hexsha stringlengths 40 40 | size int64 19 11.4M | ext stringclasses 13
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 270 | max_stars_repo_name stringlengths 5 110 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 9 | max_stars_count float64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 270 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 9 | max_issues_count float64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 270 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 9 | max_forks_count float64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 19 11.4M | avg_line_length float64 1.93 229k | max_line_length int64 12 688k | alphanum_fraction float64 0.07 0.99 | matches listlengths 1 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1db4e61de4c1a7e1dd0283a3eab5da5dba535c29 | 6,522 | hpp | C++ | Tests/FixedBGProcaConstraintCheck/FixedBGProcaFieldTest.impl.hpp | Scientistwang/GRChombo_Zipeng | cd7aeb9ce0d67422e769b9c2072afafb0b9a2659 | [
"BSD-3-Clause"
] | null | null | null | Tests/FixedBGProcaConstraintCheck/FixedBGProcaFieldTest.impl.hpp | Scientistwang/GRChombo_Zipeng | cd7aeb9ce0d67422e769b9c2072afafb0b9a2659 | [
"BSD-3-Clause"
] | null | null | null | Tests/FixedBGProcaConstraintCheck/FixedBGProcaFieldTest.impl.hpp | Scientistwang/GRChombo_Zipeng | cd7aeb9ce0d67422e769b9c2072afafb0b9a2659 | [
"BSD-3-Clause"
] | null | null | null | /* GRChombo
* Copyright 2012 The GRChombo collaboration.
* Please refer to LICENSE in GRChombo's root directory.
*/
#if !defined(FIXEDBGPROCAFIELDTEST_HPP_)
#error "This file should only be included through FixedBGProcaFieldTest.hpp"
#endif
#ifndef FIXEDBGPROCAFIELDTEST_IMPL_HPP_
#define FIXEDBGPROCAFIELDTEST_IMPL_HPP_
// Calculate the stress energy tensor elements
template <class potential_t>
template <class data_t, template <typename> class vars_t>
emtensor_t<data_t> FixedBGProcaFieldTest<potential_t>::compute_emtensor(
const vars_t<data_t> &vars, const MetricVars<data_t> &metric_vars,
const vars_t<Tensor<1, data_t>> &d1, const Tensor<2, data_t> &gamma_UU,
const Tensor<3, data_t> &chris_phys_ULL) const
{
emtensor_t<data_t> out;
// Some useful quantities
const double msquared = pow(m_potential.m_params.mass, 2.0);
// D_i A_j
Tensor<2, data_t> DA;
FOR2(i, j)
{
DA[i][j] = d1.Avec[j][i];
FOR1(k) { DA[i][j] += -chris_phys_ULL[k][i][j] * vars.Avec[k]; }
}
// D_i A_j - D_j A_i (NB exterior derivative, so christoffel symbols cancel)
Tensor<2, data_t> diff_DA;
FOR2(i, j) { diff_DA[i][j] = d1.Avec[j][i] - d1.Avec[i][j]; }
// Calculate components of EM Tensor
// S_ij = T_ij
FOR2(i, j)
{
out.Sij[i][j] =
msquared * (vars.Avec[i] * vars.Avec[j] +
0.5 * metric_vars.gamma[i][j] * vars.phi * vars.phi);
FOR2(k, l)
{
out.Sij[i][j] += gamma_UU[k][l] * (diff_DA[i][k] * diff_DA[j][l]) -
metric_vars.gamma[i][k] * metric_vars.gamma[j][l] *
vars.Evec[k] * vars.Evec[l] +
0.5 * metric_vars.gamma[k][l] *
metric_vars.gamma[i][j] * vars.Evec[k] *
vars.Evec[l] -
0.5 * gamma_UU[k][l] * metric_vars.gamma[i][j] *
msquared * vars.Avec[k] * vars.Avec[l];
FOR2(m, n)
{
out.Sij[i][j] += -0.5 * metric_vars.gamma[i][j] *
gamma_UU[k][m] * gamma_UU[l][n] * DA[k][l] *
diff_DA[m][n];
}
}
}
// S = Tr_S_ij
out.S = 0.0;
FOR2(i, j) { out.S += out.Sij[i][j] * gamma_UU[i][j]; }
// S_i (note lower index) = n^a T_a0
FOR1(i)
{
out.Si[i] = msquared * vars.phi * vars.Avec[i];
FOR1(j) { out.Si[i] += vars.Evec[j] * diff_DA[i][j]; }
}
// rho = n^a n^b T_ab
out.rho = 0.5 * msquared * (vars.phi * vars.phi);
FOR2(i, j)
{
out.rho +=
0.5 * metric_vars.gamma[i][j] * vars.Evec[i] * vars.Evec[j] +
0.5 * gamma_UU[i][j] * msquared * vars.Avec[i] * vars.Avec[j];
FOR2(k, l)
{
out.rho += 0.5 * gamma_UU[i][k] * gamma_UU[j][l] * DA[k][l] *
diff_DA[i][j];
}
}
return out;
}
// Adds VF evolution to the RHS
template <class potential_t>
template <class data_t, template <typename> class vars_t,
template <typename> class diff2_vars_t,
template <typename> class rhs_vars_t>
void FixedBGProcaFieldTest<potential_t>::matter_rhs(
rhs_vars_t<data_t> &total_rhs, const vars_t<data_t> &vars,
const MetricVars<data_t> &metric_vars, const vars_t<Tensor<1, data_t>> &d1,
const diff2_vars_t<Tensor<2, data_t>> &d2,
const vars_t<data_t> &advec,
const Coordinates<data_t> &coords) const
{
// calculate full spatial christoffel symbols
using namespace TensorAlgebra;
const auto gamma_UU = compute_inverse(metric_vars.gamma);
const auto chris_phys = compute_christoffel(metric_vars.d1_gamma, gamma_UU);
// compute terms which are affected by potential
// dphidt = phi time derivative excluding shift advection terms
// dVdA = mu^2 ( 1 + 4 c4 (A^k A_k - phi^2))
data_t dVdA = 0;
data_t dphidt = 0;
m_potential.compute_potential(dVdA, dphidt, coords, vars, d1, metric_vars);
// evolution equations for vector fields phi, A_i (note indices down) and
// the conjugate momentum E^i (index up)
total_rhs.phi = dphidt + advec.phi;
FOR1(i)
{
total_rhs.Avec[i] = -metric_vars.lapse * d1.phi[i] -
vars.phi * metric_vars.d1_lapse[i] + advec.Avec[i];
FOR1(j)
{
total_rhs.Avec[i] +=
-metric_vars.lapse * metric_vars.gamma[i][j] * vars.Evec[j] +
vars.Avec[j] * metric_vars.d1_shift[j][i];
}
}
// variable for term (D_i A_j - D_j A_i)
// NB Christoffel symbols cancel and take care with
// indices - the second index is the derivative index
Tensor<2, data_t> diff_DA;
FOR2(i, j) { diff_DA[i][j] = d1.Avec[j][i] - d1.Avec[i][j]; }
// NB This is for E^i with indices up
FOR1(i)
{
total_rhs.Evec[i] =
metric_vars.lapse * metric_vars.K * vars.Evec[i] + advec.Evec[i];
FOR1(j)
{
// dVdA = mu^2 ( 1 + 4 c4 (A^k A_k - phi^2))
total_rhs.Evec[i] +=
gamma_UU[i][j] * (metric_vars.lapse * d1.Z[j] +
metric_vars.lapse * dVdA * vars.Avec[j]) -
vars.Evec[j] * metric_vars.d1_shift[i][j];
}
FOR3(j, k, l)
{
total_rhs.Evec[i] +=
gamma_UU[k][j] * gamma_UU[i][l] *
(metric_vars.d1_lapse[k] * diff_DA[l][j] +
metric_vars.lapse * (d2.Avec[j][l][k] - d2.Avec[l][j][k]));
FOR1(m)
{
total_rhs.Evec[i] += -gamma_UU[k][j] * gamma_UU[i][l] *
metric_vars.lapse *
(chris_phys.ULL[m][k][l] * diff_DA[m][j] +
chris_phys.ULL[m][k][j] * diff_DA[l][m]);
}
}
}
// evolution equation for the damping term Z
// dVdA = mu^2 ( 1 + 4 c4 A^k A_k - 12 c4 phi^2)
// (ie the second part of the constraint, eqn 27)
total_rhs.Z =
metric_vars.lapse * (dVdA * vars.phi - m_vector_damping * vars.Z) +
advec.Z;
FOR1(i)
{
total_rhs.Z += metric_vars.lapse * d1.Evec[i][i];
FOR1(j)
{
total_rhs.Z +=
metric_vars.lapse * chris_phys.ULL[i][i][j] * vars.Evec[j];
}
}
}
#endif /* FIXEDBGPROCAFIELDTEST_IMPL_HPP_ */
| 34.146597 | 80 | 0.533119 | [
"vector"
] |
1db82800cb8a02dcbe83242bde57f7e3213eaa0a | 11,177 | cc | C++ | onnxruntime/core/providers/openvino/backend_manager.cc | jgbradley1/onnxruntime | 6c26e521346a246cdcd109412b0bc41a49cfafd0 | [
"MIT"
] | 1 | 2020-10-21T11:54:26.000Z | 2020-10-21T11:54:26.000Z | onnxruntime/core/providers/openvino/backend_manager.cc | jgbradley1/onnxruntime | 6c26e521346a246cdcd109412b0bc41a49cfafd0 | [
"MIT"
] | null | null | null | onnxruntime/core/providers/openvino/backend_manager.cc | jgbradley1/onnxruntime | 6c26e521346a246cdcd109412b0bc41a49cfafd0 | [
"MIT"
] | 1 | 2020-09-11T02:23:48.000Z | 2020-09-11T02:23:48.000Z | // Copyright(C) 2019 Intel Corporation
// Licensed under the MIT License
#include <inference_engine.hpp>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include "core/graph/graph.h"
#include "core/graph/model.h"
#include "core/platform/env.h"
#include "contexts.h"
#include "backend_manager.h"
#include "ibackend.h"
#include "backend_utils.h"
namespace onnxruntime {
namespace openvino_ep {
GlobalContext& BackendManager::GetGlobalContext() {
static GlobalContext global_context;
return global_context;
}
BackendManager::BackendManager(const onnxruntime::Node* fused_node, const logging::Logger& logger,
std::string dev_id, std::string prec_str) {
subgraph_context_.device_id = dev_id;
subgraph_context_.precision_str = prec_str;
if (prec_str == "FP32") {
subgraph_context_.precision = InferenceEngine::Precision::FP32;
} else if (prec_str == "FP16") {
subgraph_context_.precision = InferenceEngine::Precision::FP16;
} else {
ORT_THROW("Invalid OpenVINO Precision type: " + prec_str);
}
// Save the indexes of graph inputs among fused_node's inputDefs
// (which also contains initializers).
#if (defined OPENVINO_2020_2) || (defined OPENVINO_2020_3)
std::map<std::string, int> inputdef_index_map;
#endif
auto node_input_defs = fused_node->InputDefs();
int i = 0;
for (auto idef : node_input_defs) {
#if (defined OPENVINO_2020_2) || (defined OPENVINO_2020_3)
inputdef_index_map.insert({idef->Name(), i});
#else
subgraph_context_.input_names.insert({idef->Name(), i});
#endif
i++;
}
auto graph_inputs = fused_node->GetFunctionBody()->Body().GetInputs();
for (auto input : graph_inputs) {
if(subgraph_context_.device_id == "MYRIAD"){
auto shape = input->Shape();
if(shape != nullptr){
if(shape->dim_size() != 4){
subgraph_context_.set_vpu_config = true;
}
}
}
#if (defined OPENVINO_2020_2) || (defined OPENVINO_2020_3)
auto it = inputdef_index_map.find(input->Name());
if (it == inputdef_index_map.end()) {
ORT_THROW("Input not found in the input defs list");
}
int index = it->second;
subgraph_context_.input_indexes.push_back(index);
#endif
}
auto graph_outputs_defs = fused_node->OutputDefs();
i = 0;
for (auto output_def : graph_outputs_defs) {
subgraph_context_.output_names.insert({output_def->Name(), i});
i++;
}
subgraph_context_.subgraph_name = fused_node->Name();
model_proto_ = GetModelProtoFromFusedNode(fused_node, logger);
if (ModelHasBatchedInputs(model_proto_) &&
GetGlobalContext().is_wholly_supported_graph &&
subgraph_context_.device_id == "HDDL") {
subgraph_context_.enable_batching = true;
LOGS_DEFAULT(INFO) << "[OpenVINO-EP] Model can be Batch inferenced \n";
auto model_copy = ReWriteBatchDimWithOne(model_proto_);
concrete_backend_ = BackendFactory::MakeBackend(*model_copy, GetGlobalContext(), subgraph_context_);
subgraph_context_.has_dynamic_input_shape = false;
} else if (ModelHasSymbolicInputDims(fused_node)) {
LOGS_DEFAULT(INFO) << "[OpenVINO-EP] Model has symbolic input dims. Defering backend initialization";
subgraph_context_.has_dynamic_input_shape = true;
} else {
LOGS_DEFAULT(INFO) << "[OpenVINO-EP] Model has concreate input dims. Initializing backend for graph " << subgraph_context_.subgraph_name;
subgraph_context_.has_dynamic_input_shape = false;
concrete_backend_ = BackendFactory::MakeBackend(model_proto_, GetGlobalContext(), subgraph_context_);
}
}
bool BackendManager::ModelHasBatchedInputs(const ONNX_NAMESPACE::ModelProto& model_proto) const {
bool has_batched_inputs = true;
#if (defined OPENVINO_2020_2) || (defined OPENVINO_2020_3)
for (int i = 0; i < (int)subgraph_context_.input_indexes.size(); i++) {
auto input = model_proto.graph().input(subgraph_context_.input_indexes[i]);
#else
for (auto input_info_iter = subgraph_context_.input_names.begin();
input_info_iter != subgraph_context_.input_names.end(); ++input_info_iter) {
auto input = model_proto.graph().input(input_info_iter->second);
#endif
// Batch-process only raw image inputs (NCHW or NHWC layouts)
auto shape = input.type().tensor_type().shape();
if (shape.dim_size() != 4) {
has_batched_inputs = false;
break;
}
if (shape.dim(0).value_case() == shape.dim(0).kDimValue) {
has_batched_inputs = false;
break;
}
for (int index = 1; index < 4; index++) {
if (shape.dim(index).value_case() != shape.dim(0).kDimValue) {
has_batched_inputs = false;
break;
}
}
if (!has_batched_inputs) {
break;
}
}
return has_batched_inputs;
}
#ifndef NDEBUG
//Save ONNX Model
static common::Status SaveModel(ONNX_NAMESPACE::ModelProto& model_proto,
const std::string& file_path) {
int fd;
Status status = Env::Default().FileOpenWr(file_path, fd);
google::protobuf::io::FileOutputStream output(fd);
const bool result = model_proto.SerializeToZeroCopyStream(&output) && output.Flush();
if (result)
return Status::OK();
else
return Status::OK();
}
#endif
bool BackendManager::ModelHasSymbolicInputDims(const onnxruntime::Node* fused_node) const {
bool has_sym_dims = false;
auto graph_inputs = fused_node->GetFunctionBody()->Body().GetInputs();
for (auto input : graph_inputs) {
if (input->Shape() == nullptr) {
has_sym_dims = true;
break;
}
for (auto dim : input->Shape()->dim()) {
if (dim.value_case() != dim.kDimValue) {
has_sym_dims = true;
break;
}
}
if (has_sym_dims) {
break;
}
}
return has_sym_dims;
}
ONNX_NAMESPACE::ModelProto
BackendManager::GetModelProtoFromFusedNode(const onnxruntime::Node* fused_node,
const logging::Logger& logger) const {
const auto* node_function = fused_node->GetFunctionBody();
const std::string& name = fused_node->Name();
ORT_ENFORCE(node_function != nullptr, "Could not extract function body for node: ", name);
const onnxruntime::Graph& node_subgraph = node_function->Body();
onnxruntime::Model model(node_subgraph.Name(), true, ModelMetaData{}, onnxruntime::ToPathString(""),
IOnnxRuntimeOpSchemaRegistryList{}, node_subgraph.DomainToVersionMap(),
std::vector<ONNX_NAMESPACE::FunctionProto>(), logger);
ONNX_NAMESPACE::ModelProto model_proto = model.ToProto();
model_proto.set_ir_version(ONNX_NAMESPACE::Version::IR_VERSION);
*(model_proto.mutable_graph()) = node_subgraph.ToGraphProto();
#ifndef NDEBUG
if (openvino_ep::backend_utils::IsDebugEnabled()) {
SaveModel(model_proto, name + ".onnx");
}
#endif
return model_proto;
}
std::vector<std::vector<int64_t>> GetInputTensorShapes(Ort::CustomOpApi& api,
OrtKernelContext* context) {
std::vector<std::vector<int64_t>> input_shapes;
for (size_t i = 0; i < api.KernelContext_GetInputCount(context); i++) {
auto input_tensor = api.KernelContext_GetInput(context, i);
auto tensor_info = api.GetTensorTypeAndShape(input_tensor);
auto tensor_shape = api.GetTensorShape(tensor_info);
input_shapes.push_back(tensor_shape);
api.ReleaseTensorTypeAndShapeInfo(tensor_info);
}
return input_shapes;
}
std::string MakeMapKeyString(std::vector<std::vector<int64_t>>& shapes,
std::string& device_id) {
std::string key;
key += device_id;
key += "|"; //separator
for (auto shape : shapes) {
for (auto dim : shape) {
std::ostringstream o;
o << dim;
key += o.str();
key += ",";
}
key += "|";
}
return key;
}
std::shared_ptr<ONNX_NAMESPACE::ModelProto>
BackendManager::ReWriteInputShapeInfo(const ONNX_NAMESPACE::ModelProto& model_proto,
std::vector<std::vector<int64_t>> input_shapes) {
auto model_copy = std::make_shared<ONNX_NAMESPACE::ModelProto>();
std::string proto_str;
model_proto.SerializeToString(&proto_str);
model_copy->ParseFromString(proto_str);
auto graph_proto = model_copy->mutable_graph();
for (size_t i = 0; i < input_shapes.size(); i++) {
auto g_in_shape = graph_proto->mutable_input((int)i)->mutable_type()->mutable_tensor_type()->mutable_shape();
g_in_shape->clear_dim();
auto shape = input_shapes[i];
for (size_t dim = 0; dim < shape.size(); dim++) {
g_in_shape->add_dim()->set_dim_value(shape[dim]);
}
}
return model_copy;
}
std::shared_ptr<ONNX_NAMESPACE::ModelProto>
BackendManager::ReWriteBatchDimWithOne(const ONNX_NAMESPACE::ModelProto& model_proto) {
auto model_copy = std::make_shared<ONNX_NAMESPACE::ModelProto>();
std::string proto_str;
model_proto.SerializeToString(&proto_str);
model_copy->ParseFromString(proto_str);
auto graph_proto = model_copy->mutable_graph();
for (int i = 0; i < graph_proto->input_size(); i++) {
ONNX_NAMESPACE::TensorShapeProto* g_in_shape = graph_proto->mutable_input((int)i)->mutable_type()->mutable_tensor_type()->mutable_shape();
g_in_shape->mutable_dim(0)->clear_dim_value();
g_in_shape->mutable_dim(0)->set_dim_value(1);
}
return model_copy;
}
void BackendManager::Compute(Ort::CustomOpApi api, OrtKernelContext* context) {
if (subgraph_context_.has_dynamic_input_shape) {
std::vector<std::vector<int64_t>> tensor_shapes = GetInputTensorShapes(api, context);
auto key = MakeMapKeyString(tensor_shapes, subgraph_context_.device_id);
if(subgraph_context_.device_id == "MYRIAD"){
#if (defined OPENVINO_2020_2) || (defined OPENVINO_2020_3)
for(size_t i = 0; i < subgraph_context_.input_indexes.size(); i++){
if(tensor_shapes[i].size() != 4)
#else
for (auto input_info_iter = subgraph_context_.input_names.begin();
input_info_iter != subgraph_context_.input_names.end(); ++input_info_iter) {
if(tensor_shapes[input_info_iter->second].size() != 4)
#endif
subgraph_context_.set_vpu_config = true;
}
}
std::shared_ptr<IBackend> dynamic_backend;
auto search = backend_map_.find(key);
if (search == backend_map_.end()) {
LOGS_DEFAULT(INFO) << "[OpenVINO-EP] "
<< "Creating concrete backend for key: " << key;
LOGS_DEFAULT(INFO) << "[OpenVINO-EP] "
<< "Backend created for graph " << subgraph_context_.subgraph_name;
auto modelproto_with_concrete_shapes = ReWriteInputShapeInfo(model_proto_, tensor_shapes);
dynamic_backend = BackendFactory::MakeBackend(*modelproto_with_concrete_shapes,
GetGlobalContext(), subgraph_context_);
backend_map_.insert({key, dynamic_backend});
} else {
dynamic_backend = search->second;
}
dynamic_backend->Infer(api, context);
} else {
concrete_backend_->Infer(api, context);
}
}
void BackendManager::ShutdownBackendManager() {
}
} // namespace openvino_ep
} // namespace onnxruntime | 35.823718 | 142 | 0.682741 | [
"shape",
"vector",
"model"
] |
1dc086f1cfaf77f6818b3e640ada953f795a58fd | 3,128 | cpp | C++ | SIPL-Example/example.cpp | kayarre/VoxelModelingClass | 2651459d19ecdb96641f803713e500abd72ffe88 | [
"Unlicense"
] | null | null | null | SIPL-Example/example.cpp | kayarre/VoxelModelingClass | 2651459d19ecdb96641f803713e500abd72ffe88 | [
"Unlicense"
] | null | null | null | SIPL-Example/example.cpp | kayarre/VoxelModelingClass | 2651459d19ecdb96641f803713e500abd72ffe88 | [
"Unlicense"
] | null | null | null | #include "SIPL/Core.hpp"
#include "SIPL/Visualization.hpp"
//using namespace SIPL;
int main(int argc, char ** argv) {
// Load image from disk and display it
/*
SIPL::Image<SIPL::color_uchar> * im = new SIPL::Image<SIPL::color_uchar>("images/sunset.jpg");
im->display();
// Remove all the green from the color image im
for(int i = 0; i < im->getTotalSize(); i++) {
SIPL::color_uchar p = im->get(i);
p.green = 0;
im->set(i, p);
}
im->display();
// Save it
im->save("test.png", "png");
// Convert image to grayscale and display it
SIPL::Image<float> * im2 = new SIPL::Image<float>(im, SIPL::IntensityTransformation(SIPL::NORMALIZED));
// View the image using a custom level(0.5) and window(0.25)
im2->display(0.5, 0.25);
// Calculate the gradient of the image and display the vector field using colors
SIPL::Image<SIPL::float2> * gradient = new SIPL::Image<SIPL::float2>(im2->getWidth(), im2->getHeight());
SIPL::Visualization * w = new SIPL::Visualization(gradient);
w->display();
w->setWindow(0.4);
w->setLevel(0.2);
for(int x = 1; x < im2->getWidth()-1; x++) {
for(int y = 1; y < im2->getHeight()-1; y++) {
SIPL::float2 vector;
vector.x = 0.5*(im2->get(x+1,y)-im2->get(x-1,y));
vector.y = 0.5*(im2->get(x,y+1)-im2->get(x,y-1));
gradient->set(x,y,vector);
}
if(x % 20 == 0)
w->update(); // update the image on screen
}
*/
// Load volume and display one slice on the screen
// (Use arrow keys up and down to change the slice on screen)
SIPL::Volume<SIPL::uchar> * v = new SIPL::Volume<SIPL::uchar>("skull.raw", 256, 256, 256);
v->setSpacing(SIPL::float3(0.5,1.0,0.5));
SIPL::Visualization * vis2 = new SIPL::Visualization(v);
//vis2->setType(SIPL::MIP);
vis2->setLevel(100);
vis2->setWindow(200);
vis2->setTitle("Head skull CT");
vis2->display();
//v->display();
/*
v->display(100, SIPL::X);
v->display(100, SIPL::Y, 60, 100);
v->display(60, 100);
// Create and show maximum intensity projection (MIP) of the volume
v->displayMIP();
v->displayMIP(SIPL::Y, 60, 100);
*/
// Convert volume to another data type
SIPL::Volume<float> * v2 = new SIPL::Volume<float>(v, SIPL::IntensityTransformation(SIPL::NORMALIZED));
// Calculate 3D gradient of the volume
SIPL::Volume<SIPL::float3> * vGradient = new SIPL::Volume<SIPL::float3>(v->getWidth(), v->getHeight(), v->getDepth());
for(int x = 1; x < v->getWidth()-1; x++) {
for(int y = 1; y < v->getHeight()-1; y++) {
for(int z = 1; z < v->getDepth()-1; z++) {
SIPL::float3 vector;
vector.x = 0.5*(v2->get(x+1,y,z)-v2->get(x-1,y,z));
vector.y = 0.5*(v2->get(x,y+1,z)-v2->get(x,y-1,z));
vector.z = 0.5*(v2->get(x,y,z+1)-v2->get(x,y,z-1));
vGradient->set(x,y,z,vector);
}
}
}
vGradient->display();
vGradient->save("testout.raw");
}
| 35.146067 | 122 | 0.557545 | [
"vector",
"3d"
] |
1dc36119f5e3db22c3c1e5e459f4ef1c7b0c0f17 | 6,964 | cpp | C++ | src/copentimelineio/markerRetainerVector.cpp | hisergiorojas/OpenTimelineIO-C-Bindings | 78e52d9d9f0f03adc04e586655bb2a4151b541be | [
"Apache-2.0"
] | 1 | 2022-02-03T02:49:00.000Z | 2022-02-03T02:49:00.000Z | src/copentimelineio/markerRetainerVector.cpp | hisergiorojas/OpenTimelineIO-C-Bindings | 78e52d9d9f0f03adc04e586655bb2a4151b541be | [
"Apache-2.0"
] | 32 | 2021-07-26T00:42:57.000Z | 2022-03-28T00:29:39.000Z | src/copentimelineio/markerRetainerVector.cpp | hisergiorojas/OpenTimelineIO-C-Bindings | 78e52d9d9f0f03adc04e586655bb2a4151b541be | [
"Apache-2.0"
] | 4 | 2021-02-10T18:28:25.000Z | 2022-03-18T03:14:47.000Z | #include "copentimelineio/markerRetainerVector.h"
#include <opentimelineio/marker.h>
#include <vector>
typedef std::vector<OTIO_NS::Marker::Retainer<OTIO_NS::Marker>>
MarkerRetainerVectorDef;
typedef std::vector<OTIO_NS::Marker::Retainer<OTIO_NS::Marker>>::iterator
MarkerRetainerVectorIteratorDef;
typedef OTIO_NS::SerializableObject::Retainer<OTIO_NS::Marker> MarkerRetainer;
OTIO_API MarkerRetainerVector *MarkerRetainerVector_create() {
return reinterpret_cast<MarkerRetainerVector *>(
new MarkerRetainerVectorDef());
}
OTIO_API void MarkerRetainerVector_destroy(MarkerRetainerVector *self) {
delete reinterpret_cast<MarkerRetainerVectorDef *>(self);
}
OTIO_API MarkerRetainerVectorIterator *
MarkerRetainerVector_begin(MarkerRetainerVector *self) {
MarkerRetainerVectorIteratorDef iter =
reinterpret_cast<MarkerRetainerVectorDef *>(self)->begin();
return reinterpret_cast<MarkerRetainerVectorIterator *>(
new MarkerRetainerVectorIteratorDef(iter));
}
OTIO_API MarkerRetainerVectorIterator *
MarkerRetainerVector_end(MarkerRetainerVector *self) {
MarkerRetainerVectorIteratorDef iter =
reinterpret_cast<MarkerRetainerVectorDef *>(self)->end();
return reinterpret_cast<MarkerRetainerVectorIterator *>(
new MarkerRetainerVectorIteratorDef(iter));
}
OTIO_API int MarkerRetainerVector_size(MarkerRetainerVector *self) {
return reinterpret_cast<MarkerRetainerVectorDef *>(self)->size();
}
OTIO_API int MarkerRetainerVector_max_size(MarkerRetainerVector *self) {
return reinterpret_cast<MarkerRetainerVectorDef *>(self)->max_size();
}
OTIO_API int MarkerRetainerVector_capacity(MarkerRetainerVector *self) {
return reinterpret_cast<MarkerRetainerVectorDef *>(self)->capacity();
}
OTIO_API void MarkerRetainerVector_resize(MarkerRetainerVector *self, int n) {
reinterpret_cast<MarkerRetainerVectorDef *>(self)->resize(n);
}
OTIO_API bool MarkerRetainerVector_empty(MarkerRetainerVector *self) {
return reinterpret_cast<MarkerRetainerVectorDef *>(self)->empty();
}
OTIO_API void MarkerRetainerVector_shrink_to_fit(MarkerRetainerVector *self) {
reinterpret_cast<MarkerRetainerVectorDef *>(self)->shrink_to_fit();
}
OTIO_API void MarkerRetainerVector_reserve(MarkerRetainerVector *self, int n) {
reinterpret_cast<MarkerRetainerVectorDef *>(self)->reserve(n);
}
OTIO_API void MarkerRetainerVector_swap(
MarkerRetainerVector *self, MarkerRetainerVector *other) {
reinterpret_cast<MarkerRetainerVectorDef *>(self)->swap(
*reinterpret_cast<MarkerRetainerVectorDef *>(other));
}
OTIO_API RetainerMarker *MarkerRetainerVector_at(MarkerRetainerVector *self, int pos) {
MarkerRetainer obj =
reinterpret_cast<MarkerRetainerVectorDef *>(self)->at(pos);
return reinterpret_cast<RetainerMarker *>(new MarkerRetainer(obj));
}
OTIO_API void MarkerRetainerVector_push_back(
MarkerRetainerVector *self, RetainerMarker *value) {
reinterpret_cast<MarkerRetainerVectorDef *>(self)->push_back(
*reinterpret_cast<MarkerRetainer *>(value));
}
OTIO_API void MarkerRetainerVector_pop_back(MarkerRetainerVector *self) {
reinterpret_cast<MarkerRetainerVectorDef *>(self)->pop_back();
}
OTIO_API MarkerRetainerVectorIterator *MarkerRetainerVector_insert(
MarkerRetainerVector *self,
MarkerRetainerVectorIterator *pos,
RetainerMarker *val) {
MarkerRetainerVectorIteratorDef iter =
reinterpret_cast<MarkerRetainerVectorDef *>(self)->insert(
*reinterpret_cast<MarkerRetainerVectorIteratorDef *>(pos),
*reinterpret_cast<MarkerRetainer *>(val));
return reinterpret_cast<MarkerRetainerVectorIterator *>(
new MarkerRetainerVectorIteratorDef(iter));
}
OTIO_API void MarkerRetainerVector_clear(MarkerRetainerVector *self) {
reinterpret_cast<MarkerRetainerVectorDef *>(self)->clear();
}
OTIO_API MarkerRetainerVectorIterator *MarkerRetainerVector_erase(
MarkerRetainerVector *self, MarkerRetainerVectorIterator *pos) {
MarkerRetainerVectorIteratorDef iter =
reinterpret_cast<MarkerRetainerVectorDef *>(self)->erase(
*reinterpret_cast<MarkerRetainerVectorIteratorDef *>(pos));
return reinterpret_cast<MarkerRetainerVectorIterator *>(
new MarkerRetainerVectorIteratorDef(iter));
}
OTIO_API MarkerRetainerVectorIterator *MarkerRetainerVector_erase_range(
MarkerRetainerVector *self,
MarkerRetainerVectorIterator *first,
MarkerRetainerVectorIterator *last) {
MarkerRetainerVectorIteratorDef iter =
reinterpret_cast<MarkerRetainerVectorDef *>(self)->erase(
*reinterpret_cast<MarkerRetainerVectorIteratorDef *>(first),
*reinterpret_cast<MarkerRetainerVectorIteratorDef *>(last));
return reinterpret_cast<MarkerRetainerVectorIterator *>(
new MarkerRetainerVectorIteratorDef(iter));
}
OTIO_API void MarkerRetainerVectorIterator_advance(
MarkerRetainerVectorIterator *iter, int dist) {
std::advance(
*reinterpret_cast<MarkerRetainerVectorIteratorDef *>(iter), dist);
}
OTIO_API MarkerRetainerVectorIterator *MarkerRetainerVectorIterator_next(
MarkerRetainerVectorIterator *iter, int dist) {
MarkerRetainerVectorIteratorDef it = std::next(
*reinterpret_cast<MarkerRetainerVectorIteratorDef *>(iter), dist);
return reinterpret_cast<MarkerRetainerVectorIterator *>(
new MarkerRetainerVectorIteratorDef(it));
}
OTIO_API MarkerRetainerVectorIterator *MarkerRetainerVectorIterator_prev(
MarkerRetainerVectorIterator *iter, int dist) {
MarkerRetainerVectorIteratorDef it = std::prev(
*reinterpret_cast<MarkerRetainerVectorIteratorDef *>(iter), dist);
return reinterpret_cast<MarkerRetainerVectorIterator *>(
new MarkerRetainerVectorIteratorDef(it));
}
OTIO_API RetainerMarker *
MarkerRetainerVectorIterator_value(MarkerRetainerVectorIterator *iter) {
MarkerRetainer obj =
**reinterpret_cast<MarkerRetainerVectorIteratorDef *>(iter);
return reinterpret_cast<RetainerMarker *>(new MarkerRetainer(obj));
}
OTIO_API bool MarkerRetainerVectorIterator_equal(
MarkerRetainerVectorIterator *lhs, MarkerRetainerVectorIterator *rhs) {
return *reinterpret_cast<MarkerRetainerVectorIteratorDef *>(lhs) ==
*reinterpret_cast<MarkerRetainerVectorIteratorDef *>(rhs);
}
OTIO_API bool MarkerRetainerVectorIterator_not_equal(
MarkerRetainerVectorIterator *lhs, MarkerRetainerVectorIterator *rhs) {
return *reinterpret_cast<MarkerRetainerVectorIteratorDef *>(lhs) !=
*reinterpret_cast<MarkerRetainerVectorIteratorDef *>(rhs);
}
OTIO_API void
MarkerRetainerVectorIterator_destroy(MarkerRetainerVectorIterator *self) {
delete reinterpret_cast<MarkerRetainerVectorIteratorDef *>(self);
}
| 41.452381 | 87 | 0.765796 | [
"vector"
] |
1dc7007dabb80ad31ac3cc69ffe82bcd11ea35af | 1,366 | cpp | C++ | cc_nov_long/ALEXTASK-Again.cpp | nileshleve/CompCoding | e082533e57c9d6aa55845d733e6f5ff7d99ea057 | [
"MIT"
] | null | null | null | cc_nov_long/ALEXTASK-Again.cpp | nileshleve/CompCoding | e082533e57c9d6aa55845d733e6f5ff7d99ea057 | [
"MIT"
] | null | null | null | cc_nov_long/ALEXTASK-Again.cpp | nileshleve/CompCoding | e082533e57c9d6aa55845d733e6f5ff7d99ea057 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b)
{
if (b == 0)
return a;
else
return gcd(b, a%b);
}
long long int lcm(long long int a, long long int b)
{
return (a*b)/gcd(a,b);
}
int main()
{
long long int t;
cin>>t;
while(t-- > 0){
long long int n;
cin>>n;
long long int a[n];
set<long long int> s;
vector<long long int> vec;
for (long long int i = 0; i < n; ++i)
{
cin>>a[i];
if(s.find(a[i]) == s.end()){
s.insert(a[i]);
}
else{
s.insert(a[i]);
vec.push_back(a[i]);
}
}
sort(a, a+n);
for (long long int i = 0; i < n; ++i)
{
for (long long int j = i+1; j < n; ++j)
{
if(a[j] % a[i] == 0){
vec.push_back(a[j]);
}
}
}
long long int min = INT_MAX;
long long int ans = 0;
vector<long long int>::iterator it;
for (it = vec.begin(); it != vec.end(); ++it)
{
if(min > *it){
min = *it;
}
}
ans = min;
if(ans == INT_MAX || ans == 0){
ans = lcm(a[0], a[1]);
}
long long int i = 0;
long long int temp = ans;
long long int lt = ans;
while(a[i] < lt && i < n - 1){
temp = lcm(a[i], a[i+1]);
if(temp < ans)
ans = temp;
i++;
}
cout<<ans<<endl;
}
return 0;
}
//Following test case fails
//1
//4
//97 98 99 100 | 17.291139 | 52 | 0.477306 | [
"vector"
] |
1dcd3ed28674e457efd5c25f8c46ca82f2d4e15d | 1,211 | hpp | C++ | lib/separating_family.hpp | praseodym/Yannakakis | 804944662d9323af9a95f370929e70b99ac07d4c | [
"MIT"
] | 1 | 2020-04-21T23:43:02.000Z | 2020-04-21T23:43:02.000Z | lib/separating_family.hpp | praseodym/Yannakakis | 804944662d9323af9a95f370929e70b99ac07d4c | [
"MIT"
] | null | null | null | lib/separating_family.hpp | praseodym/Yannakakis | 804944662d9323af9a95f370929e70b99ac07d4c | [
"MIT"
] | null | null | null | #pragma once
#include "types.hpp"
struct adaptive_distinguishing_sequence;
struct splitting_tree;
/// \brief From the LY algorithm we generate a separating family
/// If the adaptive distinguihsing sequence is complete, then we do not need to augment the LY
/// result. If it is not complete, we augment it with sequences from the HSI-method. In both cases
/// the result is a separating family (as defined in LY).
/// \brief A set (belonging to some state) of separating sequences
/// It only has local_suffixes, as all suffixes are "harmonized", meaning that sequences share
/// prefixes among the family. With this structure we can define the HSI-method and DS-method. Our
/// method is a hybrid one. Families are always indexed by state.
struct separating_set {
std::vector<word> local_suffixes;
};
using separating_family = std::vector<separating_set>;
/// \brief Creates the separating family from the results of the LY algorithm
/// If the sequence is complete, we do not need the sequences in the splitting tree.
separating_family create_separating_family(const adaptive_distinguishing_sequence & sequence,
const splitting_tree & separating_sequences);
| 44.851852 | 98 | 0.753922 | [
"vector"
] |
1dd044742c98c1e6d80827ede7f9520d10ed619a | 9,342 | cpp | C++ | src/caffe/layers/parallel_inMem_data_layer.cpp | cc-hpc-itwm/caffeGPI | 85c57a91ec99fb1419fc281585cf54b0e3c97fb8 | [
"BSD-2-Clause"
] | 1 | 2017-09-07T07:32:29.000Z | 2017-09-07T07:32:29.000Z | src/caffe/layers/parallel_inMem_data_layer.cpp | cc-hpc-itwm/CaffeGPI | 85c57a91ec99fb1419fc281585cf54b0e3c97fb8 | [
"BSD-2-Clause"
] | null | null | null | src/caffe/layers/parallel_inMem_data_layer.cpp | cc-hpc-itwm/CaffeGPI | 85c57a91ec99fb1419fc281585cf54b0e3c97fb8 | [
"BSD-2-Clause"
] | null | null | null | #ifdef USE_OPENCV
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <fstream> // NOLINT(readability/streams)
#include <iostream> // NOLINT(readability/streams)
#include <string>
#include <utility>
#include <vector>
#include "caffe/layers/parallel_inMem_data_layer.hpp"
#include "caffe/layer.hpp"
#include "caffe/util/benchmark.hpp"
#include "caffe/util/io.hpp"
#include "caffe/util/math_functions.hpp"
#include "caffe/util/rng.hpp"
#include "caffe/util/GPIhelper.h"
namespace caffe {
template <typename Dtype>
ParallelInMemDataLayer<Dtype>::~ParallelInMemDataLayer<Dtype>() {
this->StopInternalThread();
}
template <typename Dtype>
void ParallelInMemDataLayer<Dtype>::DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
//GPI setup
gaspi_rank_t currentRank=0;
gaspi_rank_t numRanks=0;
SUCCESS_OR_DIE( gaspi_proc_rank(¤tRank));
SUCCESS_OR_DIE( gaspi_proc_num(&numRanks));
const int new_height = this->layer_param_.parallel_inmem_data_param().new_height();
const int new_width = this->layer_param_.parallel_inmem_data_param().new_width();
const bool is_color = this->layer_param_.parallel_inmem_data_param().is_color();
string root_folder = this->layer_param_.parallel_inmem_data_param().root_folder();
string labelFileName = this->layer_param_.parallel_inmem_data_param().label();
int headerSize = this->layer_param_.parallel_inmem_data_param().headersize();
const int batch_size = this->layer_param_.parallel_inmem_data_param().batch_size();
bool is_test = this->layer_param_.parallel_inmem_data_param().test();
int numChannels = 1;
if (is_color)
numChannels =3;
int imageSize=new_height*new_width*numChannels;
if (currentRank==0)
LOG(INFO) << "Opening label file " << labelFileName<<std::endl;
std::ifstream labelFile(labelFileName.c_str());
int label;
while (labelFile >> label)
Labels_.push_back(label);
labelFile.close();
const string& source = this->layer_param_.parallel_inmem_data_param().source();
if (currentRank==0)
LOG(INFO) << "Opening data file " << source<<std::endl;
//open binary
std::ifstream inFile;
inFile.open(source.c_str(), std::ios::binary);
//get bin file size
inFile.seekg(0,inFile.end);
long binFileSize = inFile.tellg();
inFile.seekg(0,inFile.beg);
if (currentRank==0)
{
LOG(INFO) << " binary size = "<< binFileSize << " target size: "<<
(headerSize+new_height*new_width*numChannels)*Labels_.size();
}
//offset for each rank
batchesGlobal_ = Labels_.size()/batch_size; //round here
batchesPerRank_ = batchesGlobal_ / numRanks; //round again
batchMemSize_ = imageSize * batch_size;
samplesPerRank_ = batchesPerRank_ * batch_size;
rankOffset_ = samplesPerRank_ * (imageSize+headerSize);
maxLabel_ = batchesPerRank_ * numRanks * batch_size;
label_id_ = currentRank*samplesPerRank_;
if (currentRank==0)
{
LOG(INFO) << " # global batches: "<< batchesGlobal_
<< ", # batches per Rank: "<< batchesPerRank_
<< ", # samples per Rank : "<< samplesPerRank_;
}
//gaspi setup
if (is_test) //use different segments for train and val data, seg 0 for solver com
segment_id_ = 2;
else
segment_id_ = 1;
qID_ = currentRank%7; //use 8 queues
//allocate global mem: n storage batches + input buffer
SUCCESS_OR_DIE(
gaspi_segment_create( segment_id_, (batchesPerRank_+1)*batchMemSize_*sizeof(uint8_t), GASPI_GROUP_ALL,
GASPI_BLOCK, GASPI_MEM_INITIALIZED)
);
//get pointer to global mem
SUCCESS_OR_DIE(
gaspi_segment_ptr (segment_id_, &segment_0_P_)
);
//get local pointer to segment
rawData_ = (uint8_t*) segment_0_P_;
//open binary
long currentOffset = (headerSize+imageSize) * label_id_*sizeof(uint8_t);
inFile.seekg(currentOffset );
//read from file
long pos=0;
for (long i = 0; i < samplesPerRank_; ++i)
{
if (i%10000==0)
std::cerr<<"Rank "<<currentRank<<": read "<<i<<" samples from file\n";
uint8_t tmp;
for (long e=0;e<headerSize;++e)
{
//read header
inFile.read(reinterpret_cast<char*>(&tmp),sizeof(uint8_t));
}
if (numChannels==1)
{
for (long e=0;e<imageSize;++e,++pos)
{
inFile.read(reinterpret_cast<char*>(&tmp),sizeof(uint8_t));
rawData_[pos]=tmp;
}
}
else //open cvs hav BGR color order!
{
uint8_t r,g,b;
for (long e=0;e<imageSize;++e,++pos)
{
inFile.read(reinterpret_cast<char*>(&r),sizeof(uint8_t));
inFile.read(reinterpret_cast<char*>(&g),sizeof(uint8_t));
inFile.read(reinterpret_cast<char*>(&b),sizeof(uint8_t));
rawData_[pos]=(Dtype)b;
pos++;e++;
rawData_[pos]=(Dtype)g;
pos++;e++;
rawData_[pos]=(Dtype)r;
}
}
}
inFile.close();
vector<int> top_shape(4);
top_shape[0]=1;
top_shape[1]=numChannels;
top_shape[2]=new_height;
top_shape[3]=new_width;
this->transformed_data_.Reshape(top_shape);
// Reshape prefetch_data and top[0] according to the batch_size.
top_shape[0] = batch_size;
for (int i = 0; i < this->prefetch_.size(); ++i) {
this->prefetch_[i]->data_.Reshape(top_shape);
}
top[0]->Reshape(top_shape);
// label
vector<int> label_shape(1, batch_size);
top[1]->Reshape(label_shape);
for (int i = 0; i < this->prefetch_.size(); ++i) {
this->prefetch_[i]->label_.Reshape(label_shape);
}
/*
label_id_ = (currentRank+1)*samplesPerRank_;
if (label_id_>=maxLabel_)
label_id_=0;
*/
}
// This function is called on prefetch thread
template <typename Dtype>
void ParallelInMemDataLayer<Dtype>::load_batch(Batch<Dtype>* batch) {
//GPI setup
CPUTimer batch_timer;
batch_timer.Start();
gaspi_rank_t currentRank=0;
gaspi_rank_t numRanks=0;
SUCCESS_OR_DIE( gaspi_proc_rank(¤tRank));
SUCCESS_OR_DIE( gaspi_proc_num(&numRanks));
CHECK(batch->data_.count());
CHECK(this->transformed_data_.count());
ParallelInMemDataParameter parallel_inmem_data_param = this->layer_param_.parallel_inmem_data_param();
const int batch_size = parallel_inmem_data_param.batch_size();
const int new_height = parallel_inmem_data_param.new_height();
const int new_width = parallel_inmem_data_param.new_width();
const bool is_color = parallel_inmem_data_param.is_color();
int numChannels = 1;
if (is_color)
numChannels =3;
int imageSize=new_height*new_width*numChannels;
vector<int> top_shape(4);
top_shape[0]=1;
top_shape[1]=numChannels;
top_shape[2]=new_height;
top_shape[3]=new_width;
this->transformed_data_.Reshape(top_shape);
// Reshape batch according to the batch_size.
top_shape[0] = batch_size;
batch->data_.Reshape(top_shape);
Dtype* prefetch_data = batch->data_.mutable_cpu_data();
Dtype* prefetch_label = batch->label_.mutable_cpu_data();
//compute rank of target batch
long batchId = label_id_ / batch_size;
gaspi_rank_t sRank = batchId / batchesPerRank_;
long sbatchId = batchId - sRank*batchesPerRank_;
long lbatchId = batchId - currentRank*batchesPerRank_;
long sOffset = sbatchId*batch_size*imageSize*sizeof(uint8_t);
//std::cout<<"BATCH "<<currentRank<<" "<<label_id_<<" "<<batchId<<" "<<sRank<<" "<<sbatchId<<" "<<std::endl;
//get local pointer to segment
rawData_ = (uint8_t*) segment_0_P_;
if (sRank == currentRank) //data is local
{
rawData_+= lbatchId*batch_size*imageSize*sizeof(uint8_t);
}
else //get data first
{
SUCCESS_OR_DIE(
gaspi_read(segment_id_, samplesPerRank_*imageSize*sizeof(uint8_t), sRank, segment_id_, sOffset,
batch_size*imageSize*sizeof(uint8_t),qID_, GASPI_BLOCK)
);
SUCCESS_OR_LOG(
gaspi_wait(qID_, GASPI_BLOCK)
);
rawData_+=samplesPerRank_*imageSize*sizeof(uint8_t);
}
// get batch
for (long item_id = 0; item_id < batch_size; ++item_id)
{
// get a blob
int offset = batch->data_.offset(item_id);
this->transformed_data_.set_cpu_data(prefetch_data + offset);
if (numChannels==1)
{
cv::Mat cv_img(new_height, new_width, CV_8UC1, rawData_);
this->data_transformer_->Transform(cv_img, &(this->transformed_data_));
}
else //open cvs hav BGR color order!
{
cv::Mat cv_img(new_height, new_width, CV_8UC3, rawData_);
/*
if(Labels_[label_id_]==10)
{
std::stringstream tmpName;
tmpName <<"/home/keuper/tmp/tmp_"<<currentRank<<"_"<<sRank<<"_"<<label_id_<<"_"<<Labels_[label_id_]<<".png";
cv::imwrite( tmpName.str(), cv_img);
}
*/
this->data_transformer_->Transform(cv_img, &(this->transformed_data_));
}
rawData_+=imageSize*sizeof(uint8_t);
prefetch_label[item_id] = Labels_[label_id_];
label_id_++;
if (label_id_ >= maxLabel_)
{
label_id_=0;
}
}
batch_timer.Stop();
if (currentRank==0)
std::cout<<"BATCH time: "<<batch_timer.MilliSeconds() << " ms."<<std::endl;
}
template <typename Dtype>
void ParallelInMemDataLayer<Dtype>::ShuffleImages() {
//empty dummy to meet enheritance conditions
}
INSTANTIATE_CLASS(ParallelInMemDataLayer);
REGISTER_LAYER_CLASS(ParallelInMemData);
} // namespace caffe
#endif // USE_OPENCV
| 29.377358 | 124 | 0.682402 | [
"vector",
"transform"
] |
1dd31163255187df6027d3db8cd946a71fed6f6a | 3,083 | cc | C++ | commands/run.cc | finiteloop/compiler | 700f5d2956d2024764f4677fc733e9e7bef70167 | [
"Apache-2.0"
] | 35 | 2020-08-24T23:24:09.000Z | 2021-12-17T17:22:21.000Z | commands/run.cc | finiteloop/compiler | 700f5d2956d2024764f4677fc733e9e7bef70167 | [
"Apache-2.0"
] | 1 | 2020-12-26T09:59:57.000Z | 2020-12-31T20:00:42.000Z | commands/run.cc | finiteloop/compiler | 700f5d2956d2024764f4677fc733e9e7bef70167 | [
"Apache-2.0"
] | 2 | 2020-12-29T06:21:09.000Z | 2021-11-19T12:43:04.000Z | // Copyright 2020 Bret Taylor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "run.h"
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/ExecutionEngine/GenericValue.h>
#include <llvm/ExecutionEngine/MCJIT.h>
#include <llvm/ExecutionEngine/SectionMemoryManager.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/Module.h>
#include <llvm/Support/TargetSelect.h>
#include <stdlib.h>
#include "../checker/check.h"
#include "../emitter/emit.h"
#include "../emitter/optimize.h"
#include "../parser/parse.h"
namespace compiler::commands {
Run::Run()
: Command("run", "Run a program",
{Option("strict", "Treat warnings as fatal errors"),
Option("unoptimized", "Do not optimize the program")},
"path") {
}
bool Run::execute(const filesystem::path& executable, map<string, bool>& flags,
map<string, string>& options, vector<string>& arguments) {
if (arguments.size() < 1) {
print_help(executable);
return false;
}
// Initialize LLVM
llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter();
// Parse the program
auto error = make_shared<Error::Terminal>();
auto fail_level = flags["strict"] ? Error::WARNING : Error::ERROR;
auto module = parser::parse(error, arguments[0]);
if (!module) {
return false;
}
// Check for correctness
auto symbols = checker::check(error, module);
if (!symbols || error->count(fail_level) > 0) {
return false;
}
// Set up the LLVM JIT engine
llvm::LLVMContext llvm_context;
auto llvm_module = new llvm::Module(arguments[0], llvm_context);
llvm::EngineBuilder factory((std::unique_ptr<llvm::Module>(llvm_module)));
if (!flags["unoptimized"]) {
llvm::TargetOptions target_options;
std::unique_ptr<llvm::RTDyldMemoryManager> memory_manager(
new llvm::SectionMemoryManager());
factory.setEngineKind(llvm::EngineKind::JIT)
.setTargetOptions(target_options)
.setMCJITMemoryManager(std::move(memory_manager));
}
string llvm_error;
auto engine = factory.setErrorStr(&llvm_error).create();
if (!engine) {
error->report(Error::Level::ERROR, llvm_error);
return false;
}
llvm_module->setDataLayout(engine->getDataLayout());
// Emit LLVM IR code
auto llvm_function = emitter::emit(module, llvm_module);
if (!llvm_function) {
return false;
}
if (!flags["unoptimized"]) {
emitter::optimize(llvm_module);
}
// Run the program
engine->finalizeObject();
engine->runFunction(llvm_function, {});
return true;
}
}
| 30.524752 | 79 | 0.693156 | [
"vector"
] |
1dd5927af8effc80a82f12d5f837305ff975597c | 3,100 | cpp | C++ | code/pcc-digrafo.cpp | gafeol/chinese-postman | 1b1dd9173ad0f58d325e0a973e2689625094df0b | [
"MIT"
] | null | null | null | code/pcc-digrafo.cpp | gafeol/chinese-postman | 1b1dd9173ad0f58d325e0a973e2689625094df0b | [
"MIT"
] | 16 | 2020-02-23T05:46:26.000Z | 2021-01-27T02:09:49.000Z | code/pcc-digrafo.cpp | gafeol/chinese-postman | 1b1dd9173ad0f58d325e0a973e2689625094df0b | [
"MIT"
] | 1 | 2020-12-11T18:26:31.000Z | 2020-12-11T18:26:31.000Z | #include "bits/stdc++.h"
using namespace std;
#include "min-cost-matching/MCM.cpp"
#include "digrafo.hpp"
#include "floyd-warshall.cpp"
#include "euler-digrafo.cpp"
#include "problema-transporte.cpp"
struct PCC {
private:
Digrafo G;
public:
vector<Aresta> expande(int ini, int fim, vector<vector<double>> &mnDist){
if(ini == fim)
return {};
vector<vector<Aresta>> &adj = G.adj;
vector<Aresta> ans;
for(Aresta ar: adj[ini]){
if(ar.cus + mnDist[ar.prox][fim] == mnDist[ini][fim]){
ans.push_back(ar);
vector<Aresta> aux = expande(ar.prox, fim, mnDist);
ans.insert(ans.end(), aux.begin(), aux.end());
return ans;
}
}
assert(false);
}
bool checkSolutionById(pair<double, vector<int>> sol) {
double cost = sol.first;
vector<int> pathId = sol.second;
double realCost = 0;
vector<tuple<int, int, double>> listaArcos = G.listaArcos();
int u = get<1>(listaArcos[pathId.back()]);
for(int id: pathId){
auto [from,to, c] = listaArcos[id];
if(u != from)
return false;
u = to;
realCost += c;
}
return (realCost == cost);
}
/// Função que resolve o PCC para digrafos.
/// Retorna um par cujo primeiro elemento é o custo da solução, enquanto que o segundo é a lista de ids dos arcos escolhidos
pair<double, vector<int>> solveById(){
vector<vector<double>> mnDist = floyd_warshall(G);
vector<int> F, S;
vector<int> dF, dS;
for(int u=0;u<G.n;u++){
int demanda = G.grauSaida[u] - G.grauEntrada[u];
if(demanda < 0){
F.push_back(u);
dF.push_back(-demanda);
}
else if(demanda > 0){
S.push_back(u);
dS.push_back(demanda);
}
}
ProblemaTransporte pt(G.n, F, dF, S, dS, mnDist);
vector<tuple<int, int, int>> f = pt.solve();
vector<tuple<int, int, double>> listaArcos = G.listaArcos();
vector<int> realId;
for(int i=0;i<(int)listaArcos.size();i++)
realId.push_back(i);
for(tuple<int, int, int> tp: f){
auto [u, v, flow] = tp;
vector<Aresta> arcos = expande(u, v, mnDist);
for (Aresta arco : arcos) {
for(int ncopias=0;ncopias<flow;ncopias++){
realId.push_back(arco.id);
listaArcos.emplace_back(u, arco.prox, arco.cus);
}
u = arco.prox;
}
}
Euler e = Euler(G.n, listaArcos);
vector<int> trilha = e.trilha_euleriana_id();
for(int i=0;i<(int)trilha.size();i++){
trilha[i] = realId[trilha[i]];
}
double custo = 0.0;
for(int id: trilha)
custo += get<2>(listaArcos[id]);
return make_pair(custo, trilha);
}
PCC(Digrafo G): G(G) {}
PCC() {}
};
| 29.807692 | 128 | 0.510645 | [
"vector"
] |
1dd5b43969efa900686a10021a85901c85e4d243 | 1,292 | cc | C++ | DRsim/src/DRsimRunAction.cc | chanchoen/eic-dual-readout | 8cea1f6df9f837c9355416ad84df33a8de2ab600 | [
"Apache-2.0"
] | 1 | 2021-04-19T02:33:00.000Z | 2021-04-19T02:33:00.000Z | DRsim/src/DRsimRunAction.cc | chanchoen/eic-dual-readout | 8cea1f6df9f837c9355416ad84df33a8de2ab600 | [
"Apache-2.0"
] | 1 | 2021-04-16T05:37:08.000Z | 2021-07-21T12:05:07.000Z | DRsim/src/DRsimRunAction.cc | chanchoen/eic-dual-readout | 8cea1f6df9f837c9355416ad84df33a8de2ab600 | [
"Apache-2.0"
] | 3 | 2021-04-25T23:02:22.000Z | 2021-07-19T08:14:49.000Z | #include "DRsimRunAction.hh"
#include "DRsimEventAction.hh"
#include "G4AutoLock.hh"
#include "G4Threading.hh"
#include <vector>
using namespace std;
namespace { G4Mutex DRsimRunActionMutex = G4MUTEX_INITIALIZER; }
HepMCG4Reader* DRsimRunAction::sHepMCreader = 0;
RootInterface<DRsimInterface::DRsimEventData>* DRsimRunAction::sRootIO = 0;
int DRsimRunAction::sNumEvt = 0;
DRsimRunAction::DRsimRunAction(G4int seed, G4String filename, G4bool useHepMC)
: G4UserRunAction()
{
fSeed = seed;
fFilename = filename;
fUseHepMC = useHepMC;
G4AutoLock lock(&DRsimRunActionMutex);
if (!sRootIO) {
sRootIO = new RootInterface<DRsimInterface::DRsimEventData>(fFilename+"_"+std::to_string(fSeed)+".root");
sRootIO->create("DRsim","DRsimEventData");
}
if (fUseHepMC && !sHepMCreader) {
sHepMCreader = new HepMCG4Reader(fSeed,fFilename);
}
}
DRsimRunAction::~DRsimRunAction() {
if (IsMaster()) {
G4AutoLock lock(&DRsimRunActionMutex);
if (fUseHepMC && sHepMCreader) {
delete sHepMCreader;
sHepMCreader = 0;
}
if (sRootIO) {
sRootIO->write();
sRootIO->close();
delete sRootIO;
sRootIO = 0;
}
}
}
void DRsimRunAction::BeginOfRunAction(const G4Run*) {
}
void DRsimRunAction::EndOfRunAction(const G4Run*) {
}
| 21.898305 | 109 | 0.704334 | [
"vector"
] |
1b8cdc76271206a3312d8227b3fe9e57f3700d1f | 422 | cpp | C++ | tests/WordSearchTest.cpp | yanzhe-chen/LeetCode | d82f0b9721ea613ab216c78e7286671d0e9e4187 | [
"MIT"
] | 43 | 2015-10-10T12:59:52.000Z | 2018-07-11T18:07:00.000Z | tests/WordSearchTest.cpp | yanzhe-chen/LeetCode | d82f0b9721ea613ab216c78e7286671d0e9e4187 | [
"MIT"
] | null | null | null | tests/WordSearchTest.cpp | yanzhe-chen/LeetCode | d82f0b9721ea613ab216c78e7286671d0e9e4187 | [
"MIT"
] | 11 | 2015-10-10T14:41:11.000Z | 2018-07-28T06:03:16.000Z | #include "catch.hpp"
#include "WordSearch.hpp"
TEST_CASE("Word Search") {
WordSearch s;
SECTION("Sample tests") {
vector<vector<char>> board{
{'A', 'B', 'C', 'E'},
{'S', 'F', 'C', 'S'},
{'A', 'D', 'E', 'E'}
};
REQUIRE(s.exist(board, "ABCCED"));
REQUIRE(s.exist(board, "SEE"));
REQUIRE_FALSE(s.exist(board, "ABCB"));
}
}
| 23.444444 | 46 | 0.447867 | [
"vector"
] |
1b8f98a0b4e0e1d63a70115f1ed33ca71910de1c | 9,809 | cpp | C++ | source_calibration/Input.cpp | Eve-ning/ManiaLib | b010c87ebe0f9e6cd2fcea2b0df2e9ea59baa3d9 | [
"MIT"
] | 5 | 2017-03-18T12:21:50.000Z | 2017-10-05T18:44:29.000Z | source_calibration/Input.cpp | Eve-ning/ManiaLib | b010c87ebe0f9e6cd2fcea2b0df2e9ea59baa3d9 | [
"MIT"
] | 3 | 2017-03-18T15:57:54.000Z | 2017-04-29T01:34:28.000Z | source_calibration/Input.cpp | Eve-ning/ManiaLib | b010c87ebe0f9e6cd2fcea2b0df2e9ea59baa3d9 | [
"MIT"
] | null | null | null | #include "Input.h"
//Initiates a SINGULAR note input prompt
//Input NIL
//Return (Double) Offset, (Int) Key Position
std::tuple<double, int> Input::Input_N_S()
{
if (DEBUG == true) {
std::cout << "[DEBUG] Input_N_S" << std::endl;
}
std::string input_raw;
std::string input_bracket;
std::string input_bar;
std::string input_bar2;
double input_offset;
int input_key;
std::cout << "Input Note (1): ";
std::getline(std::cin, input_raw, '-');
try {
input_bracket = input_raw.substr(input_raw.find("(") + 1, input_raw.find(")") - (input_raw.find("(") + 1));
}
catch (...) {
std::cout << "[ERROR] Input_N_S.input_bracket encountered an error!" << std::endl;
//menu
}
try {
input_bar = input_bracket.substr(0, input_bracket.find("|"));
}
catch (...) {
std::cout << "[ERROR] Input_N_S.input_bar encountered an error!" << std::endl;
//menu
}
try {
input_bar2 = input_bracket.substr(input_bracket.find("|") + 1, 1);
}
catch (...) {
std::cout << "[ERROR] Input_N_S.input_bar encountered an error!" << std::endl;
//menu
}
try {
input_offset = stod(input_bar);
}
catch (...) {
std::cout << "[ERROR] Input_N_S.input_offset encountered an error!" << std::endl;
//menu
}
try {
input_key = stoi(input_bar2);
}
catch (...) {
std::cout << "[ERROR] Input_N_S.input_key encountered an error!" << std::endl;
//menu
}
//----------------DEBUG----------------//
if (DEBUG == true) {
std::cout << "[DEBUG] input_bracket: " << input_bracket << std::endl;
std::cout << "[DEBUG] input_bar/input_offset: " << input_bar << std::endl;
std::cout << "[DEBUG] input_bar2/input_key: " << input_bar2 << std::endl;
}
//----------------DEBUG----------------//
return std::make_tuple(input_offset,input_key);
}
//Initiates a MULTIPLE note prompt
//Input (Int) Number of Inputs
//Return (VDouble) Offset, (VInt) Key Position
std::tuple<std::vector<double>, std::vector<int>> Input::Input_N_M(unsigned int count)
{
if (DEBUG == true) {
std::cout << "[DEBUG] Input_N_M" << std::endl;
}
std::string input_raw;
std::string input_bracket;
std::string input_bar;
std::string input_bar2;
std::vector<double>input_offset_list;
std::vector<int>input_key_list;
double input_offset;
double input_key;
double input_buffer = NULL;
if (count > 99) {
std::cout << "Input Note (*): ";
}
else {
std::cout << "Input Note (" << count << "): ";
}
std::getline(std::cin, input_raw, '-');
try {
input_bracket = input_raw.substr(input_raw.find("(") + 1, input_raw.find(")") - (input_raw.find("(") + 1));
}
catch (...) {
std::cout << "[ERROR] Input_N_M.input_bracket encountered an error!" << std::endl;
//menu
}
while (input_bracket.length() > 2) {
try {
input_bar = input_bracket.substr(0, input_bracket.find("|"));
input_bar2 = input_bracket.substr(input_bracket.find("|") + 1, 1);
input_bracket = input_bracket.erase(0, input_bar.length() + 3);
}
catch (...) {
std::cout << "[ERROR] Input_N_M.input_bar(2) encountered an error!" << std::endl;
//menu
}
try {
input_offset = stod(input_bar);
}
catch (...) {
std::cout << "[ERROR] Input_N_M.input_offset encountered an error!" << std::endl;
//menu
}
try {
input_key = stoi(input_bar2);
}
catch (...) {
std::cout << "[ERROR] Input_N_M.input_key encountered an error!" << std::endl;
//menu
}
//This prevents duplicate offsets
if (input_offset != input_buffer) {
input_offset_list.push_back(input_offset);
}
input_buffer = input_offset;
input_key_list.push_back(input_key);
//----------------DEBUG----------------//
if (DEBUG == true) {
std::cout << "[DEBUG] input_bar/input_offset: " << input_bar << std::endl;
std::cout << "[DEBUG] input_bar2/input_key: " << input_bar2 << std::endl;
}
//----------------DEBUG----------------//
}
//----------------DEBUG----------------//
if (DEBUG == true) {
unsigned int input_offset_list_size = input_offset_list.size();
unsigned int input_key_list_size = input_key_list.size();
for (unsigned int x = 0; x < input_offset_list_size; x++) {
std::cout << "[DEBUG] input_offset_list: " << input_offset_list[x] << std::endl;
}
for (unsigned int x = 0; x < input_key_list_size; x++) {
std::cout << "[DEBUG] input_key_list: " << input_key_list[x] << std::endl;
}
if (input_offset_list_size != count) {
std::cout << "[DEBUG] Mismatch in Count/>99 count" << std::endl;
}
}
//----------------DEBUG----------------//
return std::make_tuple(input_offset_list,input_key_list);
}
//Initiates a SINGULAR timing point prompt and returns a vector double
//Input NIL
//Return (Double) Offset, (Double) Code, (String) Extension
std::tuple<double, double, std::string> Input::Input_T_S()
{
if (DEBUG == true) {
std::cout << "[DEBUG] Input_T_S" << std::endl;
}
std::string input_raw;
double input_offset;
double input_code;
std::string input_extension;
std::string comma1;
std::string comma2;
std::cout << "Input Timing Point (1): ";
std::cin >> input_raw;
try {
comma1 = input_raw.substr(0, input_raw.find(","));
input_raw = input_raw.erase(0, comma1.length() + 1);
}
catch (...) {
std::cout << "[ERROR] Input_T_S.comma1 encountered an error!" << std::endl;
//menu
}
try {
comma2 = input_raw.substr(0, input_raw.find(","));
input_raw = input_raw.erase(0, comma2.length() + 1);
}
catch (...) {
std::cout << "[ERROR] Input_T_S.comma2 encountered an error!" << std::endl;
//menu
}
try {
input_offset = stod(comma1);
}
catch (...) {
std::cout << "[ERROR] Input_T_S.input_offset encountered an error!" << std::endl;
//menu
}
try {
input_code = stod(comma2);
}
catch (...) {
std::cout << "[ERROR] Input_T_S.input_code encountered an error!" << std::endl;
//menu
}
input_extension = input_raw;
//----------------DEBUG----------------//
if (DEBUG == true) {
std::cout << "[DEBUG] comma1/input_offset: " << comma1 << std::endl;
std::cout << "[DEBUG] comma2/input_code: " << comma2 << std::endl;
std::cout << "[DEBUG] input_raw/input_extension: " << input_raw << std::endl;
}
//----------------DEBUG----------------//
return std::make_tuple(input_offset, input_code, input_extension);
}
//Initiates a MULTIPLE timing point prompt and returns a vector double
//Input (Int) Number of Inputs
//Return (VDouble) Offset, (VDouble) Code, (VString) Extension
std::tuple <std::vector<double>, std::vector<double>, std::vector<std::string>> Input::Input_T_M(unsigned int count)
{
if (DEBUG == true) {
std::cout << "[DEBUG] Input_T_M" << std::endl;
}
std::string input_raw;
std::string input_raw_copy;
double input_offset;
double input_code;
std::string input_extension;
std::vector<double> input_offset_list;
std::vector<double> input_code_list;
std::vector<std::string> input_extension_list;
std::string comma1;
std::string comma2;
if (count > 99) {
std::cout << "Input Timing Point (*) <Type STOP to stop Input>: " << std::endl;
}
else {
std::cout << "Input Timing Point (" << count << ") <Type STOP to stop Input>: " << std::endl;
}
std::cin >> input_raw;
input_raw_copy = input_raw;
do {
try {
comma1 = input_raw.substr(0, input_raw.find(","));
input_raw = input_raw.erase(0, comma1.length() + 1);
}
catch (...) {
std::cout << "[ERROR] Input_T_S.comma1 encountered an error!" << std::endl;
//menu
}
try {
comma2 = input_raw.substr(0, input_raw.find(","));
input_raw = input_raw.erase(0, comma2.length() + 1);
}
catch (...) {
std::cout << "[ERROR] Input_T_S.comma2 encountered an error!" << std::endl;
//menu
}
try {
input_offset = stod(comma1);
}
catch (...) {
std::cout << "[ERROR] Input_T_S.input_offset encountered an error!" << std::endl;
//menu
}
try {
input_code = stod(comma2);
}
catch (...) {
std::cout << "[ERROR] Input_T_S.input_code encountered an error!" << std::endl;
//menu
}
input_extension = input_raw;
//----------------DEBUG----------------//
if (DEBUG == true) {
std::cout << "[DEBUG] comma1/input_offset: " << comma1 << std::endl;
std::cout << "[DEBUG] comma2/input_code: " << comma2 << std::endl;
std::cout << "[DEBUG] input_raw/input_extension: " << input_raw << std::endl;
}
//----------------DEBUG----------------//
input_offset_list.push_back(input_offset);
input_code_list.push_back(input_code);
input_extension_list.push_back(input_extension);
std::cin >> input_raw;
input_raw_copy = input_raw;
} while (input_raw_copy != "STOP");
//----------------DEBUG----------------//
if (DEBUG == true) {
unsigned int input_offset_list_size = input_offset_list.size();
unsigned int input_code_list_size = input_code_list.size();
unsigned int input_extension_list_size = input_extension_list.size();
for (unsigned int x = 0; x < input_offset_list_size; x++) {
std::cout << "[DEBUG] input_offset_list: " << input_offset_list[x] << std::endl;
}
for (unsigned int x = 0; x < input_code_list_size; x++) {
std::cout << "[DEBUG] input_code_list: " << input_code_list[x] << std::endl;
}
for (unsigned int x = 0; x < input_extension_list_size; x++) {
std::cout << "[DEBUG] input_extension_list: " << input_extension_list[x] << std::endl;
}
}
//----------------DEBUG----------------//
return std::make_tuple(input_offset_list, input_code_list, input_extension_list);
}
| 24.959288 | 117 | 0.588643 | [
"vector"
] |
1b92039c5a8a712ddb815f566796134fd82ea085 | 33,997 | cpp | C++ | game/g_ambients.cpp | kugelrund/Elite-Reinforce | a2fe0c0480ff2d9cdc241b9e5416ee7f298f00ca | [
"DOC"
] | 10 | 2017-07-04T14:38:48.000Z | 2022-03-08T22:46:39.000Z | game/g_ambients.cpp | UberGames/SP-Mod-Source-Code | 04e0e618d1ee57a2919f1a852a688c03b1aa155d | [
"DOC"
] | null | null | null | game/g_ambients.cpp | UberGames/SP-Mod-Source-Code | 04e0e618d1ee57a2919f1a852a688c03b1aa155d | [
"DOC"
] | 2 | 2017-04-23T18:24:44.000Z | 2021-11-19T23:27:03.000Z | //g_ambient.cpp
//Ambient creatures, effects, hazards, etc.
#include "g_local.h"
#include "g_functions.h"
#include "b_local.h"
extern void G_StartObjectMoving( gentity_t *object, vec3_t dir, float speed, trType_t trType );
extern void G_RunObject( gentity_t *ent );
extern void G_StopObjectMoving( gentity_t *object );
extern void CG_ElectricalExplosion( vec3_t start, vec3_t end, float radius );
extern void CG_Chunks( int owner, vec3_t origin, const vec3_t normal, float speed, int numChunks, material_t chunkType, int customChunk, float baseScale );
extern void CG_StasisFixitsThink ( centity_t *cent );
extern void CG_StasisFlierAttackThink ( centity_t *cent );
extern void CG_StasisFlierIdleThink ( centity_t *cent );
extern void CG_StasisFlierChildDeath ( vec3_t pos );
extern void CalcEntitySpot ( gentity_t *ent, spot_t spot, vec3_t point );
extern void G_SetEnemy( gentity_t *self, gentity_t *enemy );
void SP_ambient_etherian_fliers_child (gentity_t *self);
#define FLIER_HOMELESS 1
#define FLIER_CHILD_MIN_SPEED 5
#define FLIER_CHILD_SPEED_RANGE 800
#define FLIER_CHILD_MIN_DIST 48
#define FLIER_CHILD_DIST_RANGE 128
#define FLIER_ATTACK_TIME 6000
#define FLIER_NOATTACK_TIME_MIN 1000
#define FLIER_NOATTACK_TIME_MAX 3000
#define FLIER_CHILD_DAMAGE 1
#define FLIER_REACHED_TARGET 48
#define FLIER_INSPECT_DAMAGE 4
/*QUAKED ambient_etherian_mine (1 0 0) (-8 -8 -30) (8 8 8)
Floats in position
Homes in on anything within it's radius (default is 160)
Impact with solid objects makes it explode with Etherian Stasis Energy effect
Damage affects other gords, does knockback
Can be shot, 1 hit one kill.
splashDamage and splashRadius - explosion size and damage
radius - how close someone has to be to go after them
speed - movement speed (default is 40)
target -fires them when explode
TODO:
Allow targetting to explode when used
Allow to start dormant and wake up?
Allow setting of health?
*/
//---------------------------------------
void SP_ambient_etherian_mine (gentity_t *self)
{
G_SetOrigin(self, self->s.origin);
//pos1 is where to return to
VectorCopy(self->s.origin, self->pos1);
self->s.eType = ET_GENERAL;
self->s.modelindex = G_ModelIndex("models/mapobjects/stasis/mine.md3");
G_SoundIndex("sound/weapons/explosions/mine1.wav"); //precache
G_SoundIndex("sound/weapons/explosions/mine2.wav"); //precache
G_SoundIndex("sound/weapons/explosions/mine3.wav"); //precache
if ( self->radius <= 0 )
self->radius = 160;
if ( self->speed <= 0 )
self->speed = 40;
VectorSet( self->mins, -8, -8, -30 );
VectorSet( self->maxs, 8, 8, 8 );
self->health = 1;
self->takedamage = qtrue;
self->contents = CONTENTS_SOLID;
self->e_DieFunc = dieF_mine_die;
self->e_TouchFunc = touchF_mine_touch;
self->e_ThinkFunc = thinkF_mine_think;
self->nextthink = level.time + FRAMETIME;
self->clipmask = MASK_NPCSOLID;
self->noDamageTeam = TEAM_STASIS;
if ( self->splashDamage <= 0 )
self->splashDamage = 30;
if ( self->splashRadius <= 0 )
self->splashRadius = 64;
self->s.eFlags |= EF_ANIM_ALLFAST;
gi.linkentity(self);
}
//---------------------------------------
void mine_think (gentity_t *self)
{
//FIXME: if not even in PVS of player, don't think at all, maybe should stop too?
gentity_t *target;
gentity_t *entity_list[MAX_GENTITIES];
int count;
float dist, speed = self->speed;
float bestDist = Q3_INFINITE;
qboolean doMove = qfalse;
qboolean changeDir = qfalse;
vec3_t vec, targOrg;
if ( !Q_irand(0, 3) )
{
count = G_RadiusList( self->currentOrigin, self->radius, self, qtrue, entity_list );
for ( int i = 0; i < count; i++ )
{
target = entity_list[i];
if ( ( target == self) || ( target == self->owner ) )
continue;
if ( target->client && target->client->playerTeam == TEAM_STARFLEET && !(target->flags & FL_NOTARGET) )
{
VectorCopy( target->currentOrigin, targOrg );
targOrg[2] += target->client->ps.viewheight;
VectorSubtract( targOrg, self->pos1, vec );
dist = VectorLengthSquared( vec );
if ( dist < self->radius*self->radius )
{//Close to my start spot
VectorSubtract( targOrg, self->currentOrigin, vec );
dist = VectorLengthSquared( vec );
if ( dist < bestDist )//all things equal, keep current
{
if ( !self->enemy )
{//Aquired new enemy
self->pushDebounceTime = 0;
}
G_SetEnemy(self, target);
bestDist = dist;
}
}
}
}
}
if ( self->pushDebounceTime > level.time )
{//Just drifting
doMove = qtrue;
}
else
{
if ( self->enemy )
{//31337 44!
if ( self->aimDebounceTime <= level.time )
{
VectorCopy( self->enemy->currentOrigin, targOrg );
targOrg[2] += self->enemy->client->ps.viewheight;
VectorSubtract( targOrg, self->currentOrigin, self->movedir );
dist = VectorNormalize( self->movedir );
if ( dist < self->radius )
{
changeDir = qtrue;
doMove = qtrue;
}
else
{
self->enemy = NULL;
}
}
}
if ( !self->enemy )
{
vec3_t homeDir;
changeDir = qtrue;
doMove = qtrue;
VectorSubtract( self->pos1, self->currentOrigin, homeDir );
dist = VectorNormalize( homeDir );
if ( dist > self->speed / 4 )
{//Trying to get back to center
VectorCopy( homeDir, self->movedir );
}
else
{//hover about
speed *= 0.25f;
VectorSet( self->movedir, homeDir[0] + crandom(), homeDir[1] + crandom(), homeDir[2] + crandom() );
self->pushDebounceTime = level.time + 500 + random() * 200;
}
}
}
//FIXME: accelerate to top speed?
if ( doMove )
{
G_RunObject(self);
if ( changeDir )
{
G_StartObjectMoving( self, self->movedir, speed, TR_LINEAR );
}
}
else
{
G_StopObjectMoving( self );
}
self->nextthink = level.time + FRAMETIME;
}
//---------------------------------------
void mine_explode( gentity_t *self )
{
if ( self->attackDebounceTime <= level.time )
{
if ( self->target )
{
G_UseTargets( self, self->enemy );
}
if ( self->splashDamage > 0 && self->splashRadius > 0 )
{
G_TempEntity( self->currentOrigin, EV_STASIS_MINE_EXPLODE );
G_RadiusDamage( self->currentOrigin, self, self->splashDamage, self->splashRadius, self, MOD_UNKNOWN );
}
G_Sound ( self, G_SoundIndex ( va( "sound/weapons/explosions/mine%d.wav", Q_irand(1, 3) ) ) );
G_FreeEntity( self );
}
else
{
self->s.eFlags |= EF_SCALE_UP;
VectorSet( self->currentAngles, self->currentAngles[0]+crandom(), self->currentAngles[1]+crandom()*3, self->currentAngles[2]+crandom() );
G_SetAngles( self, self->currentAngles );
self->nextthink = level.time + FRAMETIME;
}
}
//---------------------------------------
void mine_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod )
{
//Do explosion
self->health = 0;
self->takedamage = qfalse;
//Throw some chunks?
self->e_PainFunc = painF_NULL;
self->e_DieFunc = dieF_NULL;
self->e_TouchFunc = touchF_NULL;
self->e_ThinkFunc = thinkF_mine_explode;
self->nextthink = level.time + FRAMETIME;
self->attackDebounceTime = level.time + Q_irand(300, 500);
G_SetEnemy(self, attacker);
}
//---------------------------------------
void mine_touch (gentity_t *self, gentity_t *other, trace_t *trace)
{
//If valid enemy, explode, otherwise, if another mine, push it, otherwise bounce off
if ( other->client && other->client->playerTeam && other->client->playerTeam != self->noDamageTeam )
{//Hit something, go boom
self->attackDebounceTime = 0;
G_SetEnemy(self, other);
mine_explode( self );
}
else if ( self->s.pos.trDelta && Q_stricmp( other->classname, self->classname ) == 0 )
{//I'm moving and hit another dude
//Drift for a second
G_StartObjectMoving( self, self->movedir, self->speed, TR_LINEAR );
self->pushDebounceTime = level.time + 1000;
}
else if ( other->s.number >= ENTITYNUM_WORLD )//Hit wall, bounce off
{//FIXME: use normal of wall to determine bounce angle?
G_StartObjectMoving( self, self->movedir, -self->speed, TR_LINEAR );
self->pushDebounceTime = level.time + 1000;
}
else if ( !self->s.pos.trDelta )
{//I'm not moving, push me
vec3_t center;
VectorSubtract(other->absmax, other->absmin, center);//size
VectorMA(other->absmin, 0.5, center, center);//center
VectorSubtract( self->currentOrigin, center, self->movedir );
//FIXME: get speed from THEM?
G_StartObjectMoving( self, self->movedir, self->speed, TR_LINEAR );
self->pushDebounceTime = level.time + 1000;
}
else
{
G_StopObjectMoving( self );
}
}
/*QUAKED ambient_etherian_fliers (1 0 0) (-8 -8 -8) (8 8 8)
Fly around on paths, occaisionally swoop down and do a melee-range discharge and return to path
"target" them at a circular series of path_corners
"target2" - What they fire when they die
"splashDamage" - Damage their melee attack does per frame (default 3)
"splashRadius" - Size of their melee attack (default 64)
"radius" - How close they can be before I pick them up and attack (default 512)
"health" - (default 40)
TODO:
Allow custom speed...?
*/
void flier_pain (gentity_t *self, gentity_t *attacker, int damage)
{//move? Anim? scream? Change dir? Pitch/roll?
//spin/drift?
if ( !self->enemy &&
(attacker->noDamageTeam != self->noDamageTeam || (attacker->client && attacker->client->playerTeam != self->noDamageTeam)) )
{
G_SetEnemy(self, attacker);
}
}
//---------------------------------------
void flier_die ( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod )
{//drift, scream and disintegrate
if ( self->target2 && self->target2[0] )
{
G_UseTargets2(self, attacker, self->target2);
}
self->health = 0;
self->takedamage = qfalse;
//Throw some chunks?
self->e_PainFunc = painF_NULL;
self->e_DieFunc = dieF_NULL;
self->e_ThinkFunc = thinkF_mine_explode;
self->nextthink = level.time + FRAMETIME;
//VectorCopy( self->currentOrigin, self->s.origin );
// self->attackDebounceTime = level.time + Q_irand(300, 500);
}
//---------------------------------------
extern void CG_Line( vec3_t start, vec3_t end, vec3_t color, float alpha );
float flier_move( gentity_t *self, vec3_t destOrg, float turnRate, qboolean modTurnSpeeds )
{
vec3_t oldDir, newMoveDir, newAngles, dirDiff;
float moveDist=0;
float moveSpeed;
EvaluateTrajectory( &self->s.apos, level.time, self->s.apos.trBase );
if( self->s.pos.trType == TR_GRAVITY )
{ // so this will inherit whatever the flier was doing when it died
// dammit - do this manually because the gravity stuff isn't right.
vec3_t velVect;
VectorScale( self->movedir, self->speed, velVect );
velVect[2] -= DEFAULT_GRAVITY * ( FRAMETIME / 1000.0 ) * .5; // one quarter of gravity to look floaty
VectorCopy( velVect, self->movedir );
self->speed = VectorNormalize( self->movedir );
G_StartObjectMoving( self, self->movedir, self->speed, TR_GRAVITY );
}
else
{
VectorSubtract( destOrg, self->currentOrigin, newMoveDir );
vectoangles( newMoveDir, newAngles );
moveDist = VectorNormalize( newMoveDir );
VectorScale( self->movedir, 1.0 - turnRate, oldDir );
VectorScale( newMoveDir, turnRate, newMoveDir );
VectorAdd( oldDir, newMoveDir, self->movedir );
VectorNormalize( self->movedir );
//set movement
//FIXME: mod speed so they slow down on turns
//Speed slows as the change in moveDir increases
VectorSubtract( self->movedir, oldDir, dirDiff );
if( modTurnSpeeds )
{
moveSpeed = (2 - VectorLength( dirDiff )) * 0.5 * self->speed;
}
else
{
moveSpeed = self->speed;
}
G_StartObjectMoving( self, self->movedir, moveSpeed, TR_LINEAR );
}
// make the angles correct
vec3_t destinationAngle;
vectoangles( self->movedir, destinationAngle );
AnglesSubtract( destinationAngle, self->s.apos.trBase, self->s.apos.trDelta );
//since this is in terms of units per second but we need the amount for a frame
VectorScale( self->s.apos.trDelta, 1000/FRAMETIME, self->s.apos.trDelta );
self->s.apos.trTime = level.time;
return moveDist;
}
//---------------------------------------
void flier_find_first_path_corner( gentity_t *self )
{
if ( !self->target || !self->target[0] )
{//Nowhere to start!
if ( !self->etherian_fixit )
{
//gi.Error( "NO start path_corner for etherian flier\n" );
}
}
self->activator = G_Find( NULL, FOFS(targetname), self->target );
if ( !self->activator )
{//Nowhere to start!
if ( !self->etherian_fixit )
{
//gi.Error( "Can't find start path_corner %s for etherian flier\n", self->target );
}
}
}
//---------------------------------------
void flier_check_attack( gentity_t *self )
{
if ( self->etherian_fixit )
{//FIXME: heal
}
else
{
if ( self->attackDebounceTime > level.time )
{
//Do effect
self->e_clThinkFunc = clThinkF_CG_StasisFlierAttackThink;
//Do radius damage
G_RadiusDamage( self->currentOrigin, self, self->splashDamage, self->splashRadius, self, MOD_STASIS );
}
else
{
self->e_clThinkFunc = clThinkF_NULL;
}
}
}
//---------------------------------------
qboolean flier_reached_path_corner( gentity_t *self )
{
vec3_t vec;
float dist;
if ( !self->activator )
{
return qfalse;
}
VectorSubtract(self->currentOrigin, self->activator->currentOrigin, vec);
dist = VectorLengthSquared(vec);
if(dist < 256)//16 squared
{
if ( !self->etherian_fixit )
{
if( !Q_irand(0, 3) )
{
//G_Sound( self, G_SoundIndex( "sound/enemies/eflyer/?.wav" ) );
}
}
return qtrue;
}
return qfalse;
}
//---------------------------------------
qboolean flier_check_valid_enemy( gentity_t *self )
{
if( !self->enemy )
{//none
return qfalse;
}
if ( self->etherian_fixit )
{//FIXME: see if still exists and still damaged
if( !(self->enemy->svFlags & SVF_BROKEN) )
{//already fixed
self->s.eFlags &= ~EF_EYEBEAM;
self->enemy = NULL;
return qfalse;
}
}
else
{
if( self->enemy->flags & FL_NOTARGET )
{//notarget
self->enemy = NULL;
return qfalse;
}
if( !self->enemy->health )
{//Dead
self->enemy = NULL;
return qfalse;
}
else if ( !gi.inPVS( self->currentOrigin, self->enemy->currentOrigin ) )
{//Not potentially visible
self->enemy = NULL;
return qfalse;
}
}
return qtrue;
}
//---------------------------------------
void flier_find_enemy (gentity_t *self, qboolean alwaysAcquire )
{
gentity_t *target;
gentity_t *entity_list[MAX_GENTITIES];
vec3_t vec;
float dist, bestDist = Q3_INFINITE;
if ( Q_irand(0, 1) && !alwaysAcquire )
{
return;
}
if( !self->etherian_fixit )
{ // we only bother with the player - we make not so much sense for the pals
//g_entities[0]
trace_t tr;
gi.trace( &tr, self->currentOrigin, vec3_origin, vec3_origin, g_entities[0].currentOrigin, self->s.number, MASK_SHOT );
if ( tr.fraction == 1.0f || tr.entityNum == g_entities[0].s.number )
{
G_SetEnemy(self, &g_entities[0]);
}
else
{
return;
}
}
else
{
int count = G_RadiusList( self->currentOrigin, 1024, self, !self->etherian_fixit, entity_list );
for ( int i = 0; i < count; i++ )
{
target = entity_list[i];
if ( target == self )
{
continue;
}
if ( target->svFlags & SVF_BROKEN )
{
VectorSubtract( target->currentOrigin, self->currentOrigin, vec );
dist = VectorLengthSquared( vec );
if ( dist < bestDist )//all things equal, keep current
{
if ( gi.inPVS( self->currentOrigin, target->currentOrigin ) )
{//NAV_ClearPathToPoint changed to always add monsterclip, so have to do our own trace now
trace_t trace;
gi.trace( &trace, self->currentOrigin, self->mins, self->maxs, target->currentOrigin, self->s.number, self->clipmask );
if( ( ( trace.startsolid == qfalse ) && ( trace.allsolid == qfalse ) ) && ( trace.fraction == 1.0f ) )
{
G_SetEnemy(self, target);
bestDist = dist;
}
}
}
}
}
}
}
//---------------------------------------
void fixit_touch ( gentity_t *self, gentity_t *other, trace_t *trace )
{
if ( other->s.number == ENTITYNUM_WORLD )
{
if ( VectorLengthSquared( trace->plane.normal ) )
{
vec3_t oldDir, newMoveDir;
VectorScale( self->movedir, 0.3, oldDir );
VectorScale( trace->plane.normal, 0.7, newMoveDir );
VectorAdd( oldDir, newMoveDir, self->movedir );
VectorNormalize( self->movedir );
}
}
}
//---------------------------------------
void flier_child_touch ( gentity_t *self, gentity_t *other, trace_t *trace )
{
G_RadiusDamage( self->currentOrigin, self, FLIER_CHILD_DAMAGE, 36, self, MOD_STASIS );
CG_StasisFlierChildDeath( self->currentOrigin );
//CG_ElectricalExplosion( self->currentOrigin, self->currentOrigin, self->splashRadius );
G_Sound ( self, G_SoundIndex ( va( "sound/weapons/explosions/mine%d.wav", Q_irand(1, 3) ) ) );
G_FreeEntity( self );
}
//---------------------------------------
void flier_fire_children (gentity_t *attacker)
{
int curChild = 0;
gentity_t *curCheck = NULL;
while( (curCheck = G_Find( curCheck, FOFS(classname), "flier_child" )) != NULL )
{
if( curCheck->owner == attacker )
{
VectorCopy( g_entities[0].currentOrigin, curCheck->pos1 );
curCheck->attackDebounceTime = level.time + ( curChild * 200 );
curCheck->e_clThinkFunc = clThinkF_CG_StasisFlierAttackThink;
//curCheck->enemy = &g_entities[0]; // always target the player - this might be bad, though. Who knows.
if( Q_irand(0, 3) == 0 )
{
curChild++;
}
}
}
}
//---------------------------------------
void flier_follow_path (gentity_t *self)
{//FIXME: don't think when enemy out of PVS?
if ( !self->etherian_fixit )
{
if ( self->speed > 140 )
{
self->speed -= 10;
}
}
self->nextthink = level.time + FRAMETIME;
G_RunObject( self );
flier_check_valid_enemy( self );
flier_check_attack( self );
if ( !self->enemy )
{//Look for enemies
flier_find_enemy( self, qfalse );
}
if ( self->enemy && self->aimDebounceTime < level.time)
{
if( self->etherian_fixit )
{
//FIXME: Decide whether or not to swoop
if ( !self->etherian_fixit )
{
//G_Sound( self, G_SoundIndex( "sound/enemies/eflyer/dssklatk.wav" ) );
}
self->e_ThinkFunc = thinkF_flier_swoop_to_enemy;
}
else
{
self->enemy = NULL;
// G_SetEnemy(self, NULL);//?
flier_find_enemy ( self, qtrue );
if( self->enemy )
{
// assault the player with my guys
flier_fire_children( self );
self->aimDebounceTime = level.time + FLIER_ATTACK_TIME;
}
else
{
self->aimDebounceTime = level.time + Q_irand(FLIER_NOATTACK_TIME_MIN, FLIER_NOATTACK_TIME_MAX);
}
}
}
else
{//Follow path, with some variance
qboolean goToNext = qfalse;
if ( self->activator )
{//We're already heading to a path_corner
if ( flier_reached_path_corner( self ) )
{
goToNext = qtrue;
}
}
else
{//First time, let's grab one
flier_find_first_path_corner( self );
goToNext = qtrue;
}
if ( goToNext && self->activator )
{//Need to find a new path_corner
//Should always find one, else: ERROR! Must loop!
if ( self->activator->target && self->activator->target[0] )
{//Find our next path_corner
self->activator = G_Find( NULL, FOFS(targetname), self->activator->target );
}
}
if ( self->activator )
{
flier_move( self, self->activator->currentOrigin, 0.3f, qtrue );
}
}
}
void misc_model_breakable_init( gentity_t *ent );
void flier_swoop_to_enemy (gentity_t *self)
{
if ( !self->etherian_fixit )
{
if ( self->speed < 300 )
{
self->speed += 10;
}
}
self->wait = 0;// will need to reacquire path
self->nextthink = level.time + FRAMETIME;
G_RunObject( self );
//Home on on enemy
flier_check_valid_enemy( self );
flier_check_attack( self );
if ( self->enemy )
{
vec3_t targOrg, vec;
float dist;
VectorCopy( self->enemy->currentOrigin, targOrg );
if ( !self->etherian_fixit )
{//flier
targOrg[2] += self->enemy->client->ps.viewheight;
}
VectorSubtract( targOrg, self->currentOrigin, vec );
dist = VectorLengthSquared( vec );
if ( dist < (self->splashRadius*self->splashRadius) )
{//attack!
if ( !self->etherian_fixit )
{//Zap it
//G_Sound( self, G_SoundIndex( "sound/enemies/etherians/attack.wav" ) );
G_Sound( self, G_SoundIndex( "sound/weapons/stasis_alien/fire.wav" ) );
//G_Sound( self, G_SoundIndex( "sound/enemies/borg/borgtaser.wav" ) );
self->aimDebounceTime = level.time + 99999999;
self->attackDebounceTime = level.time + 2000;
self->e_ThinkFunc = thinkF_flier_return_to_path;
}
else
{//Heal it
if ( self->enemy->health >= self->enemy->max_health )
{
if ( self->enemy->health == self->enemy->max_health )
{
//Do this only the first time
misc_model_breakable_init( self->enemy );
// Make sure that the animation restarts when it gets fixed
self->enemy->s.frame = 0;
self->enemy->s.eFlags &= ~ EF_ANIM_ALLFAST;
self->enemy->s.eFlags |= EF_ANIM_ONCE;
if ( self->enemy->target2 && self->enemy->target2[0] )
{//Fixing a breakable uses its target2
G_UseTargets2( self->enemy, self, self->enemy->target2 );
}
}
if ( self->spawnflags & FLIER_HOMELESS )
{//Stay here until we find something else to fix
self->activator = NULL;
self->target = NULL;
VectorCopy( self->currentOrigin, self->fixit_start_position );
}
self->enemy->svFlags &= ~SVF_BROKEN;
self->s.eFlags &= ~EF_EYEBEAM;
self->aimDebounceTime = level.time + 300;
self->attackDebounceTime = level.time + 100;
self->e_ThinkFunc = thinkF_flier_return_to_path;
}
else
{
int saveSpeed = self->speed;
if ( ! (self->enemy->s.eFlags & EF_FIXING ) )
{
// Fun fixing has now begun
self->enemy->s.eFlags |= EF_FIXING;
self->enemy->fx_time = level.time;
G_AddEvent( self, EV_GENERAL_SOUND, G_SoundIndex( "sound/ambience/stasis/fireflyfixed.wav" ));
}
// Fixing is based on time because of the shader effect used, it animates at a set rate, so
// we should sync up to that if we have any hopes of the effect looking like we want.
if ( self->enemy->fx_time + 1500 < level.time )
{
//Yeah! Fixing is done!
self->enemy->health = self->enemy->max_health;
}
self->s.eFlags |= EF_EYEBEAM;
self->speed = 20;
flier_move( self, targOrg, 0.3f, qtrue );
self->speed = saveSpeed;
}
}
}
else
{
flier_move( self, targOrg, 0.3f, qtrue );
}
}
else
{
self->e_ThinkFunc = thinkF_flier_return_to_path;
}
//When in range, start discharge timer
//Once started discharge, begin return_to_path thinking
}
void flier_return_to_path (gentity_t *self)
{
if ( !self->etherian_fixit )
{
if ( self->speed > 140 )
{
self->speed -= 10;
}
}
self->nextthink = level.time + FRAMETIME;
G_RunObject( self );
flier_check_valid_enemy( self );
//If discharge timer on, keep effect going
flier_check_attack( self );
if ( self->etherian_fixit && !self->enemy && self->aimDebounceTime > level.time )
{//FIXITs can look for enemies on the way back
flier_find_enemy( self, qfalse );
}
if ( self->enemy && self->aimDebounceTime < level.time )
{
//FIXME: Decide whether or not to swoop
if ( !self->etherian_fixit )
{
//need sounds!
//G_Sound( self, G_SoundIndex( "sound/enemies/eflyer/dssklatk.wav" ) );
}
self->e_ThinkFunc = thinkF_flier_swoop_to_enemy;
}
else
{
gentity_t *pCorner = NULL;
vec3_t vec;
float dist, bestDist = Q3_INFINITE;
//FIXME: if no path, return to spawn spot?
if ( !self->activator )
{
if( !self->target || !self->target[0] )
{
VectorSubtract( self->fixit_start_position, self->currentOrigin, vec );
if ( VectorLengthSquared( vec ) < 256 )
{
if ( !self->etherian_fixit )
{
self->aimDebounceTime = level.time + 3000;
}
G_StopObjectMoving( self );
self->e_ThinkFunc = thinkF_flier_follow_path;
}
else
{
flier_move( self, self->fixit_start_position, 0.3f, qtrue );
}
return;
}
//If don't have a path corner, pick one - what if we followed the player into an area without one?
flier_find_first_path_corner( self );
if ( !self->activator )
{
return;
}
}
if ( flier_reached_path_corner( self ) )
{
//gi.Printf( "%s got on path\n", self->classname );
//When reach path corner, start follow_path behavior
if ( !self->etherian_fixit )
{
self->aimDebounceTime = level.time + 3000;
}
self->e_ThinkFunc = thinkF_flier_follow_path;
return;
}
//Find our closest path_corner in PVS
if ( !self->wait )
{//Off path
while ( (pCorner = G_Find( pCorner, FOFS(targetname), self->activator->target )) != NULL )
{
VectorSubtract( pCorner->currentOrigin, self->pos1, vec );
dist = VectorLengthSquared( vec );
if ( dist < bestDist )
{//closest so far
//NAV_ClearPathToPoint changed to always add monsterclip, so have to do our own trace now
if ( gi.inPVS( self->currentOrigin, pCorner->currentOrigin ) )
{
trace_t trace;
gi.trace( &trace, self->currentOrigin, self->mins, self->maxs, pCorner->currentOrigin, self->s.number, self->clipmask );
if( ( ( trace.startsolid == qfalse ) && ( trace.allsolid == qfalse ) ) && ( trace.fraction == 1.0f ) )
{
self->activator = pCorner;
self->wait = 1;//on path now
bestDist = dist;
}
}
}
}
}
}
if ( self->activator )
{//Head back to the path corner
flier_move( self, self->activator->currentOrigin, 0.3f, qtrue );
}
}
void adjust_flier_child_dest (vec3_t inVect, int randomKey)
{
// this is pretty gruesome
// the first number scales the period of the cosine wave,
// the second number intensifies the randomKey,
// and the third number is the height of the cosine wave (basically distance of variation)
inVect[0] += cos( level.time * .0013 + (randomKey*26) ) * 15;
inVect[1] += cos( level.time * .0017 + (randomKey*17)) * 25;
inVect[2] += cos( level.time * .002 + (randomKey*31)) * 25;
}
void flier_child (gentity_t *self)
{
vec3_t destDist;
float destLen;
vec3_t destPos;
self->nextthink = level.time + FRAMETIME;
G_RunObject( self );
if( self->inuse && self->owner )
{ // only adjust this stuff if we're still following the parent
if( self->owner->inuse == qfalse )
{ // if our owner is dead, fall to the ground lifeless
self->s.pos.trType = TR_GRAVITY;
self->e_TouchFunc = touchF_flier_child_touch;
self->owner = NULL;
VectorCopy( self->currentOrigin, destPos ); //?
self->clipmask = MASK_PLAYERSOLID;
//self->speed *= .2; // slow down as we fall out of the air
}
else if( self->owner )
{
float targetSpeed;
// locate my destination
if( self->attackDebounceTime > 0 && self->attackDebounceTime <= level.time )
{ // I am on the attack... So go there until I hit it.
VectorCopy( self->pos1, destPos );
// See if we got there yet
vec3_t diff;
VectorSubtract( self->pos1, self->currentOrigin, diff );
if( VectorLength( diff ) < FLIER_REACHED_TARGET )
{
self->attackDebounceTime = 0;
self->e_clThinkFunc = clThinkF_CG_StasisFlierIdleThink;
}
}
else
{
VectorCopy( self->owner->currentOrigin, destPos );
}
if( self->attackDebounceTime > 0 && self->attackDebounceTime <= level.time )
{
G_RadiusDamage( self->currentOrigin, self, FLIER_INSPECT_DAMAGE, 36, self, MOD_STASIS );
}
adjust_flier_child_dest( destPos, (int)self );
VectorSubtract( destPos, self->currentOrigin, destDist);
destLen = VectorLength( destDist );
if( destLen > FLIER_CHILD_DIST_RANGE + FLIER_CHILD_MIN_DIST )
{
// out of range - go maximum speed
targetSpeed = FLIER_CHILD_SPEED_RANGE + FLIER_CHILD_MIN_SPEED;
}
else if( destLen < FLIER_CHILD_MIN_DIST )
{
// too close - go minimum speed
targetSpeed = FLIER_CHILD_MIN_SPEED;
}
else
{
float ratio;
ratio = ( destLen - FLIER_CHILD_MIN_DIST ) / FLIER_CHILD_DIST_RANGE;
//ratio *= ratio; // since this will always be less than one, it will be a lower curve (this mult makes it smaller)
targetSpeed = ratio * FLIER_CHILD_SPEED_RANGE + FLIER_CHILD_MIN_SPEED;
}
if( targetSpeed > self->speed + 90 )
{
self->speed += 90;
}
else
{
self->speed = targetSpeed;
}
}
}
if( self->inuse)
{
flier_move( self, destPos, 0.65f, qfalse );
}
}
void SP_ambient_etherian_fliers_child (gentity_t *self)
{
//how do I change this fellas size?
self->s.scale = .05;
G_SetOrigin(self, self->s.origin);
VectorCopy( self->s.origin, self->fixit_start_position );
self->s.eType = ET_THINKER;
//self->s.modelindex = G_ModelIndex("models/mapobjects/stasis/mine.md3");
//self->s.modelindex = G_ModelIndex("models/mapobjects/cargo/hypo.md3");
self->s.modelindex = 0; // Is this correct?
self->speed = 100;
self->health = 40;
//Set contents type and clipmask to contents_shotclip
VectorSet( self->mins, -8, -8, -8 );
VectorSet( self->maxs, 8, 8, 8 );
self->takedamage = qfalse;
self->contents = CONTENTS_NONE;
self->clipmask = CONTENTS_NONE;//?
self->noDamageTeam = TEAM_STASIS;
//Put on first path corner
self->e_ThinkFunc = thinkF_flier_child;
self->nextthink = level.time + FRAMETIME;
self->e_PainFunc = painF_flier_pain;
self->e_DieFunc = dieF_flier_die;
//Need a use func? touch func?
self->s.apos.trType = TR_LINEAR;
self->etherian_fixit = qfalse;
self->noDamageTeam = TEAM_STASIS;
self->svFlags |= SVF_NO_TELEPORT;
self->classname = "flier_child";
// when these guys have an enemy, they will charge it
// otherwise, they will just swarm after their parent
self->enemy = NULL;
self->e_clThinkFunc = clThinkF_CG_StasisFlierIdleThink;
// give myself a creation timestamp
//self->attackDebounceTime = level.time;
//rather, this indicates that I should go to pos1 rather than my owner, 'till I hit it
self->attackDebounceTime = 0;
gi.linkentity(self);
}
void SP_ambient_etherian_fliers (gentity_t *self)
{
G_SetOrigin(self, self->s.origin);
VectorCopy( self->s.origin, self->fixit_start_position );
self->s.eType = ET_THINKER;
self->s.modelindex = G_ModelIndex("models/players/skull/flyingskull.md3");
//G_SoundIndex( "sound/enemies/etherians/attack.wav" );
G_SoundIndex( "sound/weapons/stasis_alien/fire.wav" );
self->speed = 140;
if ( self->splashDamage <= 0 )
{
self->splashDamage = 3;
}
if ( self->splashRadius <= 0 )
{
self->splashRadius = 64;
}
if ( self->radius <= 0 )
{//How close they can be before I pick them up and attack
self->radius = 512;
}
if ( self->health <= 0 )
{
self->health = 40;
}
//Set contents type and clipmask to contents_shotclip
VectorSet( self->mins, -20, -20, -20 );
VectorSet( self->maxs, 20, 20, 20 );
self->takedamage = qtrue;
self->contents = CONTENTS_BODY;
self->clipmask = CONTENTS_SHOTCLIP;
self->noDamageTeam = TEAM_STASIS;
//Put on first path corner
self->e_ThinkFunc = thinkF_flier_return_to_path;
self->nextthink = level.time + FRAMETIME;
self->e_PainFunc = painF_flier_pain;
self->e_DieFunc = dieF_flier_die;
//Need a use func? touch func?
self->s.apos.trType = TR_LINEAR;
self->etherian_fixit = qfalse;
self->noDamageTeam = TEAM_STASIS;
self->svFlags |= SVF_NO_TELEPORT;
// let it animate automatically
self->s.eFlags |= EF_ANIM_ALLFAST;
gi.linkentity(self);
// set up the children for this thing
for( int i = 0; i < 6; i++ ){
gentity_t *child;
child = G_Spawn();
VectorCopy(self->s.origin, child->s.origin);
SP_ambient_etherian_fliers_child(child);//probably missing a bunch of important fields this way
child->owner = self;
}
}
/*QUAKED ambient_etherian_fixits (1 0 0) (-8 -8 -8) (8 8 8) HOMELESS
Creates a group of fixit sprites - they will fly to
broken units in their view and fix them.
HOMELESS - Tells them to not try to return to their start position/path once they've fixed something... they'll just stay where they were.
"radius" - max radius for fixits (default 20)
"speed" - how fast they swarm (default 100)
"count" - count of fixits (max of 10, default 6)
"random" - how much variance in the radius 0-100 (default 40)
0 = no variance; 100 = max variance
TODO:
Give a path?
*/
void SP_ambient_etherian_fixits (gentity_t *self)
{//FIXME: implement
G_SetOrigin( self, self->s.origin );
VectorCopy( self->s.origin, self->fixit_start_position );
#ifdef _DEBUG
self->s.modelindex = 0;
#endif
// Apply the defaults
G_SpawnFloat( "radius", "20", &self->radius );
G_SpawnFloat( "speed", "100", &self->speed );
G_SpawnInt( "count", "6", &self->count );
G_SpawnFloat( "random", "40", &self->random );
if ( self->count > 10 )
{
Com_Printf( "ambient_etherian_fixits: count was exceeded!" );
self->count = 10;
}
self->splashRadius = 32;
// pre-cache sounds
self->s.loopSound = G_SoundIndex( "sound/ambience/stasis/fireflywhisper.wav" );
G_SoundIndex( "sound/ambience/stasis/fireflyfixed.wav" );
// Set a random start (pos1) and movement angle/speed(pos2) for the leader..the rest of the swarm will
// be generated by use of an angular offset table.
VectorSet( self->pos1, crandom() * 360, crandom() * 360, 0 );
VectorSet( self->pos2, crandom() * 0.4 * self->speed, crandom() * 0.4 * self->speed, 0 );
VectorCopy( self->currentOrigin, self->s.pos.trBase );
VectorClear( self->s.pos.trDelta );
self->clipmask = CONTENTS_SHOTCLIP|CONTENTS_SOLID;
self->s.pos.trType = TR_LINEAR;
self->s.pos.trTime = level.time;
VectorCopy( self->s.angles, self->s.apos.trBase );
VectorClear( self->s.apos.trDelta );
self->s.apos.trType = TR_LINEAR;
self->s.apos.trTime = level.time;
//Start thinking
self->s.eType = ET_THINKER;
self->e_clThinkFunc = clThinkF_CG_StasisFixitsThink;
self->e_TouchFunc = touchF_fixit_touch;
self->e_ThinkFunc = thinkF_flier_return_to_path;
self->nextthink = level.time + FRAMETIME;
self->etherian_fixit = qtrue;
self->noDamageTeam = TEAM_STASIS;
self->svFlags |= SVF_NO_TELEPORT|SVF_NONNPC_ENEMY;
gi.linkentity(self);
} | 27.394843 | 155 | 0.661882 | [
"object",
"solid"
] |
1b92788485d8db736426455be73c68761b42e339 | 3,958 | cpp | C++ | src/test/json/self_contained.cpp | ClausKlein/json | eeabe4bdef13ccba985b4423ce558438fd2f5497 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT"
] | null | null | null | src/test/json/self_contained.cpp | ClausKlein/json | eeabe4bdef13ccba985b4423ce558438fd2f5497 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT"
] | null | null | null | src/test/json/self_contained.cpp | ClausKlein/json | eeabe4bdef13ccba985b4423ce558438fd2f5497 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT"
] | null | null | null | // Copyright (c) 2016-2020 Dr. Colin Hirsch and Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/json/
#include "test.hpp"
#include <tao/json/self_contained.hpp>
#include <tao/json/value.hpp>
namespace tao::json
{
template< typename T >
struct view_traits
: traits< T >
{
};
template<>
struct view_traits< std::string_view >
: traits< std::string_view >
{
template< template< typename... > class Traits >
static void assign( basic_value< Traits >& v, const std::string_view sv ) noexcept // NOLINT(bugprone-exception-escape)
{
v.set_string_view( sv );
}
};
template<>
struct view_traits< tao::binary_view >
: traits< tao::binary_view >
{
template< template< typename... > class Traits >
static void assign( basic_value< Traits >& v, const tao::binary_view xv ) noexcept // NOLINT(bugprone-exception-escape)
{
v.set_binary_view( xv );
}
};
void unit_test()
{
value v = { { "foo", 1 } };
value v1 = { { "bar", v }, { "baz", value::array( { 2, v, 3 } ) } };
value v2 = { { "bar", &v }, { "baz", value::array( { 2, &v, 3 } ) } };
value v4 = { { "bar", { { "foo", 1 } } }, { "baz", value::array( { 2, { { "foo", 1 } }, 3 } ) } };
TEST_ASSERT( v1 == v2 );
TEST_ASSERT( v1 == v4 );
TEST_ASSERT( v2 == v4 );
TEST_ASSERT( v1.at( "bar" ).type() == type::OBJECT );
TEST_ASSERT( v1.at( "baz" ).at( 1 ).type() == type::OBJECT );
TEST_ASSERT( v2.at( "bar" ).type() == type::VALUE_PTR );
TEST_ASSERT( v2.at( "baz" ).at( 1 ).type() == type::VALUE_PTR );
TEST_ASSERT( is_self_contained( v1 ) );
TEST_ASSERT( !is_self_contained( v2 ) );
TEST_ASSERT( is_self_contained( v4 ) );
make_self_contained( v1 );
make_self_contained( v2 );
TEST_ASSERT( is_self_contained( v1 ) );
TEST_ASSERT( is_self_contained( v2 ) );
TEST_ASSERT( v1 == v2 );
TEST_ASSERT( v1 == v4 );
TEST_ASSERT( v2 == v4 );
TEST_ASSERT( v1.at( "bar" ).type() == type::OBJECT );
TEST_ASSERT( v1.at( "baz" ).at( 1 ).type() == type::OBJECT );
TEST_ASSERT( v2.at( "bar" ).type() == type::OBJECT );
TEST_ASSERT( v2.at( "baz" ).at( 1 ).type() == type::OBJECT );
std::byte data[ 4 ];
TEST_ASSERT( is_self_contained( value() ) );
TEST_ASSERT( is_self_contained( value( true ) ) );
TEST_ASSERT( is_self_contained( value( std::string( "hallo" ) ) ) );
TEST_ASSERT( is_self_contained( value( std::int64_t( -1 ) ) ) );
TEST_ASSERT( is_self_contained( value( std::uint64_t( 1 ) ) ) );
TEST_ASSERT( is_self_contained( value( double( 3.0 ) ) ) );
TEST_ASSERT( is_self_contained( value( tao::binary( 2, std::byte( 42 ) ) ) ) );
TEST_ASSERT( is_self_contained( value( null ) ) );
TEST_ASSERT( is_self_contained( value( empty_array ) ) );
TEST_ASSERT( is_self_contained( value( empty_object ) ) );
TEST_ASSERT( is_self_contained( value( std::string_view( "hallo" ) ) ) ); // Default traits put a string in the value for safety.
TEST_ASSERT( is_self_contained( value( tao::binary_view( data, sizeof( data ) ) ) ) ); // Default traits put a binary in the value for safety.
basic_value< view_traits > sv( std::string_view( "hallo" ) );
TEST_ASSERT( !is_self_contained( sv ) );
make_self_contained( sv );
TEST_ASSERT( is_self_contained( sv ) );
TEST_ASSERT( basic_value< view_traits >( std::string_view( "hallo" ) ) == sv );
basic_value< view_traits > bv( tao::binary_view( data, sizeof( data ) ) );
TEST_ASSERT( !is_self_contained( bv ) );
make_self_contained( bv );
TEST_ASSERT( is_self_contained( bv ) );
TEST_ASSERT( basic_value< view_traits >( tao::binary_view( data, sizeof( data ) ) ) == bv );
}
} // namespace tao::json
#include "main.hpp"
| 36.990654 | 149 | 0.59045 | [
"object"
] |
1b92f67bb97e851aade72f61e233dfedbc2605ba | 6,480 | cpp | C++ | grammar/toml/lex-number.cpp | tociyuki/libtoml-cxx11 | 64b4017273e5c94b9bdd57fca3efc6bc6663ac4e | [
"Unlicense"
] | null | null | null | grammar/toml/lex-number.cpp | tociyuki/libtoml-cxx11 | 64b4017273e5c94b9bdd57fca3efc6bc6663ac4e | [
"Unlicense"
] | null | null | null | grammar/toml/lex-number.cpp | tociyuki/libtoml-cxx11 | 64b4017273e5c94b9bdd57fca3efc6bc6663ac4e | [
"Unlicense"
] | null | null | null | #include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#include "../check-builder.hpp"
#include "../layoutable.hpp"
enum {
TOKEN_INVALID,
TOKEN_BAREKEY,
TOKEN_STRKEY,
TOKEN_STRING,
TOKEN_BOOLEAN,
TOKEN_FIXNUM,
TOKEN_FLONUM,
TOKEN_DATETIME,
TOKEN_LBRACE,
TOKEN_RBRACE,
TOKEN_LBRACKET,
TOKEN_RBRACKET,
TOKEN_DOT,
TOKEN_EQUAL,
TOKEN_COMMA,
TOKEN_ENDLINE,
TOKEN_ENDMARK,
};
struct toml_number_type : public layoutable, public check_builder_type {
enum { DIGIT = 1, USCORE, MINUS, PLUS, CDOT, EXP, COLON, TIME, UTC, MATCH };
std::vector<int> base;
std::vector<int> check;
bool defined;
toml_number_type () : check_builder_type (), base (), check (), defined (false) {}
void
define_charset ()
{
charset (0,127, 0);
charset ('0','9', DIGIT);
charset ('_', USCORE);
charset ('-', MINUS);
charset ('+', PLUS);
charset ('.', CDOT);
charset ('e', EXP);
charset ('E', EXP);
charset (':', COLON);
charset ('T', TIME);
charset ('Z', UTC);
}
void
define_state ()
{
// datetime|integer|float
to ( 1, DIGIT, 2);
to ( 2, DIGIT, 3);
to ( 2, USCORE, 29);
to ( 2, MATCH, TOKEN_FIXNUM);
to ( 2, CDOT, 31);
to ( 2, EXP, 33);
to ( 3, DIGIT, 4);
to ( 3, USCORE, 29);
to ( 3, MATCH, TOKEN_FIXNUM);
to ( 3, CDOT, 31);
to ( 3, EXP, 33);
to ( 4, DIGIT, 5);
to ( 4, USCORE, 29);
to ( 4, MATCH, TOKEN_FIXNUM);
to ( 4, CDOT, 31);
to ( 4, EXP, 33);
to ( 5, MINUS, 6);
to ( 5, DIGIT, 5);
to ( 5, USCORE, 29);
to ( 5, MATCH, TOKEN_FIXNUM);
to ( 5, CDOT, 31);
to ( 5, EXP, 33);
to ( 6, DIGIT, 7);
to ( 7, DIGIT, 8);
to ( 8, MINUS, 9);
to ( 9, DIGIT, 10);
to (10, DIGIT, 11);
to (11, TIME, 12);
to (11, UTC, 28);
to (11, PLUS, 23);
to (11, MINUS, 23);
to (11, MATCH, TOKEN_DATETIME);
to (12, DIGIT, 13);
to (13, DIGIT, 14);
to (14, COLON, 15);
to (15, DIGIT, 16);
to (16, DIGIT, 17);
to (17, COLON, 18);
to (17, UTC, 28);
to (17, PLUS, 23);
to (17, MINUS, 23);
to (17, MATCH, TOKEN_DATETIME);
to (18, DIGIT, 19);
to (19, DIGIT, 20);
to (20, UTC, 28);
to (20, PLUS, 23);
to (20, MINUS, 23);
to (20, CDOT, 21);
to (20, MATCH, TOKEN_DATETIME);
to (21, DIGIT, 22);
to (22, DIGIT, 22);
to (22, UTC, 28);
to (22, PLUS, 23);
to (22, MINUS, 23);
to (22, MATCH, TOKEN_DATETIME);
to (23, DIGIT, 24);
to (24, DIGIT, 25);
to (25, COLON, 26);
to (26, DIGIT, 27);
to (27, DIGIT, 28);
to (28, MATCH, TOKEN_DATETIME);
// integer|float
to ( 1, PLUS, 29);
to ( 1, MINUS, 29);
to (29, DIGIT, 30);
to (30, DIGIT, 30);
to (30, USCORE, 29);
to (30, MATCH, TOKEN_FIXNUM);
to (30, CDOT, 31);
to (30, EXP, 33);
to (31, DIGIT, 32);
to (32, DIGIT, 32);
to (32, USCORE, 31);
to (32, MATCH, TOKEN_FLONUM);
to (32, EXP, 33);
to (33, PLUS, 34);
to (33, MINUS, 34);
to (33, DIGIT, 35);
to (34, DIGIT, 35);
to (35, DIGIT, 35);
to (35, USCORE, 34);
to (35, MATCH, TOKEN_FLONUM);
}
toml_number_type&
define ()
{
if (defined)
return *this;
defined = true;
define_charset ();
define_state ();
squarize_table ();
pack_table (base, check);
return *this;
}
std::string
render (std::string const& layout)
{
std::string s = render_int (layout, "@<ncclass@>", cclass.size () / 8);
s = render_int (s, "@<nlookup@>", cclass.size ());
s = render_int (s, "@<nbase@>", base.size ());
s = render_int (s, "@<ncheck@>", check.size ());
s = render_cclass (s, "@<cclass@>\n", cclass);
s = render_vector_dec (s, "@<base@>\n", base);
s = render_vector_hex (s, "@<check@>\n", check);
s = render_int (s, "@<match@>", MATCH);
return std::move (s);
}
};
std::string const layout (R"EOS(
int
toml_decoder_type::scan_number (value_type& value)
{
enum { NSHIFT = @<ncheck@> };
static const uint32_t CCLASS[@<ncclass@>] = {
@<cclass@>
};
static const int BASE[@<nbase@>] = {
@<base@>
};
static const int SHIFT[NSHIFT] = {
@<check@>
};
static const uint32_t MATCH = @<match@>U;
int kind = TOKEN_INVALID;
std::wstring literal;
std::string::const_iterator s = iter;
std::string::const_iterator const e = string.cend ();
for (int next_state = 1; s <= e; ++s) {
uint32_t octet = s == e ? '\0' : ord (*s);
int cls = s == e ? 0 : lookup_cls (CCLASS, @<nlookup@>U, octet);
int const prev_state = next_state;
next_state = 0;
int j = BASE[prev_state] + cls;
int m = BASE[prev_state] + MATCH;
if (0 < j && j < NSHIFT && (SHIFT[j] & 0xff) == prev_state)
next_state = (SHIFT[j] >> 8) & 0xff;
if (next_state && s < e && '_' != octet)
literal.push_back (octet);
if (0 < m && m < NSHIFT && (SHIFT[m] & 0xff) == prev_state) {
kind = (SHIFT[m] >> 8) & 0xff;
try {
if (TOKEN_FIXNUM == kind)
value = ::wjson::fixnum (std::stoll (literal));
else if (TOKEN_FLONUM == kind)
value = ::wjson::flonum (std::stod (literal));
else
value = ::wjson::datetime (literal);
}
catch (std::out_of_range) {
value = ::wjson::null ();
return TOKEN_INVALID;
}
iter = s;
}
if (! next_state)
break;
}
return kind;
}
)EOS"
);
int
main ()
{
toml_number_type number;
std::cout << number.define ().render (layout);
return EXIT_SUCCESS;
}
| 27.457627 | 86 | 0.461883 | [
"render",
"vector"
] |
1b9533cd4e7037ddb46f2f96cc1af0a1e99ca98c | 487 | hpp | C++ | ad_map_access/tests/landmark/KnownTrafficSigns.hpp | woojinjjang/map-1 | d12bb410f03d078a995130b4e671746ace8b6287 | [
"MIT"
] | 61 | 2019-12-19T20:57:24.000Z | 2022-03-29T15:20:51.000Z | ad_map_access/tests/landmark/KnownTrafficSigns.hpp | woojinjjang/map-1 | d12bb410f03d078a995130b4e671746ace8b6287 | [
"MIT"
] | 54 | 2020-04-05T05:32:47.000Z | 2022-03-15T18:42:33.000Z | ad_map_access/tests/landmark/KnownTrafficSigns.hpp | woojinjjang/map-1 | d12bb410f03d078a995130b4e671746ace8b6287 | [
"MIT"
] | 31 | 2019-12-20T07:37:39.000Z | 2022-03-16T13:06:16.000Z | // ----------------- BEGIN LICENSE BLOCK ---------------------------------
//
// Copyright (C) 2018-2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
//
// ----------------- END LICENSE BLOCK -----------------------------------
#pragma once
#include <vector>
#include "ad/map/landmark/TrafficSignType.hpp"
namespace ad {
namespace map {
namespace landmark {
extern std::vector<TrafficSignType> knownTrafficSigns;
} // namespace landmark
} // namespace map
} // namespace ad
| 21.173913 | 74 | 0.570842 | [
"vector"
] |
1b9b29f663b3451a005ce1c4d05441c38d676018 | 561 | hpp | C++ | include/unzip.hpp | NapOli1084/pipes | 842cb9b4ca6c2711d1f38dd8dac768fefe8e5b47 | [
"MIT"
] | null | null | null | include/unzip.hpp | NapOli1084/pipes | 842cb9b4ca6c2711d1f38dd8dac768fefe8e5b47 | [
"MIT"
] | null | null | null | include/unzip.hpp | NapOli1084/pipes | 842cb9b4ca6c2711d1f38dd8dac768fefe8e5b47 | [
"MIT"
] | 1 | 2019-10-28T20:57:29.000Z | 2019-10-28T20:57:29.000Z | #ifndef PIPES_UNZIP_HPP
#define PIPES_UNZIP_HPP
#include "helpers/FWD.hpp"
#include "helpers/meta.hpp"
#include "transform.hpp"
#include <tuple>
#include <utility>
namespace pipes
{
template<size_t... Is>
auto make_transform(std::index_sequence<Is...> const&)
{
return transform([](auto&& tup){return std::get<Is>(FWD(tup));}...);
}
template<typename... OutputPipes>
auto unzip(OutputPipes... outputPipes)
{
return make_transform(std::index_sequence_for<OutputPipes...>{})(outputPipes...);
}
} // namespace pipes
#endif /* PIPES_UNZIP_HPP */
| 19.344828 | 85 | 0.707665 | [
"transform"
] |
1ba2324906d3b41f15fcba28b40466f48e16d4d2 | 903 | cpp | C++ | solutions/0040.combination-sum-ii/0040.combination-sum-ii.1570946701.cpp | nettee/leetcode | 19aa8d54d64cce3679db5878ee0194fad95d8fa1 | [
"MIT"
] | 1 | 2021-01-14T06:01:02.000Z | 2021-01-14T06:01:02.000Z | solutions/0040.combination-sum-ii/0040.combination-sum-ii.1570946701.cpp | nettee/leetcode | 19aa8d54d64cce3679db5878ee0194fad95d8fa1 | [
"MIT"
] | 8 | 2018-03-27T11:47:19.000Z | 2018-11-12T06:02:12.000Z | solutions/0040.combination-sum-ii/0040.combination-sum-ii.1570946701.cpp | nettee/leetcode | 19aa8d54d64cce3679db5878ee0194fad95d8fa1 | [
"MIT"
] | 2 | 2020-04-30T09:47:01.000Z | 2020-12-03T09:34:08.000Z | class Solution {
public:
vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {
sort(candidates.begin(), candidates.end());
vector<vector<int>> res;
vector<int> current;
backtrack(candidates, 0, current, target, res);
return res;
}
void backtrack(vector<int>& candidates, int k, vector<int>& current, int target, vector<vector<int>>& res) {
if (target < 0) {
return;
} else if (target == 0) {
res.push_back(current);
return;
}
for (int i = k; i < candidates.size(); i++) {
if (i > k && candidates[i] == candidates[i-1]) {
continue;
}
current.push_back(candidates[i]);
backtrack(candidates, i+1, current, target - candidates[i], res);
current.pop_back();
}
}
};
| 31.137931 | 112 | 0.51938 | [
"vector"
] |
1ba36e53aac49c80ebc07ee4efef5233865f080a | 8,051 | cpp | C++ | PwdList.cpp | alex-caelus/kryptan_core | e836230391b77a90e5730bd8ec6c1bbbdc110d8a | [
"MIT"
] | null | null | null | PwdList.cpp | alex-caelus/kryptan_core | e836230391b77a90e5730bd8ec6c1bbbdc110d8a | [
"MIT"
] | null | null | null | PwdList.cpp | alex-caelus/kryptan_core | e836230391b77a90e5730bd8ec6c1bbbdc110d8a | [
"MIT"
] | null | null | null | #include "PwdList.h"
#include <stdexcept>
#include <string.h>
#include "Exceptions.h"
using namespace Kryptan::Core;
using namespace std;
#ifdef _WIN32
#include <windows.h>
const char* strcasestr(char* haystack, char* needle)
{
int i;
int matchamt = 0;
for(i=0;i<haystack[i];i++)
{
if (tolower(haystack[i]) != tolower(needle[matchamt]))
{
matchamt = 0;
}
if (tolower(haystack[i]) == tolower(needle[matchamt]))
{
matchamt++;
if (needle[matchamt] == 0) return (char *)1;
}
}
return 0;
}
#else
//unix
#define _strcmpi strcasecmp
#endif
bool myPwdCompare(Pwd* a, Pwd* b)
{
SecureString aSstr = a->GetDescription();
const char* aStr = aSstr.getUnsecureString();
SecureString bSstr = b->GetDescription();
const char* bStr = bSstr.getUnsecureString();
bool res = _strcmpi(aStr, bStr) < 0;
aSstr.UnsecuredStringFinished();
bSstr.UnsecuredStringFinished();
return res;
}
bool myLabelcompare(SecureString a, SecureString b)
{
const char* aStr = a.getUnsecureString();
const char* bStr = b.getUnsecureString();
bool res = _strcmpi(aStr, bStr) < 0;
a.UnsecuredStringFinished();
b.UnsecuredStringFinished();
return res;
}
PwdList::PwdList(void)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
}
PwdList::~PwdList(void)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
for (auto it = pwds.begin(); it != pwds.end(); it++)
{
delete (*it);
}
}
PwdList::PwdList(const PwdList& obj)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
throw std::logic_error("Not implemented");
}
PwdList::PwdVector PwdList::All()
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
pwds.sort(myPwdCompare);
return PwdVector(pwds.begin(), pwds.end());
}
PwdList::PwdVector PwdList::Filter(const SecureString& pattern)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
return Filter(pattern, PwdLabelVector());
}
PwdList::PwdVector PwdList::Filter(const PwdLabelVector& labels)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
return Filter(SecureString(), labels);
}
PwdList::PwdVector PwdList::Filter(const SecureString& pattern, const PwdLabelVector& labels)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
PwdVector filtered;
if (pattern.length() > 0)
{
SecureString patternCpy = pattern;
char* strPtrn = (char*)patternCpy.getUnsecureString();
for (auto it = pwds.begin(); it != pwds.end(); it++)
{
SecureString description = (*it)->GetDescription();
if (strcasestr((char*)description.getUnsecureString(), strPtrn) != NULL)
{
filtered.push_back((*it));
}
description.UnsecuredStringFinished();
}
patternCpy.UnsecuredStringFinished();
}
else {
filtered = PwdVector(pwds.begin(), pwds.end());
}
if (labels.size() > 0)
{
for (auto iLabel = labels.begin(); iLabel != labels.end(); iLabel++)
{
PwdVector passed;
for (auto iPwd = filtered.begin(); iPwd != filtered.end(); iPwd++)
{
if ((*iPwd)->HasLabel(*iLabel))
{
passed.push_back(*iPwd);
}
}
filtered = passed;
}
}
pwds.sort(myPwdCompare);
return filtered;
}
Pwd* PwdList::CreatePwd(const SecureString& desciption, const SecureString& password)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
return CreatePwd(desciption, SecureString(), password);
}
Pwd* PwdList::CreatePwd(const SecureString& desciption, const SecureString& username, const SecureString& password)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
//check if pwd is unique
for (auto it = pwds.begin(); it != pwds.end(); it++)
{
if ((*it)->GetDescription().equals(desciption))
throw KryptanDuplicatePwdException("A password already exist with that name!");
}
Pwd* pwd = new Pwd(this);
pwd->SetDescription(desciption);
pwd->SetUsername(username);
pwd->SetPassword(password);
pwds.push_back(pwd);
return pwd;
}
Pwd* PwdList::CreatePwd(const SecureString& desciption, const SecureString& username, const SecureString& password, time_t created, time_t modified)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
Pwd* pwd = CreatePwd(desciption, username, password);
pwd->SetCTime(created);
pwd->SetMTime(modified);
return pwd;
}
void PwdList::DeletePwd(Pwd* pwd)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
auto sizeBefore = pwds.size();
auto labels = pwd->GetLabels();
for (auto label = labels.begin(); label != labels.end(); label++)
{
RemovePwdFromLabel(pwd, *label);
}
pwds.remove(pwd);
delete pwd;
if (pwds.size() < sizeBefore - 1)
throw KryptanBaseException("DeletePwd removed more than one password, something probably went seriously wrong!");
}
PwdLabelVector PwdList::AllLabels()
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
existingLabels.sort(myLabelcompare);
return PwdLabelVector(existingLabels.begin(), existingLabels.end());
}
PwdLabelVector PwdList::FilterLabels(SecureString pattern)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
PwdLabelVector vector;
const char* strPtrn = pattern.getUnsecureString();
for (auto it = existingLabels.begin(); it != existingLabels.end(); it++)
{
if (strstr(strPtrn, (*it).getUnsecureString()) != NULL)
{
vector.push_back((*it));
}
(*it).UnsecuredStringFinished();
}
pattern.UnsecuredStringFinished();
std::sort(vector.begin(), vector.end(), myLabelcompare);
return vector;
}
int PwdList::CountPwds()
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
return pwds.size();
}
int PwdList::CountPwds(const SecureString& label)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
int count = 0;
for (auto it = pwds.begin(); it != pwds.end(); it++)
{
if ((*it)->HasLabel(label))
count++;
}
return count++;
}
bool PwdList::AddPwdToLabel(Pwd* pwd, SecureString label)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
if (std::find(existingLabels.begin(), existingLabels.end(), label) == existingLabels.end())
{
existingLabels.push_back(label);
}
pwd->AddLabel(label);
return false;
}
bool PwdList::AddPwdToLabelNoMTime(Pwd* pwd, SecureString label)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
if (std::find(existingLabels.begin(), existingLabels.end(), label) == existingLabels.end())
{
existingLabels.push_back(label);
}
pwd->AddLabelNoMTime(label);
return false;
}
bool PwdList::RemovePwdFromLabel(Pwd* pwd, SecureString label)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
pwd->RemoveLabel(label);
if (CountPwds(label) == 0)
{
existingLabels.remove(label);
}
return false;
}
bool PwdList::ValidateDescription(Pwd* pwd, const SecureString& newDescription)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
//check if pwd is unique
for (auto it = pwds.begin(); it != pwds.end(); it++)
{
if ((*it) != pwd && (*it)->GetDescription().equals(newDescription))
return false;
}
return true;
}
void PwdList::ImportPwd(Pwd* pwd)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
if (pwd == NULL)
return;
Pwd* imported = CreatePwd(pwd->GetDescription(), pwd->GetUsername(), pwd->GetPassword(), pwd->GetTimeCreated(), pwd->GetTimeLastModified());
auto label = pwd->GetLabels();
for (auto it = label.begin(); it != label.end(); it++)
{
AddPwdToLabel(imported, *it);
}
} | 26.926421 | 148 | 0.637933 | [
"vector"
] |
1ba73420832e851365d7c04fc6b2f48f3a9c6f5f | 2,487 | cc | C++ | tests/functional_small/ode_advancers/ode_advance_functions.cc | Pressio/pressio | e07eb1ed71266490217f2f7a3aad5e1acfecfd4a | [
"BSD-3-Clause"
] | 29 | 2019-11-11T13:17:57.000Z | 2022-03-16T01:31:31.000Z | tests/functional_small/ode_advancers/ode_advance_functions.cc | Pressio/pressio | e07eb1ed71266490217f2f7a3aad5e1acfecfd4a | [
"BSD-3-Clause"
] | 303 | 2019-09-30T10:15:41.000Z | 2022-03-30T08:24:04.000Z | tests/functional_small/ode_advancers/ode_advance_functions.cc | Pressio/pressio | e07eb1ed71266490217f2f7a3aad5e1acfecfd4a | [
"BSD-3-Clause"
] | 4 | 2020-07-07T03:32:36.000Z | 2022-03-10T05:21:42.000Z |
#include <gtest/gtest.h>
#include "pressio/ode_advancers.hpp"
using ScalarType = double;
using VectorType = std::vector<ScalarType>;
struct MyFakeStepperExplicit
{
void operator()(VectorType & odeState,
const ScalarType & time,
const ScalarType & dt,
const pressio::ode::step_count_type & step)
{
for (std::size_t i=0; i<odeState.size(); i++){
odeState[i] += time;
}
}
};
TEST(ode, explicit_advance_n_steps_fix_dt)
{
VectorType odeState(5);
std::for_each(odeState.begin(), odeState.end(),
[](ScalarType & val){val = 0.0; });
MyFakeStepperExplicit stepper;
ScalarType dt = 2.2;
ScalarType t0 = 1.2;
pressio::ode::advance_n_steps(stepper, odeState, t0, dt, 4);
std::for_each(odeState.begin(), odeState.end(),
[](const ScalarType & val){ EXPECT_DOUBLE_EQ(val, 18.);});
}
struct MyFakeStepper
{
template<typename solver_type>
void operator()(VectorType & odeState,
const ScalarType & t,
const ScalarType & dt,
const int32_t & step,
solver_type & solver)
{
for (int i=0; i<odeState.size(); i++){
odeState[i] += dt;
}
}
};
struct MyFakeSolver
{
template<typename system_t, typename state_t>
void solve(const system_t & sys, state_t & state){}
};
TEST(ode, advance_n_steps_with_dt_setter_and_collector)
{
/*
at step 0: [1,2,3]
at step 1: dt=2, and leads to [3,4,5]
at step 2: dt=0.5, and leads to [3.5,4.5,5.5]
*/
VectorType y(3);
y[0] = 1.0; y[1] = 2.0; y[2] = 3.0;
MyFakeStepper stepper;
MyFakeSolver solver;
std::string checkStr= "PASSED";
auto dtManager = [](const int32_t & step,
const ScalarType & time,
ScalarType & dt)
{
if(step==1) dt = 2.;
if(step==2) dt = 0.5;
if(step==3) dt = 1.;
};
auto collector = [&checkStr](const int32_t & step,
const ScalarType & time,
const VectorType & y)
{
using vec_t = std::vector<ScalarType>;
vec_t true0 = {1., 2., 3.};
vec_t true1 = {3., 4., 5.};
vec_t true2 = {3.5, 4.5, 5.5};
vec_t true3 = {4.5, 5.5, 6.5};
vec_t * trueY = nullptr;
if (step==0) trueY = &true0;
if (step==1) trueY = &true1;
if (step==2) trueY = &true2;
if (step==3) trueY = &true3;
for (auto i=0; i<3; ++i){
if( std::abs(y[i]-(*trueY)[i]) > 1e-11 )
checkStr = "FAILED";
}
};
pressio::ode::advance_n_steps_and_observe(stepper, y, 0., dtManager, 3, collector, solver);
}
| 23.242991 | 93 | 0.59228 | [
"vector"
] |
1bbafeb051d1e2b7fc9bf02c8c007bd281629475 | 1,156 | hpp | C++ | sparta/sparta/utils/SpartaSharedPointerBaseAllocator.hpp | debjyoti0891/map | abdae67964420d7d36255dcbf83e4240a1ef4295 | [
"MIT"
] | 44 | 2019-12-13T06:39:13.000Z | 2022-03-29T23:09:28.000Z | sparta/sparta/utils/SpartaSharedPointerBaseAllocator.hpp | debjyoti0891/map | abdae67964420d7d36255dcbf83e4240a1ef4295 | [
"MIT"
] | 222 | 2020-01-14T21:58:56.000Z | 2022-03-31T20:05:12.000Z | sparta/sparta/utils/SpartaSharedPointerBaseAllocator.hpp | debjyoti0891/map | abdae67964420d7d36255dcbf83e4240a1ef4295 | [
"MIT"
] | 19 | 2020-01-03T19:03:22.000Z | 2022-01-09T08:36:20.000Z | #pragma once
namespace sparta
{
#ifndef DO_NOT_DOCUMENT
////////////////////////////////////////////////////////////////////////////////
// Internals to support cross object allocation (derivative types)
// using Allocators. In a nutshell, if one SSP
// (SpartaSharedPointer) of the base type is being reclaimed via
// an allocator, we want to steer that deallocation to the correct
// deallocator.
template <class PointerT>
class SpartaSharedPointer;
//! Base class for the Allocator -- typeless and allows releasing
//! of an object of derived types.
class BaseAllocator {
public:
virtual ~BaseAllocator() {}
struct MemBlockBase {
MemBlockBase(BaseAllocator * alloc_in) : alloc(alloc_in) {}
virtual ~MemBlockBase() {}
BaseAllocator * const alloc = nullptr;
};
template<class PointerT>
friend class SpartaSharedPointer;
protected:
// Release an object; release the block
virtual void releaseObject_(void * block) const noexcept = 0;
virtual void releaseBlock_(void * block) = 0;
};
#endif
}
| 29.641026 | 84 | 0.606401 | [
"object"
] |
1bbf5d926222b8f5f1ebbcc2c2b7262e411934c5 | 1,821 | hpp | C++ | MLPP/TanhReg/TanhReg.hpp | KangLin/MLPP | abd2dba6076c98aa2e1c29fb3198b74a3f28f8fe | [
"MIT"
] | 927 | 2021-12-03T07:02:25.000Z | 2022-03-30T07:37:23.000Z | MLPP/TanhReg/TanhReg.hpp | DJofOUC/MLPP | 6940fc1fbcb1bc16fe910c90a32d9e4db52e264f | [
"MIT"
] | 7 | 2022-02-13T22:38:08.000Z | 2022-03-07T01:00:32.000Z | MLPP/TanhReg/TanhReg.hpp | DJofOUC/MLPP | 6940fc1fbcb1bc16fe910c90a32d9e4db52e264f | [
"MIT"
] | 132 | 2022-01-13T02:19:04.000Z | 2022-03-23T19:23:56.000Z | //
// TanhReg.hpp
//
// Created by Marc Melikyan on 10/2/20.
//
#ifndef TanhReg_hpp
#define TanhReg_hpp
#include <vector>
#include <string>
namespace MLPP {
class TanhReg{
public:
TanhReg(std::vector<std::vector<double>> inputSet, std::vector<double> outputSet, std::string reg = "None", double lambda = 0.5, double alpha = 0.5);
std::vector<double> modelSetTest(std::vector<std::vector<double>> X);
double modelTest(std::vector<double> x);
void gradientDescent(double learning_rate, int max_epoch, bool UI = 1);
void SGD(double learning_rate, int max_epoch, bool UI = 1);
void MBGD(double learning_rate, int max_epoch, int mini_batch_size, bool UI = 1);
double score();
void save(std::string fileName);
private:
double Cost(std::vector <double> y_hat, std::vector<double> y);
std::vector<double> Evaluate(std::vector<std::vector<double>> X);
std::vector<double> propagate(std::vector<std::vector<double>> X);
double Evaluate(std::vector<double> x);
double propagate(std::vector<double> x);
void forwardPass();
std::vector<std::vector<double>> inputSet;
std::vector<double> outputSet;
std::vector<double> z;
std::vector<double> y_hat;
std::vector<double> weights;
double bias;
int n;
int k;
// UI Portion
void UI(int epoch, double cost_prev);
// Regularization Params
std::string reg;
double lambda;
double alpha; /* This is the controlling param for Elastic Net*/
};
}
#endif /* TanhReg_hpp */
| 30.35 | 161 | 0.562878 | [
"vector"
] |
1bc083899fe4a21c17592c1b46c59fb3e19dfa2f | 8,926 | cc | C++ | main/src/Import/save_obj.cc | marcomanno/ploygon_triangulation | c98b99e3f9598252ffc27eb202939f0183ac872b | [
"Apache-2.0"
] | null | null | null | main/src/Import/save_obj.cc | marcomanno/ploygon_triangulation | c98b99e3f9598252ffc27eb202939f0183ac872b | [
"Apache-2.0"
] | null | null | null | main/src/Import/save_obj.cc | marcomanno/ploygon_triangulation | c98b99e3f9598252ffc27eb202939f0183ac872b | [
"Apache-2.0"
] | null | null | null | //#pragma optimize ("", off)
#include <import.hh>
#include <Geo/vector.hh>
#include <PolygonTriangularization/poly_triang.hh>
#include <Topology/impl.hh>
#include <Topology/iterator.hh>
#include <Utils/error_handling.hh>
#include <fstream>
#include <iomanip>
#include <map>
#include <set>
#include <sstream>
namespace IO {
bool save_obj(const char* _flnm, const Topo::Wrap<Topo::Type::BODY> _body,
bool _split)
{
std::ofstream fstr(_flnm);
THROW_IF(!fstr, "IO save error");
fstr << std::setprecision(17);
Topo::Iterator<Topo::Type::BODY, Topo::Type::VERTEX> vert_it(_body);
std::vector<Topo::Wrap<Topo::Type::VERTEX>> verts;
for (size_t i = 0; i < vert_it.size(); ++i)
{
auto v = vert_it.get(i);
verts.emplace_back(v);
}
std::sort(verts.begin(), verts.end());
verts.erase(std::unique(verts.begin(), verts.end()), verts.end());
std::vector<Geo::Point> all_pts;
for (const auto& v : verts)
{
all_pts.emplace_back();
v->geom(all_pts.back());
}
std::sort(all_pts.begin(), all_pts.end());
for (const auto& pt : all_pts)
fstr << "v " << pt[0] << " " << pt[1] << " " << pt[2] << "\n";
Topo::Iterator<Topo::Type::BODY, Topo::Type::FACE> face_it(_body);
for (size_t i = 0; i < face_it.size(); ++i)
{
auto f = face_it.get(i);
Topo::Iterator<Topo::Type::FACE, Topo::Type::LOOP> fl_it(f);
if (_split)
{
auto poly_t = Geo::IPolygonTriangulation::make();
for (const auto& loop : fl_it)
{
std::vector<Geo::VectorD3> plgn;
Topo::Iterator<Topo::Type::LOOP, Topo::Type::VERTEX> lv_it(loop);
for (const auto& v : lv_it)
{
plgn.emplace_back();
v->geom(plgn.back());
}
poly_t->add(plgn);
}
for (const auto& tri : poly_t->triangles())
{
fstr << "f";
for (auto ind : tri)
{
const auto& pt = poly_t->polygon()[ind];
const auto idx = std::lower_bound(all_pts.begin(),
all_pts.end(), pt) - all_pts.begin() + 1;
fstr << " " << idx;
}
fstr << "\n";
}
}
else
{
bool isle = false;
for (const auto& loop : fl_it)
{
Topo::Iterator<Topo::Type::LOOP, Topo::Type::VERTEX> lv_it(loop);
fstr << "f";
if (isle)
fstr << " ";
for (const auto& v : lv_it)
{
Geo::Point pt;
v->geom(pt);
const auto idx = std::lower_bound(
all_pts.begin(), all_pts.end(), pt) - all_pts.begin() + 1;
fstr << " " << idx;
}
fstr << "\n";
isle = true;
}
}
}
return fstr.good();
}
bool save_face(const Topo::E<Topo::Type::FACE>* _ptr, const char* _flnm,
const bool _split)
{
std::ofstream fstr(_flnm);
fstr << std::setprecision(17);
if (_split)
{
Topo::Iterator<Topo::Type::FACE, Topo::Type::VERTEX> vert_it(
const_cast<Topo::E<Topo::Type::FACE>*>(_ptr));
std::vector<Geo::VectorD3> plgn;
for (const auto& vert : vert_it)
{
Geo::VectorD3 pt;
vert->geom(pt);
plgn.emplace_back(pt);
}
auto poly_t = Geo::IPolygonTriangulation::make();
poly_t->add(plgn);
for (const auto& pt : poly_t->polygon())
{
fstr << "v " << pt[0] << " " << pt[1] << " " << pt[2] << "\n";
}
for (const auto& tri : poly_t->triangles())
{
fstr << "f";
for (auto idx : tri)
fstr << " " << idx + 1;
fstr << "\n";
}
}
else
{
std::string fv;
int i = 0;
Topo::Iterator<Topo::Type::FACE, Topo::Type::LOOP> loop_it(
const_cast<Topo::E<Topo::Type::FACE>*>(_ptr));
for (const auto& loop : loop_it)
{
Topo::Iterator<Topo::Type::LOOP, Topo::Type::VERTEX> vert_it(loop);
fv += "f";
for (const auto& vert : vert_it)
{
Geo::Point pt;
vert->geom(pt);
fstr << "v " << pt[0] << " " << pt[1] << " " << pt[2] << "\n";
fv += ' ';
fv += std::to_string(++i);
}
fv += "\n";
}
fstr << fv;
}
return fstr.good();
}
bool save_face(const Topo::E<Topo::Type::FACE>* _ptr, int _num,
const bool _split)
{
return save_face(_ptr, (std::to_string(_num) + ".obj").c_str(), _split);
}
void save_obj(const char* _flnm,
const std::vector<Geo::VectorD3>& _plgn,
const std::vector<size_t>* _inds)
{
std::string flnm;
static int n = 0;
if (_flnm != nullptr)
flnm = _flnm;
else
flnm = std::string("_deb_obj_") + std::to_string(n++);
std::ofstream ff(flnm + ".obj");
ff << std::setprecision(17);
for (const auto& v : _plgn) { ff << "v" << v << "\n"; }
ff << "f";
if (_inds == nullptr)
for (int i = 1; i <= _plgn.size(); ++i)
ff << " " << i;
else
for (auto i : *_inds)
ff << " " << i + 1;
ff << "\n";
}
void save_obj(const char* _flnm,
const std::vector<Topo::Wrap<Topo::Type::VERTEX>>& _verts)
{
std::vector<Geo::VectorD3> plgn;
for (auto vert : _verts)
{
plgn.emplace_back();
vert->geom(plgn.back());
}
save_obj(_flnm, plgn);
}
struct Saver : public ISaver
{
void add_face(const Topo::Wrap<Topo::Type::FACE>& _f) override { faces_.insert(_f); }
void add_edge(const Topo::Wrap<Topo::Type::EDGE>& _e) override { edges_.insert(_e); }
bool compute(const char* _flnm) override;
std::set<Topo::Wrap<Topo::Type::FACE>> faces_;
std::set<Topo::Wrap<Topo::Type::EDGE>> edges_;
};
std::shared_ptr<ISaver> ISaver::make()
{
return std::make_shared<Saver>();
}
bool Saver::compute(const char* _flnm)
{
std::vector<Topo::Wrap<Topo::Type::VERTEX>> vertices;
for (const auto& f : faces_)
{
Topo::Iterator<Topo::Type::FACE, Topo::Type::VERTEX> vert_it(f);
for (auto& vert : vert_it)
vertices.push_back(vert);
}
for (const auto& e : edges_)
{
Topo::Iterator<Topo::Type::EDGE, Topo::Type::VERTEX> ed_it(e);
for (auto& vert : ed_it)
vertices.push_back(vert);
}
std::sort(vertices.begin(), vertices.end());
auto new_end = std::unique(vertices.begin(), vertices.end());
vertices.erase(new_end, vertices.end());
std::ofstream fstr(_flnm);
fstr << std::setprecision(17);
auto save_vertices = [&fstr](std::vector<Topo::Wrap<Topo::Type::VERTEX>>& _vv)
{
for (auto& v : _vv)
{
Geo::Point pt;
v->geom(pt);
fstr << "v " << pt << "\n";
}
};
auto vertex_position = [&vertices](const Topo::Wrap<Topo::Type::VERTEX>& _v)
{
auto range = std::equal_range(vertices.begin(), vertices.end(), _v);
if (range.first == range.second)
return ptrdiff_t(-1);
return std::distance(vertices.begin(), range.first);
};
std::vector<std::array<size_t, 3>> inters;
std::vector<size_t> extra_ind(vertices.size(), 0);
std::vector<Topo::Wrap<Topo::Type::VERTEX>> extra_vertices;
for (const auto& e : edges_)
{
Topo::Iterator<Topo::Type::EDGE, Topo::Type::FACE> ef(e);
bool skip = false;
for (auto& f : ef)
skip |= faces_.find(f) != faces_.end();
if (!skip)
{
Topo::Iterator<Topo::Type::EDGE, Topo::Type::VERTEX> ev(e);
auto it = ev.begin();
auto v_ind0 = vertex_position(*it);
auto v_ind1 = vertex_position(*++it);
auto& v_ind2 = extra_ind[v_ind0];
if (v_ind2 == 0)
{
v_ind2 = extra_vertices.size();
extra_vertices.push_back(vertices[v_ind0]);
}
inters.push_back({ size_t(v_ind0) , size_t(v_ind1), v_ind2 });
}
}
save_vertices(vertices);
save_vertices(extra_vertices);
for (const auto& f : faces_)
{
Topo::Iterator<Topo::Type::FACE, Topo::Type::LOOP> fel(f);
auto polyt = Geo::IPolygonTriangulation::make();
std::map<Geo::Point, Topo::Wrap<Topo::Type::VERTEX>> pos_vert_map;
for (const auto& loop : fel)
{
Topo::Iterator<Topo::Type::LOOP, Topo::Type::VERTEX> lv(loop);
std::vector<Geo::Point> plygon;
for (const auto& v : lv)
{
Geo::Point pt;
v->geom(pt);
plygon.push_back(pt);
pos_vert_map.emplace(pt, v);
}
polyt->add(plygon);
}
const auto& tris = polyt->triangles();
const auto& pos = polyt->polygon();
for (auto& tri : tris)
{
fstr << "f";
for (int i = 0; i < 3; ++i)
{
const auto& v = pos_vert_map[pos[tri[i]]];
auto v_ind = vertex_position(v);
fstr << " " << v_ind + 1;
}
fstr << "\n";
}
}
for (auto& tri : inters)
fstr << "f " << tri[0] + 1 << " " << tri[1] + 1 << " " << tri[2] + vertices.size() + 1 << "\n";
return true;
}
}//namespace Import | 28.157729 | 100 | 0.531929 | [
"vector"
] |
1bc116e18fb0878f59681f47474a2ca6fc7f4641 | 2,159 | cpp | C++ | src/mytoggle.cpp | arrufat/json-tui | ed49aa41b6c0d7182ae6d19e3ff10b75905bfa49 | [
"MIT"
] | null | null | null | src/mytoggle.cpp | arrufat/json-tui | ed49aa41b6c0d7182ae6d19e3ff10b75905bfa49 | [
"MIT"
] | null | null | null | src/mytoggle.cpp | arrufat/json-tui | ed49aa41b6c0d7182ae6d19e3ff10b75905bfa49 | [
"MIT"
] | null | null | null | // Copyright 2022 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "mytoggle.hpp"
#include "ftxui/component/event.hpp"
namespace {
using namespace ftxui;
class MyToggleImpl : public ComponentBase {
public:
MyToggleImpl(const char* label_on,
const char* label_off,
bool* state)
: label_on_(label_on),
label_off_(label_off),
state_(state) {}
private:
// Component implementation.
Element Render() override {
bool is_focused = Focused();
bool is_active = Active();
auto style = (is_focused || hovered_) ? inverted
: is_active ? bold
: nothing;
auto focus_management = is_focused ? focus
: is_active ? ftxui::select
: nothing;
Element my_text = *state_ ? text(label_on_) : text(label_off_);
return my_text | style | focus_management | reflect(box_);
}
bool OnEvent(Event event) override {
if (!CaptureMouse(event))
return false;
if (event.is_mouse())
return OnMouseEvent(event);
hovered_ = false;
if (event == Event::Character(' ') || event == Event::Return) {
*state_ = !*state_;
TakeFocus();
return true;
}
return false;
}
bool OnMouseEvent(Event event) {
hovered_ = box_.Contain(event.mouse().x, event.mouse().y);
if (!CaptureMouse(event))
return false;
if (!hovered_)
return false;
if (event.mouse().button == Mouse::Left &&
event.mouse().motion == Mouse::Pressed) {
*state_ = !*state_;
return true;
}
return false;
}
bool Focusable() const final { return true; }
const char* label_on_;
const char* label_off_;
bool* const state_;
bool hovered_ = false;
Box box_;
};
} // namespace
ftxui::Component MyToggle(const char* label_on,
const char* label_off,
bool* state) {
return ftxui::Make<MyToggleImpl>(label_on, label_off, state);
}
| 25.104651 | 78 | 0.586383 | [
"render"
] |
1bc88e9ba78765fb2b71eb73ce3a9c1689731a33 | 1,059 | cpp | C++ | src/Canvas.cpp | Seizzzz/RayTracer | e8399c311e700ae494a1c353e553d9f0727361a4 | [
"MIT"
] | null | null | null | src/Canvas.cpp | Seizzzz/RayTracer | e8399c311e700ae494a1c353e553d9f0727361a4 | [
"MIT"
] | null | null | null | src/Canvas.cpp | Seizzzz/RayTracer | e8399c311e700ae494a1c353e553d9f0727361a4 | [
"MIT"
] | null | null | null | #include "Canvas.h"
#include "Common.h"
Canvas::Canvas()
{
outPPM.open(Common::g_PPMFilePath);
}
Canvas::~Canvas()
{
outPPM.close();
}
void Canvas::Render(const function<Color(uint32_t&, uint32_t&)>& func)
{
outPPM << "P3\n" << Common::g_ImageWidth << ' ' << Common::g_ImageHeight << "\n255\n";
for (auto line = 0u; line < Common::g_ImageHeight; ++line)
{
auto j = Common::g_ImageHeight - line;
outInfo << "\nLine remaining: " << j << std::flush;
for (auto i = 0u; i < Common::g_ImageWidth; ++i)
{
auto color = Color(0.0, 0.0, 0.0);
for(auto times = 0u; times < Common::g_SamplesPerPixel; ++times)
{
color += func(i, j);
}
WriteColor(color, Common::g_SamplesPerPixel);
}
}
}
void Canvas::WriteColor(Color pxColor, uint32_t pxSamples)
{
auto scale = 1.0 / pxSamples;
pxColor = (scale * pxColor).gamma();
outPPM
<< static_cast<int>(256 * clamp(pxColor.x(), 0.0, 0.999)) << ' '
<< static_cast<int>(256 * clamp(pxColor.y(), 0.0, 0.999)) << ' '
<< static_cast<int>(256 * clamp(pxColor.z(), 0.0, 0.999)) << '\n';
}
| 24.627907 | 87 | 0.612842 | [
"render"
] |
1bc98bbd6f33a3c91876285278cdba169678ec82 | 5,532 | cpp | C++ | core/src/support/GLUtil.cpp | flyskywhy/GCanvas | b5e0109eedf6f278bde0bd5cbf2b193c8170f101 | [
"Apache-2.0"
] | null | null | null | core/src/support/GLUtil.cpp | flyskywhy/GCanvas | b5e0109eedf6f278bde0bd5cbf2b193c8170f101 | [
"Apache-2.0"
] | null | null | null | core/src/support/GLUtil.cpp | flyskywhy/GCanvas | b5e0109eedf6f278bde0bd5cbf2b193c8170f101 | [
"Apache-2.0"
] | null | null | null | /**
* Created by G-Canvas Open Source Team.
* Copyright (c) 2017, Alibaba, Inc. All rights reserved.
*
* This source code is licensed under the Apache Licence 2.0.
* For the full copyright and license information, please view
* the LICENSE file in the root directory of this source tree.
*/
#include "GLUtil.h"
namespace gcanvas {
//////////////////////////////////////////////////////////////////////////////
/// Pixels Sample
//////////////////////////////////////////////////////////////////////////////
struct RGBA {
RGBA &operator+=(int c) {
r += c & 0xff;
g += c >> 8 & 0xff;
b += c >> 16 & 0xff;
a += c >> 24 & 0xff;
return *this;
}
operator uint32_t() {
uint32_t c = 0;
c += r & 0xff;
c += g << 8 & 0xff00;
c += b << 16 & 0xff0000;
c += a << 24 & 0xff000000;
return c;
}
uint16_t r = 0;
uint16_t g = 0;
uint16_t b = 0;
uint16_t a = 0;
};
inline RGBA operator/(const RGBA &a, int b) {
RGBA c;
c.r = a.r / b;
c.g = a.g / b;
c.b = a.b / b;
c.a = a.a / b;
return c;
}
inline int GetPixel(int *pixels, int x, int y, int width, int height) {
if (x < 0) {
x = 0;
}
if (x > width - 1) {
x = width - 1;
}
if (y < 0) {
y = 0;
}
if (y > height - 1) {
y = height - 1;
}
return pixels[y * width + x];
}
void PixelsSampler(int inWidth, int inHeight, int *inPixels, int outWidth, int outHeight,
int *outPixels) {
if (outWidth == 1 && outHeight == 1) {
// when GetImageData 1x1 , it means APP want color pick 1 pixel, so
// it's better not `pixel / 9` below but just pick 1 pixel exactly
// in PixelsSampler() after GCanvasContext::GetImageData(), and since
// float x y from PanResponder event which be divided by devicePixelRatio
// (so that can be float), is converted to int x y in GCanvasWeex::GetImageData(),
// so the exact pixel is inPixels[left bottom] while considering flip Y
int inY = 0;
int revertY = (inHeight - 1) - inY; // bottom is (3 - 1) - 0 = 2
int inX = 0; // left is 0
outPixels[0] = GetPixel(inPixels, inX, revertY, inWidth, inHeight);
} else {
for (int y = 0; y < outHeight; ++y) {
int inY = y * inHeight / outHeight;
int revertY = (inHeight - 1) - inY - 1;
for (int x = 0; x < outWidth; ++x) {
int inX = x * inWidth / outWidth + 1;
RGBA pixel;
pixel += GetPixel(inPixels, inX, revertY, inWidth, inHeight);
pixel += GetPixel(inPixels, inX - 1, revertY - 1, inWidth, inHeight);
pixel += GetPixel(inPixels, inX, revertY - 1, inWidth, inHeight);
pixel += GetPixel(inPixels, inX + 1, revertY - 1, inWidth, inHeight);
pixel += GetPixel(inPixels, inX - 1, revertY, inWidth, inHeight);
pixel += GetPixel(inPixels, inX + 1, revertY, inWidth, inHeight);
pixel += GetPixel(inPixels, inX - 1, revertY + 1, inWidth, inHeight);
pixel += GetPixel(inPixels, inX, revertY + 1, inWidth, inHeight);
pixel += GetPixel(inPixels, inX - 1, revertY + 1, inWidth, inHeight);
outPixels[y * outWidth + x] = pixel / 9;
}
}
}
}
//////////////////////////////////////////////////////////////////////////////
/// Pixels BindTexture
//////////////////////////////////////////////////////////////////////////////
GLuint PixelsBindTexture(const unsigned char *rgbaData, GLint format, unsigned int width,
unsigned int height, std::vector<GCanvasLog> *errVec) {
if (nullptr == rgbaData)
return (GLuint) - 1;
GLenum glerror = 0;
GLuint glID;
glGenTextures(1, &glID);
glerror = glGetError();
if (glerror && errVec) {
GCanvasLog log;
fillLogInfo(log, "gen_texture_fail", "<function:%s, glGetError:%x>", __FUNCTION__,
glerror);
errVec->push_back(log);
}
glBindTexture(GL_TEXTURE_2D, glID);
glerror = glGetError();
if (glerror && errVec) {
GCanvasLog log;
fillLogInfo(log, "bind_texture_fail", "<function:%s, glGetError:%x>", __FUNCTION__,
glerror);
errVec->push_back(log);
}
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format,
GL_UNSIGNED_BYTE, rgbaData);
glerror = glGetError();
if (glerror && errVec) {
GCanvasLog log;
fillLogInfo(log, "glTexImage2D_failglTexImage2D_fail", "<function:%s, glGetError:%x>",
__FUNCTION__, glerror);
errVec->push_back(log);
}
return glID;
}
}
| 37.127517 | 98 | 0.487708 | [
"vector"
] |
1bc99a04410f557e8d85b29ddab4439216d45d7d | 59,842 | cpp | C++ | LocalizeRCDlg.cpp | yfdyh000/LocalizeRC | 630d7ed2720c1326046569c1b4d6f5a40b2dd819 | [
"BSD-2-Clause"
] | null | null | null | LocalizeRCDlg.cpp | yfdyh000/LocalizeRC | 630d7ed2720c1326046569c1b4d6f5a40b2dd819 | [
"BSD-2-Clause"
] | null | null | null | LocalizeRCDlg.cpp | yfdyh000/LocalizeRC | 630d7ed2720c1326046569c1b4d6f5a40b2dd819 | [
"BSD-2-Clause"
] | null | null | null | // LocalizeRCDlg.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "IniEx.h"
#include "LocalizeRC.h"
#include "LocalizeRCDlg.h"
#include <math.h>
#include <boost/regex/mfc.hpp>
#define OLDFILEFORMAT -2
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
//#define _MFC_VER 0x0420
#define KEYWORD_ACCELERATORS 0
#define KEYWORD_DIALOG 1
#define KEYWORD_DIALOGEX 2
#define KEYWORD_MENU 3
#define KEYWORD_MENUEX 4
#define KEYWORD_STRINGTABLE 5
#define KEYWORD_DLGINIT 6
#define KEYWORD_code_page 7
#define NUMKEYWORDS 8
LPCTSTR strKeywords[NUMKEYWORDS] =
{
_T("ACCELERATORS"),
_T("DIALOG"),
_T("DIALOGEX"),
_T("MENU"),
_T("MENUEX"),
_T("STRINGTABLE"),
_T("DLGINIT"),
_T("code_page")
};
// random string, that indicates an error
#define ERR_STR _T("asfdshkagzuwrthgadsfhgkh12385143258")
int _LineCount( CString &srchBuf, int startPos = 0, int endPos = -1 )
{
// Purpose: Get count of text lines in a specified area of a string buffer
// Parameters:
// srchBuf (in) The input string buffer to search for lines. Must be null terminated.
// startPos (in) Character offset into buffer where search is to begin (default = 0)
// endPos (in) Character offset into buffer one beyond last character to search.
// Default (-1) searches entire length (up to a null terminator)
// Note: all character offsets are zero based
//
// Returns: number of text lines found in specified area of string buffer
//
int lfnd = startPos;
int lend = srchBuf.GetLength();
if ( endPos > -1 && endPos < lend )
lend = endPos;
//
int linecount = 0;
while ( lfnd < lend )
{
lfnd = srchBuf.Find( _T('\n'), lfnd ) + 1;
if ( lfnd < 0 || lfnd > lend )
break;
//
linecount++;
};
return linecount;
}
int _GetLinePos( CString &srchBuf, int startPos, int line )
{
// Get buffer offset in characters to the start of a specified line number
// Parameters:
// srchBuf (in) The input string buffer to search. Must be null terminated.
// startPos (in) Character offset into buffer to begin the search (0 based)
// line (in) The line number whose position is needed (0 based)
//
// Returns: Character offset into srchBuf to the start of the specified line, or -1
// if line is <0, line exceeds number of lines in the buffer, or startPos exceeds
// number characters in string buffer.
int lfnd = startPos; // Search begins at this offset
int lend = srchBuf.GetLength(); // Search ends at this offset
int iRet = -1;
if ( startPos > -1 && startPos < lend )
{
for ( int i = 0 ; i < line ; i++ )
{
lfnd = srchBuf.Find( _T('\n'), lfnd ) + 1;
if ( lfnd < 0 || lfnd > lend )
{
lfnd = -1; // Search failed
break;
}
}
iRet = lfnd;
}
return iRet;
}
int _GetLengthOfValue( CString &strbuf, int startpos )
{
// Purpose: return length of a number string including any leading spaces
// Parameters:
// strbuf (in) String buffer containing substring
// startpos (in) Starting character offset into string buffer to substring
//
// Returns: length of number including any leading spaces; returns 0 if not a number
//
int digits = 0;
int retlen = 0;
for ( int i = startpos; ; i++, retlen++ )
{
TCHAR ch = strbuf.GetAt(i);
if ( ch == _T(' ') && digits == 0 ) // Allow leading spaces
continue;
else if ( ch < _T('0') || ch > _T('9') ) // Done with number
break;
else // Count off a digit
digits++;
//
}
return retlen;
}
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
DECLARE_MESSAGE_MAP()
private:
CString m_strAbout;
public:
virtual BOOL OnInitDialog();
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
, m_strAbout(_T(""))
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_ABOUT, m_strAbout);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
BOOL CAboutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_strAbout.LoadString( IDS_ABOUT );
UpdateData( false );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// CLocalizeRCDlg dialog
CLocalizeRCDlg::CLocalizeRCDlg(CString& strWorkspace, CWnd* pParent /*=NULL*/)
: CDialog(CLocalizeRCDlg::IDD, pParent)
, m_bCopy(FALSE)
, m_nObsoleteItems(0)
, m_strWorkspace(strWorkspace)
, m_strEdit(_T(""))
, m_strTextmode(_T(""))
, m_bNoSort(FALSE)
, m_strInputRC(_T(""))
, m_strLangINI(_T(""))
, m_strOutputRC(_T(""))
, m_strAbout(_T(""))
{
if(m_strWorkspace.IsEmpty())
{
// last used Workspace from registry
m_strWorkspace = AfxGetApp()->GetProfileString(SEC_LASTPROJECT, ENT_WORKSPACE);
}
}
void CLocalizeRCDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Check(pDX, IDC_COPY, m_bCopy);
DDX_CBIndex(pDX, IDC_OBS_ITEMS, m_nObsoleteItems);
DDX_Text(pDX, IDC_WORKSPACE, m_strWorkspace);
DDX_Control(pDX, IDC_LANGUAGE, m_CtrlLanguage);
DDX_Text(pDX, IDC_EDIT, m_strEdit);
DDX_Text(pDX, IDC_TEXTMODE, m_strTextmode);
DDX_Check(pDX, IDC_NOSORT, m_bNoSort);
DDX_Text(pDX, IDC_INPUTRC, m_strInputRC);
DDX_Text(pDX, IDC_LANGINI, m_strLangINI);
DDX_Text(pDX, IDC_OUTPUTRC, m_strOutputRC);
DDX_Text(pDX, IDC_ABOUT, m_strAbout);
}
BEGIN_MESSAGE_MAP(CLocalizeRCDlg, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_CREATEINI, OnBnClickedCreateini)
ON_BN_CLICKED(IDC_OPENINI, OnBnClickedOpenini)
ON_BN_CLICKED(IDC_CREATEOUTPUT, OnBnClickedCreateoutput)
ON_WM_DESTROY()
ON_BN_CLICKED(IDC_REVERSEINI, OnBnClickedReverseini)
ON_BN_CLICKED(IDC_CHNG_WORKSPACE, OnBnClickedChngWorkspace)
ON_CBN_SELCHANGE(IDC_LANGUAGE, OnCbnSelchangeLanguage)
ON_CBN_SELCHANGE(IDC_OBS_ITEMS, OnCbnSelchangeObsItems)
ON_BN_KILLFOCUS(IDC_COPY, OnBnKillfocusCopy)
ON_BN_KILLFOCUS(IDC_NOSORT, OnBnKillfocusNosort)
ON_BN_CLICKED(IDC_NEW_WORKSPACE, OnBnClickedNewWorkspace)
ON_BN_CLICKED(IDC_CHNG_INPUTRC, OnBnClickedChngInputrc)
ON_BN_CLICKED(IDC_CHNG_LANGINI, OnBnClickedChngLangini)
ON_BN_CLICKED(IDC_CHNG_OUTPUTRC, OnBnClickedChngOutputrc)
END_MESSAGE_MAP()
// CLocalizeRCDlg message handlers
BOOL CLocalizeRCDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// LoadIcon only loads the 32x32 icon, therefore use ::LoadImage for other sizes (16x16)
hLargeIcon = AfxGetApp()->LoadIcon ( IDR_MAINFRAME );
hSmallIcon = (HICON) ::LoadImage ( AfxGetResourceHandle(),
MAKEINTRESOURCE(IDR_MAINFRAME),
IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR );
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(hLargeIcon, TRUE); // Set big icon
SetIcon(hSmallIcon, FALSE); // Set small icon
// display text mode (UNICODE/ANSI)
#ifdef UNICODE
m_strTextmode.LoadString( IDS_UNICODE );
#else
m_strTextmode.LoadString( IDS_ANSI );
#endif
m_strAbout.LoadString( IDS_ABOUT );
UpdateData(false);
// get installed languages
CFileFind Finder;
TCHAR szFilename[MAX_PATH];
GetModuleFileName( NULL, szFilename, MAX_PATH );
AddLanguage( &m_CtrlLanguage, _T("09"), LangID );
// the last 4 chars are the LanguageID in hexadecimal form
CString strSearch;
strSearch.Format( _T("%sLocalizeRC????.dll"), GetFolder(szFilename) );
BOOL bResult = Finder.FindFile( strSearch );
CString strLangCode;
while( bResult )
{
bResult = Finder.FindNextFile();
// extract 2-digit language code
strLangCode = Finder.GetFileTitle().Right(2);
AddLanguage( &m_CtrlLanguage, strLangCode, LangID );
}
Finder.Close();
// Load last workspace
LoadWorkspace(false);
return TRUE; // return TRUE unless you set the focus to a control
}
void CLocalizeRCDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CLocalizeRCDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, hSmallIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this function to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CLocalizeRCDlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(hSmallIcon);
}
BOOL CLocalizeRCDlg::OpenInputRC(BOOL bShowError)
{
return OpenRCFile( m_strInputRC, newRCdata, bShowError );
}
void CLocalizeRCDlg::LogUserMessage( int strID )
{
CString msg;
msg.FormatMessage( strID );
LogUserMessage( msg );
}
void CLocalizeRCDlg::LogUserMessage( CString msg )
{
m_strEdit.Append( msg );
m_strEdit.Append( _T("\n") );
UpdateData( false );
}
BOOL CLocalizeRCDlg::OpenRCFile( CString filename, CString &strbuf, BOOL bShowError )
{
// The file from which to load the contents of rich edit control
CStdioFile* pFile = NULL;
if( filename.IsEmpty() )
{
if( bShowError )
LogUserMessage( IDS_ERR_FILENAMEEMPTY );
// clear contents in edit-control
strbuf = _T("");
UpdateData( false );
return false;
}
CStdioUnicodeFile::FILEENCODING encoding = CStdioUnicodeFile::GetFileEncoding( filename );
try
{
#ifdef UNICODE
switch(encoding)
{
case CStdioUnicodeFile::FILEENCODING_UTF16LE:
case CStdioUnicodeFile::FILEENCODING_UTF8:
pFile = new CStdioUnicodeFile(filename, CFile::modeRead | CFILEFLAG_UNICODEHELPER, encoding);
static_cast<CStdioUnicodeFile*>(pFile)->ReadBOM();
break;
case CStdioUnicodeFile::FILEENCODING_UTF8_WITHOUT_BOM:
pFile = new CStdioUnicodeFile(filename, CFile::modeRead | CFILEFLAG_UNICODEHELPER, encoding);
break;
default:
pFile = new CStdioUnicodeFile( filename, CFile::modeRead, CStdioUnicodeFile::FILEENCODING_ANSI );
}
#else
if( bIsUnicode )
{
CString strErr;
strErr.Format( IDS_UNICODEFILE, filename );
AfxMessageBox( strErr );
// clear contents in edit-control
strbuf = _T("");
UpdateData( false );
return false; // cancel
}
else
pFile = new CStdioUnicodeFile( filename, CFile::modeRead );
#endif
}
catch( CFileException* e )
{
TCHAR szCause[255];
e->GetErrorMessage(szCause, 255);
AfxMessageBox(szCause);
e->Delete();
// clear contents in edit-control
strbuf = _T("");
UpdateData( false );
return false; // cancel
}
// clear contents in edit-control
strbuf = _T("");
// fill edit-control with contents of the input RC-file
// Update dialog size/pos data from an existing output RC file, if any
CString strLine;
while( pFile->ReadString( strLine ) )
strbuf += strLine + _T("\r\n");
//
UpdateData( false );
pFile->Close();
delete pFile;
if ( bShowError ) // Report open status if ok to show it
{
CString msg;
msg.FormatMessage( IDS_LFILEOPENED, filename );
LogUserMessage( msg );
}
return true;
}
void CLocalizeRCDlg::RemoveNewRCFileRESItems( )
{
// Disable ICON, BITMAP, and CURSOR entries that reference the "Res" folder.
// NOTE: HTML entries are a special case - these are not disabled
//
// This cleanup is normally done only if the user has opted to NOT copy the Res
// folder, which may be the case for a language DLL since those resources can
// continue to be loaded from the main app.
//
LogUserMessage( IDS_LRESREMOVAL );
boost::tregex expr( _T("^\\w+\\h+(ICON|BITMAP|CURSOR)\\h+\"(?i)res.+\"$") );
boost::tregex_iterator m1(boost::make_regex_iterator(newRCdata, expr, boost::match_not_dot_newline)), mEnd;
int startpos = 0; // Starting position of current match
int processedcount = 0; // Total number of match hits processed
while ( m1 != mEnd ) // Iterate all matching entries and comment out each one
{
startpos = (*m1)[0].first - newRCdata;
CString chk = newRCdata.Mid( startpos, (*m1)[0].length() );
// Note that edits must not alter the length of the buffer since it will affect
// the active regex search iteration
// Comment out the line by overwriting first 2 characters with //
newRCdata.SetAt( startpos++, _T('/') );
newRCdata.SetAt( startpos, _T('/') );
m1++;
processedcount++;
} // endwhile: iterate all matching entries
CString msg;
msg.FormatMessage( IDS_LRESREMSTATS, processedcount );
LogUserMessage( msg );
}
void CLocalizeRCDlg::MergeOldRCFileDesignInfo( CString &oldRCdata )
{
// Preserve dialog designer info changes made to accommodate translation string size
// differences in a previously generated output RC file
// Parameters:
// oldRCdata (in) Reference containing buffered contents of existing RC data
// containing possible dialog layout updates (read only)
//
// Progress information is reported to the log output
CString msg; // For user messages
int secitmsfound = 0; // Items found by regex parser
int secitmsskipped = 0;
int secitmsupdated = 0;
// Pointers into old RC data
int designinfosecpos = -1; // Buffer character offset to start of DESIGNINFO section
int subsectionpos = 0; // Buffer character offset to current sub-section
CString linekey; // Key for current sub-section line entry
//
// Pointers into new RC data
int ndesigninfosecpos = -1; // Buffer character offset to start of DESIGNINFO section
int nsubsectionpos = 0; // Buffer character offset to matching sub-section
LogUserMessage( IDS_LMERGINGOLDRC2 );
// Find the design info section in the new RC data
ndesigninfosecpos = newRCdata.Find( _T("GUIDELINES DESIGNINFO"), 0);
if ( ndesigninfosecpos < 0 ) // The section doesn't exist in the new data (not expected)
return;
//
// Find the design info section in old RC data and parse it
boost::tregex expr( _T("^GUIDELINES DESIGNINFO\\s+BEGIN$((?:\\s+(.+?(?:, *DIALOG))\\s+(?:.+?)END$)+)") );
boost::tregex_iterator m1(boost::make_regex_iterator(oldRCdata, expr)), mEnd;
while ( m1 != mEnd ) // ToDo: Don't really need an iterator here since there's only one section
{
// Get design info section position in buffer and body text handy
designinfosecpos = (*m1)[1].first - oldRCdata; // Start pos in buffer of design info section
CString dinfobody = CString( (*m1)[1].first, (*m1)[1].length() ); // Body of design info section
//
// Parse section for sub-section blocks
boost::tregex expr2( _T("(?:\\s+(.+?(?:, *DIALOG))\\s+(?:.+?)END$)") );
boost::tregex_iterator m2(boost::make_regex_iterator(dinfobody, expr2)), mEnd2;
while ( m2 != mEnd2 ) // Iterate over all sub-sections in the design info section
{
secitmsfound = 0; // Reset items stats for this sub-section
secitmsskipped = 0;
secitmsupdated = 0;
// Get sub-section position in buffer, key name, and body text handy
subsectionpos = ((*m2)[0].first - dinfobody) + designinfosecpos; // Start pos in buffer of this sub-section
CString dinfoblk = CString( (*m2)[0].first, (*m2)[0].length() ); // Current sub-section text
CString dinfokey = CString( (*m2)[1].first, (*m2)[1].length() ); // Key for current sub-section
// Try to find corresponding sub-section in new data
nsubsectionpos = newRCdata.Find( dinfokey, ndesigninfosecpos );
if ( nsubsectionpos < 0 ) // Sub-section not found in new data
{
msg.FormatMessage( IDS_LDESIGNSECSKIPNF, dinfokey );
continue; // Nothing to update for this section...
}
//
// Parse sub-section for numeric margin values
boost::tregex expr3( _T("^(.*?(?:,| ))( *\\d+)") );
boost::tregex_iterator m3(boost::make_regex_iterator(dinfoblk, expr3, boost::match_not_dot_newline)), mEnd3;
while ( m3 != mEnd3 ) // Iterate over all numeric margin settings in the sub-section body
{
CString subentrykey = CString( (*m3)[1].first, (*m3)[1].length() ); // Current entry key
subentrykey = subentrykey.TrimLeft(); // Clean up the key
CString subentryval = CString( (*m3)[2].first, (*m3)[2].length() ); // Current entry value
// Try to find the corresponding entry in the new data
int nsubentrypos = newRCdata.Find( subentrykey, nsubsectionpos );
if ( nsubentrypos < 0 ) // Entry not found in the new RC data
{
secitmsskipped++;
continue;
}
//
// Update the entry value in new data from matching entry in old data
int nvalpos = newRCdata.Find( _T(","), nsubentrypos ) + 1; // Starting pos of number string
// int nvallen = newRCdata.Find( _T("\n"), nvalpos ) - nvalpos; // Length of number string
int nvallen = _GetLengthOfValue( newRCdata, nvalpos );
if ( nvalpos < 1 || nvallen < 1 ) // Safety check
continue;
//
CString chk = newRCdata.Mid( nvalpos, nvallen ); // Number string in new data
if ( chk != subentryval ) // Need to update
{
newRCdata.Delete( nvalpos, nvallen );
newRCdata.Insert( nvalpos, subentryval );
secitmsupdated++;
}
secitmsfound++;
m3++;
} // endwhile: iterate sub-section entries
m2++;
msg.FormatMessage( IDS_LDESIGNSECSTAT, dinfokey, secitmsfound, secitmsupdated, secitmsskipped );
LogUserMessage( msg );
} // endwhile: iterate sub-sections
m1++;
} // endwhile: iterate design info sections
}
void CLocalizeRCDlg::MergeOldRCFileDialogLayout( CString &oldRCdata )
{
// Preserve dialog layout changes made to accommodate translation string size
// differences in a previously generated output RC file
// Parameters:
// oldRCdata (in) Reference containing buffered contents of existing RC data
// containing possible dialog layout updates (read only)
//
// Progress information is reported to the log output
//
CString msg; // For user messages
int secitmsfound = 0; // Items found by regex parser
int secitmsskipped = 0;
int secitmsupdated = 0;
LogUserMessage( IDS_LMERGINGOLDRC );
boost::tregex dsetexpr( _T("^(.*?(?:,| ))( ?\\d+, *\\d+, *\\d+, *\\d+(, *\\d+)*)") );
boost::tregex_iterator m1(boost::make_regex_iterator(oldRCdata, dsetexpr, boost::match_not_dot_newline)), mEnd;
int nsecpos = -1; // Start position of a section key in new RC data
int nendpos = -1; // Ending position of a section key in new RC data
int nseclines = 0; // Number of lines of text in section in new RC data
int secpos = -1; // Start position of a section key in old RC data
int endpos = -1; // Ending position of a section key in old RC data
int seclines = 0; // Number of lines of text in section in old RC data
CString seckey; // Key for current section
int iDEX = -1;
// Find each size/pos data set, which is 4 or 5 numbers separated by commas, and replace
// corresponding data set (according to preceding key name) in new RC output.
while ( m1 != mEnd ) // Scan old RC data for size/pos data
{
// Get the item key and try to find it in the new RC output
// In this the "key" is everything to the left of the size/pos hit on the line
// which is not reliable due to text translations and static controls that lack a unqiue ID.
// Logic compensates for this by verifying the two files match up by section key (which are
// unique) and then using line offset within the matching section.
CString key = CString( (*m1)[1].first, (*m1)[1].length() );
CString val = CString( (*m1)[2].first, (*m1)[2].length() );
CString val5 = CString( (*m1)[3].first, (*m1)[3].length() );
// Skip any false hits that are not to be adjusted
// Known exmaples are FILEVERSION and PRODUCTVERSION
if ( key.Find(_T("FILEVERSION")) > -1 || key.Find(_T("PRODUCTVERSION")) > -1 ) // Skip false hits...
{
m1++;
continue;
}
//
if ( key.Find( _T(" DIALOG ")) > -1 || (iDEX=key.Find(_T(" DIALOGEX "))) > -1 ) // Key is a dialog section
{
if ( !seckey.IsEmpty() ) // Just finished a prior section - report stats
{
msg.FormatMessage( IDS_LDIALOGSECFOUND, seckey, secitmsfound, secitmsupdated, secitmsskipped );
LogUserMessage( msg );
}
seckey = key.Trim(); // Start of new section (trim spaces - seckey is used in log output)
secitmsfound = 0;
secitmsskipped = 0;
secitmsupdated = 0;
nendpos = -1;
nseclines = 0;
// Try to find the matching dialog section in the new RC output data
nsecpos = newRCdata.Find( key ); // Find section key in new RC output, if present
if ( nsecpos < 0 ) // Allow section types DIALOG and DIALOGEX to match each other
{
if ( iDEX > -1 ) // The section key is a DIALOGEX
key.Replace( _T(" DIALOGEX "), _T(" DIALOG ") ); // Try DIALOG
else // The section key is a DIALOG
key.Replace( _T(" DIALOG "), _T(" DIALOGEX ") ); // Try DIALOGEX
//
nsecpos = newRCdata.Find( key ); // One more try...
}
if ( nsecpos > -1 ) // Match was found in new RC data
{
// Get vital data on the dialog section in the new RC data
nendpos = newRCdata.Find( _T("END"), nsecpos ); // Find end marker for the section
nseclines = _LineCount( newRCdata, nsecpos, nendpos ); // Compute number of lines of text in new section
//
// Get the same vital data on the matching dialog section in the old RC data
secpos = (*m1)[1].first - oldRCdata; // Offset to start of matching section key in old RC data
endpos = -1;
seclines = 0;
if ( secpos > -1 ) // Safety check, should not normally fail
{
endpos = oldRCdata.Find( _T("END"), secpos ); // Find end marker for the section in old RC data
seclines = _LineCount( oldRCdata, secpos, endpos ); // Compute number of lines of text in old section
}
if ( seclines != nseclines ) // Don't attempt updates if sections are different due to changes
{
msg.FormatMessage( IDS_LSECSKIPSIZE, key );
LogUserMessage( msg );
nsecpos = -1;
seckey.Empty(); // Clear out section key for next pass
}
//
}
else // Key not found in new data
{
msg.FormatMessage( IDS_LSECSKIPNF, key );
LogUserMessage( msg );
nsecpos = -1;
seckey.Empty(); // Clear out section key for next pass
} // endif: match found in new RC data
}
if ( nsecpos > -1 ) // There's a matching section key in new RC data
{
// Attempt to update the size/pos values for the section entyr in the new RC data
// using values from the matching line entry in the old RC data.
//
// Get line number within section for the current key in old RC data
int keyline = _LineCount( oldRCdata, secpos, (*m1)[2].first - oldRCdata );
// Get starting position of the matching lines within both RC data sets
int nlinepos = _GetLinePos( newRCdata, nsecpos, keyline );
if ( nlinepos > -1 ) // Must have valid line offset into new RC data
{
// Verify that at least the initial part of keyword on the line matches in both files to
// ensure a key match. Note that entire key isn't compared because it likely won't match due
// to translations of literal text.
//
// We will allow matches between xTEXT controls (CTEXT, LTEXT, and RTEXT), but not EDITTEXT
CString newkey = newRCdata.Mid(nlinepos, 14); // Isolate keys to compare
CString oldkey = key.Left(14);
BOOL keymatch = (oldkey.Trim(L" \t") == newkey.Trim(L" \t")); // Initial match result
if ( !keymatch ) // Match failed, check for allowable xTEXT key matchups
{
int keyxTextpos = oldkey.Find( _T("TEXT") ) - 1; // Position of xTEXT entry in old key or -2 if none
int newkeyxTextpos = newkey.Find( _T("TEXT") ) - 1; // Position of xTEXT entry in new key or -2 if none
if ( keyxTextpos > -1 && newkeyxTextpos > -1 ) // Both keys have an xTEXT entry
{
// If neither key is an EDITTEXT control then the match is allowed
if ( oldkey.Mid(keyxTextpos,1).FindOneOf(_T("CLR")) > -1 &&
newkey.Mid(newkeyxTextpos,1).FindOneOf(_T("CLR")) > -1 )
keymatch = TRUE;
//
}
}
if ( keymatch ) // Merge size/pos data from matching old RC data key
{
// Locate the size/pos data within the line of new RC data and update it
boost::tmatch mrslt;
int nlinelen = newRCdata.Find( _T('\n'), nlinepos ) - nlinepos;
CString sline = newRCdata.Mid( nlinepos, nlinelen ); // Substring to search
if ( boost::regex_search( sline, mrslt, dsetexpr ) ) // Found it
{
CString nval = CString(mrslt[2].first, mrslt[2].length());
CString nval5 = CString(mrslt[3].first, mrslt[3].length());
int nmatchpos = nlinepos + mrslt[2].first - sline;
int nmatchlen = mrslt[2].length();
CString chk = newRCdata.Mid( nmatchpos, nmatchlen );
if ( nmatchpos >= nlinepos && nmatchlen > 0 && chk != val )
{
newRCdata.Delete( nmatchpos, nmatchlen );
newRCdata.Insert( nmatchpos, val );
secitmsupdated++;
}
}
else // Unexpected failure to match size/pos data
{
// Log it
msg.FormatMessage( IDS_LERRSPFAIL, key.Left(10), sline );
LogUserMessage( msg );
}
}
else // Key not found in new RC output
{
// Log it
msg.FormatMessage( IDS_LKEYSKIPPED, key, newRCdata.Mid(nlinepos, key.GetLength()) );
LogUserMessage( msg );
secitmsskipped++;
} // endif: verify key line match
} // endif: line offset to new RC data is valid
} // endif: there's a matching section
secitmsfound++;
m1++;
} // endwhile: scan old RC data for size/pos values
//
// Report any stats for last section processed
if ( !seckey.IsEmpty() )
{
msg.FormatMessage( IDS_LDIALOGSECFOUND, seckey, secitmsfound, secitmsupdated, secitmsskipped );
LogUserMessage( msg );
}
}
void CLocalizeRCDlg::CheckTextClipping()
{
LogUserMessage(_T("**************************************************"));
LogUserMessage(_T("* detection of undersized labels"));
LogUserMessage(_T("**************************************************"));
CString msg;
// Check text clipping
// Parameters:
//
// Rectangles too small are reported to the log output
//
boost::tregex dsetexpr( _T("^ *[RCL]TEXT +\"([^\"]*)\", *[^,]+ *, *(\\d+) *, *(\\d+) *, *(\\d+) *, *(\\d+)") );
boost::tregex_iterator m1(boost::make_regex_iterator(newRCdata, dsetexpr, boost::match_not_dot_newline)), mEnd;
CDC dc;
dc.Attach(::GetDC(m_hWnd));
/*
// FONT pointsize, "typeface", weight, italic, charset
// FONT 8, "MS Shell Dlg", 400, 0, 0x1
int nHeight = -::MulDiv(8, dc.GetDeviceCaps(LOGPIXELSY), 72);
CFont font;
font.CreateFont(
nHeight, // pointsize
0,
0,
0,
400, // weight
0, // italic
FALSE,
FALSE,
0x1, // charset
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
_T("MS Shell Dlg"));
dc.SelectObject(font.m_hObject);
*/
TEXTMETRIC tm;
dc.GetTextMetrics(&tm);
LONG baseunitX = tm.tmAveCharWidth;
LONG baseunitY = tm.tmHeight;
/*
// we test system font
LONG l = ::GetDialogBaseUnits();
WORD baseunitX = LOWORD(l);
WORD baseunitY = HIWORD(l);
*/
msg.FormatMessage(
IDS_TEXTCLIPPED4,
baseunitX, baseunitY);
LogUserMessage(msg);
for( ; m1 != mEnd; ++m1 )
{
CString str( (*m1)[1].first, (*m1)[1].length() );
CString x ( (*m1)[2].first, (*m1)[2].length() );
CString y ( (*m1)[3].first, (*m1)[3].length() );
CString w ( (*m1)[4].first, (*m1)[4].length() );
CString h ( (*m1)[5].first, (*m1)[5].length() );
LONG baseX = _ttoi(x);
LONG baseY = _ttoi(y);
LONG pixelX = MulDiv(baseX, baseunitX, 4);
LONG pixelY = MulDiv(baseY, baseunitY, 8);
LONG baseW = _ttoi(w);
LONG baseH = _ttoi(h);
LONG pixelW = MulDiv(baseW, baseunitX, 4);
LONG pixelH = MulDiv(baseH, baseunitY, 8);
POINT point = { pixelX, pixelY };
SIZE size = { pixelW, pixelH };
CRect rect1(point, size);
CRect rect2 = rect1;
CRect rect3 = rect1;
dc.DrawText(str, rect2, DT_CALCRECT | DT_WORDBREAK);
dc.DrawText(str, rect3, DT_CALCRECT);
if( MulDiv(rect2.Width(), 4, baseunitX) <= MulDiv(rect1.Width(), 4, baseunitX)
&&
MulDiv(rect2.Height(), 8, baseunitY) <= MulDiv(rect1.Height(), 8, baseunitY) )
continue;
if( MulDiv(rect3.Width(), 4, baseunitX) <= MulDiv(rect1.Width(), 4, baseunitX)
&&
MulDiv(rect3.Height(), 8, baseunitY) <= MulDiv(rect1.Height(), 8, baseunitY) )
continue;
{
int line = _LineCount(newRCdata, 0, (*m1)[0].first - newRCdata) + 1;
// Log it
msg.FormatMessage(
IDS_TEXTCLIPPED,
str,
x, y, w, h,
line);
LogUserMessage(msg);
// vertically stretched
msg.FormatMessage(
IDS_TEXTCLIPPED2,
MulDiv(rect2.Width(), 4, baseunitX),
MulDiv(rect2.Height(), 8, baseunitY));
LogUserMessage(msg);
// horizontally stretched
msg.FormatMessage(
IDS_TEXTCLIPPED2,
MulDiv(rect3.Width(), 4, baseunitX),
MulDiv(rect3.Height(), 8, baseunitY));
LogUserMessage(msg);
// try with double width
pixelY = MulDiv(baseY - 4, baseunitY, 8);
pixelH = MulDiv(baseH + 8, baseunitY, 8);
point = { pixelX, pixelY };
size = { pixelW, pixelH };
CRect rectA(point, size);
CRect rectB = rectA;
dc.DrawText(str, rectB, DT_CALCRECT | DT_WORDBREAK);
if( MulDiv(rectB.Width(), 4, baseunitX) <= MulDiv(rectA.Width(), 4, baseunitX)
&&
MulDiv(rectB.Height(), 8, baseunitY) <= MulDiv(rectA.Height(), 8, baseunitY) )
{
msg.FormatMessage(
IDS_TEXTCLIPPED3,
MulDiv(rectA.left, 4, baseunitX),
MulDiv(rectA.top, 8, baseunitY),
MulDiv(rectA.Width(), 4, baseunitX),
MulDiv(rectA.Height(), 8, baseunitY));
LogUserMessage(msg);
}
}
}
}
void CLocalizeRCDlg::OnBnClickedCreateini()
{
// Reload InputRC
if( !OpenInputRC() )
return;
// Write/Actualize INI-File
if( WriteReadIni(true) == OLDFILEFORMAT )
LogUserMessage( IDS_OLDFILEFORMAT );
}
// extract first caption after *pnPosition
CString CLocalizeRCDlg::ExtractCaption(CString& strText, int* pnPosition, BYTE nKeyword, CString &strIDC )
{
CString strCaption, strLine;
int nStart, nEnd, nStartQuote, nEndQuote;
nStart = *pnPosition;
// DLGINIT: Microsoft-Format to store data for comboboxes
if( nKeyword == KEYWORD_DLGINIT )
{
if( nStart == 0 )
{
// remove BEGIN and END
nStart = FindSeperateWord( strText, _T("BEGIN"), 0 );
if( nStart != -1 )
nStart += 7;
}
// FORMAT: <IDC>, 0x403, <LENGTH IN BYTES>, 0
// FORMAT: <WORD> as Hex Wert chars in LOBYTE und HIGHBYTE
// comma seperated, null-terminated, ends with comma
// comma seperated, null-terminated, ends with comma
CString strHelp;
LPTSTR pHelp;
int nWord, nToken = 0, nLength = 0;
CString strToken = StringTokenize( strText, _T(",\r\n"), &nStart);
while (nStart != -1)
{
strToken.TrimLeft();
strToken.TrimRight();
if( strToken.IsEmpty() )
{
strToken = StringTokenize( strText, _T(",\r\n"),&nStart);
continue;
}
switch( nToken )
{
case 0: // IDC oder 0 bei Ende von Liste
if( strToken == "0" )
{
*pnPosition = nStart;
return strCaption;
}
else // IDC
{
if( strIDC.IsEmpty() )
{
strIDC = strToken; // new IDC
}
else
{
if( strIDC != strToken )
return strCaption;
}
}
break;
case 1: // 0x403 for Combo-Boxes
if( strToken != "0x403" )
return ERR_STR;
break;
case 2: // Length of String
nLength = _ttoi( strToken );
nLength = (int)floor((nLength / 2.0)+0.5);
break;
case 3: // always 0
break;
default: // everything above 3 is word values
if( nToken <= nLength + 3 )
{
// convert string to hexadecimal integer
nWord = _tcstol( strToken, &pHelp, 16 );
strHelp.Format( _T("%c%c"), LOBYTE(nWord), HIBYTE(nWord) );
strHelp.Remove( '\0' );
strCaption += strHelp;
if( nToken == nLength + 3 ) // last word
{
strCaption += ";";
nToken = -1;
}
}
}
nToken++;
*pnPosition = nStart;
strToken = StringTokenize(strText, _T(",\r\n"), &nStart);
}
return ERR_STR;
}
// find end of line
while( (nEnd = strText.Find( _T("\r\n"), nStart )) != -1 )
{
// strLine contents one command line
strLine += strText.Mid( nStart, nEnd - nStart );
if( strLine.GetLength() <= 0 )
{
// next line
nStart = nEnd+2;
*pnPosition = nStart;
continue;
}
int rPos = strLine.GetLength()-1;
// skip spaces at the end of line
while (rPos > 0 && strLine[rPos] == ' ')
{
rPos--;
}
// merge multiline commands to one line
if( (strLine[rPos] == '|') ||
(strLine[rPos] == ',') )
{
// next line
nStart = nEnd+2;
continue;
}
TCHAR chHelp;
if( nStart > 0 )
chHelp = strText[nStart-1];
// search for first " (is never within "") so even empty strings ("") are found
nStartQuote = strLine.Find( _T('"') );
if ( nStartQuote >= 0 )
nStartQuote++;
if( nStartQuote == -1 || !MustBeTranslated(strLine, nKeyword) ) // not found
{
strLine = "";
nStart = *pnPosition = nEnd+2;
continue;
}
// find last " and ignore "" (quotation marks within strings)
nEndQuote = FindQuote( strLine, nStartQuote );
if( nEndQuote == -1 )
{
strLine = "";
nStart = *pnPosition = nEnd+2;
continue;
}
nStartQuote--;
chHelp = strText[nStart+nStartQuote];
strCaption = strLine.Mid( nStartQuote, nEndQuote-nStartQuote );
*pnPosition += nEndQuote;
chHelp = strText[*pnPosition];
return strCaption;
}
return ERR_STR;
}
void CLocalizeRCDlg::OnBnClickedOpenini()
{
if( m_strLangINI.IsEmpty() )
LogUserMessage( IDS_ERR_FILENAMEEMPTY );
else
{
// open lang.ini with standard association
HINSTANCE hInstance = ShellExecute( m_hWnd, _T("open"), m_strLangINI, NULL, NULL, SW_SHOWNORMAL );
if( (int)hInstance <= 32 )
ShowError( IDS_ERR_OPENINI, false, (DWORD)hInstance );
}
}
void CLocalizeRCDlg::OnBnClickedCreateoutput()
{
UpdateData( true );
int nResult = WriteReadIni( false );
if( nResult == OLDFILEFORMAT )
{
AfxMessageBox( IDS_OLDFILEFORMAT );
return;
}
if( nResult <= 0 )
return;
UpdateData( false );
// create output RC
if( m_strOutputRC.IsEmpty() )
{
AfxMessageBox( IDS_ERR_FILENAMEEMPTY );
return;
}
//
// If a previous output RC exists then attempt to merge dialog size/pos changes in it with the
// the newly translated input RC data produced by WriteReadIni (newRCdata)
CString oldRCdata;
if ( OpenRCFile(m_strOutputRC, oldRCdata, false) ) // Read contents of old output RC into buffer
{
// Preserve any dialog layout changes made in a prior RC file
MergeOldRCFileDialogLayout( oldRCdata );
MergeOldRCFileDesignInfo( oldRCdata );
if( !m_bCopy ) // Remove Res folder references if Res folder isn't being copied
RemoveNewRCFileRESItems( );
//
} // endif: old RC file exists
CheckTextClipping();
try
{
CStdioUnicodeFile File( m_strOutputRC, CFILEFLAG_UNICODEHELPER | CFile::modeWrite|CFile::modeCreate, CStdioUnicodeFile::FILEENCODING_UTF8 );
#ifdef UNICODE
File.WriteBOM();
#endif
File.WriteString( newRCdata );
File.Close();
}
catch( CFileException* e )
{
TCHAR szCause[255];
e->GetErrorMessage(szCause, 255);
AfxMessageBox(szCause);
e->Delete();
}
// copy header and RES-Folder
if( m_bCopy )
{
CString strOutputFolder = GetFolder( m_strOutputRC );
CString strInputFolder = GetFolder( m_strInputRC );
// copy header
if( !CopyFile( strInputFolder+_T("resource.h"), strOutputFolder+_T("resource.h"), false ) )
ShowError( IDS_ERR_FILECOPY, true );
// create folder
if( !CreateDirectory( strOutputFolder+_T("RES"), NULL ) )
{
DWORD dwErrCode = GetLastError();
if( dwErrCode != ERROR_ALREADY_EXISTS )
{
ShowError( IDS_ERR_FOLDERCREATE, false, dwErrCode );
return;
}
}
CFileFind FFind;
BOOL bWorking = FFind.FindFile( strInputFolder+_T("RES\\*.*"), 0 );
while( bWorking )
{
bWorking = FFind.FindNextFile();
// skip . and .. files; otherwise, we'd
// recur infinitely!
if (FFind.IsDots() || FFind.IsDirectory())
continue;
else
{
// copy file
if( !CopyFile( FFind.GetFilePath(), strOutputFolder+_T("RES\\")+FFind.GetFileName(), false ) )
{
ShowError( IDS_ERR_FILECOPY, true );
}
}
}
FFind.Close();
}
// Fill Edit with InputRC again
OpenInputRC();
}
// checks if line contents strings that have to be translated
bool CLocalizeRCDlg::MustBeTranslated(CString strLine, BYTE nKeyword)
{
// if it is stringtable -> translate
if( nKeyword == KEYWORD_STRINGTABLE )
return true;
bool bTranslate = true;
strLine.TrimLeft(_T(" "));
strLine.TrimRight(_T(" "));
if(strLine[0] == '#') // Preprocessor line
bTranslate = false;
if(strLine[0] == '/') // Comment line
bTranslate = false;
//--- Exclude following controls from translation ---------------------
if(strLine.Find(_T("msctls_updown32"), 0) > 0) // Spin control
bTranslate = false;
if(strLine.Find(_T("SysTreeView32"), 0) > 0) // Tree view control
bTranslate = false;
if(strLine.Find(_T("msctls_trackbar32"), 0) > 0) // Slider control
bTranslate = false;
if(strLine.Find(_T("SysIPAddress32"), 0) > 0) // IP adress
bTranslate = false;
if(strLine.Find(_T("msctls_hotkey32"), 0) > 0) // Hot key
bTranslate = false;
if(strLine.Find(_T("SysListView32"), 0) > 0) // List view control
bTranslate = false;
if(strLine.Find(_T("SysAnimate32"), 0) > 0) // Animate control
bTranslate = false;
if(strLine.Find(_T("SysMonthCal32"), 0) > 0) // Month calendar
bTranslate = false;
if(strLine.Find(_T("ComboBoxEx32"), 0) > 0) // Extended combo box
bTranslate = false;
if( !bTranslate )
return false;
bTranslate = false;
//--- Include following controls into translation ---------------
if(strLine.Find(_T("CAPTION"), 0) == 0)
bTranslate = true; // Dialog box caption
if(strLine.Find(_T("POPUP"), 0) == 0)
bTranslate = true;
if(strLine.Find(_T("MENUITEM"), 0) == 0)
bTranslate = true;
if(strLine.Find(_T("PUSHBUTTON"), 0) == 0)
bTranslate = true;
if(strLine.Find(_T("DEFPUSHBUTTON"), 0) == 0)
bTranslate = true;
if(strLine.Find(_T("LTEXT"), 0) == 0)
bTranslate = true;
if(strLine.Find(_T("RTEXT"), 0) == 0)
bTranslate = true;
if(strLine.Find(_T("CTEXT"), 0) == 0)
bTranslate = true;
if(strLine.Find(_T("GROUPBOX"), 0) == 0)
bTranslate = true;
if(strLine.Find(_T("CONTROL"), 0) == 0)
{
if(strLine.Find(_T("BS_AUTORADIOBUTTON"), 0) != -1 )
bTranslate = true;
if(strLine.Find(_T("BS_AUTOCHECKBOX"), 0) != -1 )
bTranslate = true;
if( strLine.Find(_T("Button"), 0) != -1 )
bTranslate = true;
// statics with SS_LEFTNOWORDWRAP are controls
if(strLine.Find(_T("SS_LEFTNOWORDWRAP"), 0) != -1 )
bTranslate = true;
}
if( strLine.Find( _T("ID"), 0) == 0) // stringtable
bTranslate = true;
if(strLine.Find( _T("AFX_IDS_"), 0) == 0)
bTranslate = true;
if( strLine[0] == '"' ) // accelerator
bTranslate = true;
return bTranslate;
}
// return the position where '"' was found
int CLocalizeRCDlg::FindQuote(CString strLine, int nStartPos)
{
int nPosition = nStartPos;
// search for '"', that is not a quotation mark inside the text ("")
do
{
nPosition = strLine.Find( '"', nPosition );
// no '"' was found
if( nPosition == -1 )
return nPosition;
nPosition++;
if( nPosition >= strLine.GetLength()-1 )
return nPosition;
}
while( strLine[nPosition++] == '"' );
return nPosition-1;
}
#define PREFIX_CHANGEDITEM _T("*")
int CLocalizeRCDlg::WriteReadIni(bool bWrite)
{
BYTE nKeyword;
if( m_strLangINI.IsEmpty() )
{
LogUserMessage( IDS_ERR_FILENAMEEMPTY );
return false;
}
if ( bWrite )
LogUserMessage( IDS_LINIOPENING );
else
LogUserMessage( IDS_LINICHECKING );
//
// Create or Open INI-File
CIniEx IniEx;
if( !IniEx.Open( m_strLangINI ) )
return false;
// old sectionnames in INI file ?
LPCTSTR strOldKeywords[5] =
{
_T(" ACCELERATORS "),
_T(" DIALOG "),
_T(" DIALOGEX "),
_T(" MENU "),
_T(" MENUEX ")
};
for( nKeyword = 0; nKeyword < 5; nKeyword++ )
{
CString strHelp = strOldKeywords[nKeyword];
if( IniEx.LookupSection(&strHelp) != -1 )
return OLDFILEFORMAT;
}
CString strCaption, strHelp, strValue, strIDC;
int nStart, nHelp, nPosition, nSelStart, nSelEnd, nOldLength, nNewLength, nPrevHelp;
LogUserMessage( IDS_LINIPROCESSING );
for( nKeyword = 0; nKeyword < NUMKEYWORDS-1; nKeyword++ )
{
nPosition = 0;
// search for keyword section in RC-file
while( (nPosition = FindSeperateWord( newRCdata, strKeywords[nKeyword], nPosition )) != -1 )
{
nStart = nPosition;
// find BEGIN
nHelp = FindSeperateWord( newRCdata, _T("BEGIN"), nPosition );
// find related END (ignore interlocked BEGINs-ENDs)
nPosition = nHelp-1;
do
{
nPosition = FindSeperateWord( newRCdata, _T("END"), nPosition+1);
nHelp = FindSeperateWord( newRCdata, _T("BEGIN"), nHelp+1 );
}
while( nHelp < nPosition && nHelp != -1 );
// save SECTION in strHelp
strHelp = newRCdata.Mid( nStart, nPosition-nStart );
nHelp = nPrevHelp = 0;
// extract caption
while( (strCaption = ExtractCaption( strHelp, &nHelp, nKeyword, strIDC )) != ERR_STR )
{
if( bWrite )
{
// check if key in Lang.INI already exists
strValue = IniEx.GetValue( strKeywords[nKeyword], strCaption );
if( strValue.IsEmpty() )
{
// insert line in Lang.INI
IniEx.SetValue( strKeywords[nKeyword], strCaption, PREFIX_CHANGEDITEM+strCaption );
}
else
{
// insert line in Lang.INI
IniEx.SetValue( strKeywords[nKeyword], strCaption, PREFIX_CHANGEDITEM+strValue );
}
}
else
{
// check if key in Lang.INI exists
strValue = IniEx.GetValue( strKeywords[nKeyword], strCaption );
if( !strValue.IsEmpty() )
{
// if it is DLGINIT
if( nKeyword == 6 )
{
CString strInsert, strToken, strHelp2;
WORD wData;
int n;
int nTokenPos = 0;
while( (strToken = StringTokenize( strValue, _T(";"), &nTokenPos )) != "" )
{
// first line: header
strHelp2.Format(_T("\t%s, 0x403, %d, 0\r\n"), strIDC, strToken.GetLength()+1 );
strInsert += strHelp2;
// second line: data
for( n=0; n < strToken.GetLength(); n+=2 )
{
if( n == (strToken.GetLength() - 1) )
wData = MAKEWORD( strToken.GetAt(n), 0 );
else
wData = MAKEWORD( strToken.GetAt(n), strToken.GetAt(n+1) );
strHelp2.Format( _T("0x%04x, "), wData );
strInsert += strHelp2;
}
// eventually add null character
if( n == strToken.GetLength() )
{
strInsert += _T("\"\\000\"");
}
strInsert += _T("\r\n");
}
// only add 0 if DLGINIT block is at the end
if( nHelp >= strHelp.GetLength() -1 )
{
strInsert += _T("\t0\r\n");
nSelEnd = strHelp.GetLength();
}
else
nSelEnd = nHelp;
// find BEGIN
if( nPrevHelp == 0 )
{
nSelStart = FindSeperateWord(strHelp, _T("BEGIN"), 0 );
nSelStart += 7;
}
else
nSelStart = nPrevHelp;
nOldLength = nSelEnd-nSelStart;
strHelp.Delete( nSelStart, nOldLength );
nNewLength = strInsert.GetLength();
strHelp.Insert( nSelStart, strInsert );
}
else
{
nSelStart = nHelp-strCaption.GetLength();
nSelEnd = nHelp;
nOldLength = nSelEnd-nSelStart;
strHelp.Delete( nSelStart, nOldLength );
nNewLength = strValue.GetLength();
strHelp.Insert( nSelStart, strValue );
}
nHelp += nNewLength - nOldLength;
if( nHelp < 0 )
nHelp = 0;
}
nPrevHelp = nHelp;
}
strIDC.Empty();
}
if( !bWrite )
{
newRCdata.Delete( nStart, nPosition-nStart );
newRCdata.Insert( nStart, strHelp );
nPosition = nStart + strHelp.GetLength();
}
}
}
#define CODEPAGE _T("code_page")
// search for codepage
////////////////////////////////////////////
nPosition = 0;
CString strCodepage;
while( (nPosition = FindSeperateWord( newRCdata, CODEPAGE, nPosition )) != -1 )
{
nSelEnd = newRCdata.Find( ')', nPosition );
nSelStart = newRCdata.Find( '(', nPosition ) + 1;
strCaption = newRCdata.Mid( nSelStart, nSelEnd-nSelStart );
// check if key in Lang.INI already exists
strValue = IniEx.GetValue( CODEPAGE, strCaption );
if( bWrite )
{
if( strValue.IsEmpty() )
{
// insert line in Lang.INI
IniEx.SetValue( CODEPAGE, strCaption, PREFIX_CHANGEDITEM+strCaption );
}
else
{
// insert line in Lang.INI
IniEx.SetValue( CODEPAGE, strCaption, PREFIX_CHANGEDITEM+strValue );
}
}
else
{
if( !strValue.IsEmpty() )
{
newRCdata.Delete( nSelStart, nSelEnd-nSelStart );
newRCdata.Insert( nSelStart, strValue );
nPosition = nSelStart + strValue.GetLength();
}
}
nPosition++;
}
if( bWrite )
{
// remove unnecessary lines in Lang.INI
CStringArray strSections, strKeys;
IniEx.GetSections( strSections );
// go through every section
int nSection=0;
while( nSection < strSections.GetSize() )
{
strKeys.RemoveAll();
IniEx.GetKeysInSection( strSections[nSection], strKeys );
for( nKeyword = 0; nKeyword < NUMKEYWORDS; nKeyword++ )
{
// dont touch unknown sections
if( _tcscmp(strSections[nSection], strKeywords[nKeyword]) != 0 )
continue;
// Go through every key in this section
int nKey=0;
while( nKey < strKeys.GetSize() )
{
// check if key is necessary for this RC
strValue = IniEx.GetValue( strSections[nSection], strKeys[nKey] );
if( strValue[0] == '*' )
{
strValue.TrimLeft( _T(" *") );
IniEx.SetValue( strSections[nSection], strKeys[nKey], strValue );
}
else
{
// key is obsolete and no longer needed
switch( m_nObsoleteItems )
{
case 0: // delete item
IniEx.RemoveKey( strSections[nSection], strKeys[nKey]);
break;
case 1:
if( strValue[0] != '#' )
IniEx.SetValue( strSections[nSection], strKeys[nKey], _T("#") + strValue );
break;
}
}
nKey++;
}
break;
}
if( nKeyword == NUMKEYWORDS && strSections[nSection] != CODEPAGE )
IniEx.SetValue( strSections[nSection], _T("!!! This sectionname isn't recognized by LocalizeRC. Probably you can delete the whole section !!!"), _T("") );
strKeys.RemoveAll();
IniEx.GetKeysInSection( strSections[nSection], strKeys );
// remove empty sections
if( strKeys.GetSize() == 0 )
{
if( IniEx.RemoveSection( strSections[nSection] ) )
strSections.RemoveAt( nSection );
else
nSection++;
}
else
nSection++;
}
if( !m_bNoSort )
IniEx.SortIniValues();
// save changes
IniEx.WriteFile();
IniEx.WriteFileXliff();
}
if ( bWrite )
LogUserMessage( IDS_LINIFINISHED );
else
LogUserMessage( IDS_LINICHECKDONE);
//
return true;
}
void CLocalizeRCDlg::OnDestroy()
{
CDialog::OnDestroy();
DestroyIcon( hSmallIcon );
DestroyIcon( hLargeIcon );
AfxGetApp()->WriteProfileString( SEC_LASTPROJECT, ENT_WORKSPACE, m_strWorkspace );
SaveWorkspace();
}
CString CLocalizeRCDlg::GetFolder(CString strPath)
{
TCHAR path[_MAX_PATH];
TCHAR drive[_MAX_DRIVE];
TCHAR dir[_MAX_DIR];
_tcscpy_s( path, _MAX_PATH, strPath );
// Trenne Pfad von Anwendungsnamen
_tsplitpath_s( path, drive, _MAX_DRIVE, dir, _MAX_DIR, NULL, 0, NULL, 0 );
CString strReturn;
strReturn.Format( _T("%s%s"), drive, dir);
return strReturn;
}
void CLocalizeRCDlg::OnBnClickedReverseini()
{
// Create or Open INI-File
CIniEx IniEx;
IniEx.Open( m_strLangINI );
CStringArray strSections, strKeys;
CString strHelp;
IniEx.GetSections( strSections );
int nKey, nSec;
// go through every section
for( nSec=0; nSec < strSections.GetSize(); nSec++ )
{
// go through every key
IniEx.GetKeysInSection( strSections[nSec], strKeys );
for( nKey=0; nKey < strKeys.GetSize(); nKey++ )
{
strHelp = IniEx.GetValue( strSections[nSec], strKeys[nKey] );
if( strHelp != strKeys[nKey] )
{
IniEx.SetValue( strSections[nSec], strHelp, strKeys[nKey] );
IniEx.RemoveKey( strSections[nSec], strKeys[nKey] );
}
}
}
// save changes
IniEx.WriteFile();
LogUserMessage( IDS_LINIKEYSREVERSED );
}
void CLocalizeRCDlg::OnBnClickedNewWorkspace()
{
if( OpenSaveDialog(false, false, IDS_EXTLWS, IDS_EXTLWSDESCRIPTION, m_strWorkspace, _T("")) )
{
m_strLangINI = "";
m_strInputRC = "";
m_strOutputRC = "";
UpdateData( false );
}
}
void CLocalizeRCDlg::OnBnClickedChngWorkspace()
{
if( OpenSaveDialog(true, false, IDS_EXTLWS, IDS_EXTLWSDESCRIPTION, m_strWorkspace, _T("")) )
{
if( !LoadWorkspace() )
AfxMessageBox( IDS_ERR_OPENWORKSPACE );
}
}
BOOL CLocalizeRCDlg::LoadWorkspace(BOOL bShowError)
{
CIniEx IniEx;
if( !IniEx.Open( m_strWorkspace, 1, 0 ) )
return false;
CString strPath = GetFolder(m_strWorkspace);
m_strInputRC = GetAbsolutePathFromIni( &IniEx, ENT_INPUTRC, strPath );
m_strLangINI = GetAbsolutePathFromIni( &IniEx, ENT_LANGINI, strPath );
m_strOutputRC = GetAbsolutePathFromIni( &IniEx, ENT_OUTPUTRC, strPath );
m_bCopy = _ttoi( IniEx.GetValue(ENT_COPY) );
m_nObsoleteItems = _ttoi( IniEx.GetValue(ENT_OBSITEMS) );
m_bNoSort = _ttoi( IniEx.GetValue(ENT_NOSORT) );
OpenInputRC(bShowError);
LogUserMessage( IDS_LWSPACELOADED );
return true;
}
BOOL CLocalizeRCDlg::SaveWorkspace(void)
{
CIniEx IniEx;
if( !IniEx.Open( m_strWorkspace ) )
return false;
// save settings to Workspace
CString strHelp;
strHelp.Format( _T("%d"), m_bCopy );
IniEx.SetValue( ENT_COPY, strHelp );
strHelp.Format( _T("%d"), m_nObsoleteItems );
IniEx.SetValue( ENT_OBSITEMS, strHelp );
strHelp.Format( _T("%d"), m_bNoSort );
IniEx.SetValue( ENT_NOSORT, strHelp );
// save changes
IniEx.WriteFile();
return 0;
}
CString CLocalizeRCDlg::GetAbsolutePathFromIni(CIniEx* pIniEx, CString strKey, CString strPath)
{
CString strHelp = pIniEx->GetValue( strKey );
CString strValue;
if( strHelp.IsEmpty() )
return _T("");
if( PathIsRelative( strHelp ) )
{
TCHAR szPath[MAX_PATH];
PathCombine( szPath, strPath, strHelp );
strHelp.Format(_T("%s"), szPath);
return strHelp;
}
return strHelp;
}
void CLocalizeRCDlg::OnCbnSelchangeLanguage()
{
// Save Changes
AfxGetApp()->WriteProfileInt( SEC_LASTPROJECT, ENT_LANGID, m_CtrlLanguage.GetItemData(m_CtrlLanguage.GetCurSel()) );
AfxMessageBox( IDS_RESTARTAPP );
}
#define STR_LEN 64
int CLocalizeRCDlg::AddLanguage(CComboBox* pComboBox, LPCTSTR strLangCode, LANGID SelectedID)
{
LCID lcID;
TCHAR szLangName[STR_LEN];
LPTSTR pHelp;
int nIndex;
lcID = MAKELCID( MAKELANGID(_tcstoul( strLangCode, &pHelp, 16 ), SUBLANG_NEUTRAL ), SORT_DEFAULT );
GetLocaleInfo( lcID, LOCALE_SNATIVELANGNAME , szLangName, STR_LEN);
nIndex = pComboBox->AddString( szLangName );
pComboBox->SetItemData( nIndex, lcID );
if( lcID == SelectedID )
pComboBox->SetCurSel( nIndex );
return nIndex;
}
CString CLocalizeRCDlg::StringTokenize(CString strSource, LPCTSTR pszTokens, int* pnStart)
{
#if _MFC_VER >= 0x0700
return strSource.Tokenize( pszTokens, *pnStart );
#else
// original code CString::Tokenize from MFC7
/////////////////////////////////////////////////
if( pszTokens == NULL )
{
return( strSource );
}
// (LPCSTR)(LPCTSTR) hack for VC6.
LPCTSTR pszPlace = (LPCTSTR)strSource+*pnStart;
LPCTSTR pszEnd = (LPCTSTR)strSource+strSource.GetLength();
if( pszPlace < pszEnd )
{
int nIncluding = StringSpanIncluding( pszPlace, pszTokens );
if( (pszPlace+nIncluding) < pszEnd )
{
pszPlace += nIncluding;
int nExcluding = StringSpanExcluding( pszPlace, pszTokens );
int iFrom = *pnStart+nIncluding;
int nUntil = nExcluding;
*pnStart = iFrom+nUntil+1;
return( strSource.Mid( iFrom, nUntil ) );
}
}
// return empty string, done tokenizing
*pnStart = -1;
return( CString( "" ) );
#endif
}
#define SEPERATORS _T(" \r\n,\t()")
int CLocalizeRCDlg::FindSeperateWord(CString strText, LPCTSTR strWord, int nStartPos)
{
int nFoundPos;
while( (nFoundPos = strText.Find( strWord, nStartPos )) != -1 )
{
CString strSeperator;
// look for preceding character
if( nFoundPos > 0 )
{
strSeperator = strText[nFoundPos-1];
// if preceding character isn't a separator, continue search
if( strSeperator.FindOneOf( SEPERATORS ) == -1 )
{
// strSeperator = strText.Mid( nFoundPos-1, nFoundPos + 40 );
nStartPos = nFoundPos+_tcslen(strWord);
// nStartPos = nFoundPos+1;
continue;
}
}
// look for successing character
int nSuccessingPos = nFoundPos+_tcslen(strWord);
if( nSuccessingPos < strText.GetLength() )
{
strSeperator = strText[nSuccessingPos];
// if successing character isn't a separator, continue search
if( strSeperator.FindOneOf( SEPERATORS ) == -1 )
{
nStartPos = nSuccessingPos;
// nStartPos = nFoundPos+1;
continue;
}
}
break;
}
return nFoundPos;
}
void CLocalizeRCDlg::OnCbnSelchangeObsItems()
{
UpdateData( true );
}
void CLocalizeRCDlg::OnBnKillfocusCopy()
{
UpdateData( true );
}
void CLocalizeRCDlg::OnBnKillfocusNosort()
{
UpdateData( true );
}
void CLocalizeRCDlg::OnBnClickedChngInputrc()
{
// Change Input RC
if( OpenSaveDialog( true, true, IDS_EXTRC, IDS_EXTRCDESCRIPTION, m_strInputRC, ENT_INPUTRC ) )
OpenInputRC();
}
void CLocalizeRCDlg::OnBnClickedChngLangini()
{
// Change Lang INI
OpenSaveDialog( false, true, IDS_EXTINI, IDS_EXTINIDESCRIPTION, m_strLangINI, ENT_LANGINI );
}
void CLocalizeRCDlg::OnBnClickedChngOutputrc()
{
// Change Output RC
OpenSaveDialog( false, true, IDS_EXTRC, IDS_EXTRCDESCRIPTION, m_strOutputRC, ENT_OUTPUTRC );
}
BOOL CLocalizeRCDlg::OpenSaveDialog(BOOL bOpen, BOOL bRelative, UINT nExtID, UINT nExtDescriptionID, CString& strEdit, CString strIniEntry)
{
CString strExtension, strExtensionInfo;
strExtension.LoadString( nExtID );
strExtensionInfo.LoadString( nExtDescriptionID );
DWORD dwFlags = OFN_HIDEREADONLY|OFN_ENABLESIZING|OFN_EXPLORER;
if( bOpen )
dwFlags |= OFN_FILEMUSTEXIST;
else
dwFlags |= OFN_OVERWRITEPROMPT;
#if _MFC_VER >= 0x0700
CFileDialog FileDialog( bOpen, strExtension, NULL, dwFlags, strExtensionInfo, this, 0 );
#else
CFileDialog FileDialog( bOpen, strExtension, NULL, dwFlags, strExtensionInfo, this );
#endif
_tcscpy_s( FileDialog.m_ofn.lpstrFile, _MAX_PATH, strEdit );
if( FileDialog.DoModal() == IDOK )
{
if( bRelative )
{
// change to relative path
TCHAR szOut[MAX_PATH] = _T("");
if( !PathRelativePathTo( szOut, m_strWorkspace, FILE_ATTRIBUTE_NORMAL, FileDialog.GetPathName(), FILE_ATTRIBUTE_NORMAL ) )
_tcscpy_s( szOut, MAX_PATH, FileDialog.GetFileName() );
if( strIniEntry )
{
CIniEx IniEx;
if( !IniEx.Open( m_strWorkspace ) )
return false;
CString strValue = szOut;
IniEx.SetValue( strIniEntry, strValue );
IniEx.WriteFile();
}
}
strEdit = FileDialog.GetPathName();
UpdateData( false );
return true;
}
return false;
}
BOOL CLocalizeRCDlg::ShowError(UINT nIDString1, bool bGetLastError, DWORD dwErrCode )
{
CString strString1, strLastError;
if( dwErrCode == 0 )
dwErrCode = GetLastError();
strString1.LoadString( nIDString1 );
if( bGetLastError )
{
strLastError = ConvertErrorToString( dwErrCode );
strString1 += _T(" ") + strLastError;
}
AfxMessageBox( strString1 );
return true;
}
#include <lmerr.h>
CString CLocalizeRCDlg::ConvertErrorToString( DWORD dwErrCode )
{
HMODULE hModule = NULL; // default to system source
LPTSTR MessageBuffer = NULL;
DWORD dwBufferLength;
CString strError;
// Always start off with an empty string
strError.Empty();
// if error_code is in the network range, load the message source
if (dwErrCode >= NERR_BASE && dwErrCode <= MAX_NERR)
{
hModule = ::LoadLibraryEx( _TEXT("netmsg.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE );
}
// call FormatMessage() to allow for message text to be acquired
// from the system or the supplied module handle
dwBufferLength = ::FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_SYSTEM | // always consider system table
((hModule != NULL) ? FORMAT_MESSAGE_FROM_HMODULE : 0),
hModule, // module to get message from (NULL == system)
dwErrCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // default language
(LPTSTR) &MessageBuffer, 0, NULL );
if ( MessageBuffer )
{
if ( dwBufferLength )
strError = (LPCTSTR)MessageBuffer;
// free the buffer allocated by the system
::LocalFree(MessageBuffer);
}
// if you loaded a message source, unload it
if (hModule != NULL)
::FreeLibrary(hModule);
if ( strError.GetLength() == 0 )
strError.Format( IDS_ERR_UNKNOWN, dwErrCode );
return strError;
}
| 29.580821 | 159 | 0.641991 | [
"model"
] |
1bd6d1788c529e8a1d59ec0a997a2b3e829cf394 | 32,224 | cpp | C++ | Sources/Elastos/Packages/Apps/Settings/src/elastos/droid/settings/CChooseLockPassword.cpp | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | 7 | 2017-07-13T10:34:54.000Z | 2021-04-16T05:40:35.000Z | Sources/Elastos/Packages/Apps/Settings/src/elastos/droid/settings/CChooseLockPassword.cpp | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | null | null | null | Sources/Elastos/Packages/Apps/Settings/src/elastos/droid/settings/CChooseLockPassword.cpp | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | 9 | 2017-07-13T12:33:20.000Z | 2021-06-19T02:46:48.000Z | //=========================================================================
// Copyright (C) 2012 The Elastos Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//=========================================================================
#include "elastos/droid/settings/CChooseLockPassword.h"
#include "elastos/droid/settings/CChooseLockGeneric.h"
#include "elastos/droid/settings/CSettingsActivity.h"
#include "elastos/droid/settings/CEncryptionInterstitial.h"
#include "elastos/droid/settings/notification/CRedactionInterstitial.h"
#include "elastos/droid/text/TextUtils.h"
#include "elastos/droid/R.h"
#include "R.h"
#include <elastos/core/CoreUtils.h>
#include <elastos/core/Math.h>
#include <elastos/core/StringUtils.h>
#include <elastos/utility/logging/Slogger.h>
using Elastos::Droid::Settings::CEncryptionInterstitial;
using Elastos::Droid::Settings::Notification::CRedactionInterstitial;
using Elastos::Droid::App::Admin::IDevicePolicyManager;
using Elastos::Droid::Content::CIntent;
using Elastos::Droid::Internal::Widget::IPasswordEntryKeyboardView;
using Elastos::Droid::Internal::Widget::CLockPatternUtils;
using Elastos::Droid::Internal::Widget::ILockPatternUtilsHelper;
using Elastos::Droid::Internal::Widget::CLockPatternUtilsHelper;
using Elastos::Droid::Internal::Widget::CPasswordEntryKeyboardHelper;
using Elastos::Droid::Text::IInputType;
using Elastos::Droid::Text::ISpannable;
using Elastos::Droid::Text::TextUtils;
using Elastos::Droid::Text::ISelection;
using Elastos::Droid::Text::CSelection;
using Elastos::Droid::Text::EIID_ITextWatcher;
using Elastos::Droid::View::InputMethod::IEditorInfo;
using Elastos::Droid::View::EIID_IViewOnClickListener;
using Elastos::Droid::Widget::EIID_IOnEditorActionListener;
using Elastos::Core::CoreUtils;
using Elastos::Core::StringUtils;
using Elastos::Utility::Logging::Slogger;
namespace Elastos {
namespace Droid {
namespace Settings {
//===============================================================================
// CChooseLockPassword::ChooseLockPasswordFragment::Stage
//===============================================================================
AutoPtr<CChooseLockPassword::ChooseLockPasswordFragment::Stage>
CChooseLockPassword::ChooseLockPasswordFragment::Stage::INTRODUCTION = new Stage(
String("INTRODUCTION"), 0,
R::string::lockpassword_choose_your_password_header,
R::string::lockpassword_choose_your_pin_header,
R::string::lockpassword_continue_label);
AutoPtr<CChooseLockPassword::ChooseLockPasswordFragment::Stage>
CChooseLockPassword::ChooseLockPasswordFragment::Stage::NEED_TO_CONFIRM = new Stage(
String("NEED_TO_CONFIRM"), 1,
R::string::lockpassword_confirm_your_password_header,
R::string::lockpassword_confirm_your_pin_header,
R::string::lockpassword_ok_label);
AutoPtr<CChooseLockPassword::ChooseLockPasswordFragment::Stage>
CChooseLockPassword::ChooseLockPasswordFragment::Stage::CONFIRM_WRONG = new Stage(
String("CONFIRM_WRONG"), 2,
R::string::lockpassword_confirm_passwords_dont_match,
R::string::lockpassword_confirm_pins_dont_match,
R::string::lockpassword_continue_label);
CAR_INTERFACE_IMPL(CChooseLockPassword::ChooseLockPasswordFragment::Stage, Object, IPasswordStage)
CChooseLockPassword::ChooseLockPasswordFragment::Stage::Stage(
/* [in] */ const String& name,
/* [in] */ Int32 ordinal,
/* [in] */ Int32 hintInAlpha,
/* [in] */ Int32 hintInNumeric,
/* [in] */ Int32 nextButtonText)
: mAlphaHint(hintInAlpha)
, mNumericHint(hintInNumeric)
, mButtonText(nextButtonText)
, mName(name)
, mOrdinal(ordinal)
{}
String CChooseLockPassword::ChooseLockPasswordFragment::Stage::GetName()
{
return mName;
}
Int32 CChooseLockPassword::ChooseLockPasswordFragment::Stage::GetOrdinal()
{
return mOrdinal;
}
AutoPtr<CChooseLockPassword::ChooseLockPasswordFragment::Stage> CChooseLockPassword::ChooseLockPasswordFragment::Stage::ValueOf(
/* [in] */ const String& name)
{
if (name.Equals("INTRODUCTION")) {
return INTRODUCTION;
}
else if (name.Equals("NEED_TO_CONFIRM")) {
return NEED_TO_CONFIRM;
}
else if (name.Equals("CONFIRM_WRONG")) {
return CONFIRM_WRONG;
}
else {
return NULL;
}
}
//===============================================================================
// CChooseLockPassword::ChooseLockPasswordFragment::InnerListener
//===============================================================================
CAR_INTERFACE_IMPL_3(CChooseLockPassword::ChooseLockPasswordFragment::InnerListener, Object, IViewOnClickListener, IOnEditorActionListener, ITextWatcher)
CChooseLockPassword::ChooseLockPasswordFragment::InnerListener::InnerListener(
/* [in] */ ChooseLockPasswordFragment* host)
: mHost(host)
{}
ECode CChooseLockPassword::ChooseLockPasswordFragment::InnerListener::OnClick(
/* [in] */ IView* v)
{
return mHost->OnClick(v);
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::InnerListener::OnEditorAction(
/* [in] */ ITextView* v,
/* [in] */ Int32 actionId,
/* [in] */ IKeyEvent* event,
/* [out] */ Boolean* result)
{
return mHost->OnEditorAction(v, actionId, event, result);
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::InnerListener::BeforeTextChanged(
/* [in] */ ICharSequence* s,
/* [in] */ Int32 start,
/* [in] */ Int32 count,
/* [in] */ Int32 after)
{
return mHost->BeforeTextChanged(s, start, count, after);
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::InnerListener::OnTextChanged(
/* [in] */ ICharSequence* s,
/* [in] */ Int32 start,
/* [in] */ Int32 before,
/* [in] */ Int32 count)
{
return mHost->OnTextChanged(s, start, before, count);
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::InnerListener::AfterTextChanged(
/* [in] */ IEditable* s)
{
return mHost->AfterTextChanged(s);
}
//===============================================================================
// CChooseLockPassword::ChooseLockPasswordFragment::MyHandler
//===============================================================================
CChooseLockPassword::ChooseLockPasswordFragment::MyHandler::MyHandler(
/* [in] */ ChooseLockPasswordFragment* host)
: mHost(host)
{}
ECode CChooseLockPassword::ChooseLockPasswordFragment::MyHandler::HandleMessage(
/* [in] */ IMessage* msg)
{
Int32 what;
msg->GetWhat(&what);
if (what == MSG_SHOW_ERROR) {
AutoPtr<IInterface> obj;
msg->GetObj((IInterface**)&obj);
mHost->UpdateStage((Stage*)IPasswordStage::Probe(obj));
}
return NOERROR;
}
//===============================================================================
// CChooseLockPassword::ChooseLockPasswordFragment
//===============================================================================
const Int32 CChooseLockPassword::ChooseLockPasswordFragment::RESULT_FINISHED = RESULT_FIRST_USER;
const String CChooseLockPassword::ChooseLockPasswordFragment::KEY_FIRST_PIN("first_pin");
const String CChooseLockPassword::ChooseLockPasswordFragment::KEY_UI_STAGE("ui_stage");
const Int32 CChooseLockPassword::ChooseLockPasswordFragment::CONFIRM_EXISTING_REQUEST = 58;
const Int64 CChooseLockPassword::ChooseLockPasswordFragment::ERROR_MESSAGE_TIMEOUT = 3000;
const Int32 CChooseLockPassword::ChooseLockPasswordFragment::MSG_SHOW_ERROR = 1;
CChooseLockPassword::ChooseLockPasswordFragment::ChooseLockPasswordFragment()
: mPasswordMinLength(4)
, mPasswordMaxLength(16)
, mPasswordMinLetters(0)
, mPasswordMinUpperCase(0)
, mPasswordMinLowerCase(0)
, mPasswordMinSymbols(0)
, mPasswordMinNumeric(0)
, mPasswordMinNonLetter(0)
, mRequestedQuality(IDevicePolicyManager::PASSWORD_QUALITY_NUMERIC)
, mDone(FALSE)
, mIsAlphaMode(FALSE)
{}
CChooseLockPassword::ChooseLockPasswordFragment::~ChooseLockPasswordFragment()
{}
ECode CChooseLockPassword::ChooseLockPasswordFragment::constructor()
{
mUiStage = Stage::INTRODUCTION;
mHandler = new MyHandler(this);
mHandler->constructor();
return Fragment::constructor();
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::OnCreate(
/* [in] */ IBundle* savedInstanceState)
{
Fragment::OnCreate(savedInstanceState);
AutoPtr<IActivity> activity;
GetActivity((IActivity**)&activity);
CLockPatternUtils::New(IContext::Probe(activity), (ILockPatternUtils**)&mLockPatternUtils);
AutoPtr<IIntent> intent;
activity->GetIntent((IIntent**)&intent);
if (IChooseLockPassword::Probe(activity) == NULL) {
Slogger::E("CChooseLockPassword::ChooseLockPasswordFragment", "Fragment contained in wrong activity");
return E_SECURITY_EXCEPTION;
}
Int32 intentData, lpuData;
using Elastos::Core::Math;
mRequestedQuality = Math::Max(
(intent->GetInt32Extra(ILockPatternUtils::PASSWORD_TYPE_KEY, mRequestedQuality, &intentData), intentData),
(mLockPatternUtils->GetRequestedPasswordQuality(&lpuData), lpuData));
mPasswordMinLength = Math::Max(
(intent->GetInt32Extra(PASSWORD_MIN_KEY, mPasswordMinLength, &intentData), intentData),
(mLockPatternUtils->GetRequestedMinimumPasswordLength(&lpuData), lpuData));
intent->GetInt32Extra(PASSWORD_MAX_KEY, mPasswordMaxLength, &mPasswordMaxLength);
mPasswordMinLetters = Math::Max(
(intent->GetInt32Extra(PASSWORD_MIN_LETTERS_KEY, mPasswordMinLetters, &intentData), intentData),
(mLockPatternUtils->GetRequestedPasswordMinimumLetters(&lpuData), lpuData));
mPasswordMinUpperCase = Math::Max(
(intent->GetInt32Extra(PASSWORD_MIN_UPPERCASE_KEY, mPasswordMinUpperCase, &intentData), intentData),
(mLockPatternUtils->GetRequestedPasswordMinimumUpperCase(&lpuData), lpuData));
mPasswordMinLowerCase = Math::Max(
(intent->GetInt32Extra(PASSWORD_MIN_LOWERCASE_KEY, mPasswordMinLowerCase, &intentData), intentData),
(mLockPatternUtils->GetRequestedPasswordMinimumLowerCase(&lpuData), lpuData));
mPasswordMinNumeric = Math::Max(
(intent->GetInt32Extra(PASSWORD_MIN_NUMERIC_KEY, mPasswordMinNumeric, &intentData), intentData),
(mLockPatternUtils->GetRequestedPasswordMinimumNumeric(&lpuData), lpuData));
mPasswordMinSymbols = Math::Max(
(intent->GetInt32Extra(PASSWORD_MIN_SYMBOLS_KEY, mPasswordMinSymbols, &intentData), intentData),
(mLockPatternUtils->GetRequestedPasswordMinimumSymbols(&lpuData), lpuData));
mPasswordMinNonLetter = Math::Max(
(intent->GetInt32Extra(PASSWORD_MIN_NONLETTER_KEY, mPasswordMinNonLetter, &intentData), intentData),
(mLockPatternUtils->GetRequestedPasswordMinimumNonLetter(&lpuData), lpuData));
mChooseLockSettingsHelper = new ChooseLockSettingsHelper();
mChooseLockSettingsHelper->constructor(activity);
return NOERROR;
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::OnCreateView(
/* [in] */ ILayoutInflater* inflater,
/* [in] */ IViewGroup* container,
/* [in] */ IBundle* savedInstanceState,
/* [out] */ IView** result)
{
VALIDATE_NOT_NULL(result)
*result = NULL;
AutoPtr<IView> view;
inflater->Inflate(R::layout::choose_lock_password, NULL, (IView**)&view);
AutoPtr<InnerListener> listener = new InnerListener(this);
AutoPtr<IView> cancelButtonTmp;
view->FindViewById(R::id::cancel_button, (IView**)&cancelButtonTmp);
mCancelButton = IButton::Probe(cancelButtonTmp);
cancelButtonTmp->SetOnClickListener(listener);
AutoPtr<IView> nextButtonTmp;
view->FindViewById(R::id::next_button, (IView**)&nextButtonTmp);
mNextButton = IButton::Probe(nextButtonTmp);
nextButtonTmp->SetOnClickListener(listener);
mIsAlphaMode = IDevicePolicyManager::PASSWORD_QUALITY_ALPHABETIC == mRequestedQuality
|| IDevicePolicyManager::PASSWORD_QUALITY_ALPHANUMERIC == mRequestedQuality
|| IDevicePolicyManager::PASSWORD_QUALITY_COMPLEX == mRequestedQuality;
AutoPtr<IView> tmp;
view->FindViewById(R::id::keyboard, (IView**)&tmp);
mKeyboardView = IKeyboardView::Probe(tmp);
tmp = NULL;
view->FindViewById(R::id::password_entry, (IView**)&tmp);
mPasswordEntry = ITextView::Probe(tmp);
mPasswordEntry->SetOnEditorActionListener(listener);
mPasswordEntry->AddTextChangedListener(listener);
AutoPtr<IActivity> activity;
GetActivity((IActivity**)&activity);
CPasswordEntryKeyboardHelper::New(IContext::Probe(activity), mKeyboardView,
IView::Probe(mPasswordEntry), (IPasswordEntryKeyboardHelper**)&mKeyboardHelper);
mKeyboardHelper->SetKeyboardMode(mIsAlphaMode ?
IPasswordEntryKeyboardHelper::KEYBOARD_MODE_ALPHA
: IPasswordEntryKeyboardHelper::KEYBOARD_MODE_NUMERIC);
tmp = NULL;
view->FindViewById(R::id::headerText, (IView**)&tmp);
mHeaderText = ITextView::Probe(tmp);
Boolean res;
IView::Probe(mKeyboardView)->RequestFocus(&res);
Int32 currentType;
mPasswordEntry->GetInputType(¤tType);
mPasswordEntry->SetInputType(mIsAlphaMode ? currentType
: (IInputType::TYPE_CLASS_NUMBER | IInputType::TYPE_NUMBER_VARIATION_PASSWORD));
AutoPtr<IIntent> intent;
activity->GetIntent((IIntent**)&intent);
Boolean confirmCredentials;
intent->GetBooleanExtra(String("confirm_credentials"), TRUE, &confirmCredentials);
if (savedInstanceState == NULL) {
UpdateStage(Stage::INTRODUCTION);
if (confirmCredentials) {
mChooseLockSettingsHelper->LaunchConfirmationActivity(CONFIRM_EXISTING_REQUEST,
NULL, NULL);
}
}
else {
savedInstanceState->GetString(KEY_FIRST_PIN, &mFirstPin);
String state;
savedInstanceState->GetString(KEY_UI_STAGE, &state);
if (state != NULL) {
mUiStage = Stage::ValueOf(state);
UpdateStage(mUiStage);
}
}
mDone = FALSE;
if (ISettingsActivity::Probe(activity) != NULL) {
CSettingsActivity* sa = (CSettingsActivity*) ISettingsActivity::Probe(activity);
Int32 id = mIsAlphaMode ? R::string::lockpassword_choose_your_password_header
: R::string::lockpassword_choose_your_pin_header;
AutoPtr<ICharSequence> title;
GetText(id, (ICharSequence**)&title);
sa->SetTitle(title);
}
*result = view;
REFCOUNT_ADD(*result)
return NOERROR;
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::OnResume()
{
Fragment::OnResume();
UpdateStage(mUiStage);
Boolean res;
return IView::Probe(mKeyboardView)->RequestFocus(&res);
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::OnPause()
{
mHandler->RemoveMessages(MSG_SHOW_ERROR);
return Fragment::OnPause();
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::OnSaveInstanceState(
/* [in] */ IBundle* outState)
{
Fragment::OnSaveInstanceState(outState);
outState->PutString(KEY_UI_STAGE, mUiStage->GetName());
outState->PutString(KEY_FIRST_PIN, mFirstPin);
return NOERROR;
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::OnActivityResult(
/* [in] */ Int32 requestCode,
/* [in] */ Int32 resultCode,
/* [in] */ IIntent* data)
{
Fragment::OnActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case CONFIRM_EXISTING_REQUEST: {
if (resultCode != IActivity::RESULT_OK) {
AutoPtr<IActivity> activity;
GetActivity((IActivity**)&activity);
activity->SetResult(RESULT_FINISHED);
activity->Finish();
}
break;
}
}
return NOERROR;
}
void CChooseLockPassword::ChooseLockPasswordFragment::UpdateStage(
/* [in] */ Stage* stage)
{
AutoPtr<Stage> previousStage = mUiStage;
mUiStage = stage;
UpdateUi();
// If the stage changed, announce the header for accessibility. This
// is a no-op when accessibility is disabled.
if (previousStage.Get() != stage) {
AutoPtr<ICharSequence> cs;
mHeaderText->GetText((ICharSequence**)&cs);
IView::Probe(mHeaderText)->AnnounceForAccessibility(cs);
}
}
String CChooseLockPassword::ChooseLockPasswordFragment::ValidatePassword(
/* [in] */ const String& password)
{
String result;
if (password.GetLength() < mPasswordMinLength) {
AutoPtr< ArrayOf<IInterface*> > args = ArrayOf<IInterface*>::Alloc(1);
args->Set(0, CoreUtils::Convert(mPasswordMinLength));
GetString(mIsAlphaMode ?
R::string::lockpassword_password_too_short
: R::string::lockpassword_pin_too_short, args, &result);
return result;
}
if (password.GetLength() > mPasswordMaxLength) {
AutoPtr< ArrayOf<IInterface*> > args = ArrayOf<IInterface*>::Alloc(1);
args->Set(0, CoreUtils::Convert(mPasswordMaxLength + 1));
GetString(mIsAlphaMode ?
R::string::lockpassword_password_too_long
: R::string::lockpassword_pin_too_long, args, &result);
return result;
}
Int32 letters = 0;
Int32 numbers = 0;
Int32 lowercase = 0;
Int32 symbols = 0;
Int32 uppercase = 0;
Int32 nonletter = 0;
for (Int32 i = 0; i < password.GetLength(); i++) {
Char32 c = password.GetChar(i);
// allow non control Latin-1 characters only
if (c < 32 || c > 127) {
GetString(R::string::lockpassword_illegal_character, &result);
return result;
}
if (c >= '0' && c <= '9') {
numbers++;
nonletter++;
}
else if (c >= 'A' && c <= 'Z') {
letters++;
uppercase++;
}
else if (c >= 'a' && c <= 'z') {
letters++;
lowercase++;
}
else {
symbols++;
nonletter++;
}
}
if (IDevicePolicyManager::PASSWORD_QUALITY_NUMERIC == mRequestedQuality
|| IDevicePolicyManager::PASSWORD_QUALITY_NUMERIC_COMPLEX == mRequestedQuality) {
if (letters > 0 || symbols > 0) {
// This shouldn't be possible unless user finds some way to bring up
// soft keyboard
GetString(R::string::lockpassword_pin_contains_non_digits, &result);
return result;
}
// Check for repeated characters or sequences (e.g. '1234', '0000', '2468')
AutoPtr<ILockPatternUtilsHelper> helper;
CLockPatternUtilsHelper::AcquireSingleton((ILockPatternUtilsHelper**)&helper);
Int32 sequence;
helper->MaxLengthSequence(password, &sequence);
if (IDevicePolicyManager::PASSWORD_QUALITY_NUMERIC_COMPLEX == mRequestedQuality
&& sequence > ILockPatternUtils::MAX_ALLOWED_SEQUENCE) {
GetString(R::string::lockpassword_pin_no_sequential_digits, &result);
return result;
}
}
else if (IDevicePolicyManager::PASSWORD_QUALITY_COMPLEX == mRequestedQuality) {
AutoPtr<IResources> resources;
GetResources((IResources**)&resources);
AutoPtr< ArrayOf<IInterface*> > args = ArrayOf<IInterface*>::Alloc(1);
String str;
if (letters < mPasswordMinLetters) {
resources->GetQuantityString(
R::plurals::lockpassword_password_requires_letters, mPasswordMinLetters, &str);
args->Set(0, CoreUtils::Convert(mPasswordMinLetters));
return StringUtils::Format(str, args);
}
else if (numbers < mPasswordMinNumeric) {
resources->GetQuantityString(
R::plurals::lockpassword_password_requires_numeric, mPasswordMinNumeric, &str);
args->Set(0, CoreUtils::Convert(mPasswordMinNumeric));
return StringUtils::Format(str, args);
}
else if (lowercase < mPasswordMinLowerCase) {
resources->GetQuantityString(
R::plurals::lockpassword_password_requires_lowercase, mPasswordMinLowerCase, &str);
args->Set(0, CoreUtils::Convert(mPasswordMinLowerCase));
return StringUtils::Format(str, args);
}
else if (uppercase < mPasswordMinUpperCase) {
resources->GetQuantityString(
R::plurals::lockpassword_password_requires_uppercase, mPasswordMinUpperCase, &str);
args->Set(0, CoreUtils::Convert(mPasswordMinUpperCase));
return StringUtils::Format(str, args);
}
else if (symbols < mPasswordMinSymbols) {
resources->GetQuantityString(
R::plurals::lockpassword_password_requires_symbols, mPasswordMinSymbols, &str);
args->Set(0, CoreUtils::Convert(mPasswordMinSymbols));
return StringUtils::Format(str, args);
}
else if (nonletter < mPasswordMinNonLetter) {
resources->GetQuantityString(
R::plurals::lockpassword_password_requires_nonletter, mPasswordMinNonLetter, &str);
args->Set(0, CoreUtils::Convert(mPasswordMinNonLetter));
return StringUtils::Format(str, args);
}
}
else {
const Boolean alphabetic = IDevicePolicyManager::PASSWORD_QUALITY_ALPHABETIC
== mRequestedQuality;
const Boolean alphanumeric = IDevicePolicyManager::PASSWORD_QUALITY_ALPHANUMERIC
== mRequestedQuality;
if ((alphabetic || alphanumeric) && letters == 0) {
GetString(R::string::lockpassword_password_requires_alpha, &result);
return result;
}
if (alphanumeric && numbers == 0) {
GetString(R::string::lockpassword_password_requires_digit, &result);
return result;
}
}
Boolean res;
if (mLockPatternUtils->CheckPasswordHistory(password, &res), res) {
GetString(mIsAlphaMode ? R::string::lockpassword_password_recently_used
: R::string::lockpassword_pin_recently_used, &result);
return result;
}
return String(NULL);
}
void CChooseLockPassword::ChooseLockPasswordFragment::HandleNext()
{
Slogger::I("CChooseLockPassword", " >> HandleNext: %s", TO_CSTR(mUiStage));
if (mDone) return;
AutoPtr<ICharSequence> cs;
mPasswordEntry->GetText((ICharSequence**)&cs);
String pin;
cs->ToString(&pin);
if (TextUtils::IsEmpty(pin)) {
return;
}
String errorMsg;
if (mUiStage == Stage::INTRODUCTION) {
errorMsg = ValidatePassword(pin);
if (errorMsg.IsNull()) {
mFirstPin = pin;
mPasswordEntry->SetText(CoreUtils::Convert(""));
UpdateStage(Stage::NEED_TO_CONFIRM);
}
}
else if (mUiStage == Stage::NEED_TO_CONFIRM) {
if (mFirstPin.Equals(pin)) {
AutoPtr<IActivity> activity;
GetActivity((IActivity**)&activity);
AutoPtr<IIntent> intent;
activity->GetIntent((IIntent**)&intent);
Boolean isFallback;
intent->GetBooleanExtra(
ILockPatternUtils::LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, FALSE, &isFallback);
mLockPatternUtils->ClearLock(isFallback);
Boolean required;
intent->GetBooleanExtra(
CEncryptionInterstitial::EXTRA_REQUIRE_PASSWORD, TRUE, &required);
mLockPatternUtils->SetCredentialRequiredToDecrypt(required);
mLockPatternUtils->SaveLockPassword(pin, mRequestedQuality, isFallback);
activity->SetResult(RESULT_FINISHED);
activity->Finish();
mDone = TRUE;
StartActivity(CRedactionInterstitial::CreateStartIntent(IContext::Probe(activity)));
}
else {
AutoPtr<ICharSequence> tmp;
mPasswordEntry->GetText((ICharSequence**)&tmp);
if (tmp != NULL) {
AutoPtr<ISelection> selection;
CSelection::AcquireSingleton((ISelection**)&selection);
Int32 len;
selection->SetSelection(ISpannable::Probe(tmp), 0, (tmp->GetLength(&len), len));
}
UpdateStage(Stage::CONFIRM_WRONG);
}
}
if (!errorMsg.IsNull()) {
ShowError(errorMsg, mUiStage);
}
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::OnClick(
/* [in] */ IView* v)
{
Int32 id;
v->GetId(&id);
switch (id) {
case R::id::next_button:
HandleNext();
break;
case R::id::cancel_button: {
AutoPtr<IActivity> activity;
GetActivity((IActivity**)&activity);
activity->Finish();
break;
}
}
return NOERROR;
}
void CChooseLockPassword::ChooseLockPasswordFragment::ShowError(
/* [in] */ const String& msg,
/* [in] */ Stage* next)
{
mHeaderText->SetText(CoreUtils::Convert(msg));
AutoPtr<ICharSequence> cs;
mHeaderText->GetText((ICharSequence**)&cs);
IView::Probe(mHeaderText)->AnnounceForAccessibility(cs);
AutoPtr<IMessage> mesg;
mHandler->ObtainMessage(MSG_SHOW_ERROR, (IPasswordStage*)next, (IMessage**)&mesg);
mHandler->RemoveMessages(MSG_SHOW_ERROR);
Boolean res;
mHandler->SendMessageDelayed(mesg, ERROR_MESSAGE_TIMEOUT, &res);
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::OnEditorAction(
/* [in] */ ITextView* v,
/* [in] */ Int32 actionId,
/* [in] */ IKeyEvent* event,
/* [out] */ Boolean* result)
{
VALIDATE_NOT_NULL(result)
*result = FALSE;
// Check if this was the result of hitting the enter or "done" key
if (actionId == IEditorInfo::IME_NULL
|| actionId == IEditorInfo::IME_ACTION_DONE
|| actionId == IEditorInfo::IME_ACTION_NEXT) {
HandleNext();
*result = TRUE;
return NOERROR;
}
return NOERROR;
}
void CChooseLockPassword::ChooseLockPasswordFragment::UpdateUi()
{
AutoPtr<ICharSequence> cs;
mPasswordEntry->GetText((ICharSequence**)&cs);
String password;
cs->ToString(&password);
const Int32 length = password.GetLength();
if (mUiStage == Stage::INTRODUCTION && length > 0) {
if (length < mPasswordMinLength) {
AutoPtr< ArrayOf<IInterface*> > args = ArrayOf<IInterface*>::Alloc(1);
args->Set(0, CoreUtils::Convert(mPasswordMinLength));
String msg;
GetString(mIsAlphaMode ? R::string::lockpassword_password_too_short
: R::string::lockpassword_pin_too_short, args, &msg);
mHeaderText->SetText(CoreUtils::Convert(msg));
IView::Probe(mNextButton)->SetEnabled(FALSE);
}
else {
String error = ValidatePassword(password);
if (error != NULL) {
mHeaderText->SetText(CoreUtils::Convert(error));
IView::Probe(mNextButton)->SetEnabled(FALSE);
}
else {
mHeaderText->SetText(R::string::lockpassword_press_continue);
IView::Probe(mNextButton)->SetEnabled(TRUE);
}
}
}
else {
mHeaderText->SetText(mIsAlphaMode ? mUiStage->mAlphaHint : mUiStage->mNumericHint);
IView::Probe(mNextButton)->SetEnabled(length > 0);
}
ITextView::Probe(mNextButton)->SetText(mUiStage->mButtonText);
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::AfterTextChanged(
/* [in] */ IEditable* s)
{
// Changing the text while error displayed resets to NeedToConfirm state
if (mUiStage == Stage::CONFIRM_WRONG) {
mUiStage = Stage::NEED_TO_CONFIRM;
}
UpdateUi();
return NOERROR;
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::BeforeTextChanged(
/* [in] */ ICharSequence* s,
/* [in] */ Int32 start,
/* [in] */ Int32 count,
/* [in] */ Int32 after)
{
return NOERROR;
}
ECode CChooseLockPassword::ChooseLockPasswordFragment::OnTextChanged(
/* [in] */ ICharSequence* s,
/* [in] */ Int32 start,
/* [in] */ Int32 before,
/* [in] */ Int32 count)
{
return NOERROR;
}
//===============================================================================
// CChooseLockPassword
//===============================================================================
const String CChooseLockPassword::PASSWORD_MIN_KEY("lockscreen.password_min");
const String CChooseLockPassword::PASSWORD_MAX_KEY("lockscreen.password_max");
const String CChooseLockPassword::PASSWORD_MIN_LETTERS_KEY("lockscreen.password_min_letters");
const String CChooseLockPassword::PASSWORD_MIN_LOWERCASE_KEY("lockscreen.password_min_lowercase");
const String CChooseLockPassword::PASSWORD_MIN_UPPERCASE_KEY("lockscreen.password_min_uppercase");
const String CChooseLockPassword::PASSWORD_MIN_NUMERIC_KEY("lockscreen.password_min_numeric");
const String CChooseLockPassword::PASSWORD_MIN_SYMBOLS_KEY("lockscreen.password_min_symbols");
const String CChooseLockPassword::PASSWORD_MIN_NONLETTER_KEY("lockscreen.password_min_nonletter");
CAR_INTERFACE_IMPL(CChooseLockPassword, SettingsActivity, IChooseLockPassword)
CAR_OBJECT_IMPL(CChooseLockPassword)
CChooseLockPassword::CChooseLockPassword()
{}
CChooseLockPassword::~CChooseLockPassword()
{}
ECode CChooseLockPassword::constructor()
{
return SettingsActivity::constructor();
}
ECode CChooseLockPassword::GetIntent(
/* [out] */ IIntent** result)
{
VALIDATE_NOT_NULL(result)
*result = NULL;
AutoPtr<IIntent> intentOne;
SettingsActivity::GetIntent((IIntent**)&intentOne);
AutoPtr<IIntent> modIntent;
CIntent::New(intentOne, (IIntent**)&modIntent);
modIntent->PutExtra(EXTRA_SHOW_FRAGMENT, String("Elastos.Droid.Settings.CChooseLockPasswordFragment"));
*result = modIntent;
REFCOUNT_ADD(*result)
return NOERROR;
}
AutoPtr<IIntent> CChooseLockPassword::CreateIntent(
/* [in] */ IContext* context,
/* [in] */ Int32 quality,
/* [in] */ Boolean isFallback,
/* [in] */ Int32 minLength,
/* [in] */ Int32 maxLength,
/* [in] */ Boolean requirePasswordToDecrypt,
/* [in] */ Boolean confirmCredentials)
{
AutoPtr<IIntent> intent;
CIntent::New((IIntent**)&intent);
intent->SetClass(context, ECLSID_CChooseLockPassword);
intent->PutExtra(ILockPatternUtils::PASSWORD_TYPE_KEY, quality);
intent->PutExtra(PASSWORD_MIN_KEY, minLength);
intent->PutExtra(PASSWORD_MAX_KEY, maxLength);
intent->PutBooleanExtra(CChooseLockGeneric::CONFIRM_CREDENTIALS, confirmCredentials);
intent->PutBooleanExtra(ILockPatternUtils::LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, isFallback);
intent->PutBooleanExtra(CEncryptionInterstitial::EXTRA_REQUIRE_PASSWORD, requirePasswordToDecrypt);
return intent;
}
Boolean CChooseLockPassword::IsValidFragment(
/* [in] */ const String& fragmentName)
{
if (String("Elastos.Droid.Settings.CChooseLockPasswordFragment").Equals(fragmentName)) return TRUE;
return FALSE;
}
ECode CChooseLockPassword::OnCreate(
/* [in] */ IBundle* savedInstanceState)
{
// TODO: Fix on phones
// Disable IME on our window since we provide our own keyboard
//GetWindow()->SetFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
//WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
SettingsActivity::OnCreate(savedInstanceState);
AutoPtr<ICharSequence> msg;
GetText(R::string::lockpassword_choose_your_password_header, (ICharSequence**)&msg);
SetTitle(msg);
return NOERROR;
}
} // namespace Settings
} // namespace Droid
} // namespace Elastos | 38.777377 | 153 | 0.664319 | [
"object"
] |
1bd786bcba02de63bdfd56d29047b1599914ed13 | 95,343 | cpp | C++ | toonz/sources/common/tvectorimage/tvectorimage.cpp | ericwomer/opentoonz | 2467105e4ec0a2a3545efe8d33485c8d78d19e43 | [
"BSD-3-Clause"
] | null | null | null | toonz/sources/common/tvectorimage/tvectorimage.cpp | ericwomer/opentoonz | 2467105e4ec0a2a3545efe8d33485c8d78d19e43 | [
"BSD-3-Clause"
] | null | null | null | toonz/sources/common/tvectorimage/tvectorimage.cpp | ericwomer/opentoonz | 2467105e4ec0a2a3545efe8d33485c8d78d19e43 | [
"BSD-3-Clause"
] | null | null | null |
#include "tcurves.h"
//#include "tpalette.h"
#include "tvectorimage.h"
#include "tvectorimageP.h"
#include "tstroke.h"
//#include "tgl.h"
#include "tvectorrenderdata.h"
#include "tmathutil.h"
//#include "tdebugmessage.h"
#include "tofflinegl.h"
//#include "tcolorstyles.h"
#include "tpaletteutil.h"
#include "tthreadmessage.h"
#include "tsimplecolorstyles.h"
#include "tcomputeregions.h"
#include <memory>
//=============================================================================
typedef TVectorImage::IntersectionBranch IntersectionBranch;
namespace {
typedef std::set<int> DisabledStrokeStyles;
// uso getDisabledStrokeStyleSet() invece che accedere direttamente alla
// variabile per assicurarmi che il tutto funzioni anche quando viene
// usato PRIMA del main (per iniziativa di un costruttore di una variabile
// globale, p.es.).
// per l'idioma: cfr. Modern C++ design, Andrei Alexandrescu, Addison Wesley
// 2001, p.133
inline DisabledStrokeStyles &getDisabledStrokeStyleSet() {
static DisabledStrokeStyles disabledStokeStyles;
return disabledStokeStyles;
}
inline bool isStrokeStyleEnabled__(int index) {
DisabledStrokeStyles &disabledSet = getDisabledStrokeStyleSet();
return disabledSet.find(index) == disabledSet.end();
}
} // namespace
//=============================================================================
/*!
Permette di copiare effettuare delle copie delle curve
*/
/*
template <class Container>
class StrokeArrayInsertIterator
{
Container& container;
public:
explicit StrokeArrayInsertIterator(Container& Line)
:container(Line)
{};
StrokeArrayInsertIterator& operator=(const VIStroke* value )
{
TStroke *stroke = new TStroke(*(value->m_s));
stroke->setId(value->m_s->getId());
container.push_back(new VIStroke(stroke));
return *this;
};
StrokeArrayInsertIterator& operator*() { return *this; }
StrokeArrayInsertIterator& operator++() { return *this; }
StrokeArrayInsertIterator operator++(int val){ return *this; }
};
*/
//=============================================================================
/*!
TVectorImage::Imp: implementation of TVectorImage class
\relates TVectorImage
*/
//=============================================================================
TVectorImage::Imp::Imp(TVectorImage *vi)
: m_areValidRegions(false)
, m_notIntersectingStrokes(false)
, m_computeRegions(true)
, m_autocloseTolerance(c_newAutocloseTolerance)
, m_maxGroupId(1)
, m_maxGhostGroupId(1)
, m_mutex(new TThread::Mutex())
, m_vi(vi)
, m_intersectionData(0)
, m_computedAlmostOnce(false)
, m_justLoaded(false)
, m_insideGroup(TGroupId())
, m_minimizeEdges(true)
#ifdef NEW_REGION_FILL
, m_regionFinder(0)
#endif
{
#ifdef NEW_REGION_FILL
resetRegionFinder();
#endif
initRegionsData();
}
TVectorImage::Imp::~Imp() {
// delete m_regionFinder;
deleteRegionsData();
delete m_mutex;
}
//=============================================================================
TVectorImage::TVectorImage(bool loaded) : m_imp(new TVectorImage::Imp(this)) {
if (loaded) m_imp->m_justLoaded = true;
}
//-----------------------------------------------------------------------------
TVectorImage::~TVectorImage() {}
//-----------------------------------------------------------------------------
int TVectorImage::isInsideGroup() const {
return m_imp->m_insideGroup.getDepth();
}
//-----------------------------------------------------------------------------
int TVectorImage::addStrokeToGroup(TStroke *stroke, int strokeIndex) {
if (!m_imp->m_strokes[strokeIndex]->m_groupId.isGrouped())
return addStroke(stroke, true);
for (int i = m_imp->m_strokes.size() - 1; i >= 0; i--)
if (m_imp->m_strokes[i]->m_groupId ==
m_imp->m_strokes[strokeIndex]->m_groupId) {
m_imp->insertStrokeAt(
new VIStroke(stroke, m_imp->m_strokes[i]->m_groupId), i + 1);
return i + 1;
}
assert(false);
return -1;
}
//-----------------------------------------------------------------------------
int TVectorImage::addStroke(TStroke *stroke, bool discardPoints) {
if (discardPoints) {
TRectD bBox = stroke->getBBox();
if (bBox.x0 == bBox.x1 && bBox.y0 == bBox.y1) // empty stroke: discard
return -1;
}
if (m_imp->m_insideGroup != TGroupId()) {
int i;
for (i = m_imp->m_strokes.size() - 1; i >= 0; i--)
if (m_imp->m_insideGroup.isParentOf(m_imp->m_strokes[i]->m_groupId)) {
m_imp->insertStrokeAt(
new VIStroke(stroke, m_imp->m_strokes[i]->m_groupId), i + 1);
return i + 1;
}
}
TGroupId gid;
if (m_imp->m_strokes.empty() ||
m_imp->m_strokes.back()->m_groupId.isGrouped() != 0)
gid = TGroupId(this, true);
else
gid = m_imp->m_strokes.back()->m_groupId;
m_imp->m_strokes.push_back(new VIStroke(stroke, gid));
m_imp->m_areValidRegions = false;
return m_imp->m_strokes.size() - 1;
}
//-----------------------------------------------------------------------------
void TVectorImage::moveStrokes(int fromIndex, int count, int moveBefore) {
#ifdef _DEBUG
m_imp->checkGroups();
#endif
m_imp->moveStrokes(fromIndex, count, moveBefore, true);
#ifdef _DEBUG
m_imp->checkGroups();
#endif
}
//-----------------------------------------------------------------------------
void TVectorImage::Imp::moveStrokes(int fromIndex, int count, int moveBefore,
bool regroup) {
assert(fromIndex >= 0 && fromIndex < (int)m_strokes.size());
assert(moveBefore >= 0 && moveBefore <= (int)m_strokes.size());
assert(count > 0);
assert(fromIndex != moveBefore);
for (int i = 0; i < count; i++)
if (fromIndex < moveBefore)
moveStroke(fromIndex, moveBefore);
else
moveStroke(fromIndex + i, moveBefore + i);
std::vector<int> changedStrokes;
if (regroup) regroupGhosts(changedStrokes);
if (!changedStrokes.empty())
notifyChangedStrokes(changedStrokes, std::vector<TStroke *>(), false);
}
//-----------------------------------------------------------------------------
void TVectorImage::insertStrokeAt(VIStroke *vs, int strokeIndex,
bool recomputeRegions) {
m_imp->insertStrokeAt(vs, strokeIndex, recomputeRegions);
}
/*
void TVectorImage::insertStrokeAt(TStroke *stroke, int strokeIndex, const
TGroupId& id)
{
VIStroke* vs;
vs = new VIStroke(stroke, id);
m_imp->insertStrokeAt(vs, strokeIndex);
}
*/
//-----------------------------------------------------------------------------
/*
TRectD TVectorImage::addStroke(const std::vector<TThickPoint> &points)
{
// era: TStroke *stroke = makeTStroke(points);
TStroke *stroke = TStroke::interpolate(points, 5.0);
m_imp->m_strokes.push_back(new VIStroke( stroke) );
m_imp->m_areValidRegions = false;
return stroke->getBBox();
}
*/
//-----------------------------------------------------------------------------
static bool isRegionWithStroke(TRegion *region, TStroke *s) {
for (UINT i = 0; i < region->getEdgeCount(); i++)
if (region->getEdge(i)->m_s == s) return true;
return false;
}
//-----------------------------------------------------------------------------
static void deleteSubRegionWithStroke(TRegion *region, TStroke *s) {
for (int i = 0; i < (int)region->getSubregionCount(); i++) {
deleteSubRegionWithStroke(region->getSubregion(i), s);
if (isRegionWithStroke(region->getSubregion(i), s)) {
TRegion *r = region->getSubregion(i);
r->moveSubregionsTo(region);
assert(r->getSubregionCount() == 0);
region->deleteSubregion(i);
delete r;
i--;
}
}
}
//-----------------------------------------------------------------------------
TStroke *TVectorImage::removeStroke(int index, bool doComputeRegions) {
return m_imp->removeStroke(index, doComputeRegions);
}
TStroke *TVectorImage::Imp::removeStroke(int index, bool doComputeRegions) {
assert(index >= 0 && index < (int)m_strokes.size());
QMutexLocker sl(m_mutex);
VIStroke *stroke = m_strokes[index];
eraseIntersection(index);
m_strokes.erase(m_strokes.begin() + index);
if (m_computedAlmostOnce) {
reindexEdges(index);
if (doComputeRegions) computeRegions();
}
return stroke->m_s;
}
//-----------------------------------------------------------------------------
void TVectorImage::removeStrokes(const std::vector<int> &toBeRemoved,
bool deleteThem, bool recomputeRegions) {
m_imp->removeStrokes(toBeRemoved, deleteThem, recomputeRegions);
}
//-----------------------------------------------------------------------------
void TVectorImage::Imp::removeStrokes(const std::vector<int> &toBeRemoved,
bool deleteThem, bool recomputeRegions) {
QMutexLocker sl(m_mutex);
for (int i = toBeRemoved.size() - 1; i >= 0; i--) {
assert(i == 0 || toBeRemoved[i - 1] < toBeRemoved[i]);
UINT index = toBeRemoved[i];
eraseIntersection(index);
if (deleteThem) delete m_strokes[index];
m_strokes.erase(m_strokes.begin() + index);
}
if (m_computedAlmostOnce && !toBeRemoved.empty()) {
reindexEdges(toBeRemoved, false);
if (recomputeRegions)
computeRegions();
else
m_areValidRegions = false;
}
}
//-----------------------------------------------------------------------------
void TVectorImage::deleteStroke(int index) {
TStroke *stroke = removeStroke(index);
delete stroke;
}
//-----------------------------------------------------------------------------
void TVectorImage::deleteStroke(VIStroke *stroke) {
UINT index = 0;
for (; index < m_imp->m_strokes.size(); index++)
if (m_imp->m_strokes[index] == stroke) {
deleteStroke(index);
return;
}
}
//-----------------------------------------------------------------------------
/*
void TVectorImage::validateRegionEdges(TStroke* stroke, bool invalidate)
{
if (invalidate)
for (UINT i=0; i<getRegionCount(); i++)
{
TRegion *r = getRegion(i);
// if ((*cit)->getBBox().contains(stroke->getBBox()))
for (UINT j=0; j<r->getEdgeCount(); j++)
{
TEdge* edge = r->getEdge(j);
if (edge->m_s == stroke)
edge->m_w0 = edge->m_w1 = -1;
}
}
else
for (UINT i=0; i<getRegionCount(); i++)
{
TRegion *r = getRegion(i);
// if ((*cit)->getBBox().contains(stroke->getBBox()))
for (UINT j=0; j<r->getEdgeCount(); j++)
{
TEdge* edge = r->getEdge(j);
if (edge->m_w0==-1)
{
int index;
double t, dummy;
edge->m_s->getNearestChunk(edge->m_p0, t, index, dummy);
edge->m_w0 = getWfromChunkAndT(edge->m_s, index, t);
edge->m_s->getNearestChunk(edge->m_p1, t, index, dummy);
edge->m_w1 = getWfromChunkAndT(edge->m_s, index, t);
}
}
}
}
*/
//-----------------------------------------------------------------------------
UINT TVectorImage::getStrokeCount() const { return m_imp->m_strokes.size(); }
//-----------------------------------------------------------------------------
/*
void TVectorImage::addSeed(const TPointD& p, const TPixel& color)
{
m_imp->m_seeds.push_back(TFillSeed(color, p, NULL));
}
*/
//-----------------------------------------------------------------------------
UINT TVectorImage::getRegionCount() const {
// assert( m_imp->m_areValidRegions || m_imp->m_regions.empty());
return m_imp->m_regions.size();
}
//-----------------------------------------------------------------------------
TRegion *TVectorImage::getRegion(UINT index) const {
assert(index < m_imp->m_regions.size());
// assert( m_imp->m_areValidRegions );
return m_imp->m_regions[index];
}
//-----------------------------------------------------------------------------
TRegion *TVectorImage::getRegion(TRegionId regId) const {
int index = getStrokeIndexById(regId.m_strokeId);
assert(m_imp->m_areValidRegions);
TRegion *reg = m_imp->getRegion(regId, index);
// assert( reg );
return reg;
}
//-----------------------------------------------------------------------------
TRegion *TVectorImage::Imp::getRegion(TRegionId regId, int index) const {
assert(index != -1);
if (index == -1) return 0;
assert(index < (int)m_strokes.size());
if (index >= (int)m_strokes.size()) return 0;
std::list<TEdge *> &edgeList = m_strokes[index]->m_edgeList;
std::list<TEdge *>::iterator endList = edgeList.end();
double w0;
double w1;
for (std::list<TEdge *>::iterator it = edgeList.begin(); it != endList;
++it) {
w0 = (*it)->m_w0;
w1 = (*it)->m_w1;
if (w0 < w1) {
if (w0 < regId.m_midW && regId.m_midW < w1 && regId.m_direction)
return (*it)->m_r;
} else {
if (w1 < regId.m_midW && regId.m_midW < w0 && !regId.m_direction)
return (*it)->m_r;
}
}
#ifdef _DEBUG
TPointD cp1 = m_strokes[index]->m_s->getControlPoint(0);
TPointD cp2 = m_strokes[index]->m_s->getControlPoint(
m_strokes[index]->m_s->getControlPointCount() - 1);
#endif
return 0;
}
/*
TRegion* TVectorImage::getRegion(TRegionId regId) const
{
int index = getStrokeIndexById(regId.m_strokeId);
assert(index!=-1);
if( index == -1 )
return 0;
assert( index < (int)m_imp->m_strokes.size() );
if( index >= (int)m_imp->m_strokes.size() )
return 0;
std::list<TEdge*> &edgeList = m_imp->m_strokes[index]->m_edgeList;
std::list<TEdge*>::iterator endList = edgeList.end();
double w0;
double w1;
for(list<TEdge*>::iterator it= edgeList.begin(); it!=endList; ++it)
{
w0 = (*it)->m_w0;
w1 = (*it)->m_w1;
if(w0<w1)
{
if( w0 < regId.m_midW && regId.m_midW < w1 && regId.m_direction )
return (*it)->m_r;
}
else
{
if( w1 < regId.m_midW && regId.m_midW < w0 && !regId.m_direction )
return (*it)->m_r;
}
}
return 0;
}
*/
//-----------------------------------------------------------------------------
void TVectorImage::setEdgeColors(int strokeIndex, int leftColorIndex,
int rightColorIndex) {
std::list<TEdge *> &ll = m_imp->m_strokes[strokeIndex]->m_edgeList;
std::list<TEdge *>::const_iterator l = ll.begin();
std::list<TEdge *>::const_iterator l_e = ll.end();
for (; l != l_e; ++l) {
// double w0 = (*l)->m_w0, w1 = (*l)->m_w1;
if ((*l)->m_w0 > (*l)->m_w1) {
if (leftColorIndex != -1)
(*l)->m_styleId = leftColorIndex;
else if (rightColorIndex != -1)
(*l)->m_styleId = rightColorIndex;
} else {
if (rightColorIndex != -1)
(*l)->m_styleId = rightColorIndex;
else if (leftColorIndex != -1)
(*l)->m_styleId = leftColorIndex;
}
}
}
//-----------------------------------------------------------------------------
TStroke *TVectorImage::getStroke(UINT index) const {
assert(index < m_imp->m_strokes.size());
return m_imp->m_strokes[index]->m_s;
}
VIStroke *TVectorImage::getVIStroke(UINT index) const {
assert(index < m_imp->m_strokes.size());
return m_imp->m_strokes[index];
}
//-----------------------------------------------------------------------------
VIStroke *TVectorImage::getStrokeById(int id) const {
int n = m_imp->m_strokes.size();
for (int i = 0; i < n; i++)
if (m_imp->m_strokes[i]->m_s->getId() == id) return m_imp->m_strokes[i];
return 0;
}
//-----------------------------------------------------------------------------
int TVectorImage::getStrokeIndexById(int id) const {
int n = m_imp->m_strokes.size();
for (int i = 0; i < n; i++)
if (m_imp->m_strokes[i]->m_s->getId() == id) return i;
return -1;
}
//-----------------------------------------------------------------------------
int TVectorImage::getStrokeIndex(TStroke *stroke) const {
int n = m_imp->m_strokes.size();
for (int i = 0; i < n; i++)
if (m_imp->m_strokes[i]->m_s == stroke) return i;
return -1;
}
//-----------------------------------------------------------------------------
TRectD TVectorImage::getBBox() const {
UINT strokeCount = m_imp->m_strokes.size();
if (strokeCount == 0) return TRectD();
TPalette *plt = getPalette();
TRectD bbox;
for (UINT i = 0; i < strokeCount; ++i) {
TRectD r = m_imp->m_strokes[i]->m_s->getBBox();
TColorStyle *style = 0;
if (plt) style = plt->getStyle(m_imp->m_strokes[i]->m_s->getStyle());
if (dynamic_cast<TRasterImagePatternStrokeStyle *>(style) ||
dynamic_cast<TVectorImagePatternStrokeStyle *>(
style)) // con i pattern style, il render a volte taglia sulla bbox
// dello stroke....
// aumento la bbox della meta' delle sue dimensioni:pezzaccia.
r = r.enlarge(std::max(r.getLx() * 0.25, r.getLy() * 0.25));
bbox = ((i == 0) ? r : bbox + r);
}
return bbox;
}
//-----------------------------------------------------------------------------
bool TVectorImage::getNearestStroke(const TPointD &p, double &outW,
UINT &strokeIndex, double &dist2,
bool onlyInCurrentGroup) const {
dist2 = (std::numeric_limits<double>::max)();
strokeIndex = getStrokeCount();
outW = -1;
double tempdis2, tempPar;
for (int i = 0; i < (int)m_imp->m_strokes.size(); ++i) {
if (onlyInCurrentGroup && !inCurrentGroup(i)) continue;
TStroke *s = m_imp->m_strokes[i]->m_s;
tempPar = s->getW(p);
tempdis2 = tdistance2(TThickPoint(p, 0), s->getThickPoint(tempPar));
if (tempdis2 < dist2) {
outW = tempPar;
dist2 = tempdis2;
strokeIndex = i;
}
}
return dist2 < (std::numeric_limits<double>::max)();
}
//-----------------------------------------------------------------------------
#if defined(LINUX) || defined(MACOSX)
void TVectorImage::render(const TVectorRenderData &rd, TRaster32P &ras) {
// hardRenderVectorImage(rd,ras,this);
}
#endif
//-----------------------------------------------------------------------------
//#include "timage_io.h"
TRaster32P TVectorImage::render(bool onlyStrokes) {
TRect bBox = convert(getBBox());
if (bBox.isEmpty()) return (TRaster32P)0;
std::unique_ptr<TOfflineGL> offlineGlContext(new TOfflineGL(bBox.getSize()));
offlineGlContext->clear(TPixel32(0, 0, 0, 0));
offlineGlContext->makeCurrent();
TVectorRenderData rd(TTranslation(-convert(bBox.getP00())),
TRect(bBox.getSize()), getPalette(), 0, true, true);
rd.m_drawRegions = !onlyStrokes;
offlineGlContext->draw(this, rd, false);
return offlineGlContext->getRaster()->clone();
// hardRenderVectorImage(rd,ras,this);
}
//-----------------------------------------------------------------------------
TRegion *TVectorImage::getRegion(const TPointD &p) {
#ifndef NEW_REGION_FILL
if (!isComputedRegionAlmostOnce()) return 0;
if (!m_imp->m_areValidRegions) m_imp->computeRegions();
#endif
return m_imp->getRegion(p);
}
//-----------------------------------------------------------------------------
TRegion *TVectorImage::Imp::getRegion(const TPointD &p) {
int strokeIndex = (int)m_strokes.size() - 1;
while (strokeIndex >= 0) {
for (UINT regionIndex = 0; regionIndex < m_regions.size(); regionIndex++)
if (areDifferentGroup(strokeIndex, false, regionIndex, true) == -1 &&
m_regions[regionIndex]->contains(p))
return m_regions[regionIndex]->getRegion(p);
int curr = strokeIndex;
while (strokeIndex >= 0 &&
areDifferentGroup(curr, false, strokeIndex, false) == -1)
strokeIndex--;
}
return 0;
}
//-----------------------------------------------------------------------------
int TVectorImage::fillStrokes(const TPointD &p, int styleId) {
UINT index;
double outW, dist2;
if (getNearestStroke(p, outW, index, dist2, true)) {
double thick = getStroke(index)->getThickPoint(outW).thick * 1.25;
if (thick < 0.5) thick = 0.5;
if (dist2 > thick * thick) return -1;
assert(index >= 0 && index < m_imp->m_strokes.size());
int ret = m_imp->m_strokes[index]->m_s->getStyle();
m_imp->m_strokes[index]->m_s->setStyle(styleId);
return ret;
}
return -1;
}
//-----------------------------------------------------------------------------
#ifdef NEW_REGION_FILL
void TVectorImage::resetRegionFinder() { m_imp->resetRegionFinder(); }
#else
//------------------------------------------------------------------
int TVectorImage::fill(const TPointD &p, int newStyleId, bool onlyEmpty) {
TRegion *r = getRegion(p);
if (onlyEmpty && r && r->getStyle() != 0) return -1;
if (!m_imp->m_areValidRegions) m_imp->computeRegions();
return m_imp->fill(p, newStyleId);
}
#endif
//-----------------------------------------------------------------------------
/*
void TVectorImage::autoFill(int styleId)
{
m_imp->autoFill(styleId, true);
}
void TVectorImage::Imp::autoFill(int styleId, bool oddLevel)
{
if (!m_areValidRegions)
computeRegions();
for (UINT i = 0; i<m_regions.size(); i++)
{
if (oddLevel)
m_regions[i]->setStyle(styleId);
m_regions[i]->autoFill(styleId, !oddLevel);
}
}
*/
//-----------------------------------------------------------------------------
/*
void TRegion::autoFill(int styleId, bool oddLevel)
{
for (UINT i = 0; i<getSubregionCount(); i++)
{
TRegion* r = getSubregion(i);
if (oddLevel)
r->setStyle(styleId);
r->autoFill(styleId, !oddLevel);
}
}
*/
//-----------------------------------------------------------------------------
int TVectorImage::Imp::fill(const TPointD &p, int styleId) {
int strokeIndex = (int)m_strokes.size() - 1;
while (strokeIndex >= 0) {
if (!inCurrentGroup(strokeIndex)) {
strokeIndex--;
continue;
}
for (UINT regionIndex = 0; regionIndex < m_regions.size(); regionIndex++)
if (areDifferentGroup(strokeIndex, false, regionIndex, true) == -1 &&
m_regions[regionIndex]->contains(p))
return m_regions[regionIndex]->fill(p, styleId);
int curr = strokeIndex;
while (strokeIndex >= 0 &&
areDifferentGroup(curr, false, strokeIndex, false) == -1)
strokeIndex--;
}
return -1;
}
//-----------------------------------------------------------------------------
bool TVectorImage::selectFill(const TRectD &selArea, TStroke *s, int newStyleId,
bool onlyUnfilled, bool fillAreas,
bool fillLines) {
if (!m_imp->m_areValidRegions) m_imp->computeRegions();
return m_imp->selectFill(selArea, s, newStyleId, onlyUnfilled, fillAreas,
fillLines);
}
//-----------------------------------------------------------------------------
bool TVectorImage::Imp::selectFill(const TRectD &selArea, TStroke *s,
int newStyleId, bool onlyUnfilled,
bool fillAreas, bool fillLines) {
bool hitSome = false;
if (s) {
TVectorImage aux;
aux.addStroke(s);
aux.findRegions();
for (UINT j = 0; j < aux.getRegionCount(); j++) {
TRegion *r0 = aux.getRegion(j);
if (fillAreas)
for (UINT i = 0; i < m_regions.size(); i++) {
TRegion *r1 = m_regions[i];
if (m_insideGroup != TGroupId() &&
!m_insideGroup.isParentOf(
m_strokes[r1->getEdge(0)->m_index]->m_groupId))
continue;
if ((!onlyUnfilled || r1->getStyle() == 0) && r0->contains(*r1)) {
r1->setStyle(newStyleId);
hitSome = true;
}
}
if (fillLines)
for (UINT i = 0; i < m_strokes.size(); i++) {
if (!inCurrentGroup(i)) continue;
TStroke *s1 = m_strokes[i]->m_s;
if ((!onlyUnfilled || s1->getStyle() == 0) && r0->contains(*s1)) {
s1->setStyle(newStyleId);
hitSome = true;
}
}
}
aux.removeStroke(0);
return hitSome;
}
// rect fill
if (fillAreas)
#ifndef NEW_REGION_FILL
for (UINT i = 0; i < m_regions.size(); i++) {
int index, j = 0;
do
index = m_regions[i]->getEdge(j++)->m_index;
while (index < 0 && j < (int)m_regions[i]->getEdgeCount());
// if index<0, means that the region is purely of autoclose strokes!
if (m_insideGroup != TGroupId() && index >= 0 &&
!m_insideGroup.isParentOf(m_strokes[index]->m_groupId))
continue;
if (!onlyUnfilled || m_regions[i]->getStyle() == 0)
hitSome |= m_regions[i]->selectFill(selArea, newStyleId);
}
#else
findRegions(selArea);
for (UINT i = 0; i < m_regions.size(); i++) {
if (m_insideGroup != TGroupId() &&
!m_insideGroup.isParentOf(
m_strokes[m_regions[i]->getEdge(0)->m_index]->m_groupId))
continue;
if (!onlyUnfilled || m_regions[i]->getStyle() == 0)
hitSome |= m_regions[i]->selectFill(selArea, newStyleId);
}
#endif
if (fillLines)
for (UINT i = 0; i < m_strokes.size(); i++) {
if (!inCurrentGroup(i)) continue;
TStroke *s = m_strokes[i]->m_s;
if ((!onlyUnfilled || s->getStyle() == 0) &&
selArea.contains(s->getBBox())) {
s->setStyle(newStyleId);
hitSome = true;
}
}
return hitSome;
}
//-----------------------------------------------------------------------------
/*
void TVectorImageImp::seedFill()
{
std::vector<TFillSeed>::iterator it;
TRegion*r;
TFillStyleP app =NULL;
for (it=m_seeds.begin(); it!=m_seeds.end(); )
if ((r=fill(it->m_p, new TColorStyle(it->m_fillStyle.getPointer()) ))!=NULL)
{
it->m_r = r;
it = m_seeds.erase(it); // i seed provengono da immagini vecchie. non
servono piu'.
}
m_areValidRegions=true;
}
*/
//-----------------------------------------------------------------------------
/*
void TVectorImage::seedFill()
{
m_imp->seedFill();
}
*/
//-----------------------------------------------------------------------------
void TVectorImage::notifyChangedStrokes(
const std::vector<int> &strokeIndexArray,
const std::vector<TStroke *> &oldStrokeArray, bool areFlipped) {
std::vector<TStroke *> aux;
/*
if (oldStrokeArray.empty())
{
for (int i=0; i<(int)strokeIndexArray.size(); i++)
{
TStroke *s = getStroke(strokeIndexArray[i]);
aux.push_back(s);
}
m_imp->notifyChangedStrokes(strokeIndexArray, aux, areFlipped);
}
else*/
m_imp->notifyChangedStrokes(strokeIndexArray, oldStrokeArray, areFlipped);
}
//-----------------------------------------------------------------------------
void TVectorImage::notifyChangedStrokes(int strokeIndexArray,
TStroke *oldStroke, bool isFlipped) {
std::vector<int> app(1);
app[0] = strokeIndexArray;
std::vector<TStroke *> oldStrokeArray(1);
oldStrokeArray[0] = oldStroke ? oldStroke : getStroke(strokeIndexArray);
m_imp->notifyChangedStrokes(app, oldStrokeArray, isFlipped);
}
//-----------------------------------------------------------------------------
// ofstream of("C:\\temp\\butta.txt");
void transferColors(const std::list<TEdge *> &oldList,
const std::list<TEdge *> &newList, bool isStrokeChanged,
bool isFlipped, bool overwriteColor) {
if (newList.empty() || oldList.empty()) return;
std::list<TEdge *>::const_iterator it;
// unused variable
#if 0
list<TEdge*>::const_iterator it1;
#endif
double totLength;
if (isStrokeChanged) totLength = newList.front()->m_s->getLength();
for (it = newList.begin(); it != newList.end(); ++it) {
int newStyle = -1; // ErrorStyle;
// unused variable
#if 0
int styleId = (*it)->m_styleId;
#endif
if (!overwriteColor && (*it)->m_styleId != 0) continue;
bool reversed;
double deltaMax = 0.005;
double l0, l1;
if ((*it)->m_w0 > (*it)->m_w1) {
reversed = !isFlipped;
if (isStrokeChanged) {
l0 = (*it)->m_s->getLength((*it)->m_w1) / totLength;
l1 = (*it)->m_s->getLength((*it)->m_w0) / totLength;
} else {
l0 = (*it)->m_w1;
l1 = (*it)->m_w0;
}
} else {
reversed = isFlipped;
if (isStrokeChanged) {
l0 = (*it)->m_s->getLength((*it)->m_w0) / totLength;
l1 = (*it)->m_s->getLength((*it)->m_w1) / totLength;
} else {
l0 = (*it)->m_w0;
l1 = (*it)->m_w1;
}
// w0 = (*it)->m_w0;
// w1 = (*it)->m_w1;
}
std::list<TEdge *>::const_iterator it1 = oldList.begin();
for (; it1 != oldList.end(); ++it1) {
// unused variable
#if 0
TEdge*e = *it1;
#endif
if (/*(*it1)->m_styleId==0 ||*/
(reversed && (*it1)->m_w0 < (*it1)->m_w1) ||
(!reversed && (*it1)->m_w0 > (*it1)->m_w1))
continue;
double _l0, _l1;
if (isStrokeChanged) {
double totLength1 = (*it1)->m_s->getLength();
_l0 = (*it1)->m_s->getLength(std::min((*it1)->m_w0, (*it1)->m_w1)) /
totLength1;
_l1 = (*it1)->m_s->getLength(std::max((*it1)->m_w0, (*it1)->m_w1)) /
totLength1;
} else {
_l0 = std::min((*it1)->m_w0, (*it1)->m_w1);
_l1 = std::max((*it1)->m_w0, (*it1)->m_w1);
}
double delta = std::min(l1, _l1) - std::max(l0, _l0);
if (delta > deltaMax) {
deltaMax = delta;
newStyle = (*it1)->m_styleId;
}
}
if (newStyle >= 0) // !=ErrorStyle)
{
if ((*it)->m_r)
(*it)->m_r->setStyle(newStyle);
else
(*it)->m_styleId = newStyle;
}
}
}
//-----------------------------------------------------------------------------
void TVectorImage::transferStrokeColors(TVectorImageP sourceImage,
int sourceStroke,
TVectorImageP destinationImage,
int destinationStroke) {
std::list<TEdge *> *sourceList =
&(sourceImage->m_imp->m_strokes[sourceStroke]->m_edgeList);
std::list<TEdge *> *destinationList =
&(destinationImage->m_imp->m_strokes[destinationStroke]->m_edgeList);
transferColors(*sourceList, *destinationList, true, false, false);
}
//-----------------------------------------------------------------------------
bool TVectorImage::Imp::areWholeGroups(const std::vector<int> &indexes) const {
UINT i, j;
for (i = 0; i < indexes.size(); i++) {
if (m_strokes[indexes[i]]->m_isNewForFill) return false;
if (!m_strokes[indexes[i]]->m_groupId.isGrouped()) return false;
for (j = 0; j < m_strokes.size(); j++) {
int ret = areDifferentGroup(indexes[i], false, j, false);
if (ret == -1 || (ret >= 1 && find(indexes.begin(), indexes.end(), j) ==
indexes.end()))
return false;
}
}
return true;
}
//-----------------------------------------------------------------------------
//-------------------------------------------------------------------
void TVectorImage::Imp::notifyChangedStrokes(
const std::vector<int> &strokeIndexArray,
const std::vector<TStroke *> &oldStrokeArray, bool areFlipped) {
#ifdef _DEBUG
checkIntersections();
#endif
assert(oldStrokeArray.empty() ||
strokeIndexArray.size() == oldStrokeArray.size());
if (!m_computedAlmostOnce && !m_notIntersectingStrokes) return;
typedef std::list<TEdge *> EdgeList;
std::vector<EdgeList> oldEdgeListArray(strokeIndexArray.size());
int i;
// se si sono trasformati interi gruppi (senza deformare le stroke) non c'e'
// bisogno di ricalcolare le regioni!
if (oldStrokeArray.empty() && areWholeGroups(strokeIndexArray)) {
m_areValidRegions = true;
for (i = 0; i < (int)m_regions.size(); i++)
invalidateRegionPropAndBBox(m_regions[i]);
return;
}
QMutexLocker sl(m_mutex);
for (i = 0; i < (int)strokeIndexArray.size(); i++) // ATTENZIONE! non si puo'
// fare eraseIntersection
// in questo stesso ciclo
{
VIStroke *s = m_strokes[strokeIndexArray[i]];
// if (s->m_s->isSelfLoop())
// assert(s->m_edgeList.size()<=1);
std::list<TEdge *>::iterator it = s->m_edgeList.begin();
for (; it != s->m_edgeList.end(); it++) {
TEdge *e = new TEdge(**it, false);
if (!oldStrokeArray.empty()) e->m_s = oldStrokeArray[i];
oldEdgeListArray[i].push_back(e); // bisogna allocare nuovo edge,
// perche'la eraseIntersection poi lo
// cancella....
if ((*it)->m_toBeDeleted) delete *it;
}
s->m_edgeList.clear();
}
for (i = 0; i < (int)strokeIndexArray.size(); i++) {
eraseIntersection(strokeIndexArray[i]);
if (!m_notIntersectingStrokes)
m_strokes[strokeIndexArray[i]]->m_isNewForFill = true;
}
computeRegions(); // m_imp->m_strokes, m_imp->m_regions);
for (i = 0; i < (int)strokeIndexArray.size(); i++) {
transferColors(oldEdgeListArray[i],
m_strokes[strokeIndexArray[i]]->m_edgeList, true, areFlipped,
false);
clearPointerContainer(oldEdgeListArray[i]);
}
#ifdef _DEBUG
checkIntersections();
#endif
}
//-----------------------------------------------------------------------------
void TVectorImage::findRegions() {
// for (int i=0; i<(int)m_imp->m_strokes.size(); i++)
// {
// m_imp->eraseIntersection(i);
// m_imp->m_strokes[i]->m_isNewForFill=true;
// }
if (m_imp->m_areValidRegions) return;
// m_imp->m_regions.clear();
// compute regions...
m_imp->computeRegions(); // m_imp->m_strokes, m_imp->m_regions);
}
//-----------------------------------------------------------------------------
void TVectorImage::putRegion(TRegion *region) {
m_imp->m_regions.push_back(region);
}
//-----------------------------------------------------------------------------
//-------------------------------------------------------------------
void TVectorImage::Imp::cloneRegions(TVectorImage::Imp &out,
bool doComputeRegions) {
std::unique_ptr<IntersectionBranch[]> v;
UINT size = getFillData(v);
out.setFillData(v, size, doComputeRegions);
}
//-----------------------------------------------------------------------------
TVectorImageP TVectorImage::clone() const {
return TVectorImageP(cloneImage());
}
//-----------------------------------------------------------------------------
TImage *TVectorImage::cloneImage() const {
TVectorImage *out = new TVectorImage;
out->m_imp->m_autocloseTolerance = m_imp->m_autocloseTolerance;
out->m_imp->m_maxGroupId = m_imp->m_maxGroupId;
out->m_imp->m_maxGhostGroupId = m_imp->m_maxGhostGroupId;
for (int i = 0; i < (int)m_imp->m_strokes.size(); i++) {
out->m_imp->m_strokes.push_back(new VIStroke(*(m_imp->m_strokes[i])));
out->m_imp->m_strokes.back()->m_s->setId(m_imp->m_strokes[i]->m_s->getId());
}
m_imp->cloneRegions(*out->m_imp);
out->setPalette(getPalette());
out->m_imp->m_computedAlmostOnce = m_imp->m_computedAlmostOnce;
out->m_imp->m_justLoaded = m_imp->m_justLoaded;
return out;
}
//-----------------------------------------------------------------------------
/*
TVectorImageP mergeAndClear(TVectorImageP v1, TVectorImageP v2 )
{
TVectorImageP out = new TVectorImage;
std::vector<VIStroke*>::iterator it_b = v1->m_imp->m_strokes.begin();
std::vector<VIStroke*>::iterator it_e = v1->m_imp->m_strokes.end();
std::copy( it_b, it_e, std::back_inserter( out->m_imp->m_strokes ) );
it_b = v2->m_imp->m_strokes.begin();
it_e = v2->m_imp->m_strokes.end();
std::copy( it_b, it_e, std::back_inserter( out->m_imp->m_strokes ) );
v1->m_imp->m_regions.clear();
v1->m_imp->m_strokes.clear();
v2->m_imp->m_regions.clear();
v2->m_imp->m_strokes.clear();
out->m_imp->m_areValidRegions = false;
return out;
}
*/
//-----------------------------------------------------------------------------
VIStroke::VIStroke(const VIStroke &s, bool sameId)
: m_isPoint(s.m_isPoint)
, m_isNewForFill(s.m_isNewForFill)
, m_groupId(s.m_groupId) {
m_s = new TStroke(*s.m_s);
std::list<TEdge *>::const_iterator it = s.m_edgeList.begin(),
it_e = s.m_edgeList.end();
for (; it != it_e; ++it) {
m_edgeList.push_back(new TEdge(**it, true));
m_edgeList.back()->m_s = m_s;
}
if (sameId) m_s->setId(s.m_s->getId());
}
//-----------------------------------------------------------------------------
int TVectorImage::mergeImage(const TVectorImageP &img, const TAffine &affine,
bool sameStrokeId) {
QMutexLocker sl(m_imp->m_mutex);
#ifdef _DEBUG
checkIntersections();
#endif
TPalette *tarPlt = getPalette();
TPalette *srcPlt = img->getPalette();
assert(tarPlt);
assert(tarPlt->getPageCount() > 0);
// merge della palette
std::map<int, int> styleTable;
std::set<int> usedStyles;
img->getUsedStyles(usedStyles);
// gmt, 16/10/07. Quando si copia e incolla un path su uno stroke succede
// che la palette dell'immagine sorgente sia vuota. Non mi sembra sbagliato
// mettere comunque un test qui
if (srcPlt) mergePalette(tarPlt, styleTable, srcPlt, usedStyles);
return mergeImage(img, affine, styleTable, sameStrokeId);
}
//-----------------------------------------------------------------------------
int TVectorImage::mergeImage(const TVectorImageP &img, const TAffine &affine,
const std::map<int, int> &styleTable,
bool sameStrokeId) {
int imageSize = img->getStrokeCount();
if (imageSize == 0) return 0;
QMutexLocker sl(m_imp->m_mutex);
m_imp->m_computedAlmostOnce |= img->m_imp->m_computedAlmostOnce;
std::vector<int> changedStrokeArray(imageSize);
img->m_imp->reindexGroups(*m_imp);
int i;
int insertAt = 0;
if (m_imp->m_insideGroup !=
TGroupId()) // if is inside a group, new image is put in that group.
{
TGroupId groupId;
for (i = m_imp->m_strokes.size() - 1; i >= 0; i--) {
if (m_imp->m_insideGroup.isParentOf(m_imp->m_strokes[i]->m_groupId)) {
insertAt = i + 1;
groupId = m_imp->m_strokes[i]->m_groupId;
break;
}
}
if (insertAt != 0) {
for (i = 0; i < (int)img->m_imp->m_strokes.size(); i++) {
if (!img->m_imp->m_strokes[i]->m_groupId.isGrouped()) {
img->m_imp->m_strokes[i]->m_groupId = groupId;
} else {
img->m_imp->m_strokes[i]->m_groupId =
TGroupId(groupId, img->m_imp->m_strokes[i]->m_groupId);
}
}
}
}
// si fondono l'ultimo gruppo ghost della vecchia a e il primo della nuova
else if (!m_imp->m_strokes.empty() &&
m_imp->m_strokes.back()->m_groupId.isGrouped(true) != 0 &&
img->m_imp->m_strokes[0]->m_groupId.isGrouped(true) != 0) {
TGroupId idNew = m_imp->m_strokes.back()->m_groupId,
idOld = img->m_imp->m_strokes[0]->m_groupId;
for (i = 0; i < (int)img->m_imp->m_strokes.size() &&
img->m_imp->m_strokes[i]->m_groupId == idOld;
i++)
img->m_imp->m_strokes[i]->m_groupId = idNew;
}
// merge dell'immagine
std::map<int, int>::const_iterator styleTableIt;
int oldSize = getStrokeCount();
for (i = 0; i < imageSize; i++) {
VIStroke *srcStroke = img->m_imp->m_strokes[i];
VIStroke *tarStroke = new VIStroke(*srcStroke, sameStrokeId);
int styleId;
// cambio i colori delle regioni
std::list<TEdge *>::const_iterator it = tarStroke->m_edgeList.begin(),
it_e = tarStroke->m_edgeList.end();
for (; it != it_e; ++it) {
int styleId = (*it)->m_styleId;
styleTableIt = styleTable.find(styleId);
assert(styleTableIt != styleTable.end());
if (styleTableIt != styleTable.end())
(*it)->m_styleId = styleTableIt->second;
}
tarStroke->m_s->transform(affine, true);
int strokeId = srcStroke->m_s->getId();
if (getStrokeById(strokeId) == 0) tarStroke->m_s->setId(strokeId);
// cambio i colori dello stroke
styleId = srcStroke->m_s->getStyle();
styleTableIt = styleTable.find(styleId);
assert(styleTableIt != styleTable.end());
if (styleTableIt != styleTable.end())
tarStroke->m_s->setStyle(styleTableIt->second);
if (insertAt == 0) {
m_imp->m_strokes.push_back(tarStroke);
changedStrokeArray[i] = oldSize + i;
} else {
std::vector<VIStroke *>::iterator it = m_imp->m_strokes.begin();
advance(it, insertAt + i);
m_imp->m_strokes.insert(it, tarStroke);
changedStrokeArray[i] = insertAt + i;
}
}
if (insertAt > 0) {
// for (i=changedStrokeArray.back()+1; i<m_imp->m_strokes.size(); i++)
// changedStrokeArray.push_back(i);
m_imp->reindexEdges(changedStrokeArray, true);
}
notifyChangedStrokes(changedStrokeArray, std::vector<TStroke *>(), false);
#ifdef _DEBUG
checkIntersections();
#endif
return insertAt;
}
//-----------------------------------------------------------------------------
void TVectorImage::Imp::reindexGroups(TVectorImage::Imp &img) {
UINT i, j;
int newMax = img.m_maxGroupId;
int newMaxGhost = img.m_maxGhostGroupId;
for (i = 0; i < m_strokes.size(); i++) {
VIStroke *s = m_strokes[i];
if (s->m_groupId.m_id.empty()) continue;
if (s->m_groupId.m_id[0] > 0)
for (j = 0; j < s->m_groupId.m_id.size(); j++) {
s->m_groupId.m_id[j] += img.m_maxGroupId;
newMax = std::max(newMax, s->m_groupId.m_id[j]);
}
else
for (j = 0; j < s->m_groupId.m_id.size(); j++) {
s->m_groupId.m_id[j] -= img.m_maxGhostGroupId;
newMaxGhost = std::max(newMaxGhost, -s->m_groupId.m_id[j]);
}
}
m_maxGroupId = img.m_maxGroupId = newMax;
m_maxGhostGroupId = img.m_maxGhostGroupId = newMaxGhost;
}
//-----------------------------------------------------------------------------
void TVectorImage::mergeImage(const std::vector<const TVectorImage *> &images) {
UINT oldSize = getStrokeCount();
std::vector<int> changedStrokeArray;
const TVectorImage *img;
int index;
if (m_imp->m_insideGroup != TGroupId()) {
for (index = m_imp->m_strokes.size() - 1; index > -1; index--)
if (m_imp->m_insideGroup.isParentOf(m_imp->m_strokes[index]->m_groupId))
break;
assert(index > -1);
} else
index = getStrokeCount() - 1;
for (UINT j = 0; j < images.size(); ++j) {
img = images[j];
if (img->getStrokeCount() == 0) continue;
img->m_imp->reindexGroups(*m_imp);
int i = 0;
/*if (!m_imp->m_strokes.empty() &&
m_imp->m_strokes[index-1]->m_groupId.isGrouped(true)!=0 &&
img->m_imp->m_strokes[0]->m_groupId.isGrouped(true)!=0)
{
assert(false);
TGroupId idNew = m_imp->m_strokes[index]->m_groupId, idOld =
img->m_imp->m_strokes[0]->m_groupId;
for (;i<(int)img->m_imp->m_strokes.size() &&
img->m_imp->m_strokes[i]->m_groupId==idOld; i++)
img->m_imp->m_strokes[i]->m_groupId==idNew;
}*/
int strokeCount = img->getStrokeCount();
m_imp->m_computedAlmostOnce |= img->m_imp->m_computedAlmostOnce;
for (i = 0; i < strokeCount; i++) {
VIStroke *srcStroke = img->m_imp->m_strokes[i];
VIStroke *tarStroke = new VIStroke(*srcStroke);
int strokeId = srcStroke->m_s->getId();
if (getStrokeById(strokeId) == 0) tarStroke->m_s->setId(strokeId);
index++;
if (m_imp->m_insideGroup == TGroupId())
m_imp->m_strokes.push_back(tarStroke);
else // if we are inside a group, the images must become part of that
// group
{
tarStroke->m_groupId =
TGroupId(m_imp->m_insideGroup, tarStroke->m_groupId);
m_imp->insertStrokeAt(tarStroke, index);
}
changedStrokeArray.push_back(index);
}
}
notifyChangedStrokes(changedStrokeArray, std::vector<TStroke *>(), false);
}
//-------------------------------------------------------------------
void TVectorImage::recomputeRegionsIfNeeded() {
if (!m_imp->m_justLoaded) return;
m_imp->m_justLoaded = false;
std::vector<int> v(m_imp->m_strokes.size());
int i;
for (i = 0; i < (int)m_imp->m_strokes.size(); i++) v[i] = i;
m_imp->notifyChangedStrokes(v, std::vector<TStroke *>(), false);
}
//-----------------------------------------------------------------------------
void TVectorImage::eraseStyleIds(const std::vector<int> styleIds) {
int j;
for (j = 0; j < (int)styleIds.size(); j++) {
int styleId = styleIds[j];
int strokeCount = getStrokeCount();
int i;
for (i = strokeCount - 1; i >= 0; i--) {
TStroke *stroke = getStroke(i);
if (stroke && stroke->getStyle() == styleId) removeStroke(i);
}
int regionCount = getRegionCount();
for (i = 0; i < regionCount; i++) {
TRegion *region = getRegion(i);
if (!region || region->getStyle() != styleId) continue;
TPointD p;
if (region->getInternalPoint(p)) fill(p, 0);
}
}
}
//-------------------------------------------------------------------
void TVectorImage::insertImage(const TVectorImageP &img,
const std::vector<int> &dstIndices) {
UINT i;
UINT imageSize = img->getStrokeCount();
assert(dstIndices.size() == imageSize);
// img->m_imp->reindexGroups(*m_imp);
std::vector<int> changedStrokeArray(imageSize);
std::vector<VIStroke *>::iterator it = m_imp->m_strokes.begin();
for (i = 0; i < imageSize; i++) {
assert(i == 0 || dstIndices[i] > dstIndices[i - 1]);
VIStroke *srcStroke = img->m_imp->m_strokes[i];
VIStroke *tarStroke = new VIStroke(*srcStroke);
int strokeId = srcStroke->m_s->getId();
if (getStrokeById(strokeId) == 0) tarStroke->m_s->setId(strokeId);
advance(it, (i == 0) ? dstIndices[i] : dstIndices[i] - dstIndices[i - 1]);
it = m_imp->m_strokes.insert(it, tarStroke);
changedStrokeArray[i] = dstIndices[i];
}
m_imp->reindexEdges(changedStrokeArray, true);
notifyChangedStrokes(changedStrokeArray, std::vector<TStroke *>(), false);
// m_imp->computeRegions();
}
//-----------------------------------------------------------------------------
void TVectorImage::enableRegionComputing(bool enabled,
bool notIntersectingStrokes) {
m_imp->m_computeRegions = enabled;
m_imp->m_notIntersectingStrokes = notIntersectingStrokes;
}
//------------------------------------------------------------------------------
void TVectorImage::enableMinimizeEdges(bool enabled) {
m_imp->m_minimizeEdges = enabled;
}
//-----------------------------------------------------------------------------
TVectorImageP TVectorImage::splitImage(const std::vector<int> &indices,
bool removeFlag) {
TVectorImageP out = new TVectorImage;
out->m_imp->m_maxGroupId = m_imp->m_maxGroupId;
out->m_imp->m_maxGhostGroupId = m_imp->m_maxGhostGroupId;
std::vector<int> toBeRemoved;
TPalette *vp = getPalette();
if (vp) out->setPalette(vp->clone());
for (UINT i = 0; i < indices.size(); ++i) {
VIStroke *ref = m_imp->m_strokes[indices[i]];
assert(ref);
VIStroke *vs = new VIStroke(*ref);
vs->m_isNewForFill = true;
out->m_imp->m_strokes.push_back(vs);
}
if (removeFlag) removeStrokes(indices, true, true);
out->m_imp->m_areValidRegions = false;
out->m_imp->m_computedAlmostOnce = m_imp->m_computedAlmostOnce;
return out;
}
//-----------------------------------------------------------------------------
TVectorImageP TVectorImage::splitSelected(bool removeFlag) {
TVectorImageP out = new TVectorImage;
std::vector<int> toBeRemoved;
for (UINT i = 0; i < getStrokeCount(); ++i) {
VIStroke *ref = m_imp->m_strokes[i];
assert(ref);
if (ref->m_s->getFlag(TStroke::c_selected_flag)) {
VIStroke *stroke = new VIStroke(*ref);
out->m_imp->m_strokes.push_back(stroke);
if (removeFlag) {
toBeRemoved.push_back(i);
// removeStroke(i);
// delete ref;
// i--;
}
}
}
removeStrokes(toBeRemoved, true, true);
out->m_imp->m_areValidRegions = false;
return out;
}
//-----------------------------------------------------------------------------
void TVectorImage::validateRegions(bool state) {
m_imp->m_areValidRegions = state;
}
//-----------------------------------------------------------------------------
/*
void TVectorImage::invalidateBBox()
{
for(UINT i=0; i<getRegionCount(); i++)
getRegion(i)->invalidateBBox();
}
*/
//-----------------------------------------------------------------------------
void TVectorImage::setFillData(std::unique_ptr<IntersectionBranch[]> const &v,
UINT branchCount, bool doComputeRegions) {
m_imp->setFillData(v, branchCount, doComputeRegions);
}
//-----------------------------------------------------------------------------
UINT TVectorImage::getFillData(std::unique_ptr<IntersectionBranch[]> &v) {
return m_imp->getFillData(v);
}
//-----------------------------------------------------------------------------
void TVectorImage::enableStrokeStyle(int index, bool enable) {
DisabledStrokeStyles &disabledSet = getDisabledStrokeStyleSet();
if (enable)
disabledSet.erase(index);
else
disabledSet.insert(index);
}
//-----------------------------------------------------------------------------
bool TVectorImage::isStrokeStyleEnabled(int index) {
return isStrokeStyleEnabled__(index);
}
//-----------------------------------------------------------------------------
void TVectorImage::getUsedStyles(std::set<int> &styles) const {
UINT strokeCount = getStrokeCount();
UINT i = 0;
for (; i < strokeCount; ++i) {
VIStroke *srcStroke = m_imp->m_strokes[i];
int styleId = srcStroke->m_s->getStyle();
if (styleId != 0) styles.insert(styleId);
std::list<TEdge *>::const_iterator it = srcStroke->m_edgeList.begin();
for (; it != srcStroke->m_edgeList.end(); ++it) {
styleId = (*it)->m_styleId;
if (styleId != 0) styles.insert(styleId);
}
}
}
//-----------------------------------------------------------------------------
inline double recomputeW1(double oldW, const TStroke &oldStroke,
const TStroke &newStroke, double startW) {
double oldLength = oldStroke.getLength();
double newLength = newStroke.getLength();
assert(startW <= oldW);
assert(newLength < oldLength);
double s = oldStroke.getLength(startW, oldW);
assert(s <= newLength || areAlmostEqual(s, newLength, 1e-5));
return newStroke.getParameterAtLength(s);
}
//-----------------------------------------------------------------------------
inline double recomputeW2(double oldW, const TStroke &oldStroke,
const TStroke &newStroke, double length) {
double s = oldStroke.getLength(oldW);
return newStroke.getParameterAtLength(length + s);
}
//-----------------------------------------------------------------------------
inline double recomputeW(double oldW, const TStroke &oldStroke,
const TStroke &newStroke, bool isAtBegin) {
double oldLength = oldStroke.getLength();
double newLength = newStroke.getLength();
assert(newLength < oldLength);
double s =
oldStroke.getLength(oldW) - ((isAtBegin) ? 0 : oldLength - newLength);
assert(s <= newLength || areAlmostEqual(s, newLength, 1e-5));
return newStroke.getParameterAtLength(s);
}
//-----------------------------------------------------------------------------
#ifdef _DEBUG
void TVectorImage::checkIntersections() { m_imp->checkIntersections(); }
#endif
/*
void TVectorImage::reassignStyles()
{
set<int> styles;
UINT strokeCount = getStrokeCount();
UINT i=0;
for( ; i< strokeCount; ++i)
{
int styleId = getStroke(i)->getStyle();
if(styleId != 0) styles.insert(styleId);
}
UINT regionCount = getRegionCount();
for( i = 0; i< regionCount; ++i)
{
int styleId = getRegion(i)->getStyle();
if(styleId != 0) styles.insert(styleId);
}
map<int, int> conversionTable;
for(set<int>::iterator it = styles.begin(); it != styles.end(); ++it)
{
int styleId = *it;
conversionTable[styleId] = styleId + 13;
}
for( i = 0; i< strokeCount; ++i)
{
TStroke *stroke = getStroke(i);
int styleId = stroke->getStyle();
if(styleId != 0)
{
map<int, int>::iterator it = conversionTable.find(styleId);
if(it != conversionTable.end())
stroke->setStyle(it->second);
}
}
for( i = 0; i< regionCount; ++i)
{
TRegion *region = getRegion(i);
int styleId = region->getStyle();
if(styleId != 0)
{
map<int, int>::iterator it = conversionTable.find(styleId);
if(it != conversionTable.end())
region->setStyle(it->second);
}
}
}
*/
//-----------------------------------------------------------------------------
bool TVectorImage::isComputedRegionAlmostOnce() const {
return m_imp->m_computedAlmostOnce;
}
//-----------------------------------------------------------------------------
void TVectorImage::splitStroke(int strokeIndex,
const std::vector<DoublePair> &sortedWRanges) {
m_imp->splitStroke(strokeIndex, sortedWRanges);
}
void TVectorImage::Imp::splitStroke(
int strokeIndex, const std::vector<DoublePair> &sortedWRanges) {
int i;
VIStroke *subV = 0;
if (strokeIndex >= (int)m_strokes.size() || sortedWRanges.empty()) return;
VIStroke *vs = m_strokes[strokeIndex];
TGroupId groupId = vs->m_groupId;
// se e' un self loop, alla fine non lo sara', e deve stare insieme
// alle stroke non loopate. sposto lo stroke se serve
/*
{
if (vs->m_s->isSelfLoop())
int up = strokeIndex+1;
while (up<(int)m_strokes.size() && m_strokes[up]->m_s->isSelfLoop())
up++;
int dn = strokeIndex-1;
while (dn>=0 && m_strokes[dn]->m_s->isSelfLoop())
dn--;
if ((up == m_strokes.size() || up!=strokeIndex+1) && (dn<0 ||
dn!=strokeIndex-1))
{
if (up>=(int)m_strokes.size())
{
assert(dn>=0);
moveStroke(strokeIndex, dn+1);
strokeIndex = dn+1;
}
else
{
moveStroke(strokeIndex, up-1);
strokeIndex = up-1;
}
}
}
*/
assert(vs == m_strokes[strokeIndex]);
bool toBeJoined =
(vs->m_s->isSelfLoop() && sortedWRanges.front().first == 0.0 &&
sortedWRanges.back().second == 1.0);
int styleId = vs->m_s->getStyle();
TStroke::OutlineOptions oOptions(vs->m_s->outlineOptions());
m_regions.clear();
std::list<TEdge *> origEdgeList; // metto al pizzo la edge std::list della
// stroke, perche' la erase intersection ne
// fara' scempio
std::list<TEdge *>::iterator it = vs->m_edgeList.begin(),
it_e = vs->m_edgeList.end();
for (; it != it_e; ++it) origEdgeList.push_back(new TEdge(**it, false));
removeStroke(strokeIndex, false);
std::vector<std::list<TEdge *>> edgeList(sortedWRanges.size());
strokeIndex--;
int wSize = (int)sortedWRanges.size();
for (i = 0; i < wSize; i++) {
assert(sortedWRanges[i].first < sortedWRanges[i].second);
assert(i == wSize - 1 ||
sortedWRanges[i].second <= sortedWRanges[i + 1].first);
assert(sortedWRanges[i].first >= 0 && sortedWRanges[i].first <= 1);
assert(sortedWRanges[i].second >= 0 && sortedWRanges[i].second <= 1);
subV = new VIStroke(new TStroke(), groupId);
TStroke s, dummy;
if (areAlmostEqual(sortedWRanges[i].first, 0, 1e-4))
s = *vs->m_s;
else
vs->m_s->split(sortedWRanges[i].first, dummy, s);
double lenAtW0 = vs->m_s->getLength(sortedWRanges[i].first);
double lenAtW1 = vs->m_s->getLength(sortedWRanges[i].second);
double newW1 = s.getParameterAtLength(lenAtW1 - lenAtW0);
if (areAlmostEqual(newW1, 1.0, 1e-4))
*(subV->m_s) = s;
else
s.split(newW1, *(subV->m_s), dummy);
strokeIndex++;
/*assert(m_strokes[strokeIndex]->m_edgeList.empty());
assert(m_strokes[strokeIndex-wSize+1]->m_edgeList.empty());*/
std::list<TEdge *>::const_iterator it = origEdgeList.begin(),
it_e = origEdgeList.end();
for (; it != it_e; ++it) {
double wMin = std::min((*it)->m_w0, (*it)->m_w1);
double wMax = std::max((*it)->m_w0, (*it)->m_w1);
if (wMin >= sortedWRanges[i].second || wMax <= sortedWRanges[i].first)
continue;
TEdge *e = new TEdge(**it, false);
if (wMin < sortedWRanges[i].first)
wMin = 0.0;
else
wMin =
recomputeW1(wMin, *(vs->m_s), *(subV->m_s), sortedWRanges[i].first);
if (wMax > sortedWRanges[i].second)
wMax = 1.0;
else
wMax =
recomputeW1(wMax, *(vs->m_s), *(subV->m_s), sortedWRanges[i].first);
if (e->m_w0 < e->m_w1)
e->m_w0 = wMin, e->m_w1 = wMax;
else
e->m_w1 = wMin, e->m_w0 = wMax;
e->m_r = 0;
e->m_s = subV->m_s;
e->m_index = strokeIndex;
edgeList[i].push_back(e);
}
subV->m_edgeList.clear();
insertStrokeAt(subV, strokeIndex);
subV->m_s->setStyle(styleId);
subV->m_s->outlineOptions() = oOptions;
}
clearPointerContainer(origEdgeList);
if (toBeJoined) // la stroke e' un loop, quindi i due choncketti iniziali e
// finali vanno joinati
{
VIStroke *s0 = m_strokes[strokeIndex];
VIStroke *s1 = m_strokes[strokeIndex - wSize + 1];
std::list<TEdge *> &l0 = edgeList.back();
std::list<TEdge *> &l1 = edgeList.front();
// assert(s0->m_edgeList.empty());
// assert(s1->m_edgeList.empty());
removeStroke(strokeIndex - wSize + 1, false);
strokeIndex--;
removeStroke(strokeIndex, false);
VIStroke *s = new VIStroke(joinStrokes(s0->m_s, s1->m_s), groupId);
insertStrokeAt(s, strokeIndex);
std::list<TEdge *>::iterator it = l0.begin(), it_e = l0.end();
for (; it != it_e; ++it) {
(*it)->m_s = s->m_s;
(*it)->m_index = strokeIndex;
(*it)->m_w0 = recomputeW2((*it)->m_w0, *(s0->m_s), *(s->m_s), 0);
(*it)->m_w1 = recomputeW2((*it)->m_w1, *(s0->m_s), *(s->m_s), 0);
}
it = l1.begin();
double length = s0->m_s->getLength();
while (it != l1.end()) {
(*it)->m_s = s->m_s;
(*it)->m_index = strokeIndex;
(*it)->m_w0 = recomputeW2((*it)->m_w0, *(s1->m_s), *(s->m_s), length);
(*it)->m_w1 = recomputeW2((*it)->m_w1, *(s1->m_s), *(s->m_s), length);
l0.push_back(*it);
it = l1.erase(it);
}
assert(l1.empty());
edgeList.erase(edgeList.begin());
std::vector<DoublePair> appSortedWRanges;
wSize--;
delete s0;
delete s1;
}
// checkIntersections();
// double len = e->m_s->getLength();
// if (recomputeRegions)
if (m_computedAlmostOnce) {
computeRegions();
assert((int)edgeList.size() == wSize);
assert((int)m_strokes.size() > strokeIndex);
for (i = 0; i < wSize; i++)
transferColors(edgeList[i],
m_strokes[strokeIndex - wSize + i + 1]->m_edgeList, false,
false, false);
}
for (i = 0; i < wSize; i++) clearPointerContainer(edgeList[i]);
delete vs;
}
//-----------------------------------------------------------------------------
static void computeEdgeList(TStroke *newS, const std::list<TEdge *> &edgeList1,
bool join1AtBegin,
const std::list<TEdge *> &edgeList2,
bool join2AtBegin, std::list<TEdge *> &edgeList) {
std::list<TEdge *>::const_iterator it;
if (!edgeList1.empty()) {
TStroke *s1 = edgeList1.front()->m_s;
double length1 = s1->getLength();
;
for (it = edgeList1.begin(); it != edgeList1.end(); ++it) {
double l0 = s1->getLength((*it)->m_w0), l1 = s1->getLength((*it)->m_w1);
if (join1AtBegin) l0 = length1 - l0, l1 = length1 - l1;
TEdge *e = new TEdge();
e->m_toBeDeleted = true;
e->m_index = -1;
e->m_s = newS;
e->m_styleId = (*it)->m_styleId;
e->m_w0 = newS->getParameterAtLength(l0);
e->m_w1 = newS->getParameterAtLength(l1);
edgeList.push_back(e);
}
}
if (!edgeList2.empty()) {
TStroke *s2 = edgeList2.front()->m_s;
double offset = newS->getLength(newS->getW(s2->getPoint(0.0)));
double length2 = s2->getLength();
for (it = edgeList2.begin(); it != edgeList2.end(); ++it) {
double l0 = s2->getLength((*it)->m_w0), l1 = s2->getLength((*it)->m_w1);
if (!join2AtBegin) l0 = length2 - l0, l1 = length2 - l1;
TEdge *e = new TEdge();
e->m_toBeDeleted = true;
e->m_index = -1;
e->m_s = newS;
e->m_styleId = (*it)->m_styleId;
e->m_w0 = newS->getParameterAtLength(offset + l0);
e->m_w1 = newS->getParameterAtLength(offset + l1);
edgeList.push_back(e);
}
}
}
//-----------------------------------------------------------------------------
#ifdef _DEBUG
//#include "tpalette.h"
#include "tcolorstyles.h"
void printEdges(std::ofstream &os, char *str, TPalette *plt,
const std::list<TEdge *> &edges) {
std::list<TEdge *>::const_iterator it;
os << str << std::endl;
for (it = edges.begin(); it != edges.end(); ++it) {
TColorStyle *style = plt->getStyle((*it)->m_styleId);
TPixel32 color = style->getMainColor();
os << "w0-w1:(" << (*it)->m_w0 << "-->" << (*it)->m_w1 << ")" << std::endl;
os << "color=(" << color.r << "," << color.g << "," << color.b << ")"
<< std::endl;
}
os << std::endl << std::endl << std::endl;
}
#else
#define printEdges
#endif
//-----------------------------------------------------------------------------
#ifdef _DEBUG
void TVectorImage::Imp::printStrokes(std::ofstream &os) {
for (int i = 0; i < (int)m_strokes.size(); i++) {
os << "*****stroke #" << i << " *****";
m_strokes[i]->m_s->print(os);
}
}
#endif
//-----------------------------------------------------------------------------
TStroke *TVectorImage::removeEndpoints(int strokeIndex) {
return m_imp->removeEndpoints(strokeIndex);
}
void TVectorImage::restoreEndpoints(int index, TStroke *oldStroke) {
m_imp->restoreEndpoints(index, oldStroke);
}
//-----------------------------------------------------------------------------
VIStroke *TVectorImage::Imp::extendStrokeSmoothly(int index,
const TThickPoint &pos,
int cpIndex) {
TStroke *stroke = m_strokes[index]->m_s;
TGroupId groupId = m_strokes[index]->m_groupId;
int cpCount = stroke->getControlPointCount();
int styleId = stroke->getStyle();
const TThickQuadratic *q =
stroke->getChunk(cpIndex == 0 ? 0 : stroke->getChunkCount() - 1);
double len = q->getLength();
double w = exp(-len * 0.01);
TThickPoint m = q->getThickP1();
TThickPoint p1 =
(cpIndex == 0 ? q->getThickP0() : q->getThickP2()) * (1 - w) + m * w;
TThickPoint middleP = (p1 + pos) * 0.5;
double angle = fabs(cross(normalize(m - middleP), normalize(pos - middleP)));
if (angle < 0.05) middleP = (m + pos) * 0.5;
stroke->setControlPoint(cpIndex, middleP);
if (isAlmostZero(len)) {
if (cpIndex == 0)
stroke->setControlPoint(1,
middleP * 0.1 + stroke->getControlPoint(2) * 0.9);
else
stroke->setControlPoint(
cpCount - 2,
middleP * 0.1 + stroke->getControlPoint(cpCount - 3) * 0.9);
}
std::vector<TThickPoint> points(cpCount);
for (int i = 0; i < cpCount - 1; i++)
points[i] = stroke->getControlPoint((cpIndex == 0) ? cpCount - i - 1 : i);
points[cpCount - 1] = pos;
TStroke *newStroke = new TStroke(points);
newStroke->setStyle(styleId);
newStroke->outlineOptions() = stroke->outlineOptions();
std::list<TEdge *> oldEdgeList, emptyList;
computeEdgeList(newStroke, m_strokes[index]->m_edgeList, cpIndex == 0,
emptyList, 0, oldEdgeList);
std::vector<int> toBeDeleted;
toBeDeleted.push_back(index);
removeStrokes(toBeDeleted, true, false);
insertStrokeAt(new VIStroke(newStroke, groupId), index, false);
computeRegions();
transferColors(oldEdgeList, m_strokes[index]->m_edgeList, true, false, true);
return m_strokes[index];
}
//-----------------------------------------------------------------------------
VIStroke *TVectorImage::Imp::extendStroke(int index, const TThickPoint &p,
int cpIndex) {
TGroupId groupId = m_strokes[index]->m_groupId;
TStroke *stroke = m_strokes[index]->m_s;
TStroke *ret;
int cpCount = stroke->getControlPointCount();
int count = 0;
std::vector<TThickPoint> points(cpCount + 2);
int i, incr = (cpIndex == 0) ? -1 : 1;
for (i = ((cpIndex == 0) ? cpCount - 1 : 0); i != cpIndex + incr; i += incr)
points[count++] = stroke->getControlPoint(i);
TThickPoint tp(p, points[count - 1].thick);
points[count++] = 0.5 * (stroke->getControlPoint(cpIndex) + tp);
points[count++] = tp;
TStroke *newStroke = new TStroke(points);
newStroke->setStyle(stroke->getStyle());
newStroke->outlineOptions() = stroke->outlineOptions();
ret = newStroke;
std::list<TEdge *> oldEdgeList, emptyList;
if (m_computedAlmostOnce)
computeEdgeList(newStroke, m_strokes[index]->m_edgeList, cpIndex == 0,
emptyList, false, oldEdgeList);
std::vector<int> toBeDeleted;
toBeDeleted.push_back(index);
removeStrokes(toBeDeleted, true, false);
// removeStroke(index, false);
insertStrokeAt(new VIStroke(newStroke, groupId), index, false);
if (m_computedAlmostOnce) {
computeRegions();
transferColors(oldEdgeList, m_strokes[index]->m_edgeList, true, false,
true);
}
return m_strokes[index];
}
//-----------------------------------------------------------------------------
VIStroke *TVectorImage::Imp::joinStroke(int index1, int index2, int cpIndex1,
int cpIndex2) {
assert(m_strokes[index1]->m_groupId == m_strokes[index2]->m_groupId);
TGroupId groupId = m_strokes[index1]->m_groupId;
TStroke *stroke1 = m_strokes[index1]->m_s;
TStroke *stroke2 = m_strokes[index2]->m_s;
// TStroke* ret;
int cpCount1 = stroke1->getControlPointCount();
int cpCount2 = stroke2->getControlPointCount();
int styleId = stroke1->getStyle();
// check if the both ends are at the same postion
bool isSamePos = isAlmostZero(tdistance2(stroke1->getControlPoint(cpIndex1),
stroke2->getControlPoint(cpIndex2)));
// connecting the ends in the same shape at the same postion
// means just making the shape self-looped
if (isSamePos && index1 == index2) {
stroke1->setSelfLoop();
return m_strokes[index1];
}
std::vector<TThickPoint> points;
int i, incr = (cpIndex1 == 0) ? -1 : 1;
int start = ((cpIndex1 == 0) ? cpCount1 - 1 : 0);
int end = (isSamePos) ? cpIndex1 : cpIndex1 + incr;
for (i = start; i != end; i += incr)
points.push_back(stroke1->getControlPoint(i));
points.push_back(0.5 * (stroke1->getControlPoint(cpIndex1) +
stroke2->getControlPoint(cpIndex2)));
if (index1 != index2) {
incr = (cpIndex2 == 0) ? 1 : -1;
start = (isSamePos) ? cpIndex2 + incr : cpIndex2;
end = ((cpIndex2 == 0) ? cpCount2 - 1 : 0) + incr;
for (i = start; i != end; i += incr)
points.push_back(stroke2->getControlPoint(i));
} else
points.push_back(stroke2->getControlPoint(cpIndex2));
TStroke *newStroke = new TStroke(points);
newStroke->setStyle(styleId);
newStroke->outlineOptions() = stroke1->outlineOptions();
// ret = newStroke;
if (index1 == index2) newStroke->setSelfLoop();
std::list<TEdge *> oldEdgeList, emptyList;
computeEdgeList(
newStroke, m_strokes[index1]->m_edgeList, cpIndex1 == 0,
(index1 != index2) ? m_strokes[index2]->m_edgeList : emptyList,
cpIndex2 == 0, oldEdgeList);
std::vector<int> toBeDeleted;
toBeDeleted.push_back(index1);
if (index1 != index2) toBeDeleted.push_back(index2);
removeStrokes(toBeDeleted, true, false);
insertStrokeAt(new VIStroke(newStroke, groupId), index1, false);
computeRegions();
transferColors(oldEdgeList, m_strokes[index1]->m_edgeList, true, false, true);
return m_strokes[index1];
}
//-----------------------------------------------------------------------------
VIStroke *TVectorImage::Imp::joinStrokeSmoothly(int index1, int index2,
int cpIndex1, int cpIndex2) {
assert(m_strokes[index1]->m_groupId == m_strokes[index2]->m_groupId);
TGroupId groupId = m_strokes[index1]->m_groupId;
TStroke *stroke1 = m_strokes[index1]->m_s;
TStroke *stroke2 = m_strokes[index2]->m_s;
TStroke *ret;
int cpCount1 = stroke1->getControlPointCount();
int cpCount2 = stroke2->getControlPointCount();
int styleId = stroke1->getStyle();
int qCount1 = stroke1->getChunkCount();
int qCount2 = stroke2->getChunkCount();
const TThickQuadratic *q1 =
stroke1->getChunk(cpIndex1 == 0 ? 0 : qCount1 - 1);
const TThickQuadratic *q2 =
stroke2->getChunk(cpIndex2 == 0 ? 0 : qCount2 - 1);
double len1 = q1->getLength();
assert(len1 >= 0);
if (len1 <= 0) len1 = 0;
double w1 = exp(-len1 * 0.01);
double len2 = q2->getLength();
assert(len2 >= 0);
if (len2 <= 0) len2 = 0;
double w2 = exp(-len2 * 0.01);
TThickPoint extreme1 = cpIndex1 == 0 ? q1->getThickP0() : q1->getThickP2();
TThickPoint extreme2 = cpIndex2 == 0 ? q2->getThickP0() : q2->getThickP2();
TThickPoint m1 = q1->getThickP1();
TThickPoint m2 = q2->getThickP1();
TThickPoint p1 = extreme1 * (1 - w1) + m1 * w1;
TThickPoint p2 = extreme2 * (1 - w2) + m2 * w2;
TThickPoint middleP = (p1 + p2) * 0.5;
double angle = fabs(cross(normalize(m1 - middleP), normalize(m2 - middleP)));
if (angle < 0.05) middleP = (m1 + m2) * 0.5;
stroke1->setControlPoint(cpIndex1, middleP);
if (isAlmostZero(len1)) {
if (cpIndex1 == 0)
stroke1->setControlPoint(
1, middleP * 0.1 + stroke1->getControlPoint(2) * 0.9);
else
stroke1->setControlPoint(
cpCount1 - 2,
middleP * 0.1 + stroke1->getControlPoint(cpCount1 - 3) * 0.9);
}
stroke2->setControlPoint(cpIndex2, middleP);
if (isAlmostZero(len2)) {
if (cpIndex2 == 0)
stroke2->setControlPoint(
1, middleP * 0.1 + stroke2->getControlPoint(2) * 0.9);
else
stroke2->setControlPoint(
cpCount2 - 2,
middleP * 0.1 + stroke2->getControlPoint(cpCount2 - 3) * 0.9);
}
if (stroke1 == stroke2) {
std::list<TEdge *> oldEdgeList, emptyList;
computeEdgeList(stroke1, m_strokes[index1]->m_edgeList, cpIndex1 == 0,
emptyList, false, oldEdgeList);
eraseIntersection(index1);
m_strokes[index1]->m_isNewForFill = true;
stroke1->setSelfLoop();
computeRegions();
transferColors(oldEdgeList, m_strokes[index1]->m_edgeList, true, false,
true);
return m_strokes[index1];
// nundo->m_newStroke=new TStroke(*stroke1);
// nundo->m_newStrokeId=stroke1->getId();
}
std::vector<TThickPoint> points;
points.reserve(cpCount1 + cpCount2 - 1);
int incr = (cpIndex1) ? 1 : -1;
int stop = cpIndex1;
int i = cpCount1 - 1 - cpIndex1;
for (; i != stop; i += incr) points.push_back(stroke1->getControlPoint(i));
incr = (cpIndex2) ? -1 : 1;
stop = cpCount2 - 1 - cpIndex2;
for (i = cpIndex2; i != stop; i += incr)
points.push_back(stroke2->getControlPoint(i));
points.push_back(stroke2->getControlPoint(stop));
TStroke *newStroke = new TStroke(points);
newStroke->setStyle(styleId);
newStroke->outlineOptions() = stroke1->outlineOptions();
ret = newStroke;
// nundo->m_newStroke=new TStroke(*newStroke);
// nundo->m_newStrokeId=newStroke->getId();
std::list<TEdge *> oldEdgeList;
// ofstream os("c:\\temp\\edges.txt");
// printEdges(os, "****edgelist1", getPalette(),
// m_imp->m_strokes[index1]->m_edgeList);
// printEdges(os, "****edgelist2", getPalette(),
// m_imp->m_strokes[index2]->m_edgeList);
computeEdgeList(newStroke, m_strokes[index1]->m_edgeList, cpIndex1 == 0,
m_strokes[index2]->m_edgeList, cpIndex2 == 0, oldEdgeList);
// printEdges(os, "****edgelist", getPalette(), oldEdgeList);
std::vector<int> toBeDeleted;
toBeDeleted.push_back(index1);
toBeDeleted.push_back(index2);
removeStrokes(toBeDeleted, true, false);
insertStrokeAt(new VIStroke(newStroke, groupId), index1);
computeRegions();
transferColors(oldEdgeList, m_strokes[index1]->m_edgeList, true, false, true);
return m_strokes[index1];
// TUndoManager::manager()->add(nundo);
}
//-----------------------------------------------------------------------------
VIStroke *TVectorImage::joinStroke(int index1, int index2, int cpIndex1,
int cpIndex2, bool isSmooth) {
int finalStyle = -1;
if (index1 > index2) {
finalStyle = getStroke(index1)->getStyle();
std::swap(index1, index2);
std::swap(cpIndex1, cpIndex2);
}
/*
if (index1==index2) //selfLoop!
{
if (index1>0 && index1<(int)getStrokeCount()-1 &&
!getStroke(index1-1)->isSelfLoop() &&
!getStroke(index1+1)->isSelfLoop())
{
for (UINT i = index1+2; i<getStrokeCount() && !getStroke(i)->isSelfLoop(); i++)
;
moveStroke(index1, i-1);
index1 = index2 = i-1;
}
}
*/
VIStroke *ret;
if (isSmooth)
ret = m_imp->joinStrokeSmoothly(index1, index2, cpIndex1, cpIndex2);
else
ret = m_imp->joinStroke(index1, index2, cpIndex1, cpIndex2);
if (finalStyle != -1) getStroke(index1)->setStyle(finalStyle);
return ret;
}
//-----------------------------------------------------------------------------
VIStroke *TVectorImage::extendStroke(int index, const TThickPoint &p,
int cpIndex, bool isSmooth) {
if (isSmooth)
return m_imp->extendStrokeSmoothly(index, p, cpIndex);
else
return m_imp->extendStroke(index, p, cpIndex);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
TInputStreamInterface &TInputStreamInterface::operator>>(TPixel32 &pixel) {
return *this >> pixel.r >> pixel.g >> pixel.b >> pixel.m;
}
//-------------------------------------------------------------------
TOutputStreamInterface &TOutputStreamInterface::operator<<(
const TPixel32 &pixel) {
return *this << pixel.r << pixel.g << pixel.b << pixel.m;
}
//-------------------------------------------------------------------
void TVectorImage::setAutocloseTolerance(double val) {
m_imp->m_autocloseTolerance = val;
}
//-------------------------------------------------------------------
double TVectorImage::getAutocloseTolerance() const {
return m_imp->m_autocloseTolerance;
}
//-------------------------------------------------------------------
TThread::Mutex *TVectorImage::getMutex() const { return m_imp->m_mutex; }
//-------------------------------------------------------------------
void TVectorImage::areaFill(TStroke *stroke, int index, bool m_onlyUnfilled) {
TVectorImage v;
v.addStroke(stroke);
v.findRegions();
for (UINT i = 0; i < v.getRegionCount(); i++)
for (UINT j = 0; j < getRegionCount(); j++) {
if (m_imp->m_insideGroup != TGroupId() &&
!m_imp->m_insideGroup.isParentOf(
m_imp->m_strokes[getRegion(j)->getEdge(0)->m_index]->m_groupId))
continue;
if (v.getRegion(i)->contains(*getRegion(j)))
getRegion(j)->setStyle(index);
}
v.removeStroke(0);
}
VIStroke *cloneVIStroke(VIStroke *vs) { return new VIStroke(*vs); }
void deleteVIStroke(VIStroke *vs) {
delete vs;
vs = 0;
}
//-------------------------------------------------------------------
bool TVectorImage::sameSubGroup(int index0, int index1) const {
if (index0 < 0 || index1 < 0) return 0;
return m_imp->m_strokes[index0]->m_groupId.getCommonParentDepth(
m_imp->m_strokes[index1]->m_groupId) >
m_imp->m_insideGroup.getDepth();
}
//-------------------------------------------------------------------
int TVectorImage::getCommonGroupDepth(int index0, int index1) const {
if (index0 < 0 || index1 < 0) return 0;
return m_imp->m_strokes[index0]->m_groupId.getCommonParentDepth(
m_imp->m_strokes[index1]->m_groupId);
}
//-------------------------------------------------------------------
int TVectorImage::ungroup(int fromIndex) {
m_imp->m_insideGroup = TGroupId();
assert(m_imp->m_strokes[fromIndex]->m_groupId.isGrouped() != 0);
std::vector<int> changedStrokes;
int toIndex = fromIndex + 1;
while (toIndex < (int)m_imp->m_strokes.size() &&
m_imp->m_strokes[fromIndex]->m_groupId.getCommonParentDepth(
m_imp->m_strokes[toIndex]->m_groupId) >= 1)
toIndex++;
toIndex--;
TGroupId groupId;
if (fromIndex > 0 &&
m_imp->m_strokes[fromIndex - 1]->m_groupId.isGrouped(true) != 0)
groupId = m_imp->m_strokes[fromIndex - 1]->m_groupId;
else if (toIndex < (int)m_imp->m_strokes.size() - 1 &&
m_imp->m_strokes[toIndex + 1]->m_groupId.isGrouped(true) != 0)
groupId = m_imp->m_strokes[toIndex + 1]->m_groupId;
else
groupId = TGroupId(this, true);
for (int i = fromIndex;
i <= toIndex || (i < (int)m_imp->m_strokes.size() &&
m_imp->m_strokes[i]->m_groupId.isGrouped(true) != 0);
i++) {
m_imp->m_strokes[i]->m_groupId.ungroup(groupId);
changedStrokes.push_back(i);
}
notifyChangedStrokes(changedStrokes, std::vector<TStroke *>(), false);
return toIndex - fromIndex + 1;
}
//-------------------------------------------------------------------
bool TVectorImage::isEnteredGroupStroke(int index) const {
return m_imp->m_insideGroup.isParentOf(getVIStroke(index)->m_groupId);
}
//-------------------------------------------------------------------
bool TVectorImage::enterGroup(int index) {
VIStroke *vs = getVIStroke(index);
if (!vs->m_groupId.isGrouped()) return false;
int newDepth = vs->m_groupId.getCommonParentDepth(m_imp->m_insideGroup) + 1;
TGroupId newGroupId = vs->m_groupId;
while (newGroupId.getDepth() > newDepth) newGroupId = newGroupId.getParent();
if (newGroupId == m_imp->m_insideGroup) return false;
m_imp->m_insideGroup = newGroupId;
return true;
}
//-------------------------------------------------------------------
int TVectorImage::exitGroup() {
if (m_imp->m_insideGroup == TGroupId()) return -1;
int i, ret = -1;
for (i = 0; i < (int)m_imp->m_strokes.size(); i++) {
if (m_imp->m_strokes[i]->m_groupId.getCommonParentDepth(
m_imp->m_insideGroup) >= m_imp->m_insideGroup.getDepth()) {
ret = i;
break;
}
}
assert(i != m_imp->m_strokes.size());
m_imp->m_insideGroup = m_imp->m_insideGroup.getParent();
return ret;
}
//-------------------------------------------------------------------
void TVectorImage::group(int fromIndex, int count) {
int i;
assert(count >= 0);
std::vector<int> changedStroke;
TGroupId parent = TGroupId(this, false);
for (i = 0; i < count; i++) {
m_imp->m_strokes[fromIndex + i]->m_groupId =
TGroupId(parent, m_imp->m_strokes[fromIndex + i]->m_groupId);
changedStroke.push_back(fromIndex + i);
}
m_imp->rearrangeMultiGroup(); // see method's comment
m_imp->regroupGhosts(changedStroke);
notifyChangedStrokes(changedStroke, std::vector<TStroke *>(), false);
#ifdef _DEBUG
m_imp->checkGroups();
#endif
}
//-------------------------------------------------------------------
int TVectorImage::getGroupDepth(UINT index) const {
assert(index < m_imp->m_strokes.size());
return m_imp->m_strokes[index]->m_groupId.isGrouped();
}
//-------------------------------------------------------------------
int TVectorImage::areDifferentGroup(UINT index1, bool isRegion1, UINT index2,
bool isRegion2) const {
return m_imp->areDifferentGroup(index1, isRegion1, index2, isRegion2);
}
//-------------------------------------------------------------------
/*this method is tricky.
it is not allow to have not-adiacent strokes of same group.
but it can happen when you group some already-grouped strokes creating
sub-groups.
example: vi made of 5 strokes, before grouping (N=no group)
N
N
1
1
N
after grouping became:
2
2
2-1
2-1
2
not allowed!
this method moves strokes, so that adiacent strokes have same group.
so after calling rearrangeMultiGroup the vi became:
2
2
2
2-1
2-1
*/
void TVectorImage::Imp::rearrangeMultiGroup() {
UINT i, j, k;
if (m_strokes.size() <= 0) return;
for (i = 0; i < m_strokes.size() - 1; i++) {
if (m_strokes[i]->m_groupId.isGrouped() &&
m_strokes[i + 1]->m_groupId.isGrouped() &&
m_strokes[i]->m_groupId != m_strokes[i + 1]->m_groupId) {
TGroupId &prevId = m_strokes[i]->m_groupId;
TGroupId &idToMove = m_strokes[i + 1]->m_groupId;
for (j = i + 1;
j < m_strokes.size() && m_strokes[j]->m_groupId == idToMove; j++)
;
if (j != m_strokes.size()) {
j--; // now range i+1-j contains the strokes to be moved.
// let's compute where to move them (after last
for (k = j; k < m_strokes.size() && m_strokes[k]->m_groupId != prevId;
k++)
;
if (k < m_strokes.size()) {
for (; k < m_strokes.size() && m_strokes[k]->m_groupId == prevId; k++)
;
moveStrokes(i + 1, j - i, k, false);
rearrangeMultiGroup();
return;
}
}
}
}
}
//-------------------------------------------------------------------
int TVectorImage::Imp::areDifferentGroup(UINT index1, bool isRegion1,
UINT index2, bool isRegion2) const {
TGroupId group1, group2;
if (isRegion1) {
TRegion *r = m_regions[index1];
for (UINT i = 0; i < r->getEdgeCount(); i++)
if (r->getEdge(i)->m_index >= 0) {
group1 = m_strokes[r->getEdge(i)->m_index]->m_groupId;
break;
}
} else
group1 = m_strokes[index1]->m_groupId;
if (isRegion2) {
TRegion *r = m_regions[index2];
for (UINT i = 0; i < r->getEdgeCount(); i++)
if (r->getEdge(i)->m_index >= 0) {
group2 = m_strokes[r->getEdge(i)->m_index]->m_groupId;
break;
}
} else
group2 = m_strokes[index2]->m_groupId;
if (!group1 && !group2) return 0;
if (group1 == group2)
return -1;
else
return group1.getCommonParentDepth(group2);
}
//-------------------------------------------------------------------
int TGroupId::getCommonParentDepth(const TGroupId &id) const {
int size1 = m_id.size();
int size2 = id.m_id.size();
int count;
for (count = 0; count < std::min(size1, size2); count++)
if (m_id[size1 - count - 1] != id.m_id[size2 - count - 1]) break;
return count;
}
//-------------------------------------------------------------------
TGroupId::TGroupId(const TGroupId &parent, const TGroupId &id) {
assert(parent.m_id[0] > 0);
assert(id.m_id.size() > 0);
if (id.isGrouped(true) != 0)
m_id.push_back(parent.m_id[0]);
else {
m_id = id.m_id;
int i;
for (i = 0; i < (int)parent.m_id.size(); i++)
m_id.push_back(parent.m_id[i]);
}
}
/*
bool TGroupId::sameParent(const TGroupId& id) const
{
assert(!m_id.empty() || !id.m_id.empty());
return m_id.back()==id.m_id.back();
}
*/
TGroupId TGroupId::getParent() const {
if (m_id.size() <= 1) return TGroupId();
TGroupId ret = *this;
ret.m_id.erase(ret.m_id.begin());
return ret;
}
void TGroupId::ungroup(const TGroupId &id) {
assert(id.isGrouped(true) != 0);
assert(!m_id.empty());
if (m_id.size() == 1)
m_id[0] = id.m_id[0];
else
m_id.pop_back();
}
bool TGroupId::operator==(const TGroupId &id) const {
if (m_id.size() != id.m_id.size()) return false;
UINT i;
for (i = 0; i < m_id.size(); i++)
if (m_id[i] != id.m_id[i]) return false;
return true;
}
bool TGroupId::operator<(const TGroupId &id) const {
assert(!m_id.empty() && !id.m_id.empty());
int size1 = m_id.size();
int size2 = id.m_id.size();
int i;
for (i = 0; i < std::min(size1, size2); i++)
if (m_id[size1 - i - 1] != id.m_id[size2 - i - 1])
return m_id[size1 - i - 1] < id.m_id[size2 - i - 1];
return size1 < size2;
}
//-------------------------------------------------------------------
int TGroupId::isGrouped(bool implicit) const {
assert(!m_id.empty());
assert(m_id[0] != 0);
if (implicit)
return (m_id[0] < 0) ? 1 : 0;
else
return (m_id[0] > 0) ? m_id.size() : 0;
}
//-------------------------------------------------------------------
TGroupId::TGroupId(TVectorImage *vi, bool isGhost) {
m_id.push_back((isGhost) ? -(++vi->m_imp->m_maxGhostGroupId)
: ++vi->m_imp->m_maxGroupId);
}
#ifdef _DEBUG
void TVectorImage::Imp::checkGroups() {
TGroupId currGroupId;
std::set<TGroupId> groupSet;
std::set<TGroupId>::iterator it;
UINT i = 0;
while (i < m_strokes.size()) {
// assert(m_strokes[i]->m_groupId!=currGroupId);
// assert(i==0 ||
// m_strokes[i-1]->m_groupId.isGrouped()!=m_strokes[i]->m_groupId.isGrouped()!=0
// ||
// (m_strokes[i]->m_groupId.isGrouped()!=0 &&
// m_strokes[i-1]->m_groupId!=m_strokes[i]->m_groupId));
currGroupId = m_strokes[i]->m_groupId;
it = groupSet.find(currGroupId);
if (it != groupSet.end()) // esisteva gia un gruppo con questo id!
assert(!"errore: due gruppi con lo stesso id!");
else
groupSet.insert(currGroupId);
while (i < m_strokes.size() && m_strokes[i]->m_groupId == currGroupId) i++;
}
}
#endif
//-------------------------------------------------------------------
bool TVectorImage::canMoveStrokes(int strokeIndex, int count,
int moveBefore) const {
return m_imp->canMoveStrokes(strokeIndex, count, moveBefore);
}
//-------------------------------------------------------------------
// verifica se si possono spostare le stroke da strokeindex a
// strokeindex+count-1 prima della posizione moveBefore;
// per fare questo fa un vettore in cui mette tutti i gruppi nella posizione
// dopo lo
// spostamento e verifica che sia un configurazione di gruppi ammessa.
bool TVectorImage::Imp::canMoveStrokes(int strokeIndex, int count,
int moveBefore) const {
if (m_maxGroupId <= 1) // non ci sono gruppi!
return true;
int i, j = 0;
std::vector<TGroupId> groupsAfterMoving(m_strokes.size());
if (strokeIndex < moveBefore) {
for (i = 0; i < strokeIndex; i++)
groupsAfterMoving[j++] = m_strokes[i]->m_groupId;
for (i = strokeIndex + count; i < moveBefore; i++)
groupsAfterMoving[j++] = m_strokes[i]->m_groupId;
for (i = strokeIndex; i < strokeIndex + count; i++)
groupsAfterMoving[j++] = m_strokes[i]->m_groupId;
for (i = moveBefore; i < (int)m_strokes.size(); i++)
groupsAfterMoving[j++] = m_strokes[i]->m_groupId;
} else {
for (i = 0; i < moveBefore; i++)
groupsAfterMoving[j++] = m_strokes[i]->m_groupId;
for (i = strokeIndex; i < strokeIndex + count; i++)
groupsAfterMoving[j++] = m_strokes[i]->m_groupId;
for (i = moveBefore; i < strokeIndex; i++)
groupsAfterMoving[j++] = m_strokes[i]->m_groupId;
for (i = strokeIndex + count; i < (int)m_strokes.size(); i++)
groupsAfterMoving[j++] = m_strokes[i]->m_groupId;
}
assert(j == (int)m_strokes.size());
i = 0;
TGroupId currGroupId;
std::set<TGroupId> groupSet;
while (i < (int)groupsAfterMoving.size()) {
currGroupId = groupsAfterMoving[i];
if (groupSet.find(currGroupId) !=
groupSet.end()) // esisteva gia un gruppo con questo id!
{
if (!currGroupId.isGrouped(true)) // i gruppi impliciti non contano
return false;
} else
groupSet.insert(currGroupId);
while (i < (int)groupsAfterMoving.size() &&
groupsAfterMoving[i] == currGroupId)
i++;
}
return true;
}
//-----------------------------------------------------------------
void TVectorImage::Imp::regroupGhosts(std::vector<int> &changedStrokes) {
TGroupId currGroupId;
std::set<TGroupId> groupMap;
std::set<TGroupId>::iterator it;
UINT i = 0;
while (i < m_strokes.size()) {
assert(m_strokes[i]->m_groupId != currGroupId);
assert(i == 0 ||
m_strokes[i - 1]->m_groupId.isGrouped() !=
m_strokes[i]->m_groupId.isGrouped() != 0 ||
(m_strokes[i]->m_groupId.isGrouped() != 0 &&
m_strokes[i - 1]->m_groupId != m_strokes[i]->m_groupId));
currGroupId = m_strokes[i]->m_groupId;
it = groupMap.find(currGroupId);
if (it != groupMap.end()) // esisteva gia un gruppo con questo id!
{
if (currGroupId.isGrouped() != 0)
assert(!"errore: due gruppi con lo stesso id!");
else // gruppo ghost; gli do un nuovo id
{
TGroupId newGroup(m_vi, true);
while (i < m_strokes.size() &&
m_strokes[i]->m_groupId.isGrouped(true) != 0) {
m_strokes[i]->m_groupId = newGroup;
changedStrokes.push_back(i);
i++;
}
}
} else {
groupMap.insert(currGroupId);
while (i < m_strokes.size() &&
((currGroupId.isGrouped(false) != 0 &&
m_strokes[i]->m_groupId == currGroupId) ||
(currGroupId.isGrouped(true) != 0 &&
m_strokes[i]->m_groupId.isGrouped(true) != 0))) {
if (m_strokes[i]->m_groupId != currGroupId) {
m_strokes[i]->m_groupId = currGroupId;
changedStrokes.push_back(i);
}
i++;
}
}
}
}
//--------------------------------------------------------------
bool TVectorImage::canEnterGroup(int strokeIndex) const {
VIStroke *vs = m_imp->m_strokes[strokeIndex];
if (!vs->m_groupId.isGrouped()) return false;
return m_imp->m_insideGroup == TGroupId() ||
vs->m_groupId != m_imp->m_insideGroup;
}
//--------------------------------------------------------------
bool TVectorImage::inCurrentGroup(int strokeIndex) const {
return m_imp->inCurrentGroup(strokeIndex);
}
//----------------------------------------------------------------------------------
bool TVectorImage::Imp::inCurrentGroup(int strokeIndex) const {
return m_insideGroup == TGroupId() ||
m_insideGroup.isParentOf(m_strokes[strokeIndex]->m_groupId);
}
//--------------------------------------------------------------------------------------------------
bool TVectorImage::selectable(int strokeIndex) const {
return (m_imp->m_insideGroup != m_imp->m_strokes[strokeIndex]->m_groupId &&
inCurrentGroup(strokeIndex));
}
//--------------------------------------------------------------------------------------------------
namespace {
bool containsNoSubregion(const TRegion *r, const TPointD &p) {
if (r->contains(p)) {
for (unsigned int i = 0; i < r->getSubregionCount(); i++)
if (r->getSubregion(i)->contains(p)) return false;
return true;
} else
return false;
}
}; // namespace
//------------------------------------------------------
int TVectorImage::getGroupByStroke(UINT index) const {
VIStroke *viStroke = getVIStroke(index);
return viStroke->m_groupId.m_id.back();
}
//------------------------------------------------------
int TVectorImage::getGroupByRegion(UINT index) const {
TRegion *r = m_imp->m_regions[index];
for (UINT i = 0; i < r->getEdgeCount(); i++)
if (r->getEdge(i)->m_index >= 0) {
return m_imp->m_strokes[r->getEdge(i)->m_index]->m_groupId.m_id.back();
}
return -1;
}
//------------------------------------------------------
int TVectorImage::pickGroup(const TPointD &pos, bool onEnteredGroup) const {
if (onEnteredGroup && isInsideGroup() == 0) return -1;
// double maxDist2 = 50*tglGetPixelSize2();
int strokeIndex = getStrokeCount() - 1;
while (strokeIndex >=
0) // ogni ciclo di while esplora un gruppo; ciclo sugli stroke
{
if (!isStrokeGrouped(strokeIndex)) {
strokeIndex--;
continue;
}
bool entered = isInsideGroup() > 0 && isEnteredGroupStroke(strokeIndex);
if ((onEnteredGroup || entered) && (!onEnteredGroup || !entered)) {
strokeIndex--;
continue;
}
int currStrokeIndex = strokeIndex;
while (strokeIndex >= 0 &&
getCommonGroupDepth(strokeIndex, currStrokeIndex) > 0) {
TStroke *s = getStroke(strokeIndex);
double outT;
int chunkIndex;
double dist2;
bool ret = s->getNearestChunk(pos, outT, chunkIndex, dist2);
if (ret) {
TThickPoint p = s->getChunk(chunkIndex)->getThickPoint(outT);
if (p.thick < 0.1) p.thick = 1;
if (sqrt(dist2) <= 1.5 * p.thick) return strokeIndex;
}
/*TThickPoint p = s->getThickPoint(s->getW(pos));
double dist = tdistance( TThickPoint(pos,0), p);
if (dist<1.2*p.thick/2.0)
return strokeIndex;*/
strokeIndex--;
}
}
strokeIndex = getStrokeCount() - 1;
int ret = -1;
while (strokeIndex >=
0) // ogni ciclo di while esplora un gruppo; ciclo sulle regions
{
if (!isStrokeGrouped(strokeIndex)) {
strokeIndex--;
continue;
}
bool entered = isInsideGroup() > 0 && isEnteredGroupStroke(strokeIndex);
if ((onEnteredGroup || entered) && (!onEnteredGroup || !entered)) {
strokeIndex--;
continue;
}
TRegion *currR = 0;
for (UINT regionIndex = 0; regionIndex < getRegionCount(); regionIndex++) {
TRegion *r = getRegion(regionIndex);
int i, regionStrokeIndex = -1;
for (i = 0; i < (int)r->getEdgeCount() && regionStrokeIndex < 0; i++)
regionStrokeIndex = r->getEdge(i)->m_index;
if (regionStrokeIndex >= 0 &&
sameSubGroup(regionStrokeIndex, strokeIndex) &&
containsNoSubregion(r, pos)) {
if (!currR || currR->contains(*r)) {
currR = r;
ret = regionStrokeIndex;
}
}
}
if (currR != 0) {
assert(m_palette);
const TSolidColorStyle *st = dynamic_cast<const TSolidColorStyle *>(
m_palette->getStyle(currR->getStyle()));
if (!st || st->getMainColor() != TPixel::Transparent) return ret;
}
while (strokeIndex > 0 &&
getCommonGroupDepth(strokeIndex, strokeIndex - 1) > 0)
strokeIndex--;
strokeIndex--;
}
return -1;
}
//------------------------------------------------------------------------------------
int TVectorImage::pickGroup(const TPointD &pos) const {
int index;
if ((index = pickGroup(pos, true)) == -1) return pickGroup(pos, false);
return index;
}
//--------------------------------------------------------------------------------------------------
| 30.795543 | 100 | 0.553276 | [
"render",
"shape",
"vector",
"transform"
] |
1bd9e88754b9b5c66638a63362aed06d9fd93d73 | 7,447 | inl | C++ | common/src/partitioning/grid/GridContainer.inl | petitg1987/UrchinEngine | 32d4b62b1ab7e2aa781c99de11331e3738078b0c | [
"MIT"
] | 24 | 2015-10-05T00:13:57.000Z | 2020-05-06T20:14:06.000Z | common/src/partitioning/grid/GridContainer.inl | petitg1987/UrchinEngine | 32d4b62b1ab7e2aa781c99de11331e3738078b0c | [
"MIT"
] | 1 | 2019-11-01T08:00:55.000Z | 2019-11-01T08:00:55.000Z | common/src/partitioning/grid/GridContainer.inl | petitg1987/UrchinEngine | 32d4b62b1ab7e2aa781c99de11331e3738078b0c | [
"MIT"
] | 10 | 2015-11-25T07:33:13.000Z | 2020-03-02T08:21:10.000Z |
template<class T> AxisCompare<T>::AxisCompare(std::size_t axisIndex) :
axisIndex(axisIndex) {
}
template<class T> bool AxisCompare<T>::operator() (const T& item1, const T& item2) const {
return item1->getGridPosition()[axisIndex] < item2->getGridPosition()[axisIndex];
}
template<class T> GridContainer<T>::GridContainer() :
axisSortedItems({}) {
}
template<class T> bool GridContainer<T>::addItem(std::shared_ptr<T> item) {
for (std::size_t axisIndex = 0; axisIndex < 3; ++axisIndex) {
std::int64_t key = buildKey(item->getGridPosition(), axisIndex);
ItemSet<T> initialSet((AxisCompare<std::shared_ptr<T>>(axisIndex)));
auto insertResult = axisSortedItems[axisIndex].insert(std::make_pair(key, initialSet));
ItemSet<T>& setContainer = insertResult.first->second;
const auto& insertSetResult = setContainer.insert(item);
if (!insertSetResult.second) [[unlikely]] {
assert(axisIndex == 0);
return false;
}
}
return true;
}
template<class T> std::int64_t GridContainer<T>::buildKey(const Point3<int>& gridPosition, std::size_t excludeIndex) const {
std::size_t index1 = (excludeIndex + 1) % 3;
std::size_t index2 = (excludeIndex + 2) % 3;
return (((std::int64_t)gridPosition[index1]) << 32) + ((std::int64_t)gridPosition[index2]);
}
template<class T> std::shared_ptr<T> GridContainer<T>::removeItem(const Point3<int>& gridPosition) {
std::shared_ptr<T> removedItem;
for (std::size_t axisIndex = 0; axisIndex < 3; ++axisIndex) {
std::int64_t key = buildKey(gridPosition, axisIndex);
auto itFindMap = axisSortedItems[axisIndex].find(key);
if (itFindMap != axisSortedItems[axisIndex].end()) {
auto& set = itFindMap->second;
auto itFindSet = findInItemSet(set, gridPosition, axisIndex);
if (itFindSet != set.end()) {
removedItem = *itFindSet;
set.erase(itFindSet);
}
if (set.empty()) {
axisSortedItems[axisIndex].erase(itFindMap);
}
}
}
return removedItem;
}
template<class T> void GridContainer<T>::updateItemPosition(T& item, const Point3<int>& newGridPosition) {
std::shared_ptr<T> removedItem = removeItem(item.getGridPosition());
if (!removedItem) {
throw std::runtime_error("Item position cannot be updated because the item is not found at this position: " + StringUtil::toString(item.getGridPosition()));
}
removedItem->setGridPosition(newGridPosition);
addItem(removedItem);
}
template<class T> typename ItemSet<T>::iterator GridContainer<T>::findInItemSet(const ItemSet<T>& set, const Point3<int>& gridPosition, std::size_t axisIndex) const {
auto lowerBound = std::lower_bound(set.begin(), set.end(), gridPosition, [&axisIndex](const std::shared_ptr<T>& item, const Point3<int>& pos) {
return pos[axisIndex] > item->getGridPosition()[axisIndex];
});
if (lowerBound != set.end() && (*lowerBound)->getGridPosition()[axisIndex] == gridPosition[axisIndex]) {
return lowerBound;
}
return set.end();
}
template<class T> bool GridContainer<T>::isItemExist(const Point3<int>& gridPosition) const {
return getItem(gridPosition) != nullptr;
}
template<class T> T* GridContainer<T>::getItem(const Point3<int>& gridPosition) const {
std::int64_t key = buildKey(gridPosition, 0);
auto itFindMap = axisSortedItems[0].find(key);
if (itFindMap != axisSortedItems[0].end()) {
const auto& set = itFindMap->second;
const auto itFindSet = findInItemSet(set, gridPosition, 0);
if (itFindSet != set.end()) {
return (*itFindSet).get();
}
}
return nullptr;
}
/**
* @tparam items [out] All items in grid container
*/
template<class T> void GridContainer<T>::getItems(std::vector<T*>& items) const {
for (std::pair<std::int64_t, ItemSet<T>> element : axisSortedItems[0]) {
for (auto it = element.second.begin(); it != element.second.end(); ++it) {
items.push_back(it->get());
}
}
}
template<class T> std::shared_ptr<T> GridContainer<T>::findNeighbor(const Point3<int>& gridPosition, Axis axis, Direction direction) const {
auto axisIndex = (std::size_t)axis;
const auto& sortedItems = axisSortedItems[axisIndex];
std::int64_t key = buildKey(gridPosition, axisIndex);
auto itFind = sortedItems.find(key);
if (itFind != sortedItems.end()) {
const auto& set = itFind->second;
if (direction == Direction::POSITIVE) {
auto upperBound = std::upper_bound(set.begin(), set.end(), gridPosition, [&axisIndex](const Point3<int>& pos, const std::shared_ptr<T>& item) {
return pos[axisIndex] < item->getGridPosition()[axisIndex];
});
if (upperBound != set.end()) {
return *upperBound;
}
} else if (direction == Direction::NEGATIVE) {
auto lowerBound = std::lower_bound(set.begin(), set.end(), gridPosition, [&axisIndex](const std::shared_ptr<T>& item, const Point3<int>& pos) {
return pos[axisIndex] > item->getGridPosition()[axisIndex];
});
if (lowerBound != set.begin()) {
return *(--lowerBound);
}
} else {
throw std::runtime_error("Unknown direction: " + std::to_string(direction));
}
}
return nullptr;
}
template<class T> std::vector<std::shared_ptr<T>> GridContainer<T>::findAllDirectNeighbors(const Point3<int>& gridPosition, Axis axis, Direction direction) const {
std::vector<std::shared_ptr<T>> result;
std::size_t axisIndex = (std::size_t)axis;
const auto& sortedItems = axisSortedItems[axisIndex];
std::int64_t key = buildKey(gridPosition, axisIndex);
auto itFind = sortedItems.find(key);
if (itFind != sortedItems.end()) {
const auto& set = itFind->second;
if (direction == Direction::POSITIVE) {
auto upperBound = std::upper_bound(set.begin(), set.end(), gridPosition, [&axisIndex](const Point3<int>& pos, const std::shared_ptr<T>& item) {
return pos[axisIndex] < item->getGridPosition()[axisIndex];
});
int directNeighborPosition = gridPosition[axisIndex] + 1;
for (; upperBound != set.end(); ++upperBound) {
if ((*upperBound)->getGridPosition()[axisIndex] == directNeighborPosition++) {
result.push_back(*upperBound);
} else {
break;
}
}
} else if (direction == Direction::NEGATIVE) {
auto lowerBound = std::lower_bound(set.begin(), set.end(), gridPosition, [&axisIndex](const std::shared_ptr<T>& item, const Point3<int>& pos) {
return pos[axisIndex] > item->getGridPosition()[axisIndex];
});
int directNeighborPosition = gridPosition[axisIndex] - 1;
while (lowerBound-- != set.begin()) {
if ((*lowerBound)->getGridPosition()[axisIndex] == directNeighborPosition--) {
result.push_back(*lowerBound);
} else {
break;
}
}
} else {
throw std::runtime_error("Unknown direction: " + std::to_string(direction));
}
}
return result;
}
| 41.143646 | 166 | 0.61743 | [
"vector"
] |
1bdde70414fdc8e6a2179c3c94daed0edf08d8a1 | 26,656 | hpp | C++ | include/System/Net/HttpListenerResponse.hpp | marksteward/BeatSaber-Quest-Codegen | a76f063f71cef207a9f048ad7613835f554911a7 | [
"Unlicense"
] | null | null | null | include/System/Net/HttpListenerResponse.hpp | marksteward/BeatSaber-Quest-Codegen | a76f063f71cef207a9f048ad7613835f554911a7 | [
"Unlicense"
] | null | null | null | include/System/Net/HttpListenerResponse.hpp | marksteward/BeatSaber-Quest-Codegen | a76f063f71cef207a9f048ad7613835f554911a7 | [
"Unlicense"
] | null | null | null | // Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "extern/beatsaber-hook/shared/utils/typedefs.h"
#include "extern/beatsaber-hook/shared/utils/byref.hpp"
// Including type: System.IDisposable
#include "System/IDisposable.hpp"
#include "extern/beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp"
#include "extern/beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp"
#include "extern/beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp"
#include "extern/beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Begin forward declares
// Forward declaring namespace: System::Text
namespace System::Text {
// Forward declaring type: Encoding
class Encoding;
}
// Forward declaring namespace: System::Net
namespace System::Net {
// Forward declaring type: CookieCollection
class CookieCollection;
// Forward declaring type: WebHeaderCollection
class WebHeaderCollection;
// Forward declaring type: ResponseStream
class ResponseStream;
// Forward declaring type: HttpListenerContext
class HttpListenerContext;
// Forward declaring type: Cookie
class Cookie;
}
// Forward declaring namespace: System
namespace System {
// Forward declaring type: Version
class Version;
}
// Forward declaring namespace: System::IO
namespace System::IO {
// Forward declaring type: Stream
class Stream;
// Forward declaring type: MemoryStream
class MemoryStream;
}
// Completed forward declares
// Type namespace: System.Net
namespace System::Net {
// Size: 0x99
#pragma pack(push, 1)
// Autogenerated type: System.Net.HttpListenerResponse
// [TokenAttribute] Offset: FFFFFFFF
class HttpListenerResponse : public ::Il2CppObject/*, public System::IDisposable*/ {
public:
// private System.Boolean disposed
// Size: 0x1
// Offset: 0x10
bool disposed;
// Field size check
static_assert(sizeof(bool) == 0x1);
// Padding between fields: disposed and: content_encoding
char __padding0[0x7] = {};
// private System.Text.Encoding content_encoding
// Size: 0x8
// Offset: 0x18
System::Text::Encoding* content_encoding;
// Field size check
static_assert(sizeof(System::Text::Encoding*) == 0x8);
// private System.Int64 content_length
// Size: 0x8
// Offset: 0x20
int64_t content_length;
// Field size check
static_assert(sizeof(int64_t) == 0x8);
// private System.Boolean cl_set
// Size: 0x1
// Offset: 0x28
bool cl_set;
// Field size check
static_assert(sizeof(bool) == 0x1);
// Padding between fields: cl_set and: content_type
char __padding3[0x7] = {};
// private System.String content_type
// Size: 0x8
// Offset: 0x30
::Il2CppString* content_type;
// Field size check
static_assert(sizeof(::Il2CppString*) == 0x8);
// private System.Net.CookieCollection cookies
// Size: 0x8
// Offset: 0x38
System::Net::CookieCollection* cookies;
// Field size check
static_assert(sizeof(System::Net::CookieCollection*) == 0x8);
// private System.Net.WebHeaderCollection headers
// Size: 0x8
// Offset: 0x40
System::Net::WebHeaderCollection* headers;
// Field size check
static_assert(sizeof(System::Net::WebHeaderCollection*) == 0x8);
// private System.Boolean keep_alive
// Size: 0x1
// Offset: 0x48
bool keep_alive;
// Field size check
static_assert(sizeof(bool) == 0x1);
// Padding between fields: keep_alive and: output_stream
char __padding7[0x7] = {};
// private System.Net.ResponseStream output_stream
// Size: 0x8
// Offset: 0x50
System::Net::ResponseStream* output_stream;
// Field size check
static_assert(sizeof(System::Net::ResponseStream*) == 0x8);
// private System.Version version
// Size: 0x8
// Offset: 0x58
System::Version* version;
// Field size check
static_assert(sizeof(System::Version*) == 0x8);
// private System.String location
// Size: 0x8
// Offset: 0x60
::Il2CppString* location;
// Field size check
static_assert(sizeof(::Il2CppString*) == 0x8);
// private System.Int32 status_code
// Size: 0x4
// Offset: 0x68
int status_code;
// Field size check
static_assert(sizeof(int) == 0x4);
// Padding between fields: status_code and: status_description
char __padding11[0x4] = {};
// private System.String status_description
// Size: 0x8
// Offset: 0x70
::Il2CppString* status_description;
// Field size check
static_assert(sizeof(::Il2CppString*) == 0x8);
// private System.Boolean chunked
// Size: 0x1
// Offset: 0x78
bool chunked;
// Field size check
static_assert(sizeof(bool) == 0x1);
// Padding between fields: chunked and: context
char __padding13[0x7] = {};
// private System.Net.HttpListenerContext context
// Size: 0x8
// Offset: 0x80
System::Net::HttpListenerContext* context;
// Field size check
static_assert(sizeof(System::Net::HttpListenerContext*) == 0x8);
// System.Boolean HeadersSent
// Size: 0x1
// Offset: 0x88
bool HeadersSent;
// Field size check
static_assert(sizeof(bool) == 0x1);
// Padding between fields: HeadersSent and: headers_lock
char __padding15[0x7] = {};
// System.Object headers_lock
// Size: 0x8
// Offset: 0x90
::Il2CppObject* headers_lock;
// Field size check
static_assert(sizeof(::Il2CppObject*) == 0x8);
// private System.Boolean force_close_chunked
// Size: 0x1
// Offset: 0x98
bool force_close_chunked;
// Field size check
static_assert(sizeof(bool) == 0x1);
// Creating value type constructor for type: HttpListenerResponse
HttpListenerResponse(bool disposed_ = {}, System::Text::Encoding* content_encoding_ = {}, int64_t content_length_ = {}, bool cl_set_ = {}, ::Il2CppString* content_type_ = {}, System::Net::CookieCollection* cookies_ = {}, System::Net::WebHeaderCollection* headers_ = {}, bool keep_alive_ = {}, System::Net::ResponseStream* output_stream_ = {}, System::Version* version_ = {}, ::Il2CppString* location_ = {}, int status_code_ = {}, ::Il2CppString* status_description_ = {}, bool chunked_ = {}, System::Net::HttpListenerContext* context_ = {}, bool HeadersSent_ = {}, ::Il2CppObject* headers_lock_ = {}, bool force_close_chunked_ = {}) noexcept : disposed{disposed_}, content_encoding{content_encoding_}, content_length{content_length_}, cl_set{cl_set_}, content_type{content_type_}, cookies{cookies_}, headers{headers_}, keep_alive{keep_alive_}, output_stream{output_stream_}, version{version_}, location{location_}, status_code{status_code_}, status_description{status_description_}, chunked{chunked_}, context{context_}, HeadersSent{HeadersSent_}, headers_lock{headers_lock_}, force_close_chunked{force_close_chunked_} {}
// Creating interface conversion operator: operator System::IDisposable
operator System::IDisposable() noexcept {
return *reinterpret_cast<System::IDisposable*>(this);
}
// Get static field: static private System.String tspecials
static ::Il2CppString* _get_tspecials();
// Set static field: static private System.String tspecials
static void _set_tspecials(::Il2CppString* value);
// Get instance field: private System.Boolean disposed
bool _get_disposed();
// Set instance field: private System.Boolean disposed
void _set_disposed(bool value);
// Get instance field: private System.Text.Encoding content_encoding
System::Text::Encoding* _get_content_encoding();
// Set instance field: private System.Text.Encoding content_encoding
void _set_content_encoding(System::Text::Encoding* value);
// Get instance field: private System.Int64 content_length
int64_t _get_content_length();
// Set instance field: private System.Int64 content_length
void _set_content_length(int64_t value);
// Get instance field: private System.Boolean cl_set
bool _get_cl_set();
// Set instance field: private System.Boolean cl_set
void _set_cl_set(bool value);
// Get instance field: private System.String content_type
::Il2CppString* _get_content_type();
// Set instance field: private System.String content_type
void _set_content_type(::Il2CppString* value);
// Get instance field: private System.Net.CookieCollection cookies
System::Net::CookieCollection* _get_cookies();
// Set instance field: private System.Net.CookieCollection cookies
void _set_cookies(System::Net::CookieCollection* value);
// Get instance field: private System.Net.WebHeaderCollection headers
System::Net::WebHeaderCollection* _get_headers();
// Set instance field: private System.Net.WebHeaderCollection headers
void _set_headers(System::Net::WebHeaderCollection* value);
// Get instance field: private System.Boolean keep_alive
bool _get_keep_alive();
// Set instance field: private System.Boolean keep_alive
void _set_keep_alive(bool value);
// Get instance field: private System.Net.ResponseStream output_stream
System::Net::ResponseStream* _get_output_stream();
// Set instance field: private System.Net.ResponseStream output_stream
void _set_output_stream(System::Net::ResponseStream* value);
// Get instance field: private System.Version version
System::Version* _get_version();
// Set instance field: private System.Version version
void _set_version(System::Version* value);
// Get instance field: private System.String location
::Il2CppString* _get_location();
// Set instance field: private System.String location
void _set_location(::Il2CppString* value);
// Get instance field: private System.Int32 status_code
int _get_status_code();
// Set instance field: private System.Int32 status_code
void _set_status_code(int value);
// Get instance field: private System.String status_description
::Il2CppString* _get_status_description();
// Set instance field: private System.String status_description
void _set_status_description(::Il2CppString* value);
// Get instance field: private System.Boolean chunked
bool _get_chunked();
// Set instance field: private System.Boolean chunked
void _set_chunked(bool value);
// Get instance field: private System.Net.HttpListenerContext context
System::Net::HttpListenerContext* _get_context();
// Set instance field: private System.Net.HttpListenerContext context
void _set_context(System::Net::HttpListenerContext* value);
// Get instance field: System.Boolean HeadersSent
bool _get_HeadersSent();
// Set instance field: System.Boolean HeadersSent
void _set_HeadersSent(bool value);
// Get instance field: System.Object headers_lock
::Il2CppObject* _get_headers_lock();
// Set instance field: System.Object headers_lock
void _set_headers_lock(::Il2CppObject* value);
// Get instance field: private System.Boolean force_close_chunked
bool _get_force_close_chunked();
// Set instance field: private System.Boolean force_close_chunked
void _set_force_close_chunked(bool value);
// System.Boolean get_ForceCloseChunked()
// Offset: 0x133A31C
bool get_ForceCloseChunked();
// public System.Text.Encoding get_ContentEncoding()
// Offset: 0x1334160
System::Text::Encoding* get_ContentEncoding();
// public System.Void set_ContentLength64(System.Int64 value)
// Offset: 0x133A324
void set_ContentLength64(int64_t value);
// public System.Void set_ContentType(System.String value)
// Offset: 0x1333D40
void set_ContentType(::Il2CppString* value);
// public System.Net.WebHeaderCollection get_Headers()
// Offset: 0x133A464
System::Net::WebHeaderCollection* get_Headers();
// public System.IO.Stream get_OutputStream()
// Offset: 0x133A46C
System::IO::Stream* get_OutputStream();
// public System.Boolean get_SendChunked()
// Offset: 0x133A4AC
bool get_SendChunked();
// public System.Void set_SendChunked(System.Boolean value)
// Offset: 0x1331874
void set_SendChunked(bool value);
// public System.Void set_StatusCode(System.Int32 value)
// Offset: 0x1333C00
void set_StatusCode(int value);
// System.Void .ctor(System.Net.HttpListenerContext context)
// Offset: 0x133718C
template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary>
static HttpListenerResponse* New_ctor(System::Net::HttpListenerContext* context) {
static auto ___internal__logger = ::Logger::get().WithContext("System::Net::HttpListenerResponse::.ctor");
return THROW_UNLESS((::il2cpp_utils::New<HttpListenerResponse*, creationType>(context)));
}
// static private System.Void .cctor()
// Offset: 0x133B40C
static void _cctor();
// private System.Void System.IDisposable.Dispose()
// Offset: 0x133A4B4
void System_IDisposable_Dispose();
// private System.Void Close(System.Boolean force)
// Offset: 0x133A4BC
void Close(bool force);
// public System.Void Close()
// Offset: 0x133A4EC
void Close();
// public System.Void Close(System.Byte[] responseEntity, System.Boolean willBlock)
// Offset: 0x133418C
void Close(::Array<uint8_t>* responseEntity, bool willBlock);
// System.Void SendHeaders(System.Boolean closing, System.IO.MemoryStream ms)
// Offset: 0x133A500
void SendHeaders(bool closing, System::IO::MemoryStream* ms);
// static private System.String FormatHeaders(System.Net.WebHeaderCollection headers)
// Offset: 0x133B000
static ::Il2CppString* FormatHeaders(System::Net::WebHeaderCollection* headers);
// static private System.String CookieToClientString(System.Net.Cookie cookie)
// Offset: 0x133ADA0
static ::Il2CppString* CookieToClientString(System::Net::Cookie* cookie);
// static private System.String QuotedString(System.Net.Cookie cookie, System.String value)
// Offset: 0x133B250
static ::Il2CppString* QuotedString(System::Net::Cookie* cookie, ::Il2CppString* value);
// static private System.Boolean IsToken(System.String value)
// Offset: 0x133B324
static bool IsToken(::Il2CppString* value);
}; // System.Net.HttpListenerResponse
#pragma pack(pop)
static check_size<sizeof(HttpListenerResponse), 152 + sizeof(bool)> __System_Net_HttpListenerResponseSizeCheck;
static_assert(sizeof(HttpListenerResponse) == 0x99);
}
DEFINE_IL2CPP_ARG_TYPE(System::Net::HttpListenerResponse*, "System.Net", "HttpListenerResponse");
#include "extern/beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp"
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::get_ForceCloseChunked
// Il2CppName: get_ForceCloseChunked
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (System::Net::HttpListenerResponse::*)()>(&System::Net::HttpListenerResponse::get_ForceCloseChunked)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "get_ForceCloseChunked", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::get_ContentEncoding
// Il2CppName: get_ContentEncoding
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<System::Text::Encoding* (System::Net::HttpListenerResponse::*)()>(&System::Net::HttpListenerResponse::get_ContentEncoding)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "get_ContentEncoding", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::set_ContentLength64
// Il2CppName: set_ContentLength64
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (System::Net::HttpListenerResponse::*)(int64_t)>(&System::Net::HttpListenerResponse::set_ContentLength64)> {
static const MethodInfo* get() {
static auto* value = &::il2cpp_utils::GetClassFromName("System", "Int64")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "set_ContentLength64", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{value});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::set_ContentType
// Il2CppName: set_ContentType
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (System::Net::HttpListenerResponse::*)(::Il2CppString*)>(&System::Net::HttpListenerResponse::set_ContentType)> {
static const MethodInfo* get() {
static auto* value = &::il2cpp_utils::GetClassFromName("System", "String")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "set_ContentType", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{value});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::get_Headers
// Il2CppName: get_Headers
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<System::Net::WebHeaderCollection* (System::Net::HttpListenerResponse::*)()>(&System::Net::HttpListenerResponse::get_Headers)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "get_Headers", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::get_OutputStream
// Il2CppName: get_OutputStream
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<System::IO::Stream* (System::Net::HttpListenerResponse::*)()>(&System::Net::HttpListenerResponse::get_OutputStream)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "get_OutputStream", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::get_SendChunked
// Il2CppName: get_SendChunked
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (System::Net::HttpListenerResponse::*)()>(&System::Net::HttpListenerResponse::get_SendChunked)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "get_SendChunked", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::set_SendChunked
// Il2CppName: set_SendChunked
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (System::Net::HttpListenerResponse::*)(bool)>(&System::Net::HttpListenerResponse::set_SendChunked)> {
static const MethodInfo* get() {
static auto* value = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "set_SendChunked", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{value});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::set_StatusCode
// Il2CppName: set_StatusCode
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (System::Net::HttpListenerResponse::*)(int)>(&System::Net::HttpListenerResponse::set_StatusCode)> {
static const MethodInfo* get() {
static auto* value = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "set_StatusCode", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{value});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::New_ctor
// Il2CppName: .ctor
// Cannot get method pointer of value based method overload from template for constructor!
// Try using FindMethod instead!
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::_cctor
// Il2CppName: .cctor
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)()>(&System::Net::HttpListenerResponse::_cctor)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), ".cctor", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::System_IDisposable_Dispose
// Il2CppName: System.IDisposable.Dispose
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (System::Net::HttpListenerResponse::*)()>(&System::Net::HttpListenerResponse::System_IDisposable_Dispose)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "System.IDisposable.Dispose", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::Close
// Il2CppName: Close
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (System::Net::HttpListenerResponse::*)(bool)>(&System::Net::HttpListenerResponse::Close)> {
static const MethodInfo* get() {
static auto* force = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "Close", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{force});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::Close
// Il2CppName: Close
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (System::Net::HttpListenerResponse::*)()>(&System::Net::HttpListenerResponse::Close)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "Close", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::Close
// Il2CppName: Close
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (System::Net::HttpListenerResponse::*)(::Array<uint8_t>*, bool)>(&System::Net::HttpListenerResponse::Close)> {
static const MethodInfo* get() {
static auto* responseEntity = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "Byte"), 1)->byval_arg;
static auto* willBlock = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "Close", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{responseEntity, willBlock});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::SendHeaders
// Il2CppName: SendHeaders
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (System::Net::HttpListenerResponse::*)(bool, System::IO::MemoryStream*)>(&System::Net::HttpListenerResponse::SendHeaders)> {
static const MethodInfo* get() {
static auto* closing = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
static auto* ms = &::il2cpp_utils::GetClassFromName("System.IO", "MemoryStream")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "SendHeaders", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{closing, ms});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::FormatHeaders
// Il2CppName: FormatHeaders
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::Il2CppString* (*)(System::Net::WebHeaderCollection*)>(&System::Net::HttpListenerResponse::FormatHeaders)> {
static const MethodInfo* get() {
static auto* headers = &::il2cpp_utils::GetClassFromName("System.Net", "WebHeaderCollection")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "FormatHeaders", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{headers});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::CookieToClientString
// Il2CppName: CookieToClientString
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::Il2CppString* (*)(System::Net::Cookie*)>(&System::Net::HttpListenerResponse::CookieToClientString)> {
static const MethodInfo* get() {
static auto* cookie = &::il2cpp_utils::GetClassFromName("System.Net", "Cookie")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "CookieToClientString", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{cookie});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::QuotedString
// Il2CppName: QuotedString
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::Il2CppString* (*)(System::Net::Cookie*, ::Il2CppString*)>(&System::Net::HttpListenerResponse::QuotedString)> {
static const MethodInfo* get() {
static auto* cookie = &::il2cpp_utils::GetClassFromName("System.Net", "Cookie")->byval_arg;
static auto* value = &::il2cpp_utils::GetClassFromName("System", "String")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "QuotedString", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{cookie, value});
}
};
// Writing MetadataGetter for method: System::Net::HttpListenerResponse::IsToken
// Il2CppName: IsToken
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::Il2CppString*)>(&System::Net::HttpListenerResponse::IsToken)> {
static const MethodInfo* get() {
static auto* value = &::il2cpp_utils::GetClassFromName("System", "String")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::Net::HttpListenerResponse*), "IsToken", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{value});
}
};
| 53.526104 | 1,126 | 0.720176 | [
"object",
"vector"
] |
1bef585268907597bdc4c4e521d765f1dd4e96c8 | 10,826 | cpp | C++ | demos/gaze_estimation_demo/cpp_gapi/src/custom_kernels.cpp | kblaszczak-intel/open_model_zoo | e313674d35050d2a4721bbccd9bd4c404f1ba7f8 | [
"Apache-2.0"
] | 2,201 | 2018-10-15T14:37:19.000Z | 2020-07-16T02:05:51.000Z | demos/gaze_estimation_demo/cpp_gapi/src/custom_kernels.cpp | kblaszczak-intel/open_model_zoo | e313674d35050d2a4721bbccd9bd4c404f1ba7f8 | [
"Apache-2.0"
] | 759 | 2018-10-18T07:43:55.000Z | 2020-07-16T01:23:12.000Z | demos/gaze_estimation_demo/cpp_gapi/src/custom_kernels.cpp | kblaszczak-intel/open_model_zoo | e313674d35050d2a4721bbccd9bd4c404f1ba7f8 | [
"Apache-2.0"
] | 808 | 2018-10-16T14:03:49.000Z | 2020-07-15T11:41:45.000Z | // Copyright (C) 2021-2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "custom_kernels.hpp"
#include <stddef.h>
#include <algorithm>
#include <cmath>
#include <memory>
#include <opencv2/gapi/cpu/gcpukernel.hpp>
#include <opencv2/imgproc.hpp>
#include "kernel_packages.hpp"
namespace {
void rotateImageAroundCenter(const cv::Mat& srcImage, const float angle, cv::Mat& dstImage) {
const auto width = srcImage.cols;
const auto height = srcImage.rows;
const cv::Size size(width, height);
const cv::Point2f center(static_cast<float>(width / 2), static_cast<float>(height / 2));
const auto rotMatrix = cv::getRotationMatrix2D(center, static_cast<double>(angle), 1);
cv::warpAffine(srcImage, dstImage, rotMatrix, size, 1, cv::BORDER_REPLICATE);
}
void toCHW(const cv::Mat& src, cv::Mat& dst) {
dst.create(cv::Size(src.cols, src.rows * src.channels()), CV_32F);
std::vector<cv::Mat> planes;
for (int i = 0; i < src.channels(); ++i) {
planes.push_back(dst.rowRange(i * src.rows, (i + 1) * src.rows));
}
cv::split(src, planes);
}
void preprocessing(const cv::Mat& src, const cv::Size& new_size, const float roll, cv::Mat& dst) {
cv::Mat rot, cvt, rsz;
rotateImageAroundCenter(src, roll, rot); // rotate
cv::resize(rot, rsz, new_size); // resize
rsz.convertTo(cvt, CV_32F); // convert to F32
toCHW(cvt, dst); // HWC to CHW
dst = dst.reshape(1, {1, 3, new_size.height, new_size.width}); // reshape to CNN input
}
void adjustBoundingBox(cv::Rect& boundingBox) {
auto w = boundingBox.width;
auto h = boundingBox.height;
boundingBox.x -= static_cast<int>(0.067 * w);
boundingBox.y -= static_cast<int>(0.028 * h);
boundingBox.width += static_cast<int>(0.15 * w);
boundingBox.height += static_cast<int>(0.13 * h);
if (boundingBox.width < boundingBox.height) {
auto dx = (boundingBox.height - boundingBox.width);
boundingBox.x -= dx / 2;
boundingBox.width += dx;
} else {
auto dy = (boundingBox.width - boundingBox.height);
boundingBox.y -= dy / 2;
boundingBox.height += dy;
}
}
cv::Rect createEyeBoundingBox(const cv::Point2i& p1, const cv::Point2i& p2, float scale = 1.8f) {
cv::Rect result;
float size = static_cast<float>(cv::norm(p1 - p2));
result.width = static_cast<int>(scale * size);
result.height = result.width;
auto midpoint = (p1 + p2) / 2;
result.x = midpoint.x - (result.width / 2);
result.y = midpoint.y - (result.height / 2);
return result;
}
} // anonymous namespace
// clang-format off
GAPI_OCV_KERNEL(OCVPrepareEyes, custom::PrepareEyes) {
static void run(const cv::Mat& in,
const std::vector<cv::Rect>& left_rc,
const std::vector<cv::Rect>& right_rc,
const std::vector<cv::Mat>& rolls,
const cv::Size& new_size,
std::vector<cv::Mat>& left_eyes,
std::vector<cv::Mat>& right_eyes) {
left_eyes.clear();
right_eyes.clear();
const auto size = left_rc.size();
for (size_t j = 0; j < size; ++j) {
auto roll = rolls.at(j).ptr<float>()[0];
cv::Mat l_dst, r_dst;
auto leftEyeImage(cv::Mat(in, left_rc.at(j)));
preprocessing(leftEyeImage, new_size, roll, l_dst);
left_eyes.push_back(l_dst);
auto rightEyeImage(cv::Mat(in, right_rc.at(j)));
preprocessing(rightEyeImage, new_size, roll, r_dst);
right_eyes.push_back(r_dst);
}
}
};
/** FIXME: This kernel should become part of G-API kernels in future **/
GAPI_OCV_KERNEL(OCVParseSSD, custom::ParseSSD) {
static void run(const cv::Mat& in_ssd_result,
const cv::Size& upscale,
const float detectionThreshold,
std::vector<cv::Rect>& out_objects,
std::vector<float>& out_confidence) {
const auto &in_ssd_dims = in_ssd_result.size;
CV_Assert(in_ssd_dims.dims() == 4u);
const int MAX_PROPOSALS = in_ssd_dims[2];
const int OBJECT_SIZE = in_ssd_dims[3];
CV_Assert(OBJECT_SIZE == 7); // fixed SSD object size
const cv::Rect surface({0, 0}, upscale);
out_objects.clear();
const float *data = in_ssd_result.ptr<float>();
for (int i = 0; i < MAX_PROPOSALS; i++) {
const float image_id = data[i * OBJECT_SIZE + 0];
const float confidence = data[i * OBJECT_SIZE + 2];
if (image_id < 0.f) {
break; // marks end-of-detections
}
if (confidence < detectionThreshold) {
continue; // skip objects with low confidence
}
const float rc_left = data[i * OBJECT_SIZE + 3];
const float rc_top = data[i * OBJECT_SIZE + 4];
const float rc_right = data[i * OBJECT_SIZE + 5];
const float rc_bottom = data[i * OBJECT_SIZE + 6];
out_confidence.push_back(confidence);
cv::Rect rc; // map relative coordinates to the original image scale
rc.x = static_cast<int>(rc_left * upscale.width);
rc.y = static_cast<int>(rc_top * upscale.height);
rc.width = static_cast<int>(rc_right * upscale.width) - rc.x;
rc.height = static_cast<int>(rc_bottom * upscale.height) - rc.y;
adjustBoundingBox(rc);
const auto clipped_rc = rc & surface;
if (clipped_rc.area() != rc.area()) {
continue;
}
out_objects.emplace_back(clipped_rc);
}
}
};
GAPI_OCV_KERNEL(OCVProcessPoses, custom::ProcessPoses) {
static void run(const std::vector<cv::Mat>& in_ys,
const std::vector<cv::Mat>& in_ps,
const std::vector<cv::Mat>& in_rs,
std::vector<cv::Point3f>& out_poses,
std::vector<cv::Mat>& out_poses_wr) {
CV_Assert(in_ys.size() == in_ps.size() && in_ys.size() == in_rs.size());
const size_t sz = in_ys.size();
for (size_t idx = 0u; idx < sz; ++idx) {
cv::Point3f pose;
pose.x = in_ys[idx].ptr<float>()[0];
pose.y = in_ps[idx].ptr<float>()[0];
pose.z = in_rs[idx].ptr<float>()[0];
out_poses.push_back(pose);
cv::Mat pose_wr(1, 3, CV_32FC1);
float* ptr = pose_wr.ptr<float>();
ptr[0] = pose.x;
ptr[1] = pose.y;
ptr[2] = 0;
out_poses_wr.push_back(pose_wr);
}
}
};
GAPI_OCV_KERNEL(OCVProcessLandmarks, custom::ProcessLandmarks) {
static void run(const cv::Mat& in,
const std::vector<cv::Mat>& landmarks,
const std::vector<cv::Rect>& face_rois,
std::vector<cv::Rect>& left_eyes_rc,
std::vector<cv::Rect>& right_eyes_rc,
std::vector<cv::Point2f>& leftEyeMidpoint,
std::vector<cv::Point2f>& rightEyeMidpoint,
std::vector<std::vector<cv::Point>>& out_lanmarks) {
CV_Assert(landmarks.size() == face_rois.size());
const auto size = landmarks.size();
for (size_t idx = 0u; idx < size; ++idx) {
const float* rawLandmarks = landmarks.at(idx).ptr<float>();
std::vector<cv::Point2i> faceLandmarks;
for (unsigned long i = 0; i < landmarks.at(idx).total() / 2; ++i) {
const int x = static_cast<int>(rawLandmarks[2 * i] *
face_rois.at(idx).width + face_rois.at(idx).x);
const int y = static_cast<int>(rawLandmarks[2 * i + 1] *
face_rois.at(idx).height + face_rois.at(idx).y);
faceLandmarks.emplace_back(x, y);
}
leftEyeMidpoint.push_back((faceLandmarks[0] + faceLandmarks[1]) / 2);
left_eyes_rc.push_back(createEyeBoundingBox(faceLandmarks[0], faceLandmarks[1]));
rightEyeMidpoint.push_back((faceLandmarks[2] + faceLandmarks[3]) / 2);
right_eyes_rc.push_back(createEyeBoundingBox(faceLandmarks[2], faceLandmarks[3]));
out_lanmarks.push_back(faceLandmarks);
}
}
};
GAPI_OCV_KERNEL(OCVProcessEyes, custom::ProcessEyes) {
static void run(const cv::Mat& in,
const std::vector<cv::Mat>& left_eyes_state,
const std::vector<cv::Mat>& right_eyes_state,
std::vector<int>& left_states,
std::vector<int>& right_states) {
CV_Assert(left_eyes_state.size() == right_eyes_state.size());
for (const auto& state : left_eyes_state) {
const auto left_outputValue = state.ptr<float>();
const auto left = left_outputValue[0] < left_outputValue[1] ? 1 : 0;
left_states.push_back(left);
}
for (const auto& state : right_eyes_state) {
const auto right_outputValue = state.ptr<float>();
const auto right = right_outputValue[0] < right_outputValue[1] ? 1 : 0;
right_states.push_back(right);
}
}
};
GAPI_OCV_KERNEL(OCVProcessGazes, custom::ProcessGazes) {
static void run(const std::vector<cv::Mat>& gaze_vectors,
const std::vector<cv::Mat>& rolls,
std::vector<cv::Point3f>& out_gazes) {
CV_Assert(gaze_vectors.size() == rolls.size());
const auto size = gaze_vectors.size();
for (size_t i = 0; i < size; ++i) {
const auto rawResults = gaze_vectors.at(i).ptr<float>();
cv::Point3f gazeVector;
gazeVector.x = rawResults[0];
gazeVector.y = rawResults[1];
gazeVector.z = rawResults[2];
gazeVector = gazeVector / cv::norm(gazeVector);
/** rotate gaze vector to compensate for the alignment **/
auto roll = rolls.at(i).ptr<float>()[0];
float cs = static_cast<float>(std::cos(static_cast<double>(roll) * CV_PI / 180.0));
float sn = static_cast<float>(std::sin(static_cast<double>(roll) * CV_PI / 180.0));
auto tmpX = gazeVector.x * cs + gazeVector.y * sn;
auto tmpY = -gazeVector.x * sn + gazeVector.y * cs;
gazeVector.x = tmpX;
gazeVector.y = tmpY;
out_gazes.push_back(gazeVector);
}
}
};
// clang-format on
cv::gapi::GKernelPackage custom::kernels() {
return cv::gapi::
kernels<OCVPrepareEyes, OCVParseSSD, OCVProcessLandmarks, OCVProcessEyes, OCVProcessGazes, OCVProcessPoses>();
}
| 39.510949 | 118 | 0.572603 | [
"object",
"vector"
] |
1bf1c8149e1a95db92621d846e1c4eb76971e26f | 4,276 | cpp | C++ | source/Plugins/Language/Swift/ObjCRuntimeSyntheticProvider.cpp | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 765 | 2015-12-03T16:44:59.000Z | 2022-03-07T12:41:10.000Z | source/Plugins/Language/Swift/ObjCRuntimeSyntheticProvider.cpp | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 1,815 | 2015-12-11T23:56:05.000Z | 2020-01-10T19:28:43.000Z | source/Plugins/Language/Swift/ObjCRuntimeSyntheticProvider.cpp | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 284 | 2015-12-03T16:47:25.000Z | 2022-03-12T05:39:48.000Z | //===-- ObjCRuntimeSyntheticProvider.cpp ------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#include "ObjCRuntimeSyntheticProvider.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/DeclVendor.h"
#include "lldb/lldb-public.h"
using namespace lldb;
using namespace lldb_private;
std::string ObjCRuntimeSyntheticProvider::GetDescription() {
StreamString sstr;
sstr.Printf("%s%s%s Runtime-generated synthetic provider for %s {\n",
Cascades() ? "" : " (not cascading)",
SkipsPointers() ? " (skip pointers)" : "",
SkipsReferences() ? " (skip references)" : "",
m_descriptor_sp->GetClassName().AsCString("<unknown>"));
return sstr.GetString();
}
size_t ObjCRuntimeSyntheticProvider::FrontEnd::GetNumBases() {
return m_provider->m_descriptor_sp->GetSuperclass().get() ? 1 : 0;
}
size_t ObjCRuntimeSyntheticProvider::FrontEnd::CalculateNumChildren() {
size_t ivars = m_provider->GetNumIVars();
size_t bases = GetNumBases();
return bases + ivars;
}
static lldb::ValueObjectSP GetSuitableRootObject(ValueObjectSP valobj_sp) {
if (valobj_sp) {
if (!valobj_sp->GetParent())
return valobj_sp;
if (valobj_sp->IsBaseClass()) {
if (valobj_sp->GetParent()->IsBaseClass())
return GetSuitableRootObject(valobj_sp->GetParent()->GetSP());
return valobj_sp;
}
}
return valobj_sp;
}
ObjCRuntimeSyntheticProvider::FrontEnd::FrontEnd(
ObjCRuntimeSyntheticProvider *prv, ValueObject &backend)
: SyntheticChildrenFrontEnd(backend), m_provider(prv),
m_root_sp(::GetSuitableRootObject(backend.GetSP())) {}
lldb::ValueObjectSP
ObjCRuntimeSyntheticProvider::FrontEnd::GetChildAtIndex(size_t idx) {
lldb::ValueObjectSP child_sp(nullptr);
if (idx < CalculateNumChildren()) {
if (GetNumBases() == 1) {
if (idx == 0) {
do {
ProcessSP process_sp(m_backend.GetProcessSP());
if (!process_sp)
break;
ObjCLanguageRuntime *runtime = ObjCLanguageRuntime::Get(*process_sp);
if (!runtime)
break;
DeclVendor *vendor = runtime->GetDeclVendor();
if (!vendor)
break;
std::vector<CompilerDecl> decls;
auto descriptor_sp(m_provider->m_descriptor_sp);
if (!descriptor_sp)
break;
descriptor_sp = descriptor_sp->GetSuperclass();
if (!descriptor_sp)
break;
const bool append = false;
const uint32_t max = 1;
if (0 ==
vendor->FindDecls(descriptor_sp->GetClassName(), append, max,
decls))
break;
const uint32_t offset = 0;
const bool can_create = true;
if (decls.empty())
break;
auto *ctx = llvm::dyn_cast<ClangASTContext>(decls[0].GetTypeSystem());
if (!ctx)
break;
CompilerType type = ctx->GetTypeForDecl(decls[0].GetOpaqueDecl());
if (!type.IsValid())
break;
child_sp = m_backend.GetSyntheticBase(offset, type, can_create);
} while (false);
return child_sp;
} else
--idx;
}
if (m_root_sp) {
const auto &ivar_info(m_provider->GetIVarAtIndex(idx));
const bool can_create = true;
child_sp = m_root_sp->GetSyntheticChildAtOffset(
ivar_info.m_offset, ivar_info.m_type, can_create);
if (child_sp)
child_sp->SetName(ivar_info.m_name);
}
}
return child_sp;
}
size_t ObjCRuntimeSyntheticProvider::FrontEnd::GetIndexOfChildWithName(
ConstString name) {
for (size_t idx = 0; idx < CalculateNumChildren(); idx++) {
const auto &ivar_info(m_provider->GetIVarAtIndex(idx));
if (name == ivar_info.m_name)
return idx + GetNumBases();
}
return UINT32_MAX;
}
| 33.669291 | 80 | 0.624181 | [
"vector"
] |
1bf1fc9f669e0a320253f110be8acf12a3cd3bd1 | 2,978 | hpp | C++ | src/interrupt.hpp | balsini/FREDSim | 720dc30d4c2f8a51a05ec74584aef352f029c19f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-05-24T15:20:53.000Z | 2020-05-24T15:20:53.000Z | src/interrupt.hpp | balsini/rtlib2.0 | 720dc30d4c2f8a51a05ec74584aef352f029c19f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | src/interrupt.hpp | balsini/rtlib2.0 | 720dc30d4c2f8a51a05ec74584aef352f029c19f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | /***************************************************************************
begin : Thu Apr 24 15:54:58 CEST 2003
copyright : (C) 2003 by Giuseppe Lipari
email : lipari@sssup.it
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/*
* $Id: interrupt.hpp,v 1.5 2005/10/05 16:46:22 cesare Exp $
*
* $Log: interrupt.hpp,v $
* Revision 1.5 2005/10/05 16:46:22 cesare
* Added DLL support.
*
* Revision 1.4 2005/03/31 15:27:27 cesare
* Corrected some documentations. Added XML docs.
*
* Revision 1.3 2004/11/26 03:47:10 cesare
* Finished merging the main trunk with Lipari's branch.
*
*/
#ifndef __INTERRUPT_HPP__
#define __INTERRUPT_HPP__
#include <vector>
#include <entity.hpp>
#include <gevent.hpp>
#include <randomvar.hpp>
namespace RTSim {
using namespace std;
using namespace MetaSim;
class Task;
/**
This class models an interrupt. It can be periodic/sporadic (the
default), or bursty. The corresponding action is to activate a
number of tasks.
@author Giuseppe Lipari
*/
class Interrupt : public Entity {
protected:
/// the tasks
vector<Task *> tasks;
/// interarrival time between bursts
RandomVar *int_time;
/// bursty period (minimum interval btw consecutive interrupts)
int bp;
/// burst lenght (number of consecutive interrupts in a burst).
RandomVar *burst_lenght;
/// Counts the number of activations in the burst
int count;
/// max number of activations in this round
int max_act;
public:
/// Trigger Event
GEvent<Interrupt> triggerEvt;
/**
Constructor
@param iat interarrival time btw bursts
@param burstperiod minimum interval btw consecutive interrupts
@param burstlenght number of consecutive instances in a burst
@param name the name of the interrupt
*/
Interrupt(RandomVar *iat,
int burstperiod = 1,
RandomVar *burstlenght = NULL, const char *name="");
~Interrupt();
/// add a task to the interrupt activation list
void addTask(Task *t);
/**
Called by the trigger event. Activates the tasks and posts the
trigger event again.
*/
void onTrigger(Event *);
void newRun();
void endRun();
};
} // namespace RTSim
#endif
| 28.361905 | 77 | 0.543318 | [
"vector"
] |
1bf295a9cd54c419b18c3362fd1b8b9fc469ac78 | 21,698 | cpp | C++ | native/src/Participant.cpp | tha061/DataRing | 4ae8466777c5a882b53b387b282ded94aca500e9 | [
"MIT"
] | null | null | null | native/src/Participant.cpp | tha061/DataRing | 4ae8466777c5a882b53b387b282ded94aca500e9 | [
"MIT"
] | null | null | null | native/src/Participant.cpp | tha061/DataRing | 4ae8466777c5a882b53b387b282ded94aca500e9 | [
"MIT"
] | null | null | null | #include "Participant.h"
#include "../public_func.h"
/**
* @file Participant.cpp
* @brief Implementation of Participant's functionality
* @author Tham Nguyen tham.nguyen@mq.edu.au, Nam Bui, Data Ring
* @date April 2020
*/
Participant::Participant()
{
size_dataset = 0;
}
Participant::Participant(string data_dir)
{
size_dataset = 0;
DATA_DIR = data_dir; //dataset directory
}
static int _getRandomInRange(int min, int max)
{
return min + (rand() % (max - min + 1));
}
string getDummyDomain()
{
const int MAX_COL_1 = 40000;
const int MIN_COL_1 = 1000;
const int MAX_COL_2 = 40000;
const int MIN_COL_2 = 1000;
const int MAX_COL_3 = 40000;
const int MIN_COL_3 = 0;
const float MAX_COL_4 = 110000000.0;
const float MIN_COL_4 = 0.0;
const int DISTINCT_COL_5 = 2;
const int DISTINCT_COL_7 = 7;
const int DISTINCT_COL_8 = 12;
const int DISTINCT_COL_9 = 3;
const int DISTINCT_COL_10 = 6;
int col1 = _getRandomInRange(MIN_COL_1, MAX_COL_1);
int col2 = _getRandomInRange(MIN_COL_2, MAX_COL_2);
int col3 = _getRandomInRange(MIN_COL_3, MAX_COL_3);
float col4 = 0.0 + static_cast<float>(rand()) / (static_cast<float>(RAND_MAX / (110000000.0 - 0.0)));
int col5 = _getRandomInRange(0, DISTINCT_COL_5 - 1);
float col6 = 5.31 + static_cast<float>(rand()) / (static_cast<float>(RAND_MAX / (30.99 - 5.31)));
int col7 = _getRandomInRange(0, DISTINCT_COL_7 - 1);
int col8 = _getRandomInRange(-1, 10);
int col9 = _getRandomInRange(0, DISTINCT_COL_9 - 1);
int col10 = _getRandomInRange(0, DISTINCT_COL_10 - 1);
string dummy_domain = to_string(col1) + " " + to_string(col2) + " " + to_string(col3) + " " + to_string(col4) + " " + to_string(col5) + " " + to_string(col6) + " " + to_string(col7) + " " + to_string(col8) + " " + to_string(col9) + " " + to_string(col10);
return dummy_domain;
}
// Participant Generates original Histogram
void Participant::create_OriginalHistogram(int dataset_size, int domainCoefficient)
{
std::ifstream data(DATA_DIR);
if (!data.is_open())
{
cout << "Original File is not defined" << endl;
std::exit(EXIT_FAILURE);
}
int i = 0;
std::string str;
std::getline(data, str); // skip the first line
while (!data.eof())
{
if (i >= dataset_size)
{
break;
}
getline(data, str);
if (str.empty())
{
continue;
}
string id, name;
int count;
istringstream iss(str);
getline(iss, id, ',');
// cout<<"id = "<<id<<endl;
getline(iss, name, ',');
// cout<<"name = "<<name<<endl;
iss >> count;
// cout<<"count = "<<count<<endl;
string id_domain = id + " " + name;
histogram.insert({make_pair(id, name), count});
i++;
}
for (hash_pair_map::iterator itr = histogram.begin(); itr != histogram.end(); ++itr)
{
size_dataset += itr->second;
}
int domain_size = histogram.size();
// cout << "Size of original histogram: " << domain_size << endl;
int Histo_size = domainCoefficient * size_dataset;
int dummy_id = size_dataset;
while (histogram.size() < Histo_size)
{
string dummy_domain = getDummyDomain();
histogram.insert({make_pair(to_string(dummy_id), dummy_domain), 0}); //honest Histogram: dummy are bin 0s, insert to a map
dummy_id++;
}
}
void Participant::addDummy_FakeHist_random(int keepDomainS, int factorSize)
{
fake_histogram = histogram; //added by Tham
int replaceDomainS = size_dataset - keepDomainS;
int Histo_size = factorSize * size_dataset;
int replace_counter = 0;
while (replace_counter < replaceDomainS)
{
int random_id = _getRandomInRange(size_dataset, Histo_size - 1);
hash_pair_map::iterator find = fake_histogram.find({to_string(random_id), ""});
if (find != fake_histogram.end() && find->second == 0)
{
find->second = 1;
replace_counter++;
}
}
replace_counter = 0;
while (replace_counter < replaceDomainS)
{
int random_id = _getRandomInRange(0, size_dataset - 1);
hash_pair_map::iterator find = fake_histogram.find({to_string(random_id), ""});
if (find != fake_histogram.end() && find->second == 1)
{
find->second = 0;
replace_counter++;
}
}
}
// Dishonest participant makes a histogram of (1+scaled_up)*n bins "1"
void Participant::addDummy_ones_FakeHistogram(int factorSize, float adding_ones)
{
fake_histogram = histogram;
int Histo_size = factorSize * size_dataset;
int replace_counter = 0;
int adding_ones_num = int(adding_ones*size_dataset);
int random_id = size_dataset;
while(replace_counter < adding_ones_num)
{
hash_pair_map::iterator find = fake_histogram.find({to_string(random_id), ""});
if (find != fake_histogram.end() && find->second == 0)
{
find->second = 1;
replace_counter++;
random_id++;
}
}
}
void Participant::computeAnswer_opt(ENC_DOMAIN_MAP &enc_question_map, gamal_ciphertext_t sum_cipher, hash_pair_map hist, gamal_key_t &coll_key, float epsilon_i)
{
gamal_ciphertext_t tmp, mul_tmp;
gamal_cipher_new(tmp);
gamal_cipher_new(mul_tmp);
gamal_encrypt(sum_cipher, coll_key, 0);
int count = 0;
for(hash_pair_map::iterator itr = hist.begin(); itr != hist.end(); itr++)
{
id_domain_pair domain_pair = itr->first;
int value = itr->second;
ENC_DOMAIN_MAP::iterator find = enc_question_map.find(domain_pair);
if(find != enc_question_map.end() && value > 0)
{
if(value == 1)
{
tmp->C1 = sum_cipher->C1;
tmp->C2 = sum_cipher->C2;
gamal_add(sum_cipher, tmp, find->second);
count++;
}
else //value >= 2
{
gamal_mult_opt(mul_tmp, find->second, value);
tmp->C1 = sum_cipher->C1;
tmp->C2 = sum_cipher->C2;
gamal_add(sum_cipher, tmp, mul_tmp);
}
}
}
//noise generation
int randomNoise = (int)getLaplaceNoise(sensitivity, epsilon_i);
int randomNoise_to_enc;
if (randomNoise < minNoise)
{
randomNoise = (int)(minNoise);
}
else if (randomNoise > maxNoise)
{
randomNoise = (int)(maxNoise);
}
if(randomNoise < 0)
{
randomNoise_to_enc = -randomNoise;
}
else {
randomNoise_to_enc = randomNoise;
}
gamal_ciphertext_t noiseEnc;
gamal_cipher_new(noiseEnc);
gamal_encrypt(noiseEnc, coll_key, randomNoise_to_enc); //encrypt a positive noise
gamal_cipher_new(tmp);
tmp->C1 = sum_cipher->C1;
tmp->C2 = sum_cipher->C2;
gamal_add(sum_cipher, tmp, noiseEnc);
}
//Compute answer for sum query
void Participant::computeAnswer_sum(ENC_DOMAIN_MAP &enc_question_map, gamal_ciphertext_t sum_cipher, hash_pair_map hist, gamal_key_t &coll_key, float epsilon_i, int attr_to_sum)
{
int counter = 0;
gamal_ciphertext_t tmp, mul_tmp, tmp_mult_attr, cipher_0, cipher_1, mul_tmp2;
gamal_cipher_new(tmp);
gamal_cipher_new(mul_tmp);
gamal_cipher_new(mul_tmp2);
gamal_cipher_new(tmp_mult_attr);
gamal_cipher_new(cipher_0);
gamal_cipher_new(cipher_1);
gamal_encrypt(sum_cipher, coll_key, 0);
gamal_encrypt(cipher_0, coll_key, 0);
gamal_encrypt(cipher_1, coll_key, 1);
int count = 0;
int attr_to_sum_value;
for(hash_pair_map::iterator itr = hist.begin(); itr != hist.end(); itr++)
{
vector<string> col_arr;
id_domain_pair domain_pair = itr->first;
string domain = domain_pair.second;
char delim = ' ';
stringstream ss(domain);
// cout<<"domain ="<<domain<<endl;
string token;
while (getline(ss, token, delim))
{
col_arr.push_back(token);
}
attr_to_sum_value = stoi(col_arr[attr_to_sum]);
if (attr_to_sum_value == 0 || attr_to_sum_value == 1)
{
cout<<"attr_to_sum_value = "<<attr_to_sum_value<<endl;
}
int value = itr->second;
ENC_DOMAIN_MAP::iterator find = enc_question_map.find(domain_pair);
if(find != enc_question_map.end() && value > 0)
{
if(value == 1)
{
tmp->C1 = sum_cipher->C1;
tmp->C2 = sum_cipher->C2;
if (attr_to_sum_value == 0)
{
gamal_add(sum_cipher, tmp, cipher_0);
}
else if (attr_to_sum_value == 1)
{
gamal_add(sum_cipher, tmp, cipher_1);
}
else
{
gamal_mult_opt(tmp_mult_attr, find->second, attr_to_sum_value);
gamal_add(sum_cipher, tmp, tmp_mult_attr);
}
count++;
}
else //value >= 2
{
tmp->C1 = sum_cipher->C1;
tmp->C2 = sum_cipher->C2;
if (attr_to_sum_value == 0)
{
gamal_add(sum_cipher, tmp, cipher_0);
}
else if (attr_to_sum_value == 1)
{
gamal_mult_opt(mul_tmp2, find->second, value); //attr_to_sum_value = 1
gamal_add(sum_cipher, tmp, mul_tmp2);
}
else
{
gamal_mult_opt(mul_tmp, find->second, value);
gamal_mult_opt(find->second, find->second, attr_to_sum_value);
gamal_add(sum_cipher, tmp, mul_tmp);
}
}
}
}
//noise generation
int randomNoise = (int)getLaplaceNoise(sensitivity, epsilon_i);
int randomNoise_to_enc;
if (randomNoise < minNoise)
{
randomNoise = (int)(minNoise);
}
else if (randomNoise > maxNoise)
{
randomNoise = (int)(maxNoise);
}
if(randomNoise < 0)
{
randomNoise_to_enc = -randomNoise;
}
else {
randomNoise_to_enc = randomNoise;
}
gamal_ciphertext_t noiseEnc;
gamal_cipher_new(noiseEnc);
gamal_encrypt(noiseEnc, coll_key, randomNoise_to_enc);
gamal_cipher_new(tmp);
tmp->C1 = sum_cipher->C1;
tmp->C2 = sum_cipher->C2;
gamal_add(sum_cipher, tmp, noiseEnc);
}
// Generate a permutation of the domain
void Participant::getPermutationOfHistogram(vector<string> public_data_domain, vector<int> flag)
{
int index=0;
string temp;
vector<string> public_data_domain_temp = public_data_domain;
while (public_data_domain_temp.size())
{
temp=getString(public_data_domain_temp);
string id, name;
istringstream iss(temp);
getline(iss, id, ' ');
getline(iss, name);
map_public_data_domain_permute.insert({make_pair(id, name), index}); //keep this for un-permutation vector generation
map_public_data_domain_permute_to_send_flag.insert({make_pair(id, name), flag[index]});//send this to S1: id,label and corresponding flag
index++;
}
}
// Generate permutation and corresponding inverse permutation vector
void Participant::getInversePermutationVector(vector<string> public_data_domain, hash_pair_map map_public_data_domain_permute)
{
vector<string> public_data_domain_permute_sort(map_public_data_domain_permute.size());
vector<int> match_back_to_public_data_domain(map_public_data_domain_permute.size());
int i =0;
for (hash_pair_map::iterator itr = map_public_data_domain_permute.begin(); itr != map_public_data_domain_permute.end(); ++itr) {
public_data_domain_permute_sort[i] = itr->first.first;//just for check bug
match_back_to_public_data_domain[i] = itr->second; //take this to get the un-permute vector
i++;
}
//inverse permutation vector generation
for (int i=0; i<map_public_data_domain_permute.size(); i++)
{
int ind = match_back_to_public_data_domain[i];
vector_un_permute_sort[i] = public_data_domain[ind];
}
}
static void _printEncData(int index, gamal_ciphertext_t *enc_list)
{
extern EC_GROUP *init_group;
BIGNUM *x = BN_new();
BIGNUM *y = BN_new();
cout << "Print encryption of row index" << index << endl;
printf("encryption of row index #%d->C1:\n", index);
if (EC_POINT_get_affine_coordinates_GFp(init_group, enc_list[index]->C1, x, y, NULL))
{
BN_print_fp(stdout, x);
putc('\n', stdout);
BN_print_fp(stdout, y);
putc('\n', stdout);
}
else
{
std::cerr << "Can't get point coordinates." << std::endl;
}
printf("\n");
printf("encryption of row index #%d->C2:\n", index);
if (EC_POINT_get_affine_coordinates_GFp(init_group, enc_list[index]->C2, x, y, NULL))
{
BN_print_fp(stdout, x);
putc('\n', stdout);
BN_print_fp(stdout, y);
putc('\n', stdout);
}
else
{
std::cerr << "Can't get point coordinates." << std::endl;
}
printf("\n");
}
void Participant::print_Histogram(string filename, hash_pair_map histo)
{
cout << "\nPrint Histogram\n";
int i = 0;
hash_pair_map::iterator itr;
stringstream ss;
fstream fout;
ss << filename <<".csv";
fout.open(ss.str().c_str(),ios::out | ios::app);
for (itr = histo.begin(); itr != histo.end(); ++itr)
{
fout << itr->first.first << "|" << itr->first.second << "|" << itr->second << endl;
}
fout.close();
}
void _printCiphertext(gamal_ciphertext_ptr ciphertext)
{
extern EC_GROUP *init_group;
BIGNUM *x = BN_new();
BIGNUM *y = BN_new();
if (EC_POINT_get_affine_coordinates_GFp(init_group, ciphertext->C1, x, y, NULL))
{
BN_print_fp(stdout, x);
putc('\n', stdout);
BN_print_fp(stdout, y);
putc('\n', stdout);
}
else
{
std::cerr << "Can't get point coordinates." << std::endl;
}
printf("\n");
if (EC_POINT_get_affine_coordinates_GFp(init_group, ciphertext->C2, x, y, NULL))
{
BN_print_fp(stdout, x);
putc('\n', stdout);
BN_print_fp(stdout, y);
putc('\n', stdout);
}
else
{
std::cerr << "Can't get point coordinates." << std::endl;
}
printf("\n");
}
/////////////////////////////// added Oct 2020
void Participant::get_data_domain_and_data_flag(hash_pair_map hist)
{
int it =0;
for (hash_pair_map::iterator itr = hist.begin(); itr != hist.end(); ++itr)
{
vector_endcoded_label[it] = itr->first.first + ' ' + itr->first.second;
vector_flag[it] = itr->second;
it++;
}
}
void Participant::prepare_Real_Query(ENC_Stack &pre_enc_stack, vector<string> public_data_domain)
{
enc_real_query_map_pre.clear();
for (int i=0; i <= public_data_domain.size()-1; i++)
{
// cout<<"test prep real OK where i = "<< i<<endl;
string id, name;
istringstream iss(public_data_domain[i]);
getline(iss, id, ' ');
getline(iss, name);
gamal_ciphertext_t *enc_0 = new gamal_ciphertext_t[1];
pre_enc_stack.pop_E0(enc_0[0]);
enc_real_query_map_pre.insert({make_pair(id, name), enc_0[0]});
}
// // for (int i=0; i<1; i++)
// // {
// // cout<<"test ok" <<endl;
// // ENC_DOMAIN_MAP::iterator itr = party_enc_real_query_map_pre.begin();
// // cout<<itr->first.first<<endl;
// // cout<<itr->first.second<<endl;
// // cout<<itr->second<<endl;
// // cout<<"test ok" <<endl;
// // }
// int i =0;
// for (ENC_DOMAIN_MAP::iterator itr = party_enc_real_query_map_pre.begin(); itr != party_enc_real_query_map_pre.end(); itr++)
// {
// // cout<<"test ok" <<endl;
// // ENC_DOMAIN_MAP::iterator itr = party_enc_real_query_map_pre.begin();
// cout<<itr->first.first<<endl;
// cout<<itr->first.second<<endl;
// cout<<itr->second<<endl;
// // cout<<"test ok" <<endl;
// }
}
void Participant::matchDomainForQuery(string query_directory)
{
map<int, string> columns_map;
//gen test estimation function
std::ifstream data(query_directory);
if (!data.is_open())
{
cout << "Query File is not defined" << endl;
std::exit(EXIT_FAILURE);
}
std::string str;
std::getline(data, str); // skip the first line
while (!data.eof())
{
getline(data, str);
if (str.empty())
{
continue;
}
string value;
int col_id;
istringstream iss(str);
getline(iss, value, ',');
iss >> col_id;
columns_map.insert({col_id, value});
// cout<<"col_id = " <<col_id<<endl;
// cout<<"value = "<<value<<endl;
}
matching_query_domain_vec.clear();
int counter = 0;
int no_match =0;
// cout<<"i = "<<i<<endl;
int i=0;
for (ENC_DOMAIN_MAP::iterator itr = enc_real_query_map_pre.begin(); itr != enc_real_query_map_pre.end(); itr++)
{
i++;
// cout<<"test ok" <<endl;
bool match = true;
// cout<<itr->first.first<<"\t"<<itr->first.second<<endl;
// cout<<itr->first.second<<endl;
// cout<<itr->second<<endl;
vector<string> col_arr;
id_domain_pair domain_pair = itr->first;
string domain = domain_pair.second;
char delim = ' ';
stringstream ss(domain);
string token;
while (getline(ss, token, delim))
{
col_arr.push_back(token);
}
for (map<int, string>::iterator colItr = columns_map.begin(); colItr != columns_map.end(); colItr++)
{
vector<string> query_arr;
string query = colItr->second;
char delim = ' ';
stringstream ss(query);
string token;
while (getline(ss, token, delim))
{
query_arr.push_back(token);
}
int col_index = colItr->first;
int col_value_int_min = stoi(query_arr[0]);
int col_value_int_max = stoi(query_arr[1]);
int o_col_value_int = stoi(col_arr[col_index]);
//matched when in a range
if (o_col_value_int < col_value_int_min || o_col_value_int > col_value_int_max)
{
match = false;
no_match++;
break;
}
}
if (match)
{
matching_query_domain_vec.push_back(domain_pair);
counter++;
}
}
// cout<<"i = "<<i<<endl;
// cout<<"no of o_match = "<<no_match<<endl;
}
void Participant::generate_Real_Query(ENC_Stack &pre_enc_stack)
{
enc_real_query_map.clear();
enc_real_query_map = enc_real_query_map_pre;
gamal_ciphertext_t encrypt_1;
gamal_cipher_new(encrypt_1);
pre_enc_stack.pop_E1(encrypt_1);
int counter = 0;
for (int i = 0; i < matching_query_domain_vec.size(); i++)
{
id_domain_pair match_domain = matching_query_domain_vec[i];
ENC_DOMAIN_MAP::iterator find = enc_real_query_map.find(match_domain);
if (find != enc_real_query_map.end())
{
counter++;
gamal_add(find->second, find->second, encrypt_1);
}
}
}
int Participant::generate_Real_Query_sum(ENC_Stack &pre_enc_stack, int index_attr_to_sum)
{
enc_real_query_map.clear();
enc_real_query_map = enc_real_query_map_pre;
gamal_ciphertext_t encrypt_1;
gamal_cipher_new(encrypt_1);
pre_enc_stack.pop_E1(encrypt_1);
int counter = 0;
for (int i = 0; i < matching_query_domain_vec.size(); i++)
{
id_domain_pair match_domain = matching_query_domain_vec[i];
ENC_DOMAIN_MAP::iterator find = enc_real_query_map.find(match_domain);
if (find != enc_real_query_map.end())
{
counter++;
gamal_add(find->second, find->second, encrypt_1);
}
}
party_index_attr_sum = index_attr_to_sum;
return party_index_attr_sum;
}
| 27.640764 | 260 | 0.555212 | [
"vector"
] |
1bf39eb5b0843868172d245804f28cdb338db35e | 3,048 | cpp | C++ | src/old/VX_MaterialVoxel.cpp | mertan-a/voxcraft-sim | dfb61f7c8fcc1a4f9277d2fcd98f721d2a6adbf1 | [
"CC0-1.0"
] | 26 | 2020-06-27T23:44:45.000Z | 2022-02-19T22:31:10.000Z | src/old/VX_MaterialVoxel.cpp | mertan-a/voxcraft-sim | dfb61f7c8fcc1a4f9277d2fcd98f721d2a6adbf1 | [
"CC0-1.0"
] | 40 | 2020-06-22T19:42:47.000Z | 2021-11-08T15:16:57.000Z | src/old/VX_MaterialVoxel.cpp | mertan-a/voxcraft-sim | dfb61f7c8fcc1a4f9277d2fcd98f721d2a6adbf1 | [
"CC0-1.0"
] | 9 | 2020-06-05T16:12:15.000Z | 2021-12-01T07:07:55.000Z | /*******************************************************************************
Copyright (c) 2015, Jonathan Hiller
To cite academic use of Voxelyze: Jonathan Hiller and Hod Lipson "Dynamic Simulation of Soft Multimaterial 3D-Printed Objects" Soft Robotics. March 2014, 1(1): 88-101.
Available at http://online.liebertpub.com/doi/pdfplus/10.1089/soro.2013.0010
This file is part of Voxelyze.
Voxelyze is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Voxelyze is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
See <http://www.opensource.org/licenses/lgpl-3.0.html> for license details.
*******************************************************************************/
#include "VX_MaterialVoxel.h"
#include <assert.h>
CVX_MaterialVoxel::CVX_MaterialVoxel(float youngsModulus, float density, double nominalSize) : CVX_Material(youngsModulus, density)
{
initialize(nominalSize);
}
CVX_MaterialVoxel::CVX_MaterialVoxel(rapidjson::Value& mat, double nominalSize) : CVX_Material(mat)
{
initialize(nominalSize);
}
CVX_MaterialVoxel::CVX_MaterialVoxel(const CVX_Material& mat, double nominalSize) : CVX_Material(mat)
{
initialize(nominalSize);
}
void CVX_MaterialVoxel::initialize(double nominalSize)
{
nomSize = nominalSize;
gravMult = 0.0f;
updateDerived();
}
CVX_MaterialVoxel& CVX_MaterialVoxel::operator=(const CVX_MaterialVoxel& vIn)
{
CVX_Material::operator=(vIn); //set base CVX_Material class variables equal
nomSize=vIn.nomSize;
gravMult=vIn.gravMult;
_eHat = vIn._eHat;
_mass=vIn._mass;
_massInverse=vIn._massInverse;
_sqrtMass=-vIn._sqrtMass;
_firstMoment=vIn._firstMoment;
_momentInertia=vIn._momentInertia;
_momentInertiaInverse=vIn._momentInertiaInverse;
_2xSqMxExS=vIn._2xSqMxExS;
_2xSqIxExSxSxS=vIn._2xSqIxExSxSxS;
return *this;
}
bool CVX_MaterialVoxel::updateDerived()
{
CVX_Material::updateDerived(); //update base CVX_Material class derived variables
double volume = nomSize*nomSize*nomSize;
_mass = (float)(volume*rho);
_momentInertia = (float)(_mass*nomSize*nomSize / 6.0f); //simple 1D approx
_firstMoment = (float)(_mass*nomSize / 2.0f);
if (volume==0 || _mass==0 || _momentInertia==0){
_massInverse = _sqrtMass = _momentInertiaInverse = _2xSqMxExS = _2xSqIxExSxSxS = 0.0f; //zero everything out
return false;
}
_massInverse = 1.0f / _mass;
_sqrtMass = sqrt(_mass);
_momentInertiaInverse = 1.0f / _momentInertia;
_2xSqMxExS = (float)(2.0f*sqrt(_mass*E*nomSize));
_2xSqIxExSxSxS = (float)(2.0f*sqrt(_momentInertia*E*nomSize*nomSize*nomSize));
return true;
}
bool CVX_MaterialVoxel::setNominalSize(double size)
{
if (size <= 0) size = FLT_MIN;
nomSize=size;
return updateDerived(); //update derived quantities
} | 35.034483 | 242 | 0.73458 | [
"3d"
] |
1bf634093772e29fcfc4b850c7672460e45075aa | 2,230 | cpp | C++ | Sources/Internal/Scene3D/Systems/LightUpdateSystem.cpp | Serviak/dava.engine | d51a26173a3e1b36403f846ca3b2e183ac298a1a | [
"BSD-3-Clause"
] | 1 | 2020-11-14T10:18:24.000Z | 2020-11-14T10:18:24.000Z | Sources/Internal/Scene3D/Systems/LightUpdateSystem.cpp | Serviak/dava.engine | d51a26173a3e1b36403f846ca3b2e183ac298a1a | [
"BSD-3-Clause"
] | null | null | null | Sources/Internal/Scene3D/Systems/LightUpdateSystem.cpp | Serviak/dava.engine | d51a26173a3e1b36403f846ca3b2e183ac298a1a | [
"BSD-3-Clause"
] | 1 | 2020-09-05T21:16:17.000Z | 2020-09-05T21:16:17.000Z | #include "Scene3D/Systems/LightUpdateSystem.h"
#include "Scene3D/Entity.h"
#include "Scene3D/Components/LightComponent.h"
#include "Scene3D/Components/TransformComponent.h"
#include "Scene3D/Components/SingleComponents/TransformSingleComponent.h"
#include "Render/Highlevel/Frustum.h"
#include "Render/Highlevel/Camera.h"
#include "Render/Highlevel/Landscape.h"
#include "Render/Highlevel/RenderLayer.h"
#include "Render/Highlevel/RenderPass.h"
#include "Render/Highlevel/RenderBatch.h"
#include "Render/Highlevel/RenderSystem.h"
#include "Scene3D/Scene.h"
#include "Time/SystemTimer.h"
namespace DAVA
{
LightUpdateSystem::LightUpdateSystem(Scene* scene)
: SceneSystem(scene)
{
}
void LightUpdateSystem::Process(float32 timeElapsed)
{
TransformSingleComponent* tsc = GetScene()->transformSingleComponent;
for (auto& pair : tsc->worldTransformChanged.map)
{
if (pair.first->GetComponentsCount(Component::LIGHT_COMPONENT) > 0)
{
for (Entity* entity : pair.second)
{
RecalcLight(entity);
}
}
}
}
void LightUpdateSystem::RecalcLight(Entity* entity)
{
// Update new transform pointer, and mark that transform is changed
Matrix4* worldTransformPointer = (static_cast<TransformComponent*>(entity->GetComponent(Component::TRANSFORM_COMPONENT)))->GetWorldTransformPtr();
Light* light = (static_cast<LightComponent*>(entity->GetComponent(Component::LIGHT_COMPONENT)))->GetLightObject();
light->SetPositionDirectionFromMatrix(*worldTransformPointer);
entity->GetScene()->renderSystem->MarkForUpdate(light);
}
void LightUpdateSystem::AddEntity(Entity* entity)
{
Light* lightObject = (static_cast<LightComponent*>(entity->GetComponent(Component::LIGHT_COMPONENT)))->GetLightObject();
if (!lightObject)
return;
entityObjectMap.insert(entity, lightObject);
GetScene()->GetRenderSystem()->AddLight(lightObject);
RecalcLight(entity);
}
void LightUpdateSystem::RemoveEntity(Entity* entity)
{
Light* lightObject = entityObjectMap.at(entity);
if (!lightObject)
{
return;
}
GetScene()->GetRenderSystem()->RemoveLight(lightObject);
entityObjectMap.erase(entity);
}
}; | 31.408451 | 150 | 0.730942 | [
"render",
"transform"
] |
400c803e3f088a8389a9991e2b9ebb1a241f91c9 | 830 | cpp | C++ | src/2000/2629.cpp17.cpp | upple/BOJ | e6dbf9fd17fa2b458c6a781d803123b14c18e6f1 | [
"MIT"
] | 8 | 2018-04-12T15:54:09.000Z | 2020-06-05T07:41:15.000Z | src/2000/2629.cpp17.cpp | upple/BOJ | e6dbf9fd17fa2b458c6a781d803123b14c18e6f1 | [
"MIT"
] | null | null | null | src/2000/2629.cpp17.cpp | upple/BOJ | e6dbf9fd17fa2b458c6a781d803123b14c18e6f1 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
vector<int> c;
bool dp[40001];
int main()
{
int n;
cin>>n;
c.resize(n);
for(int i=0; i<n; i++)
{
cin>>c[i];
}
dp[0]=1;
queue<int> Q;
Q.push(0);
for(int i=0; i<n; i++)
{
for(int size=Q.size(); size--;)
{
int cur=Q.front();
Q.pop();
Q.push(cur);
if(cur+c[i]>40000|| dp[cur+c[i]]) continue;
dp[cur+c[i]]=1;
Q.push(cur+c[i]);
}
}
int m;
cin>>m;
while(m--)
{
int x;
cin>>x;
queue<int> Q;
bool v[40001]={};
Q.push(x);
v[x]=1;
for(int i=0; i<n; i++)
{
for(int size=Q.size(); size--;)
{
int cur=Q.front();
Q.pop();
Q.push(cur);
if(dp[cur])
{
cout<<"Y ";
goto out;
}
if(cur+c[i]>40000 || v[cur+c[i]]) continue;
v[cur+c[i]]=1;
Q.push(cur+c[i]);
}
}
cout<<"N ";
out:;
}
} | 13.174603 | 47 | 0.463855 | [
"vector"
] |
400fd1f76d65ba6657140e92458eadca2d21e164 | 2,212 | cpp | C++ | Codeforces/1401/d.cpp | eyangch/competitive-programming | 59839efcec72cb792e61b7d316f83ad54f16a166 | [
"MIT"
] | 14 | 2019-08-14T00:43:10.000Z | 2021-12-16T05:43:31.000Z | Codeforces/1401/d.cpp | eyangch/competitive-programming | 59839efcec72cb792e61b7d316f83ad54f16a166 | [
"MIT"
] | null | null | null | Codeforces/1401/d.cpp | eyangch/competitive-programming | 59839efcec72cb792e61b7d316f83ad54f16a166 | [
"MIT"
] | 6 | 2020-12-30T03:30:17.000Z | 2022-03-11T03:40:02.000Z | #include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
template <typename T1, typename T2>
ostream &operator <<(ostream &os, pair<T1, T2> p){os << p.first << " " << p.second; return os;}
template <typename T>
ostream &operator <<(ostream &os, vector<T> &v){for(T i : v)os << i << ", "; return os;}
template <typename T>
ostream &operator <<(ostream &os, set<T> s){for(T i : s) os << i << ", "; return os;}
template <typename T1, typename T2>
ostream &operator <<(ostream &os, map<T1, T2> m){for(pair<T1, T2> i : m) os << i << endl; return os;}
ll MOD = 1e9+7;
ll N, M, p[105000], children[105000];
vi graph[105000];
ll dfs(ll idx, ll par){
ll c = 0;
for(ll i : graph[idx]){
if(i != par){
c += dfs(i, idx);
}
}
c++;
children[idx] = c;
return c;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll T; cin >> T;
for(ll tc = 1; tc <= T; tc++){
cin >> N;
for(ll i = 0; i < N; i++){
graph[i].clear();
}
for(ll i = 0; i < N-1; i++){
ll u, v; cin >> u >> v;
graph[u-1].push_back(v-1);
graph[v-1].push_back(u-1);
}
cin >> M;
for(ll i = 0; i < M; i++){
cin >> p[i];
}
sort(p, p+M);
dfs(0, -1);
vi trav;
for(ll i = 0; i < N; i++){
for(ll j : graph[i]){
if(children[i] > children[j]){
trav.push_back((N-children[j]) * children[j]);
}
}
}
sort(trav.begin(), trav.end());
ll ptr = 0;
ll ans = 0;
while(M < (ll)trav.size() - ptr){
ptr++;
}
for(ll i = 0; ptr + i < (ll)trav.size(); i++){
trav[ptr+i] *= p[i];
trav[ptr+i] %= MOD;
}
for(ll i = (ll)trav.size(); i < M; i++){
trav[(ll)trav.size()-1] *= p[i];
trav[(ll)trav.size()-1] %= MOD;
}
for(ll i : trav){
ans += i;
ans %= MOD;
}
cout << ans << endl;
}
return 0;
}
| 25.425287 | 101 | 0.438969 | [
"vector"
] |
4017faa2047d76983e93d46bd3bc411c0c40fa6d | 584 | cpp | C++ | LeetCode/970.cpp | LauZyHou/- | 66c047fe68409c73a077eae561cf82b081cf8e45 | [
"MIT"
] | 7 | 2019-02-25T13:15:00.000Z | 2021-12-21T22:08:39.000Z | LeetCode/970.cpp | LauZyHou/- | 66c047fe68409c73a077eae561cf82b081cf8e45 | [
"MIT"
] | null | null | null | LeetCode/970.cpp | LauZyHou/- | 66c047fe68409c73a077eae561cf82b081cf8e45 | [
"MIT"
] | 1 | 2019-04-03T06:12:46.000Z | 2019-04-03T06:12:46.000Z | class Solution {
public:
int pow(int x,int k) {
int ret = 1;
for(int i=0;i<k;i++)
ret = ret*x;
return ret;
}
vector<int> powerfulIntegers(int x, int y, int bound) {
//bound最大1000000
//2的20次方大于这个数
int xval, yval;
set<int> st;
for(int i=0;i<20 && (xval=pow(x,i))<bound;i++)
for(int j=0;j<20 && (yval=pow(y,j))<bound;j++) {
int val = xval + yval;
if(val<=bound)
st.insert(val);
}
set<int>::iterator it;
vector<int> ans;
for(it=st.begin();it!=st.end();it++) {
ans.push_back(*it);
}
sort(ans.begin(),ans.end());
return ans;
}
}; | 20.137931 | 59 | 0.563356 | [
"vector"
] |
401860c57a4ad0c308f14f11c3b2366924d112ec | 2,966 | hpp | C++ | caffe/include/caffe/util/octree_parser.hpp | pauldinh/O-CNN | fecefd92b559bdfe94a3983b2b010645167c41a1 | [
"MIT"
] | 299 | 2019-05-27T02:18:56.000Z | 2022-03-31T15:29:20.000Z | caffe/include/caffe/util/octree_parser.hpp | pauldinh/O-CNN | fecefd92b559bdfe94a3983b2b010645167c41a1 | [
"MIT"
] | 100 | 2019-05-07T03:17:01.000Z | 2022-03-30T09:02:04.000Z | caffe/include/caffe/util/octree_parser.hpp | pauldinh/O-CNN | fecefd92b559bdfe94a3983b2b010645167c41a1 | [
"MIT"
] | 84 | 2019-05-17T17:44:06.000Z | 2022-02-14T04:32:02.000Z | #ifndef CAFFE_UTIL_OCTREE_PARSER_
#define CAFFE_UTIL_OCTREE_PARSER_
#include <vector>
#include <string>
#include "caffe/util/octree_info.hpp"
using std::vector;
using std::string;
namespace caffe {
class OctreeParser {
public:
typedef unsigned int uint32;
typedef unsigned long long uint64;
typedef OctreeInfo::PropType PropType;
enum NodeType {kNonEmptyLeaf = -2, kLeaf = -1, kInternelNode = 0 };
public:
OctreeParser() : h_metadata_(nullptr), d_metadata_(nullptr),
info_(nullptr), const_ptr_(true), info_buffer_() {}
void set_cpu(const void* ptr);
void set_gpu(const void* ptr, const void* oct_info = nullptr);
void set_cpu(void* ptr, OctreeInfo* octinfo = nullptr);
void set_gpu(void* ptr, OctreeInfo* octinfo = nullptr);
const OctreeInfo& info() const { return *info_; }
OctreeInfo& mutable_info() { return *info_; }
NodeType node_type(const int t) const;
bool is_empty() const { return info_ == nullptr; }
const char* ptr_cpu(const PropType ptype, const int depth) const;
const unsigned int* key_cpu(const int depth) const;
const int* children_cpu(const int depth) const;
const int* neighbor_cpu(const int depth) const;
const float* feature_cpu(const int depth) const;
const float* label_cpu(const int depth) const;
const float* split_cpu(const int depth) const;
const char* ptr_gpu(const PropType ptype, const int depth) const;
const unsigned int* key_gpu(const int depth) const;
const int* children_gpu(const int depth) const;
const int* neighbor_gpu(const int depth) const;
const float* feature_gpu(const int depth) const;
const float* label_gpu(const int depth) const;
const float* split_gpu(const int depth) const;
char* mutable_ptr_cpu(const PropType ptype, const int depth);
unsigned int* mutable_key_cpu(const int depth);
int* mutable_children_cpu(const int depth);
int* mutable_neighbor_cpu(const int depth);
float* mutable_feature_cpu(const int depth);
float* mutable_label_cpu(const int depth);
float* mutable_split_cpu(const int depth);
char* mutable_ptr_gpu(const PropType ptype, const int depth);
unsigned int* mutable_key_gpu(const int depth);
int* mutable_children_gpu(const int depth);
int* mutable_neighbor_gpu(const int depth);
float* mutable_feature_gpu(const int depth);
float* mutable_label_gpu(const int depth);
float* mutable_split_gpu(const int depth);
protected:
// Caveat: for the following to functions, pt and depth
// must be consistent, i.e pt must be in the range [0, 2^depth]^3
// compute the key for the sepcified point
void compute_key(uint32& key, const uint32* pt, const int depth);
// compute the point coordinate given the key
void compute_pt(uint32* pt, const uint32& key, const int depth);
protected:
// original pointer
char* h_metadata_;
char* d_metadata_;
OctreeInfo* info_;
bool const_ptr_;
private:
OctreeInfo info_buffer_;
};
} // namespace caffe
#endif // CAFFE_UTIL_OCTREE_PARSER_ | 33.704545 | 69 | 0.74646 | [
"vector"
] |
40195378b453dffb604f8271d171ef8cc8e3fb03 | 17,404 | cpp | C++ | neon/Helium/HeliumForWindows/Implementation/Plugins/PB_ImageCapture_PLG/PBPlugin.cpp | mensfeld/rhodes | 2962610a314ed563a0b7c83fcae6136913a1b033 | [
"MIT"
] | 173 | 2015-01-02T11:14:08.000Z | 2022-03-05T09:54:54.000Z | neon/Helium/HeliumForWindows/Implementation/Plugins/PB_ImageCapture_PLG/PBPlugin.cpp | mensfeld/rhodes | 2962610a314ed563a0b7c83fcae6136913a1b033 | [
"MIT"
] | 263 | 2015-01-05T04:35:22.000Z | 2021-09-07T06:00:02.000Z | neon/Helium/HeliumForWindows/Implementation/Plugins/PB_ImageCapture_PLG/PBPlugin.cpp | watusi/rhodes | 07161cca58ff6a960bbd1b79b36447b819bfa0eb | [
"MIT"
] | 77 | 2015-01-12T20:57:18.000Z | 2022-02-17T15:15:14.000Z | #include "stdafx.h"
#include "../../common/public/pbplugin.h"
#include <windows.h>
#pragma once
#pragma region ClassMembers
////////////////////////////////////////////////////////////////////////////////
/// Function: PBModule
/// Description: Sets the Module count variable and copies the default name "Abstract" to the object identifier
/// Returns: N/A
/// Author: Paul Henderson
/// Date: May 2009
////////////////////////////////////////////////////////////////////////////////
PBModule::PBModule()
{
m_iLoadCount = 0;
m_pCurrentPBstruct = NULL;///>used to hold the current structure for the global callback functions
_tcscpy(m_szModName,L"Abstract");
m_pInstHead = NULL;
m_hQuitEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
}
////////////////////////////////////////////////////////////////////////////////
/// Function: ~PBModule
/// Description: Destructor not currently used
/// Returns: N/A
/// Author: Paul Henderson
/// Date: May 2009
////////////////////////////////////////////////////////////////////////////////
PBModule::~PBModule()
{
//delete the instance counting memory
deleteInst(m_pInstHead);
CloseHandle(m_hQuitEvent);
}
////////////////////////////////////////////////////////////////////////
/// Function: cmp
/// Description: compares to TCHARs - case insensitive
/// Returns: TRUE if successful
/// Author: Paul Henderson
/// Date: September 2009
////////////////////////////////////////////////////////////////////////
BOOL PBModule::cmp(LPCTSTR tc1, LPCTSTR tc2)
{
if (!tc1 || !tc2)
return false;
return !_wcsicmp(tc1, tc2);
}
BOOL PBModule::Init(PPBCORESTRUCT pPBCoreStructure)
{
m_pCoreStructure = pPBCoreStructure;
return m_pCoreStructure->pCallPlgMethod ? TRUE :FALSE;
}
////////////////////////////////////////////////////////////////////////
/// Function: Preload
/// Description: Sets up the function pointers from the core,
/// maintains a module count and calls onInit() when called for the first time
/// Returns: An enumeration type defined in PBPlugin.h
/// Author: Paul Henderson
/// Date: May 2009
////////////////////////////////////////////////////////////////////////
BOOL PBModule::Preload(PPBSTRUCT pPBStructure, PPBCORESTRUCT pPBCoreStructure)
{
m_pCoreStructure = pPBCoreStructure;
m_pCurrentPBstruct = pPBStructure;
++m_iLoadCount;
PPBINSTSTRUCT pInstStruct = new PBInstStruct;
if(pInstStruct == NULL){
Log(PB_LOG_ERROR,L"Mem allocation",L"Preload",__LINE__);
return FALSE;
}
pInstStruct->instID = pPBStructure->iTabID;
pInstStruct->pWrappedObj = NULL;
pInstStruct->pNext = NULL;
if(m_pInstHead == NULL){
pPBCoreStructure->pLoggingFunc(PB_LOG_INFO,L"First call",L"Preload",__LINE__,m_szModName);
m_pInstHead = pInstStruct;
if(!onInit(pPBStructure)){ ///>let the derived class know about it by calling it's onInit()
pPBCoreStructure->pLoggingFunc(PB_LOG_ERROR,L"Failed to initialise in the derived object",L"Preload",__LINE__,m_szModName);///>log error
return FALSE;
}
}
else{
/**
*
* go through the linked list and look for a match
*/
PPBINSTSTRUCT pInst;
for(pInst = m_pInstHead;pInst->pNext;pInst = pInstStruct->pNext)
{
if(pInst->instID == pPBStructure->iTabID){
pPBCoreStructure->pLoggingFunc(PB_LOG_ERROR,L"Preload called twice same instance",L"Preload",__LINE__,m_szModName);
delete pInstStruct;
return FALSE;
}
}
pInst->pNext = pInstStruct;
}
if(!onAttachInstance(pPBStructure,pInstStruct)){///>let the derived object know about a new PB app instance
Log(PB_LOG_ERROR,L"Failed onAttachInstance in the derived object",L"Preload",__LINE__);///>log error
return FALSE; ///>error the derived function has failed
}
return TRUE;
}
//returns the head of the list
PPBINSTSTRUCT PBModule::dispose(PPBSTRUCT pPBStructure,PPBINSTSTRUCT pInstStruct)
{
PPBINSTSTRUCT pTempInst;
if(pInstStruct == NULL)
return NULL;
if(pInstStruct->instID == pPBStructure->iTabID){
//pInstStruct = dispose(pPBStructure,pInstStruct->pNext);
pTempInst = pInstStruct->pNext;
delete pInstStruct;
return pTempInst;
}
pInstStruct->pNext = dispose(pPBStructure,pInstStruct->pNext);
return pInstStruct;
}
////////////////////////////////////////////////////////////////////////
/// Function: Dispose
/// Description: Calls onDeInit() when the last Dispose has been issued
/// Returns: An enumeration type INITRET defined in PBPlugin.h
/// Author: Paul Henderson
/// Date: May 2009
////////////////////////////////////////////////////////////////////////
INITRET PBModule::Dispose(PPBSTRUCT pPBStructure)
{
PPBINSTSTRUCT pInstStruct,pTempStruct;
--m_iLoadCount;
if(m_pInstHead->instID == pPBStructure->iTabID){
if(!onReleaseInstance(pPBStructure,m_pInstHead)){///>let the derived object know about it
Log(PB_LOG_ERROR,L"Failed onReleaseInstance in the derived object",L"Dispose",__LINE__);///>log error
return FAILED; ///>error the derived function has failed
}
if(m_pInstHead->pNext){
pTempStruct = m_pInstHead->pNext;
delete m_pInstHead;
m_pInstHead = pTempStruct;
}
else{
onDeInit(pPBStructure);
PulseEvent(m_hQuitEvent);
return DEINITIALISED;///>return DEINITIALISED when the last instance has been deleted
}
return OK;
}
for(pInstStruct = m_pInstHead;pInstStruct->pNext;pInstStruct = pInstStruct->pNext)
{
if(pInstStruct->pNext->instID == pPBStructure->iTabID){
///>found a match
if(!onReleaseInstance(pPBStructure,pInstStruct->pNext)){///>let the derived object know about it
Log(PB_LOG_ERROR,L"Failed onReleaseInstance in the derived object",L"Dispose",__LINE__);///>log error
return FAILED; ///>error the derived function has failed
}
pTempStruct = pInstStruct->pNext->pNext;
delete pInstStruct->pNext;
pInstStruct->pNext = pTempStruct;
return OK;
}
}
Log(PB_LOG_ERROR,L"iTabID not found",L"Dispose",__LINE__);///> the tab ID was not found, so log an error
return FAILED;///>
}
////////////////////////////////////////////////////////////////////////
/// Function: Process
/// Description: Calls Metaproc with the correct object pointer.
///
/// Returns: TRUE if successful;
/// Author: Paul Henderson
/// Date: Aug 2009
////////////////////////////////////////////////////////////////////////
BOOL PBModule::Process(PBMetaStruct *pbMetaStructure, PPBSTRUCT pPBStructure)
{
BOOL bOk= FALSE;
if (pPBStructure->hWnd == NULL || pPBStructure->hInstance == NULL)
return FALSE;
m_pCurrentPBstruct = pPBStructure;///>used to hold the current structure for the global callback functions
void *pWrappedpObj = GetObjFromID(pPBStructure->iTabID);
if(pWrappedpObj == NULL)
return FALSE;
return MetaProc(pbMetaStructure,pPBStructure,pWrappedpObj);
}
////////////////////////////////////////////////////////////////////////
BOOL PBModule::ProcessMessage (int appid, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
PPBINSTSTRUCT pInstStruct;
// Notify specified instance
for (pInstStruct = m_pInstHead; pInstStruct; pInstStruct = pInstStruct->pNext)
{
if (pInstStruct->instID == appid)
return onMessage (hwnd, msg, wparam, lparam, pInstStruct->pWrappedObj);
}
return FALSE;
}
////////////////////////////////////////////////////////////////////////
BOOL PBModule::StaticProcessMessage (PBModule *pmodule, int appid, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
return pmodule->ProcessMessage (appid, hwnd, msg, wparam, lparam);
}
////////////////////////////////////////////////////////////////////////////////
// Description: Log the specified message to the logging module via function pointer to the core.
//
// Authors: Paul Henderson
// Change History:
// May 2009 - Initial Revision (PH)
////////////////////////////////////////////////////////////////////////////////
BOOL PBModule::Log(LogTypeInterface logSeverity, LPCTSTR pLogComment,
LPCTSTR pFunctionName, DWORD dwLineNumber)
{
if(m_pCoreStructure->pLoggingFunc){
return m_pCoreStructure->pLoggingFunc(logSeverity,pLogComment,pFunctionName ,dwLineNumber,m_szModName);
}
return FALSE;
}
////////////////////////////////////////////////////////////////////////
/// Function: SendMetaFunc
/// Description: Method that is used when a module sends a meta tag to another module usually contained in another DLL.
/// This version of the overloaded function sets properties in another module, which is why w have a parameter and a value.
/// Returns: TRUE if successful;
/// Author: Paul Henderson
/// Date: May 2009
////////////////////////////////////////////////////////////////////////
BOOL PBModule::SetModProperty(LPCTSTR pTargetMod,LPCTSTR pParam,LPCTSTR pValue)
{
if(m_pCoreStructure->pSetPlugProp)
return m_pCoreStructure->pSetPlugProp(m_pCurrentPBstruct,pTargetMod,pParam,pValue,m_szModName);
return FALSE;
}
////////////////////////////////////////////////////////////////////////
/// Function: SendMetaFunc
/// Description: Method that is used when a module sends a meta tag to another module usually contained in another DLL.
///
/// Returns: TRUE if successful;
/// Author: Paul Henderson
/// Date: May 2009
////////////////////////////////////////////////////////////////////////
BOOL PBModule::CallModMethod(LPCTSTR pTargetMod,LPCTSTR pMethod)
{
if(m_pCoreStructure->pCallPlgMethod)
return m_pCoreStructure->pCallPlgMethod(m_pCurrentPBstruct,pTargetMod,pMethod,m_szModName);
return FALSE;
}
////////////////////////////////////////////////////////////////////////
/// Function: RegisterForMessage
/// Description: Method that is used when a module requests notification of a message from the core.
/// If wparam or lparam is NULL a notification will be received for the message only.
/// This is an asynchronous method that places the message on the core register and returns immediately.
///
/// Returns: TRUE if successful;
/// Author: Paul Henderson
/// Date: May 2009
////////////////////////////////////////////////////////////////////////
BOOL PBModule::RegisterForMessage(HWND hwnd, UINT msg)
{
return RegisterForMessage (this, StaticProcessMessage, m_pCurrentPBstruct->iTabID, hwnd, msg);
}
BOOL PBModule::RegisterForMessage(UINT msg)
{
return RegisterForMessage (m_pCurrentPBstruct->hWnd, msg);
}
////////////////////////////////////////////////////////////////////////
/// Function: PBRegisterForMessage
/// Description: Used when a module requests notification of a message from the core.
/// Can be called from a thread when no this pointer is available to to a specific module.
/// If wparam or lparam is NULL a notification will be received for the message only.
/// This is an asynchronous method that places the message on the core register and returns immediately.
///
/// Returns: TRUE if successful;
/// Author: Paul Henderson
/// Date: May 2009
////////////////////////////////////////////////////////////////////////
BOOL PBModule::RegisterForMessage(PBModule *pmodule, MESSAGECALLBACK *pcallback, int appid, HWND hwnd, UINT msg)
{
if(m_pCoreStructure->pRegMessFunc){
REGISTERMESSAGE reg;
reg.hWnd = hwnd;
reg.nAppID = appid;
reg.pCallback = pcallback;
reg.pModule = pmodule;
reg.uMessage = msg;
return m_pCoreStructure->pRegMessFunc(®);
}
return FALSE;
}
/******************************************************************************/
/******************************************************************************/
// Functions for handling paint notifications from the core
/******************************************************************************/
void PBModule::ProcessPaint (int appid, PAINTSTRUCT *pps)
{
PPBINSTSTRUCT pInstStruct;
// Notify specified instance
for (pInstStruct = m_pInstHead; pInstStruct; pInstStruct = pInstStruct->pNext)
{
if (pInstStruct->instID == appid)
onPaint (pps, pInstStruct->pWrappedObj);
}
}
/******************************************************************************/
void PBModule::StaticProcessPaint (PBModule *pmodule, int appid, PAINTSTRUCT *pps)
{
pmodule->ProcessPaint (appid, pps);
}
/******************************************************************************/
BOOL PBModule::RegisterForPaint (void)
{
if (m_pCoreStructure->pRegPaintFunc)
{
REGISTERPAINT reg;
reg.hWnd = m_pCurrentPBstruct->hWnd;
reg.nAppID = m_pCurrentPBstruct->iTabID;
reg.pCallback = StaticProcessPaint;
reg.pModule = this;
return m_pCoreStructure->pRegPaintFunc (®);
}
return FALSE;
}
/******************************************************************************/
////////////////////////////////////////////////////////////////////////
/// Function: RegisterForAppFocus
/// Description: Method that is used when a module requests notification of PB application focus.
///
/// Author: Paul Henderson
/// Date: September 2009
////////////////////////////////////////////////////////////////////////
void PBModule::RegisterForAppFocus()
{
//create the thread that waits for a change in application instance event
HANDLE hAppFocus = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) AppFocusThread,(LPVOID) this, 0, 0);
}
////////////////////////////////////////////////////////////////////////
/// Function: AppFocusThread
/// Description: Thread that is started when a module calls 'RegisterForAppFocus()'
/// It calls 'onAppFocus()' when a PB application gains focus
/// Author: Paul Henderson
/// Date: September 2009
////////////////////////////////////////////////////////////////////////
DWORD WINAPI PBModule::AppFocusThread(LPVOID lparam)
{
PBModule *pObj = (PBModule *)lparam;
HANDLE hEvents[2];
//int iOldID,iNewID;
//iOldID = iNewID = PBINVALID_APPID;
hEvents[0] = pObj->m_pCoreStructure->pEventStructure->PBAppGotFocusEvent;
hEvents[1] = pObj->m_hQuitEvent;
DWORD dwEvent;
while(1)
{
dwEvent = WaitForMultipleObjects( 2, hEvents,FALSE,INFINITE);
switch(dwEvent - WAIT_OBJECT_0)
{
case 0://app got focus
//check for a application focus change
if(*pObj->m_pCoreStructure->pPreviousInstID != *pObj->m_pCoreStructure->pCurrentInstID)
pObj->onAppFocus(*pObj->m_pCoreStructure->pPreviousInstID,*pObj->m_pCoreStructure->pCurrentInstID);
/* needed if we use SetEvent instead of PulseEvent in the core
while(1)
{
if(WaitForSingleObject(hEvents[0],0) == WAIT_TIMEOUT)
break;
Sleep(100);
}
*/
break;
case 1://close thread
return 0;
}
}
}
void *PBModule::GetObjFromID(int iID)
{
if(iID != PB_INVALID_APPID){
PPBINSTSTRUCT pInstStruct;
for(pInstStruct = m_pInstHead;;pInstStruct = pInstStruct->pNext)
{
if(pInstStruct->instID == iID)
return pInstStruct->pWrappedObj;
if(pInstStruct->pNext == NULL)
break;///> instance ID not found
}
}
return NULL;
}
////////////////////////////////////////////////////////////////////////
/// Function: SendPBNavigate
/// Description: Method that is used when a module executes a navigation.
/// This method requires one navigation string with as many arguments as necessary.
/// This is an asynchronous method that places the navigation URI into a queue and returns immediately.
///
/// Returns: TRUE if successful;
/// Author: Paul Henderson
/// Date: May 2009
////////////////////////////////////////////////////////////////////////
BOOL PBModule::SendPBNavigate(int iInstID,LPCTSTR lpNavStr,...)
{
BOOL bRet = FALSE;
VARSTRUCT structVar,*pVars,*pStartVars;
pStartVars = pVars = &structVar;
memset(pStartVars,0,sizeof(VARSTRUCT));
TCHAR *l_ParamVal;
va_list l_Arg;
va_start(l_Arg, lpNavStr);
l_ParamVal = va_arg(l_Arg,TCHAR*); // Move past the Format String
while(l_ParamVal)
{
//copy the pointer to our pointer within the structure
pVars->pStr = l_ParamVal;
l_ParamVal = va_arg(l_Arg,TCHAR*);
if(l_ParamVal){
pVars->pNextVar = new VARSTRUCT;
if(pVars->pNextVar == NULL){
bRet = FALSE;
goto _cleanup;
}
pVars->pNextVar->pNextVar = NULL; // GD
pVars = pVars->pNextVar;
}
}
bRet = m_pCoreStructure->pNavigateFunc(iInstID,lpNavStr,pStartVars,m_szModName);
_cleanup:
deleteMem(pStartVars);
return bRet;
}
////////////////////////////////////////////////////////////////////////
/// Function: deleteMem
/// Description: Method that is used internally.
/// Recursively deletes the linked list created in SendPBNavigate
///
/// Returns: void;
/// Author: Paul Henderson
/// Date: May 2009
////////////////////////////////////////////////////////////////////////
void PBModule::deleteMem(PVARSTRUCT pVarStruct)
{
if(pVarStruct->pNextVar){
deleteMem(pVarStruct->pNextVar);
delete pVarStruct->pNextVar;
pVarStruct->pNextVar = NULL;
}
}
////////////////////////////////////////////////////////////////////////
/// Function: deleteInst
/// Description: Method that is used internally.
/// Recursively deletes the linked list used for tracking instance state
///
/// Returns: void;
/// Author: Paul Henderson
/// Date: July 2009
////////////////////////////////////////////////////////////////////////
void PBModule::deleteInst(PPBINSTSTRUCT pInstStruct)
{
if(pInstStruct->pNext){
deleteInst(pInstStruct->pNext);
delete pInstStruct->pNext;
pInstStruct->pNext = NULL;
}
}
#pragma endregion
| 30.426573 | 139 | 0.597794 | [
"object"
] |
401efdf96198001286225b91d70a96ad656477f0 | 553 | cpp | C++ | dynamic-programming/maximumSubarray.cpp | pg-thakur/data-structure-and-algorithms | 59712df30d5d887e1d18a369019b424b2b8dc9e9 | [
"Apache-2.0"
] | null | null | null | dynamic-programming/maximumSubarray.cpp | pg-thakur/data-structure-and-algorithms | 59712df30d5d887e1d18a369019b424b2b8dc9e9 | [
"Apache-2.0"
] | 2 | 2020-10-04T06:39:24.000Z | 2020-10-18T10:37:31.000Z | dynamic-programming/maximumSubarray.cpp | pg-thakur/data-structure-and-algorithms | 59712df30d5d887e1d18a369019b424b2b8dc9e9 | [
"Apache-2.0"
] | 1 | 2020-10-05T07:40:03.000Z | 2020-10-05T07:40:03.000Z | //Given an integer array nums, find the contiguous subarray
//(containing at least one number) which has the largest sum and return its sum.
//A subarray is a contiguous part of an array.
// @author: Prashant Gaurav
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> nums(n);
for(int i=0;i<n;i++)
cin>>nums[i];
int x= nums[0];
int ans= nums[0];
for(int i=1;i<nums.size();i++)
{
x= max(x+nums[i], nums[i]);
ans= max(x, ans);
}
cout<<ans;
}
| 18.433333 | 80 | 0.571429 | [
"vector"
] |
40249652797825a27cd0188e03acfce1ebd4993e | 591 | cpp | C++ | _codeforces/501B/501b.cpp | rusucosmin/Cplusplus | 0e95cd01d20b22404aa4166c71d5a9e834a5a21b | [
"MIT"
] | 11 | 2015-08-29T13:41:22.000Z | 2020-01-08T20:34:06.000Z | _codeforces/501B/501b.cpp | rusucosmin/Cplusplus | 0e95cd01d20b22404aa4166c71d5a9e834a5a21b | [
"MIT"
] | null | null | null | _codeforces/501B/501b.cpp | rusucosmin/Cplusplus | 0e95cd01d20b22404aa4166c71d5a9e834a5a21b | [
"MIT"
] | 5 | 2016-01-20T18:17:01.000Z | 2019-10-30T11:57:15.000Z | #include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
using namespace std;
map<string, int> idx;
map<int, string> aux, last;
int main() {
#ifndef ONLINE_JUDGE
freopen("501b.in", "r", stdin);
freopen("501b.out", "w", stdout);
#endif
int n;
cin >> n;
int users = 0;
for(int i = 1 ; i <= n ; ++ i) {
string a, b;
cin >> a >> b;
if(!idx[a]) {
idx[a] = ++ users;
aux[users] = a;
}
last[idx[a]] = b;
idx[b] = idx[a];
}
cout << users << '\n';
for(int i = 1 ; i <= users ; ++ i) {
cout << aux[i] << ' ' << last[i] << '\n';
}
}
| 16.416667 | 43 | 0.519459 | [
"vector"
] |
4028c18038fb668d5db6d0c006386f77d7b4d473 | 33,245 | cpp | C++ | tools/SeekTest/SeekTest.cpp | FunctionLab/sleipnir | 6f74986ef03cb2df8deee1077ae180391557403a | [
"CC-BY-3.0"
] | 1 | 2021-03-21T23:17:12.000Z | 2021-03-21T23:17:12.000Z | tools/SeekTest/SeekTest.cpp | FunctionLab/sleipnir | 6f74986ef03cb2df8deee1077ae180391557403a | [
"CC-BY-3.0"
] | 4 | 2021-03-26T13:56:59.000Z | 2022-03-30T21:38:06.000Z | tools/SeekTest/SeekTest.cpp | FunctionLab/sleipnir | 6f74986ef03cb2df8deee1077ae180391557403a | [
"CC-BY-3.0"
] | null | null | null | /*****************************************************************************
* This file is provided under the Creative Commons Attribution 3.0 license.
*
* You are free to share, copy, distribute, transmit, or adapt this work
* PROVIDED THAT you attribute the work to the authors listed below.
* For more information, please see the following web page:
* http://creativecommons.org/licenses/by/3.0/
*
* This file is a component of the Sleipnir library for functional genomics,
* authored by:
* Curtis Huttenhower (chuttenh@princeton.edu)
* Mark Schroeder
* Maria D. Chikina
* Olga G. Troyanskaya (ogt@princeton.edu, primary contact)
*
* If you use this library, the included executable tools, or any related
* code in your work, please cite the following publication:
* Curtis Huttenhower, Mark Schroeder, Maria D. Chikina, and
* Olga G. Troyanskaya.
* "The Sleipnir library for computational functional genomics"
*****************************************************************************/
#include "stdafx.h"
#include "cmdline.h"
#include <iomanip>
#include <random>
float **LoadGenes(const vector <string> struserGenes,
const vector <utype> &veciGenes, const vector <string> &vecstrGenes,
const vector <utype> &veciallGenes, CSeekIntIntMap *gmap,
CSeekDataset *vcd, float **vall) {
float **v2 = CSeekTools::Init2DArray(struserGenes.size(),
vecstrGenes.size(), CMeta::GetNaN());
size_t i, j;
for (i = 0; i < struserGenes.size(); i++) {
utype s = veciGenes[i]; //s is user gene ID
if (CSeekTools::IsNaN(s)) continue;
for (j = 0; j < vecstrGenes.size(); j++) {
utype t = veciallGenes[j];
if (CSeekTools::IsNaN(t)) continue;
if (CMeta::IsNaN(vall[s][t])) continue;
if (CSeekTools::IsNaN(gmap->GetForward(t))) continue;
v2[i][t] = vall[s][t];
}
}
return v2;
}
float **ReadUserGenes(const vector <string> &struserGenes,
const vector <utype> &veciGenes, const vector <string> &vecstrGenes,
const vector <utype> &veciallGenes, CSeekIntIntMap *gmap,
CSeekDataset *vcd, CDataPair &Dat) {
float **v2 = CSeekTools::Init2DArray(struserGenes.size(),
vecstrGenes.size(), CMeta::GetNaN());
size_t i, j;
for (i = 0; i < struserGenes.size(); i++) {
utype s = veciGenes[i]; //s is user gene ID
if (CSeekTools::IsNaN(s)) continue;
float *v = Dat.GetFullRow(s);
for (j = 0; j < vecstrGenes.size(); j++) {
utype t = veciallGenes[j];
if (CSeekTools::IsNaN(t)) continue;
if (CMeta::IsNaN(v[t])) continue;
if (CSeekTools::IsNaN(gmap->GetForward(t))) continue;
//Disable gene average subtraction!
//v[t] = v[t] - vcd->GetGeneAverage(t);
v2[i][t] = v[t];
//fprintf(stderr, "%.2f\n", v2[i][t]);
}
free(v);
}
return v2;
}
float **ReadAllGenes(const vector <string> &vecstrGenes,
const vector <utype> &veciallGenes, CSeekIntIntMap *gmap,
CSeekDataset *vcd, CDataPair &Dat) {
float **v2 = CSeekTools::Init2DArray(vecstrGenes.size(),
vecstrGenes.size(), CMeta::GetNaN());
size_t i, j;
size_t ss = Dat.GetGenes();
map <string, utype> mapstrintGenes;
for (i = 0; i < vecstrGenes.size(); i++)
mapstrintGenes[vecstrGenes[i]] = i;
//fprintf(stderr, "thread limit is %d\n", omp_get_max_threads());
//getchar();
#pragma omp parallel for \
private(i, j) \
shared(Dat, gmap, mapstrintGenes, vcd, v2) \
firstprivate(ss) \
schedule(dynamic)
for (i = 0; i < ss; i++) {
utype tid = omp_get_thread_num();
string s = Dat.GetGene(i);
utype ii = mapstrintGenes[s];
if (CSeekTools::IsNaN(gmap->GetForward(ii))) continue;
float *v = Dat.GetFullRow(i);
for (j = 0; j < ss; j++) {
string t = Dat.GetGene(j);
utype jj = mapstrintGenes[t];
if (CSeekTools::IsNaN(gmap->GetForward(jj))) continue;
v[j] = v[j] - vcd->GetGeneAverage(jj);
v2[ii][jj] = v[j];
//fprintf(stderr, "%.2f\n", v2[s][t]);
}
//fprintf(stderr, "Done row %d", i);
//getchar();
free(v);
//fprintf(stderr, "TID %d Gene %d is done.\n", tid, i);
//fprintf(stderr, "Gene %d / %d is done.\n", i, ss);
//fprintf(stderr, "Done freeing row %d", i); getchar();
}
return v2;
}
bool GetRandomGenes(gsl_rng *r, int size, vector <string> &struserGenes,
vector <utype> &veciGenes, const vector <string> &vecstrGenes,
const vector <utype> &veciallGenes, CSeekIntIntMap *gmap) {
struserGenes.clear();
veciGenes.clear();
struserGenes.resize(size);
veciGenes.resize(size);
utype i;
int totSize = 0;
for (i = 0; i < veciallGenes.size(); i++) {
utype t = veciallGenes[i];
if (CSeekTools::IsNaN(t)) continue;
if (CSeekTools::IsNaN(gmap->GetForward(t))) continue;
totSize++;
}
int *gsample = (int *) malloc(size * sizeof(int));
int *gs = (int *) malloc(totSize * sizeof(int));
utype ti = 0;
for (i = 0; i < veciallGenes.size(); i++) {
utype t = veciallGenes[i];
if (CSeekTools::IsNaN(t)) continue;
if (CSeekTools::IsNaN(gmap->GetForward(t))) continue;
gs[ti] = i;
ti++;
}
gsl_ran_choose(r, gsample, size, gs, totSize, sizeof(int));
for (i = 0; i < size; i++) {
veciGenes[i] = veciallGenes[gsample[i]];
struserGenes[i] = vecstrGenes[gsample[i]];
}
free(gsample);
free(gs);
return true;
}
bool GetMeanStdev(const vector<float> &f, float &mean, float &stdev) {
size_t i, j;
mean = 0;
stdev = 0;
for (i = 0; i < f.size(); i++) {
mean += f[i];
}
mean /= f.size();
for (i = 0; i < f.size(); i++) {
stdev += (f[i] - mean) * (f[i] - mean);
}
stdev /= f.size();
stdev = sqrt(stdev);
return true;
}
bool CalculateWelch(const float &mean1, const float &stdev1, const int &size1,
const float &mean2, const float &stdev2, const int &size2,
double &pvalt, double &t) {
double v1 = (double) stdev1 * (double) stdev1;
double v2 = (double) stdev2 * (double) stdev2;
int n1 = size1;
int n2 = size2;
t = (mean1 - mean2) / sqrt(v1 / n1 + v2 / n2);
double x1 = v1 / n1;
double x2 = v2 / n2;
double i1 = x1 + x2;
double df = i1 * i1 / (x1 * x1 / (n1 - 1) + x2 * x2 / (n2 - 1));
if (t > 0) {
//fprintf(stderr, "t:%.2f df:%.2f n1:%d n2:%d mean1:%.2f mean2:%.2f v1:%.2f v2:%.2f\n",
// t, df, n1, n2, mean1, mean2, v1, v2);
double pval1 = gsl_cdf_tdist_Q(t, df);
double pval2 = gsl_cdf_tdist_P(-1.0 * t, df);
pvalt = pval1 + pval2;
} else {
//fprintf(stderr, "t:%.2f df:%.2f n1:%d n2:%d mean1:%.2f mean2:%.2f v1:%.2f v2:%.2f\n",
// t, df, n1, n2, mean1, mean2, v1, v2);
double pval1 = gsl_cdf_tdist_Q(-1.0 * t, df);
double pval2 = gsl_cdf_tdist_P(t, df);
pvalt = pval1 + pval2;
}
return true;
}
vector <string> Do_Pair_Proportion() {
}
vector <string> Do_T_Test(
gsl_rng *rnd,
float **vall,
const vector <utype> &veciGenes, //process
const vector <string> &vecstrProcess, //process
const vector <utype> &veciallGenes, //background
const vector <string> &vecstrGenes, //background
CSeekIntIntMap *gmap
) {
unsigned int seed = gsl_rng_get(rnd);
const gsl_rng_type *T;
gsl_rng *r;
gsl_rng_env_setup();
T = gsl_rng_default;
r = gsl_rng_alloc(T);
gsl_rng_set(r, seed);
size_t i, j, k;
vector <vector<utype>> vi;
vector <vector<string>> si;
vi.resize(100);
si.resize(100);
int size = veciGenes.size();
vector <string> outstr;
for (i = 0; i < 100; i++) {
vi[i] = vector<utype>();
si[i] = vector<string>();
GetRandomGenes(r, size, si[i], vi[i], vecstrGenes, veciallGenes, gmap);
}
float user_mean, user_stdev;
vector<float> rand_mean, rand_stdev;
rand_mean.resize(100);
rand_stdev.resize(100);
for (i = 0; i < 100; i++) {
vector<float> vv; //preparation
for (j = 0; j < veciGenes.size(); j++) {
for (k = 0; k < veciGenes.size(); k++) {
if (CMeta::IsNaN(vall[vi[i][j]][vi[i][k]])) continue;
vv.push_back(vall[vi[i][j]][vi[i][k]]);
}
}
GetMeanStdev(vv, rand_mean[i], rand_stdev[i]);
//fprintf(stderr, "Random %.2f %.2f\n", rand_mean[i], rand_stdev[i]);
}
vector<float> vf; //preparation
for (j = 0; j < veciGenes.size(); j++) {
for (k = 0; k < veciGenes.size(); k++) {
if (CMeta::IsNaN(vall[veciGenes[j]][veciGenes[k]])) continue;
vf.push_back(vall[veciGenes[j]][veciGenes[k]]);
}
}
GetMeanStdev(vf, user_mean, user_stdev);
ostringstream ost;
ost.setf(ios::fixed);
ost << "User " << setprecision(2) << user_mean << " " << setprecision(2) << user_stdev;
outstr.push_back(ost.str());
for (i = 0; i < 100; i++) {
double pvalt, t;
CalculateWelch(rand_mean[i], rand_stdev[i], veciGenes.size(),
user_mean, user_stdev, veciGenes.size(), pvalt, t);
//printf("%.2f %.2f %.3E\n", (float) user_mean - rand_mean[i], t, pvalt);
ostringstream ost2;
ost2.setf(ios::fixed);
ost2 << setprecision(2) << (float) user_mean - rand_mean[i] << " " << setprecision(2) << t << " "
<< setprecision(2) << scientific << pvalt;
outstr.push_back(ost2.str());
}
return outstr;
}
bool Get_Mann_Whitney_U_Statistics(const vector<float> &v1, const vector<float> &v2,
double &U1, double &U2, double &z, double &auc) {
size_t i, j, k;
vector <AResultFloat> vv; //preparation
int s1 = v1.size();
int s2 = v2.size();
vv.resize(v1.size() + v2.size());
size_t kk = 0;
for (i = 0; i < v1.size(); i++) {
vv[kk].i = 0;
vv[kk].f = v1[i];
kk++;
}
for (i = 0; i < v2.size(); i++) {
vv[kk].i = 1;
vv[kk].f = v2[i];
kk++;
}
sort(vv.begin(), vv.end());
U1 = 0;
U2 = 0;
for (j = 0; j < vv.size(); j++) {
if (vv[j].i == 0) {
U1 += j + 1.0;
} else {
U2 += j + 1.0;
}
}
U1 -= (s1 * (s1 + 1.0) / 2.0);
U2 -= (s2 * (s2 + 1.0) / 2.0);
//normal approximation
double mu = s1 * s2 / 2.0;
double sigma_u = sqrt((s1 * s2) * (s1 + s2 + 1.0) / 12.0);
z = (U1 - mu) / sigma_u;
auc = U1 / (s1 * s2);
return true;
}
vector <string> Do_Mann_Whitney_U_Test(
gsl_rng *rnd,
float **vall,
const vector <utype> &veciGenes, //process
const vector <string> &vecstrProcess, //process
const vector <utype> &veciallGenes, //background
const vector <string> &vecstrGenes, //background
CSeekIntIntMap *gmap
) {
unsigned int seed = gsl_rng_get(rnd);
vector <string> outstr;
const gsl_rng_type *T;
gsl_rng *r;
gsl_rng_env_setup();
T = gsl_rng_default;
r = gsl_rng_alloc(T);
gsl_rng_set(r, seed);
size_t i, j, k;
vector <vector<utype>> vi;
vector <vector<string>> si;
vi.resize(100);
si.resize(100);
int size = veciGenes.size();
for (i = 0; i < 100; i++) {
vi[i] = vector<utype>();
si[i] = vector<string>();
GetRandomGenes(r, size, si[i], vi[i], vecstrGenes, veciallGenes, gmap);
}
vector<double> U1, U2;
vector<float> z;
vector<int> s1, s2;
vector<float> auc;
U1.resize(100);
U2.resize(100);
z.resize(100);
s1.resize(100);
s2.resize(100);
auc.resize(100);
for (i = 0; i < 100; i++) {
vector <AResultFloat> vv; //preparation
s1[i] = 0;
s2[i] = 0;
for (j = 0; j < veciGenes.size(); j++) {
for (k = 0; k < veciGenes.size(); k++) {
if (CMeta::IsNaN(vall[vi[i][j]][vi[i][k]])) continue;
s1[i]++;
}
}
for (j = 0; j < veciGenes.size(); j++) {
for (k = 0; k < veciGenes.size(); k++) {
if (CMeta::IsNaN(vall[veciGenes[j]][veciGenes[k]])) continue;
s2[i]++;
}
}
vv.resize(s1[i] + s2[i]);
int kk = 0;
for (j = 0; j < veciGenes.size(); j++) {
for (k = 0; k < veciGenes.size(); k++) {
if (CMeta::IsNaN(vall[vi[i][j]][vi[i][k]])) continue;
vv[kk].f = vall[vi[i][j]][vi[i][k]];
vv[kk].i = 0;
kk++;
}
}
for (j = 0; j < veciGenes.size(); j++) {
for (k = 0; k < veciGenes.size(); k++) {
if (CMeta::IsNaN(vall[veciGenes[j]][veciGenes[k]])) continue;
vv[kk].f = vall[veciGenes[j]][veciGenes[k]];
vv[kk].i = 1;
kk++;
}
}
sort(vv.begin(), vv.end());
U1[i] = 0;
U2[i] = 0;
for (j = 0; j < vv.size(); j++) {
if (vv[j].i == 0) {
U1[i] += j + 1.0;
} else {
U2[i] += j + 1.0;
}
}
U1[i] -= (s1[i] * (s1[i] + 1.0) / 2.0);
U2[i] -= (s2[i] * (s2[i] + 1.0) / 2.0);
/*double U = 0;
if(U1<U2){
U = U1;
}else{
U = U2;
}*/
//normal approximation
double mu = s1[i] * s2[i] / 2.0;
double sigma_u = sqrt((s1[i] * s2[i]) * (s1[i] + s2[i] + 1.0) / 12.0);
z[i] = (U1[i] - mu) / sigma_u;
auc[i] = U1[i] / (s1[i] * s2[i]);
//printf("%d %.2f %.2f %.2f %.2f\n", s1, (float) U1, (float) z, (float) U1/(s1*s2), (float) U2/(s1*s2));
}
for (i = 0; i < 100; i++) {
ostringstream ost;
ost.setf(ios::fixed);
ost << s1[i] << " " << U1[i] << " " << setprecision(2) << z[i] << " " << setprecision(2) << auc[i];
outstr.push_back(ost.str());
}
return outstr;
}
vector <string> Do_Mann_Whitney_U_Test_By_Gene(gsl_rng *rnd, float **vall,
const vector <string> &vecstrProcess,
const vector <utype> &veciProcess,
const vector <string> &vecstrGenes,
const vector <utype> &veciallGenes,
CSeekIntIntMap *gmap
) {
unsigned int seed = gsl_rng_get(rnd);
vector <string> outstr;
size_t i, j, jj, k;
int size = veciProcess.size();
int trials = 1;
int perGeneTrials = 11;
const gsl_rng_type *T;
gsl_rng *r;
gsl_rng_env_setup();
T = gsl_rng_default;
r = gsl_rng_alloc(T);
gsl_rng_set(r, seed);
for (i = 0; i < trials; i++) {
vector <utype> veciRandom;
vector <string> vecstrRandom;
GetRandomGenes(r, size, vecstrRandom, veciRandom, vecstrGenes, veciallGenes, gmap);
outstr.emplace_back("Process");
//Process
for (j = 0; j < size; j++) {
utype thisGene = veciProcess[j];
vector<float> vProcess;
for (k = 0; k < size; k++) {
float x = vall[thisGene][veciProcess[k]];
if (CMeta::IsNaN(x)) continue;
vProcess.push_back(x);
}
ostringstream ost;
ost << "Gene " << vecstrProcess[j] << " size " << vProcess.size();
outstr.push_back(ost.str());
//fprintf(stdout, "Gene %s size %d\n", vecstrProcess[j].c_str(), vProcess.size());
vector <AResultFloat> ar;
vector<double> U1, U2, z, auc;
ar.resize(perGeneTrials);
U1.resize(perGeneTrials);
U2.resize(perGeneTrials);
z.resize(perGeneTrials);
auc.resize(perGeneTrials);
for (jj = 0; jj < perGeneTrials; jj++) {
vector <utype> veciRandomGene;
vector <string> vecstrRandomGene;
GetRandomGenes(r, size, vecstrRandomGene, veciRandomGene, vecstrGenes, veciallGenes, gmap);
vector<float> vRandom;
for (k = 0; k < size; k++) {
float x = vall[thisGene][veciRandomGene[k]];
if (CMeta::IsNaN(x)) continue;
vRandom.push_back(x);
}
Get_Mann_Whitney_U_Statistics(vProcess, vRandom, U1[jj], U2[jj], z[jj], auc[jj]);
ar[jj].i = jj;
ar[jj].f = auc[jj];
//fprintf(stdout, "%d %d %.2f %.2f\n", (int) U1, (int) U2, z, auc);
}
sort(ar.begin(), ar.end());
int med = perGeneTrials / 2;
int ar_med = ar[med].i;
//Show the median
ostringstream ost2;
ost2.setf(ios::fixed);
ost2 << (int) U1[ar_med] << " " << (int) U2[ar_med] << " " << setprecision(2) << z[ar_med] << " "
<< setprecision(2) << auc[ar_med];
outstr.push_back(ost2.str());
//fprintf(stdout, "%d %d %.2f %.2f\n", (int) U1[ar_med], (int) U2[ar_med], z[ar_med], auc[ar_med]);
}
outstr.push_back("Random");
//fprintf(stdout, "Random\n");
//If process genes were just randomly selected geneset
for (j = 0; j < size; j++) {
utype thisGene = veciRandom[j];
vector<float> vRan;
for (k = 0; k < size; k++) {
float x = vall[thisGene][veciRandom[k]];
if (CMeta::IsNaN(x)) continue;
vRan.push_back(x);
}
ostringstream ost;
ost << "Gene number " << j << " size " << vRan.size();
outstr.push_back(ost.str());
vector <AResultFloat> ar;
vector<double> U1, U2, z, auc;
ar.resize(perGeneTrials);
U1.resize(perGeneTrials);
U2.resize(perGeneTrials);
z.resize(perGeneTrials);
auc.resize(perGeneTrials);
for (jj = 0; jj < perGeneTrials; jj++) {
vector <utype> veciRandomGene;
vector <string> vecstrRandomGene;
GetRandomGenes(r, size, vecstrRandomGene, veciRandomGene, vecstrGenes, veciallGenes, gmap);
vector<float> vRandom;
for (k = 0; k < size; k++) {
float x = vall[thisGene][veciRandomGene[k]];
if (CMeta::IsNaN(x)) continue;
vRandom.push_back(x);
}
Get_Mann_Whitney_U_Statistics(vRan, vRandom, U1[jj], U2[jj], z[jj], auc[jj]);
//fprintf(stdout, "%d %d %.2f %.2f\n", (int) U1, (int) U2, z, auc);
ar[jj].i = jj;
ar[jj].f = auc[jj];
}
sort(ar.begin(), ar.end());
int med = perGeneTrials / 2;
int ar_med = ar[med].i;
//Show the median
//fprintf(stdout, "%d %d %.2f %.2f\n", (int) U1[ar_med], (int) U2[ar_med], z[ar_med], auc[ar_med]);
ostringstream ost2;
ost2.setf(ios::fixed);
ost2 << (int) U1[ar_med] << " " << (int) U2[ar_med] << " " << setprecision(2) << z[ar_med] << " "
<< setprecision(2) << auc[ar_med];
outstr.push_back(ost2.str());
}
}
return outstr;
}
vector <string> Do_One(const char *file, gsl_rng *rnd, CSeekDataset *vcd, float **vall,
map <string, utype> &mapstrintGene, vector <string> &vecstrGenes) {
size_t i, j, k;
vector <string> ostr;
vector <string> vecstrUserGenes;
CSeekStrIntMap mapTmp;
if (!CSeekTools::ReadListOneColumn(file, vecstrUserGenes, mapTmp))
return ostr;
vector <utype> userGenes;
for (i = 0; i < vecstrUserGenes.size(); i++) {
userGenes.push_back(mapstrintGene[vecstrUserGenes[i]]);
}
CSeekIntIntMap *gmap = vcd->GetGeneMap();
vector <string> struserGenes;
for (i = 0; i < userGenes.size(); i++) {
if (CSeekTools::IsNaN(gmap->GetForward(userGenes[i]))) {
ostringstream ost;
ost << "Error: gene " << vecstrUserGenes[i] << " is not found in this dataset";
ostr.push_back(ost.str());
continue;
}
struserGenes.push_back(vecstrGenes[userGenes[i]]);
}
if (struserGenes.empty() || struserGenes.size() < 5) {
return ostr;
}
vector <utype> veciGenes;
veciGenes.clear(); //only user gene set
veciGenes.resize(struserGenes.size());
for (i = 0; i < struserGenes.size(); ++i) {
//veciGenes[ i ] = Dat.GetGene( struserGenes[i] );
veciGenes[i] = mapstrintGene[struserGenes[i]];
}
vector <utype> veciallGenes;
veciallGenes.clear(); //all genes
veciallGenes.resize(vecstrGenes.size());
for (i = 0; i < vecstrGenes.size(); ++i) {
//veciallGenes[ i ] = Dat.GetGene( vecstrGenes[i] );
veciallGenes[i] = mapstrintGene[vecstrGenes[i]];
}
//float** v2 = LoadGenes(struserGenes, veciGenes, vecstrGenes,
// veciallGenes, gmap, vcd, vall);
vector <string> outstr =
// Do_Mann_Whitney_U_Test_By_Gene(rnd, vall, struserGenes, veciGenes, vecstrGenes, veciallGenes, gmap);
Do_T_Test(rnd, vall, veciGenes, struserGenes, veciallGenes, vecstrGenes, gmap);
//Do_Mann_Whitney_U_Test(rnd, vall, veciGenes, struserGenes, veciallGenes, vecstrGenes, gmap);
for (i = 0; i < outstr.size(); i++) {
ostr.push_back(outstr[i]);
}
//Do_T_Test(vall, veciGenes, struserGenes, veciallGenes, vecstrGenes, gmap);
//ostr = Do_Mann_Whitney_U_Test(vall, veciGenes, struserGenes, veciallGenes, vecstrGenes, gmap);
/*
int *a1 = (int*)malloc(2*sizeof(int));
int *a2 = (int*)malloc(size*sizeof(int));
for(i=0; i<size; i++){
a2[i] = i;
}
fprintf(stderr, "Random to random\n");
for(i=0; i<100; i++){
gsl_ran_choose(rnd, a1, 2, a2, size, sizeof(int));
double pvalt, t;
CalculateWelch(rand_mean[a1[0]], rand_stdev[a1[0]], veciGenes.size(),
rand_mean[a1[1]], rand_stdev[a1[1]], veciGenes.size(), pvalt, t);
fprintf(stderr, "%.2f %.3E\n", t, pvalt);
}
free(a1);
free(a2);
*/
//CSeekTools::Free2DArray(v2);
//for(i=0; i<100; i++){
// CSeekTools::Free2DArray(randomGenes[i]);
//}
return ostr;
}
int main(int iArgs, char **aszArgs) {
static const size_t c_iBuffer = 1024;
gengetopt_args_info sArgs{};
ifstream ifsm;
istream *pistm;
vector <string> vecstrLine, vecstrGenes, vecstrDatasets, vecstrQuery, vecstrUserDatasets;
char acBuffer[c_iBuffer];
size_t i, j, k;
omp_set_num_threads(8);
/*utype ii;
omp_set_num_threads(8);
#pragma omp parellel for \
private(i) \
schedule(static, 1)
for(ii=0; ii<100; ii++){
utype tid = omp_get_thread_num();
fprintf(stderr, "Hello World %d\n", tid);
}*/
const gsl_rng_type *T;
gsl_rng *rnd;
gsl_rng_env_setup();
T = gsl_rng_default;
rnd = gsl_rng_alloc(T);
if (cmdline_parser(iArgs, aszArgs, &sArgs)) {
cmdline_parser_print_help();
return 1;
}
vector <string> vecstrGeneID;
map <string, utype> mapstrintGene;
if (!CSeekTools::ReadListTwoColumns(sArgs.input_arg, vecstrGeneID, vecstrGenes))
return 1;
for (i = 0; i < vecstrGenes.size(); i++)
mapstrintGene[vecstrGenes[i]] = i;
if (sArgs.db_flag == 1) {
vector<float> quant;
CSeekTools::ReadQuantFile(sArgs.quant_arg, quant);
vector <string> vecstrDataset, vDP;
if (!CSeekTools::ReadListTwoColumns(sArgs.dataset_list_arg,
vecstrDataset, vDP))
return (int)false;
auto *DB = new CDatabase(false);
DB->Open(sArgs.db_dir_arg, vecstrGenes, vecstrDataset.size(), sArgs.db_num_arg);
string strPrepInputDirectory = sArgs.prep_arg;
string strSinfoInputDirectory = sArgs.sinfo_arg;
vector < CSeekDataset * > vc;
vc.resize(vecstrDataset.size());
size_t i, j, k;
for (i = 0; i < vecstrDataset.size(); i++) {
vc[i] = new CSeekDataset();
string strFileStem = vecstrDataset[i];
string strAvgPath = strPrepInputDirectory + "/" +
strFileStem + ".gavg";
string strPresencePath = strPrepInputDirectory + "/" +
strFileStem + ".gpres";
string strSinfoPath = strSinfoInputDirectory + "/" +
strFileStem + ".sinfo";
vc[i]->ReadGeneAverage(strAvgPath);
vc[i]->ReadGenePresence(strPresencePath);
vc[i]->ReadDatasetAverageStdev(strSinfoPath);
vc[i]->InitializeGeneMap();
}
size_t iGenes = vecstrGenes.size();
size_t iDatasets = vecstrDataset.size();
vector <string> vecstrQuery;
CSeekTools::ReadMultiGeneOneLine(sArgs.query_arg, vecstrQuery);
//Need to load the query
vector<char> cQuery;
CSeekTools::InitVector(cQuery, iGenes, (char) 0);
for (i = 0; i < vecstrQuery.size(); i++) {
if (mapstrintGene.find(vecstrQuery[i]) == mapstrintGene.end()) continue;
utype k = mapstrintGene.find(vecstrQuery[i])->second;
cQuery[k] = 1;
}
vector <utype> allQ;
for (i = 0; i < cQuery.size(); i++)
if (cQuery[i] == 1)
allQ.push_back(i);
allQ.resize(allQ.size());
for (i = 0; i < iDatasets; i++)
if (vc[i]->GetDBMap() != NULL)
vc[i]->DeleteQueryBlock();
for (i = 0; i < iDatasets; i++)
vc[i]->InitializeQueryBlock(allQ);
size_t m, d;
for (i = 0; i < allQ.size(); i++) {
m = allQ[i];
vector<unsigned char> Qi;
if (!DB->GetGene(m, Qi)) {
cerr << "Gene does not exist" << endl;
continue;
}
utype db;
CSeekIntIntMap *qu = NULL;
unsigned char **r = NULL;
for (j = 0; j < vecstrDataset.size(); j++) {
if ((qu = vc[j]->GetDBMap()) == NULL)
continue;
if (CSeekTools::IsNaN(db = (qu->GetForward(m))))
continue;
for (r = vc[j]->GetMatrix(), k = 0; k < iGenes; k++)
r[db][k] = Qi[k * vecstrDataset.size() + j];
}
Qi.clear();
}
if (!!sArgs.count_pair_flag) {
map<float, vector<int> > countPairs;
float point = 0.0;
while (point <= 5.0) {
countPairs[point] = vector<int>();
CSeekTools::InitVector(countPairs[point], iDatasets, (int) 0);
point += 0.25;
}
for (k = 0; k < iDatasets; k++) {
CSeekIntIntMap *mapQ = vc[k]->GetDBMap();
CSeekIntIntMap *mapG = vc[k]->GetGeneMap();
if (mapQ == NULL) continue;
unsigned char **f = vc[k]->GetMatrix();
size_t qi, qj;
for (qi = 0; qi < allQ.size(); qi++) {
utype gene_qi = allQ[qi];
utype iQ = mapQ->GetForward(gene_qi);
if (CSeekTools::IsNaN(iQ)) continue;
for (qj = qi + 1; qj < allQ.size(); qj++) {
utype gene_qj = allQ[qj];
utype jQ = mapG->GetForward(gene_qj);
if (CSeekTools::IsNaN(jQ)) continue;
unsigned char uc = f[iQ][gene_qj];
if (uc == 255) continue;
float vv = quant[uc];
point = 0.0;
while (point <= 5.0) {
if (vv > point)
countPairs[point][k]++;
point += 0.25;
}
}
}
}
for (i = 0; i < iDatasets; i++)
vc[i]->DeleteQueryBlock();
point = 0.0;
while (point <= 5.0) {
sort(countPairs[point].begin(), countPairs[point].end(), greater<int>());
float tmp = 0;
for (i = 0; i < 10; i++)
tmp += (float) countPairs[point][i];
tmp /= 10.0;
fprintf(stderr, "%.2f\t%.1f pairs\n", point, tmp);
point += 0.25;
}
}
if (!!sArgs.histogram_flag) {
srand(unsigned(time(nullptr)));
vector<int> dID;
for (k = 0; k < iDatasets; k++) {
dID.push_back(k);
}
random_device rand_dev;
mt19937 rand_gen(rand_dev());
shuffle(dID.begin(), dID.end(), rand_gen);
utype kk;
for (kk = 0; kk < 100; kk++) {
k = dID[kk];
CSeekIntIntMap *mapQ = vc[k]->GetDBMap();
CSeekIntIntMap *mapG = vc[k]->GetGeneMap();
if (mapQ == nullptr) continue;
unsigned char **f = vc[k]->GetMatrix();
size_t qi, ii;
for (qi = 0; qi < allQ.size(); qi++) {
utype gene_qi = allQ[qi];
utype iQ = mapQ->GetForward(gene_qi);
if (CSeekTools::IsNaN(iQ)) continue;
vector<float> z_score;
const vector <utype> &allRGenes = mapG->GetAllReverse();
for (ii = 0; ii < mapG->GetNumSet(); ii++) {
size_t ij = allRGenes[ii];
float a = vc[k]->GetGeneAverage(ij);
unsigned char x = f[iQ][ij];
if (x == 255) continue;
//float xnew = quant[x] - a;
float xnew = quant[x];
z_score.push_back(xnew);
}
sort(z_score.begin(), z_score.end());
float pts[] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9};
fprintf(stderr, "Query %s\tDataset %zu\t", vecstrGenes[gene_qi].c_str(), k);
for (ii = 0; ii < 9; ii++)
fprintf(stderr, "%.2f\t", z_score[(int) (pts[ii] * z_score.size())]);
fprintf(stderr, "\n");
}
}
return 0;
}
}
CSeekStrIntMap mapTmp;
vector <string> vecstrList;
if (!CSeekTools::ReadListOneColumn(sArgs.gene_set_list_arg, vecstrList, mapTmp))
return 1;
if (sArgs.dab_flag == 1) {
auto *vcd = new CSeekDataset();
string strAvg = sArgs.gavg_input_arg;
string strPres = sArgs.gpres_input_arg;
vcd->ReadGeneAverage(strAvg);
vcd->ReadGenePresence(strPres);
vcd->InitializeGeneMap();
CDataPair Dat;
if (!Dat.Open(sArgs.dabinput_arg, false, false)) {
cerr << "Error opening dab file" << endl;
return 1;
}
//fprintf(stderr, "Read.\n");
//getchar();
CSeekIntIntMap *gmap = vcd->GetGeneMap();
vector <utype> veciallGenes;
veciallGenes.clear(); //all genes
veciallGenes.resize(vecstrGenes.size());
for (i = 0; i < vecstrGenes.size(); ++i) {
veciallGenes[i] = mapstrintGene[vecstrGenes[i]];
//fprintf(stderr, "Gene %s is id %d %d\n", vecstrGenes[i].c_str(), i, Dat.GetGene(vecstrGenes[i]));
}
//getchar();
float **vall = ReadAllGenes(vecstrGenes, veciallGenes, gmap, vcd, Dat);
//fprintf(stderr, "Finished loading all\n");
vector <vector<string>> vx;
vx.resize(vecstrList.size());
//getchar();
#pragma omp parallel for \
private(i) \
shared(vx, vcd, vall, mapstrintGene, vecstrGenes, vecstrList) \
schedule(dynamic)
for (i = 0; i < vecstrList.size(); i++) {
fprintf(stderr, "Doing: %s\n", vecstrList[i].c_str());
vx[i] = Do_One(vecstrList[i].c_str(), rnd, vcd, vall, mapstrintGene, vecstrGenes);
}
for (i = 0; i < vecstrList.size(); i++) {
printf("File: %s\n", vecstrList[i].c_str());
for (j = 0; j < vx[i].size(); j++) {
cout << vx[i][j] << endl;
}
}
}
//#ifdef WIN32
// pthread_win32_process_detach_np( );
//#endif // WIN32
return 0;
}
| 33.682877 | 115 | 0.502662 | [
"vector"
] |
403041ad1d21fb1893fd40538f3425ce5bc6622e | 6,821 | cpp | C++ | indra/newview/llhudeffecttrail.cpp | SaladDais/LLUDP-Encryption | 8a426cd0dd154e1a10903e0e6383f4deb2a6098a | [
"ISC"
] | 1 | 2022-01-29T07:10:03.000Z | 2022-01-29T07:10:03.000Z | indra/newview/llhudeffecttrail.cpp | bloomsirenix/Firestorm-manikineko | 67e1bb03b2d05ab16ab98097870094a8cc9de2e7 | [
"Unlicense"
] | null | null | null | indra/newview/llhudeffecttrail.cpp | bloomsirenix/Firestorm-manikineko | 67e1bb03b2d05ab16ab98097870094a8cc9de2e7 | [
"Unlicense"
] | 1 | 2021-10-01T22:22:27.000Z | 2021-10-01T22:22:27.000Z | /**
* @file llhudeffecttrail.cpp
* @brief LLHUDEffectSpiral class implementation
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llhudeffecttrail.h"
#include "llviewercontrol.h"
#include "message.h"
#include "llagent.h"
#include "llbox.h"
#include "lldrawable.h"
#include "llhudrender.h"
#include "llviewertexturelist.h"
#include "llviewerobjectlist.h"
#include "llviewerpartsim.h"
#include "llviewerpartsource.h"
#include "llvoavatar.h"
#include "llworld.h"
LLHUDEffectSpiral::LLHUDEffectSpiral(const U8 type) : LLHUDEffect(type), mbInit(FALSE)
{
mKillTime = 10.f;
mVMag = 1.f;
mVOffset = 0.f;
mInitialRadius = 1.f;
mFinalRadius = 1.f;
mSpinRate = 10.f;
mFlickerRate = 50.f;
mScaleBase = 0.1f;
mScaleVar = 0.f;
mFadeInterp.setStartTime(0.f);
mFadeInterp.setEndTime(mKillTime);
mFadeInterp.setStartVal(1.f);
mFadeInterp.setEndVal(1.f);
}
LLHUDEffectSpiral::~LLHUDEffectSpiral()
{
}
void LLHUDEffectSpiral::markDead()
{
if (mPartSourcep)
{
mPartSourcep->setDead();
mPartSourcep = NULL;
}
LLHUDEffect::markDead();
}
void LLHUDEffectSpiral::packData(LLMessageSystem *mesgsys)
{
if (!mSourceObject)
{
//LL_WARNS() << "Missing object in trail pack!" << LL_ENDL;
}
LLHUDEffect::packData(mesgsys);
U8 packed_data[56];
memset(packed_data, 0, 56);
if (mSourceObject)
{
htolememcpy(packed_data, mSourceObject->mID.mData, MVT_LLUUID, 16);
}
if (mTargetObject)
{
htolememcpy(packed_data + 16, mTargetObject->mID.mData, MVT_LLUUID, 16);
}
if (!mPositionGlobal.isExactlyZero())
{
htolememcpy(packed_data + 32, mPositionGlobal.mdV, MVT_LLVector3d, 24);
}
mesgsys->addBinaryDataFast(_PREHASH_TypeData, packed_data, 56);
}
void LLHUDEffectSpiral::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
{
const size_t EFFECT_SIZE = 56;
U8 packed_data[EFFECT_SIZE];
LLHUDEffect::unpackData(mesgsys, blocknum);
LLUUID object_id, target_object_id;
size_t size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData);
if (size != EFFECT_SIZE)
{
LL_WARNS() << "Spiral effect with bad size " << size << LL_ENDL;
return;
}
mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData,
packed_data, EFFECT_SIZE, blocknum, EFFECT_SIZE);
htolememcpy(object_id.mData, packed_data, MVT_LLUUID, 16);
htolememcpy(target_object_id.mData, packed_data + 16, MVT_LLUUID, 16);
htolememcpy(mPositionGlobal.mdV, packed_data + 32, MVT_LLVector3d, 24);
LLViewerObject *objp = NULL;
if (object_id.isNull())
{
setSourceObject(NULL);
}
else
{
LLViewerObject *objp = gObjectList.findObject(object_id);
if (objp)
{
setSourceObject(objp);
}
else
{
// We don't have this object, kill this effect
markDead();
return;
}
}
if (target_object_id.isNull())
{
setTargetObject(NULL);
}
else
{
objp = gObjectList.findObject(target_object_id);
if (objp)
{
setTargetObject(objp);
}
else
{
// We don't have this object, kill this effect
markDead();
return;
}
}
triggerLocal();
}
void LLHUDEffectSpiral::triggerLocal()
{
mKillTime = mTimer.getElapsedTimeF32() + mDuration;
BOOL show_beam = gSavedSettings.getBOOL("ShowSelectionBeam");
LLColor4 color;
color.setVec(mColor);
if (!mPartSourcep)
{
if (!mTargetObject.isNull() && !mSourceObject.isNull())
{
if (show_beam)
{
LLPointer<LLViewerPartSourceBeam> psb = new LLViewerPartSourceBeam;
psb->setColor(color);
psb->setSourceObject(mSourceObject);
psb->setTargetObject(mTargetObject);
psb->setOwnerUUID(gAgent.getID());
LLViewerPartSim::getInstance()->addPartSource(psb);
mPartSourcep = psb;
}
}
else
{
if (!mSourceObject.isNull() && !mPositionGlobal.isExactlyZero())
{
if (show_beam)
{
LLPointer<LLViewerPartSourceBeam> psb = new LLViewerPartSourceBeam;
psb->setSourceObject(mSourceObject);
psb->setTargetObject(NULL);
psb->setColor(color);
psb->mLKGTargetPosGlobal = mPositionGlobal;
psb->setOwnerUUID(gAgent.getID());
LLViewerPartSim::getInstance()->addPartSource(psb);
mPartSourcep = psb;
}
}
else
{
LLVector3 pos;
if (mSourceObject)
{
pos = mSourceObject->getPositionAgent();
}
else
{
pos = gAgent.getPosAgentFromGlobal(mPositionGlobal);
}
LLPointer<LLViewerPartSourceSpiral> pss = new LLViewerPartSourceSpiral(pos);
if (!mSourceObject.isNull())
{
pss->setSourceObject(mSourceObject);
}
pss->setColor(color);
pss->setOwnerUUID(gAgent.getID());
LLViewerPartSim::getInstance()->addPartSource(pss);
mPartSourcep = pss;
}
}
}
else
{
LLPointer<LLViewerPartSource>& ps = mPartSourcep;
if (mPartSourcep->getType() == LLViewerPartSource::LL_PART_SOURCE_BEAM)
{
LLViewerPartSourceBeam *psb = (LLViewerPartSourceBeam *)ps.get();
psb->setSourceObject(mSourceObject);
psb->setTargetObject(mTargetObject);
psb->setColor(color);
if (mTargetObject.isNull())
{
psb->mLKGTargetPosGlobal = mPositionGlobal;
}
}
else
{
LLViewerPartSourceSpiral *pss = (LLViewerPartSourceSpiral *)ps.get();
pss->setSourceObject(mSourceObject);
}
}
mbInit = TRUE;
}
void LLHUDEffectSpiral::setTargetObject(LLViewerObject *objp)
{
if (objp == mTargetObject)
{
return;
}
mTargetObject = objp;
}
void LLHUDEffectSpiral::render()
{
F32 time = mTimer.getElapsedTimeF32();
static LLCachedControl<bool> showSelectionBeam(gSavedSettings, "ShowSelectionBeam"); // <FS:Ansariel> Performance tweak
if ((!mSourceObject.isNull() && mSourceObject->isDead()) ||
(!mTargetObject.isNull() && mTargetObject->isDead()) ||
mKillTime < time ||
// <FS:Ansariel> Performance tweak
//(!mPartSourcep.isNull() && !gSavedSettings.getBOOL("ShowSelectionBeam")) )
(!mPartSourcep.isNull() && !showSelectionBeam) )
{
markDead();
return;
}
}
void LLHUDEffectSpiral::renderForTimer()
{
render();
}
| 24.017606 | 120 | 0.709867 | [
"render",
"object"
] |
4030ac9644993f3c0a5759747c8b6b60bbd60791 | 1,176 | cpp | C++ | filters/src/filter_plane.cpp | utarvl/core | 6720f254e202d2bc4b6a6a02915635a76ab9d7e9 | [
"Apache-2.0"
] | 2 | 2019-06-09T08:27:45.000Z | 2019-09-22T20:55:50.000Z | filters/src/filter_plane.cpp | utarvl/core | 6720f254e202d2bc4b6a6a02915635a76ab9d7e9 | [
"Apache-2.0"
] | null | null | null | filters/src/filter_plane.cpp | utarvl/core | 6720f254e202d2bc4b6a6a02915635a76ab9d7e9 | [
"Apache-2.0"
] | null | null | null | /*
* Cloud-based Object Recognition Engine (CORE)
*
*/
#include <core/filters/filter_plane.h>
int
filterPlaneModel (pcl::PointCloud<pcl::PointXYZRGB>::Ptr &cloud, float distance)
{
Eigen::VectorXf planecoeffs, coeffs;
pcl::PointIndices::Ptr
inliers (new pcl::PointIndices);
pcl::SampleConsensusModelPlane<pcl::PointXYZRGB>::Ptr
model_p (new pcl::SampleConsensusModelPlane<pcl::PointXYZRGB> (cloud));
pcl::ExtractIndices<pcl::PointXYZRGB> extract;
pcl::RandomSampleConsensus<pcl::PointXYZRGB> ransac (model_p);
ransac.setDistanceThreshold (distance);
ransac.computeModel ();
ransac.getInliers (inliers->indices);
ransac.getModelCoefficients (planecoeffs);
model_p->optimizeModelCoefficients (inliers->indices, planecoeffs, coeffs);
model_p->selectWithinDistance (coeffs, distance, inliers->indices);
if (inliers->indices.empty ())
return (-1);
// Remove the points that fit a plane from the cloud
pcl::ExtractIndices<pcl::PointXYZRGB> eifilter;
eifilter.setInputCloud (cloud);
eifilter.setIndices (inliers);
eifilter.setNegative (true);
eifilter.setKeepOrganized (true);
eifilter.filter (*cloud);
return (0);
}
| 29.4 | 80 | 0.740646 | [
"object"
] |
4031c559698a51387b6bbdc7514ac0f403bac590 | 2,537 | cc | C++ | ui/base/idle/idle_android.cc | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | ui/base/idle/idle_android.cc | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | ui/base/idle/idle_android.cc | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/base/idle/idle.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "base/memory/singleton.h"
#include "base/notreached.h"
#include "ui/base/idle/idle_internal.h"
#include "ui/base/ui_base_jni_headers/IdleDetector_jni.h"
using base::android::AttachCurrentThread;
using base::android::ConvertJavaStringToUTF8;
using base::android::ScopedJavaLocalRef;
namespace ui {
namespace {
class AndroidIdleMonitor {
public:
AndroidIdleMonitor() {
JNIEnv* env = AttachCurrentThread();
j_idle_manager_.Reset(Java_IdleDetector_create(env));
}
~AndroidIdleMonitor() {}
static AndroidIdleMonitor* GetInstance() {
// This class is constructed a single time whenever the
// first web page using the User Idle Detection API
// starts monitoring the idle state.
//
// Upon construction, a java object is instantiated and
// the Android broadcast receivers are registered to listen
// to the OS events.
//
// The singleton only gets destroyed when the browser exists,
// so the broadcast receivers never get unregistered. The
// events are rare and we respond very quickly to them.
//
// In addition to that, Android kills chrome regularly, so
// in practice the lifetime is reasonably scoped.
//
// This approach is consistent with the implementation on
// Macs.
return base::Singleton<AndroidIdleMonitor>::get();
}
int CalculateIdleTime() {
JNIEnv* env = AttachCurrentThread();
jlong result = Java_IdleDetector_getIdleTime(env, j_idle_manager_);
return result;
}
bool CheckIdleStateIsLocked() {
JNIEnv* env = AttachCurrentThread();
jboolean result = Java_IdleDetector_isScreenLocked(env, j_idle_manager_);
return result;
}
private:
base::android::ScopedJavaGlobalRef<jobject> j_idle_manager_;
};
} // namespace
int CalculateIdleTime() {
return AndroidIdleMonitor::GetInstance()->CalculateIdleTime();
}
bool CheckIdleStateIsLocked() {
if (IdleStateForTesting().has_value())
return IdleStateForTesting().value() == IDLE_STATE_LOCKED;
return AndroidIdleMonitor::GetInstance()->CheckIdleStateIsLocked();
}
IdleState CalculateIdleState(int idle_threshold) {
// TODO(crbug.com/878979): implementation pending.
NOTIMPLEMENTED();
return IdleState::IDLE_STATE_UNKNOWN;
}
} // namespace ui
| 28.829545 | 77 | 0.733544 | [
"object"
] |
40379114da70e989673c4195e50635e9c1323777 | 951 | cpp | C++ | Problems/Array/MonotoneArray.cpp | vishwajeet-hogale/LearnSTL | 0cbfc12b66ba844de23d7966d18cadc7b2d5a77f | [
"MIT"
] | null | null | null | Problems/Array/MonotoneArray.cpp | vishwajeet-hogale/LearnSTL | 0cbfc12b66ba844de23d7966d18cadc7b2d5a77f | [
"MIT"
] | null | null | null | Problems/Array/MonotoneArray.cpp | vishwajeet-hogale/LearnSTL | 0cbfc12b66ba844de23d7966d18cadc7b2d5a77f | [
"MIT"
] | null | null | null | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
bool isMonotonic(vector<int>& A) {
bool flag = true;
A.erase(unique(A.begin(),A.end()),A.end());
if(A.size()==1){
return true;
}
if(A[0]>=A[1]){
for(int i=1;i<A.size()-1;i++){
if(A[i]<A[i+1]){
flag = false;
}
}
}
else if(A[0]<=A[1]){
for(int i=1;i<A.size()-1;i++){
if(A[i]>A[i+1]){
flag = false;
}
}
}
return flag;
}
int main(){
vector<int> num;
num.push_back(1);
num.push_back(1);
num.push_back(2);
num.push_back(2);
num.push_back(1);
num.push_back(1);
num.push_back(2);
cout<<"Is the given array monotonic? "<<endl;
cout<<isMonotonic(num)<<endl;
return 0;
} | 23.775 | 51 | 0.410095 | [
"vector"
] |
403ea47f4e61b5c893d882168ff6f985bf95406d | 6,343 | cc | C++ | src/arith/domain_touched.cc | driazati/tvm | b76c817986040dc070d215cf32523d9b2adc8e8b | [
"Apache-2.0"
] | 1 | 2021-12-13T22:07:00.000Z | 2021-12-13T22:07:00.000Z | src/arith/domain_touched.cc | driazati/tvm | b76c817986040dc070d215cf32523d9b2adc8e8b | [
"Apache-2.0"
] | 7 | 2022-02-17T23:04:46.000Z | 2022-03-31T22:22:55.000Z | src/arith/domain_touched.cc | driazati/tvm | b76c817986040dc070d215cf32523d9b2adc8e8b | [
"Apache-2.0"
] | null | null | null | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/*!
* \file bound_deducer.cc
* \brief Utility to deduce bound of expression
*/
#include <tvm/runtime/registry.h>
#include <tvm/te/tensor.h>
#include <tvm/tir/expr.h>
#include <tvm/tir/stmt_functor.h>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
namespace tvm {
namespace arith {
using namespace tir;
namespace {
using BufferTouches = std::vector<std::vector<IntSet>>;
struct LoadAccess {
BufferTouches set;
};
struct StoreAccess {
BufferTouches set;
};
struct CombinedAccess {
BufferTouches set;
};
using BufferDomainAccess = std::tuple<LoadAccess, StoreAccess, CombinedAccess>;
} // namespace
// Find Read region of the tensor in the stmt.
class BufferTouchedDomain final : public StmtExprVisitor {
public:
BufferTouchedDomain(const Stmt& stmt) { operator()(stmt); }
std::unordered_map<const BufferNode*, BufferDomainAccess>& GetAccessedBufferRegions() {
return buffer_access_map_;
}
Region FindUnion(const Buffer& buffer, bool consider_loads, bool consider_stores) {
Region ret;
auto kv = buffer_access_map_.find(buffer.get());
if (kv == buffer_access_map_.end()) {
LOG(WARNING) << "[arith::BufferDomainTouched] "
<< "The requested buffer is not contained in the provided stmt body: " << buffer;
return ret;
}
Range none;
BufferTouches bounds;
if (consider_loads && consider_stores) {
bounds = std::get<CombinedAccess>(kv->second).set;
} else if (consider_loads) {
bounds = std::get<LoadAccess>(kv->second).set;
} else if (consider_stores) {
bounds = std::get<StoreAccess>(kv->second).set;
} else {
CHECK(false) << "Must consider at least on of either loads and stores, but both are false";
}
for (size_t i = 0; i < bounds.size(); ++i) {
ret.push_back(arith::Union(bounds[i]).CoverRange(none));
}
return ret;
}
void VisitStmt_(const ForNode* op) final {
const VarNode* var = op->loop_var.get();
dom_map_[var] = IntSet::FromRange(Range::FromMinExtent(op->min, op->extent));
StmtExprVisitor::VisitStmt_(op);
dom_map_.erase(var);
}
void VisitStmt_(const LetStmtNode* op) final {
dom_map_[op->var.get()] = arith::EvalSet(op->value, dom_map_);
StmtExprVisitor::VisitStmt_(op);
dom_map_.erase(op->var.get());
}
/* TODO: Thread extent unitest not generated.*/
void VisitStmt_(const AttrStmtNode* op) final {
if (op->attr_key == tir::attr::thread_extent) {
const IterVarNode* thread_axis = op->node.as<IterVarNode>();
ICHECK(thread_axis);
const VarNode* var = thread_axis->var.get();
dom_map_[var] = IntSet::FromRange(Range(make_zero(op->value.dtype()), op->value));
StmtExprVisitor::VisitStmt_(op);
dom_map_.erase(var);
} else {
StmtExprVisitor::VisitStmt_(op);
}
}
void VisitExpr_(const BufferLoadNode* op) final {
// Record load-exclusive buffer access
Touch(&std::get<LoadAccess>(buffer_access_map_[op->buffer.get()]).set, op->indices);
// Record load-store inclusive buffer access
Touch(&std::get<CombinedAccess>(buffer_access_map_[op->buffer.get()]).set, op->indices);
StmtExprVisitor::VisitExpr_(op);
}
void VisitStmt_(const BufferStoreNode* op) final {
// Record store-exclusive buffer access
Touch(&std::get<StoreAccess>(buffer_access_map_[op->buffer.get()]).set, op->indices);
// Record load-store inclusive buffer access
Touch(&std::get<CombinedAccess>(buffer_access_map_[op->buffer.get()]).set, op->indices);
StmtExprVisitor::VisitStmt_(op);
}
private:
void Touch(BufferTouches* bounds, const Array<PrimExpr>& args) const {
if (args.size() > bounds->size()) {
bounds->resize(args.size());
}
for (size_t i = 0; i < args.size(); ++i) {
if (args[i].as<RampNode>()) {
(*bounds)[i].emplace_back(IntSet::Vector(args[i]));
} else {
(*bounds)[i].emplace_back(EvalSet(args[i], dom_map_));
}
}
}
std::unordered_map<const BufferNode*, BufferDomainAccess> buffer_access_map_;
std::unordered_map<const VarNode*, IntSet> dom_map_;
};
Region DomainTouched(const Stmt& stmt, const Buffer& buffer, bool consider_loads,
bool consider_stores) {
return BufferTouchedDomain(stmt).FindUnion(buffer, consider_loads, consider_stores);
}
Map<Buffer, runtime::ADT> DomainTouchedAccessMap(const PrimFunc& func) {
auto buffer_access_map = BufferTouchedDomain(func->body).GetAccessedBufferRegions();
Map<Buffer, runtime::ADT> ret;
auto& buffer_map = func->buffer_map;
for (auto& var : func->params) {
auto& buffer = buffer_map[var];
auto& access = buffer_access_map[buffer.get()];
Array<Array<IntSet>> loads, stores, combined;
for (std::vector<IntSet>& touch : std::get<LoadAccess>(access).set) {
loads.push_back(Array<IntSet>(touch));
}
for (std::vector<IntSet>& touch : std::get<StoreAccess>(access).set) {
stores.push_back(Array<IntSet>(touch));
}
for (std::vector<IntSet>& touch : std::get<CombinedAccess>(access).set) {
combined.push_back(Array<IntSet>(touch));
}
std::vector<ObjectRef> fields;
fields.push_back(loads);
fields.push_back(stores);
fields.push_back(combined);
ret.Set(buffer, runtime::ADT::Tuple(fields));
}
return ret;
}
TVM_REGISTER_GLOBAL("arith.DomainTouched").set_body_typed(DomainTouched);
TVM_REGISTER_GLOBAL("arith.DomainTouchedAccessMap").set_body_typed(DomainTouchedAccessMap);
} // namespace arith
} // namespace tvm
| 33.209424 | 100 | 0.689421 | [
"vector"
] |
4041461a57c1cc70885035fc628b9a14d4baa832 | 6,537 | cpp | C++ | CppProject5_3D/CppProject5/src/models/ModelBank.cpp | Damoy/Tower3D | a6f1ec9fd5e7c26ade5528828cc576f5ed45394a | [
"MIT"
] | 1 | 2019-08-25T03:04:35.000Z | 2019-08-25T03:04:35.000Z | CppProject5_3D/CppProject5/src/models/ModelBank.cpp | Damoy/Tower3D | a6f1ec9fd5e7c26ade5528828cc576f5ed45394a | [
"MIT"
] | null | null | null | CppProject5_3D/CppProject5/src/models/ModelBank.cpp | Damoy/Tower3D | a6f1ec9fd5e7c26ade5528828cc576f5ed45394a | [
"MIT"
] | null | null | null | #include "ModelBank.h"
#include "loaders\ModelLoader.h"
#include "gameEngine\Configs.h"
namespace ModelBank {
namespace Textures {
const char* GREEN_TEXTURE_128x128 = "res/textures/green_128x128.png";
const char* GREEN_TEXTURE_16x16 = "res/textures/green_16x16.png";
const char* GLASS_TEXTURE_64x64 = "res/textures/glass_64x64.png";
const char* GRASS_TEXTURE_64x64 = "res/textures/grassGround_64x64.png";
const char* GROUND_TEXTURE_64x64 = "res/textures/ground_64x64.png";
const char* SPACE_TEXTURE_512x512 = "res/textures/bg_512x512.png";
const char* GROUND_TEXTURE_128x128 = "res/textures/groundTexTest_128x128.png";
const char* SELECT_TEXTURE_128x128 = "res/textures/select_128x128.png";
const char* SAMPLE_ASTEROID_TEXTURE_128x128 = "res/textures/asteroid1_128x128.png";
const char* SAMPLE_TOWER_TEXTURE_128x128 = "res/textures/sampleTower_128x128.png";
const char* SAMPLE_PROJECTILE_TEXTURE_128x128 = SAMPLE_TOWER_TEXTURE_128x128;
const char* SAMPLE_MAP_TEXTURE_128x128 = GREEN_TEXTURE_128x128;
const char* INTELLIGENT_TOWER_TEXTURE_128x128 = "res/textures/intelligentTower2_128x128.png";
const char* INTELLIGENT_PROJECTILE_TEXTURE_128x128 = INTELLIGENT_TOWER_TEXTURE_128x128;
const char* GUI_SELECTION_TEXTURE_128x128 = "res/textures/selectedTowerGUI_128x128.png";
const char* SPAWN_TEXTURE_128X128 = "res/textures/spawn_128x128.png";
}
namespace Models {
// possible only thanks to the static call to the static WindowManager creation
// ... Indeed glewInit() was called only at GameEngine creation
// which happens later than below
TexturedModel* tileSelectionModel = ModelLoader::getInstance("Loading tile selection model..")->loadFlatRectangleModel(ModelBank::Textures::SELECT_TEXTURE_128x128);
TexturedModel* sampleSelectionModel = ModelLoader::getInstance("Loading sample selection model..")->loadFlatRectangleModel(ModelBank::Textures::SAMPLE_TOWER_TEXTURE_128x128);
TexturedModel* intelligentSelectionModel = ModelLoader::getInstance("Loading intelligent selection model ..")->loadFlatRectangleModel(ModelBank::Textures::INTELLIGENT_TOWER_TEXTURE_128x128);
TexturedModel* sampleAsteroidModel = ModelLoader::getInstance("Loading sample asteroid model..")->loadCubeModel(ModelBank::Textures::SAMPLE_ASTEROID_TEXTURE_128x128, Configs::SAMPLE_ASTEROID_SIZE);
TexturedModel* sampleTowerModel = ModelLoader::getInstance("Loading sample tower model..")->loadCubeModel(ModelBank::Textures::SAMPLE_TOWER_TEXTURE_128x128, Configs::SAMPLE_TOWER_SIZE);
TexturedModel* sampleProjectileModel = ModelLoader::getInstance("Loading sample projectile model..")->loadCubeModel(ModelBank::Textures::SAMPLE_PROJECTILE_TEXTURE_128x128, Configs::SAMPLE_PROJECTILE_SIZE);
TexturedModel* intelligentTowerModel = ModelLoader::getInstance("Loading intelligent tower model..")->loadCubeModel(ModelBank::Textures::INTELLIGENT_TOWER_TEXTURE_128x128, Configs::INTELLIGENT_TOWER_SIZE);
TexturedModel* intelligentProjectileModel = ModelLoader::getInstance("Loading intelligent projectile model..")->loadCubeModel(ModelBank::Textures::INTELLIGENT_PROJECTILE_TEXTURE_128x128, Configs::INTELLIGENT_PROJECTILE_SIZE);
TexturedModel* spawnModel = ModelLoader::getInstance("Loading spawn model..")->loadCubeModel(ModelBank::Textures::SPAWN_TEXTURE_128X128, Configs::SPAWN_SIZE);
}
namespace Vertices {
const unsigned int REC_VERTICES_SIZE = 12 * sizeof(float);
const unsigned int CUBE_VERTICES_SIZE = 12 * 6 * sizeof(float);
float RECTANGLE_VERTICES[] = {
-0.5f, 0.5f, 0.0f,// top left
0.5f, 0.5f, 0.0f,// top right
0.5f, -0.5f, 0.0f,// bottom right
-0.5f, -0.5f, 0.0f,// bottom left
};
float RECTANGLE_VERTICES_2D[] = {
-1.0f, 1.0f,
-1.0f, -1.0f,
1.0f, 1.0f,
1.0f, -1.0f
};
float* generateRectangleVertices(float w, float h) {
float* rectVertices = new float[12]{
-w, h, 0.0f,
-w, -h, 0.0f,
w, h, 0.0f,
w, -h, 0.0f,
};
return rectVertices;
}
// cube vertices, tex ... info
// took on the net ofc
float* generateCubeVertices(float size) {
float* cubeVertices = new float[12 * 6]{
size, -size, -size,
size, -size, size,
-size, -size, size,
-size, -size, -size,
size, size, -size,
-size, size, -size,
-size, size, size,
size, size, size,
size, -size, -size,
size, size, -size,
size, size, size,
size, -size, size,
size, -size, size,
size, size, size,
-size, size, size,
-size, -size, size,
-size, -size, size,
-size, size, size,
-size, size, -size,
-size, -size, -size,
size, size, -size,
size, -size, -size,
-size, -size, -size,
-size, size, -size
};
return cubeVertices;
}
}
namespace Indices {
const unsigned int REC_INDICES_SIZE = 6 * sizeof(int);
const unsigned int CUBE_INDICES_SIZE = 12 * 3 * sizeof(int);
int RECTANGLE_INDICES[] = {
0, 1, 2, // top left triangle
2, 3, 0, // bot right triangle
};
int CUBE_INDICES[] = {
0, 1, 3,
3, 1, 2,
4, 5, 7,
7, 5, 6,
8, 9, 11,
11, 9, 10,
12, 13, 15,
15, 13, 14,
16, 17, 19,
19, 17, 18,
20, 21, 23,
23, 21, 22,
};
}
namespace TextureCoords {
const unsigned int REC_TEX_COORDS_SIZE = 8 * sizeof(float);
const unsigned int CUBE_TEX_COORDS_SIZE = 4 * 2 * 6 * sizeof(float);
float RECTANGLE_TEX_COORDS[] = {
0.0f, 0.0f, // top left
0.0f, 1.0f, // bot left
1.0f, 1.0f, // bot right
1.0f, 0.0f, // top right
};
float CUBE_TEX_COORDS[] = {
0, 0,
0, 1,
1, 1,
1, 0,
0, 0,
0, 1,
1, 1,
1, 0,
0, 0,
0, 1,
1, 1,
1, 0,
0, 0,
0, 1,
1, 1,
1, 0,
0, 0,
0, 1,
1, 1,
1, 0,
0, 0,
0, 1,
1, 1,
1, 0,
};
}
namespace Normals {
const unsigned int RECTANGLE_NORMALS_SIZE = 3 * 4 * sizeof(float);
const unsigned int CUBE_NORMALS_SIZE = 3 * 4 * 6 * sizeof(float);
float RECTANGLE_NORMALS[]{
-0.5f, 0.5f, 0.0f, // top left
0.5f, 0.5f, 0.0f,// top right
0.5f, -0.5f, 0.0f,// bottom right
-0.5f, -0.5f, 0.0f,// bottom left
};
float CUBE_NORMALS[] = {
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f
};
}
} | 28.545852 | 227 | 0.672327 | [
"model"
] |
4044e0399af9e4db38781821d142292ea92b2554 | 29,900 | cc | C++ | c++/test/TestReader.cc | PengleiShi/orc | 6b69228f52f13e33f0bdb35a84dd9902b7a969f9 | [
"Apache-2.0"
] | null | null | null | c++/test/TestReader.cc | PengleiShi/orc | 6b69228f52f13e33f0bdb35a84dd9902b7a969f9 | [
"Apache-2.0"
] | null | null | null | c++/test/TestReader.cc | PengleiShi/orc | 6b69228f52f13e33f0bdb35a84dd9902b7a969f9 | [
"Apache-2.0"
] | null | null | null | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <cstring>
#include "orc/Reader.hh"
#include "Reader.hh"
#include "Adaptor.hh"
#include "MemoryInputStream.hh"
#include "MemoryOutputStream.hh"
#include "wrap/gmock.h"
#include "wrap/gtest-wrapper.h"
namespace orc {
using ::testing::ElementsAreArray;
static const int DEFAULT_MEM_STREAM_SIZE = 1024 * 1024; // 1M
TEST(TestReader, testWriterVersions) {
EXPECT_EQ("original", writerVersionToString(WriterVersion_ORIGINAL));
EXPECT_EQ("HIVE-8732", writerVersionToString(WriterVersion_HIVE_8732));
EXPECT_EQ("HIVE-4243", writerVersionToString(WriterVersion_HIVE_4243));
EXPECT_EQ("HIVE-12055", writerVersionToString(WriterVersion_HIVE_12055));
EXPECT_EQ("HIVE-13083", writerVersionToString(WriterVersion_HIVE_13083));
EXPECT_EQ("future - 99",
writerVersionToString(static_cast<WriterVersion>(99)));
}
TEST(TestReader, testCompressionNames) {
EXPECT_EQ("none", compressionKindToString(CompressionKind_NONE));
EXPECT_EQ("zlib", compressionKindToString(CompressionKind_ZLIB));
EXPECT_EQ("snappy", compressionKindToString(CompressionKind_SNAPPY));
EXPECT_EQ("lzo", compressionKindToString(CompressionKind_LZO));
EXPECT_EQ("lz4", compressionKindToString(CompressionKind_LZ4));
EXPECT_EQ("zstd", compressionKindToString(CompressionKind_ZSTD));
EXPECT_EQ("unknown - 99",
compressionKindToString(static_cast<CompressionKind>(99)));
}
TEST(TestRowReader, computeBatchSize) {
uint64_t rowIndexStride = 100;
uint64_t rowsInCurrentStripe = 100 * 8 + 50;
std::vector<bool> includedRowGroups =
{ false, false, true, true, false, false, true, true, false };
EXPECT_EQ(0, RowReaderImpl::computeBatchSize(
1024, 0, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(0, RowReaderImpl::computeBatchSize(
1024, 50, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(200, RowReaderImpl::computeBatchSize(
1024, 200, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(150, RowReaderImpl::computeBatchSize(
1024, 250, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(0, RowReaderImpl::computeBatchSize(
1024, 550, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(100, RowReaderImpl::computeBatchSize(
1024, 700, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(50, RowReaderImpl::computeBatchSize(
50, 700, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(0, RowReaderImpl::computeBatchSize(
50, 810, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(0, RowReaderImpl::computeBatchSize(
50, 900, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
}
TEST(TestRowReader, advanceToNextRowGroup) {
uint64_t rowIndexStride = 100;
uint64_t rowsInCurrentStripe = 100 * 8 + 50;
std::vector<bool> includedRowGroups =
{ false, false, true, true, false, false, true, true, false };
EXPECT_EQ(200, RowReaderImpl::advanceToNextRowGroup(
0, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(200, RowReaderImpl::advanceToNextRowGroup(
150, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(250, RowReaderImpl::advanceToNextRowGroup(
250, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(350, RowReaderImpl::advanceToNextRowGroup(
350, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(350, RowReaderImpl::advanceToNextRowGroup(
350, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(600, RowReaderImpl::advanceToNextRowGroup(
500, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(699, RowReaderImpl::advanceToNextRowGroup(
699, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(799, RowReaderImpl::advanceToNextRowGroup(
799, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(850, RowReaderImpl::advanceToNextRowGroup(
800, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
EXPECT_EQ(850, RowReaderImpl::advanceToNextRowGroup(
900, rowsInCurrentStripe, rowIndexStride, includedRowGroups));
}
void CheckFileWithSargs(const char* fileName, const char* softwareVersion) {
std::stringstream ss;
if(const char* example_dir = std::getenv("ORC_EXAMPLE_DIR")) {
ss << example_dir;
} else {
ss << "../../../examples";
}
// Read a file with bloom filters written by CPP writer in version 1.6.11.
ss << "/" << fileName;
ReaderOptions readerOpts;
std::unique_ptr<Reader> reader =
createReader(readLocalFile(ss.str().c_str()), readerOpts);
EXPECT_EQ(WriterId::ORC_CPP_WRITER, reader->getWriterId());
EXPECT_EQ(softwareVersion, reader->getSoftwareVersion());
// Create SearchArgument with a EQUALS predicate which can leverage the bloom filters.
RowReaderOptions rowReaderOpts;
std::unique_ptr<SearchArgumentBuilder> sarg = SearchArgumentFactory::newBuilder();
// Integer value 18000000000 has an inconsistent hash before the fix of ORC-1024.
sarg->equals(1, PredicateDataType::LONG,Literal(static_cast<int64_t>(18000000000L)));
std::unique_ptr<SearchArgument> final_sarg = sarg->build();
rowReaderOpts.searchArgument(std::move(final_sarg));
std::unique_ptr<RowReader> rowReader = reader->createRowReader(rowReaderOpts);
// Make sure bad bloom filters won't affect the results.
std::unique_ptr<ColumnVectorBatch> batch =
rowReader->createRowBatch(1024);
EXPECT_TRUE(rowReader->next(*batch));
EXPECT_EQ(5, batch->numElements);
EXPECT_FALSE(rowReader->next(*batch));
}
TEST(TestRowReader, testSkipBadBloomFilters) {
CheckFileWithSargs("bad_bloom_filter_1.6.11.orc", "ORC C++ 1.6.11");
CheckFileWithSargs("bad_bloom_filter_1.6.0.orc", "ORC C++");
}
void verifySelection(const std::unique_ptr<Reader>& reader,
const RowReaderOptions::IdReadIntentMap& idReadIntentMap,
const std::vector<uint32_t>& expectedSelection) {
RowReaderOptions rowReaderOpts;
rowReaderOpts.includeTypesWithIntents(idReadIntentMap);
std::unique_ptr<RowReader> rowReader =
reader->createRowReader(rowReaderOpts);
std::vector<bool> expected(reader->getType().getMaximumColumnId() + 1,
false);
for (auto id : expectedSelection) {
expected[id] = true;
}
ASSERT_THAT(rowReader->getSelectedColumns(), ElementsAreArray(expected));
}
std::unique_ptr<Reader> createNestedListMemReader(MemoryOutputStream& memStream) {
MemoryPool* pool = getDefaultPool();
auto type = std::unique_ptr<Type>(
Type::buildTypeFromString("struct<"
"int_array:array<int>,"
"int_array_array_array:array<array<array<int>>>"
">"));
WriterOptions options;
options.setStripeSize(1024 * 1024)
.setCompressionBlockSize(1024)
.setCompression(CompressionKind_NONE)
.setMemoryPool(pool)
.setRowIndexStride(1000);
auto writer = createWriter(*type, &memStream, options);
auto batch = writer->createRowBatch(100);
auto& type0StructBatch = dynamic_cast<StructVectorBatch&>(*batch);
auto& type1ListBatch = dynamic_cast<ListVectorBatch&>(*type0StructBatch.fields[0]);
auto& type2LongBatch = dynamic_cast<LongVectorBatch&>(*type1ListBatch.elements);
auto& type3ListBatch = dynamic_cast<ListVectorBatch&>(*type0StructBatch.fields[1]);
auto& type4ListBatch = dynamic_cast<ListVectorBatch&>(*type3ListBatch.elements);
auto& type5ListBatch = dynamic_cast<ListVectorBatch&>(*type4ListBatch.elements);
auto& type6LongBatch = dynamic_cast<LongVectorBatch&>(*type5ListBatch.elements);
type6LongBatch.numElements = 3;
type6LongBatch.data[0] = 1;
type6LongBatch.data[1] = 2;
type6LongBatch.data[2] = 3;
type5ListBatch.numElements = 3;
type5ListBatch.offsets[0] = 0;
type5ListBatch.offsets[1] = 1;
type5ListBatch.offsets[2] = 2;
type5ListBatch.offsets[3] = 3;
type4ListBatch.numElements = 3;
type4ListBatch.offsets[0] = 0;
type4ListBatch.offsets[1] = 1;
type4ListBatch.offsets[2] = 2;
type4ListBatch.offsets[3] = 3;
type3ListBatch.numElements = 1;
type3ListBatch.offsets[0] = 0;
type3ListBatch.offsets[1] = 3;
type2LongBatch.numElements = 2;
type2LongBatch.data[0] = -1;
type2LongBatch.data[1] = -2;
type1ListBatch.numElements = 1;
type1ListBatch.offsets[0] = 0;
type1ListBatch.offsets[1] = 2;
type0StructBatch.numElements = 1;
writer->add(*batch);
writer->close();
std::unique_ptr<InputStream> inStream(
new MemoryInputStream(memStream.getData(), memStream.getLength()));
ReaderOptions readerOptions;
readerOptions.setMemoryPool(*pool);
return createReader(std::move(inStream), readerOptions);
}
TEST(TestReadIntent, testListAll) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedListMemReader(memStream);
// select all of int_array.
verifySelection(reader, {{1, ReadIntent_ALL}}, {0, 1, 2});
}
TEST(TestReadIntent, testListOffsets) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedListMemReader(memStream);
// select only the offsets of int_array.
verifySelection(reader, {{1, ReadIntent_OFFSETS}}, {0, 1});
// select only the offsets of int_array and the outermost offsets of
// int_array_array_array.
verifySelection(reader, {{1, ReadIntent_OFFSETS}, {3, ReadIntent_OFFSETS}}, {0, 1, 3});
// select the entire offsets of int_array_array_array without the elements.
verifySelection(reader, {{3, ReadIntent_OFFSETS}, {5, ReadIntent_OFFSETS}}, {0, 3, 4, 5});
}
TEST(TestReadIntent, testListAllAndOffsets) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedListMemReader(memStream);
// select all of int_array and only the outermost offsets of int_array_array_array.
verifySelection(reader, {{1, ReadIntent_ALL}, {3, ReadIntent_OFFSETS}}, {0, 1, 2, 3});
}
TEST(TestReadIntent, testListConflictingIntent) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedListMemReader(memStream);
// test conflicting ReadIntent on nested list.
verifySelection(reader, {{3, ReadIntent_OFFSETS}, {5, ReadIntent_ALL}}, {0, 3, 4, 5, 6});
verifySelection(reader, {{3, ReadIntent_ALL}, {5, ReadIntent_OFFSETS}}, {0, 3, 4, 5, 6});
}
TEST(TestReadIntent, testRowBatchContent) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedListMemReader(memStream);
// select all of int_array and only the offsets of int_array_array.
RowReaderOptions::IdReadIntentMap idReadIntentMap =
{{1, ReadIntent_ALL}, {3, ReadIntent_OFFSETS}};
RowReaderOptions rowReaderOpts;
rowReaderOpts.includeTypesWithIntents(idReadIntentMap);
std::unique_ptr<RowReader> rowReader =
reader->createRowReader(rowReaderOpts);
// Read a row batch.
std::unique_ptr<ColumnVectorBatch> batch =
rowReader->createRowBatch(1024);
EXPECT_TRUE(rowReader->next(*batch));
EXPECT_EQ(1, batch->numElements);
auto& structBatch = dynamic_cast<StructVectorBatch&>(*batch);
// verify content of int_array selection.
auto& intArrayBatch = dynamic_cast<ListVectorBatch&>(*structBatch.fields[0]);
auto& innerLongBatch = dynamic_cast<LongVectorBatch&>(*intArrayBatch.elements);
EXPECT_EQ(1, intArrayBatch.numElements);
EXPECT_NE(nullptr, intArrayBatch.offsets.data());
EXPECT_EQ(0, intArrayBatch.offsets.data()[0]);
EXPECT_EQ(2, intArrayBatch.offsets.data()[1]);
EXPECT_EQ(2, innerLongBatch.numElements);
EXPECT_NE(nullptr, innerLongBatch.data.data());
EXPECT_EQ(-1, innerLongBatch.data.data()[0]);
EXPECT_EQ(-2, innerLongBatch.data.data()[1]);
// verify content of int_array_array_array selection.
auto& intArrayArrayArrayBatch = dynamic_cast<ListVectorBatch&>(*structBatch.fields[1]);
EXPECT_EQ(1, intArrayArrayArrayBatch.numElements);
EXPECT_NE(nullptr, intArrayArrayArrayBatch.offsets.data());
EXPECT_EQ(0, intArrayArrayArrayBatch.offsets.data()[0]);
EXPECT_EQ(3, intArrayArrayArrayBatch.offsets.data()[1]);
EXPECT_EQ(nullptr, intArrayArrayArrayBatch.elements);
}
std::unique_ptr<Reader> createNestedMapMemReader(MemoryOutputStream& memStream) {
MemoryPool* pool = getDefaultPool();
auto type = std::unique_ptr<Type>(
Type::buildTypeFromString("struct<"
"id:int,"
"single_map:map<string,string>,"
"nested_map:map<string,map<string,map<string,string>>>"
">"));
WriterOptions options;
options.setStripeSize(1024 * 1024)
.setCompressionBlockSize(1024)
.setCompression(CompressionKind_NONE)
.setMemoryPool(pool)
.setRowIndexStride(1000);
auto writer = createWriter(*type, &memStream, options);
auto batch = writer->createRowBatch(100);
auto& type0StructBatch = dynamic_cast<StructVectorBatch&>(*batch);
auto& type1LongBatch = dynamic_cast<LongVectorBatch&>(*type0StructBatch.fields[0]);
auto& type2MapBatch = dynamic_cast<MapVectorBatch&>(*type0StructBatch.fields[1]);
auto& type3StringBatch = dynamic_cast<StringVectorBatch&>(*type2MapBatch.keys);
auto& type4StringBatch = dynamic_cast<StringVectorBatch&>(*type2MapBatch.elements);
auto& type5MapBatch = dynamic_cast<MapVectorBatch&>(*type0StructBatch.fields[2]);
auto& type6StringBatch = dynamic_cast<StringVectorBatch&>(*type5MapBatch.keys);
auto& type7MapBatch = dynamic_cast<MapVectorBatch&>(*type5MapBatch.elements);
auto& type8StringBatch = dynamic_cast<StringVectorBatch&>(*type7MapBatch.keys);
auto& type9MapBatch = dynamic_cast<MapVectorBatch&>(*type7MapBatch.elements);
auto& type10StringBatch = dynamic_cast<StringVectorBatch&>(*type9MapBatch.keys);
auto& type11StringBatch = dynamic_cast<StringVectorBatch&>(*type9MapBatch.elements);
std::string map2Key = "k0";
std::string map2Element = "v0";
std::string map5Key = "k1";
std::string map7Key = "k2";
std::string map9Key = "k3";
std::string map9Element = "v3";
type11StringBatch.numElements = 1;
type11StringBatch.data[0] = const_cast<char*>(map9Element.c_str());
type11StringBatch.length[0] = static_cast<int64_t>(map9Element.length());
type10StringBatch.numElements = 1;
type10StringBatch.data[0] = const_cast<char*>(map9Key.c_str());
type10StringBatch.length[0] = static_cast<int64_t>(map9Key.length());
type9MapBatch.numElements = 1;
type9MapBatch.offsets[0] = 0;
type9MapBatch.offsets[1] = 1;
type8StringBatch.numElements = 1;
type8StringBatch.data[0] = const_cast<char*>(map7Key.c_str());
type8StringBatch.length[0] = static_cast<int64_t>(map7Key.length());
type7MapBatch.numElements = 1;
type7MapBatch.offsets[0] = 0;
type7MapBatch.offsets[1] = 1;
type6StringBatch.numElements = 1;
type6StringBatch.data[0] = const_cast<char*>(map5Key.c_str());
type6StringBatch.length[0] = static_cast<int64_t>(map5Key.length());
type5MapBatch.numElements = 1;
type5MapBatch.offsets[0] = 0;
type5MapBatch.offsets[1] = 1;
type4StringBatch.numElements = 1;
type4StringBatch.data[0] = const_cast<char*>(map2Element.c_str());
type4StringBatch.length[0] = static_cast<int64_t>(map2Element.length());
type3StringBatch.numElements = 1;
type3StringBatch.data[0] = const_cast<char*>(map2Key.c_str());
type3StringBatch.length[0] = static_cast<int64_t>(map2Key.length());
type2MapBatch.numElements = 1;
type2MapBatch.offsets[0] = 0;
type2MapBatch.offsets[1] = 1;
type1LongBatch.numElements = 1;
type1LongBatch.data[0] = 0;
type0StructBatch.numElements = 1;
writer->add(*batch);
writer->close();
std::unique_ptr<InputStream> inStream(
new MemoryInputStream(memStream.getData(), memStream.getLength()));
ReaderOptions readerOptions;
readerOptions.setMemoryPool(*pool);
return createReader(std::move(inStream), readerOptions);
}
TEST(TestReadIntent, testMapAll) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedMapMemReader(memStream);
// select all of single_map.
verifySelection(reader, {{2, ReadIntent_ALL}}, {0, 2, 3, 4});
}
TEST(TestReadIntent, testMapOffsets) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedMapMemReader(memStream);
// select only the offsets of single_map.
verifySelection(reader, {{2, ReadIntent_OFFSETS}}, {0, 2});
// select only the offsets of single_map and the outermost offsets of nested_map.
verifySelection(reader, {{2, ReadIntent_OFFSETS}, {5, ReadIntent_OFFSETS}}, {0, 2, 5});
// select the entire offsets of nested_map without the map items of the innermost map.
verifySelection(reader, {{5, ReadIntent_OFFSETS}, {9, ReadIntent_OFFSETS}}, {0, 5, 7, 9});
}
TEST(TestReadIntent, testMapAllAndOffsets) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedMapMemReader(memStream);
// select all of single_map and only the outermost offsets of nested_map.
verifySelection(reader, {{2, ReadIntent_ALL}, {5, ReadIntent_OFFSETS}}, {0, 2, 3, 4, 5});
}
TEST(TestReadIntent, testMapConflictingIntent) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedMapMemReader(memStream);
// test conflicting ReadIntent on nested_map.
verifySelection(reader, {{5, ReadIntent_OFFSETS}, {9, ReadIntent_ALL}}, {0, 5, 7, 9, 10, 11});
verifySelection(reader, {{5, ReadIntent_ALL}, {9, ReadIntent_OFFSETS}},
{0, 5, 6, 7, 8, 9, 10, 11});
verifySelection(reader, {{5, ReadIntent_OFFSETS}, {7, ReadIntent_ALL}, {9, ReadIntent_OFFSETS}},
{0, 5, 7, 8, 9, 10, 11});
}
TEST(TestReadIntent, testMapRowBatchContent) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedMapMemReader(memStream);
// select all of single_map and only the offsets of nested_map.
RowReaderOptions::IdReadIntentMap idReadIntentMap = {{2, ReadIntent_ALL},
{5, ReadIntent_OFFSETS}};
RowReaderOptions rowReaderOpts;
rowReaderOpts.includeTypesWithIntents(idReadIntentMap);
std::unique_ptr<RowReader> rowReader = reader->createRowReader(rowReaderOpts);
// Read a row batch.
std::unique_ptr<ColumnVectorBatch> batch = rowReader->createRowBatch(1024);
EXPECT_TRUE(rowReader->next(*batch));
EXPECT_EQ(1, batch->numElements);
auto& structBatch = dynamic_cast<StructVectorBatch&>(*batch);
// verify content of single_map selection.
auto& mapBatch = dynamic_cast<MapVectorBatch&>(*structBatch.fields[0]);
auto& keyBatch = dynamic_cast<StringVectorBatch&>(*mapBatch.keys);
auto& valueBatch = dynamic_cast<StringVectorBatch&>(*mapBatch.elements);
EXPECT_EQ(1, mapBatch.numElements);
EXPECT_NE(nullptr, mapBatch.offsets.data());
EXPECT_EQ(0, mapBatch.offsets.data()[0]);
EXPECT_EQ(1, mapBatch.offsets.data()[1]);
// verify key content.
EXPECT_EQ(1, keyBatch.numElements);
EXPECT_NE(nullptr, keyBatch.length.data());
EXPECT_NE(nullptr, keyBatch.data.data());
EXPECT_EQ(2, keyBatch.length.data()[0]);
EXPECT_EQ(0, strncmp("k0", keyBatch.data.data()[0], 2));
// verify value content.
EXPECT_EQ(1, valueBatch.numElements);
EXPECT_NE(nullptr, valueBatch.length.data());
EXPECT_NE(nullptr, valueBatch.data.data());
EXPECT_EQ(2, valueBatch.length.data()[0]);
EXPECT_EQ(0, strncmp("v0", valueBatch.data.data()[0], 2));
// verify content of nested_map selection.
auto& nestedMapBatch = dynamic_cast<MapVectorBatch&>(*structBatch.fields[1]);
EXPECT_EQ(1, nestedMapBatch.numElements);
EXPECT_NE(nullptr, nestedMapBatch.offsets.data());
EXPECT_EQ(0, nestedMapBatch.offsets.data()[0]);
EXPECT_EQ(1, nestedMapBatch.offsets.data()[1]);
EXPECT_EQ(nullptr, nestedMapBatch.keys);
EXPECT_EQ(nullptr, nestedMapBatch.elements);
}
std::unique_ptr<Reader> createNestedUnionMemReader(MemoryOutputStream& memStream) {
MemoryPool* pool = getDefaultPool();
auto type = std::unique_ptr<Type>(
Type::buildTypeFromString("struct<"
"id:int,"
"single_union:uniontype<int,string>,"
"nested_union:uniontype<uniontype<int,uniontype<int,string>>,int>"
">"));
WriterOptions options;
options.setStripeSize(1024 * 1024)
.setCompressionBlockSize(1024)
.setCompression(CompressionKind_NONE)
.setMemoryPool(pool)
.setRowIndexStride(1000);
auto writer = createWriter(*type, &memStream, options);
auto batch = writer->createRowBatch(100);
auto& type0StructBatch = dynamic_cast<StructVectorBatch&>(*batch);
auto& type1LongBatch = dynamic_cast<LongVectorBatch&>(*type0StructBatch.fields[0]);
auto& type2UnionBatch = dynamic_cast<UnionVectorBatch&>(*type0StructBatch.fields[1]);
auto& type3LongBatch = dynamic_cast<LongVectorBatch&>(*type2UnionBatch.children[0]);
auto& type4StringBatch = dynamic_cast<StringVectorBatch&>(*type2UnionBatch.children[1]);
auto& type5UnionBatch = dynamic_cast<UnionVectorBatch&>(*type0StructBatch.fields[2]);
auto& type6UnionBatch = dynamic_cast<UnionVectorBatch&>(*type5UnionBatch.children[0]);
auto& type7LongBatch = dynamic_cast<LongVectorBatch&>(*type6UnionBatch.children[0]);
auto& type8UnionBatch = dynamic_cast<UnionVectorBatch&>(*type6UnionBatch.children[1]);
auto& type9LongBatch = dynamic_cast<LongVectorBatch&>(*type8UnionBatch.children[0]);
auto& type10StringBatch = dynamic_cast<StringVectorBatch&>(*type8UnionBatch.children[1]);
auto& type11LongBatch = dynamic_cast<LongVectorBatch&>(*type5UnionBatch.children[1]);
std::string string4Element = "s1";
std::string string10Element = "n1";
// first row
type1LongBatch.data[0] = 0;
type2UnionBatch.tags[0] = 0;
type2UnionBatch.offsets[0] = 0;
type3LongBatch.data[0] = 0;
type5UnionBatch.tags[0] = 0;
type5UnionBatch.offsets[0] = 0;
type6UnionBatch.tags[0] = 1;
type6UnionBatch.offsets[0] = 0;
type8UnionBatch.tags[0] = 0;
type8UnionBatch.offsets[0] = 0;
type9LongBatch.data[0] = 1;
// second row
type1LongBatch.data[1] = 1;
type2UnionBatch.tags[1] = 1;
type2UnionBatch.offsets[1] = 0;
type4StringBatch.data[0] = const_cast<char*>(string4Element.c_str());
type4StringBatch.length[0] = static_cast<int64_t>(string4Element.length());
type5UnionBatch.tags[1] = 0;
type5UnionBatch.offsets[1] = 1;
type6UnionBatch.tags[1] = 1;
type6UnionBatch.offsets[1] = 1;
type8UnionBatch.tags[1] = 1;
type8UnionBatch.offsets[1] = 0;
type10StringBatch.data[0] = const_cast<char*>(string10Element.c_str());
type10StringBatch.length[0] = static_cast<int64_t>(string10Element.length());
// update numElements
type11LongBatch.numElements = 0;
type10StringBatch.numElements = 1;
type9LongBatch.numElements = 1;
type8UnionBatch.numElements = 2;
type7LongBatch.numElements = 0;
type6UnionBatch.numElements = 2;
type5UnionBatch.numElements = 2;
type4StringBatch.numElements = 1;
type3LongBatch.numElements = 1;
type2UnionBatch.numElements = 2;
type1LongBatch.numElements = 2;
type0StructBatch.numElements = 2;
writer->add(*batch);
writer->close();
std::unique_ptr<InputStream> inStream(
new MemoryInputStream(memStream.getData(), memStream.getLength()));
ReaderOptions readerOptions;
readerOptions.setMemoryPool(*pool);
return createReader(std::move(inStream), readerOptions);
}
TEST(TestReadIntent, testUnionAll) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedUnionMemReader(memStream);
// select all of single_union.
verifySelection(reader, {{2, ReadIntent_ALL}}, {0, 2, 3, 4});
}
TEST(TestReadIntent, testUnionOffsets) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedUnionMemReader(memStream);
// select only the offsets of single_union.
verifySelection(reader, {{2, ReadIntent_OFFSETS}}, {0, 2});
// select only the offsets of single_union and the outermost offsets of nested_union.
verifySelection(reader, {{2, ReadIntent_OFFSETS}, {5, ReadIntent_OFFSETS}}, {0, 2, 5});
// select only the offsets of single_union and the innermost offsets of nested_union.
verifySelection(reader, {{2, ReadIntent_OFFSETS}, {8, ReadIntent_OFFSETS}},
{0, 2, 5, 6, 7, 8, 11});
}
TEST(TestReadIntent, testUnionAllAndOffsets) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedUnionMemReader(memStream);
// select all of single_union and only the outermost offsets of nested_union.
verifySelection(reader, {{2, ReadIntent_ALL}, {5, ReadIntent_OFFSETS}}, {0, 2, 3, 4, 5});
}
TEST(TestReadIntent, testUnionConflictingIntent) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedUnionMemReader(memStream);
// test conflicting ReadIntent on nested_union.
verifySelection(reader, {{5, ReadIntent_OFFSETS}, {8, ReadIntent_ALL}},
{0, 5, 6, 7, 8, 9, 10, 11});
verifySelection(reader, {{5, ReadIntent_ALL}, {8, ReadIntent_OFFSETS}},
{0, 5, 6, 7, 8, 9, 10, 11});
verifySelection(reader, {{5, ReadIntent_OFFSETS}, {6, ReadIntent_ALL}, {8, ReadIntent_OFFSETS}},
{0, 5, 6, 7, 8, 9, 10, 11});
}
TEST(TestReadIntent, testUnionRowBatchContent) {
MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);
std::unique_ptr<Reader> reader = createNestedUnionMemReader(memStream);
// select all of single_union and only the offsets of nested_union.
RowReaderOptions::IdReadIntentMap idReadIntentMap = {{2, ReadIntent_ALL},
{5, ReadIntent_OFFSETS}};
RowReaderOptions rowReaderOpts;
rowReaderOpts.includeTypesWithIntents(idReadIntentMap);
std::unique_ptr<RowReader> rowReader = reader->createRowReader(rowReaderOpts);
// Read a row batch.
std::unique_ptr<ColumnVectorBatch> batch = rowReader->createRowBatch(1024);
EXPECT_TRUE(rowReader->next(*batch));
EXPECT_EQ(2, batch->numElements);
auto& structBatch = dynamic_cast<StructVectorBatch&>(*batch);
// verify content of single_union selection.
auto& unionBatch = dynamic_cast<UnionVectorBatch&>(*structBatch.fields[0]);
EXPECT_EQ(2, unionBatch.numElements);
EXPECT_EQ(2, unionBatch.children.size());
auto& longBatch = dynamic_cast<LongVectorBatch&>(*unionBatch.children[0]);
auto& stringBatch = dynamic_cast<StringVectorBatch&>(*unionBatch.children[1]);
EXPECT_EQ(1, longBatch.numElements);
EXPECT_EQ(1, stringBatch.numElements);
EXPECT_NE(nullptr, unionBatch.tags.data());
EXPECT_NE(nullptr, unionBatch.offsets.data());
EXPECT_NE(nullptr, longBatch.data.data());
EXPECT_NE(nullptr, stringBatch.length.data());
// verify content of the first row.
EXPECT_EQ(0, unionBatch.tags.data()[0]);
EXPECT_EQ(0, unionBatch.offsets.data()[0]);
EXPECT_EQ(0, longBatch.data.data()[0]);
// verify content of the second row.
EXPECT_EQ(1, unionBatch.tags.data()[1]);
EXPECT_EQ(0, unionBatch.offsets.data()[1]);
EXPECT_EQ(2, stringBatch.length.data()[0]);
EXPECT_EQ(0, strncmp("s1", stringBatch.data.data()[0], 2));
// verify content of nested_union selection.
auto& nestedUnionBatch = dynamic_cast<UnionVectorBatch&>(*structBatch.fields[1]);
EXPECT_EQ(2, nestedUnionBatch.numElements);
EXPECT_EQ(0, nestedUnionBatch.children.size());
EXPECT_NE(nullptr, nestedUnionBatch.tags.data());
EXPECT_NE(nullptr, nestedUnionBatch.offsets.data());
// verify that tags and offsets are still read.
EXPECT_EQ(0, nestedUnionBatch.tags.data()[0]);
EXPECT_EQ(0, nestedUnionBatch.tags.data()[1]);
EXPECT_EQ(0, nestedUnionBatch.offsets.data()[0]);
EXPECT_EQ(1, nestedUnionBatch.offsets.data()[1]);
}
} // namespace
| 44.230769 | 100 | 0.711003 | [
"vector"
] |
404b2c13cdd5f8d06c09f87a654c984059ca1e05 | 10,657 | cc | C++ | onnxruntime/core/optimizer/dynamic_quantize_matmul_fusion.cc | sriduth/onnxruntime | b2da700e4d953239833e40f9a1b39b15936cc6dd | [
"MIT"
] | 1 | 2020-10-21T11:54:26.000Z | 2020-10-21T11:54:26.000Z | onnxruntime/core/optimizer/dynamic_quantize_matmul_fusion.cc | sriduth/onnxruntime | b2da700e4d953239833e40f9a1b39b15936cc6dd | [
"MIT"
] | null | null | null | onnxruntime/core/optimizer/dynamic_quantize_matmul_fusion.cc | sriduth/onnxruntime | b2da700e4d953239833e40f9a1b39b15936cc6dd | [
"MIT"
] | 1 | 2020-09-11T02:23:48.000Z | 2020-09-11T02:23:48.000Z | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "dynamic_quantize_matmul_fusion.h"
#include "core/graph/graph_utils.h"
#include "core/optimizer/initializer.h"
#include "core/optimizer/utils.h"
#include <deque>
using namespace ONNX_NAMESPACE;
using namespace ::onnxruntime::common;
namespace onnxruntime {
// Check if bias is a 1-D tensor, or N-D tensor with the prior N-1 dimension equal to 1.
// And its last dimension equal to MatMul's last dimension
static bool CheckBiasShape(const TensorShapeProto* bias_shape, const TensorShapeProto* matmul_shape) {
if (nullptr == matmul_shape || matmul_shape->dim_size() <= 1 ||
nullptr == bias_shape || bias_shape->dim_size() < 1) {
return false;
}
// First N-1 dimension must equal to 1
for (int i = 0; i < bias_shape->dim_size() - 1; i++) {
if (bias_shape->dim(i).dim_value() != 1) {
return false;
}
}
int64_t bias_last_dim = bias_shape->dim(bias_shape->dim_size() - 1).dim_value();
int64_t matmul_last_dim = matmul_shape->dim(matmul_shape->dim_size() - 1).dim_value();
return bias_last_dim == matmul_last_dim && bias_last_dim > 0;
}
/**
DynamicQuantizeMatMulFusion will fuse subgraph like below into DynamicQuantizeMatMul:
(input)
|
v
DynamicQuantizeLinear --------+
| |
v v
MatMulInteger (B const) Mul (B const) (input)
| | |
v v v
Cast ------------------>Mul ----> DynamicQuantizeMatMul
| |
v v
Add (B const, Optional) (output)
|
v
(output)
It also fuses subgraph like below into MatMulIntegerToFloat:
input input
| |
v v
+----------------------------DynamicQuantizeLinear------------------------+ DynamicQuantizeLinear
| | | |
| +----------------+--------------+ | +---------+----------+
| | | | | |
V v v v V v
MatMulInteger(B const) Mul(B const) MatMulInteger (B const) Mul (B const) ---> MatMulIntegerToFloat MatMulIntegerToFloat
| | | | | |
v v v v v v
Cast ---------------->Mul Cast ---------------->Mul (output1) ----------(output2)
| |
v v
Add (B const, Optional) Add (B const, Optional)
| |
v v
(output1) (output2)
*/
Status DynamicQuantizeMatMulFusion::ApplyImpl(Graph& graph, bool& modified, int graph_level, const logging::Logger& logger) const {
GraphViewer graph_viewer(graph);
const auto& node_topology_list = graph_viewer.GetNodesInTopologicalOrder();
std::vector<std::reference_wrapper<Node>> nodes_to_remove;
for (auto node_index : node_topology_list) {
auto* node_ptr = graph.GetNode(node_index);
if (nullptr == node_ptr)
continue; // node was removed
auto& mul_node = *node_ptr;
ORT_RETURN_IF_ERROR(Recurse(mul_node, modified, graph_level, logger));
if (!graph_utils::IsSupportedOptypeVersionAndDomain(mul_node, "Mul", {7, 13}) ||
!graph_utils::IsSupportedProvider(mul_node, GetCompatibleExecutionProviders())) {
continue;
}
// Left Parents path
std::vector<graph_utils::EdgeEndToMatch> left_parent_path{
{0, 0, "Cast", {6, 9, 13}, kOnnxDomain},
{0, 0, "MatMulInteger", {10}, kOnnxDomain},
{0, 0, "DynamicQuantizeLinear", {11}, kOnnxDomain}};
std::vector<graph_utils::EdgeEndToMatch> right_parent_path{
{0, 1, "Mul", {7, 13}, kOnnxDomain},
{1, 0, "DynamicQuantizeLinear", {11}, kOnnxDomain}};
std::vector<std::reference_wrapper<Node>> left_nodes;
std::vector<std::reference_wrapper<Node>> right_nodes;
if (!graph_utils::FindPath(graph, mul_node, true, left_parent_path, left_nodes, logger) ||
!graph_utils::FindPath(graph, mul_node, true, right_parent_path, right_nodes, logger)) {
continue;
}
Node& cast_node = left_nodes[0];
Node& matmulinteger_node = left_nodes[1];
Node& dql_node_left = left_nodes[2];
Node& mul_node_right = right_nodes[0];
Node& dql_node_right = right_nodes[1];
// Check if left DynamicQuantizeLinear is same as right DynamicQuantizeLinear
if (dql_node_left.Index() != dql_node_right.Index()) {
continue;
}
// Check Nodes' Edges count and Nodes' outputs are not in Graph output
if (!optimizer_utils::CheckOutputEdges(graph, cast_node, 1) ||
!optimizer_utils::CheckOutputEdges(graph, matmulinteger_node, 1) ||
!optimizer_utils::CheckOutputEdges(graph, mul_node_right, 1)) {
continue;
}
const NodeArg& matmulinteger_B = *(matmulinteger_node.InputDefs()[1]);
if (!graph_utils::IsConstantInitializer(graph, matmulinteger_B.Name(), true)) {
continue;
}
const NodeArg& mul_right_B = *(mul_node_right.InputDefs()[1]);
if (!graph_utils::IsConstantInitializer(graph, mul_right_B.Name(), true)) {
continue;
}
// Find bias node
Node* add_node = nullptr;
// const Node* add_node = FindBiasNode(graph, mul_node, ;
if (optimizer_utils::CheckOutputEdges(graph, mul_node, 1)) {
const Node* tmp_add_node = graph_utils::FirstChildByType(mul_node, "Add");
if (nullptr != tmp_add_node) {
const NodeArg& tmp_add_node_B = *(tmp_add_node->InputDefs()[1]);
if (graph_utils::IsConstantInitializer(graph, tmp_add_node_B.Name(), true) &&
CheckBiasShape(tmp_add_node_B.Shape(), matmulinteger_B.Shape())) {
add_node = graph.GetNode(tmp_add_node->Index());
}
}
}
// DynamicQuantizeLinear outputs are only used by one MatMulInteger,
// thus it can fused into DynamicQuantizeMatMul
NodeArg optional_node_arg("", nullptr);
std::vector<NodeArg*> input_defs;
std::string op_type_to_fuse = "DynamicQuantizeMatMul";
if (optimizer_utils::CheckOutputEdges(graph, dql_node_left, 3)) {
input_defs.push_back(dql_node_left.MutableInputDefs()[0]);
input_defs.push_back(matmulinteger_node.MutableInputDefs()[1]);
input_defs.push_back(mul_node_right.MutableInputDefs()[1]);
input_defs.push_back(&optional_node_arg);
if (matmulinteger_node.InputDefs().size() == 4) {
const NodeArg& matmulinteger_B_zp = *(matmulinteger_node.InputDefs()[3]);
if (!graph_utils::IsConstantInitializer(graph, matmulinteger_B_zp.Name(), true)) {
continue;
}
input_defs[3] = matmulinteger_node.MutableInputDefs()[3];
}
nodes_to_remove.push_back(dql_node_left);
} else {
op_type_to_fuse = "MatMulIntegerToFloat";
input_defs.push_back(matmulinteger_node.MutableInputDefs()[0]);
input_defs.push_back(matmulinteger_node.MutableInputDefs()[1]);
input_defs.push_back(mul_node_right.MutableInputDefs()[0]);
input_defs.push_back(mul_node_right.MutableInputDefs()[1]);
input_defs.push_back(&optional_node_arg);
input_defs.push_back(&optional_node_arg);
if (matmulinteger_node.InputDefs().size() >= 3) {
// Add zero point of A
input_defs[4] = matmulinteger_node.MutableInputDefs()[2];
// Add zero point of B
if (matmulinteger_node.InputDefs().size() == 4) {
const NodeArg& matmulinteger_B_zp = *(matmulinteger_node.InputDefs()[3]);
if (!graph_utils::IsConstantInitializer(graph, matmulinteger_B_zp.Name(), true)) {
continue;
}
input_defs[5] = matmulinteger_node.MutableInputDefs()[3];
}
}
}
if (add_node != nullptr) {
input_defs.push_back(add_node->MutableInputDefs()[1]);
}
Node* fused_node = &graph.AddNode(graph.GenerateNodeName(op_type_to_fuse),
op_type_to_fuse,
"",
input_defs,
add_node != nullptr ? add_node->MutableOutputDefs() : mul_node.MutableOutputDefs(),
nullptr,
kMSDomain);
// Assign provider to this new node. Provider should be same as the provider for old node.
ORT_ENFORCE(nullptr != fused_node);
fused_node->SetExecutionProviderType(mul_node.GetExecutionProviderType());
nodes_to_remove.push_back(matmulinteger_node);
nodes_to_remove.push_back(cast_node);
nodes_to_remove.push_back(mul_node_right);
nodes_to_remove.push_back(mul_node);
if (add_node != nullptr) {
nodes_to_remove.push_back(*add_node);
}
}
for (const auto& node : nodes_to_remove) {
graph_utils::RemoveNodeOutputEdges(graph, node);
graph.RemoveNode(node.get().Index());
}
modified = true;
return Status::OK();
}
} // namespace onnxruntime
| 45.738197 | 151 | 0.522943 | [
"shape",
"vector"
] |
404b395c96d85975a3450f952d821cfc7a42f709 | 19,938 | cc | C++ | onnxruntime/contrib_ops/cpu/tokenizer.cc | CaseyCarter/onnxruntime | 4cc7121368a033ec0d2925c0dfcd6de1774fdd9c | [
"MIT"
] | null | null | null | onnxruntime/contrib_ops/cpu/tokenizer.cc | CaseyCarter/onnxruntime | 4cc7121368a033ec0d2925c0dfcd6de1774fdd9c | [
"MIT"
] | null | null | null | onnxruntime/contrib_ops/cpu/tokenizer.cc | CaseyCarter/onnxruntime | 4cc7121368a033ec0d2925c0dfcd6de1774fdd9c | [
"MIT"
] | null | null | null | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "core/common/common.h"
#include "core/framework/tensor.h"
#include "core/framework/op_kernel.h"
#include "core/graph/onnx_protobuf.h"
#include "onnx/defs/schema.h"
#include "core/common/utf8_util.h"
#include "re2/re2.h"
#include <codecvt>
#include <locale>
namespace onnxruntime {
namespace contrib {
class Tokenizer final : public OpKernel {
public:
explicit Tokenizer(const OpKernelInfo& info);
Tokenizer(const Tokenizer&) = delete;
Tokenizer& operator=(const Tokenizer&) = delete;
~Tokenizer() = default;
Status Compute(OpKernelContext* context) const override;
private:
Status CharTokenize(OpKernelContext* context, size_t N, size_t C,
const std::vector<int64_t>& input_dims) const;
Status SeparatorTokenize(OpKernelContext* context, size_t N, size_t C,
const std::vector<int64_t>& input_dims) const;
Status ExpressionTokenize(OpKernelContext* ctx,
size_t N, size_t C,
const std::vector<int64_t>& input_dims) const;
bool mark_;
std::string pad_value_;
int64_t mincharnum_;
bool char_tokenezation_;
struct SearchData;
std::unique_ptr<SearchData> search_data_;
std::unique_ptr<re2::RE2> regex_;
};
using namespace utf8_util;
ONNX_CPU_OPERATOR_TYPED_MS_KERNEL(
Tokenizer,
1,
string,
KernelDefBuilder()
.TypeConstraint("T", DataTypeImpl::GetTensorType<std::string>()),
contrib::Tokenizer);
namespace tokenizer_details {
const char start_text = 0x2;
const char end_text = 0x3;
const std::string conv_error("Conversion Error");
const std::wstring wconv_error(L"Conversion Error");
// Use a Trie like structure for searching multiple strings
// at once but convert it to a ternary tree for saving space.
// We insert separators in the same order they are specified.
// Template parameter is a CharT which can be a char/wchar_t
// or anything else that supports operator ><,== as long as
// this is not a variable length sequence. We convert utf8 to utf16
// before inserting.
// Value is a supplementary information useful for search hit
// and is present in the nodes that terminate the whole search pattern
template <class CharT, class Value>
class TernarySearchTree {
private:
struct Node {
std::unique_ptr<Node> left_;
std::unique_ptr<Node> mid_;
std::unique_ptr<Node> right_;
CharT c_; // character
Value value_;
bool has_val_;
explicit Node(CharT c) : c_(c), value_(), has_val_(false) {
}
~Node() = default;
};
struct GetState {
const CharT* const str_;
const size_t len_;
size_t depth_;
const Value* result_;
};
public:
TernarySearchTree() = default;
~TernarySearchTree() = default;
/**
* Returns a ptr to an associated value and nullptr on search miss.
* Must use default constructed state.
*/
const Value* get(const CharT* str, size_t len) const {
if (len == 0) {
return nullptr;
}
GetState get_state{str, len, 0, nullptr};
get(root_.get(), get_state);
return get_state.result_;
}
/**
* Returns true if successful and false on empty strings
* and duplicates.
*/
bool put(const CharT* str, size_t len, const Value& v) {
if (len < 1) {
assert(false);
return false;
}
Node* new_root = put(root_.get(), str, len, v, 0);
if (new_root != nullptr) {
root_.release();
root_.reset(new_root);
return true;
}
return false;
}
private:
void update_state(const Node* node, GetState& state) const {
if (node->has_val_) {
if (state.result_ == nullptr) {
state.result_ = &node->value_;
} else if (node->value_ < *state.result_) {
state.result_ = &node->value_;
}
}
}
void get(const Node* node, GetState& state) const {
if (node == nullptr) {
return;
}
assert(state.depth_ < state.len_);
CharT c = state.str_[state.depth_];
if (c < node->c_) {
get(node->left_.get(), state);
return;
} else if (c > node->c_) {
get(node->right_.get(), state);
return;
} else if (state.depth_ < (state.len_ - 1)) {
// Check if we have a match at this node
update_state(node, state);
if (node->mid_ != nullptr) {
++state.depth_;
get(node->mid_.get(), state);
}
return;
}
update_state(node, state);
}
Node* put(Node* node, const CharT* str, size_t len, const Value& v, size_t depth) {
CharT c = str[depth];
std::unique_ptr<Node> new_node;
if (node == nullptr) {
new_node.reset(new Node(c));
}
Node* new_link = nullptr;
Node* n = (node != nullptr) ? node : new_node.get();
if (c < n->c_) {
new_link = put(n->left_.get(), str, len, v, depth);
if (new_link != nullptr) {
n->left_.release();
n->left_.reset(new_link);
}
} else if (c > n->c_) {
new_link = put(n->right_.get(), str, len, v, depth);
if (new_link != nullptr) {
n->right_.release();
n->right_.reset(new_link);
}
} else if (depth < (len - 1)) {
new_link = put(n->mid_.get(), str, len, v, depth + 1);
if (new_link != nullptr) {
n->mid_.release();
n->mid_.reset(new_link);
}
} else {
if (!n->has_val_) {
n->value_ = v;
n->has_val_ = true;
new_link = n;
}
}
if (new_link != nullptr) {
new_node.release();
return n;
}
return nullptr;
}
std::unique_ptr<Node> root_;
};
// We store the length of the original pattern within the
// Ternary Tree. This allows us to cut out the length of the matching
// separator from the original string.
struct SearchValue {
size_t w_len;
int priority_;
bool operator<(const SearchValue& o) const {
return priority_ < o.priority_;
}
};
} // namespace tokenizer_details
using namespace tokenizer_details;
struct Tokenizer::SearchData {
TernarySearchTree<wchar_t, SearchValue> tst_;
};
Tokenizer::Tokenizer(const OpKernelInfo& info) : OpKernel(info) {
int64_t mark = 0;
auto status = info.GetAttr("mark", &mark);
ORT_ENFORCE(status.IsOK(), "attribute mark is not set");
mark_ = mark != 0;
status = info.GetAttr("pad_value", &pad_value_);
ORT_ENFORCE(status.IsOK(), "attribute pad_value is not set");
status = info.GetAttr("mincharnum", &mincharnum_);
ORT_ENFORCE(status.IsOK(), "attribute mincharnum is not set");
ORT_ENFORCE(mincharnum_ > 0, "attribute mincharnum must have a positive value");
// Optional attributes either or
std::vector<std::string> separators;
std::string tokenexp;
status = info.GetAttrs("separators", separators);
if (!status.IsOK()) {
status = info.GetAttr("tokenexp", &tokenexp);
ORT_ENFORCE(status.IsOK(), "Either one of the separators OR tokenexp attributes required but none is set");
ORT_ENFORCE(!tokenexp.empty(), "Expecting a non-empty tokenexp");
} else {
ORT_ENFORCE(!separators.empty(), "Expect at least one item within separators");
}
char_tokenezation_ = (separators.size() == 1 &&
separators[0].empty());
ORT_ENFORCE(!char_tokenezation_ || mincharnum_ < 2,
"mincharnum is too big for char level tokenezation");
// Check if we have separators or tokenexp
if (!char_tokenezation_) {
if (!separators.empty()) {
std::unique_ptr<SearchData> sd(std::make_unique<SearchData>());
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter(conv_error, wconv_error);
int priority = 0; // earlier search patterns get priority
for (const auto& sep : separators) {
ORT_ENFORCE(!sep.empty(), "No empty separators allowed");
std::wstring wsep = converter.from_bytes(sep);
ORT_ENFORCE(wsep != wconv_error, "Separator strings contains invalid utf8 chars");
bool result = sd->tst_.put(wsep.c_str(), wsep.length(), {wsep.length(), priority});
ORT_ENFORCE(result, "duplicate separator detected");
++priority;
}
search_data_.swap(sd);
} else {
// Use tokenexp
re2::RE2::Options options;
options.set_longest_match(true);
std::unique_ptr<re2::RE2> regex(new re2::RE2(tokenexp, options));
if (!regex->ok()) {
ORT_THROW("Can not digest regex: ", regex->error());
}
regex_.swap(regex);
}
}
}
Status Tokenizer::CharTokenize(OpKernelContext* ctx, size_t N, size_t C,
const std::vector<int64_t>& input_dims) const {
// With char tokenzation we get as many tokens as the number of
// utf8 characters in the string. So for every string we calculate its character(utf8) length
// add padding and add start/end test separators if necessary
size_t max_tokens = 0;
auto X = ctx->Input<Tensor>(0);
auto const input_data = X->template Data<std::string>();
auto curr_input = input_data;
auto const last = input_data + N * C;
while (curr_input != last) {
const auto& s = *curr_input;
size_t tokens = 0; // length in utf8 chars
if (!utf8_validate(reinterpret_cast<const unsigned char*>(s.data()), s.size(),
tokens)) {
return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT,
"Input string contains invalid utf8 chars: " + s);
}
max_tokens = std::max(max_tokens, tokens);
++curr_input;
}
std::vector<int64_t> output_dims(input_dims);
// Check if we have no output due to apparently empty strings input.
if (max_tokens == 0) {
output_dims.push_back(0);
TensorShape output_shape(output_dims);
ctx->Output(0, output_shape);
return Status::OK();
}
if (mark_) {
max_tokens += 2; // Start/end markers as separate tokens
}
output_dims.push_back(max_tokens);
TensorShape output_shape(output_dims);
auto output_tensor = ctx->Output(0, output_shape);
auto const output_data = output_tensor->template MutableData<std::string>();
size_t output_index = 0;
curr_input = input_data;
while (curr_input != last) {
const auto& s = *curr_input;
if (mark_) {
(output_data + output_index)->assign(&start_text, 1);
++output_index;
}
size_t tokens = 0;
const size_t str_len = s.size();
for (size_t token_idx = 0; token_idx < str_len;) {
size_t tlen = 0;
bool result = utf8_bytes(static_cast<unsigned char>(s[token_idx]), tlen);
assert(result);
(void)result;
assert(token_idx + tlen <= str_len);
*(output_data + output_index) = s.substr(token_idx, tlen);
++output_index;
token_idx += tlen;
++tokens;
}
if (mark_) {
(output_data + output_index)->assign(&end_text, 1);
++output_index;
}
// Padding strings
assert(tokens + (mark_ * 2) <= max_tokens);
const size_t pads = max_tokens - (mark_ * 2) - tokens;
for (size_t p = 0; p < pads; ++p) {
*(output_data + output_index) = pad_value_;
++output_index;
}
++curr_input;
}
return Status::OK();
}
Status Tokenizer::SeparatorTokenize(OpKernelContext* ctx,
size_t N, size_t C,
const std::vector<int64_t>& input_dims) const {
struct Match {
int priority_;
size_t offset_;
size_t size_;
// create a conflict for overlapping matches
// thus if they overlap neither is less than the other
// and they are considered equal
bool operator<(const Match& o) const {
return (offset_ + size_) <= o.offset_;
}
};
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter(conv_error, wconv_error);
// Scan all strings and attempt to find separators in them
// collect all the output tokens here
size_t max_tokens = 0;
std::vector<std::vector<std::wstring>> tokenized_strings;
tokenized_strings.reserve(N * C);
auto X = ctx->Input<Tensor>(0);
auto const input_data = X->template Data<std::string>();
auto curr_input = input_data;
auto const last = input_data + N * C;
while (curr_input != last) {
const auto& s = *curr_input;
std::wstring wstr = converter.from_bytes(s);
if (wstr == wconv_error) {
return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT,
"Invalid utf8 chars in the input: " + s);
}
std::set<Match> matches;
const wchar_t* ws = wstr.c_str();
size_t len_remaining = wstr.length();
size_t offset = 0;
while (len_remaining > 0) {
const auto* val = search_data_->tst_.get(ws, len_remaining);
if (val != nullptr) {
auto p = matches.insert({val->priority_, offset, val->w_len});
while (!p.second && val->priority_ < p.first->priority_) {
// if overlapping matches of the same pattern(priority), then
// the earlier match naturally wins
matches.erase(p.first);
p = matches.insert({val->priority_, offset, val->w_len});
}
}
++ws;
++offset;
--len_remaining;
}
// Tokenize
tokenized_strings.emplace_back();
auto& row_tokens = tokenized_strings.back();
row_tokens.reserve(matches.size() + 1);
ws = wstr.c_str();
offset = 0;
for (const auto& m : matches) {
assert(m.offset_ >= offset);
size_t sz = (m.offset_ - offset);
if (sz > 0 && sz >= size_t(mincharnum_)) {
row_tokens.emplace_back(ws, sz);
}
offset = m.offset_ + m.size_;
ws = wstr.c_str() + offset;
}
assert(offset <= wstr.length());
if (offset < wstr.length()) {
row_tokens.emplace_back(ws, wstr.length() - offset);
}
max_tokens = std::max(max_tokens, row_tokens.size());
++curr_input;
}
std::vector<int64_t> output_dims(input_dims);
// Check if we have no output due to either empty input
// everything is a separator
if (max_tokens == 0) {
output_dims.push_back(0);
TensorShape output_shape(output_dims);
ctx->Output(0, output_shape);
return Status::OK();
}
if (mark_) {
max_tokens += 2; // Start/end markers as separate tokens
}
output_dims.push_back(max_tokens);
TensorShape output_shape(output_dims);
auto output_tensor = ctx->Output(0, output_shape);
auto const output_data = output_tensor->template MutableData<std::string>();
#ifdef _DEBUG
const size_t max_output_index = N * C * max_tokens;
#endif
size_t output_index = 0;
for (auto& row : tokenized_strings) {
#ifdef _DEBUG
size_t c_idx = output_index;
#endif
if (mark_) {
(output_data + output_index)->assign(&start_text, 1);
++output_index;
}
// Output tokens for this row
for (auto& token : row) {
*(output_data + output_index) = converter.to_bytes(token);
++output_index;
}
if (mark_) {
(output_data + output_index)->assign(&end_text, 1);
++output_index;
}
const size_t pads = max_tokens - (mark_ * 2) - row.size();
for (size_t p = 0; p < pads; ++p) {
*(output_data + output_index) = pad_value_;
++output_index;
}
#ifdef _DEBUG
assert(output_index <= max_output_index);
assert((output_index - c_idx) <= max_tokens);
#endif
}
return Status::OK();
}
Status Tokenizer::ExpressionTokenize(OpKernelContext* ctx,
size_t N, size_t C,
const std::vector<int64_t>& input_dims) const {
using namespace re2;
// Represents a token that will be output after
// first is the index, second is the size;
std::vector<std::vector<StringPiece>> tokens;
tokens.reserve(N * C);
size_t max_tokens = 0;
auto X = ctx->Input<Tensor>(0);
auto const input_data = X->template Data<std::string>();
auto curr_input = input_data;
auto const last = input_data + N * C;
// We do not constraint the search to match
// on the beginning or end of the string
const RE2::Anchor anchor = RE2::UNANCHORED;
while (curr_input != last) {
const auto& s = *curr_input;
tokens.emplace_back();
auto& row = tokens.back();
StringPiece text(s);
const auto end_pos = s.length();
size_t start_pos = 0;
StringPiece submatch;
bool match = true;
do {
match = regex_->Match(text, start_pos, end_pos, anchor, &submatch, 1);
if (match) {
// Record pos/len
assert(submatch.data() != nullptr);
size_t match_pos = submatch.data() - s.data();
assert(match_pos >= start_pos);
// Guard against empty match and make
// sure we make progress either way
auto token_len = submatch.length();
if (token_len > 0) {
row.push_back(submatch);
start_pos = match_pos + token_len;
} else {
start_pos = match_pos + 1;
}
}
} while (match);
max_tokens = std::max(max_tokens, row.size());
++curr_input;
}
// Check for empty output
std::vector<int64_t> output_dims(input_dims);
// Check if we have no output due to either empty input
// everything is a separator
if (max_tokens == 0) {
output_dims.push_back(0);
TensorShape output_shape(output_dims);
ctx->Output(0, output_shape);
return Status::OK();
}
if (mark_) {
max_tokens += 2; // Start/end markers as separate tokens
}
output_dims.push_back(max_tokens);
TensorShape output_shape(output_dims);
auto output_tensor = ctx->Output(0, output_shape);
auto const output_data = output_tensor->template MutableData<std::string>();
#ifdef _DEBUG
const size_t max_output_index = N * C * max_tokens;
#endif
curr_input = input_data;
size_t output_index = 0;
for (const auto& row : tokens) {
assert(curr_input != last);
#ifdef _DEBUG
size_t c_idx = output_index;
#endif
if (mark_) {
(output_data + output_index)->assign(&start_text, 1);
++output_index;
}
// Output tokens for this row
for (const auto& token : row) {
(output_data + output_index)->assign(token.data(), token.length());
++output_index;
}
if (mark_) {
(output_data + output_index)->assign(&end_text, 1);
++output_index;
}
const size_t pads = max_tokens - (mark_ * 2) - row.size();
for (size_t p = 0; p < pads; ++p) {
*(output_data + output_index) = pad_value_;
++output_index;
}
#ifdef _DEBUG
assert(output_index <= max_output_index);
assert((output_index - c_idx) <= max_tokens);
#endif
++curr_input;
}
return Status::OK();
}
Status Tokenizer::Compute(OpKernelContext* ctx) const {
// Get input buffer ptr
auto X = ctx->Input<Tensor>(0);
if (X == nullptr) return Status(common::ONNXRUNTIME, common::FAIL, "input count mismatch");
if (X->DataType() != DataTypeImpl::GetType<std::string>()) {
return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT,
"tensor(string) expected as input");
}
auto& input_dims = X->Shape().GetDims();
size_t N = 0;
size_t C = 0;
if (input_dims.size() == 1) {
N = 1;
if (input_dims[0] < 1) {
return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT,
"Invalid C dimension value");
}
C = input_dims[0];
} else if (input_dims.size() == 2) {
if (input_dims[0] < 1 || input_dims[1] < 1) {
return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT,
"Invalid N and/or C dimension values");
}
N = input_dims[0];
C = input_dims[1];
} else {
return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT,
"Input dimensions are either [C] or [N][C] allowed");
}
Status s;
if (char_tokenezation_) {
s = CharTokenize(ctx, N, C, input_dims);
} else {
if (regex_ != nullptr) {
s = ExpressionTokenize(ctx, N, C, input_dims);
} else {
s = SeparatorTokenize(ctx, N, C, input_dims);
}
}
return s;
}
} // namespace contrib
} // namespace onnxruntime
| 30.579755 | 111 | 0.630454 | [
"shape",
"vector"
] |
4050b1675c942a8ae01839e319fca56b077bd926 | 389 | cpp | C++ | 0-course1/02-week/0-SortingIntegersModulo.cpp | mamoudmatook/CPlusPlusInRussian | ef1f92e4880f24fe16fbcbef8dba3a2658d2208e | [
"MIT"
] | null | null | null | 0-course1/02-week/0-SortingIntegersModulo.cpp | mamoudmatook/CPlusPlusInRussian | ef1f92e4880f24fe16fbcbef8dba3a2658d2208e | [
"MIT"
] | null | null | null | 0-course1/02-week/0-SortingIntegersModulo.cpp | mamoudmatook/CPlusPlusInRussian | ef1f92e4880f24fe16fbcbef8dba3a2658d2208e | [
"MIT"
] | null | null | null | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool compare(int x, int y)
{
return abs(x) < abs(y);
}
int main()
{
int n;
cin >> n;
vector<int> nums(n);
for(auto &i: nums)
{
cin >> i;
};
sort(nums.begin(),nums.end(), compare);
for (const auto &i: nums)
{
cout << i << " ";
}
cout << endl;
} | 14.961538 | 43 | 0.503856 | [
"vector"
] |
40513f8da14c75075e331b7a69f41769b71a64fa | 9,815 | cpp | C++ | src/mimic_renderer.cpp | kahuz/3d-mimic | 94a17926302eb23a6de28a863577b6f506e723b1 | [
"MIT"
] | null | null | null | src/mimic_renderer.cpp | kahuz/3d-mimic | 94a17926302eb23a6de28a863577b6f506e723b1 | [
"MIT"
] | null | null | null | src/mimic_renderer.cpp | kahuz/3d-mimic | 94a17926302eb23a6de28a863577b6f506e723b1 | [
"MIT"
] | null | null | null |
// user header
#include "mimic_renderer.h"
#include "mimic_ui.h"
#include "Logger.h"
using namespace std;
static GLFWwindow *window = NULL;
static void glfw_error_callback(int error, const char* description)
{
fprintf(stderr, "Glfw Error %d: %s\n", error, description);
}
bool InitRenderContext()
{
// Setup window
glfwSetErrorCallback(glfw_error_callback);
if (!glfwInit())
{
return false;
}
// GL 3.0 + GLSL 130
const char* glsl_version = "#version 130";
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
// Create window with graphics context
window = glfwCreateWindow(640, 640, "Dear ImGui GLFW+OpenGL3 example", NULL, NULL);
if (window == NULL)
{
return false;
}
glfwMakeContextCurrent(window);
glfwSwapInterval(1); // Enable vsync
// Initialize OpenGL loader
bool err = gl3wInit() != 0;
if (err)
{
fprintf(stderr, "Failed to initialize OpenGL loader!\n");
return false;
}
// Setup Dear ImGui context
IMGUI_CHECKVERSION();
ImGui::CreateContext();
// Setup Dear ImGui style
ImGui::StyleColorsDark(); //ImGui::StyleColorsClassic();
// Setup Platform/Renderer backends
ImGui_ImplGlfw_InitForOpenGL(window, true);
ImGui_ImplOpenGL3_Init(glsl_version);
return true;
}
void MimicRender()
{
InitRenderContext();
bool show_demo_window = true;
bool show_another_window = false;
ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
//init GLSL Program
GLShader* my_gl = new GLShader();
my_gl->LoadShader(GL_VERTEX_SHADER, "../src/gl_shader/object.vshader");
my_gl->LoadShader(GL_FRAGMENT_SHADER, "../src/gl_shader/object.fshader");
my_gl->LinkShaders();
//set vertex Attribute vPosition
my_gl->SetGLAttribLocation(GL_VERTEX_SHADER, "vPosition");
my_gl->SetGLUniformLocation(GL_VERTEX_SHADER, "uProjection");
my_gl->SetGLUniformLocation(GL_VERTEX_SHADER, "uModel");
my_gl->SetGLUniformLocation(GL_VERTEX_SHADER, "uView");
static float f = 0.0f;
static int counter = 0;
// Main loop
while (!glfwWindowShouldClose(window))
{
// Poll and handle events (inputs, window resize, etc.)
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
glfwPollEvents();
// Start the Dear ImGui frame
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
DrawMenuBar();
static int x = 0, y = 0, frame_num = 0;
static float angle = 90, cur_x_pos = 0, prev_x_pos = 0, cur_y_pos = 0, prev_y_pos = 0;
static float angle_x = 0.0f, angle_y = 0.0f;
static bool active_rotate = false;
static std::string rotate_btn_str = "Disable Rotate";
int mouse_state = 0; // 0 release, 1 press
ImGuiIO& io = ImGui::GetIO();
// 2. Show a simple window that we create ourselves. We use a Begin/End pair to created a named window.
{
ImGui::Begin("Hello, world!"); // Create a window called "Hello, world!" and append into it.
ImGui::Text("This is some useful text."); // Display some text (you can use a format strings too)
ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our window open/close state
ImGui::Checkbox("Another Window", &show_another_window);
ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated)
counter++;
if (ImGui::Button(rotate_btn_str.c_str()))
{
active_rotate = !active_rotate;
if (active_rotate)
{
rotate_btn_str = "Enable Rotate";
}
else
{
rotate_btn_str = "Disable Rotate";
}
}
ImGui::SameLine();
ImGui::Text("counter = %d", counter);
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++)
{
if (ImGui::IsMouseDown(i))
{
mouse_state = 1;
}
}
for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++)
{
if (ImGui::IsMouseReleased(i))
{
mouse_state = 0;
}
}
std::string mouse_state_str = mouse_state ? "Clicked" : "Released";
ImGui::Text("Mouse state %s", mouse_state_str.c_str());
ImGui::Text("angle x %f", angle_x);
ImGui::Text("angle y %f", angle_y);
ImGui::End();
}
// 3. Show another simple window.
if (show_another_window)
{
ImGui::Begin("Another Window", &show_another_window); // Pass a pointer to our bool variable (the window will have a closing button that will clear the bool when clicked)
ImGui::Text("Hello from another window!");
if (ImGui::Button("Close Me"))
show_another_window = false;
ImGui::End();
}
// Rendering
ImGui::Render();
int display_w, display_h;
glfwGetFramebufferSize(window, &display_w, &display_h);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(clear_color.x * clear_color.w, clear_color.y * clear_color.w, clear_color.z * clear_color.w, clear_color.w);
if (g_menu_load_model)
{
frame_num++;
if (frame_num % 33 == 0)
{
angle++;
}
GLfloat mProjeMat[16] =
{
0.3f, 0.0f, 0.0f, 0.0f,
0.0f, 0.3f, 0.0f, 0.0f,
0.0f, 0.0f, 0.3f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f
};
GLfloat mViewMat[16] =
{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f
};
GLfloat mModelMat[16] =
{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f
};
if (mouse_state == 1 && active_rotate)
{
cur_x_pos = io.MousePos.x;
cur_y_pos = io.MousePos.y;
if (cur_x_pos != prev_x_pos)
{
angle_x += std::fmod((cur_x_pos - prev_x_pos), 360.0f) / 20;
if (angle_x > 360.0f || angle_x < -360.0f)
{
angle_x = 0.0f;
}
}
if (cur_y_pos != prev_y_pos)
{
angle_y += std::fmod((cur_y_pos - prev_y_pos), 360.0f) / 20;
if (angle_y > 360.0f || angle_y < -360.0f)
{
angle_y = 0.0f;
}
}
}
float x_s = sinf(angle_y);
float x_c = cosf(angle_y);
float y_s = sinf(angle_x);
float y_c = cosf(angle_x);
GLfloat mRotate_X_Mat[16] =
{
1.f, 0.f, 0.f, 0.f,
0.f, x_c, x_s, 0.f,
0.f, -x_s, x_c, 0.f,
0.f, 0.f, 0.f, 1.f
};
GLfloat mRotate_Y_Mat[16] = {
y_c, 0.f, -y_s, 0.f,
0.f, 1.f, 0.f, 0.f,
y_s, 0.f, y_c, 0.f,
0.f, 0.f, 0.f, 1.f
};
//linmath test
glViewport(0, 0, display_w, display_h);
glUseProgram(my_gl->program);
glUniformMatrix4fv(my_gl->vert_member.at("uProjection"), 1, GL_FALSE, mProjeMat);
//glUniformMatrix4fv(my_gl->vert_member.at("uView"), 1, GL_FALSE, mViewMat);
glUniformMatrix4fv(my_gl->vert_member.at("uView"), 1, GL_FALSE, mRotate_X_Mat);
//glUniformMatrix4fv(my_gl->vert_member.at("uModel"), 1, GL_FALSE, mModelMat);
glUniformMatrix4fv(my_gl->vert_member.at("uModel"), 1, GL_FALSE, mRotate_Y_Mat);
glEnableVertexAttribArray(my_gl->vert_member.at("vPosition"));
glVertexAttribPointer(my_gl->vert_member.at("vPosition"), 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), &g_model.positions[0]);
glLineWidth(3);
glDrawElements(GL_LINES, g_model.v_faces.size(), GL_UNSIGNED_INT, &g_model.v_faces[0]);
prev_x_pos = cur_x_pos;
prev_y_pos = cur_y_pos;
}
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
glfwSwapBuffers(window);
}
// Cleanup
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
glfwDestroyWindow(window);
glfwTerminate();
} | 33.047138 | 182 | 0.542944 | [
"render",
"object"
] |
4053fd48014b8a51ec0bf749ffc4edee002570e8 | 3,930 | cpp | C++ | Cpp/fost-core/string-ascii.cpp | KayEss/fost-base | 05ac1b6a1fb672c61ba6502efea86f9c5207e28f | [
"BSL-1.0"
] | 2 | 2016-05-25T22:17:38.000Z | 2019-04-02T08:34:17.000Z | Cpp/fost-core/string-ascii.cpp | KayEss/fost-base | 05ac1b6a1fb672c61ba6502efea86f9c5207e28f | [
"BSL-1.0"
] | 5 | 2018-07-13T10:43:05.000Z | 2019-09-02T14:54:42.000Z | Cpp/fost-core/string-ascii.cpp | KayEss/fost-base | 05ac1b6a1fb672c61ba6502efea86f9c5207e28f | [
"BSL-1.0"
] | 1 | 2020-10-22T20:44:24.000Z | 2020-10-22T20:44:24.000Z | /**
Copyright 2009-2019 Red Anchor Trading Co. Ltd.
Distributed under the Boost Software License, Version 1.0.
See <http://www.boost.org/LICENSE_1_0.txt>
*/
#include "fost-core.hpp"
#include <fost/detail/hex.hpp>
#include <fost/insert.hpp>
#include <fost/unicode.hpp>
#include <fost/exception/not_implemented.hpp>
#include <fost/exception/out_of_range.hpp>
#include <fost/exception/parse_error.hpp>
namespace {
void check_range(fostlib::utf32 minimum, const fostlib::string &s) {
std::size_t p = 0;
try {
for (auto c(s.begin()); c != s.end(); ++c, ++p) {
if (*c > 0xf7 || *c < minimum) {
throw fostlib::exceptions::out_of_range<int>(
"ASCII characters outside valid range", minimum,
127, *c);
}
}
} catch (fostlib::exceptions::exception &e) {
fostlib::insert(
e.data(), "string-to-here",
fostlib::coerce<fostlib::ascii_string>(s.substr(0, p)));
fostlib::insert(e.data(), "checked", p);
fostlib::insert(e.data(), "size", s.bytes());
throw;
}
}
}
/**
## fostlib::ascii_string
*/
void fostlib::ascii_string_tag::do_encode(fostlib::nliteral, fostlib::string &) {
throw fostlib::exceptions::not_implemented(__PRETTY_FUNCTION__);
}
void fostlib::ascii_string_tag::do_encode(
const fostlib::string &, fostlib::string &) {
throw fostlib::exceptions::not_implemented(__PRETTY_FUNCTION__);
}
void fostlib::ascii_string_tag::check_encoded(const fostlib::string &s) {
check_range(1, s);
}
fostlib::ascii_string fostlib::coercer<
fostlib::ascii_string,
std::vector<fostlib::ascii_string::value_type>>::
coerce(const std::vector<fostlib::ascii_string::value_type> &v) {
return ascii_string(std::string(&v[0], v.size()));
}
fostlib::ascii_string
fostlib::coercer<fostlib::ascii_string, fostlib::string>::coerce(
const fostlib::string &s) {
fostlib::utf8_string utf8 = fostlib::coerce<fostlib::utf8_string>(s);
return fostlib::ascii_string(static_cast<std::string>(utf8.underlying()));
}
fostlib::string fostlib::coercer<fostlib::string, fostlib::ascii_string>::coerce(
const fostlib::ascii_string &s) {
return string(s.underlying());
}
fostlib::json fostlib::coercer<fostlib::json, fostlib::ascii_string>::coerce(
const fostlib::ascii_string &s) {
return json{string{s}};
}
/**
## fostlib::ascii_printable_string
*/
void fostlib::ascii_printable_string_tag::do_encode(
fostlib::nliteral, fostlib::string &) {
throw fostlib::exceptions::not_implemented(__PRETTY_FUNCTION__);
}
void fostlib::ascii_printable_string_tag::do_encode(
const fostlib::string &, fostlib::string &) {
throw fostlib::exceptions::not_implemented(__PRETTY_FUNCTION__);
}
void fostlib::ascii_printable_string_tag::check_encoded(
const fostlib::string &s) {
check_range(' ', s);
}
fostlib::ascii_printable_string fostlib::coercer<
fostlib::ascii_printable_string,
std::vector<fostlib::ascii_printable_string::value_type>>::
coerce(const std::vector<fostlib::ascii_printable_string::value_type>
&v) {
return ascii_printable_string(std::string(&v[0], v.size()));
}
fostlib::ascii_printable_string
fostlib::coercer<fostlib::ascii_printable_string, fostlib::string>::
coerce(const fostlib::string &s) {
fostlib::utf8_string utf8 = fostlib::coerce<fostlib::utf8_string>(s);
return fostlib::ascii_printable_string(
static_cast<std::string>(utf8.underlying()));
}
fostlib::string
fostlib::coercer<fostlib::string, fostlib::ascii_printable_string>::
coerce(const fostlib::ascii_printable_string &s) {
return string{s};
}
| 32.75 | 81 | 0.646565 | [
"vector"
] |
4063586f682bc2871f6f280860db930ea73c4f04 | 2,788 | cpp | C++ | tightvnc/desktop/Win32ScreenDriverBaseImpl.cpp | jjzhang166/qmlvncviewer2 | b888c416ab88b81fe802ab0559bb87361833a0b5 | [
"Apache-2.0"
] | 47 | 2016-08-17T03:18:32.000Z | 2022-01-14T01:33:15.000Z | tightvnc/desktop/Win32ScreenDriverBaseImpl.cpp | jjzhang166/qmlvncviewer2 | b888c416ab88b81fe802ab0559bb87361833a0b5 | [
"Apache-2.0"
] | 3 | 2018-06-29T06:13:28.000Z | 2020-11-26T02:31:49.000Z | tightvnc/desktop/Win32ScreenDriverBaseImpl.cpp | jjzhang166/qmlvncviewer2 | b888c416ab88b81fe802ab0559bb87361833a0b5 | [
"Apache-2.0"
] | 15 | 2016-08-17T07:03:55.000Z | 2021-08-02T14:42:02.000Z | // Copyright (C) 2011,2012 GlavSoft LLC.
// All rights reserved.
//
//-------------------------------------------------------------------------
// This file is part of the TightVNC software. Please visit our Web site:
//
// http://www.tightvnc.com/
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//-------------------------------------------------------------------------
//
#include "Win32ScreenDriverBaseImpl.h"
#include "util/Exception.h"
Win32ScreenDriverBaseImpl::Win32ScreenDriverBaseImpl(UpdateKeeper *updateKeeper,
UpdateListener *updateListener,
LocalMutex *fbLocalMutex,
LogWriter *log)
: m_fbLocalMutex(fbLocalMutex),
m_cursorPosDetector(updateKeeper, updateListener, log),
m_curShapeDetector(updateKeeper, updateListener, &m_curShapeGrabber, fbLocalMutex, log)
{
}
Win32ScreenDriverBaseImpl::~Win32ScreenDriverBaseImpl()
{
terminateDetection();
}
void Win32ScreenDriverBaseImpl::executeDetection()
{
m_cursorPosDetector.resume();
m_curShapeDetector.resume();
}
void Win32ScreenDriverBaseImpl::terminateDetection()
{
m_cursorPosDetector.terminate();
m_curShapeDetector.terminate();
m_cursorPosDetector.wait();
m_curShapeDetector.wait();
}
LocalMutex *Win32ScreenDriverBaseImpl::getFbMutex()
{
return m_fbLocalMutex;
}
bool Win32ScreenDriverBaseImpl::grabCursorShape(const PixelFormat *pf)
{
// Grabbing under the mutex avoid us from grab void cursor shape in time when the
// shape hides until grabs screen.
AutoLock al(m_fbLocalMutex);
return m_curShapeGrabber.grab(pf);
}
const CursorShape *Win32ScreenDriverBaseImpl::getCursorShape()
{
return m_curShapeGrabber.getCursorShape();
}
Point Win32ScreenDriverBaseImpl::getCursorPosition()
{
AutoLock al(m_fbLocalMutex);
return m_cursorPosDetector.getCursorPos();
}
void Win32ScreenDriverBaseImpl::getCopiedRegion(Rect *copyRect, Point *source)
{
AutoLock al(m_fbLocalMutex);
m_copyRectDetector.detectWindowMovements(copyRect, source);
}
| 32.045977 | 89 | 0.690818 | [
"shape"
] |
40643f268bcdb5dfac984bd77abb8e12bb644a3d | 5,490 | cpp | C++ | test/geoindex_test.cpp | KevinStern/index-cpp | 42ae81cec1fb6f65376f7e818925233b0e4b783e | [
"MIT"
] | 63 | 2015-01-15T19:47:47.000Z | 2022-03-16T02:55:01.000Z | test/geoindex_test.cpp | KevinStern/index-cpp | 42ae81cec1fb6f65376f7e818925233b0e4b783e | [
"MIT"
] | null | null | null | test/geoindex_test.cpp | KevinStern/index-cpp | 42ae81cec1fb6f65376f7e818925233b0e4b783e | [
"MIT"
] | 18 | 2015-08-17T15:15:36.000Z | 2019-06-02T07:00:06.000Z | /* Copyright (c) 2013 Kevin L. Stern
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "test.h"
#include <algorithm>
#include <bitset>
#include <random>
#include <unordered_set>
#include "geoindex.h"
namespace {
static double XMIN = -180;
static double XMAX = 180;
static double YMIN = -90;
static double YMAX = 90;
typedef GeoPoint<GeoDegreeCoordinateSystem> AnchoredGeoPoint;
typedef GeoRectangle<GeoDegreeCoordinateSystem> AnchoredGeoRectangle;
static const char TEST_FILENAME[] = "GeoIndexTest.index";
static std::default_random_engine E;
static std::uniform_real_distribution<double> X{XMIN, XMAX};
static std::uniform_real_distribution<double> Y{YMIN, YMAX};
struct IndexRecord {
AnchoredGeoPoint point;
IndexRecord() {}
IndexRecord(const AnchoredGeoPoint& point) : point(point) {}
};
class IndexRecordSerializer {
public:
static constexpr uint32_t ENCODED_SIZE = 16;
static void parse(Buffer& buffer, IndexRecord& record) {
double x = buffer.get_double();
double y = buffer.get_double();
record.point = AnchoredGeoPoint(x, y);
}
static void write(const IndexRecord& record, Buffer& buffer) {
buffer.put_double(record.point.x());
buffer.put_double(record.point.y());
}
static AnchoredGeoPoint geopoint(const IndexRecord& record) {
return record.point;
}
};
AnchoredGeoRectangle MakeRandomGeoRectangle(double min_dimension, double max_dimension) {
std::uniform_real_distribution<double> d{min_dimension, max_dimension};
double x1 = X(E);
double y1 = Y(E);
double x2 = x1 + d(E);
double y2 = y1 + d(E);
return AnchoredGeoRectangle(x1, y1, x2, y2);
}
template <typename HashType>
void GeoIndexBasicTestHelper() {
typedef GeoIndex<IndexRecord, GeoDegreeCoordinateSystem, HashType> AnchoredGeoIndex;
E.seed(time(NULL));
Cleaner cleaner([&](){remove(TEST_FILENAME);});
std::vector<IndexRecord> points;
for (int i = 0; i < 100000; ++i) {
points.push_back(IndexRecord(AnchoredGeoPoint(X(E), Y(E))));
}
AnchoredGeoIndex::order(points.begin(), points.end(), &IndexRecordSerializer::geopoint, points);
Buffer buffer(Buffer::LITTLE, points.size() * IndexRecordSerializer::ENCODED_SIZE);
for (const auto& next : points) {
IndexRecordSerializer::write(next, buffer);
}
buffer.switch_mode();
FILE* file = fopen(TEST_FILENAME, "wb");
fwrite(buffer.data(), 1, buffer.remaining(), file);
fclose(file);
typename AnchoredGeoIndex::FileDataSource file_source(
TEST_FILENAME, &IndexRecordSerializer::parse, IndexRecordSerializer::ENCODED_SIZE,
Buffer::LITTLE, 100);
typename AnchoredGeoIndex::VectorDataSource vector_source(points);
for (int i = 0; i < 100; ++i) {
AnchoredGeoIndex file_index(&file_source, &IndexRecordSerializer::geopoint);
AnchoredGeoIndex vector_index(&vector_source, &IndexRecordSerializer::geopoint);
AnchoredGeoRectangle rect = MakeRandomGeoRectangle(0.1, 20);
uint64_t time = std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now().time_since_epoch()).count();
std::unordered_set<AnchoredGeoPoint> expected;
for (auto& next : points) {
if (rect.contains(next.point)) {
expected.insert(next.point);
}
}
time = std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now().time_since_epoch()).count() - time;
std::unordered_set<AnchoredGeoPoint> file_actual;
std::unordered_set<AnchoredGeoPoint> vector_actual;
//typename AnchoredGeoIndex::QueryStats file_stats =
file_index.query(rect, [&](const IndexRecord& record){file_actual.insert(record.point);});
//typename AnchoredGeoIndex::QueryStats vector_stats =
vector_index.query(rect, [&](const IndexRecord& record){vector_actual.insert(record.point);});
/*
LOG("File: read=" << file_stats.record_read_count << " prefixes=" <<
file_stats.prefix_search_count << " time=" << file_stats.time_us << "(us)\n" <<
"\tVector: read=" << vector_stats.record_read_count << " prefixes=" <<
vector_stats.prefix_search_count << " time=" << vector_stats.time_us << "(us)\n" <<
"\tExpected: size=" << expected.size() << " time=" << time << "(us)");
*/
ASSERT_TRUE(expected == file_actual);
ASSERT_TRUE(expected == vector_actual);
}
}
}
TEST(GeoIndexBasic) {
GeoIndexBasicTestHelper<uint64_t>();
GeoIndexBasicTestHelper<uint32_t>();
GeoIndexBasicTestHelper<uint16_t>();
}
| 38.125 | 98 | 0.723315 | [
"vector"
] |
4067f7fddca9aa127df1c981abf1bad471667dad | 1,207 | cpp | C++ | test/dmsorttest/dmsorttest.cpp | brinkqiang/dmcpp | 9be9d3675b20879d5335fabc231b4e5d26208786 | [
"MIT"
] | null | null | null | test/dmsorttest/dmsorttest.cpp | brinkqiang/dmcpp | 9be9d3675b20879d5335fabc231b4e5d26208786 | [
"MIT"
] | null | null | null | test/dmsorttest/dmsorttest.cpp | brinkqiang/dmcpp | 9be9d3675b20879d5335fabc231b4e5d26208786 | [
"MIT"
] | null | null | null | #include <iomanip>
#include <iostream>
#include <string>
#include <type_traits>
#include <variant>
#include <vector>
#include <algorithm>
// test git patch
class player
{
public:
player(int nLevel, int nAge)
: m_nLevel(nLevel), m_nAge(nAge)
{
}
int get_level()
{
return m_nLevel;
}
int get_age()
{
return m_nAge;
}
int m_nLevel;
int m_nAge;
};
int main()
{
std::vector<player*> vecPlayer;
vecPlayer.push_back(new player(2, 2));
vecPlayer.push_back(new player(2, 3));
vecPlayer.push_back(new player(3, 5));
vecPlayer.push_back(new player(3, 6));
vecPlayer.push_back(new player(1, 2));
vecPlayer.push_back(new player(1, 3));
std::sort(vecPlayer.begin(), vecPlayer.end(), [](player* p1, player* p2)
{
return (p1->get_level() < p2->get_level()) ||
(p1->get_level() == p2->get_level() && p1->get_age() > p2->get_age());
});
std::sort(vecPlayer.begin(), vecPlayer.end(), [](player* p1, player* p2)
{
return (p1->get_level() > p2->get_level()) ||
(p1->get_level() == p2->get_level() && p1->get_age() > p2->get_age());
});
return 0;
} | 20.810345 | 85 | 0.573322 | [
"vector"
] |
406999ecad9a6cc4185ba8bfefae29a93df0eca8 | 2,695 | cpp | C++ | OJ/11813/11813.cpp | albertored11/PCOM-Problems | 018abf1870e9189c2e369e0864596a3678eb8e25 | [
"MIT"
] | null | null | null | OJ/11813/11813.cpp | albertored11/PCOM-Problems | 018abf1870e9189c2e369e0864596a3678eb8e25 | [
"MIT"
] | null | null | null | OJ/11813/11813.cpp | albertored11/PCOM-Problems | 018abf1870e9189c2e369e0864596a3678eb8e25 | [
"MIT"
] | null | null | null | #include <iostream>
#include <cstdio>
#include <climits>
#include <vector>
#include <iomanip>
#include <queue> // Cola de mayor a menor por defecto en priority
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <deque>
#include <unordered_set>
using namespace std;
using ii = pair<int, int>;
using vii = vector<ii>;
using vi = vector<int>;
using vvi = vector<vi>; // para listas de adyacencia
using vvii = vector<vii>;
using iii = pair<ii, int>;
using viii = vector<iii>;
const int MAX_INTERSEC = 100000;
const int MAX_STORES = 10;
const int MAX_COMB = 1 << MAX_STORES;
const int INF = 10e6;
vvii adjList;
vector<int> tiendas;
int numInsersec, numCaminos, numTiendas;
int dist[MAX_INTERSEC + 2][MAX_COMB + 2];
void resuelve() {
cin >> numInsersec >> numCaminos;
adjList.assign(numInsersec, vii());
tiendas.assign(numInsersec, -1);
for (int i = 0; i < numCaminos; ++i) {
int X, Y, D;
cin >> X >> Y >> D;
adjList[X].push_back({D, Y});
adjList[Y].push_back({D, X});
}
cin >> numTiendas;
for (int i = 0; i < numTiendas; ++i) {
int tienda;
cin >> tienda;
tiendas[tienda] = i;
}
for (int i = 0; i < numInsersec; ++i)
for (int j = 0; j < (1 << numTiendas); ++j)
dist[i][j] = INF;
dist[0][0] = 0;
priority_queue<iii, viii, greater<iii>> pq;
int allVisited = (1 << (numTiendas)) - 1;
pq.push({{0, 0}, 0});
while (!pq.empty()) {
iii front = pq.top();
pq.pop();
int d = front.first.first;
int u = front.first.second;
int visited = front.second;
if (u == 0 && visited == allVisited) {
cout << dist[0][allVisited] << '\n';
break;
}
if (d > dist[u][visited])
continue;
for (auto a : adjList[u]) {
int newvisited = visited;
if (tiendas[a.second] != -1)
newvisited |= (1 << tiendas[a.second]);
if (dist[u][visited] + a.first < dist[a.second][newvisited]) {
dist[a.second][newvisited] = dist[u][visited] + a.first;
pq.push({{dist[a.second][newvisited], a.second}, newvisited});
}
}
}
}
int main() {
int nCasos;
cin >> nCasos;
while (nCasos--) resuelve();
return 0;
}
| 21.388889 | 78 | 0.505751 | [
"vector"
] |
40706f6b4e1d59c737d2948fe808f9d178025200 | 2,260 | cpp | C++ | Measure/main.cpp | Colin-Orian/HAPI-GPU | acd9af0728fc7b01a81cff57d0f0966a9f9bbba5 | [
"MIT"
] | null | null | null | Measure/main.cpp | Colin-Orian/HAPI-GPU | acd9af0728fc7b01a81cff57d0f0966a9f9bbba5 | [
"MIT"
] | null | null | null | Measure/main.cpp | Colin-Orian/HAPI-GPU | acd9af0728fc7b01a81cff57d0f0966a9f9bbba5 | [
"MIT"
] | null | null | null | /********************************************
*
* test
*
* Test program for the HAPI library.
*
********************************************/
#define _USE_MATH_DEFINES
#include <math.h>
#include "HAPI.h"
#include <stdio.h>
#include "Matrix.h"
#include <vector>
int main(int argc, char **argv) {
Node *node = new Node(NONE);
GeometryNode *gnode;
GeometryNode *fan;
TransformationNode *tnode;
int i;
char buffer[256];
double t1;
double dx, dy, dz;
double theta;
double dtheta;
int n;
double x, y, z;
dx = atof(argv[1]);
dy = atof(argv[2]);
dz = atof(argv[3]);
printf("dz: %f\n",dz);
t1 = getSeconds();
setChannels(RED);
setWavelength(RED, 650.0);
setTarget(FILE);
setBaseFileName("test");
setWorldSpace(-1.0, -1.0, -1.0, 1.0, 1.0, 1.0);
// setDeviceSpace(-0.25, -0.25, 17.75, 0.25, 0.25, 18.25);
setDeviceSpace(-0.4+dx, -0.4+dy, 17.75+dz, 0.4+dx, 0.4+dy, 18.25+dz);
gnode = new GeometryNode(LINE);
gnode->addLine(-0.5, -0.5, 1.0, 0.5, -0.5, 1.0);
gnode->addLine(0.5, -0.5, 1.0, 0.5, 0.5, 1.0);
gnode->addLine(0.5,0.5, 1.0, -0.5, 0.5, 1.0);
gnode->addLine(-0.5, 0.5, 1.0, -0.5, -0.5, 1.0);
gnode->addLine(-1.0, -1.0, -1.0, 1.0, -1.0, -1.0);
gnode->addLine(1.0, -1.0, -1.0, 1.0, 1.0, -1.0);
gnode->addLine(1.0, 1.0, -1.0, -1.0, 1.0, -1.0);
gnode->addLine(-1.0, 1.0, -1.0, -1.0, -1.0, -1.0);
gnode->addLine(-0.5, -0.5, 1.0, -1.0, -1.0, -1.0);
gnode->addLine(0.5, -0.5, 1.0, 1.0, -1.0, -1.0);
gnode->addLine(0.5, 0.5, 1.0, 1.0, 1.0, -1.0);
gnode->addLine(-0.5, 0.5, 1.0, -1.0, 1.0, -1.0);
tnode = new TransformationNode();
tnode->rotateZ(0.0);
fan = new GeometryNode(LINE);
n = 42;
theta = 0;
dtheta = 2*M_PI/n;
z = 0.5;
// printf("%f %f\n", 0.2*cos(0.0), 0.2*sin(0.0));
// printf("%f %f\n", 0.2*cos(dtheta), 0.2*sin(dtheta));
for(i=0; i<n; i++) {
x = cos(theta);
y = sin(theta);
fan->addLine(0.2*cos(theta), 0.2*sin(theta), z, x, y, z);
theta += dtheta;
}
node->addChild(gnode);
// tnode->addChild(gnode);
setAlgorithm(RAINBOW_SLIT);
for(i=0; i<1; i++) {
// setPointDistance(200.0 + i*50.0);
// printf("%d %f\n",i,200.0+i*50.0);
sprintf(buffer,"ptest%d",i);
setBaseFileName(buffer);
display(node);
// tnode->rotateZ(0.1);
}
printf("total time: %f\n", getSeconds() - t1);
} | 25.977011 | 70 | 0.54823 | [
"vector"
] |
4085120ff8e2f034646519debac109c5aa2fe8ea | 3,099 | hpp | C++ | include/tikpp/request.hpp | aymanalqadhi/tikpp | 8e94abdc4ac8c85dd893780ad4256cdd6690a758 | [
"Apache-2.0"
] | 4 | 2021-02-07T08:21:10.000Z | 2022-01-16T04:33:18.000Z | include/tikpp/request.hpp | xSHAD0Wx/tikpp | 8e94abdc4ac8c85dd893780ad4256cdd6690a758 | [
"Apache-2.0"
] | null | null | null | include/tikpp/request.hpp | xSHAD0Wx/tikpp | 8e94abdc4ac8c85dd893780ad4256cdd6690a758 | [
"Apache-2.0"
] | 3 | 2020-10-18T20:00:38.000Z | 2022-03-22T09:04:46.000Z | #ifndef TIKPP_REQUEST_HPP
#define TIKPP_REQUEST_HPP
#include "tikpp/sentence.hpp"
#include "fmt/format.h"
#include <cstdint>
#include <string>
#include <vector>
namespace tikpp {
namespace detail {
template <typename T, std::size_t size = sizeof(T)>
inline void append_uint(const T &val, std::vector<std::uint8_t> &buf) {
static_assert(size >= 1 && size <= 4 && size <= sizeof(T));
buf.push_back((val >> (8 * (size - 1))) & 0xFF);
if constexpr (size - 1 > 0) {
append_uint<T, size - 1>(val, buf);
}
}
inline void encode_length(std::size_t len, std::vector<std::uint8_t> &buf) {
if (len < 0x80) {
append_uint<decltype(len), 1>(len, buf);
} else if (len < 0x4000) {
append_uint<decltype(len), 2>(len | 0x00008000, buf);
} else if (len < 0x200000) {
append_uint<decltype(len), 3>(len | 0x00C00000, buf);
} else if (len < 0x10000000) {
append_uint<decltype(len), 4>(len | 0xE0000000, buf);
} else {
append_uint<std::uint8_t>(0xF0, buf);
append_uint<decltype(len), 4>(len, buf);
}
}
inline void encode_word(std::string word, std::vector<std::uint8_t> &buf) {
encode_length(word.size(), buf);
std::copy(word.begin(), word.end(), std::back_inserter(buf));
}
} // namespace detail
struct request : sentence {
request(std::string command, std::uint32_t tag)
: command_ {std::move(command)}, tag_ {tag} {
}
inline void add_word(std::string key, std::string value) {
words_.emplace(std::make_pair(std::move(key), std::move(value)));
}
template <typename... Args>
inline void add_word(std::string key, const char *fmt, Args &&... args) {
add_word(std::move(key), fmt::format(fmt, std::forward<Args>(args)...));
}
inline void add_param(std::string key, std::string value) {
words_.emplace(std::make_pair(fmt::format("={}", std::move(key)),
std::move(value)));
}
inline void add_attribute(std::string key, std::string value) {
words_.emplace(std::make_pair(fmt::format(".{}", std::move(key)),
std::move(value)));
}
template <typename T>
inline void add_param(std::string key, T value) {
add_param(std::move(key), fmt::to_string(value));
}
template <typename T>
inline void add_attribute(std::string key, T value) {
add_attribute(std::move(key), fmt::to_string(value));
}
inline auto query() const noexcept -> const std::vector<std::string> & {
return query_;
}
inline void query(std::vector<std::string> q) {
query_ = std::move(q);
}
[[nodiscard]] inline auto command() const noexcept -> const std::string & {
return command_;
}
[[nodiscard]] inline auto tag() const noexcept -> std::uint32_t {
return tag_;
}
void encode(std::vector<std::uint8_t> &buf) const;
protected:
std::string command_;
std::vector<std::string> query_;
std::uint32_t tag_;
};
} // namespace tikpp
#endif
| 28.431193 | 80 | 0.596644 | [
"vector"
] |
408c485802ae81b39de30f9449b705d2a723cbe3 | 1,434 | cpp | C++ | cpp/problems/39_Combination_Sum/solution.cpp | zerdzhong/LeetCode | a293a4ae3ac32f416c5361f386d027f558a67954 | [
"MIT"
] | null | null | null | cpp/problems/39_Combination_Sum/solution.cpp | zerdzhong/LeetCode | a293a4ae3ac32f416c5361f386d027f558a67954 | [
"MIT"
] | null | null | null | cpp/problems/39_Combination_Sum/solution.cpp | zerdzhong/LeetCode | a293a4ae3ac32f416c5361f386d027f558a67954 | [
"MIT"
] | null | null | null | //
// Created by zhongzhendong on 2018-12-28.
//
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <vector>
using namespace std;
/*
https://leetcode.com/problems/combination-sum/
*/
class Solution {
public:
vector<vector<int>> combinationSum(vector<int>& candidates, int target) {
vector<vector<int>> result;
if(candidates.size() == 0 || target == 0) {return result; }
vector<int> list;
dfs(candidates, target, 0, result, list);
return result;
}
void dfs(const vector<int> &candidates,
int target,
int level,
vector<vector<int>>& result,
vector<int>& list)
{
if (target < 0 ){
return;
}
if(target == 0) {
result.push_back(list);
return;
}
for(int i = level; i < candidates.size(); i++) {
list.push_back(candidates[i]);
dfs(candidates, target - candidates[i], i, result, list);
list.pop_back();
}
}
};
TEST_CASE("CombinationSum") {
vector<int> candidates = {2,3,6,7};
auto res = Solution().combinationSum(candidates, 7);
vector<vector<int>> answer = {{7},{2,2,3}};
REQUIRE(res == answer);
candidates = {2,3,5};
res = Solution().combinationSum(candidates, 4);
answer = {{2,2,2,2},{2,3,3},{3,5}};
REQUIRE(res == answer);
}
| 22.061538 | 77 | 0.540446 | [
"vector"
] |
408e8cd25653029812e313e905bf816a9e310774 | 3,073 | cpp | C++ | src/bill.cpp | Thavarshan/vigaro | 697df33eb29e4fdf40aad96d3c30c0b90c82c158 | [
"MIT"
] | 3 | 2021-07-22T03:00:53.000Z | 2021-08-07T09:52:53.000Z | src/bill.cpp | Thavarshan/vigaro | 697df33eb29e4fdf40aad96d3c30c0b90c82c158 | [
"MIT"
] | 5 | 2021-03-01T12:01:01.000Z | 2021-03-04T17:14:39.000Z | src/bill.cpp | Thavarshan/vigaro | 697df33eb29e4fdf40aad96d3c30c0b90c82c158 | [
"MIT"
] | 1 | 2021-04-09T20:29:11.000Z | 2021-04-09T20:29:11.000Z | /**
* @file bill.cpp
* @author Thavarshan Thayananthajothy (tjthavarshan@gmail.com) <CL/HDCSE/95/15>
* @brief Rathnayaka GYMS Application (ICBT Batch 95 - Programming Fundamentals Assignment).
* @version 2.6.2
* @date 2021-04-16
*
* @copyright Copyright (c) 2021
*
*/
#include "include/details.h"
#include <iostream>
#include <map>
#include <string>
#include <vector>
/**
* @brief Calculate total payable amount and deduct discounts if user is eligible.
*
* @param amounts
* @return std::map<std::string, double>
*/
std::map<std::string, double> calculateBillAmount(std::vector<double> &amounts)
{
// We define a map to store the charge title and amount like total, discount and due.
std::map<std::string, double> charges;
double total = 0.00;
// We break down the vector that contains the prices of each packages purchased by the user.
for (double &amount : amounts)
{
// And add each amount to sum up as the total amount.
total += amount;
}
// We now check if the user is eligible for a discount by
// determining if the total is greater than Rs. 5000
double discount = total > 5000.00 ? total * 0.05 : 0.00;
double due = total - discount; // the due total amount we set according to the discount value.
// We now set each charge amount along with it's relevant titles.
charges.insert(std::make_pair("total", total));
charges.insert(std::make_pair("discount", discount));
charges.insert(std::make_pair("due", due));
// Finally we return the map with all the content.
return charges;
}
/**
* @brief Calculate bill amount for user choices invoice.
*
* @param choices
* @return std::map<std::string, double>
*/
std::map<std::string, double> makePurchase(std::map<std::string, int> &choices)
{
// The amounts vector will contain all the prices multiplied
// by the number of each package purchased by the user.
std::vector<double> amounts;
// The details will have the final content that will be passed to the invoice generator module.
std::map<std::string, double> details;
// We first break down the user's purchase choices and calculate total price of each purchase.
for (auto const &[id, units] : choices)
{
// Each package is recieved as a collection of it ID and units purchased
// e.x. { "PKGDT001", 10 }. So, we lookup the price of each package
// using its ID and multiply it by the number of units purchased.
amounts.push_back(packagePriceLookup(id) * (double)units); // This function is found in "details.cpp".
// We also have to pass these details to the invoice generator.
details.insert(std::make_pair(id, (double)units));
}
// Now we calculate the final payable bill amounts.
for (auto const &[charge, amount] : calculateBillAmount(amounts))
{
// We add those information to the details collection too.
details.insert(std::make_pair(charge, amount));
}
// Finally we return all the information as a map.
return details;
}
| 35.321839 | 110 | 0.677514 | [
"vector"
] |
4099f4be38a41a3cf20e68a1803f0349395f6fab | 16,371 | hpp | C++ | Pods/OpenVPNAdapter/Sources/OpenVPN3/openvpn/common/string.hpp | TiagoPedroByterev/openvpnclient-ios | a9dafb2a481cc72a3e408535fb7f0aba9f5cfa76 | [
"MIT"
] | 10 | 2021-03-29T13:52:06.000Z | 2022-03-10T02:24:25.000Z | Pods/OpenVPNAdapter/Sources/OpenVPN3/openvpn/common/string.hpp | TiagoPedroByterev/openvpnclient-ios | a9dafb2a481cc72a3e408535fb7f0aba9f5cfa76 | [
"MIT"
] | null | null | null | Pods/OpenVPNAdapter/Sources/OpenVPN3/openvpn/common/string.hpp | TiagoPedroByterev/openvpnclient-ios | a9dafb2a481cc72a3e408535fb7f0aba9f5cfa76 | [
"MIT"
] | 6 | 2021-07-03T07:56:56.000Z | 2022-02-14T15:28:23.000Z | // OpenVPN -- An application to securely tunnel IP networks
// over a single port, with support for SSL/TLS-based
// session authentication and key exchange,
// packet encryption, packet authentication, and
// packet compression.
//
// Copyright (C) 2012-2017 OpenVPN Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License Version 3
// as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program in the COPYING file.
// If not, see <http://www.gnu.org/licenses/>.
// General purpose string-manipulation functions.
#ifndef OPENVPN_COMMON_STRING_H
#define OPENVPN_COMMON_STRING_H
#include <string>
#include <vector>
#include <cstring>
#include <cctype>
#include <algorithm>
#include <openvpn/common/platform.hpp>
#include <openvpn/common/size.hpp>
namespace openvpn {
namespace string {
// case insensitive compare functions
inline int strcasecmp(const char *s1, const char *s2)
{
#ifdef OPENVPN_PLATFORM_WIN
return ::_stricmp(s1, s2);
#else
return ::strcasecmp(s1, s2);
#endif
}
inline int strcasecmp(const std::string& s1, const char *s2)
{
return strcasecmp(s1.c_str(), s2);
}
inline int strcasecmp(const char *s1, const std::string& s2)
{
return strcasecmp(s1, s2.c_str());
}
inline int strcasecmp(const std::string& s1, const std::string& s2)
{
return strcasecmp(s1.c_str(), s2.c_str());
}
// Like strncpy but makes sure dest is always null terminated
inline void strncpynt (char *dest, const char *src, size_t maxlen)
{
strncpy (dest, src, maxlen);
if (maxlen > 0)
dest[maxlen - 1] = 0;
}
// Copy string to dest, make sure dest is always null terminated,
// and fill out trailing chars in dest with '\0' up to dest_size.
inline void copy_fill (void *dest, const std::string& src, const size_t dest_size)
{
if (dest_size > 0)
{
const size_t ncopy = std::min(dest_size - 1, src.length());
std::memcpy(dest, src.c_str(), ncopy);
std::memset(static_cast<unsigned char *>(dest) + ncopy, 0, dest_size - ncopy);
}
}
inline bool is_true(const std::string& str)
{
return str == "1" || !strcasecmp(str.c_str(), "true");
}
inline bool starts_with(const std::string& str, const std::string& prefix)
{
const size_t len = str.length();
const size_t plen = prefix.length();
if (plen <= len)
return std::memcmp(str.c_str(), prefix.c_str(), plen) == 0;
else
return false;
}
inline bool starts_with(const std::string& str, const char *prefix)
{
const size_t len = str.length();
const size_t plen = std::strlen(prefix);
if (plen <= len)
return std::memcmp(str.c_str(), prefix, plen) == 0;
else
return false;
}
inline bool ends_with(const std::string& str, const std::string& suffix)
{
const size_t len = str.length();
const size_t slen = suffix.length();
if (slen <= len)
return std::memcmp(str.c_str() + (len-slen), suffix.c_str(), slen) == 0;
else
return false;
}
inline bool ends_with(const std::string& str, const char *suffix)
{
const size_t len = str.length();
const size_t slen = std::strlen(suffix);
if (slen <= len)
return std::memcmp(str.c_str() + (len-slen), suffix, slen) == 0;
else
return false;
}
// return true if string ends with char c
inline bool ends_with(const std::string& str, const char c)
{
return str.length() && str.back() == c;
}
// return true if string ends with a newline
inline bool ends_with_newline(const std::string& str)
{
return ends_with(str, '\n');
}
// return true if string ends with a CR or LF
inline bool ends_with_crlf(const std::string& str)
{
if (str.length())
{
const char c = str.back();
return c == '\n' || c == '\r';
}
else
return false;
}
// Prepend leading characters (c) to str to obtain a minimum string length (min_len).
// Useful for adding leading zeros to numeric values or formatting tables.
inline std::string add_leading(const std::string& str, const size_t min_len, const char c)
{
if (min_len <= str.length())
return str;
size_t len = min_len - str.length();
std::string ret;
ret.reserve(min_len);
while (len--)
ret += c;
ret += str;
return ret;
}
// make sure that string ends with char c, if not append it
inline std::string add_trailing_copy(const std::string& str, const char c)
{
if (ends_with(str, c))
return str;
else
return str + c;
}
// make sure that string ends with char c, if not append it
inline void add_trailing(std::string& str, const char c)
{
if (!ends_with(str, c))
str += c;
}
// make sure that string ends with CRLF, if not append it
inline void add_trailing_crlf(std::string& str)
{
if (ends_with(str, "\r\n"))
;
else if (ends_with(str, '\r'))
str += '\n';
else if (ends_with(str, '\n'))
{
str.pop_back();
str += "\r\n";
}
else
str += "\r\n";
}
// make sure that string ends with CRLF, if not append it
inline std::string add_trailing_crlf_copy(std::string str)
{
add_trailing_crlf(str);
return str;
}
// make sure that string ends with char c, if not append it (unless the string is empty)
inline std::string add_trailing_unless_empty_copy(const std::string& str, const char c)
{
if (str.empty() || ends_with(str, c))
return str;
else
return str + c;
}
// remove trailing \r or \n chars
inline void trim_crlf(std::string& str)
{
while (ends_with_crlf(str))
str.pop_back();
}
// remove trailing \r or \n chars
inline std::string trim_crlf_copy(std::string str)
{
trim_crlf(str);
return str;
}
// return true if str of size len contains an embedded null
inline bool embedded_null(const char *str, size_t len)
{
while (len--)
if (!*str++)
return true;
return false;
}
// return the length of a string, omitting trailing nulls
inline size_t len_without_trailing_nulls(const char *str, size_t len)
{
while (len > 0 && str[len-1] == '\0')
--len;
return len;
}
// return true if string contains at least one newline
inline bool is_multiline(const std::string& str)
{
return str.find_first_of('\n') != std::string::npos;
}
// Return string up to a delimiter (without the delimiter).
// Returns the entire string if no delimiter is found.
inline std::string to_delim(const std::string& str, const char delim)
{
const size_t pos = str.find_first_of(delim);
if (pos != std::string::npos)
return str.substr(0, pos);
else
return str;
}
// return the first line (without newline) of a multi-line string
inline std::string first_line(const std::string& str)
{
return to_delim(str, '\n');
}
// Define a common interpretation of what constitutes a space character.
// Return true if c is a space char.
inline bool is_space(const char c)
{
return std::isspace(static_cast<unsigned char>(c)) != 0;
}
inline bool is_digit(const char c)
{
return std::isdigit(static_cast<unsigned char>(c)) != 0;
}
inline bool is_alpha(const char c)
{
return std::isalpha(static_cast<unsigned char>(c)) != 0;
}
inline bool is_alphanumeric(const char c)
{
return std::isalnum(static_cast<unsigned char>(c)) != 0;
}
inline bool is_printable(const char c)
{
return std::isprint(static_cast<unsigned char>(c)) != 0;
}
inline bool is_printable(const unsigned char c)
{
return std::isprint(c) != 0;
}
inline bool is_ctrl(const char c)
{
return std::iscntrl(static_cast<unsigned char>(c)) != 0;
}
inline bool is_ctrl(const unsigned char c)
{
return std::iscntrl(c) != 0;
}
// return true if string conforms to regex \w*
inline bool is_word(const std::string& str)
{
for (auto &c : str)
if (!(is_alphanumeric(c) || c == '_'))
return false;
return true;
}
// return true if all string characters are printable (or if string is empty)
inline bool is_printable(const std::string& str)
{
for (auto &c : str)
if (!is_printable(c))
return false;
return true;
}
// return true if str contains at least one non-space control char
inline bool contains_non_space_ctrl(const std::string& str)
{
for (auto &c : str)
if ((!is_space(c) && is_ctrl(c)) || c == 127)
return true;
return false;
}
// return true if str contains at least one space char
inline bool contains_space(const std::string& str)
{
for (std::string::const_iterator i = str.begin(); i != str.end(); ++i)
if (is_space(*i))
return true;
return false;
}
// remove all spaces in string
inline std::string remove_spaces(const std::string& str)
{
std::string ret;
for (std::string::const_iterator i = str.begin(); i != str.end(); ++i)
{
char c = *i;
if (!is_space(c))
ret += c;
}
return ret;
}
// replace all spaces in string with rep
inline std::string replace_spaces(const std::string& str, const char rep)
{
std::string ret;
for (std::string::const_iterator i = str.begin(); i != str.end(); ++i)
{
char c = *i;
if (is_space(c))
c = rep;
ret += c;
}
return ret;
}
// replace all spaces in string with rep, reducing instances of multiple
// consecutive spaces to a single instance of rep and removing leading
// and trailing spaces
inline std::string reduce_spaces(const std::string& str, const char rep)
{
std::string ret;
bool last_space = true;
for (std::string::const_iterator i = str.begin(); i != str.end(); ++i)
{
char c = *i;
const bool space = is_space(c);
if (is_space(c))
c = rep;
if (!(space && last_space))
ret += c;
last_space = space;
}
if (last_space && !ret.empty())
ret.pop_back();
return ret;
}
// generate a string with spaces
inline std::string spaces(int n)
{
std::string ret;
ret.reserve(n);
while (n-- > 0)
ret += ' ';
return ret;
}
// indent a multiline string
inline std::string indent(const std::string& str, const int first, const int remaining)
{
std::string ret;
int n_spaces = first;
for (auto &c : str)
{
if (n_spaces)
ret += spaces(n_spaces);
n_spaces = 0;
ret += c;
if (c == '\n')
n_spaces = remaining;
}
return ret;
}
// replace instances of char 'from' in string with char 'to'
inline std::string replace_copy(const std::string& str, const char from, const char to)
{
std::string ret;
ret.reserve(str.length());
for (auto &c : str)
ret.push_back(c == from ? to : c);
return ret;
}
// return true if str is empty or contains only space chars
inline bool is_empty(const std::string& str)
{
for (const auto& c : str)
if (!is_space(c))
return false;
return true;
}
// return true if str is empty or contains only space chars
inline bool is_empty(const char *str)
{
if (!str)
return true;
char c;
while ((c = *str++) != '\0')
if (!is_space(c))
return false;
return true;
}
// convert \n to \r\n
inline std::string unix2dos(const std::string& str, const bool force_eol=false)
{
std::string ret;
bool last_char_was_cr = false;
ret.reserve(str.length() + str.length() / 8);
for (std::string::const_iterator i = str.begin(); i != str.end(); ++i)
{
const char c = *i;
if (c == '\n' && !last_char_was_cr)
ret += '\r';
ret += c;
last_char_was_cr = (c == '\r');
}
if (force_eol)
add_trailing_crlf(ret);
return ret;
}
// Split a string on sep delimiter. The size of the
// returned string vector will be at least 1 and at
// most maxsplit + 1 (unless maxsplit is passed as -1).
inline std::vector<std::string> split(const std::string& str,
const char sep,
const int maxsplit = -1)
{
std::vector<std::string> ret;
int nterms = 0;
std::string term;
if (maxsplit >= 0)
ret.reserve(maxsplit + 1);
for (const auto c : str)
{
if (c == sep && (maxsplit < 0 || nterms < maxsplit))
{
ret.push_back(std::move(term));
++nterms;
term.clear();
}
else
term += c;
}
ret.push_back(std::move(term));
return ret;
}
inline std::string join(const std::vector<std::string>& strings,
const std::string& delim,
const bool tail=false)
{
std::string ret;
bool first = true;
for (const auto &s : strings)
{
if (!first)
ret += delim;
ret += s;
first = false;
}
if (tail && !ret.empty())
ret += delim;
return ret;
}
inline std::vector<std::string> from_argv(int argc, char *argv[], const bool skip_first)
{
std::vector<std::string> ret;
for (int i = (skip_first ? 1 : 0); i < argc; ++i)
ret.emplace_back(argv[i]);
return ret;
}
inline std::string trim_left_copy(const std::string& str)
{
for (size_t i = 0; i < str.length(); ++i)
{
if (!is_space(str[i]))
return str.substr(i);
}
return std::string();
}
inline std::string trim_copy(const std::string& str)
{
for (size_t i = 0; i < str.length(); ++i)
{
if (!is_space(str[i]))
{
size_t last_nonspace = i;
for (size_t j = i + 1; j < str.length(); ++j)
{
if (!is_space(str[j]))
last_nonspace = j;
}
return str.substr(i, last_nonspace - i + 1);
}
}
return std::string();
}
inline std::string to_upper_copy(const std::string& str)
{
std::string ret;
ret.reserve(str.length()+1);
for (const auto &c : str)
ret.push_back(std::toupper(static_cast<unsigned char>(c)));
return ret;
}
inline std::string to_lower_copy(const std::string& str)
{
std::string ret;
ret.reserve(str.length()+1);
for (const auto &c : str)
ret.push_back(std::tolower(static_cast<unsigned char>(c)));
return ret;
}
inline void trim(std::string& str)
{
str = trim_copy(str);
}
inline void trim_left(std::string& str)
{
str = trim_left_copy(str);
}
inline void to_lower(std::string& str)
{
str = to_lower_copy(str);
}
inline void to_upper(std::string& str)
{
str = to_upper_copy(str);
}
// Replace any subsequence of consecutive space chars containing
// at least one newline with a single newline char. If string
// is non-empty and doesn't include a trailing newline, add one.
inline std::string remove_blanks(const std::string& str)
{
std::string ret;
ret.reserve(str.length()+1);
std::string spaces;
bool in_space = false;
bool has_nl = false;
for (auto &c : str)
{
const bool s = is_space(c);
reprocess:
if (in_space)
{
if (s)
{
if (c == '\n')
has_nl = true;
spaces += c;
}
else
{
if (has_nl)
ret += '\n';
else
ret += spaces;
in_space = false;
has_nl = false;
spaces.clear();
goto reprocess;
}
}
else
{
if (s)
{
in_space = true;
goto reprocess;
}
else
ret += c;
}
}
if (!ret.empty() && !ends_with_newline(ret))
ret += '\n';
return ret;
}
} // namespace string
} // namespace openvpn
#endif // OPENVPN_COMMON_STRING_H
| 25.070444 | 94 | 0.594221 | [
"vector"
] |
409a67b37efc4a797f078df98b196d783f62b221 | 1,590 | hpp | C++ | src/metal-filesystem-pipeline/include/metal-filesystem-pipeline/metal_pipeline_storage.hpp | metalfs/metal_fs | f244d4125622849f36bd7846881a5f3a7efca188 | [
"MIT"
] | 12 | 2020-04-21T05:21:32.000Z | 2022-02-19T11:27:18.000Z | src/metal-filesystem-pipeline/include/metal-filesystem-pipeline/metal_pipeline_storage.hpp | metalfs/metal_fs | f244d4125622849f36bd7846881a5f3a7efca188 | [
"MIT"
] | 10 | 2019-02-10T17:10:16.000Z | 2020-02-01T20:05:42.000Z | src/metal-filesystem-pipeline/include/metal-filesystem-pipeline/metal_pipeline_storage.hpp | metalfs/metal_fs | f244d4125622849f36bd7846881a5f3a7efca188 | [
"MIT"
] | 4 | 2020-07-15T04:42:20.000Z | 2022-02-19T11:27:19.000Z | #pragma once
#include <metal-filesystem-pipeline/metal-filesystem-pipeline_api.h>
#include <map>
#include <memory>
#include <vector>
#include <metal-filesystem/metal.h>
#include <metal-filesystem-pipeline/filesystem_context.hpp>
#include <metal-pipeline/card.hpp>
#include <metal-pipeline/fpga_interface.hpp>
namespace metal {
class METAL_FILESYSTEM_PIPELINE_API PipelineStorage
: public FilesystemContext,
public std::enable_shared_from_this<PipelineStorage> {
public:
PipelineStorage(
Card card, fpga::AddressType type, fpga::MapType map,
std::string metadataDir, bool deleteMetadataIfExists = false,
std::shared_ptr<PipelineStorage> dramPipelineStorage = nullptr);
fpga::AddressType type() const { return _type; };
fpga::MapType map() const { return _map; };
std::shared_ptr<PipelineStorage> dramPipelineStorage() const {
return _dramPipelineStorage;
}
inline static const std::string PagefileReadPath = "/.pagefile_read";
inline static const std::string PagefileWritePath = "/.pagefile_write";
protected:
void createDramPagefile(const std::string &pagefilePath);
int initialize();
int deinitialize();
int mtl_storage_get_metadata(mtl_storage_metadata *metadata);
int read(uint64_t inode_id, uint64_t offset, void *buffer, uint64_t length);
int write(uint64_t inode_id, uint64_t offset, const void *buffer,
uint64_t length);
Card _card;
mtl_storage_backend _backend;
fpga::AddressType _type;
fpga::MapType _map;
std::shared_ptr<PipelineStorage> _dramPipelineStorage;
};
} // namespace metal
| 29.444444 | 78 | 0.755975 | [
"vector"
] |
409e6c60e8db6262b47137cc059db2d947d9d6f5 | 14,641 | cc | C++ | runtime/bin/elf_loader.cc | jtlapp/sdk | 0bca6aaf106b1d2752df8134d745743d52b6a78b | [
"BSD-3-Clause"
] | 2 | 2019-11-06T13:44:11.000Z | 2019-11-17T06:49:40.000Z | runtime/bin/elf_loader.cc | jtlapp/sdk | 0bca6aaf106b1d2752df8134d745743d52b6a78b | [
"BSD-3-Clause"
] | 1 | 2021-01-21T14:45:59.000Z | 2021-01-21T14:45:59.000Z | runtime/bin/elf_loader.cc | jtlapp/sdk | 0bca6aaf106b1d2752df8134d745743d52b6a78b | [
"BSD-3-Clause"
] | 1 | 2019-12-06T19:09:33.000Z | 2019-12-06T19:09:33.000Z | // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include <bin/elf_loader.h>
#include <bin/file.h>
#include <platform/elf.h>
#include <platform/globals.h>
#include <vm/cpu.h>
#include <vm/virtual_memory.h>
#include <memory>
namespace dart {
namespace bin {
namespace elf {
/// A loader for a subset of ELF which may be used to load objects produced by
/// Dart_CreateAppAOTSnapshotAsElf.
class LoadedElf {
public:
explicit LoadedElf(const char* filename, uint64_t elf_data_offset)
: filename_(strdup(filename), std::free),
elf_data_offset_(elf_data_offset) {}
~LoadedElf();
/// Loads the ELF object into memory. Returns whether the load was successful.
/// On failure, the error may be retrieved by 'error()'.
bool Load();
/// Reads Dart-specific symbols from the loaded ELF.
///
/// Stores the address of the corresponding symbol in each non-null output
/// parameter.
///
/// Fails if any output parameter is non-null but points to null and the
/// corresponding symbol was not found, or if the dynamic symbol table could
/// not be decoded.
///
/// On failure, the error may be retrieved by 'error()'.
bool ResolveSymbols(const uint8_t** vm_data,
const uint8_t** vm_instrs,
const uint8_t** isolate_data,
const uint8_t** isolate_instrs);
const char* error() { return error_; }
private:
bool ReadHeader();
bool ReadProgramTable();
bool LoadSegments();
bool ReadSectionTable();
bool ReadSectionStringTable();
bool ReadSections();
static uword PageSize() { return VirtualMemory::PageSize(); }
// Unlike File::Map, allows non-aligned 'start' and 'length'.
MappedMemory* MapFilePiece(uword start,
uword length,
const void** mapping_start);
std::unique_ptr<char, decltype(std::free)*> filename_;
const uint64_t elf_data_offset_;
// Initialized on a successful Load().
File* file_;
// Initialized on error.
const char* error_ = nullptr;
// Initialized by ReadHeader().
dart::elf::ElfHeader header_;
// Initialized by ReadProgramTable().
std::unique_ptr<MappedMemory> program_table_mapping_;
const dart::elf::ProgramHeader* program_table_ = nullptr;
// Initialized by LoadSegments().
std::unique_ptr<VirtualMemory> base_;
// Initialized by ReadSectionTable().
std::unique_ptr<MappedMemory> section_table_mapping_;
const dart::elf::SectionHeader* section_table_ = nullptr;
// Initialized by ReadSectionStringTable().
std::unique_ptr<MappedMemory> section_string_table_mapping_;
const char* section_string_table_ = nullptr;
// Initialized by ReadSections().
const char* dynamic_string_table_ = nullptr;
const dart::elf::Symbol* dynamic_symbol_table_ = nullptr;
uword dynamic_symbol_count_ = 0;
DISALLOW_COPY_AND_ASSIGN(LoadedElf);
};
#define CHECK(value) \
if (!(value)) { \
ASSERT(error_ != nullptr); \
return false; \
}
#define ERROR(message) \
{ \
error_ = (message); \
return false; \
}
#define CHECK_ERROR(value, message) \
if (!(value)) { \
error_ = (message); \
return false; \
}
bool LoadedElf::Load() {
VirtualMemory::Init();
if (error_ != nullptr) {
return false;
}
CHECK_ERROR(Utils::IsAligned(elf_data_offset_, PageSize()),
"File offset must be page-aligned.");
file_ = File::Open(/*namespc=*/nullptr, filename_.get(),
bin::File::FileOpenMode::kRead);
CHECK_ERROR(file_ != nullptr, "Cannot open ELF object file.");
CHECK_ERROR(file_->SetPosition(elf_data_offset_), "Invalid file offset.");
CHECK(ReadHeader());
CHECK(ReadProgramTable());
CHECK(LoadSegments());
CHECK(ReadSectionTable());
CHECK(ReadSectionStringTable());
CHECK(ReadSections());
return true;
}
LoadedElf::~LoadedElf() {
// Unmap the image.
base_.reset();
// Explicitly destroy all the mappings before closing the file.
program_table_mapping_.reset();
section_table_mapping_.reset();
section_string_table_mapping_.reset();
if (file_ != nullptr) {
file_->Close();
file_->Release();
}
}
bool LoadedElf::ReadHeader() {
CHECK_ERROR(file_->ReadFully(&header_, sizeof(dart::elf::ElfHeader)),
"Could not read ELF file.");
CHECK_ERROR(header_.ident[dart::elf::EI_DATA] == dart::elf::ELFDATA2LSB,
"Expected little-endian ELF object.");
CHECK_ERROR(header_.type == dart::elf::ET_DYN,
"Can only load dynamic libraries.");
#if defined(TARGET_ARCH_IA32)
CHECK_ERROR(header_.machine == dart::elf::EM_386, "Architecture mismatch.");
#elif defined(TARGET_ARCH_X64)
CHECK_ERROR(header_.machine == dart::elf::EM_X86_64,
"Architecture mismatch.");
#elif defined(TARGET_ARCH_ARM)
CHECK_ERROR(header_.machine == dart::elf::EM_ARM, "Architecture mismatch.");
#elif defined(TARGET_ARCH_ARM64)
CHECK_ERROR(header_.machine == dart::elf::EM_AARCH64,
"Architecture mismatch.");
#else
#error Unsupported architecture architecture.
#endif
CHECK_ERROR(header_.version == dart::elf::EV_CURRENT,
"Unexpected ELF version.");
CHECK_ERROR(header_.header_size == sizeof(dart::elf::ElfHeader),
"Unexpected header size.");
CHECK_ERROR(
header_.program_table_entry_size == sizeof(dart::elf::ProgramHeader),
"Unexpected program header size.");
CHECK_ERROR(
header_.section_table_entry_size == sizeof(dart::elf::SectionHeader),
"Unexpected section header size.");
return true;
}
bool LoadedElf::ReadProgramTable() {
const uword file_start = header_.program_table_offset;
const uword file_length =
header_.num_program_headers * sizeof(dart::elf::ProgramHeader);
program_table_mapping_.reset(
MapFilePiece(file_start, file_length,
reinterpret_cast<const void**>(&program_table_)));
CHECK_ERROR(program_table_mapping_ != nullptr,
"Could not mmap the program table.");
return true;
}
bool LoadedElf::ReadSectionTable() {
const uword file_start = header_.section_table_offset;
const uword file_length =
header_.num_section_headers * sizeof(dart::elf::SectionHeader);
section_table_mapping_.reset(
MapFilePiece(file_start, file_length,
reinterpret_cast<const void**>(§ion_table_)));
CHECK_ERROR(section_table_mapping_ != nullptr,
"Could not mmap the section table.");
return true;
}
bool LoadedElf::ReadSectionStringTable() {
const dart::elf::SectionHeader header =
section_table_[header_.shstrtab_section_index];
section_string_table_mapping_.reset(
MapFilePiece(header.file_offset, header.file_size,
reinterpret_cast<const void**>(§ion_string_table_)));
CHECK_ERROR(section_string_table_mapping_ != nullptr,
"Could not mmap the section string table.");
return true;
}
bool LoadedElf::LoadSegments() {
// Calculate the total amount of virtual memory needed.
uword total_memory = 0;
uword maximum_alignment = PageSize();
for (uword i = 0; i < header_.num_program_headers; ++i) {
const dart::elf::ProgramHeader header = program_table_[i];
// Only PT_LOAD segments need to be loaded.
if (header.type != dart::elf::ProgramHeaderType::PT_LOAD) continue;
total_memory = Utils::Maximum(
static_cast<uword>(header.memory_offset + header.memory_size),
total_memory);
CHECK_ERROR(Utils::IsPowerOfTwo(header.alignment),
"Alignment must be a power of two.");
maximum_alignment =
Utils::Maximum(maximum_alignment, static_cast<uword>(header.alignment));
}
total_memory = Utils::RoundUp(total_memory, PageSize());
base_.reset(VirtualMemory::AllocateAligned(
total_memory, /*alignment=*/maximum_alignment,
/*is_executable=*/false, /*mapping name=*/filename_.get()));
CHECK_ERROR(base_ != nullptr, "Could not reserve virtual memory.");
for (uword i = 0; i < header_.num_program_headers; ++i) {
const dart::elf::ProgramHeader header = program_table_[i];
// Only PT_LOAD segments need to be loaded.
if (header.type != dart::elf::ProgramHeaderType::PT_LOAD) continue;
const uword memory_offset = header.memory_offset,
file_offset = header.file_offset;
CHECK_ERROR(
(memory_offset % PageSize()) == (file_offset % PageSize()),
"Difference between file and memory offset must be page-aligned.");
const intptr_t adjustment = header.memory_offset % PageSize();
void* const memory_start =
static_cast<char*>(base_->address()) + memory_offset - adjustment;
const uword file_start = elf_data_offset_ + file_offset - adjustment;
const uword length = header.memory_size + adjustment;
File::MapType map_type = File::kReadOnly;
if (header.flags == (dart::elf::PF_R | dart::elf::PF_W)) {
map_type = File::kReadWrite;
} else if (header.flags == (dart::elf::PF_R | dart::elf::PF_X)) {
map_type = File::kReadExecute;
} else if (header.flags == dart::elf::PF_R) {
map_type = File::kReadOnly;
} else {
ERROR("Unsupported segment flag set.");
}
std::unique_ptr<MappedMemory> memory(
file_->Map(map_type, file_start, length, memory_start));
CHECK_ERROR(memory != nullptr, "Could not map segment.");
CHECK_ERROR(memory->address() == memory_start,
"Mapping not at requested address.");
}
return true;
}
bool LoadedElf::ReadSections() {
for (uword i = 0; i < header_.num_section_headers; ++i) {
const dart::elf::SectionHeader header = section_table_[i];
const char* const name = section_string_table_ + header.name;
if (strcmp(name, ".dynstr") == 0) {
CHECK_ERROR(header.memory_offset != 0, ".dynstr must be loaded.");
dynamic_string_table_ =
static_cast<const char*>(base_->address()) + header.memory_offset;
} else if (strcmp(name, ".dynsym") == 0) {
CHECK_ERROR(header.memory_offset != 0, ".dynsym must be loaded.");
dynamic_symbol_table_ = reinterpret_cast<const dart::elf::Symbol*>(
base_->start() + header.memory_offset);
dynamic_symbol_count_ = header.file_size / sizeof(dart::elf::Symbol);
}
}
CHECK_ERROR(dynamic_string_table_ != nullptr, "Couldn't find .dynstr.");
CHECK_ERROR(dynamic_symbol_table_ != nullptr, "Couldn't find .dynsym.");
return true;
}
bool LoadedElf::ResolveSymbols(const uint8_t** vm_data,
const uint8_t** vm_instrs,
const uint8_t** isolate_data,
const uint8_t** isolate_instrs) {
if (error_ != nullptr) {
return false;
}
// The first entry of the symbol table is reserved.
for (uword i = 1; i < dynamic_symbol_count_; ++i) {
const dart::elf::Symbol sym = dynamic_symbol_table_[i];
const char* name = dynamic_string_table_ + sym.name;
const uint8_t** output = nullptr;
if (strcmp(name, kVmSnapshotDataAsmSymbol) == 0) {
output = vm_data;
} else if (strcmp(name, kVmSnapshotInstructionsAsmSymbol) == 0) {
output = vm_instrs;
} else if (strcmp(name, kIsolateSnapshotDataAsmSymbol) == 0) {
output = isolate_data;
} else if (strcmp(name, kIsolateSnapshotInstructionsAsmSymbol) == 0) {
output = isolate_instrs;
}
if (output != nullptr) {
*output = reinterpret_cast<const uint8_t*>(base_->start() + sym.value);
}
}
CHECK_ERROR(vm_data == nullptr || *vm_data != nullptr,
"Could not find VM snapshot data.");
CHECK_ERROR(vm_instrs == nullptr || *vm_instrs != nullptr,
"Could not find VM snapshot instructions.");
CHECK_ERROR(isolate_data == nullptr || *isolate_data != nullptr,
"Could not find isolate snapshot data.");
CHECK_ERROR(isolate_instrs == nullptr || *isolate_instrs != nullptr,
"Could not find isolate instructions.");
return true;
}
MappedMemory* LoadedElf::MapFilePiece(uword file_start,
uword file_length,
const void** mem_start) {
const uword adjustment = (elf_data_offset_ + file_start) % PageSize();
const uword mapping_offset = elf_data_offset_ + file_start - adjustment;
const uword mapping_length =
Utils::RoundUp(elf_data_offset_ + file_start + file_length, PageSize()) -
mapping_offset;
MappedMemory* const mapping =
file_->Map(bin::File::kReadOnly, mapping_offset, mapping_length);
if (mapping != nullptr) {
*mem_start = reinterpret_cast<uint8_t*>(mapping->start() +
(file_start % PageSize()));
}
return mapping;
}
} // namespace elf
} // namespace bin
} // namespace dart
DART_EXPORT Dart_LoadedElf* Dart_LoadELF(const char* filename,
uint64_t file_offset,
const char** error,
const uint8_t** vm_snapshot_data,
const uint8_t** vm_snapshot_instrs,
const uint8_t** vm_isolate_data,
const uint8_t** vm_isolate_instrs) {
std::unique_ptr<dart::bin::elf::LoadedElf> elf(
new dart::bin::elf::LoadedElf(filename, file_offset));
if (!elf->Load() ||
!elf->ResolveSymbols(vm_snapshot_data, vm_snapshot_instrs,
vm_isolate_data, vm_isolate_instrs)) {
*error = elf->error();
return nullptr;
}
return reinterpret_cast<Dart_LoadedElf*>(elf.release());
}
DART_EXPORT void Dart_UnloadELF(Dart_LoadedElf* loaded) {
delete reinterpret_cast<dart::bin::elf::LoadedElf*>(loaded);
}
| 36.420398 | 80 | 0.630148 | [
"object"
] |
40a150067302e01c8871e955dec251da6aa176ad | 21,949 | cxx | C++ | base/fs/utils/untfs/src/ntfsbit.cxx | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/fs/utils/untfs/src/ntfsbit.cxx | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/fs/utils/untfs/src/ntfsbit.cxx | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | /*++
Copyright (c) 1991-2000 Microsoft Corporation
Module Name:
ntfsbit.cxx
Abstract:
This module contains the declarations for NTFS_BITMAP,
which models the bitmap of an NTFS volume, and MFT_BITMAP,
which models the bitmap for the Master File Table.
Author:
Bill McJohn (billmc) 17-June-91
Environment:
ULIB, User Mode
Notes:
This implementation only supports bitmaps which have a number
of sectors which will fit in a ULONG. The interface supports
the 64-bit number of clusters, but Initialize will refuse to
accept a number-of-clusters value which has a non-zero high part.
If we rewrite BITVECTOR to accept 64-bit cluster numbers (or
write a new one) this class could easily be fixed to support
larger volumes.
--*/
#include <pch.cxx>
#define _NTAPI_ULIB_
#define _UNTFS_MEMBER_
#include "ulib.hxx"
#include "error.hxx"
#include "untfs.hxx"
#include "ntfsbit.hxx"
#include "attrib.hxx"
DEFINE_EXPORTED_CONSTRUCTOR( NTFS_BITMAP, OBJECT, UNTFS_EXPORT );
UNTFS_EXPORT
NTFS_BITMAP::~NTFS_BITMAP(
)
{
Destroy();
}
VOID
NTFS_BITMAP::Construct(
)
/*++
Routine Description:
Worker method for object construction.
Arguments:
None.
Return Value:
None.
--*/
{
_NumberOfClusters = 0;
_BitmapSize = 0;
_BitmapData = NULL;
_NextAlloc = 0;
_Mft = NULL;
_ClusterFactor = 0;
_Drive = NULL;
}
VOID
NTFS_BITMAP::Destroy(
)
/*++
Routine Description:
Worker method to prepare an object for destruction
or reinitialization.
Arguments:
None.
Return Value:
None.
--*/
{
_NumberOfClusters = 0;
_BitmapSize = 0;
FREE( _BitmapData );
_NextAlloc = 0;
_Mft = NULL;
}
UNTFS_EXPORT
BOOLEAN
NTFS_BITMAP::Initialize(
IN BIG_INT NumberOfClusters,
IN BOOLEAN IsGrowable,
IN PLOG_IO_DP_DRIVE Drive,
IN ULONG ClusterFactor
)
/*++
Routine Description:
This method initializes an NTFS_BITMAP object.
Arguments:
NumberOfClusters -- Supplies the number of allocation units
which the bitmap covers.
IsGrowable -- Supplies a flag indicating whether the
bitmap may grow (TRUE) or is of fixed size
(FALSE).
Return Value:
TRUE upon successful completion.
Notes:
The bitmap is initialized with all clusters within the range of
NumberOfClusters marked as FREE.
--*/
{
ULONG LowNumberOfClusters;
Destroy();
if( NumberOfClusters.GetHighPart() != 0 ) {
DebugPrint( "bitmap.cxx: cannot manage a volume of this size.\n" );
return FALSE;
}
LowNumberOfClusters = NumberOfClusters.GetLowPart();
_NumberOfClusters = NumberOfClusters;
_IsGrowable = IsGrowable;
_Drive = Drive;
_ClusterFactor = ClusterFactor;
// Determine the size in bytes of the bitmap. Note that this size
// is quad-aligned.
_BitmapSize = ( LowNumberOfClusters % 8 ) ?
( LowNumberOfClusters/8 + 1 ) :
( LowNumberOfClusters/8 );
_BitmapSize = QuadAlign( max(_BitmapSize, 1) );
// Allocate space for the bitvector and initialize it.
if( (_BitmapData = MALLOC( _BitmapSize )) == NULL ||
!_Bitmap.Initialize( _BitmapSize * 8,
RESET,
(PPT)_BitmapData ) ) {
// Note that Destroy will clean up _BitmapData
Destroy();
return FALSE;
}
// If the bitmap is growable, then any padding bits are reset (free);
// if it is fixed size, they are set (allocated).
if( _IsGrowable ) {
_Bitmap.ResetBit( _NumberOfClusters.GetLowPart(),
_BitmapSize * 8 - _NumberOfClusters.GetLowPart() );
} else {
_Bitmap.SetBit( _NumberOfClusters.GetLowPart(),
_BitmapSize * 8 - _NumberOfClusters.GetLowPart() );
}
// The bitmap is intialized with all clusters marked free.
//
SetFree( 0, _NumberOfClusters );
return TRUE;
}
UNTFS_EXPORT
BOOLEAN
NTFS_BITMAP::Write(
IN OUT PNTFS_ATTRIBUTE BitmapAttribute,
IN OUT PNTFS_BITMAP VolumeBitmap
)
/*++
Routine Description:
This method writes the bitmap.
Arguments:
BitmapAttribute -- supplies the attribute which describes the
bitmap's location on disk.
VolumeBitmap -- supplies the volume's bitmap for possible
allocation during write.
Return Value:
TRUE upon successful completion.
Notes:
The attribute will, if necessary, allocate space from the
bitmap to write it.
--*/
{
ULONG BytesWritten;
DebugPtrAssert( _BitmapData );
return( CheckAttributeSize( BitmapAttribute, VolumeBitmap ) &&
BitmapAttribute->Write( _BitmapData,
0,
_BitmapSize,
&BytesWritten,
VolumeBitmap ) &&
BytesWritten == _BitmapSize );
}
UNTFS_EXPORT
BOOLEAN
NTFS_BITMAP::IsFree(
IN LCN Lcn,
IN BIG_INT RunLength
) CONST
/*++
Routine Description:
This method determines whether the specified cluster run is
marked as free in the bitmap.
Arguments:
Lcn -- supplies the LCN of the first cluster in the run
RunLength -- supplies the length of the run
Return Value:
TRUE if all clusters in the run are free in the bitmap.
Notes:
This method checks to make sure that the LCNs in question are in
range, i.e. less than the number of clusters in the bitmap.
--*/
{
ULONG i, CurrentLcn;
if( Lcn < 0 ||
Lcn + RunLength > _NumberOfClusters ) {
return FALSE;
}
// Note that, since _NumberOfClusters is not greater than the
// maximum ULONG, the high parts of Lcn and RunLength are
// sure to be zero.
for( i = 0, CurrentLcn = Lcn.GetLowPart();
i < RunLength.GetLowPart();
i++, CurrentLcn++ ) {
if( _Bitmap.IsBitSet( CurrentLcn ) ) {
return FALSE;
}
}
return TRUE;
}
BIG_INT
NTFS_BITMAP::QueryFreeBlockSize(
IN LCN Lcn
) CONST
/*++
Routine Description:
This method determines the size of the free block starting at
the given location.
Arguments:
Lcn -- supplies the LCN of the first cluster in the run
Return Value:
Number of contiguous free cluster
Notes:
This method checks to make sure that the LCNs in question are in
range, i.e. less than the number of clusters in the bitmap.
--*/
{
ULONG CurrentLcn;
if( Lcn < 0 ||
Lcn > _NumberOfClusters ) {
return FALSE;
}
DebugAssert(Lcn.GetHighPart() == 0);
DebugAssert(_NumberOfClusters.GetHighPart() == 0);
for( CurrentLcn = Lcn.GetLowPart();
CurrentLcn < _NumberOfClusters;
CurrentLcn++ ) {
if( _Bitmap.IsBitSet( CurrentLcn ) ) {
return (CurrentLcn - Lcn.GetLowPart());
}
}
return (CurrentLcn - Lcn.GetLowPart());
}
UNTFS_EXPORT
BOOLEAN
NTFS_BITMAP::IsAllocated(
IN LCN Lcn,
IN BIG_INT RunLength
) CONST
/*++
Routine Description:
This method determines whether the specified cluster run is
marked as used in the bitmap.
Arguments:
Lcn -- supplies the LCN of the first cluster in the run
RunLength -- supplies the length of the run
Return Value:
TRUE if all clusters in the run are in use in the bitmap.
Notes:
This method checks to make sure that the LCNs in question are in
range, i.e. less than the number of clusters in the bitmap.
--*/
{
ULONG i, CurrentLcn;
if( Lcn < 0 ||
Lcn + RunLength > _NumberOfClusters ) {
return FALSE;
}
// Note that, since _NumberOfClusters is not greater than the
// maximum ULONG, the high parts of Lcn and RunLength are
// sure to be zero.
for( i = 0, CurrentLcn = Lcn.GetLowPart();
i < RunLength.GetLowPart();
i++, CurrentLcn++ ) {
if( !_Bitmap.IsBitSet( CurrentLcn ) ) {
return FALSE;
}
}
return TRUE;
}
BOOLEAN
NTFS_BITMAP::AllocateClusters(
IN LCN NearHere,
IN BIG_INT RunLength,
OUT PLCN FirstAllocatedLcn,
IN ULONG AlignmentFactor
)
/*++
Routine Description:
This method finds a free run of sectors and marks it as allocated.
If the bitmap being allocated from is the volume bitmap, this method
will have a valid _Drive member. In this case, it will attempt to
verify that only usable clusters are allocated. If _Mft is also
set, any bad clusters found will be added to the bad cluster file.
Arguments:
NearHere -- supplies the LCN near which the caller would
like the space allocated.
RunLength -- supplies the number of clusters to be allocated
FirstAllocatedLcn -- receives the first LCN of the allocated run
AlignmentFactor -- supplies the alignment requirement for the
allocated run--it must start on a multiple
of AlignmentFactor.
Return Value:
TRUE upon successful completion; FirstAllocatedLcn receives the
LCN of the first cluster in the run.
--*/
{
ULONG current_lcn;
LCN first_allocated_lcn;
ULONG count;
BOOLEAN verify_each;
NTFS_BAD_CLUSTER_FILE badclus;
if (NearHere == 0) {
NearHere = _NextAlloc;
}
if (NearHere + RunLength > _NumberOfClusters) {
NearHere = _NumberOfClusters/2;
}
if( RunLength.GetHighPart() != 0 ) {
DebugAbort( "UNTFS: Trying to allocate too many sectors.\n" );
return FALSE;
}
//
// First we'll allocate a run and verify the whole thing at once.
// If that fails we'll go through the bitmap again, verifying each
// cluster.
//
verify_each = FALSE;
again:
// Search forwards for a big enough block.
count = RunLength.GetLowPart();
for (current_lcn = NearHere.GetLowPart();
count > 0 && current_lcn < _NumberOfClusters;
current_lcn += 1) {
if (IsFree(current_lcn, 1)) {
if (count == RunLength.GetLowPart() && current_lcn%AlignmentFactor != 0) {
continue;
}
if (verify_each && NULL != _Drive) {
// Insure that this cluster is functional and can accept IO.
if (!_Drive->Verify(current_lcn * _ClusterFactor,
_ClusterFactor)) {
// This cluster is bad. Set the bit in the bitmap so we
// won't waste time trying to allocate it again and start
// over.
SetAllocated(current_lcn, 1);
count = RunLength.GetLowPart();
// If the bad cluster file is available, add this lcn
// to it.
if (NULL != _Mft) {
if (!badclus.Initialize(_Mft) ||
!badclus.Read() ||
!badclus.Add(current_lcn) ||
!badclus.Flush(this)) {
DebugPrintTrace(("Unable to update bad cluster file. Bad Cluster at: %x\n",
current_lcn));
}
}
continue;
}
}
count -= 1;
} else {
count = RunLength.GetLowPart();
}
}
//
// If the forward search succeeded then allocate and return the
// result.
//
if (count == 0) {
first_allocated_lcn = current_lcn - RunLength;
if (NULL != _Drive && !_Drive->Verify(first_allocated_lcn * _ClusterFactor,
RunLength * _ClusterFactor,
NULL)) {
if (verify_each) {
// If we have been here before, then the whole block is bad as
// Verify cannot tell which individual cluster is/are bad
SetAllocated(first_allocated_lcn, RunLength);
verify_each = FALSE;
NearHere = first_allocated_lcn + RunLength;
if (NULL != _Mft) {
if (!badclus.Initialize(_Mft) ||
!badclus.Read() ||
!badclus.AddRun(first_allocated_lcn, RunLength) ||
!badclus.Flush(this)) {
DebugPrintTrace(("Unable to update bad cluster file.\n"
"Bad Cluster starts at %x%x with run length %x%x\n",
first_allocated_lcn.GetHighPart(),
first_allocated_lcn.GetLowPart(),
RunLength.GetHighPart(),
RunLength.GetLowPart()));
}
}
goto again;
}
//
// Want to go through each cluster in the run we found and
// figure out which ones are bad.
//
verify_each = TRUE;
NearHere = first_allocated_lcn;
goto again;
}
*FirstAllocatedLcn = first_allocated_lcn;
SetAllocated(first_allocated_lcn, RunLength);
_NextAlloc = first_allocated_lcn + RunLength;
return TRUE;
}
//
// We couldn't find any space by searching forwards, so let's
// search backwards.
//
verify_each = FALSE;
again_backward:
count = RunLength.GetLowPart();
for (current_lcn = NearHere.GetLowPart() + RunLength.GetLowPart() - 1;
count > 0 && current_lcn > 0; current_lcn -= 1) {
if (IsFree(current_lcn, 1)) {
if (count == RunLength.GetLowPart() &&
(current_lcn - RunLength.GetLowPart() + 1)%AlignmentFactor != 0) {
continue;
}
if (verify_each && NULL != _Drive) {
// Insure that this cluster is functional and can accept IO.
if (!_Drive->Verify(current_lcn * _ClusterFactor,
_ClusterFactor)) {
// This cluster is bad. Set the bit in the bitmap so we
// won't waste time trying to allocate it again and start
// over.
SetAllocated(current_lcn, 1);
count = RunLength.GetLowPart();
// If the bad cluster file is available, add this lcn
// to it.
if (NULL != _Mft) {
if (!badclus.Initialize(_Mft) ||
!badclus.Read() ||
!badclus.Add(current_lcn) ||
!badclus.Flush(this)) {
DebugPrintTrace(("Unable to update bad cluster file. Bad Cluster at: %x\n",
current_lcn));
}
}
continue;
}
}
count -= 1;
} else {
count = RunLength.GetLowPart();
}
}
if (count != 0) {
return FALSE;
}
first_allocated_lcn = current_lcn + 1;
if (NULL != _Drive && !_Drive->Verify(first_allocated_lcn * _ClusterFactor,
RunLength * _ClusterFactor,
NULL)) {
if (verify_each) {
// If we have been here before, then the whole block is bad as
// Verify cannot tell which individual cluster is/are bad
SetAllocated(first_allocated_lcn, RunLength);
verify_each = FALSE;
NearHere = first_allocated_lcn - RunLength;
if (NULL != _Mft) {
if (!badclus.Initialize(_Mft) ||
!badclus.Read() ||
!badclus.AddRun(first_allocated_lcn, RunLength) ||
!badclus.Flush(this)) {
DebugPrintTrace(("Unable to update bad cluster file.\n"
"Bad Cluster starts at %x%x with run length %x%x\n",
first_allocated_lcn.GetHighPart(),
first_allocated_lcn.GetLowPart(),
RunLength.GetHighPart(),
RunLength.GetLowPart()));
}
}
goto again_backward;
}
//
// Want to go through each cluster in the run we found and
// figure out which ones are bad.
//
verify_each = TRUE;
NearHere = first_allocated_lcn + RunLength + 1;
goto again_backward;
}
//
// Since we had to search backwards, we don't want to start
// our next search from here (and waste time searching forwards).
// Instead, set the roving pointer to zero.
//
*FirstAllocatedLcn = first_allocated_lcn;
SetAllocated(first_allocated_lcn, RunLength);
_NextAlloc = 0;
return TRUE;
}
BOOLEAN
NTFS_BITMAP::Resize(
IN BIG_INT NewNumberOfClusters
)
/*++
Routine Description:
This method changes the number of allocation units that the bitmap
covers. It may either grow or shrink the bitmap.
Arguments:
NewNumberOfClusters -- supplies the new number of allocation units
covered by this bitmap.
Return Value:
TRUE upon successful completion.
Notes:
The size (in bytes) of the bitmap is always kept quad-aligned, and
any padding bits are reset.
--*/
{
PVOID NewBitmapData;
ULONG NewSize;
LCN OldNumberOfClusters;
DebugAssert( _IsGrowable );
// Make sure that the number of clusters fits into a ULONG,
// so we can continue to use BITVECTOR.
if( NewNumberOfClusters.GetHighPart() != 0 ) {
DebugPrint( "bitmap.cxx: cannot manage a volume of this size.\n" );
return FALSE;
}
// Compute the new size of the bitmap, in bytes. Note that this
// size is always quad-aligned (ie. a multiple of 8).
NewSize = ( NewNumberOfClusters.GetLowPart() % 8 ) ?
( NewNumberOfClusters.GetLowPart()/8 + 1) :
( NewNumberOfClusters.GetLowPart()/8 );
NewSize = QuadAlign( NewSize );
if( NewSize == _BitmapSize ) {
// The bitmap is already the right size, so it's just a matter
// of diddling the private data. Since padding in a growable
// bitmap is always reset (free), the new space is by default
// free.
_NumberOfClusters = NewNumberOfClusters;
return TRUE;
}
// The bitmap has changed size, so we need to allocate new memory
// for it and copy it.
if( (NewBitmapData = MALLOC( NewSize )) == NULL ) {
return FALSE;
}
// Note that, if we supply the memory, BITVECTOR::Initialize
// cannot fail, so we don't check its return value.
_Bitmap.Initialize( NewSize * 8,
RESET,
(PPT)NewBitmapData );
if( NewNumberOfClusters < _NumberOfClusters ) {
// Copy the part of the old bitmap that we wish to
// preserve into the new bitmap.
memcpy( NewBitmapData,
_BitmapData,
NewSize );
} else {
// Copy the old bitmap into the new bitmap, and then
// mark all the newly claimed space as unused.
memcpy( NewBitmapData,
_BitmapData,
_BitmapSize );
SetFree( _NumberOfClusters,
NewNumberOfClusters - _NumberOfClusters );
}
FREE( _BitmapData );
_BitmapData = NewBitmapData;
_BitmapSize = NewSize;
_NumberOfClusters = NewNumberOfClusters;
// Make sure the padding bits are reset.
_Bitmap.ResetBit( _NumberOfClusters.GetLowPart(),
_BitmapSize * 8 - _NumberOfClusters.GetLowPart() );
return TRUE;
}
VOID
NTFS_BITMAP::SetGrowable(
IN BOOLEAN Growable
)
/*++
Routine Description:
This method changes whether the bitmap is growable or not. This
primarily effects the padding bits, if any, at the end of the bitmap.
They are clear for growable bitmaps and set for non-growable ones.
Arguments:
Growable -- Whether the bitmap should be growable.
Return Value:
None.
--*/
{
if (Growable) {
_Bitmap.ResetBit( _NumberOfClusters.GetLowPart(),
_BitmapSize * 8 - _NumberOfClusters.GetLowPart() );
} else {
_Bitmap.SetBit( _NumberOfClusters.GetLowPart(),
_BitmapSize * 8 - _NumberOfClusters.GetLowPart() );
}
}
| 25.611435 | 105 | 0.543988 | [
"object"
] |
40a35550d76365ada5a1ec8837f985629b4a1d47 | 54,736 | cpp | C++ | src/main.cpp | rohankumardubey/HybridRendering | 509f768cddb705afd26a639e3440240357b6b009 | [
"MIT"
] | 224 | 2020-04-20T03:42:54.000Z | 2022-01-04T16:08:48.000Z | src/main.cpp | rohankumardubey/HybridRendering | 509f768cddb705afd26a639e3440240357b6b009 | [
"MIT"
] | 7 | 2020-02-17T10:33:15.000Z | 2021-12-09T21:58:16.000Z | src/main.cpp | rohankumardubey/HybridRendering | 509f768cddb705afd26a639e3440240357b6b009 | [
"MIT"
] | 13 | 2020-07-03T13:39:52.000Z | 2021-12-11T08:50:42.000Z | #include <application.h>
#include <camera.h>
#include <profiler.h>
#include <assimp/scene.h>
#include <equirectangular_to_cubemap.h>
#include <ImGuizmo.h>
#include <math.h>
#define GLM_ENABLE_EXPERIMENTAL
#include <gtx/matrix_decompose.hpp>
#include <gtc/quaternion.hpp>
#include "g_buffer.h"
#include "deferred_shading.h"
#include "ray_traced_shadows.h"
#include "ray_traced_ao.h"
#include "ray_traced_reflections.h"
#include "ddgi.h"
#include "ground_truth_path_tracer.h"
#include "tone_map.h"
#include "temporal_aa.h"
#include "utilities.h"
class HybridRendering : public dw::Application
{
public:
friend class GBuffer;
protected:
bool init(int argc, const char* argv[]) override
{
m_common_resources = std::unique_ptr<CommonResources>(new CommonResources(m_vk_backend));
m_g_buffer = std::unique_ptr<GBuffer>(new GBuffer(m_vk_backend, m_common_resources.get(), m_width, m_height));
m_ray_traced_shadows = std::unique_ptr<RayTracedShadows>(new RayTracedShadows(m_vk_backend, m_common_resources.get(), m_g_buffer.get()));
m_ray_traced_ao = std::unique_ptr<RayTracedAO>(new RayTracedAO(m_vk_backend, m_common_resources.get(), m_g_buffer.get()));
m_ray_traced_reflections = std::unique_ptr<RayTracedReflections>(new RayTracedReflections(m_vk_backend, m_common_resources.get(), m_g_buffer.get()));
m_ddgi = std::unique_ptr<DDGI>(new DDGI(m_vk_backend, m_common_resources.get(), m_g_buffer.get()));
m_ground_truth_path_tracer = std::unique_ptr<GroundTruthPathTracer>(new GroundTruthPathTracer(m_vk_backend, m_common_resources.get()));
m_deferred_shading = std::unique_ptr<DeferredShading>(new DeferredShading(m_vk_backend, m_common_resources.get(), m_g_buffer.get()));
m_temporal_aa = std::unique_ptr<TemporalAA>(new TemporalAA(m_vk_backend, m_common_resources.get(), m_g_buffer.get()));
m_tone_map = std::unique_ptr<ToneMap>(new ToneMap(m_vk_backend, m_common_resources.get()));
create_camera();
set_active_scene();
return true;
}
// -----------------------------------------------------------------------------------------------------------------------------------
void update(double delta) override
{
dw::vk::CommandBuffer::Ptr cmd_buf = m_vk_backend->allocate_graphics_command_buffer();
VkCommandBufferBeginInfo begin_info;
DW_ZERO_MEMORY(begin_info);
begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
vkBeginCommandBuffer(cmd_buf->handle(), &begin_info);
{
DW_SCOPED_SAMPLE("Update", cmd_buf);
debug_gui();
// Update camera.
update_camera();
// Update light.
update_light_animation();
// Update uniforms.
update_uniforms(cmd_buf);
m_common_resources->current_scene()->build_tlas(cmd_buf);
update_ibl(cmd_buf);
// Render.
m_g_buffer->render(cmd_buf);
m_ray_traced_shadows->render(cmd_buf);
m_ray_traced_ao->render(cmd_buf);
m_ddgi->render(cmd_buf);
m_ray_traced_reflections->render(cmd_buf, m_ddgi.get());
m_deferred_shading->render(cmd_buf,
m_ray_traced_ao.get(),
m_ray_traced_shadows.get(),
m_ray_traced_reflections.get(),
m_ddgi.get());
m_ground_truth_path_tracer->render(cmd_buf);
m_temporal_aa->render(cmd_buf,
m_deferred_shading.get(),
m_ray_traced_ao.get(),
m_ray_traced_shadows.get(),
m_ray_traced_reflections.get(),
m_ddgi.get(),
m_ground_truth_path_tracer.get(),
m_delta_seconds);
m_tone_map->render(cmd_buf,
m_temporal_aa.get(),
m_deferred_shading.get(),
m_ray_traced_ao.get(),
m_ray_traced_shadows.get(),
m_ray_traced_reflections.get(),
m_ddgi.get(),
m_ground_truth_path_tracer.get(),
[this](dw::vk::CommandBuffer::Ptr cmd_buf) {
render_gui(cmd_buf);
});
}
vkEndCommandBuffer(cmd_buf->handle());
submit_and_present({ cmd_buf });
m_common_resources->num_frames++;
if (m_common_resources->first_frame)
m_common_resources->first_frame = false;
m_common_resources->ping_pong = !m_common_resources->ping_pong;
}
// -----------------------------------------------------------------------------------------------------------------------------------
void shutdown() override
{
m_tone_map.reset();
m_temporal_aa.reset();
m_deferred_shading.reset();
m_g_buffer.reset();
m_ground_truth_path_tracer.reset();
m_ray_traced_shadows.reset();
m_ray_traced_ao.reset();
m_ray_traced_reflections.reset();
m_ddgi.reset();
m_common_resources.reset();
}
// -----------------------------------------------------------------------------------------------------------------------------------
void key_pressed(int code) override
{
if (m_camera_type == CAMERA_TYPE_FREE)
{
// Handle forward movement.
if (code == GLFW_KEY_W)
m_heading_speed = m_camera_speed * CAMERA_SPEED_MULTIPLIER;
else if (code == GLFW_KEY_S)
m_heading_speed = -m_camera_speed * CAMERA_SPEED_MULTIPLIER;
// Handle sideways movement.
if (code == GLFW_KEY_A)
m_sideways_speed = -m_camera_speed * CAMERA_SPEED_MULTIPLIER;
else if (code == GLFW_KEY_D)
m_sideways_speed = m_camera_speed * CAMERA_SPEED_MULTIPLIER;
if (code == GLFW_KEY_SPACE)
m_mouse_look = true;
}
if (code == GLFW_KEY_G)
m_debug_gui = !m_debug_gui;
}
// -----------------------------------------------------------------------------------------------------------------------------------
void key_released(int code) override
{
if (m_camera_type == CAMERA_TYPE_FREE)
{
// Handle forward movement.
if (code == GLFW_KEY_W || code == GLFW_KEY_S)
m_heading_speed = 0.0f;
// Handle sideways movement.
if (code == GLFW_KEY_A || code == GLFW_KEY_D)
m_sideways_speed = 0.0f;
}
if (code == GLFW_KEY_SPACE)
m_mouse_look = false;
}
// -----------------------------------------------------------------------------------------------------------------------------------
void mouse_pressed(int code) override
{
if (m_camera_type == CAMERA_TYPE_FREE)
{
// Enable mouse look.
if (code == GLFW_MOUSE_BUTTON_RIGHT)
m_mouse_look = true;
}
}
// -----------------------------------------------------------------------------------------------------------------------------------
void mouse_released(int code) override
{
if (m_camera_type == CAMERA_TYPE_FREE)
{
// Disable mouse look.
if (code == GLFW_MOUSE_BUTTON_RIGHT)
m_mouse_look = false;
}
}
// -----------------------------------------------------------------------------------------------------------------------------------
dw::AppSettings intial_app_settings() override
{
// Set custom settings here...
dw::AppSettings settings;
settings.width = 1920;
settings.height = 1080;
settings.title = "Hybrid Rendering (c) Dihara Wijetunga";
settings.ray_tracing = true;
return settings;
}
// -----------------------------------------------------------------------------------------------------------------------------------
void window_resized(int width, int height) override
{
// Override window resized method to update camera projection.
m_main_camera->update_projection(60.0f, CAMERA_NEAR_PLANE, CAMERA_FAR_PLANE, float(m_width) / float(m_height));
m_vk_backend->wait_idle();
m_common_resources->write_descriptor_sets(m_vk_backend);
}
private:
// -----------------------------------------------------------------------------------------------------------------------------------
void create_camera()
{
m_main_camera = std::make_unique<dw::Camera>(60.0f, CAMERA_NEAR_PLANE, CAMERA_FAR_PLANE, float(m_width) / float(m_height), glm::vec3(0.0f, 35.0f, 125.0f), glm::vec3(0.0f, 0.0, -1.0f));
m_common_resources->prev_position = m_main_camera->m_position;
float z_buffer_params_x = -1.0 + (CAMERA_NEAR_PLANE / CAMERA_FAR_PLANE);
m_common_resources->z_buffer_params = glm::vec4(z_buffer_params_x, 1.0f, z_buffer_params_x / CAMERA_NEAR_PLANE, 1.0f / CAMERA_NEAR_PLANE);
}
// -----------------------------------------------------------------------------------------------------------------------------------
void debug_gui()
{
ImGuizmo::BeginFrame();
if (m_debug_gui)
{
{
ImGuizmo::SetOrthographic(false);
ImGuizmo::SetRect(0, 0, m_width, m_height);
if (ImGuizmo::Manipulate(&m_main_camera->m_view[0][0], &m_main_camera->m_projection[0][0], m_light_transform_operation, ImGuizmo::WORLD, &m_light_transform[0][0], NULL, NULL))
m_ground_truth_path_tracer->restart_accumulation();
}
bool open = true;
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_HorizontalScrollbar;
ImGui::SetNextWindowPos(ImVec2(0.0f, 0.0f));
ImGui::SetNextWindowSize(ImVec2(m_width * 0.3f, m_height));
if (ImGui::Begin("Hybrid Rendering", &open, window_flags))
{
if (ImGui::CollapsingHeader("Settings", ImGuiTreeNodeFlags_DefaultOpen))
{
if (ImGui::TreeNode("General"))
{
if (ImGui::BeginCombo("Scene", constants::scene_types[m_common_resources->current_scene_type].c_str()))
{
for (uint32_t i = 0; i < constants::scene_types.size(); i++)
{
const bool is_selected = (i == m_common_resources->current_scene_type);
if (ImGui::Selectable(constants::scene_types[i].c_str(), is_selected))
{
m_common_resources->current_scene_type = (SceneType)i;
set_active_scene();
}
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
if (ImGui::BeginCombo("Environment", constants::environment_types[m_common_resources->current_environment_type].c_str()))
{
for (uint32_t i = 0; i < constants::environment_types.size(); i++)
{
const bool is_selected = (i == m_common_resources->current_environment_type);
if (i == ENVIRONMENT_TYPE_PROCEDURAL_SKY && m_light_type != LIGHT_TYPE_DIRECTIONAL)
continue;
if (ImGui::Selectable(constants::environment_types[i].c_str(), is_selected))
{
m_common_resources->current_environment_type = (EnvironmentType)i;
m_common_resources->current_skybox_ds = m_common_resources->skybox_ds[m_common_resources->current_environment_type];
m_ground_truth_path_tracer->restart_accumulation();
}
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
if (ImGui::BeginCombo("Visualization", constants::visualization_types[m_common_resources->current_visualization_type].c_str()))
{
for (uint32_t i = 0; i < constants::visualization_types.size(); i++)
{
const bool is_selected = (i == m_common_resources->current_visualization_type);
if (ImGui::Selectable(constants::visualization_types[i].c_str(), is_selected))
m_common_resources->current_visualization_type = (VisualizationType)i;
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
if (m_common_resources->current_visualization_type == VISUALIZATION_TYPE_REFLECTIONS)
{
RayTracedReflections::OutputType type = m_ray_traced_reflections->current_output();
if (ImGui::BeginCombo("Buffers", RayTracedReflections::kOutputTypeNames[type].c_str()))
{
for (uint32_t i = 0; i < RayTracedReflections::kNumOutputTypes; i++)
{
const bool is_selected = (i == type);
if (ImGui::Selectable(RayTracedReflections::kOutputTypeNames[i].c_str(), is_selected))
type = (RayTracedReflections::OutputType)i;
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
m_ray_traced_reflections->set_current_output(type);
}
else if (m_common_resources->current_visualization_type == VISUALIZATION_TYPE_SHADOWS)
{
RayTracedShadows::OutputType type = m_ray_traced_shadows->current_output();
if (ImGui::BeginCombo("Buffers", RayTracedShadows::kOutputTypeNames[type].c_str()))
{
for (uint32_t i = 0; i < RayTracedShadows::kNumOutputTypes; i++)
{
const bool is_selected = (i == type);
if (ImGui::Selectable(RayTracedShadows::kOutputTypeNames[i].c_str(), is_selected))
type = (RayTracedShadows::OutputType)i;
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
m_ray_traced_shadows->set_current_output(type);
}
else if (m_common_resources->current_visualization_type == VISUALIZATION_TYPE_AMBIENT_OCCLUSION)
{
RayTracedAO::OutputType type = m_ray_traced_ao->current_output();
if (ImGui::BeginCombo("Buffers", RayTracedAO::kOutputTypeNames[type].c_str()))
{
for (uint32_t i = 0; i < RayTracedAO::kNumOutputTypes; i++)
{
const bool is_selected = (i == type);
if (ImGui::Selectable(RayTracedAO::kOutputTypeNames[i].c_str(), is_selected))
type = (RayTracedAO::OutputType)i;
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
m_ray_traced_ao->set_current_output(type);
}
else if (m_common_resources->current_visualization_type == VISUALIZATION_TYPE_GROUND_TRUTH)
m_ground_truth_path_tracer->gui();
ImGui::SliderFloat("Roughness Multiplier", &m_common_resources->roughness_multiplier, 0.0f, 1.0f);
m_tone_map->gui();
ImGui::TreePop();
ImGui::Separator();
}
if (ImGui::TreeNode("Light"))
{
LightType type = m_light_type;
if (ImGui::BeginCombo("Type", constants::light_types[type].c_str()))
{
for (uint32_t i = 0; i < constants::light_types.size(); i++)
{
const bool is_selected = (i == type);
if (ImGui::Selectable(constants::light_types[i].c_str(), is_selected))
type = (LightType)i;
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
if (m_light_type != type)
{
m_light_type = type;
reset_light();
}
if (m_light_type == LIGHT_TYPE_DIRECTIONAL)
directional_light_gui();
else if (m_light_type == LIGHT_TYPE_POINT)
point_light_gui();
else if (m_light_type == LIGHT_TYPE_SPOT)
spot_light_gui();
ImGui::TreePop();
ImGui::Separator();
}
if (ImGui::TreeNode("Camera"))
{
CameraType type = m_camera_type;
if (ImGui::BeginCombo("Type", constants::camera_types[type].c_str()))
{
for (uint32_t i = 0; i < constants::camera_types.size(); i++)
{
const bool is_selected = (i == type);
if (ImGui::Selectable(constants::camera_types[i].c_str(), is_selected))
type = (CameraType)i;
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
if (type != m_camera_type)
{
m_camera_type = type;
m_ground_truth_path_tracer->restart_accumulation();
}
if (m_camera_type == CAMERA_TYPE_FIXED)
{
uint32_t current_angle = m_current_fixed_camera_angle;
if (ImGui::BeginCombo("Current Angle", std::to_string(current_angle).c_str()))
{
for (uint32_t i = 0; i < constants::fixed_camera_forward_vectors[m_common_resources->current_scene_type].size(); i++)
{
const bool is_selected = (i == current_angle);
if (ImGui::Selectable(std::to_string(i).c_str(), is_selected))
{
current_angle = i;
m_ground_truth_path_tracer->restart_accumulation();
}
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
m_current_fixed_camera_angle = current_angle;
}
else if (m_camera_type == CAMERA_TYPE_ANIMATED)
{
bool is_playing = m_common_resources->demo_players[m_common_resources->current_scene_type]->is_playing();
if (ImGui::Checkbox("Is Playing?", &is_playing))
{
if (is_playing)
m_common_resources->demo_players[m_common_resources->current_scene_type]->play();
else
m_common_resources->demo_players[m_common_resources->current_scene_type]->stop();
}
}
if (m_camera_type != CAMERA_TYPE_ANIMATED)
{
ImGui::SliderFloat("Speed", &m_camera_speed, 0.1f, 10.0f);
if (ImGui::Checkbox("Side to Side motion", &m_side_to_side_motion))
{
if (m_side_to_side_motion)
m_side_to_side_motion_time = 0.0f;
m_side_to_side_start_pos = m_main_camera->m_position;
}
if (m_side_to_side_motion)
ImGui::SliderFloat("Side to Side distance", &m_side_to_side_motion_distance, 0.1f, 20.0f);
}
ImGui::TreePop();
ImGui::Separator();
}
if (ImGui::TreeNode("Ray Traced Shadows"))
{
ImGui::PushID("Ray Traced Shadows");
RayTraceScale scale = m_ray_traced_shadows->scale();
if (ImGui::BeginCombo("Scale", constants::ray_trace_scales[scale].c_str()))
{
for (uint32_t i = 0; i < constants::ray_trace_scales.size(); i++)
{
const bool is_selected = (i == scale);
if (ImGui::Selectable(constants::ray_trace_scales[i].c_str(), is_selected))
{
m_vk_backend->wait_idle();
m_ray_traced_shadows.reset();
m_ray_traced_shadows = std::unique_ptr<RayTracedShadows>(new RayTracedShadows(m_vk_backend, m_common_resources.get(), m_g_buffer.get(), (RayTraceScale)i));
}
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
bool enabled = m_deferred_shading->use_ray_traced_shadows();
if (ImGui::Checkbox("Enabled", &enabled))
m_deferred_shading->set_use_ray_traced_shadows(enabled);
m_ray_traced_shadows->gui();
ImGui::PopID();
ImGui::TreePop();
ImGui::Separator();
}
if (ImGui::TreeNode("Ray Traced Reflections"))
{
ImGui::PushID("Ray Traced Reflections");
RayTraceScale scale = m_ray_traced_reflections->scale();
if (ImGui::BeginCombo("Scale", constants::ray_trace_scales[scale].c_str()))
{
for (uint32_t i = 0; i < constants::ray_trace_scales.size(); i++)
{
const bool is_selected = (i == scale);
if (ImGui::Selectable(constants::ray_trace_scales[i].c_str(), is_selected))
{
m_vk_backend->wait_idle();
m_ray_traced_reflections.reset();
m_ray_traced_reflections = std::unique_ptr<RayTracedReflections>(new RayTracedReflections(m_vk_backend, m_common_resources.get(), m_g_buffer.get(), (RayTraceScale)i));
}
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
bool enabled = m_deferred_shading->use_ray_traced_reflections();
if (ImGui::Checkbox("Enabled", &enabled))
m_deferred_shading->set_use_ray_traced_reflections(enabled);
m_ray_traced_reflections->gui();
ImGui::PopID();
ImGui::TreePop();
ImGui::Separator();
}
if (ImGui::TreeNode("Ray Traced Ambient Occlusion"))
{
ImGui::PushID("Ray Traced Ambient Occlusion");
RayTraceScale scale = m_ray_traced_ao->scale();
if (ImGui::BeginCombo("Scale", constants::ray_trace_scales[scale].c_str()))
{
for (uint32_t i = 0; i < constants::ray_trace_scales.size(); i++)
{
const bool is_selected = (i == scale);
if (ImGui::Selectable(constants::ray_trace_scales[i].c_str(), is_selected))
{
m_vk_backend->wait_idle();
m_ray_traced_ao.reset();
m_ray_traced_ao = std::unique_ptr<RayTracedAO>(new RayTracedAO(m_vk_backend, m_common_resources.get(), m_g_buffer.get(), (RayTraceScale)i));
}
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
bool enabled = m_deferred_shading->use_ray_traced_ao();
if (ImGui::Checkbox("Enabled", &enabled))
m_deferred_shading->set_use_ray_traced_ao(enabled);
m_ray_traced_ao->gui();
ImGui::PopID();
ImGui::TreePop();
ImGui::Separator();
}
if (ImGui::TreeNode("Global Illumination"))
{
ImGui::PushID("GUI_Global_Illumination");
RayTraceScale scale = m_ddgi->scale();
if (ImGui::BeginCombo("Scale", constants::ray_trace_scales[scale].c_str()))
{
for (uint32_t i = 0; i < constants::ray_trace_scales.size(); i++)
{
const bool is_selected = (i == scale);
if (ImGui::Selectable(constants::ray_trace_scales[i].c_str(), is_selected))
{
m_vk_backend->wait_idle();
m_ddgi.reset();
m_ddgi = std::unique_ptr<DDGI>(new DDGI(m_vk_backend, m_common_resources.get(), m_g_buffer.get(), (RayTraceScale)i));
set_active_scene();
}
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
bool enabled = m_deferred_shading->use_ddgi();
if (ImGui::Checkbox("Enabled", &enabled))
m_deferred_shading->set_use_ddgi(enabled);
bool visualize_probe_grid = m_deferred_shading->visualize_probe_grid();
if (ImGui::Checkbox("Visualize Probe Grid", &visualize_probe_grid))
m_deferred_shading->set_visualize_probe_grid(visualize_probe_grid);
m_ddgi->gui();
ImGui::PopID();
ImGui::TreePop();
ImGui::Separator();
}
if (ImGui::TreeNode("TAA"))
{
m_temporal_aa->gui();
ImGui::TreePop();
}
}
if (ImGui::CollapsingHeader("Profiler", ImGuiTreeNodeFlags_DefaultOpen))
dw::profiler::ui();
ImGui::End();
}
}
}
// -----------------------------------------------------------------------------------------------------------------------------------
void directional_light_gui()
{
m_light_transform_operation = ImGuizmo::OPERATION::ROTATE;
ImGui::ColorEdit3("Color", &m_light_color.x);
ImGui::InputFloat("Intensity", &m_light_intensity);
ImGui::SliderFloat("Radius", &m_light_radius, 0.0f, 0.1f);
glm::vec3 position;
glm::vec3 rotation;
glm::vec3 scale;
ImGuizmo::DecomposeMatrixToComponents(&m_light_transform[0][0], &position.x, &rotation.x, &scale.x);
ImGui::InputFloat3("Rotation", &rotation.x);
ImGuizmo::RecomposeMatrixFromComponents(&position.x, &rotation.x, &scale.x, &m_light_transform[0][0]);
glm::vec3 out_skew;
glm::vec4 out_persp;
glm::vec3 out_scale;
glm::quat out_orientation;
glm::vec3 out_position;
glm::decompose(m_light_transform, out_scale, out_orientation, out_position, out_skew, out_persp);
ImGui::Checkbox("Animation", &m_light_animation);
}
// -----------------------------------------------------------------------------------------------------------------------------------
void point_light_gui()
{
ImGui::ColorEdit3("Color", &m_light_color.x);
ImGui::InputFloat("Intensity", &m_light_intensity);
ImGui::SliderFloat("Radius", &m_light_radius, 0.0f, 10.0f);
m_light_transform_operation = ImGuizmo::TRANSLATE;
glm::vec3 position;
glm::vec3 rotation;
glm::vec3 scale;
ImGuizmo::DecomposeMatrixToComponents(&m_light_transform[0][0], &position.x, &rotation.x, &scale.x);
ImGui::InputFloat3("Position", &position.x);
ImGuizmo::RecomposeMatrixFromComponents(&position.x, &rotation.x, &scale.x, &m_light_transform[0][0]);
}
// -----------------------------------------------------------------------------------------------------------------------------------
void spot_light_gui()
{
ImGui::ColorEdit3("Color", &m_light_color.x);
ImGui::InputFloat("Intensity", &m_light_intensity);
ImGui::SliderFloat("Radius", &m_light_radius, 0.0f, 10.0f);
ImGui::SliderFloat("Inner Cone Angle", &m_light_cone_angle_inner, 1.0f, 100.0f);
ImGui::SliderFloat("Outer Cone Angle", &m_light_cone_angle_outer, 1.0f, 100.0f);
if (ImGui::RadioButton("Translate", m_light_transform_operation == ImGuizmo::TRANSLATE))
m_light_transform_operation = ImGuizmo::TRANSLATE;
ImGui::SameLine();
if (ImGui::RadioButton("Rotate", m_light_transform_operation == ImGuizmo::ROTATE))
m_light_transform_operation = ImGuizmo::ROTATE;
glm::vec3 position;
glm::vec3 rotation;
glm::vec3 scale;
ImGuizmo::DecomposeMatrixToComponents(&m_light_transform[0][0], &position.x, &rotation.x, &scale.x);
ImGui::InputFloat3("Position", &position.x);
ImGui::InputFloat3("Rotation", &rotation.x);
ImGuizmo::RecomposeMatrixFromComponents(&position.x, &rotation.x, &scale.x, &m_light_transform[0][0]);
if (m_common_resources->current_scene_type == SCENE_TYPE_GLOBAL_ILLUMINATION_TEST)
ImGui::Checkbox("Animation", &m_light_animation);
}
// -----------------------------------------------------------------------------------------------------------------------------------
void reset_light()
{
m_light_transform = glm::mat4(1.0f);
if (m_common_resources->current_scene_type == SCENE_TYPE_SHADOWS_TEST)
{
if (m_light_type == LIGHT_TYPE_DIRECTIONAL)
{
m_light_radius = 0.1f;
m_light_intensity = 1.0f;
m_light_transform = glm::rotate(m_light_transform, glm::radians(50.0f), glm::vec3(0.0f, 1.0f, 0.0f)) * glm::rotate(glm::mat4(1.0f), glm::radians(50.0f), glm::vec3(1.0f, 0.0f, 0.0f));
}
else if (m_light_type == LIGHT_TYPE_POINT)
{
m_light_radius = 2.5f;
m_light_intensity = 500.0f;
m_light_transform = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 10.0f, 0.0f));
}
else if (m_light_type == LIGHT_TYPE_SPOT)
{
m_light_radius = 2.5f;
m_light_intensity = 500.0f;
m_light_cone_angle_inner = 40.0f;
m_light_cone_angle_outer = 50.0f;
glm::mat4 R = glm::rotate(glm::mat4(1.0f), glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f));
glm::mat4 T = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 2.5f, 15.0f));
m_light_transform = T * R;
}
}
else if (m_common_resources->current_scene_type == SCENE_TYPE_REFLECTIONS_TEST)
{
if (m_light_type == LIGHT_TYPE_DIRECTIONAL)
{
m_light_radius = 0.1f;
m_light_intensity = 1.0f;
m_light_transform = glm::rotate(m_light_transform, glm::radians(-35.0f), glm::vec3(0.0f, 1.0f, 0.0f)) * glm::rotate(glm::mat4(1.0f), glm::radians(-60.0f), glm::vec3(1.0f, 0.0f, 0.0f));
}
else if (m_light_type == LIGHT_TYPE_POINT)
{
m_light_radius = 2.5f;
m_light_intensity = 500.0f;
m_light_transform = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 10.0f, 0.0f));
}
else if (m_light_type == LIGHT_TYPE_SPOT)
{
m_light_radius = 2.5f;
m_light_intensity = 5000.0f;
m_light_cone_angle_inner = 40.0f;
m_light_cone_angle_outer = 50.0f;
glm::mat4 R = glm::rotate(glm::mat4(1.0f), glm::radians(75.0f), glm::vec3(1.0f, 0.0f, 0.0f));
glm::mat4 T = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 15.0f, 20.0f));
m_light_transform = T * R;
}
}
else if (m_common_resources->current_scene_type == SCENE_TYPE_GLOBAL_ILLUMINATION_TEST)
{
if (m_light_type == LIGHT_TYPE_DIRECTIONAL)
{
m_light_radius = 0.1f;
m_light_intensity = 1.0f;
m_light_transform = glm::rotate(m_light_transform, glm::radians(50.0f), glm::vec3(0.0f, 1.0f, 0.0f)) * glm::rotate(glm::mat4(1.0f), glm::radians(50.0f), glm::vec3(1.0f, 0.0f, 0.0f));
}
else if (m_light_type == LIGHT_TYPE_POINT)
{
m_light_radius = 2.5f;
m_light_intensity = 100.0f;
m_light_transform = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 4.0f, 2.0f));
}
else if (m_light_type == LIGHT_TYPE_SPOT)
{
m_light_radius = 2.5f;
m_light_intensity = 1000.0f;
m_light_cone_angle_inner = 8.0f;
m_light_cone_angle_outer = 20.0f;
glm::mat4 R = glm::rotate(glm::mat4(1.0f), glm::radians(70.0f), glm::vec3(1.0f, 0.0f, 0.0f));
glm::mat4 T = glm::translate(glm::mat4(1.0f), glm::vec3(-8.25f, 7.5f, 6.0f));
m_light_transform = T * R;
}
}
else if (m_common_resources->current_scene_type == SCENE_TYPE_SPONZA)
{
if (m_light_type == LIGHT_TYPE_DIRECTIONAL)
{
m_light_radius = 0.08f;
m_light_intensity = 10.0f;
m_light_transform = glm::rotate(m_light_transform, glm::radians(30.0f), glm::vec3(0.0f, 0.0f, 1.0f)) * glm::rotate(glm::mat4(1.0f), glm::radians(-10.0f), glm::vec3(1.0f, 0.0f, 0.0f));
}
else if (m_light_type == LIGHT_TYPE_POINT)
{
m_light_radius = 4.0f;
m_light_intensity = 50000.0f;
m_light_transform = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 130.0f, 0.0f));
}
else if (m_light_type == LIGHT_TYPE_SPOT)
{
m_light_radius = 6.5f;
m_light_intensity = 500000.0f;
m_light_cone_angle_inner = 10.0f;
m_light_cone_angle_outer = 30.0f;
glm::mat4 R = glm::rotate(glm::mat4(1.0f), glm::radians(50.0f), glm::vec3(1.0f, 0.0f, 0.0f));
glm::mat4 T = glm::translate(glm::mat4(1.0f), glm::vec3(80.0f, 60.0f, 15.0f));
m_light_transform = T * R;
}
}
else if (m_common_resources->current_scene_type == SCENE_TYPE_PICA_PICA)
{
if (m_light_type == LIGHT_TYPE_DIRECTIONAL)
{
m_light_radius = 0.1f;
m_light_intensity = 1.0f;
m_light_transform = glm::rotate(m_light_transform, glm::radians(-45.0f), glm::vec3(0.0f, 0.0f, 1.0f)) * glm::rotate(glm::mat4(1.0f), glm::radians(15.0f), glm::vec3(0.0f, 1.0f, 0.0f));
}
else if (m_light_type == LIGHT_TYPE_POINT)
{
m_light_radius = 2.5f;
m_light_intensity = 500.0f;
m_light_transform = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 15.0f, 0.0f));
}
else if (m_light_type == LIGHT_TYPE_SPOT)
{
m_light_radius = 2.5f;
m_light_intensity = 500.0f;
m_light_cone_angle_inner = 40.0f;
m_light_cone_angle_outer = 50.0f;
glm::mat4 R = glm::rotate(m_light_transform, glm::radians(-30.0f), glm::vec3(0.0f, 1.0f, 0.0f)) * glm::rotate(glm::mat4(1.0f), glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f));
glm::mat4 T = glm::translate(glm::mat4(1.0f), glm::vec3(-10.0f, 6.0f, 20.0f));
m_light_transform = T * R;
}
}
if (m_common_resources->current_environment_type == ENVIRONMENT_TYPE_PROCEDURAL_SKY && m_light_type != LIGHT_TYPE_DIRECTIONAL)
{
m_common_resources->current_environment_type = ENVIRONMENT_TYPE_NONE;
m_common_resources->current_skybox_ds = m_common_resources->skybox_ds[m_common_resources->current_environment_type];
}
m_ground_truth_path_tracer->restart_accumulation();
}
// -----------------------------------------------------------------------------------------------------------------------------------
void update_uniforms(dw::vk::CommandBuffer::Ptr cmd_buf)
{
DW_SCOPED_SAMPLE("Update Uniforms", cmd_buf);
glm::mat4 current_jitter = glm::translate(glm::mat4(1.0f), glm::vec3(m_temporal_aa->current_jitter(), 0.0f));
m_common_resources->view = m_main_camera->m_view;
m_common_resources->projection = m_temporal_aa->enabled() ? current_jitter * m_main_camera->m_projection : m_main_camera->m_projection;
m_common_resources->prev_view_projection = m_main_camera->m_prev_view_projection;
m_common_resources->position = m_main_camera->m_position;
m_light_direction = glm::normalize(glm::mat3(m_light_transform) * glm::vec3(0.0f, -1.0f, 0.0f));
m_light_position = glm::vec3(m_light_transform[3][0], m_light_transform[3][1], m_light_transform[3][2]);
m_ubo_data.proj_inverse = glm::inverse(m_common_resources->projection);
m_ubo_data.view_inverse = glm::inverse(m_common_resources->view);
m_ubo_data.view_proj = m_common_resources->projection * m_common_resources->view;
m_ubo_data.view_proj_inverse = glm::inverse(m_ubo_data.view_proj);
m_ubo_data.prev_view_proj = m_common_resources->first_frame ? m_common_resources->prev_view_projection : current_jitter * m_common_resources->prev_view_projection;
m_ubo_data.cam_pos = glm::vec4(m_common_resources->position, float(m_deferred_shading->use_ray_traced_ao()));
m_ubo_data.current_prev_jitter = glm::vec4(m_temporal_aa->current_jitter(), m_temporal_aa->prev_jitter());
m_ubo_data.light.set_light_radius(m_light_radius);
m_ubo_data.light.set_light_color(m_light_color);
m_ubo_data.light.set_light_intensity(m_light_intensity);
m_ubo_data.light.set_light_type(m_light_type);
m_ubo_data.light.set_light_direction(-m_light_direction);
m_ubo_data.light.set_light_position(m_light_position);
m_ubo_data.light.set_light_cos_theta_inner(glm::cos(glm::radians(m_light_cone_angle_inner)));
m_ubo_data.light.set_light_cos_theta_outer(glm::cos(glm::radians(m_light_cone_angle_outer)));
m_main_camera->m_prev_view_projection = m_ubo_data.view_proj;
uint8_t* ptr = (uint8_t*)m_common_resources->ubo->mapped_ptr();
memcpy(ptr + m_common_resources->ubo_size * m_vk_backend->current_frame_idx(), &m_ubo_data, sizeof(UBO));
}
// -----------------------------------------------------------------------------------------------------------------------------------
void update_ibl(dw::vk::CommandBuffer::Ptr cmd_buf)
{
if (m_common_resources->current_environment_type == ENVIRONMENT_TYPE_PROCEDURAL_SKY)
{
m_common_resources->sky_environment->hosek_wilkie_sky_model->update(cmd_buf, -m_light_direction);
{
DW_SCOPED_SAMPLE("Generate Skybox Mipmap", cmd_buf);
m_common_resources->sky_environment->hosek_wilkie_sky_model->image()->generate_mipmaps(cmd_buf);
}
m_common_resources->sky_environment->cubemap_sh_projection->update(cmd_buf);
m_common_resources->sky_environment->cubemap_prefilter->update(cmd_buf);
}
}
// -----------------------------------------------------------------------------------------------------------------------------------
void update_light_animation()
{
if (m_light_animation)
{
if (m_common_resources->current_scene_type == SCENE_TYPE_GLOBAL_ILLUMINATION_TEST && m_light_type == LIGHT_TYPE_SPOT)
{
float t = sinf(m_light_animation_time) * 0.5f + 0.5f;
glm::mat4 R = glm::rotate(glm::mat4(1.0f), glm::radians(70.0f), glm::vec3(1.0f, 0.0f, 0.0f));
glm::mat4 T = glm::translate(glm::mat4(1.0f), glm::mix(glm::vec3(-8.25f, 7.5f, 6.0f), glm::vec3(0.25f, 7.5f, 6.0f), t));
m_light_transform = T * R;
}
else if (m_light_type == LIGHT_TYPE_DIRECTIONAL)
{
double time = glfwGetTime() * 0.5f;
m_light_direction.x = sinf(time);
m_light_direction.z = cosf(time);
m_light_direction.y = 1.0f;
m_light_direction = glm::normalize(m_light_direction);
}
m_light_animation_time += m_delta_seconds;
}
}
// -----------------------------------------------------------------------------------------------------------------------------------
void update_camera()
{
m_temporal_aa->update();
if (m_camera_type == CAMERA_TYPE_FREE)
{
float forward_delta = m_heading_speed * m_delta;
float sideways_delta = m_sideways_speed * m_delta;
m_main_camera->set_translation_delta(m_main_camera->m_forward, forward_delta);
m_main_camera->set_translation_delta(m_main_camera->m_right, sideways_delta);
if (forward_delta != 0.0f || sideways_delta != 0.0f)
m_ground_truth_path_tracer->restart_accumulation();
m_camera_x = m_mouse_delta_x * m_camera_sensitivity;
m_camera_y = m_mouse_delta_y * m_camera_sensitivity;
if (m_mouse_look)
{
// Activate Mouse Look
m_main_camera->set_rotatation_delta(glm::vec3((float)(m_camera_y),
(float)(m_camera_x),
(float)(0.0f)));
m_ground_truth_path_tracer->restart_accumulation();
}
else
{
m_main_camera->set_rotatation_delta(glm::vec3((float)(0),
(float)(0),
(float)(0)));
}
if (m_side_to_side_motion)
{
m_main_camera->set_position(m_side_to_side_start_pos + m_main_camera->m_right * sinf(static_cast<float>(m_side_to_side_motion_time)) * m_side_to_side_motion_distance);
m_side_to_side_motion_time += m_delta * 0.005f;
}
m_main_camera->update();
}
else if (m_camera_type == CAMERA_TYPE_FIXED)
{
if (m_side_to_side_motion)
{
m_main_camera->update_from_frame(constants::fixed_camera_position_vectors[m_common_resources->current_scene_type][m_current_fixed_camera_angle] + m_main_camera->m_right * sinf(static_cast<float>(m_side_to_side_motion_time)) * m_side_to_side_motion_distance, constants::fixed_camera_forward_vectors[m_common_resources->current_scene_type][m_current_fixed_camera_angle], constants::fixed_camera_right_vectors[m_common_resources->current_scene_type][m_current_fixed_camera_angle]);
m_side_to_side_motion_time += m_delta * 0.005f;
}
else
m_main_camera->update_from_frame(constants::fixed_camera_position_vectors[m_common_resources->current_scene_type][m_current_fixed_camera_angle], constants::fixed_camera_forward_vectors[m_common_resources->current_scene_type][m_current_fixed_camera_angle], constants::fixed_camera_right_vectors[m_common_resources->current_scene_type][m_current_fixed_camera_angle]);
}
else
m_common_resources->demo_players[m_common_resources->current_scene_type]->update(m_delta, m_main_camera.get());
m_common_resources->frame_time = m_delta_seconds;
m_common_resources->camera_delta = m_main_camera->m_position - m_common_resources->prev_position;
m_common_resources->prev_position = m_main_camera->m_position;
}
// -----------------------------------------------------------------------------------------------------------------------------------
void set_active_scene()
{
m_current_fixed_camera_angle = 0;
m_light_animation_time = 0.0f;
m_camera_type = CAMERA_TYPE_FREE;
m_common_resources->demo_players[m_common_resources->current_scene_type]->stop();
if (m_common_resources->current_scene_type == SCENE_TYPE_SHADOWS_TEST)
{
m_ddgi->set_normal_bias(1.0f);
m_ddgi->set_probe_distance(4.0f);
m_ddgi->set_infinite_bounce_intensity(1.7f);
m_ddgi->restart_accumulation();
m_deferred_shading->set_probe_visualization_scale(0.5f);
m_camera_speed = 2.0f;
m_main_camera->set_position(glm::vec3(0.321986f, 7.552417f, 28.927477f));
}
else if (m_common_resources->current_scene_type == SCENE_TYPE_REFLECTIONS_TEST)
{
m_ddgi->set_normal_bias(1.0f);
m_ddgi->set_probe_distance(4.0f);
m_ddgi->set_infinite_bounce_intensity(1.7f);
m_ddgi->restart_accumulation();
m_deferred_shading->set_probe_visualization_scale(0.5f);
m_camera_speed = 0.1f;
m_main_camera->set_position(glm::vec3(1.449991f, 8.761821f, 33.413113f));
}
else if (m_common_resources->current_scene_type == SCENE_TYPE_GLOBAL_ILLUMINATION_TEST)
{
m_ddgi->set_normal_bias(1.0f);
m_ddgi->set_probe_distance(4.0f);
m_ddgi->set_infinite_bounce_intensity(0.8f);
m_ddgi->restart_accumulation();
m_deferred_shading->set_probe_visualization_scale(0.5f);
m_light_type = LIGHT_TYPE_SPOT;
m_camera_speed = 0.1f;
m_main_camera->set_position(glm::vec3(1.628197f, 4.763937f, 4.361343f));
}
else if (m_common_resources->current_scene_type == SCENE_TYPE_SPONZA)
{
m_ddgi->set_normal_bias(0.1f);
m_ddgi->set_probe_distance(50.0f);
m_ddgi->set_infinite_bounce_intensity(1.7f);
m_ddgi->restart_accumulation();
m_deferred_shading->set_probe_visualization_scale(5.0f);
m_camera_speed = 2.0f;
m_main_camera->set_position(glm::vec3(279.537201f, 35.164913f, -20.101242f));
}
else if (m_common_resources->current_scene_type == SCENE_TYPE_PICA_PICA)
{
m_ddgi->set_normal_bias(1.0f);
m_ddgi->set_probe_distance(4.0f);
m_ddgi->set_infinite_bounce_intensity(1.7f);
m_ddgi->restart_accumulation();
m_deferred_shading->set_probe_visualization_scale(0.5f);
m_camera_speed = 1.0f;
m_main_camera->set_position(glm::vec3(-8.837002f, 8.267305f, 18.703117f));
}
reset_light();
}
// -----------------------------------------------------------------------------------------------------------------------------------
private:
std::unique_ptr<CommonResources> m_common_resources;
std::unique_ptr<GBuffer> m_g_buffer;
std::unique_ptr<DeferredShading> m_deferred_shading;
std::unique_ptr<RayTracedShadows> m_ray_traced_shadows;
std::unique_ptr<RayTracedAO> m_ray_traced_ao;
std::unique_ptr<RayTracedReflections> m_ray_traced_reflections;
std::unique_ptr<DDGI> m_ddgi;
std::unique_ptr<GroundTruthPathTracer> m_ground_truth_path_tracer;
std::unique_ptr<TemporalAA> m_temporal_aa;
std::unique_ptr<ToneMap> m_tone_map;
// Camera.
CameraType m_camera_type = CAMERA_TYPE_FREE;
uint32_t m_current_fixed_camera_angle = 0;
std::unique_ptr<dw::Camera> m_main_camera;
bool m_mouse_look = false;
float m_heading_speed = 0.0f;
float m_sideways_speed = 0.0f;
float m_camera_sensitivity = 0.05f;
float m_camera_speed = 2.0f;
float m_offset = 0.1f;
float m_side_to_side_motion_time = 0.0f;
float m_side_to_side_motion_distance = 5.0f;
glm::vec3 m_side_to_side_start_pos = glm::vec3(0.0f);
bool m_side_to_side_motion = false;
bool m_debug_gui = false;
// Camera orientation.
float m_camera_x;
float m_camera_y;
// Light
ImGuizmo::OPERATION m_light_transform_operation = ImGuizmo::OPERATION::ROTATE;
glm::mat4 m_light_transform = glm::mat4(1.0f);
float m_light_radius = 0.1f;
glm::vec3 m_light_direction = glm::normalize(glm::vec3(0.568f, 0.707f, -0.421f));
glm::vec3 m_light_position = glm::vec3(5.0f);
glm::vec3 m_light_color = glm::vec3(1.0f);
float m_light_intensity = 1.0f;
float m_light_cone_angle_inner = 40.0f;
float m_light_cone_angle_outer = 50.0f;
float m_light_animation_time = 0.0f;
bool m_light_animation = false;
LightType m_light_type = LIGHT_TYPE_DIRECTIONAL;
// Uniforms.
UBO m_ubo_data;
};
DW_DECLARE_MAIN(HybridRendering) | 46.035324 | 494 | 0.494391 | [
"render"
] |
40a50c80528fcc8a82b3001e28b5e4d64b0e111e | 2,894 | cpp | C++ | spline.cpp | jimchan932/guassEliminationForSpline | 3deefc11b7923d1c88f779523af843a243e932bd | [
"Apache-2.0"
] | null | null | null | spline.cpp | jimchan932/guassEliminationForSpline | 3deefc11b7923d1c88f779523af843a243e932bd | [
"Apache-2.0"
] | null | null | null | spline.cpp | jimchan932/guassEliminationForSpline | 3deefc11b7923d1c88f779523af843a243e932bd | [
"Apache-2.0"
] | 1 | 2021-11-03T13:53:43.000Z | 2021-11-03T13:53:43.000Z | #include <iostream>
#include <vector>
//#include "tridiag.h"
#define MAXSIZE 100
using namespace std;
//#define gamma 234
// solve for x
void tridiag(double* a, double* b, double* c, double* r, double* u , int n)
{
int j;
double bet;
double *gam = new double[n];
u[0] = r[0] / (bet = b[0]);
for(j = 1; j < n; j++) // 0 ... n-1
{
gam[j] = c[j-1] / bet;
bet = b[j] - a[j]*gam[j];
if(bet == 0.0)
{
std::cout <<"error: 0 for local variable"; return;
}
u[j] = (r[j] -a[j]*u[j-1])/bet;
}
for(j=(n-2); j>= 0; j--)
{
u[j] -= gam[j+1] * u[j+1];
}
delete []gam;
}
void cyclic(double *a, double *b, double *c, double alpha, double beta,
double*r, double*x, int n)
{
int i;
double fact; double gamma;
gamma = -444.0;
double* bb = new double[n];
double *u = new double[n];
double *z = new double[n];
bb[0] = b[0] - gamma;
bb[n-1] = b[n-1] - alpha*beta/gamma;
for(i = 1; i < n-1; i++)
{
bb[i] =b[i];
}
tridiag(a, bb, c, r, x, n);
u[0] = gamma;
u[n-1] = alpha;
for(i = 1; i < n-1; i++) u[i] =0.0;
tridiag(a, bb, c,u,z, n);
fact = (x[0] + beta*x[n-1]/gamma)/
(1.0 + z[0] + beta*z[n-1]/gamma);
for(int i = 0; i < n; i++) x[i] -= fact*z[i]; // solve solution vector x
}
int main()
{
int n;
double x[MAXSIZE];
double y[MAXSIZE];
double lambda[MAXSIZE];
double u[MAXSIZE];
double diag[MAXSIZE];
double differenceX[MAXSIZE];
double f[MAXSIZE];
double solution[MAXSIZE];
std::cin >> n;
x[0] = 0;
std::cout << "Input x: ";
/*
for(int i = 0; i < n+1; i++)
{ // x0 to x(n)
double tempX;
std::cin >> tempX;
x[i] = tempX;
}*/
for(int i = 0; i < n+1; i++)
{ // x0 to x(n)
double tempX;
std::cin >> tempX;
x[i] = tempX;
}
for(int i = 0; i < n+1; i++)
{ // y0 to y(n)
double tempY;
std::cin >> tempY;
y[i] = tempY;
}
for(int i = 0; i < n; i++)
{
double tempDiff = x[i+1] - x[i]; // h0 to h(n-1)
differenceX[i] = tempDiff; // 0 to n-1
}
for(int i = 0; i < n-1; i++)
{
lambda[i] = differenceX[i+1] / (differenceX[i] + differenceX[i+1]);
}
lambda[n-1] = 0;
u[0] = 0;
for(int i = 1; i < n; i++)
{
u[i] = differenceX[i-1] / (differenceX[i] + differenceX[i-1]);
}
double lambdaN = differenceX[0] / (differenceX[n-1] + differenceX[0]);
double Un = 1- lambda[n-1];
for(int i = 0; i < n; i++)
{
diag[i] = 2;
}
double diff0 = (y[1] - y[0]) /(differenceX[0]);
for(int i = 0; i < n-1; i++)
{
double diffi = (y[i+2] - y[i+1]) / (differenceX[i+1]);
double diffiPlus1 = (y[i+1] - y[i]) / (differenceX[i]);
f[i] = 6* (diffiPlus1 - diffi)/ (differenceX[i] + differenceX[i+1]);
}
double diffn = (y[n] - y[n-1]) /(differenceX[n-1]);
f[n-1] = 6* (diff0 - diffn)/ (differenceX[0] + differenceX[n-1]);
cyclic(lambda, diag, u, lambdaN, Un,
f, solution, n);
for(int i = 0; i < n; i++)
{
std::cout << solution[i]<<" ";
}
return 0;
}
| 19.687075 | 77 | 0.516586 | [
"vector"
] |
40a605af29f5bac401e6fc9d9c2a9f7200d012b9 | 6,270 | cpp | C++ | src/brminterface.cpp | kimuras/broomie | 4ec89753f049c452790e70c4d0744b6b689ac60d | [
"BSD-3-Clause"
] | null | null | null | src/brminterface.cpp | kimuras/broomie | 4ec89753f049c452790e70c4d0744b6b689ac60d | [
"BSD-3-Clause"
] | null | null | null | src/brminterface.cpp | kimuras/broomie | 4ec89753f049c452790e70c4d0744b6b689ac60d | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (C) 2009 Shunya Kimura <brmtrain@gmail.com>
* All Rights Reserved.
*
* Use and distribution of this program is licensed under the
* BSD license. See the COPYING file for full text.
*/
#include "brmalgorithm.hpp"
#include "brmutil.hpp"
#include <math.h>
#include <iterator>
#include <fcgi_stdio.h>
class CGIManager {
private:
std::string basePath;
std::string confPath;
int method;
broomie::Classifier* classifier;
void readParameters(){}
enum {
FCGLIFETIME = 10000,
MINIBNUM = 31,
UPLOADMAX = (256*1024*1024),
};
public:
CGIManager(std::string configName) : confPath(configName), classifier(){}
~CGIManager()
{
delete classifier;
}
bool readConfig()
{
bool ok = true;
std::ifstream ifs(confPath.c_str(), std::ios::in);
if(!ifs) return false;
std::string line;
while(std::getline(ifs, line)){
std::vector<std::string> features = broomie::util::split(line, "\t");
if(features[0] == broomie::DEFINE_METHOD_NAME){
if(features[1] == broomie::METHOD_BAYES){
method = broomie::BAYES;
} else if(features[1] == broomie::METHOD_OLL){
method = broomie::OLL;
} else if(features[1] == broomie::METHOD_TINYSVM){
method = broomie::TINYSVM;
} else {
return false;
}
} else if(features[0] == broomie::DEFINE_BASE_DIR_NAME.c_str()){
basePath = features[1];
}
}
return ok;
}
const unsigned int getLifeTime()
{
return FCGLIFETIME;
}
int accept()
{
return FCGI_Accept();
}
bool openClassifier()
{
bool ok = true;
broomie::ModelFactoryImpl* modelFactory = new broomie::ModelFactoryImpl();
classifier = new broomie::Classifier(modelFactory, basePath);
ok = classifier->beginClassification(this->method);
delete modelFactory;
return ok;
}
bool closeClassifier()
{
bool ok = true;
ok = classifier->endClassification();
return ok;
}
/* dispatch the acctual process by mode */
void dispatch()
{
TCMAP* params = tcmapnew2(MINIBNUM);
readparameters(params);
std::string text = tcmapget2(params, "text");
std::vector<std::string>features = broomie::util::split(text, "\t");
broomie::Document doc(features.size() / 2);
std::string className;
std::string feature;
for(unsigned int i = 0; i < features.size(); i++){
if(i % 2 == 0){
feature = features[i];
} else {
double point = atof(features[i].c_str());
doc.addFeature(feature, point);
}
}
broomie::ResultSet* rs = classifier->classify(doc);
for(int i = 0; i < rs->getResultSetNum(); i++){
float point;
std::string className = rs->getResult(i, point);
printf("%s:%f\n", className.c_str(), point);
}
delete rs;
tcmapdel(params);
}
/* read CGI parameters */
void readparameters(TCMAP* params)
{
char* buf = NULL;
int len = 0;
const char* rp;
if((rp = getenv("REQUEST_METHOD")) != NULL && !strcmp(rp, "POST") &&
(rp = getenv("CONTENT_LENGTH")) != NULL && (len = atoi(rp)) > 0){
if(len > UPLOADMAX) len = UPLOADMAX;
buf = static_cast<char*>(tccalloc(len + 1, 1));
if(static_cast<int>(fread(buf, 1, len, stdin)) != len){
tcfree(buf);
buf = NULL;
}
} else if((rp = getenv("QUERY_STRING")) != NULL){
buf = tcstrdup(rp);
len = strlen(buf);
}
if(buf && len > 0){
if((rp = getenv("CONTENT_TYPE")) != NULL
&& tcstrfwm(rp, "multipart/form-data")
&& (rp = strstr(rp, "boundary=")) != NULL){
rp += 9;
if(*rp == '"') rp++;
char bstr[strlen(rp)+1];
strcpy(bstr, rp);
char* wp = strchr(bstr, ';');
if(wp) *wp = '\0';
wp = strchr(bstr, '"');
if(wp) *wp = '\0';
TCLIST* parts = tcmimeparts(buf, len, bstr);
int pnum = tclistnum(parts);
for(int i = 0; i < pnum; i++){
int psiz;
const char* part =
static_cast<const char*>(tclistval(parts, i, &psiz));
TCMAP* hmap = tcmapnew2(MINIBNUM);
int bsiz;
char* body = tcmimebreak(part, psiz, hmap, &bsiz);
int nsiz;
const char* name =
static_cast<const char*>(tcmapget(hmap, "NAME", 4, &nsiz));
if(name){
tcmapput(params, name, nsiz, body, bsiz);
const char* fname = tcmapget2(hmap, "FILENAME");
if(fname){
if(*fname == '/'){
fname = strrchr(fname, '/') + 1;
} else if(((*fname >= 'a' && *fname <= 'z') ||
(*fname >= 'A' && *fname <= 'Z')) &&
fname[1] == ':' && fname[2] == '\\'){
fname = strrchr(fname, '\\') + 1;
}
if(*fname != '\0'){
char key[nsiz+10];
sprintf(key, "%s_filename", name);
tcmapput2(params, key, fname);
}
}
}
tcfree(body);
tcmapdel(hmap);
}
tclistdel(parts);
} else {
TCLIST* pairs = tcstrsplit(buf, "&");
int num = tclistnum(pairs);
for(int i = 0; i < num; i++){
char* key = tcstrdup(tclistval2(pairs, i));
char* val = strchr(key, '=');
if(val){
*(val++) = '\0';
char* dkey = tcurldecode(key, &len);
char* dval = tcurldecode(val, &len);
tcmapput2(params, dkey, dval);
tcfree(dval);
tcfree(dkey);
}
tcfree(key);
}
tclistdel(pairs);
}
}
tcfree(buf);
}
};
int main(int argc, char** argv)
{
bool ok = true;
unsigned int cnt = 0;
std::string configName = "./";
configName.append(broomie::CONFIG_NAME);
CGIManager cgiMgr(configName);
cgiMgr.readConfig();
ok = cgiMgr.openClassifier();
while(cgiMgr.accept() >= 0){
cnt++;
printf("Content-Type: text/plain; charset=UTF-8\r\n");
printf("X-FCGI-Count: %d\r\n", cnt);
printf("\r\n");
cgiMgr.dispatch();
fflush(stdout);
if(cnt >= cgiMgr.getLifeTime()) break;
}
ok = cgiMgr.closeClassifier();
return 0;
}
| 27.379913 | 78 | 0.532376 | [
"vector"
] |
40a904c92f2d570d3d42c5dea12623a4b045d6d6 | 7,311 | cc | C++ | compiler/mcr_cc/llvm/llvm_intrinsics.cc | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | 20 | 2021-06-24T16:38:42.000Z | 2022-01-20T16:15:57.000Z | compiler/mcr_cc/llvm/llvm_intrinsics.cc | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | null | null | null | compiler/mcr_cc/llvm/llvm_intrinsics.cc | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | 4 | 2021-11-03T06:01:12.000Z | 2022-02-24T02:57:31.000Z | /**
* Copyright (C) 2021 Paschalis Mpeis (paschalis.mpeis-AT-gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include "intrinsic_helper.h"
#include <llvm/IR/Intrinsics.h>
#include "asm_arm_thumb.h"
#include "asm_arm64.h"
#include "function_helper.h"
#include "hgraph_printers.h"
#include "hgraph_to_llvm-inl.h"
#include "hgraph_to_llvm.h"
#include "ir_builder.h"
#include "llvm_compilation_unit.h"
#include "mirror/string.h"
#include "optimizing/data_type-inl.h"
#include "llvm_macros_irb_.h"
using namespace ::llvm;
namespace art {
namespace LLVM {
void IntrinsicHelper::LlvmInvariantStart(Value* variable) {
if(!isa<GlobalVariable>(variable)) {
DLOG(ERROR) << __func__ << ": Not global. skip for: "
<< variable->getName().str();
return;
}
// TODO: cast
// LlvmInvariantStart(cast<GlobalVariable*>(variable));
}
void IntrinsicHelper::LlvmInvariantStart(GlobalVariable* variable) {
Type* varTy = variable->getType();
DataLayout* DL = new DataLayout(mod_);
uint32_t typeSize = DL->getTypeAllocSize(varTy);
std::vector<Value*> args{irb_->getJLong(typeSize), variable};
std::vector<Type *> ty{varTy};
Function *F= Intrinsic::getDeclaration(
mod_, Intrinsic::invariant_start, ty);
irb_->CreateCall(F, args);
}
Value* IntrinsicHelper::llvm_round(Intrinsics intrinsic, HInvoke* invoke,
std::vector<Value*> callee_args) {
// to follow exactly the Java8 standard, something like the below
// should be implemented:
// llvm.round:
// fcvtas w0, s8
// optimizing/intrinsics_arm64.cc TODO
// ARM64:
// fcvtas w0, s0
// tbz w0, #31, #+0x18 (addr 0x23a0dc) (basically ignoring the rest..)
// frinta s1, s0
// fsub s1, s0, s1
// fmov s31, #0x60 (0.5000)
// fcmp s1, s31
// cinc w0, w0, eq
_LOGLLVM2(irb_, ERROR, "Round: TODO_LLVM for Java8 standard");
CHECK(intrinsic == Intrinsics::kMathRoundFloat ||
intrinsic == Intrinsics::kMathRoundDouble)
<< "Not Math.round";
// return type is i32
DataType::Type htypein = invoke->InputAt(0)->GetType();
DataType::Type htypeout = invoke->GetType();
Type* ltypein = irb_->getType(htypein);
Type* ltypeout = irb_->getType(htypeout);
std::vector<Type *> ty(1, ltypein); // to get float/double variant
Function *llvm_round= Intrinsic::getDeclaration(mod_, Intrinsic::round, ty);
Value* result = irb_->CreateCall(llvm_round, callee_args);
Value* casted_result = result;
CHECK(DataType::IsIntegralType(htypeout)) << "result must be integer.";
// Result must be converted to integral type
casted_result = irb_->CreateFPToSI(result, ltypeout);
return casted_result;
}
Value* IntrinsicHelper::callLlvmDoubleIntrinsic(Intrinsic::ID id,
Intrinsics intrinsic, HInvoke* invoke, std::vector<Value*> args) {
Type* ltype = irb_->getType(invoke->GetType());
std::vector<Type *> ty(1, ltype);
Function *f= Intrinsic::getDeclaration(mod_, id, ty);
return irb_->CreateCall(f, args);
}
Value* IntrinsicHelper::llvm_sqrt(
Intrinsics intrinsic, HInvoke* invoke, std::vector<Value*> args) {
// llvm.round: fsqrt d0, d8
// ARM64: fsqrt d0, d0
return callLlvmDoubleIntrinsic(
Intrinsic::sqrt, intrinsic, invoke, args);
}
Value* IntrinsicHelper::llvm_ceil(
Intrinsics intrinsic, HInvoke* invoke, std::vector<Value*> args) {
// llvm.ceil: frintp d0, d8
// ARM64: frintp d0, d0
return callLlvmDoubleIntrinsic(
Intrinsic::ceil, intrinsic, invoke, args);
}
Value* IntrinsicHelper::llvm_floor(
Intrinsics intrinsic, HInvoke* invoke, std::vector<Value*> args) {
// llvm.floor: frintm d0, d8
// ARM64: frintm d0, d0
return callLlvmDoubleIntrinsic(
Intrinsic::floor, intrinsic, invoke, args);
}
Value* IntrinsicHelper::llvm_exp(
Intrinsics intrinsic, HInvoke* invoke, std::vector<Value*> args) {
return callLlvmDoubleIntrinsic(
Intrinsic::exp, intrinsic, invoke, args);
}
Value* IntrinsicHelper::llvm_cos(
Intrinsics intrinsic, HInvoke* invoke, std::vector<Value*> args) {
return callLlvmDoubleIntrinsic(
Intrinsic::cos, intrinsic, invoke, args);
}
// https://godbolt.org/z/7s8hed
Value* IntrinsicHelper::llvm_log(
Intrinsics intrinsic, HInvoke* invoke, std::vector<Value*> args) {
return callLlvmDoubleIntrinsic(
Intrinsic::log, intrinsic, invoke, args);
}
Value* IntrinsicHelper::llvm_fshl(DataType::Type type, std::vector<Value*> args) {
Type* ltype = irb_->getType(type);
std::vector<Type *> ty(1, ltype);
Function *f= Intrinsic::getDeclaration(mod_, Intrinsic::fshl, ty);
return irb_->CreateCall(f, args);
}
// Count the number of 1 bits Integer.bitcount
Value* IntrinsicHelper::llvm_bitcount(
HInvoke* h, Intrinsics intrinsic, std::vector<Value*> callee_args) {
DLOG(INFO) << __func___;
Type* ltype = nullptr;
bool cast_to_i32 = false;
switch(intrinsic) {
// case Intrinsics::kLongBitCount:
// ltype = irb_->getJLongTy();
// cast_to_i32 = true;
// break;
case Intrinsics::kIntegerBitCount:
ltype = irb_->getJIntTy();
break;
default:
DIE << "Wrong type: must be int or long: " << intrinsic;
}
std::vector<Type *> ty(1, ltype); // to get int/long variants
Function *F = Intrinsic::getDeclaration(mod_, Intrinsic::ctpop, ty);
std::vector<Value*> args{callee_args.begin(), callee_args.end()};
Value* result = irb_->CreateCall(F, args);
if(cast_to_i32) {
result = irb_->CreateTrunc(result, irb_->getInt32Ty());
}
return result;
}
// Count the number of leading/trailing zeros.
Value* IntrinsicHelper::llvm_count_zeros(
HInvoke* h, Intrinsics intrinsic, std::vector<Value*> callee_args,
bool leading) {
DLOG(INFO) << __func___;
Type* ltype = nullptr;
bool cast_to_i32 = false;
switch(intrinsic) {
case Intrinsics::kLongNumberOfLeadingZeros:
case Intrinsics::kLongNumberOfTrailingZeros:
ltype = irb_->getJLongTy();
cast_to_i32 = true;
break;
case Intrinsics::kIntegerNumberOfLeadingZeros:
case Intrinsics::kIntegerNumberOfTrailingZeros:
ltype = irb_->getJIntTy();
break;
default:
DIE << "Wrong type: must be int or long: " << intrinsic;
}
std::vector<Type *> ty(1, ltype); // to get int/long variants
Function *F = nullptr;
if(leading) {
F = Intrinsic::getDeclaration(mod_, Intrinsic::ctlz, ty);
} else {
F = Intrinsic::getDeclaration(mod_, Intrinsic::cttz, ty);
}
std::vector<Value*> args{callee_args.begin(), callee_args.end()};
// is_zero_undef: true to allow zero (e.g. cttz(i32 0) is 32
args.push_back(irb_->getInt1(1));
Value* result = irb_->CreateCall(F, args);
if(cast_to_i32) {
result = irb_->CreateTrunc(result, irb_->getInt32Ty());
}
return result;
}
#include "llvm_macros_undef.h"
} // namespace LLVM
} // namespace art
| 30.08642 | 82 | 0.694023 | [
"vector"
] |
40aa52cb5f791cf5822653d5dd623ed60edba82f | 5,825 | cpp | C++ | src/smartpeak/source/core/RawDataProcessors/CalculateIsotopicPurities.cpp | dmccloskey/SmartPeak2 | d3b42a938b225973117ddd4f9f5e5016034c09be | [
"MIT"
] | 7 | 2020-07-16T02:51:26.000Z | 2020-10-17T11:20:35.000Z | src/smartpeak/source/core/RawDataProcessors/CalculateIsotopicPurities.cpp | dmccloskey/SmartPeak2 | d3b42a938b225973117ddd4f9f5e5016034c09be | [
"MIT"
] | 5 | 2020-08-02T20:18:31.000Z | 2020-12-01T13:37:49.000Z | src/smartpeak/source/core/RawDataProcessors/CalculateIsotopicPurities.cpp | dmccloskey/SmartPeak2 | d3b42a938b225973117ddd4f9f5e5016034c09be | [
"MIT"
] | 1 | 2020-07-25T07:41:22.000Z | 2020-07-25T07:41:22.000Z | // --------------------------------------------------------------------------
// SmartPeak -- Fast and Accurate CE-, GC- and LC-MS(/MS) Data Processing
// --------------------------------------------------------------------------
// Copyright The SmartPeak Team -- Novo Nordisk Foundation
// Center for Biosustainability, Technical University of Denmark 2018-2021.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
// INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// --------------------------------------------------------------------------
// $Maintainer: Douglas McCloskey $
// $Authors: Douglas McCloskey, Pasquale Domenico Colaianni $
// --------------------------------------------------------------------------
#include <SmartPeak/core/RawDataProcessors/CalculateIsotopicPurities.h>
#include <SmartPeak/core/Filenames.h>
#include <SmartPeak/core/Utilities.h>
#include <SmartPeak/core/FeatureFiltersUtils.h>
#include <OpenMS/ANALYSIS/QUANTITATION/IsotopeLabelingMDVs.h>
#include <plog/Log.h>
#include <algorithm>
#include <exception>
namespace SmartPeak
{
std::set<std::string> CalculateIsotopicPurities::getInputs() const
{
return { };
}
std::set<std::string> CalculateIsotopicPurities::getOutputs() const
{
return { "Features" };
}
std::vector<std::string> CalculateIsotopicPurities::getRequirements() const
{
return { "sequence", "traML" };
}
ParameterSet CalculateIsotopicPurities::getParameterSchema() const
{
std::map<std::string, std::vector<std::map<std::string, std::string>>> param_struct({
{"CalculateIsotopicPurities", {
{
{"name", "isotopic_purity_values"},
{"type", "string"},
{"value", ""},
{"description", "The isotropic purity values"},
},
{
{"name", "isotopic_purity_name"},
{"type", "list"},
{"value", "[]"},
{"description", "The isotropic purity names"},
}
}} });
return ParameterSet(param_struct);
}
void CalculateIsotopicPurities::doProcess(
RawDataHandler& rawDataHandler_IO,
const ParameterSet& params_I,
Filenames& filenames_I
) const
{
getFilenames(filenames_I);
// Complete user parameters with schema
ParameterSet params(params_I);
params.merge(getParameterSchema());
OpenMS::IsotopeLabelingMDVs isotopelabelingmdvs;
OpenMS::Param parameters = isotopelabelingmdvs.getParameters();
isotopelabelingmdvs.setParameters(parameters);
OpenMS::FeatureMap normalized_featureMap;
auto& CalculateIsotopicPurities_params = params.at("CalculateIsotopicPurities");
std::vector<std::string> isotopic_purity_names;
std::vector<std::vector<double>> experiment_data_mat;
for (auto& param : CalculateIsotopicPurities_params)
{
if (param.getName() == "isotopic_purity_values" && !param.getValueAsString().empty())
{
std::string experiment_data_s;
std::vector<double> experiment_data;
experiment_data_s = param.getValueAsString();
std::regex regex_double("[+-]?\\d+(?:\\.\\d+)?");
size_t num_lists = std::count(experiment_data_s.begin(), experiment_data_s.end(), '[') == std::count(experiment_data_s.begin(), experiment_data_s.end(), ']') ? std::count(experiment_data_s.begin(), experiment_data_s.end(), '[') : 0;
experiment_data_mat.resize(num_lists);
std::sregex_iterator values_begin = std::sregex_iterator(experiment_data_s.begin(), experiment_data_s.end(), regex_double);
std::sregex_iterator values_end = std::sregex_iterator();
auto num_values = std::distance(values_begin , values_end);
for (std::sregex_iterator it = values_begin; it != values_end; ++it)
experiment_data.push_back(std::stod(it->str()));
size_t element_idx = 0;
size_t list_idx = 0;
do
{
do
{
experiment_data_mat.at(list_idx).push_back(experiment_data.at(element_idx));
element_idx++;
if (element_idx > 0 && element_idx % (num_values / num_lists) == 0) list_idx++;
}
while ((element_idx > 0 && element_idx % (num_values / num_lists) != 0));
}
while (list_idx < num_lists);
}
if (param.getName() == "isotopic_purity_name" && !param.getValueAsString().empty())
{
std::string isotopic_purity_name_s;
isotopic_purity_name_s = param.getValueAsString();
std::regex regex_string_list("[^\"\',\[]+(?=')");
std::sregex_iterator names_begin = std::sregex_iterator(isotopic_purity_name_s.begin(), isotopic_purity_name_s.end(), regex_string_list);
for (std::sregex_iterator it = names_begin; it != std::sregex_iterator(); ++it)
isotopic_purity_names.push_back(it->str());
}
}
normalized_featureMap = rawDataHandler_IO.getFeatureMap();
isotopelabelingmdvs.calculateIsotopicPurities(normalized_featureMap, experiment_data_mat, isotopic_purity_names);
rawDataHandler_IO.setFeatureMap(normalized_featureMap);
rawDataHandler_IO.updateFeatureMapHistory();
}
}
| 40.734266 | 240 | 0.649099 | [
"vector"
] |
40b179e8cb234a29a56d4d1678f8c62833ce5f54 | 200 | cpp | C++ | apps/app2/app.cpp | phiwen96/Phan | 61bd47d57dc6d0e7a92c6e9db676f5d76ed8edb4 | [
"Apache-2.0"
] | 3 | 2021-03-15T12:57:32.000Z | 2021-03-15T15:34:07.000Z | apps/app2/app.cpp | phiwen96/Phan | 61bd47d57dc6d0e7a92c6e9db676f5d76ed8edb4 | [
"Apache-2.0"
] | null | null | null | apps/app2/app.cpp | phiwen96/Phan | 61bd47d57dc6d0e7a92c6e9db676f5d76ed8edb4 | [
"Apache-2.0"
] | 1 | 2021-03-15T13:36:21.000Z | 2021-03-15T13:36:21.000Z | #include <iostream>
#include <vector>
#include <tuple>
using namespace std;
int main() {
std::vector<double> input = {1.2, 2.3, 3.4, 4.5};
cout << "hello world" << endl;
return 0;
}
| 12.5 | 53 | 0.585 | [
"vector"
] |
40bb7632c8d0e2006c900658d45d2fe1cca18f5e | 6,257 | cpp | C++ | Presentation/Section/Dockage.cpp | garmin/ActiveCaptainCommunitySDK-common | a7574a3b85b77771ceb47e5fc9a99fd31a10d47a | [
"Apache-2.0"
] | null | null | null | Presentation/Section/Dockage.cpp | garmin/ActiveCaptainCommunitySDK-common | a7574a3b85b77771ceb47e5fc9a99fd31a10d47a | [
"Apache-2.0"
] | null | null | null | Presentation/Section/Dockage.cpp | garmin/ActiveCaptainCommunitySDK-common | a7574a3b85b77771ceb47e5fc9a99fd31a10d47a | [
"Apache-2.0"
] | null | null | null | /*------------------------------------------------------------------------------
Copyright 2021 Garmin Ltd. or its subsidiaries.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
------------------------------------------------------------------------------*/
/**
@file
@brief Represents the ActiveCaptain community database
Dockage object from the sqlite database
Copyright 2018-2020 by Garmin Ltd. or its subsidiaries.
*/
#define DBG_MODULE "ACDB"
#define DBG_TAG "Dockage"
#include "DBG_pub.h"
#include "Acdb/Presentation/Section/Dockage.hpp"
#include "Acdb/PrvTypes.hpp"
namespace Acdb {
namespace Presentation {
//----------------------------------------------------------------
//!
//! @public
//! @brief Constructor
//!
//----------------------------------------------------------------
Dockage::Dockage(std::string&& aTitle, std::vector<YesNoMultiValueField>&& aYesNoMultiValueFields,
std::vector<AttributePriceField>&& aAttributePriceFields,
std::vector<AttributeField>&& aAttributeFields,
std::unique_ptr<AttributeField> aSectionNote,
std::vector<YesNoUnknownNearbyField>&& aYnubFields,
std::vector<YesNoUnknownNearbyFieldPair>&& aYnubFieldPairs, LinkField&& aEditField,
LinkField&& aSeeAllField)
: mTitle(std::move(aTitle)),
mYesNoMultiValueFields(std::move(aYesNoMultiValueFields)),
mAttributePriceFields(std::move(aAttributePriceFields)),
mAttributeFields(std::move(aAttributeFields)),
mSectionNote(std::move(aSectionNote)),
mYnubFields(std::move(aYnubFields)),
mYnubFieldPairs(std::move(aYnubFieldPairs)),
mEditField(std::move(aEditField)),
mSeeAllField(std::move(aSeeAllField)) {} // end of Dockage
//----------------------------------------------------------------
//!
//! @public
//! @brief Equality operator
//!
//----------------------------------------------------------------
bool Dockage::operator==(const Dockage& aRhs) const {
return mTitle == aRhs.mTitle && mYesNoMultiValueFields == aRhs.mYesNoMultiValueFields &&
mAttributePriceFields == aRhs.mAttributePriceFields &&
mAttributeFields == aRhs.mAttributeFields &&
CompareUniquePtr(mSectionNote, aRhs.mSectionNote) && mYnubFields == aRhs.mYnubFields &&
mYnubFieldPairs == aRhs.mYnubFieldPairs && mEditField == aRhs.mEditField &&
mSeeAllField == aRhs.mSeeAllField;
} // end of operator==
//----------------------------------------------------------------
//!
//! @public
//! @brief Accessor
//!
//! @return value of the attribute fields
//!
//----------------------------------------------------------------
const std::vector<AttributeField>& Dockage::GetAttributeFields() const {
return mAttributeFields;
} // end of GetAttributeFields
//----------------------------------------------------------------
//!
//! @public
//! @brief Accessor
//!
//! @return value of the attribute price fields
//!
//----------------------------------------------------------------
const std::vector<AttributePriceField>& Dockage::GetAttributePriceFields() const {
return mAttributePriceFields;
} // end of GetAttributePriceFields
//----------------------------------------------------------------
//!
//! @public
//! @brief Accessor
//!
//! @return value of the edit field
//!
//----------------------------------------------------------------
const LinkField& Dockage::GetEditField() const { return mEditField; } // end of GetEditField
//----------------------------------------------------------------
//!
//! @public
//! @brief Accessor
//!
//! @return pointer to section note field
//!
//----------------------------------------------------------------
const AttributeField* Dockage::GetSectionNote() const {
return mSectionNote.get();
} // end of GetSectionNote
//----------------------------------------------------------------
//!
//! @public
//! @brief Accessor
//!
//! @return value of the see all field
//!
//----------------------------------------------------------------
const LinkField& Dockage::GetSeeAllField() const { return mSeeAllField; } // end of GetSeeAllField
//----------------------------------------------------------------
//!
//! @public
//! @brief Accessor
//!
//! @return value of the title
//!
//----------------------------------------------------------------
const std::string& Dockage::GetTitle() const { return mTitle; } // end of GetTitle
//----------------------------------------------------------------
//!
//! @public
//! @brief Accessor
//!
//! @return value of the Yes / No multi-value fields
//!
//----------------------------------------------------------------
const std::vector<YesNoMultiValueField>& Dockage::GetYesNoMultiValueFields() const {
return mYesNoMultiValueFields;
} // end of GetYesNoMultiValueFields
//----------------------------------------------------------------
//!
//! @public
//! @brief Accessor
//!
//! @return value of the Yes / No / Unknown / Nearby fields
//!
//----------------------------------------------------------------
const std::vector<YesNoUnknownNearbyField>& Dockage::GetYesNoUnknownNearbyFields() const {
return mYnubFields;
} // end of GetYesNoUnknownNearbyFields
//----------------------------------------------------------------
//!
//! @public
//! @brief Accessor
//!
//! @return value of the Yes / No / Unknown / Nearby field pairs
//!
//----------------------------------------------------------------
const std::vector<YesNoUnknownNearbyFieldPair>& Dockage::GetYesNoUnknownNearbyFieldPairs() const {
return mYnubFieldPairs;
} // end of GetYesNoUnknownNearbyFieldPairs
} // end of namespace Presentation
} // end of namespace Acdb
| 35.151685 | 100 | 0.516382 | [
"object",
"vector"
] |
8add15564b7ddef6c66faef5ca4c5245b288874d | 922 | cpp | C++ | CI1-16/src/Postman.cpp | pemesteves/AEDA_1819-exercises | c8158547a53865c3910e420208b853579d0971c6 | [
"MIT"
] | 2 | 2018-11-28T10:59:27.000Z | 2018-12-21T14:33:12.000Z | CI1-16/src/Postman.cpp | pemesteves/AEDA_1819-exercises | c8158547a53865c3910e420208b853579d0971c6 | [
"MIT"
] | null | null | null | CI1-16/src/Postman.cpp | pemesteves/AEDA_1819-exercises | c8158547a53865c3910e420208b853579d0971c6 | [
"MIT"
] | 1 | 2018-11-18T23:41:41.000Z | 2018-11-18T23:41:41.000Z | /*
* Postman.cpp
*/
#include "Postman.h"
unsigned int Postman::nId = 0;
Postman::Postman(): id(0){};
Postman::Postman(string name): id(++nId){
this->name = name;
}
void Postman::setName(string nm){
name = nm;
}
string Postman::getName() const{
return name;
}
vector<Mail *> Postman::getMail() const {
return myMail;
}
void Postman::addMail(Mail *m) {
myMail.push_back(m);
}
void Postman::addMail(vector<Mail *> mails) {
myMail.insert(myMail.end(),mails.begin(),mails.end());
}
unsigned int Postman::getID() const{
return id;
}
bool Postman::operator< (const Postman &p) const{
vector<string> v1, v2;
for(size_t i = 0; i < myMail.size(); i++){
v1.push_back(myMail[i]->getZipCode());
}
unsigned int n1 = numberDifferent(v1);
vector<Mail *> v = p.getMail();
for (size_t i = 0; i < v.size(); i++){
v2.push_back(v[i]->getZipCode());
}
unsigned int n2 = numberDifferent(v2);
return n1 < n2;
}
| 17.074074 | 55 | 0.644252 | [
"vector"
] |
8ae75cceac9bd64b651683283302b9df9145cbe3 | 8,990 | cc | C++ | tests/round_robin.cc | alionurdemetoglu/gearmand | dd9ac59a730f816e0dc5f27f98fdc06a08cc4c22 | [
"BSD-3-Clause"
] | 712 | 2016-07-02T03:32:22.000Z | 2022-03-23T14:23:02.000Z | tests/round_robin.cc | alionurdemetoglu/gearmand | dd9ac59a730f816e0dc5f27f98fdc06a08cc4c22 | [
"BSD-3-Clause"
] | 294 | 2016-07-03T16:17:41.000Z | 2022-03-30T04:37:49.000Z | tests/round_robin.cc | alionurdemetoglu/gearmand | dd9ac59a730f816e0dc5f27f98fdc06a08cc4c22 | [
"BSD-3-Clause"
] | 163 | 2016-07-08T10:03:38.000Z | 2022-01-21T05:03:48.000Z | /* Gearman server and library
* Copyright (C) 2008 Brian Aker, Eric Day
* All rights reserved.
*
* Use and distribution licensed under the BSD license. See
* the COPYING file in the parent directory for full text.
*/
#include "gear_config.h"
#include <libtest/test.hpp>
using namespace libtest;
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <memory>
#include <unistd.h>
#include <libgearman/gearman.h>
#include "libgearman/client.hpp"
#include "libgearman/worker.hpp"
using namespace org::gearmand;
#include "tests/start_worker.h"
struct Context
{
bool run_worker;
in_port_t _port;
uint32_t _retries;
server_startup_st& servers;
Context(server_startup_st& arg, in_port_t port_arg) :
run_worker(false),
_port(port_arg),
_retries(0),
servers(arg)
{
}
uint32_t retries()
{
return _retries;
}
uint32_t retries(const uint32_t arg)
{
return _retries= arg;
}
in_port_t port() const
{
return _port;
}
~Context()
{
reset();
}
void reset()
{
servers.clear();
_port= libtest::get_free_port();
_retries= 0;
}
};
#ifndef __INTEL_COMPILER
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
/* append test for worker */
static gearman_return_t append_function_WORKER(gearman_job_st* job, void *context_arg)
{
/* this will will set the last char in the context (buffer) to the */
/* first char of the work */
char *buf = (char *)context_arg;
assert(buf);
char *work = (char *)gearman_job_workload(job);
buf+= strlen(buf);
*buf= *work;
return GEARMAN_SUCCESS;
}
static test_return_t queue_add(void *object)
{
Context *context= (Context *)object;
ASSERT_TRUE(context);
libgearman::Client client(context->port());
char job_handle[GEARMAN_JOB_HANDLE_SIZE];
uint8_t *value= (uint8_t *)malloc(1);
*value= uint8_t('0');
size_t value_length= 1;
context->run_worker= false;
/* send strings "0", "1" ... "9" to alternating between 2 queues */
/* queue1 = 1,3,5,7,9 */
/* queue2 = 0,2,4,6,8 */
for (uint32_t x= 0; x < 10; x++)
{
ASSERT_EQ(GEARMAN_SUCCESS,
gearman_client_do_background(&client, (x % 2) ? "queue1" : "queue2", NULL,
value, value_length,
job_handle));
*value = (uint8_t)(*value +1);
}
free(value);
context->run_worker= true;
return TEST_SUCCESS;
}
static test_return_t queue_worker(void *object)
{
Context *context= (Context *)object;
ASSERT_TRUE(context);
libgearman::Worker worker(context->port());
char buffer[11];
memset(buffer, 0, sizeof(buffer));
ASSERT_TRUE(context->run_worker);
gearman_function_t append_function_FN= gearman_function_create(append_function_WORKER);
ASSERT_EQ(GEARMAN_SUCCESS, gearman_worker_define_function(&worker,
test_literal_param("queue1"),
append_function_FN,
0, buffer));
ASSERT_EQ(GEARMAN_SUCCESS, gearman_worker_define_function(&worker,
test_literal_param("queue2"),
append_function_FN,
0, buffer));
for (uint32_t x= 0; x < 10; x++)
{
ASSERT_EQ(GEARMAN_SUCCESS, gearman_worker_work(&worker));
}
// expect buffer to be reassembled in a predictable round robin order
test_strcmp("1032547698", buffer);
return TEST_SUCCESS;
}
struct Limit
{
uint32_t _count;
uint32_t _expected;
bool _limit;
Limit(uint32_t expected_arg, bool limit_arg= false) :
_count(0),
_expected(expected_arg),
_limit(limit_arg)
{ }
void increment()
{
_count++;
}
void reset()
{
_count= 0;
}
uint32_t count()
{
return _count;
}
uint32_t expected()
{
return _expected;
}
gearman_return_t response() const
{
if (_limit)
{
return GEARMAN_SUCCESS;
}
return GEARMAN_FATAL;
}
bool complete()
{
if (_limit and _count == _expected)
{
return true;
}
return false;
}
};
// The idea is to return GEARMAN_ERROR until we hit limit, then return
// GEARMAN_SUCCESS
static gearman_return_t job_retry_WORKER(gearman_job_st* job, void *context_arg)
{
(void)(job);
assert(gearman_job_workload_size(job) == 0);
assert(gearman_job_workload(job) == NULL);
Limit *limit= (Limit*)context_arg;
if (limit->complete())
{
return GEARMAN_SUCCESS;
}
limit->increment();
return GEARMAN_ERROR;
}
static test_return_t _job_retry_TEST(Context *context, Limit& limit)
{
gearman_function_t job_retry_FN= gearman_function_create(job_retry_WORKER);
std::unique_ptr<worker_handle_st> handle(test_worker_start(context->port(),
NULL,
__func__,
job_retry_FN,
&limit,
gearman_worker_options_t(),
0)); // timeout
libgearman::Client client(context->port());
gearman_return_t rc;
test_null(gearman_client_do(&client,
__func__,
NULL, // unique
NULL, 0, // workload
NULL, // result size
&rc));
ASSERT_EQ(uint32_t(limit.expected()), uint32_t(limit.count()));
ASSERT_EQ(limit.response(), rc);
return TEST_SUCCESS;
}
static test_return_t job_retry_GEARMAN_SUCCESS_TEST(void *object)
{
Context *context= (Context *)object;
Limit limit(context->retries() -1, true);
return _job_retry_TEST(context, limit);
}
static test_return_t job_retry_limit_GEARMAN_SUCCESS_TEST(void *object)
{
Context *context= (Context *)object;
if (context->retries() < 2)
{
return TEST_SKIPPED;
}
for (uint32_t x= 1; x < context->retries(); x++)
{
Limit limit(uint32_t(x -1), true);
ASSERT_EQ(TEST_SUCCESS, _job_retry_TEST(context, limit));
}
return TEST_SUCCESS;
}
static test_return_t job_retry_GEARMAN_FATAL_TEST(void *object)
{
Context *context= (Context *)object;
Limit limit(context->retries());
return _job_retry_TEST(context, limit);
}
static test_return_t round_robin_SETUP(void *object)
{
Context *context= (Context *)object;
const char *argv[]= { "--round-robin", 0 };
if (server_startup(context->servers, "gearmand", context->port(), argv))
{
return TEST_SUCCESS;
}
return TEST_FAILURE;
}
static test_return_t _job_retries_SETUP(Context *context)
{
char buffer[1024];
snprintf(buffer, sizeof(buffer), "--job-retries=%u", uint32_t(context->retries()));
const char *argv[]= { buffer, 0};
if (server_startup(context->servers, "gearmand", context->port(), argv))
{
return TEST_SUCCESS;
}
return TEST_FAILURE;
}
static test_return_t job_retries_once_SETUP(void *object)
{
Context *context= (Context *)object;
context->retries(1);
return _job_retries_SETUP(context);
}
static test_return_t job_retries_twice_SETUP(void *object)
{
Context *context= (Context *)object;
context->retries(2);
return _job_retries_SETUP(context);
}
static test_return_t job_retries_ten_SETUP(void *object)
{
Context *context= (Context *)object;
context->retries(10);
return _job_retries_SETUP(context);
}
static test_return_t _TEARDOWN(void *object)
{
Context *context= (Context *)object;
context->reset();
return TEST_SUCCESS;
}
static void *world_create(server_startup_st& servers, test_return_t&)
{
Context *context= new Context(servers, libtest::get_free_port());
return context;
}
static bool world_destroy(void *object)
{
Context *context= (Context *)object;
delete context;
return TEST_SUCCESS;
}
test_st round_robin_TESTS[] ={
{"add", 0, queue_add },
{"worker", 0, queue_worker },
{0, 0, 0}
};
test_st job_retry_TESTS[] ={
{"GEARMAN_FATAL", 0, job_retry_GEARMAN_FATAL_TEST },
{"GEARMAN_SUCCESS", 0, job_retry_GEARMAN_SUCCESS_TEST },
{"limit", 0, job_retry_limit_GEARMAN_SUCCESS_TEST },
{0, 0, 0}
};
collection_st collection[] ={
{"round_robin", round_robin_SETUP, _TEARDOWN, round_robin_TESTS },
{"--job-retries=1", job_retries_once_SETUP, _TEARDOWN, job_retry_TESTS },
{"--job-retries=2", job_retries_twice_SETUP, _TEARDOWN, job_retry_TESTS },
{"--job-retries=10", job_retries_ten_SETUP, _TEARDOWN, job_retry_TESTS },
{0, 0, 0, 0}
};
void get_world(libtest::Framework *world)
{
world->collections(collection);
world->create(world_create);
world->destroy(world_destroy);
}
| 22.875318 | 92 | 0.622914 | [
"object"
] |
8aea6e174ecfd6b0947fceb0586bd71cdfa66935 | 4,247 | cc | C++ | src/attributes/OdaGeoDecoderWrapper.cc | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 41 | 2018-12-07T23:10:50.000Z | 2022-02-19T03:01:49.000Z | src/attributes/OdaGeoDecoderWrapper.cc | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 59 | 2019-01-04T15:43:30.000Z | 2022-03-31T09:48:15.000Z | src/attributes/OdaGeoDecoderWrapper.cc | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2019-01-07T14:36:33.000Z | 2021-09-06T14:48:36.000Z |
/****************************** LICENSE *******************************
* (C) Copyright 1996-2017 ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an intergovernmental organisation nor
* does it submit to any jurisdiction.
******************************* LICENSE *******************************/
/*! \\file OdaGeoDecoderAttributes.h
\\brief Definition of OdaGeoDecoder Attributes class.
This file is automatically generated.
Do Not Edit!
*/
#include "MagRequest.h"
#include "OdaGeoDecoderWrapper.h"
#include "MagicsParameter.h"
#include "Factory.h"
#include "MagTranslator.h"
#include "MagicsGlobal.h"
using namespace magics;
OdaGeoDecoderWrapper::OdaGeoDecoderWrapper(): odageodecoder_(new OdaGeoDecoder())
{
}
OdaGeoDecoderWrapper::OdaGeoDecoderWrapper(OdaGeoDecoder* odageodecoder): odageodecoder_(odageodecoder)
{
}
OdaGeoDecoderWrapper::~OdaGeoDecoderWrapper()
{
}
void OdaGeoDecoderWrapper::set(const MagRequest& request)
{
if (request.countValues("ODB_FILENAME") ) {
string path_value = request("ODB_FILENAME");
odageodecoder_->path_ = path_value;
}
if (request.countValues("ODB_LATITUDE_VARIABLE") ) {
string latitude_value = request("ODB_LATITUDE_VARIABLE");
odageodecoder_->latitude_ = latitude_value;
}
if (request.countValues("ODB_LONGITUDE_VARIABLE") ) {
string longitude_value = request("ODB_LONGITUDE_VARIABLE");
odageodecoder_->longitude_ = longitude_value;
}
if (request.countValues("ODB_VALUE_VARIABLE") ) {
string value_value = request("ODB_VALUE_VARIABLE");
odageodecoder_->value_ = value_value;
}
if (request.countValues("ODB_Y_COMPONENT_VARIABLE") ) {
string y_value = request("ODB_Y_COMPONENT_VARIABLE");
odageodecoder_->y_ = y_value;
}
if (request.countValues("ODB_X_COMPONENT_VARIABLE") ) {
string x_value = request("ODB_X_COMPONENT_VARIABLE");
odageodecoder_->x_ = x_value;
}
if (request.countValues("ODB_NB_ROWS") ) {
int nb_rows_value = request("ODB_NB_ROWS");
odageodecoder_->nb_rows_ = nb_rows_value;
}
if (request.countValues("ODB_USER_TITLE") ) {
string title_value = request("ODB_USER_TITLE");
odageodecoder_->title_ = title_value;
}
if (request.countValues("ODB_COORDINATES_UNIT") ) {
string unit_value = request("ODB_COORDINATES_UNIT");
odageodecoder_->unit_ = unit_value;
}
string odb_binning_value = request.countValues("ODB_BINNING") ? (string) request("ODB_BINNING") : "off";
MagLog::debug() << " ODB_BINNING set to " << odb_binning_value << endl;
BinningObjectWrapper* odb_binning_wrapper = 0;
try
{
odb_binning_wrapper = SimpleFactory<BinningObjectWrapper>::create(odb_binning_value);
}
catch (NoFactoryException&) {
if (MagicsGlobal::strict()) {
throw;
}
MagLog::warning() << "[" << odb_binning_value << "] is not a valid value for odb_binning: reset to default -> [off]" << endl;
odb_binning_wrapper = SimpleFactory<BinningObjectWrapper>::create("off");
}
odb_binning_wrapper->set(request);
odageodecoder_->odb_binning_ = unique_ptr<BinningObject>(odb_binning_wrapper->object());
delete odb_binning_wrapper;
}
void OdaGeoDecoderWrapper::print(ostream& out) const
{
out << "OdaGeoDecoderWrapper[]";
}
#include "BinningObjectWrapper.h"
static SimpleObjectMaker<BinningObjectWrapper> OdaGeoDecoder_odb_binning_binning_Wrapper("binning");
#include "BinningObjectWrapper.h"
static SimpleObjectMaker<BinningObjectWrapper> OdaGeoDecoder_odb_binning_on_Wrapper("on");
#include "NoBinningObjectWrapper.h"
static SimpleObjectMaker<NoBinningObject, BinningObject> OdaGeoDecoder_odb_binning_nobinning ("nobinning");
static SimpleObjectMaker<NoBinningObjectWrapper, BinningObjectWrapper> OdaGeoDecoder_odb_binning_nobinning_wrapper ("nobinning");
#include "NoBinningObjectWrapper.h"
static SimpleObjectMaker<NoBinningObject, BinningObject> OdaGeoDecoder_odb_binning_off ("off");
static SimpleObjectMaker<NoBinningObjectWrapper, BinningObjectWrapper> OdaGeoDecoder_odb_binning_off_wrapper ("off");
| 29.699301 | 129 | 0.739581 | [
"object"
] |
8aeb41b690e5dc6890c57d62e05f2d6269c80531 | 17,217 | cpp | C++ | DiligentTools/Imgui/src/ImGuiImplDiligent.cpp | Romanovich1311/DEngine-pcsx4 | 65d28b15e9428d77963de95412aaceeb5930d29d | [
"Apache-2.0"
] | 15 | 2021-07-03T17:20:50.000Z | 2022-03-20T23:39:09.000Z | DiligentTools/Imgui/src/ImGuiImplDiligent.cpp | Romanovich1311/DEngine-pcsx4 | 65d28b15e9428d77963de95412aaceeb5930d29d | [
"Apache-2.0"
] | 1 | 2021-08-09T15:10:17.000Z | 2021-09-30T06:47:04.000Z | DiligentTools/Imgui/src/ImGuiImplDiligent.cpp | Romanovich1311/DEngine-pcsx4 | 65d28b15e9428d77963de95412aaceeb5930d29d | [
"Apache-2.0"
] | 9 | 2021-07-21T10:53:59.000Z | 2022-03-03T10:27:33.000Z | /*
* Copyright 2019-2020 Diligent Graphics LLC
* Copyright 2015-2019 Egor Yusov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* In no event and under no legal theory, whether in tort (including negligence),
* contract, or otherwise, unless required by applicable law (such as deliberate
* and grossly negligent acts) or agreed to in writing, shall any Contributor be
* liable for any damages, including any direct, indirect, special, incidental,
* or consequential damages of any character arising as a result of this License or
* out of the use or inability to use the software (including but not limited to damages
* for loss of goodwill, work stoppage, computer failure or malfunction, or any and
* all other commercial damages or losses), even if such Contributor has been advised
* of the possibility of such damages.
*/
#include <cstddef>
#include "imgui.h"
#include "ImGuiImplDiligent.hpp"
#include "RenderDevice.h"
#include "DeviceContext.h"
#include "RefCntAutoPtr.hpp"
#include "BasicMath.hpp"
#include "MapHelper.hpp"
namespace Diligent
{
class ImGuiImplDiligent_Internal
{
public:
ImGuiImplDiligent_Internal(IRenderDevice* pDevice,
TEXTURE_FORMAT BackBufferFmt,
TEXTURE_FORMAT DepthBufferFmt,
Uint32 InitialVertexBufferSize,
Uint32 InitialIndexBufferSize) :
// clang-format off
m_pDevice {pDevice},
m_BackBufferFmt {BackBufferFmt},
m_DepthBufferFmt {DepthBufferFmt},
m_VertexBufferSize{InitialVertexBufferSize},
m_IndexBufferSize {InitialIndexBufferSize}
// clang-format on
{
// Setup back-end capabilities flags
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
io.BackendRendererName = "ImGuiImplDiligent";
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
io.IniFilename = nullptr;
CreateDeviceObjects();
}
~ImGuiImplDiligent_Internal()
{
ImGui::DestroyContext();
}
void NewFrame();
void RenderDrawData(IDeviceContext* pCtx, ImDrawData* pDrawData);
// Use if you want to reset your rendering device without losing ImGui state.
void InvalidateDeviceObjects();
void CreateDeviceObjects();
void CreateFontsTexture();
private:
RefCntAutoPtr<IRenderDevice> m_pDevice;
RefCntAutoPtr<IBuffer> m_pVB;
RefCntAutoPtr<IBuffer> m_pIB;
RefCntAutoPtr<IBuffer> m_pVertexConstantBuffer;
RefCntAutoPtr<IPipelineState> m_pPSO;
RefCntAutoPtr<ITextureView> m_pFontSRV;
RefCntAutoPtr<IShaderResourceBinding> m_pSRB;
const TEXTURE_FORMAT m_BackBufferFmt;
const TEXTURE_FORMAT m_DepthBufferFmt;
Uint32 m_VertexBufferSize = 0;
Uint32 m_IndexBufferSize = 0;
};
void ImGuiImplDiligent_Internal::NewFrame()
{
if (!m_pPSO)
CreateDeviceObjects();
}
// Use if you want to reset your rendering device without losing ImGui state.
void ImGuiImplDiligent_Internal::InvalidateDeviceObjects()
{
m_pVB.Release();
m_pIB.Release();
m_pVertexConstantBuffer.Release();
m_pPSO.Release();
m_pFontSRV.Release();
m_pSRB.Release();
}
static const char* VertexShaderSource = R"(
cbuffer Constants
{
float4x4 ProjectionMatrix;
}
struct VSInput
{
float2 pos : ATTRIB0;
float2 uv : ATTRIB1;
float4 col : ATTRIB2;
};
struct PSInput
{
float4 pos : SV_POSITION;
float4 col : COLOR;
float2 uv : TEXCOORD;
};
void main(in VSInput VSIn, out PSInput PSIn)
{
PSIn.pos = mul(ProjectionMatrix, float4(VSIn.pos.xy, 0.0, 1.0));
PSIn.col = VSIn.col;
PSIn.uv = VSIn.uv;
}
)";
static const char* PixelShaderSource = R"(
struct PSInput
{
float4 pos : SV_POSITION;
float4 col : COLOR;
float2 uv : TEXCOORD;
};
Texture2D Texture;
SamplerState Texture_sampler;
float4 main(in PSInput PSIn) : SV_Target
{
return PSIn.col * Texture.Sample(Texture_sampler, PSIn.uv);
}
)";
void ImGuiImplDiligent_Internal::CreateDeviceObjects()
{
InvalidateDeviceObjects();
ShaderCreateInfo ShaderCI;
ShaderCI.UseCombinedTextureSamplers = true;
ShaderCI.SourceLanguage = SHADER_SOURCE_LANGUAGE_HLSL;
RefCntAutoPtr<IShader> pVS;
{
ShaderCI.Desc.ShaderType = SHADER_TYPE_VERTEX;
ShaderCI.Desc.Name = "Imgui VS";
ShaderCI.Source = VertexShaderSource;
m_pDevice->CreateShader(ShaderCI, &pVS);
}
RefCntAutoPtr<IShader> pPS;
{
ShaderCI.Desc.ShaderType = SHADER_TYPE_PIXEL;
ShaderCI.Desc.Name = "Imgui PS";
ShaderCI.Source = PixelShaderSource;
m_pDevice->CreateShader(ShaderCI, &pPS);
}
PipelineStateDesc PSODesc;
PSODesc.Name = "ImGUI PSO";
auto& GraphicsPipeline = PSODesc.GraphicsPipeline;
GraphicsPipeline.NumRenderTargets = 1;
GraphicsPipeline.RTVFormats[0] = m_BackBufferFmt;
GraphicsPipeline.DSVFormat = m_DepthBufferFmt;
GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
GraphicsPipeline.pVS = pVS;
GraphicsPipeline.pPS = pPS;
GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
GraphicsPipeline.RasterizerDesc.ScissorEnable = True;
GraphicsPipeline.DepthStencilDesc.DepthEnable = False;
auto& RT0 = GraphicsPipeline.BlendDesc.RenderTargets[0];
RT0.BlendEnable = True;
RT0.SrcBlend = BLEND_FACTOR_SRC_ALPHA;
RT0.DestBlend = BLEND_FACTOR_INV_SRC_ALPHA;
RT0.BlendOp = BLEND_OPERATION_ADD;
RT0.SrcBlendAlpha = BLEND_FACTOR_INV_SRC_ALPHA;
RT0.DestBlendAlpha = BLEND_FACTOR_ZERO;
RT0.BlendOpAlpha = BLEND_OPERATION_ADD;
RT0.RenderTargetWriteMask = COLOR_MASK_ALL;
LayoutElement VSInputs[] //
{
{0, 0, 2, VT_FLOAT32}, // pos
{1, 0, 2, VT_FLOAT32}, // uv
{2, 0, 4, VT_UINT8, True} // col
};
GraphicsPipeline.InputLayout.NumElements = _countof(VSInputs);
GraphicsPipeline.InputLayout.LayoutElements = VSInputs;
ShaderResourceVariableDesc Variables[] =
{
{SHADER_TYPE_PIXEL, "Texture", SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE} //
};
PSODesc.ResourceLayout.Variables = Variables;
PSODesc.ResourceLayout.NumVariables = _countof(Variables);
SamplerDesc SamLinearWrap;
SamLinearWrap.AddressU = TEXTURE_ADDRESS_WRAP;
SamLinearWrap.AddressV = TEXTURE_ADDRESS_WRAP;
SamLinearWrap.AddressW = TEXTURE_ADDRESS_WRAP;
StaticSamplerDesc StaticSamplers[] =
{
{SHADER_TYPE_PIXEL, "Texture", SamLinearWrap} //
};
PSODesc.ResourceLayout.StaticSamplers = StaticSamplers;
PSODesc.ResourceLayout.NumStaticSamplers = _countof(StaticSamplers);
m_pDevice->CreatePipelineState(PSODesc, &m_pPSO);
{
BufferDesc BuffDesc;
BuffDesc.uiSizeInBytes = sizeof(float4x4);
BuffDesc.Usage = USAGE_DYNAMIC;
BuffDesc.BindFlags = BIND_UNIFORM_BUFFER;
BuffDesc.CPUAccessFlags = CPU_ACCESS_WRITE;
m_pDevice->CreateBuffer(BuffDesc, nullptr, &m_pVertexConstantBuffer);
}
m_pPSO->GetStaticVariableByName(SHADER_TYPE_VERTEX, "Constants")->Set(m_pVertexConstantBuffer);
CreateFontsTexture();
}
void ImGuiImplDiligent_Internal::CreateFontsTexture()
{
// Build texture atlas
ImGuiIO& io = ImGui::GetIO();
unsigned char* pixels = nullptr;
int width = 0, height = 0;
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
TextureDesc FontTexDesc;
FontTexDesc.Name = "Imgui font texture";
FontTexDesc.Type = RESOURCE_DIM_TEX_2D;
FontTexDesc.Width = static_cast<Uint32>(width);
FontTexDesc.Height = static_cast<Uint32>(height);
FontTexDesc.Format = TEX_FORMAT_RGBA8_UNORM;
FontTexDesc.BindFlags = BIND_SHADER_RESOURCE;
FontTexDesc.Usage = USAGE_STATIC;
TextureSubResData Mip0Data[] = {{pixels, FontTexDesc.Width * 4}};
TextureData InitData(Mip0Data, _countof(Mip0Data));
RefCntAutoPtr<ITexture> pFontTex;
m_pDevice->CreateTexture(FontTexDesc, &InitData, &pFontTex);
m_pFontSRV = pFontTex->GetDefaultView(TEXTURE_VIEW_SHADER_RESOURCE);
m_pSRB.Release();
m_pPSO->CreateShaderResourceBinding(&m_pSRB, true);
m_pSRB->GetVariableByName(SHADER_TYPE_PIXEL, "Texture")->Set(m_pFontSRV);
// Store our identifier
io.Fonts->TexID = (ImTextureID)m_pFontSRV;
}
void ImGuiImplDiligent_Internal::RenderDrawData(IDeviceContext* pCtx, ImDrawData* pDrawData)
{
// Avoid rendering when minimized
if (pDrawData->DisplaySize.x <= 0.0f || pDrawData->DisplaySize.y <= 0.0f)
return;
// Create and grow vertex/index buffers if needed
if (!m_pVB || static_cast<int>(m_VertexBufferSize) < pDrawData->TotalVtxCount)
{
m_pVB.Release();
while (static_cast<int>(m_VertexBufferSize) < pDrawData->TotalVtxCount)
m_VertexBufferSize *= 2;
BufferDesc VBDesc;
VBDesc.Name = "Imgui vertex buffer";
VBDesc.BindFlags = BIND_VERTEX_BUFFER;
VBDesc.uiSizeInBytes = m_VertexBufferSize * sizeof(ImDrawVert);
VBDesc.Usage = USAGE_DYNAMIC;
VBDesc.CPUAccessFlags = CPU_ACCESS_WRITE;
m_pDevice->CreateBuffer(VBDesc, nullptr, &m_pVB);
}
if (!m_pIB || static_cast<int>(m_IndexBufferSize) < pDrawData->TotalIdxCount)
{
m_pIB.Release();
while (static_cast<int>(m_IndexBufferSize) < pDrawData->TotalIdxCount)
m_IndexBufferSize *= 2;
BufferDesc IBDesc;
IBDesc.Name = "Imgui index buffer";
IBDesc.BindFlags = BIND_INDEX_BUFFER;
IBDesc.uiSizeInBytes = m_IndexBufferSize * sizeof(ImDrawIdx);
IBDesc.Usage = USAGE_DYNAMIC;
IBDesc.CPUAccessFlags = CPU_ACCESS_WRITE;
m_pDevice->CreateBuffer(IBDesc, nullptr, &m_pIB);
}
{
MapHelper<ImDrawVert> Verices(pCtx, m_pVB, MAP_WRITE, MAP_FLAG_DISCARD);
MapHelper<ImDrawIdx> Indices(pCtx, m_pIB, MAP_WRITE, MAP_FLAG_DISCARD);
ImDrawVert* vtx_dst = Verices;
ImDrawIdx* idx_dst = Indices;
for (int n = 0; n < pDrawData->CmdListsCount; n++)
{
const ImDrawList* cmd_list = pDrawData->CmdLists[n];
memcpy(vtx_dst, cmd_list->VtxBuffer.Data, cmd_list->VtxBuffer.Size * sizeof(ImDrawVert));
memcpy(idx_dst, cmd_list->IdxBuffer.Data, cmd_list->IdxBuffer.Size * sizeof(ImDrawIdx));
vtx_dst += cmd_list->VtxBuffer.Size;
idx_dst += cmd_list->IdxBuffer.Size;
}
}
// Setup orthographic projection matrix into our constant buffer
// Our visible imgui space lies from pDrawData->DisplayPos (top left) to pDrawData->DisplayPos+data_data->DisplaySize (bottom right).
// DisplayPos is (0,0) for single viewport apps.
{
MapHelper<float4x4> CBData(pCtx, m_pVertexConstantBuffer, MAP_WRITE, MAP_FLAG_DISCARD);
float L = pDrawData->DisplayPos.x;
float R = pDrawData->DisplayPos.x + pDrawData->DisplaySize.x;
float T = pDrawData->DisplayPos.y;
float B = pDrawData->DisplayPos.y + pDrawData->DisplaySize.y;
// clang-format off
*CBData = float4x4
{
2.0f / (R - L), 0.0f, 0.0f, 0.0f,
0.0f, 2.0f / (T - B), 0.0f, 0.0f,
0.0f, 0.0f, 0.5f, 0.0f,
(R + L) / (L - R), (T + B) / (B - T), 0.5f, 1.0f
};
// clang-format on
}
auto DisplayWidth = static_cast<Uint32>(pDrawData->DisplaySize.x);
auto DisplayHeight = static_cast<Uint32>(pDrawData->DisplaySize.y);
auto SetupRenderState = [&]() //
{
// Setup shader and vertex buffers
Uint32 Offsets[] = {0};
IBuffer* pVBs[] = {m_pVB};
pCtx->SetVertexBuffers(0, 1, pVBs, Offsets, RESOURCE_STATE_TRANSITION_MODE_TRANSITION, SET_VERTEX_BUFFERS_FLAG_RESET);
pCtx->SetIndexBuffer(m_pIB, 0, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
pCtx->SetPipelineState(m_pPSO);
pCtx->CommitShaderResources(m_pSRB, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
const float blend_factor[4] = {0.f, 0.f, 0.f, 0.f};
pCtx->SetBlendFactors(blend_factor);
Viewport vp;
vp.Width = pDrawData->DisplaySize.x;
vp.Height = pDrawData->DisplaySize.y;
vp.MinDepth = 0.0f;
vp.MaxDepth = 1.0f;
vp.TopLeftX = vp.TopLeftY = 0;
pCtx->SetViewports(1, &vp, DisplayWidth, DisplayHeight);
};
SetupRenderState();
// Render command lists
// (Because we merged all buffers into a single one, we maintain our own offset into them)
int global_idx_offset = 0;
int global_vtx_offset = 0;
ImVec2 clip_off = pDrawData->DisplayPos;
for (int n = 0; n < pDrawData->CmdListsCount; n++)
{
const ImDrawList* cmd_list = pDrawData->CmdLists[n];
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
{
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
if (pcmd->UserCallback != NULL)
{
// User callback, registered via ImDrawList::AddCallback()
// (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
SetupRenderState();
else
pcmd->UserCallback(cmd_list, pcmd);
}
else
{
// Apply scissor/clipping rectangle
const Rect r =
{
static_cast<Int32>(pcmd->ClipRect.x - clip_off.x),
static_cast<Int32>(pcmd->ClipRect.y - clip_off.y),
static_cast<Int32>(pcmd->ClipRect.z - clip_off.x),
static_cast<Int32>(pcmd->ClipRect.w - clip_off.y) //
};
pCtx->SetScissorRects(1, &r, DisplayWidth, DisplayHeight);
// Bind texture, Draw
auto* texture_srv = reinterpret_cast<ITextureView*>(pcmd->TextureId);
VERIFY_EXPR(texture_srv == m_pFontSRV);
(void)texture_srv;
//ctx->PSSetShaderResources(0, 1, &texture_srv);
DrawIndexedAttribs DrawAttrs(pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? VT_UINT16 : VT_UINT32, DRAW_FLAG_VERIFY_STATES);
DrawAttrs.FirstIndexLocation = pcmd->IdxOffset + global_idx_offset;
DrawAttrs.BaseVertex = pcmd->VtxOffset + global_vtx_offset;
pCtx->DrawIndexed(DrawAttrs);
}
}
global_idx_offset += cmd_list->IdxBuffer.Size;
global_vtx_offset += cmd_list->VtxBuffer.Size;
}
}
ImGuiImplDiligent::ImGuiImplDiligent(IRenderDevice* pDevice,
TEXTURE_FORMAT BackBufferFmt,
TEXTURE_FORMAT DepthBufferFmt,
Uint32 InitialVertexBufferSize,
Uint32 InitialIndexBufferSize) :
m_pImpl(new ImGuiImplDiligent_Internal(pDevice, BackBufferFmt, DepthBufferFmt, InitialVertexBufferSize, InitialIndexBufferSize))
{
}
ImGuiImplDiligent::~ImGuiImplDiligent()
{
}
void ImGuiImplDiligent::NewFrame()
{
m_pImpl->NewFrame();
ImGui::NewFrame();
}
void ImGuiImplDiligent::EndFrame()
{
ImGui::EndFrame();
}
void ImGuiImplDiligent::Render(IDeviceContext* pCtx)
{
// No need to call ImGui::EndFrame as ImGui::Render calls it automatically
ImGui::Render();
m_pImpl->RenderDrawData(pCtx, ImGui::GetDrawData());
}
// Use if you want to reset your rendering device without losing ImGui state.
void ImGuiImplDiligent::InvalidateDeviceObjects()
{
m_pImpl->InvalidateDeviceObjects();
}
void ImGuiImplDiligent::CreateDeviceObjects()
{
m_pImpl->CreateDeviceObjects();
}
void ImGuiImplDiligent::UpdateFontsTexture()
{
m_pImpl->CreateFontsTexture();
}
} // namespace Diligent
| 35.645963 | 144 | 0.644595 | [
"render"
] |
8aed3ccfcad6b04afa4d880ecf3a3b28abb04d85 | 19,981 | cpp | C++ | src/plugins/extra/entities/opensubdiv.cpp | PearCoding/PearRay | 8654a7dcd55cc67859c7c057c7af64901bf97c35 | [
"MIT"
] | 19 | 2016-11-07T00:01:19.000Z | 2021-12-29T05:35:14.000Z | src/plugins/extra/entities/opensubdiv.cpp | PearCoding/PearRay | 8654a7dcd55cc67859c7c057c7af64901bf97c35 | [
"MIT"
] | 33 | 2016-07-06T21:58:05.000Z | 2020-08-01T18:18:24.000Z | src/plugins/extra/entities/opensubdiv.cpp | PearCoding/PearRay | 8654a7dcd55cc67859c7c057c7af64901bf97c35 | [
"MIT"
] | null | null | null | #include "Environment.h"
#include "Logger.h"
#include "Profiler.h"
#include "ResourceManager.h"
#include "SceneLoadContext.h"
#include "cache/Cache.h"
#include "emission/IEmission.h"
#include "entity/IEntity.h"
#include "entity/IEntityPlugin.h"
#include "geometry/CollisionData.h"
#include "material/IMaterial.h"
#include "mesh/MeshFactory.h"
#include <filesystem>
#include <cctype>
#include <opensubdiv/far/stencilTableFactory.h>
#include <opensubdiv/far/topologyDescriptor.h>
#include <opensubdiv/osd/cpuEvaluator.h>
#include <opensubdiv/osd/cpuVertexBuffer.h>
#ifdef OPENSUBDIV_HAS_OPENMP
#include <opensubdiv/osd/ompEvaluator.h>
#endif
#ifdef OPENSUBDIV_HAS_TBB
#include <opensubdiv/osd/tbbEvaluator.h>
#endif
namespace PR {
class SubdivMeshEntity : public IEntity {
public:
ENTITY_CLASS
SubdivMeshEntity(uint32 id, const std::string& name,
const std::shared_ptr<Mesh>& mesh,
const std::vector<uint32>& materials,
int32 lightID)
: IEntity(id, name)
, mLightID(lightID)
, mMaterials(materials)
, mMesh(mesh)
{
}
virtual ~SubdivMeshEntity() {}
std::string type() const override
{
return "subdivmesh";
}
bool hasEmission() const override
{
return mLightID >= 0;
}
float localSurfaceArea(uint32 id) const override
{
return mMesh->localSurfaceArea(id);
}
bool isCollidable() const override
{
return mMesh->isCollidable();
}
float collisionCost() const override
{
return mMesh->collisionCost();
}
BoundingBox localBoundingBox() const override
{
return mMesh->localBoundingBox();
}
void checkCollision(const RayPackage& in, CollisionOutput& out) const override
{
PR_PROFILE_THIS;
auto in_local = in.transformAffine(invTransform().matrix(), invTransform().linear());
mMesh->checkCollision(in_local, out);
// out.FaceID is set inside mesh
out.HitDistance = in_local.transformDistance(out.HitDistance,
transform().linear());
out.EntityID = simdpp::make_uint(id());
for (size_t i = 0; i < PR_SIMD_BANDWIDTH; ++i) {
insert(i, out.MaterialID,
extract(i, out.MaterialID) < mMaterials.size()
? mMaterials.at(extract(i, out.MaterialID))
: 0);
}
}
void checkCollision(const Ray& in, HitPoint& out) const override
{
PR_PROFILE_THIS;
auto in_local = in.transformAffine(invTransform().matrix(), invTransform().linear());
mMesh->checkCollision(in_local, out);
// out.FaceID is set inside mesh
out.HitDistance = in_local.transformDistance(out.HitDistance,
transform().linear());
out.EntityID = id();
out.MaterialID = out.MaterialID < mMaterials.size()
? mMaterials.at(out.MaterialID)
: 0;
}
Vector3f pickRandomParameterPoint(const Vector3f& /*view*/, const Vector2f& rnd,
uint32& faceID, float& pdf) const override
{
PR_PROFILE_THIS;
return mMesh->pickRandomParameterPoint(rnd, faceID, pdf);
}
void provideGeometryPoint(const Vector3f&, uint32 faceID, const Vector3f& parameter,
GeometryPoint& pt) const override
{
PR_PROFILE_THIS;
mMesh->provideGeometryPoint(faceID, parameter, pt);
// Global
pt.P = transform() * pt.P;
pt.N = normalMatrix() * pt.N;
pt.Nx = normalMatrix() * pt.Nx;
pt.Ny = normalMatrix() * pt.Ny;
pt.N.normalize();
pt.Nx.normalize();
pt.Ny.normalize();
pt.MaterialID = pt.MaterialID < mMaterials.size()
? mMaterials.at(pt.MaterialID)
: 0;
pt.EmissionID = mLightID;
pt.DisplaceID = 0;
}
private:
int32 mLightID;
std::vector<uint32> mMaterials;
std::shared_ptr<Mesh> mMesh;
};
enum OpenSubdivComputationMode {
OSCM_CPU = 0,
OSCM_OPENMP,
OSCM_TBB
};
using namespace OpenSubdiv;
struct SubdivisionOptions {
int MaxLevel = 4;
bool Adaptive = false;
int Scheme = Sdc::SCHEME_CATMARK;
int BoundaryInterpolation = Sdc::Options::VTX_BOUNDARY_EDGE_ONLY;
int FVarInterpolation = Sdc::Options::FVAR_LINEAR_ALL;
int UVInterpolation = Far::StencilTableFactory::INTERPOLATE_VARYING;
bool LimitNormals = true;
OpenSubdivComputationMode ComputationMode = OSCM_OPENMP;
};
class SubdivMeshEntityPlugin : public IEntityPlugin {
public:
Far::TopologyDescriptor::FVarChannel fvarChannels[1];
std::vector<uint32> fvarIndices;
Far::TopologyRefiner* setupRefiner(const MeshBase* originalMesh, const SubdivisionOptions& opts)
{
PR_PROFILE_THIS;
auto vertsPerFace = originalMesh->faceVertexCounts();
const auto& indices = originalMesh->indices();
Far::TopologyDescriptor desc;
desc.numFaces = static_cast<int>(originalMesh->faceCount());
desc.numVertices = static_cast<int>(originalMesh->nodeCount());
desc.numVertsPerFace = (const int*)vertsPerFace.data();
desc.vertIndicesPerFace = (const Far::Index*)indices.data();
static_assert(sizeof(uint32) == sizeof(int) && sizeof(uint32) == sizeof(Far::Index),
"Above code is depending on it. (Maybe fix it!)");
if (originalMesh->features() & MF_HAS_MATERIAL) {
fvarIndices.clear();
fvarIndices.reserve(originalMesh->indices().size());
for (size_t f = 0; f < originalMesh->faceCount(); ++f) {
size_t elems = originalMesh->faceVertexCount(f);
for (size_t i = 0; i < elems; ++i)
fvarIndices.push_back(static_cast<uint32>(f));
}
PR_ASSERT(originalMesh->indices().size() == fvarIndices.size(), "Invalid index calculation");
fvarChannels[0].numValues = static_cast<int>(fvarIndices.size());
fvarChannels[0].valueIndices = (const Far::Index*)fvarIndices.data();
desc.numFVarChannels = 1;
desc.fvarChannels = fvarChannels;
}
Sdc::Options sdc_options;
sdc_options.SetVtxBoundaryInterpolation((Sdc::Options::VtxBoundaryInterpolation)opts.BoundaryInterpolation);
sdc_options.SetFVarLinearInterpolation((Sdc::Options::FVarLinearInterpolation)opts.FVarInterpolation);
Far::TopologyRefiner* refiner = Far::TopologyRefinerFactory<Far::TopologyDescriptor>::Create(
desc,
Far::TopologyRefinerFactory<Far::TopologyDescriptor>::Options((Sdc::SchemeType)opts.Scheme, sdc_options));
if (!opts.Adaptive) {
Far::TopologyRefiner::UniformOptions ref_opts(opts.MaxLevel);
ref_opts.fullTopologyInLastLevel = true;
refiner->RefineUniform(ref_opts);
} else {
Far::TopologyRefiner::AdaptiveOptions ref_opts(opts.MaxLevel);
//ref_opts.orderVerticesFromFacesFirst = true;
ref_opts.useSingleCreasePatch = false;
ref_opts.considerFVarChannels = (originalMesh->features() & MF_HAS_MATERIAL);
refiner->RefineAdaptive(ref_opts);
}
return refiner;
}
// TODO
/*Far::LimitStencilTable const* setupLimitStencilTable(Far::TopologyRefiner* refiner, int interp)
{
Far::LimitStencilTableFactory::Options stencil_options;
stencil_options.interpolationMode = interp;
stencil_options.generate1stDerivatives = true;
stencil_options.generate2ndDerivatives = false;
//return Far::LimitStencilTableFactory::Create(*refiner, stencil_options);
return nullptr;
}*/
Far::StencilTable const* setupStencilTable(Far::TopologyRefiner* refiner, int interp)
{
Far::StencilTableFactory::Options stencil_options;
stencil_options.generateIntermediateLevels = false;
stencil_options.generateOffsets = true;
stencil_options.interpolationMode = interp;
return Far::StencilTableFactory::Create(*refiner, stencil_options);
}
Osd::CpuVertexBuffer* refineData(const float* source, int elems,
int coarseElems, int refElems,
OpenSubdivComputationMode mode,
Far::StencilTable const* stencilTable,
Osd::CpuVertexBuffer** limit = nullptr)
{
Osd::BufferDescriptor srcDesc(0, elems, elems);
Osd::CpuVertexBuffer* srcbuffer = Osd::CpuVertexBuffer::Create(elems, coarseElems);
srcbuffer->UpdateData(source, 0, coarseElems);
Osd::BufferDescriptor dstDesc(0, elems, elems);
Osd::CpuVertexBuffer* dstbuffer = Osd::CpuVertexBuffer::Create(elems, refElems);
if (limit) {
limit[0] = Osd::CpuVertexBuffer::Create(elems, refElems);
limit[1] = Osd::CpuVertexBuffer::Create(elems, refElems);
switch (mode) {
default:
case OSCM_CPU:
Osd::CpuEvaluator::EvalStencils(srcbuffer, srcDesc, dstbuffer, dstDesc, limit[0], dstDesc, limit[1], dstDesc, (Far::LimitStencilTable const*)stencilTable);
break;
#if defined(OPENSUBDIV_HAS_OPENMP)
case OSCM_OPENMP:
Osd::OmpEvaluator::EvalStencils(srcbuffer, srcDesc, dstbuffer, dstDesc, limit[0], dstDesc, limit[1], dstDesc, (Far::LimitStencilTable const*)stencilTable);
break;
#endif
#if defined(OPENSUBDIV_HAS_TBB)
case OSCM_TBB:
Osd::TbbEvaluator::EvalStencils(srcbuffer, srcDesc, dstbuffer, dstDesc, limit[0], dstDesc, limit[1], dstDesc, (Far::LimitStencilTable const*)stencilTable);
break;
#endif
}
} else {
switch (mode) {
default:
case OSCM_CPU:
Osd::CpuEvaluator::EvalStencils(srcbuffer, srcDesc, dstbuffer, dstDesc, stencilTable);
break;
#if defined(OPENSUBDIV_HAS_OPENMP)
case OSCM_OPENMP:
Osd::OmpEvaluator::EvalStencils(srcbuffer, srcDesc, dstbuffer, dstDesc, stencilTable);
break;
#endif
#if defined(OPENSUBDIV_HAS_TBB)
case OSCM_TBB:
Osd::TbbEvaluator::EvalStencils(srcbuffer, srcDesc, dstbuffer, dstDesc, stencilTable);
break;
#endif
}
}
delete srcbuffer;
return dstbuffer;
}
void refineVertexData(const MeshBase* originalMesh,
std::unique_ptr<MeshBase>& refineMesh,
OpenSubdivComputationMode mode,
Far::TopologyRefiner* refiner,
Far::StencilTable const* stencilTable)
{
PR_PROFILE_THIS;
int coarseElems = refiner->GetLevel(0).GetNumVertices();
int refElems = refiner->GetLevel(refiner->GetMaxLevel()).GetNumVertices();
Osd::CpuVertexBuffer* buffer = refineData(originalMesh->vertices().data(), 3, coarseElems, refElems, mode, stencilTable);
std::vector<float> dstVerts(3 * refiner->GetLevel(refiner->GetMaxLevel()).GetNumVertices());
memcpy(dstVerts.data(), buffer->BindCpuBuffer(), sizeof(float) * dstVerts.size());
refineMesh->setVertices(dstVerts);
delete buffer;
}
void refineUVData(const MeshBase* originalMesh,
std::unique_ptr<MeshBase>& refineMesh,
OpenSubdivComputationMode mode,
Far::TopologyRefiner* refiner,
Far::StencilTable const* stencilTable)
{
PR_PROFILE_THIS;
int coarseElems = refiner->GetLevel(0).GetNumVertices();
int refElems = refiner->GetLevel(refiner->GetMaxLevel()).GetNumVertices();
Osd::CpuVertexBuffer* buffer = refineData(originalMesh->uvs().data(), 2, coarseElems, refElems, mode, stencilTable);
std::vector<float> dstVerts(2 * refiner->GetLevel(refiner->GetMaxLevel()).GetNumVertices());
memcpy(dstVerts.data(), buffer->BindCpuBuffer(), sizeof(float) * dstVerts.size());
refineMesh->setUVs(dstVerts);
delete buffer;
}
// TODO: Check
void refineVelocityData(const MeshBase* originalMesh,
std::unique_ptr<MeshBase>& refineMesh,
OpenSubdivComputationMode mode,
Far::TopologyRefiner* refiner,
Far::StencilTable const* stencilTable)
{
PR_PROFILE_THIS;
int coarseElems = refiner->GetLevel(0).GetNumVertices();
int refElems = refiner->GetLevel(refiner->GetMaxLevel()).GetNumVertices();
Osd::CpuVertexBuffer* buffer = refineData(originalMesh->velocities().data(), 3, coarseElems, refElems, mode, stencilTable);
std::vector<float> dstVerts(3 * refiner->GetLevel(refiner->GetMaxLevel()).GetNumVertices());
memcpy(dstVerts.data(), buffer->BindCpuBuffer(), sizeof(float) * dstVerts.size());
refineMesh->setVelocities(dstVerts);
delete buffer;
}
// Approach without all convert buffers possible?
void refineMaterialData(const MeshBase* originalMesh,
std::unique_ptr<MeshBase>& refineMesh,
OpenSubdivComputationMode mode,
Far::TopologyRefiner* refiner,
Far::StencilTable const* stencilTable)
{
PR_PROFILE_THIS;
Far::TopologyLevel const& refLevel = refiner->GetLevel(refiner->GetMaxLevel());
//int coarseElems = refiner->GetLevel(0).GetNumFVarValues();
int refElems = refLevel.GetNumFVarValues();
std::vector<float> slotsAsFloat(originalMesh->faceCount());
uint32 max = 0;
for (size_t i = 0; i < slotsAsFloat.size(); ++i) {
uint32 v = originalMesh->materialSlot(i);
max = std::max(max, v);
slotsAsFloat[i] = static_cast<float>(v);
}
Osd::CpuVertexBuffer* buffer = refineData(slotsAsFloat.data(), 1, (int)slotsAsFloat.size(), refElems, mode, stencilTable);
const float* dstVerts = buffer->BindCpuBuffer();
std::vector<uint32> slots(refineMesh->faceCount());
for (size_t i = 0; i < slots.size(); ++i) {
Far::ConstIndexArray fverts = refLevel.GetFaceFVarValues(static_cast<Far::Index>(i));
PR_ASSERT(fverts.size() > 0, "Invalid return by GetFaceFVarValues");
slots[i] = std::min(max, std::max(0u, static_cast<uint32>(std::floor(dstVerts[fverts[0]]))));
}
refineMesh->setMaterialSlots(slots);
delete buffer;
}
std::unique_ptr<MeshBase> refineMesh(const MeshBase* originalMesh, const SubdivisionOptions& opts)
{
PR_PROFILE_THIS;
PR_ASSERT(opts.MaxLevel >= 1, "No refinement done!");
Far::TopologyRefiner* refiner = setupRefiner(originalMesh, opts);
Far::StencilTable const* stencilTable = setupStencilTable(refiner, Far::StencilTableFactory::INTERPOLATE_VERTEX);
Far::StencilTable const* uvStencilTable = stencilTable;
if ((originalMesh->features() & MF_HAS_UV) && opts.UVInterpolation != Far::StencilTableFactory::INTERPOLATE_VERTEX)
uvStencilTable = setupStencilTable(refiner, opts.UVInterpolation);
Far::StencilTable const* fvarStencilTable = (originalMesh->features() & MF_HAS_MATERIAL)
? setupStencilTable(refiner, Far::StencilTableFactory::INTERPOLATE_FACE_VARYING)
: nullptr;
Far::TopologyLevel const& refLevel = refiner->GetLevel(refiner->GetMaxLevel());
std::vector<uint32> new_indices(refLevel.GetNumFaceVertices());
std::vector<uint8> new_vertsPerFace(refLevel.GetNumFaces());
PR_LOG(L_INFO) << "Subdivision(L=" << opts.MaxLevel << "/" << refiner->GetMaxLevel() << ") [V=" << originalMesh->nodeCount() << " F=" << originalMesh->faceCount() << " I=" << originalMesh->indices().size()
<< "] -> [V=" << refLevel.GetNumVertices() << " F=" << new_vertsPerFace.size() << " I=" << new_indices.size() << "]" << std::endl;
size_t indC = 0;
for (int face = 0; face < refLevel.GetNumFaces(); ++face) {
Far::ConstIndexArray fverts = refLevel.GetFaceVertices(face);
new_vertsPerFace[face] = fverts.size();
for (int i = 0; i < fverts.size(); ++i)
new_indices[indC++] = fverts[i];
}
PR_ASSERT(indC == new_indices.size(), "Invalid subdivision calculation");
// Setup mesh
std::unique_ptr<MeshBase> refineMesh = std::make_unique<MeshBase>();
refineMesh->setIndices(new_indices);
refineMesh->setFaceVertexCount(new_vertsPerFace);
refineVertexData(originalMesh, refineMesh, opts.ComputationMode, refiner, stencilTable);
// TODO: Add normals based on limit
refineMesh->buildNormals();
if (originalMesh->features() & MF_HAS_UV)
refineUVData(originalMesh, refineMesh, opts.ComputationMode, refiner, uvStencilTable);
if (originalMesh->features() & MF_HAS_MATERIAL)
refineMaterialData(originalMesh, refineMesh, opts.ComputationMode, refiner, fvarStencilTable);
if (originalMesh->features() & MF_HAS_VELOCITY)
refineVelocityData(originalMesh, refineMesh, opts.ComputationMode, refiner, stencilTable);
// Remove buffers
std::vector<uint32> null;
fvarIndices.swap(null);
delete refiner;
if (stencilTable != uvStencilTable)
delete uvStencilTable;
delete stencilTable;
if (fvarStencilTable)
delete fvarStencilTable;
return refineMesh;
}
std::shared_ptr<IEntity> create(uint32 id, const std::string&, const SceneLoadContext& ctx)
{
const ParameterGroup& params = ctx.parameters();
std::string name = params.getString("name", "__unnamed__");
std::string mesh_name = params.getString("mesh", "");
std::vector<std::string> matNames = params.getStringArray("materials");
std::vector<uint32> materials;
for (std::string n : matNames) {
std::shared_ptr<IMaterial> mat = ctx.Env->getMaterial(n);
if (mat)
materials.push_back(mat->id());
}
std::string emsName = params.getString("emission", "");
int32 emsID = -1;
std::shared_ptr<IEmission> ems = ctx.Env->getEmission(emsName);
if (ems)
emsID = ems->id();
SubdivisionOptions opts;
opts.MaxLevel = std::max(1, (int)params.getInt("max_level", opts.MaxLevel));
opts.Adaptive = params.getBool("adaptive", opts.Adaptive);
std::string scheme = params.getString("scheme", "");
std::string boundaryInterpolation = params.getString("boundary_interpolation", "");
std::string uvInterpolation = params.getString("uv_interpolation", "");
std::string fVarInterpolation = params.getString("fvar_interpolation", "");
// Scheme
std::transform(scheme.begin(), scheme.end(), scheme.begin(), ::tolower);
if (scheme == "catmark")
opts.Scheme = Sdc::SCHEME_CATMARK;
else if (scheme == "bilinear")
opts.Scheme = Sdc::SCHEME_BILINEAR;
else if (scheme == "loop")
opts.Scheme = Sdc::SCHEME_LOOP;
// Boundary Interpolation
std::transform(boundaryInterpolation.begin(), boundaryInterpolation.end(), boundaryInterpolation.begin(), ::tolower);
if (boundaryInterpolation == "none")
opts.BoundaryInterpolation = Sdc::Options::VTX_BOUNDARY_NONE;
else if (boundaryInterpolation == "edge_only")
opts.BoundaryInterpolation = Sdc::Options::VTX_BOUNDARY_EDGE_ONLY;
else if (boundaryInterpolation == "edge_and_corner")
opts.BoundaryInterpolation = Sdc::Options::VTX_BOUNDARY_EDGE_AND_CORNER;
// FVar Interpolation
std::transform(fVarInterpolation.begin(), fVarInterpolation.end(), fVarInterpolation.begin(), ::tolower);
if (fVarInterpolation == "none")
opts.FVarInterpolation = Sdc::Options::FVAR_LINEAR_NONE;
else if (fVarInterpolation == "corners_only")
opts.FVarInterpolation = Sdc::Options::FVAR_LINEAR_CORNERS_ONLY;
else if (fVarInterpolation == "corners_plus1")
opts.FVarInterpolation = Sdc::Options::FVAR_LINEAR_CORNERS_PLUS1;
else if (fVarInterpolation == "corners_plus2")
opts.FVarInterpolation = Sdc::Options::FVAR_LINEAR_CORNERS_PLUS2;
else if (fVarInterpolation == "boundaries")
opts.FVarInterpolation = Sdc::Options::FVAR_LINEAR_BOUNDARIES;
else if (fVarInterpolation == "all")
opts.FVarInterpolation = Sdc::Options::FVAR_LINEAR_ALL;
// UV Interpolation
std::transform(uvInterpolation.begin(), uvInterpolation.end(), uvInterpolation.begin(), ::tolower);
if (uvInterpolation == "vertex")
opts.UVInterpolation = Far::StencilTableFactory::INTERPOLATE_VERTEX;
else if (uvInterpolation == "varying")
opts.UVInterpolation = Far::StencilTableFactory::INTERPOLATE_VARYING;
std::shared_ptr<Mesh> mesh = ctx.Env->getMesh(mesh_name);
if (opts.MaxLevel < 1) {
return std::make_shared<SubdivMeshEntity>(id, name,
mesh,
materials, emsID);
}
MeshBase* originalMesh = mesh->base_unsafe();
if (!originalMesh)
return nullptr;
if (!originalMesh->isValid()) {
PR_LOG(L_ERROR) << "Mesh " << mesh_name << " is invalid." << std::endl;
return nullptr;
}
if (opts.Scheme == Sdc::SCHEME_LOOP) // Scheme Loop accepts triangle data only
originalMesh->triangulate();
std::unique_ptr<MeshBase> refinedMesh = refineMesh(originalMesh, opts);
refinedMesh->triangulate();
bool useCache = mesh->cache()->shouldCacheMesh(refinedMesh->nodeCount());
std::shared_ptr<Mesh> newMesh = MeshFactory::create(mesh->name() + "_subdiv", std::move(refinedMesh),
mesh->cache(), useCache);
return std::make_shared<SubdivMeshEntity>(id, name,
newMesh,
materials, emsID);
}
const std::vector<std::string>& getNames() const
{
static std::vector<std::string> names({ "opensubdiv" });
return names;
}
bool init()
{
return true;
}
};
} // namespace PR
PR_PLUGIN_INIT(PR::SubdivMeshEntityPlugin, _PR_PLUGIN_NAME, PR_PLUGIN_VERSION) | 34.629116 | 207 | 0.716681 | [
"mesh",
"geometry",
"vector",
"transform"
] |
8af8952196d060ccf38c119c0589a25adaa0707d | 4,337 | cc | C++ | components/ntp_snippets/contextual/contextual_suggestions_ukm_entry_unittest.cc | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | components/ntp_snippets/contextual/contextual_suggestions_ukm_entry_unittest.cc | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | components/ntp_snippets/contextual/contextual_suggestions_ukm_entry_unittest.cc | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/ntp_snippets/contextual/contextual_suggestions_ukm_entry.h"
#include "base/macros.h"
#include "base/test/scoped_task_environment.h"
#include "components/ntp_snippets/contextual/contextual_suggestions_metrics_reporter.h"
#include "components/ukm/test_ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "testing/gtest/include/gtest/gtest.h"
using ukm::TestUkmRecorder;
using ukm::builders::ContextualSuggestions;
namespace contextual_suggestions {
const int NO_ENTRY = -1;
class ContextualSuggestionsUkmEntryTest : public ::testing::Test {
protected:
ContextualSuggestionsUkmEntryTest() = default;
void SetUp() override;
// The entry under test.
std::unique_ptr<ContextualSuggestionsUkmEntry> ukm_entry_;
TestUkmRecorder* GetTestUkmRecorder() { return &test_ukm_recorder_; }
const ukm::mojom::UkmEntry* FirstEntry();
bool HasEntryMetric(const char* metric_name);
int GetEntryMetric(const char* metric_name);
private:
// Sets up the task scheduling/task-runner environment for each test.
base::test::ScopedTaskEnvironment scoped_task_environment_;
// Sets itself as the global UkmRecorder on construction.
ukm::TestAutoSetUkmRecorder test_ukm_recorder_;
DISALLOW_COPY_AND_ASSIGN(ContextualSuggestionsUkmEntryTest);
};
void ContextualSuggestionsUkmEntryTest::SetUp() {
ukm_entry_.reset(
new ContextualSuggestionsUkmEntry(ukm::UkmRecorder::GetNewSourceID()));
}
const ukm::mojom::UkmEntry* ContextualSuggestionsUkmEntryTest::FirstEntry() {
TestUkmRecorder* recorder = GetTestUkmRecorder();
std::vector<const ukm::mojom::UkmEntry*> entry_vector =
recorder->GetEntriesByName(ContextualSuggestions::kEntryName);
EXPECT_EQ(1U, entry_vector.size());
return entry_vector[0];
}
bool ContextualSuggestionsUkmEntryTest::HasEntryMetric(
const char* metric_name) {
TestUkmRecorder* recorder = GetTestUkmRecorder();
return recorder->EntryHasMetric(FirstEntry(), metric_name);
}
int ContextualSuggestionsUkmEntryTest::GetEntryMetric(const char* metric_name) {
TestUkmRecorder* recorder = GetTestUkmRecorder();
const ukm::mojom::UkmEntry* first_entry = FirstEntry();
if (!recorder->EntryHasMetric(first_entry, metric_name))
return NO_ENTRY;
return (int)*(recorder->GetEntryMetric(first_entry, metric_name));
}
TEST_F(ContextualSuggestionsUkmEntryTest, BaseTest) {
ukm_entry_->Flush();
// Deleting the entry should write default values for everything.
EXPECT_EQ(0, GetEntryMetric(ContextualSuggestions::kAnyDownloadedName));
EXPECT_EQ(0, GetEntryMetric(ContextualSuggestions::kAnySuggestionTakenName));
EXPECT_EQ(0, GetEntryMetric(ContextualSuggestions::kClosedFromPeekName));
EXPECT_EQ(0, GetEntryMetric(ContextualSuggestions::kEverOpenedName));
EXPECT_EQ(0, GetEntryMetric(ContextualSuggestions::kFetchStateName));
EXPECT_EQ(0,
GetEntryMetric(ContextualSuggestions::kShowDurationBucketMinName));
EXPECT_EQ(0, GetEntryMetric(ContextualSuggestions::kTriggerEventName));
}
TEST_F(ContextualSuggestionsUkmEntryTest, ExpectedOperationTest) {
ukm_entry_->RecordEventMetrics(FETCH_DELAYED);
ukm_entry_->RecordEventMetrics(FETCH_REQUESTED);
ukm_entry_->RecordEventMetrics(FETCH_COMPLETED);
ukm_entry_->RecordEventMetrics(UI_PEEK_REVERSE_SCROLL);
ukm_entry_->RecordEventMetrics(UI_OPENED);
ukm_entry_->RecordEventMetrics(SUGGESTION_DOWNLOADED);
ukm_entry_->RecordEventMetrics(SUGGESTION_DOWNLOADED);
ukm_entry_->RecordEventMetrics(SUGGESTION_CLICKED);
ukm_entry_->Flush();
EXPECT_EQ(1, GetEntryMetric(ContextualSuggestions::kAnyDownloadedName));
EXPECT_EQ(1, GetEntryMetric(ContextualSuggestions::kAnySuggestionTakenName));
EXPECT_EQ(0, GetEntryMetric(ContextualSuggestions::kClosedFromPeekName));
EXPECT_EQ(1, GetEntryMetric(ContextualSuggestions::kEverOpenedName));
EXPECT_EQ(static_cast<int64_t>(FetchState::COMPLETED),
GetEntryMetric(ContextualSuggestions::kFetchStateName));
EXPECT_LT(0,
GetEntryMetric(ContextualSuggestions::kShowDurationBucketMinName));
EXPECT_EQ(1, GetEntryMetric(ContextualSuggestions::kTriggerEventName));
}
} // namespace contextual_suggestions
| 40.157407 | 87 | 0.801706 | [
"vector"
] |
8afcd6ac4f821feb1cfbff869afd9e73021a9e8b | 17,088 | cpp | C++ | Controller_AI_Rudra/src/Controller_AI_Rudra.cpp | Rudra-Trivedi/CrashLatest | 58de43e089786579d2db981d0ff1559fad245fd7 | [
"MIT"
] | null | null | null | Controller_AI_Rudra/src/Controller_AI_Rudra.cpp | Rudra-Trivedi/CrashLatest | 58de43e089786579d2db981d0ff1559fad245fd7 | [
"MIT"
] | null | null | null | Controller_AI_Rudra/src/Controller_AI_Rudra.cpp | Rudra-Trivedi/CrashLatest | 58de43e089786579d2db981d0ff1559fad245fd7 | [
"MIT"
] | null | null | null | // MIT License
//
// Copyright(c) 2020 Arthur Bacon and Kevin Dill
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this softwareand associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and /or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright noticeand this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include "Controller_AI_Rudra.h"
#include <cmath>
#include "/Game ai/New folder/CrashLoyal-master/Interface/src/Constants.h"
#include "/Game ai/New folder/CrashLoyal-master/Interface/src/EntityStats.h"
#include "/Game ai/New folder/CrashLoyal-master/Interface/src/iPlayer.h"
#include "/Game ai/New folder/CrashLoyal-master/Interface/src/Vec2.h"
// X for giant spawn area
static const float GiantLeftSpawnX = (LEFT_BRIDGE_CENTER_X);
static const float GiantRightSpawnX = (RIGHT_BRIDGE_CENTER_X );
// Y for giant spawn area
static const float GiantSpawnY = (RIVER_TOP_Y - 2.f);
// X for Knight Spawn
static const float KnightLeftSpawnX = (LEFT_BRIDGE_CENTER_X + BRIDGE_WIDTH + 1.f );
static const float KnightRightSpawnX = (RIGHT_BRIDGE_CENTER_X - BRIDGE_WIDTH - 1.f);
// Y for Knight Spawn
static const float KnightSpawnY = (RIVER_TOP_Y - 2.f);
// Archer spawn X
static const float ArcherLeftSpawnX = LEFT_BRIDGE_CENTER_X;
static const float ArcherRightSpawnX = RIGHT_BRIDGE_CENTER_X;
// Archer Spawn Y
static const float ArcherSpawnY = 0.f;
static const Vec2 ksGiantPos(LEFT_BRIDGE_CENTER_X, RIVER_TOP_Y - 5.f);
static const Vec2 ksArcherPos(LEFT_BRIDGE_CENTER_X, 0.f);
bool isattacking = true;
Game& g = Game::get();
//Player& northPlayer = g.getPlayer(m_pPlayer->isNorth());
//Player& southPlayer = g.getPlayer(!(m_pPlayer->isNorth()));
std::vector<Entity*> OpponentBuildings;
std::vector<Entity*> OpponentMobs;
// Returns true if there's already a giant present
bool Controller_AI_Rudra::isGiantPresent()
{
for (Entity* pMob : g.getPlayer(m_pPlayer->isNorth()).getMobs())
{
if (!pMob->isDead())
{
if (pMob->getStats().getMobType() == iEntityStats::Giant)
{
return true;
}
}
else
{
continue;
}
}
return false;
}
bool Controller_AI_Rudra::isKnightPresent()
{
for (Entity* pMob : g.getPlayer(m_pPlayer->isNorth()).getMobs())
{
if (!pMob->isDead())
{
if (pMob->getStats().getMobType() == iEntityStats::Swordsman)
{
return true;
}
}
else
{
continue;
}
}
return false;
}
bool Controller_AI_Rudra::isArcherPresent()
{
for (Entity* pMob : g.getPlayer(m_pPlayer->isNorth()).getMobs())
{
if (!pMob->isDead())
{
if (pMob->getStats().getMobType() == iEntityStats::Archer)
{
return true;
}
}
else
{
continue;
}
}
return false;
}
float Controller_AI_Rudra::isOpponentMobPresent(iEntityStats::MobType mobType)
{
for (Entity* othermob : g.getPlayer(!(m_pPlayer->isNorth())).getMobs())
{
if (!othermob->isDead())
{
if (othermob->getStats().getMobType() == mobType)
{
return othermob->getPosition().x;
}
}
}
return -1;
}
// Getting the State of the player controlled by our AI
void Controller_AI_Rudra::getattackstatus()
{
if (!g.getPlayer(!(m_pPlayer->isNorth())).getMobs().empty())
{
isattacking = false;
}
else
{
isattacking = true;
}
}
// Getting the opponent buildings
void Controller_AI_Rudra::GetOpponentBuildings()
{
OpponentBuildings = g.getPlayer(!(m_pPlayer->isNorth())).getBuildings();
}
// Finding the nearest spawn point accoding to buidling health
float Controller_AI_Rudra::nearestXforSpawn(float x, float x1)
{
std::vector<Entity*> pbuild;
for (Entity* otherbuilding : OpponentBuildings)
{
if (otherbuilding->getStats().getBuildingType() == iEntityStats::BuildingType::Princess)
{
pbuild.push_back(otherbuilding);
}
}
if (pbuild[0]->getHealth() < pbuild[1]->getHealth())
{
float a, b;
a = abs(pbuild[0]->getPosition().x - x);
b = abs(pbuild[0]->getPosition().x - x1);
if (a < b)
{
return x;
}
else
{
return x1;
}
}
else if (pbuild[0]->getHealth() > pbuild[1]->getHealth())
{
float a, b;
a = abs(pbuild[1]->getPosition().x - x);
b = abs(pbuild[1]->getPosition().x - x1);
if (a < b)
{
return x;
}
else
{
return x1;
}
}
return x1;
}
float Controller_AI_Rudra::nearestXforDefence(float x, float x1, Entity* OMob)
{
if (!OMob->isDead())
{
if ((abs(OMob->getPosition().x - x)) < (abs(OMob->getPosition().x - x1)) || (abs(OMob->getPosition().x - x)) == (abs(OMob->getPosition().x - x1)))
{
return x;
}
else if ((abs(OMob->getPosition().x - x)) > (abs(OMob->getPosition().x - x1)))
{
return x1;
}
}
else
{
return x1;
}
}
void Controller_AI_Rudra::GetEnemiesOnField()
{
for (Entity* othermob : g.getPlayer(!(m_pPlayer->isNorth())).getMobs())
{
if (!othermob->isDead())
{
OpponentMobs.push_back(othermob);
}
}
}
void Controller_AI_Rudra::tick(float deltaTSec)
{
assert(m_pPlayer);
//Get Enemies on Field
GetEnemiesOnField();
// Get opponent buildings
GetOpponentBuildings();
// choose whether to attack or defend
getattackstatus();
// attack strategy
if (isattacking)
{
if (m_pPlayer->getElixir() >= 9)
{
if (!isGiantPresent())
{
Vec2 GiantSpawnWorld(nearestXforSpawn(GiantLeftSpawnX, GiantRightSpawnX), GiantSpawnY);
Vec2 GiantGamePos = GiantSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Giant, GiantGamePos);
Vec2 ArcherSpawnWorld(GiantSpawnWorld.x, ArcherSpawnY);
Vec2 ArcherGamePos = ArcherSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
}
else if (isGiantPresent())
{
Vec2 ArcherSpawnWorld(nearestXforSpawn(ArcherLeftSpawnX,ArcherRightSpawnX), ArcherSpawnY);
Vec2 ArcherGamePos = ArcherSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
}
}
else if (m_pPlayer->getElixir() >=6 && m_pPlayer->getElixir() < 9)
{
if (isGiantPresent())
{
Vec2 ArcherSpawnWorld(nearestXforSpawn(ArcherLeftSpawnX, ArcherRightSpawnX), ArcherSpawnY);
Vec2 ArcherGamePos = ArcherSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
}
else
{
Vec2 GiantSpawnWorld(nearestXforSpawn(GiantLeftSpawnX, GiantRightSpawnX), GiantSpawnY);
Vec2 GiantGamePos = GiantSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Giant, GiantGamePos);
}
}
else if(m_pPlayer->getElixir() >= 4 && m_pPlayer->getElixir() < 6)
{
if (isGiantPresent())
{
Vec2 ArcherSpawnWorld(nearestXforSpawn(ArcherLeftSpawnX, ArcherRightSpawnX), ArcherSpawnY);
Vec2 ArcherGamePos = ArcherSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
}
}
}
// defence strategy
else
{
int RightTroops = 0;
int LeftTroops = 0;
for (Entity* othermob : g.getPlayer(!(m_pPlayer->isNorth())).getMobs())
{
if (othermob->getPosition().x > KingX)
{
RightTroops++;
}
else
{
LeftTroops++;
}
}
if (m_pPlayer->getElixir() >= 8)
{
std::cout << "Enough ELixir to Spawn Strong Defense" << std::endl;
if (RightTroops > LeftTroops)
{
std::cout << "More troops on the right" << std::endl;
Vec2 KnightSpawnWorld(KnightRightSpawnX, KnightSpawnY);
Vec2 KnightGamePos = KnightSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Swordsman, KnightGamePos);
Vec2 ArcherSpawnWorld(ArcherRightSpawnX , KnightSpawnY - 1.f);
Vec2 ArcherGamePos = ArcherSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
}
else
{
std::cout << "More troops on the left" << std::endl;
Vec2 KnightSpawnWorld(KnightLeftSpawnX, KnightSpawnY );
Vec2 KnightGamePos = KnightSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Swordsman, KnightGamePos);
Vec2 ArcherSpawnWorld(ArcherLeftSpawnX , KnightSpawnY - 1.f);
Vec2 ArcherGamePos = ArcherSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
}
}
else if (m_pPlayer->getElixir() >= 5 && m_pPlayer->getElixir() < 8)
{
float archx = isOpponentMobPresent(iEntityStats::Archer);
float knightx = isOpponentMobPresent(iEntityStats::Swordsman);
float giantx = isOpponentMobPresent(iEntityStats::Giant);
std::cout << "Enough ELixir to Spawn counter defense" << std::endl;
if (archx > 0)
{
if (archx > KingX)
{
std::cout << "Spawned defense against Archers on the right" << std::endl;
Vec2 ArcherSpawnWorld(ArcherRightSpawnX, ArcherSpawnY);
Vec2 ArcherGamePos = ArcherSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
}
else
{
std::cout << "Spawned defense against Archers on the left" << std::endl;
Vec2 ArcherSpawnWorld(ArcherLeftSpawnX, ArcherSpawnY);
Vec2 ArcherGamePos = ArcherSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
}
}
else if (knightx > 0)
{
if (knightx > KingX)
{
std::cout << "Spawned defense against Knight on the right" << std::endl;
Vec2 KnightSpawnWorld(KnightRightSpawnX, KnightSpawnY);
Vec2 KnightGamePos = KnightSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Swordsman, KnightGamePos);
}
else
{
std::cout << "Spawned defense against Knight on the left" << std::endl;
Vec2 KnightSpawnWorld(KnightLeftSpawnX, KnightSpawnY);
Vec2 KnightGamePos = KnightSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Swordsman, KnightGamePos);
}
}
else if (giantx > KingX)
{
if (giantx > KingX)
{
std::cout << "Spawned defense against Giant on the right" << std::endl;
Vec2 KnightSpawnWorld(KnightRightSpawnX, KnightSpawnY);
Vec2 KnightGamePos = KnightSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Swordsman, KnightGamePos);
}
else
{
std::cout << "Spawned defense against Giant on the left" << std::endl;
Vec2 KnightSpawnWorld(KnightLeftSpawnX, KnightSpawnY);
Vec2 KnightGamePos = KnightSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Swordsman, KnightGamePos);
}
}
}
else if (m_pPlayer->getElixir() >= 3 && m_pPlayer->getElixir() < 5)
{
std::cout << "Spawning defense to stall attack" << std::endl;
if (!isKnightPresent())
{
if (RightTroops > LeftTroops)
{
std::cout << "Spawned knight on right to stall attack" << std::endl;
Vec2 KnightSpawnWorld(KnightRightSpawnX, KnightSpawnY);
Vec2 KnightGamePos = KnightSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Swordsman, KnightGamePos);
}
else
{
std::cout << "Spawned knight on left to stall attack" << std::endl;
Vec2 KnightSpawnWorld(KnightLeftSpawnX, KnightSpawnY);
Vec2 KnightGamePos = KnightSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Swordsman, KnightGamePos);
}
}
else if(!isArcherPresent())
{
if (RightTroops > LeftTroops)
{
std::cout << "Knight Present sending Archers on right" << std::endl;
Vec2 ArcherSpawnWorld(ArcherRightSpawnX, ArcherSpawnY);
Vec2 ArcherGamePos = ArcherSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
}
else
{
std::cout << "Sending archers to supoort knight on the right" << std::endl;
Vec2 ArcherSpawnWorld(ArcherLeftSpawnX, ArcherSpawnY);
Vec2 ArcherGamePos = ArcherSpawnWorld.Player2Game(m_pPlayer->isNorth());
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
m_pPlayer->placeMob(iEntityStats::Archer, ArcherGamePos);
}
}
}
}
//// wait for elixir
//if (m_pPlayer->getElixir() >= 9)
//{
// // convert the positions from player space to game space
// bool isNorth = m_pPlayer->isNorth();
// Vec2 giantPos_Game = ksGiantPos.Player2Game(isNorth);
// Vec2 archerPos_Game = ksArcherPos.Player2Game(isNorth);
// // Create two archers and a giant
// m_pPlayer->placeMob(iEntityStats::Giant, giantPos_Game);
// m_pPlayer->placeMob(iEntityStats::Archer, archerPos_Game);
// m_pPlayer->placeMob(iEntityStats::Archer, archerPos_Game);
//}
}
| 31.411765 | 158 | 0.569522 | [
"vector"
] |
c104a76a55efc678bcf4f208c499ce92e6dd923a | 1,415 | cpp | C++ | src/System_GUI.cpp | int-Frank/DgEngine | aaec951a36c0c06540a14299b428e3f9ed1b5b20 | [
"Apache-2.0"
] | 1 | 2015-01-13T06:58:27.000Z | 2015-01-13T06:58:27.000Z | src/System_GUI.cpp | int-Frank/DgEngine | aaec951a36c0c06540a14299b428e3f9ed1b5b20 | [
"Apache-2.0"
] | null | null | null | src/System_GUI.cpp | int-Frank/DgEngine | aaec951a36c0c06540a14299b428e3f9ed1b5b20 | [
"Apache-2.0"
] | null | null | null | //@group Systems
#include "System_GUI.h"
#include "InputCodes.h"
#include "Options.h"
#include "Options.h"
#include "GUI_Internal.h"
#include "Renderer.h"
#include "GUI.h"
namespace DgE
{
MAKE_SYSTEM_DEFINITION(System_GUI)
System_GUI::System_GUI(int a_windowW, int a_windowH)
: m_dt(1.0f / 60.0f)
, m_pScreen(nullptr)
{
m_pScreen = GUI::Container::Create({0.f, 0.f}, {(float)a_windowW, (float)a_windowH});
}
System_GUI::~System_GUI()
{
delete m_pScreen;
}
void System_GUI::HandleMessage(Message * a_pMsg)
{
DISPATCH_MESSAGE(Message_Window_Resized);
if (a_pMsg->GetCategory() != MC_GUI)
return;
m_pScreen->HandleMessage(a_pMsg);
a_pMsg->SetFlag(Message::Flag::Handled, true);
}
void System_GUI::HandleMessage(Message_Window_Resized * a_pMsg)
{
vec2 size((float)a_pMsg->w, (float)a_pMsg->h);
GUI::Renderer::SetScreenSize(size);
m_pScreen->SetSize(size);
}
void System_GUI::Update(float a_dt)
{
m_dt = a_dt;
}
void System_GUI::Render()
{
GlobalRenderState *pState = Renderer::GetGlobalRenderState();
Renderer::Disable(RenderFeature::DepthTest);
Renderer::Enable(RenderFeature::Sissor);
m_pScreen->Draw();
Renderer::SetRenderState(pState);
}
void System_GUI::ClearFrame()
{
m_pScreen->Clear();
}
void System_GUI::AddWidget(GUI::Widget * a_pWgt)
{
m_pScreen->Add(a_pWgt);
}
} | 20.507246 | 89 | 0.674205 | [
"render"
] |
c104cab139bb6607b1fd808590178dc213709de4 | 9,388 | cpp | C++ | Plugins/org.blueberry.ui.qt/src/internal/berryCommandService.cpp | liu3xing3long/MITK-2016.11 | 385c506f9792414f40337e106e13d5fd61aa3ccc | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | Plugins/org.blueberry.ui.qt/src/internal/berryCommandService.cpp | liu3xing3long/MITK-2016.11 | 385c506f9792414f40337e106e13d5fd61aa3ccc | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | Plugins/org.blueberry.ui.qt/src/internal/berryCommandService.cpp | liu3xing3long/MITK-2016.11 | 385c506f9792414f40337e106e13d5fd61aa3ccc | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | /*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berryCommandService.h"
#include <berryCommand.h>
#include <berryCommandManager.h>
#include <berryCommandCategory.h>
#include <berryParameterizedCommand.h>
#include <berryUIElement.h>
#include "berryPersistentState.h"
#include "berryWorkbenchPlugin.h"
#include "berryElementReference.h"
#include "berryIPreferences.h"
#include <berryIHandler.h>
#include <berryIElementUpdater.h>
#include <berryIElementReference.h>
#include <berryISafeRunnable.h>
#include <berrySafeRunner.h>
#include <berryObjectString.h>
#include <QStringList>
namespace berry {
const QString CommandService::PREFERENCE_KEY_PREFIX = "org.blueberry.ui.commands/state";
const QString CommandService::CreatePreferenceKey(const SmartPointer<Command>& command,
const QString& stateId)
{
return PREFERENCE_KEY_PREFIX + '/' + command->GetId() + '/' + stateId;
}
CommandService::CommandService( CommandManager* commandManager)
: commandManager(commandManager)
, commandPersistence(this)
{
if (commandManager == nullptr)
{
throw std::invalid_argument("Cannot create a command service with a null manager");
}
}
CommandService::~CommandService()
{
this->Dispose();
}
void CommandService::AddExecutionListener(IExecutionListener* listener)
{
commandManager->AddExecutionListener(listener);
}
void CommandService::DefineUncategorizedCategory(const QString& name,
const QString& description)
{
commandManager->DefineUncategorizedCategory(name, description);
}
SmartPointer<ParameterizedCommand> CommandService::Deserialize(const QString& serializedParameterizedCommand) const
{
return commandManager->Deserialize(serializedParameterizedCommand);
}
void CommandService::Dispose()
{
/*
* All state on all commands neeeds to be disposed. This is so that the
* state has a chance to persist any changes.
*/
const QList<Command::Pointer> commands = commandManager->GetAllCommands();
foreach (const Command::Pointer& command, commands)
{
const QList<QString> stateIds = command->GetStateIds();
foreach(const QString& stateId, stateIds)
{
const State::Pointer state = command->GetState(stateId);
if (PersistentState::Pointer persistentState = state.Cast<PersistentState>())
{
if (persistentState->ShouldPersist())
{
persistentState->Save(WorkbenchPlugin::GetDefault()->GetPreferences(),
CreatePreferenceKey(command, stateId));
}
}
}
}
commandCallbacks.clear();
}
SmartPointer<CommandCategory> CommandService::GetCategory(const QString& categoryId) const
{
return commandManager->GetCategory(categoryId);
}
SmartPointer<Command> CommandService::GetCommand(const QString& commandId) const
{
return commandManager->GetCommand(commandId);
}
QList<SmartPointer<CommandCategory> > CommandService::GetDefinedCategories() const
{
return commandManager->GetDefinedCategories();
}
QStringList CommandService::GetDefinedCategoryIds() const
{
return commandManager->GetDefinedCategoryIds().toList();
}
QStringList CommandService::GetDefinedCommandIds() const
{
return commandManager->GetDefinedCommandIds().toList();
}
QList<SmartPointer<Command> > CommandService::GetDefinedCommands() const
{
return commandManager->GetDefinedCommands();
}
QStringList CommandService::GetDefinedParameterTypeIds() const
{
return commandManager->GetDefinedParameterTypeIds().toList();
}
QList<SmartPointer<ParameterType> > CommandService::GetDefinedParameterTypes() const
{
return commandManager->GetDefinedParameterTypes();
}
QString CommandService::GetHelpContextId(const SmartPointer<const Command>& command) const
{
return commandManager->GetHelpContextId(command);
}
QString CommandService::GetHelpContextId(const QString& commandId) const
{
Command::Pointer command = GetCommand(commandId);
return commandManager->GetHelpContextId(command);
}
SmartPointer<ParameterType> CommandService::GetParameterType(const QString& parameterTypeId) const
{
return commandManager->GetParameterType(parameterTypeId);
}
void CommandService::ReadRegistry()
{
commandPersistence.Read();
}
void CommandService::RemoveExecutionListener(IExecutionListener* listener)
{
commandManager->RemoveExecutionListener(listener);
}
void CommandService::SetHelpContextId(const SmartPointer<IHandler>& handler,
const QString& helpContextId)
{
commandManager->SetHelpContextId(handler, helpContextId);
}
void CommandService::RefreshElements(const QString& commandId,
const QHash<QString, Object::Pointer>& filter)
{
Command::Pointer cmd = GetCommand(commandId);
if (!cmd->IsDefined() || !(cmd->GetHandler().Cast<IElementUpdater>()))
{
return;
}
IElementUpdater::Pointer updater = cmd->GetHandler().Cast<IElementUpdater>();
if (commandCallbacks.isEmpty())
{
return;
}
if(!commandCallbacks.contains(commandId))
{
return;
}
foreach (IElementReference::Pointer callbackRef, commandCallbacks[commandId])
{
struct _SafeRunnable : public ISafeRunnable
{
IElementUpdater* updater;
IElementReference* callbackRef;
_SafeRunnable(IElementUpdater* updater, IElementReference* callbackRef)
: updater(updater), callbackRef(callbackRef)
{}
void HandleException(const ctkException& exc) override
{
WorkbenchPlugin::Log(QString("Failed to update callback: ") +
callbackRef->GetCommandId() + exc.what());
}
void Run() override
{
updater->UpdateElement(callbackRef->GetElement().GetPointer(), callbackRef->GetParameters());
}
};
QHash<QString,Object::Pointer> parms = callbackRef->GetParameters();
ISafeRunnable::Pointer run(new _SafeRunnable(updater.GetPointer(), callbackRef.GetPointer()));
if (filter.isEmpty())
{
SafeRunner::Run(run);
}
else
{
bool match = true;
QHashIterator<QString, Object::Pointer> i(filter);
while (i.hasNext())
{
i.next();
Object::Pointer value = parms[i.key()];
if (i.value() != value)
{
match = false;
break;
}
}
if (match)
{
SafeRunner::Run(run);
}
}
}
}
SmartPointer<IElementReference> CommandService::RegisterElementForCommand(
const SmartPointer<ParameterizedCommand>& command,
const SmartPointer<UIElement>& element)
{
if (!command->GetCommand()->IsDefined())
{
throw NotDefinedException(
"Cannot define a callback for undefined command "
+ command->GetCommand()->GetId());
}
if (element.IsNull())
{
throw NotDefinedException("No callback defined for command "
+ command->GetCommand()->GetId());
}
QHash<QString, QString> paramMap = command->GetParameterMap();
QHash<QString, Object::Pointer> parms;
for (QHash<QString, QString>::const_iterator i = paramMap.begin();
i != paramMap.end(); ++i)
{
Object::Pointer value(new ObjectString(i.value()));
parms.insert(i.key(), value);
}
IElementReference::Pointer ref(new ElementReference(command->GetId(),
element, parms));
RegisterElement(ref);
return ref;
}
void CommandService::RegisterElement(const SmartPointer<IElementReference>& elementReference)
{
QList<IElementReference::Pointer>& parameterizedCommands = commandCallbacks[elementReference->GetCommandId()];
parameterizedCommands.push_back(elementReference);
// If the active handler wants to update the callback, it can do
// so now
Command::Pointer command = GetCommand(elementReference->GetCommandId());
if (command->IsDefined())
{
if (IElementUpdater::Pointer updater = command->GetHandler().Cast<IElementUpdater>())
{
updater->UpdateElement(elementReference->GetElement().GetPointer(),
elementReference->GetParameters());
}
}
}
void CommandService::UnregisterElement(const SmartPointer<IElementReference>& elementReference)
{
if (commandCallbacks.contains(elementReference->GetCommandId()))
{
QList<IElementReference::Pointer>& parameterizedCommands = commandCallbacks[elementReference->GetCommandId()];
parameterizedCommands.removeAll(elementReference);
if (parameterizedCommands.isEmpty())
{
commandCallbacks.remove(elementReference->GetCommandId());
}
}
}
const CommandPersistence* CommandService::GetCommandPersistence() const
{
return &commandPersistence;
}
}
| 29.429467 | 116 | 0.679591 | [
"object"
] |
c1097e36b9259904c17c517602faa1c588a77143 | 1,090 | hpp | C++ | include/caffe/layers/QuadExpandLayer.hpp | PengHuiSun/caffe | a628672032dc83f3df6536bb72c5475ae0a5f512 | [
"Intel",
"BSD-2-Clause"
] | null | null | null | include/caffe/layers/QuadExpandLayer.hpp | PengHuiSun/caffe | a628672032dc83f3df6536bb72c5475ae0a5f512 | [
"Intel",
"BSD-2-Clause"
] | null | null | null | include/caffe/layers/QuadExpandLayer.hpp | PengHuiSun/caffe | a628672032dc83f3df6536bb72c5475ae0a5f512 | [
"Intel",
"BSD-2-Clause"
] | null | null | null | #ifndef CAFFE_QUAD_EXPAND_LAYER_HPP__
#define CAFFE_QUAD_EXPAND_LAYER_HPP__
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/layer.hpp"
#include "caffe/proto/caffe.pb.h"
namespace caffe {
template <typename Dtype>
class QuadExpandLayer : public Layer<Dtype> {
public:
QuadExpandLayer(const LayerParameter& param) : Layer<Dtype>(param) {}
virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top);
virtual void Reshape(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top);
virtual inline const char* type() const { return "QuadExpand"; }
virtual inline int ExactNumBottomBlobs() const { return 1; }
virtual inline int ExactNumTopBlobs() const { return 1; }
protected:
virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top);
virtual void Backward_cpu(const vector<Blob<Dtype>*>& bottom, const vector<bool>& propagate_down,
const vector<Blob<Dtype>*>& top);
};
} // namespace caffe
#endif // CAFFE_QUAD_EXPAND_LAYER_HPP__ | 34.0625 | 99 | 0.717431 | [
"vector"
] |
c119db0fa2517b34cc95ac4b20839354ce193782 | 11,085 | hpp | C++ | Source/Configuration.hpp | alvinahmadov/Dixter | 6f98f1e84192e1e43eee409bdee6b3dac75d6443 | [
"MIT"
] | 4 | 2018-12-06T01:20:50.000Z | 2019-08-04T10:19:23.000Z | Source/Configuration.hpp | alvinahmadov/Dixter | 6f98f1e84192e1e43eee409bdee6b3dac75d6443 | [
"MIT"
] | null | null | null | Source/Configuration.hpp | alvinahmadov/Dixter | 6f98f1e84192e1e43eee409bdee6b3dac75d6443 | [
"MIT"
] | null | null | null | /**
* Copyright (C) 2015-2019
* Author Alvin Ahmadov <alvin.dev.ahmadov@gmail.com>
*
* This file is part of Dixter Project
* License-Identifier: MIT License
* See README.md for more information.
*/
#pragma once
#include <map>
#include <unordered_map>
#include <set>
#include <mutex>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/json_parser.hpp>
#include "Commons.hpp"
namespace Dixter
{
struct TNode;
class TNodeData;
class TNodeEntry;
struct IConfiguration;
/**
* \author Alvin Ahmadov
* \namespace Dixter
* \struct ConfigurationInterface
* \brief Interface for Configuration readers/writers.
* */
struct IConfiguration
{
using PropertyTree = boost::property_tree::basic_ptree<TString, TUString>;
using PropertyTreePtr = std::unique_ptr<PropertyTree>;
using NodeEntryPtr = std::shared_ptr<TNodeEntry>;
using ConfigurationProperty = std::unordered_map<TString, std::shared_ptr<IConfiguration>>;
/**
* \interface ConfigurationInterface
* \brief Abstract method for loading data
* from configuration file.
* */
virtual void load() = 0;
/**
* \interface ConfigurationInterface
* \brief Abstract method for writing data
* to configuration file.
* */
virtual void save() = 0;
virtual void set(const TString& key, const TUString& value) = 0;
virtual void keys(std::list<TString>&) const = 0;
virtual void get(const TString& key, std::vector<TUString>& values) const = 0;
virtual TUString get(const TString& key, const TUString& byValue) const = 0;
virtual TUString get(const TString& key) const = 0;
virtual ~IConfiguration() = default;
};
/**
* \brief Enum that defines which configuration reader/writer to use.
* */
enum class EConfiguration
{
None,
INI,
XML,
JSON
};
/**
* @brief Class for reading and storing settings from ini file
* */
class TConfigurationINI final : public IConfiguration,
public TMoveOnly
{
public:
explicit TConfigurationINI(const TString& file) noexcept;
virtual ~TConfigurationINI() noexcept override = default;
void load() override;
void save() override;
void set(const TString& key, const TUString& value) override;
void keys(std::list<TString>&) const override;
TUString get(const TString& key) const override;
void get(const TString& key, std::vector<TUString>& values) const override;
TUString get(const TString& key, const TUString& byValue) const override;
private:
TString m_file;
PropertyTreePtr m_propertyTree;
NodeEntryPtr m_entries;
};
/**
* \class XMLConfiguration
* \implements ConfigurationInterface
* \brief Class for reading and storing settings from xml file
* */
class TConfigurationXML final : public IConfiguration,
public TMoveOnly
{
public:
/**
* \class XMLConfiguration
* \brief ctor.
* \param file Absolute path to XML configuration xml file.
* */
explicit TConfigurationXML(const TString& file) noexcept;
/**
* \class XMLConfiguration
* \brief dtor.
* */
virtual ~TConfigurationXML() noexcept override = default;
/**
* \class XMLConfiguration
* \brief Loads data from configuration file to memory.
* */
void load() override;
/**
* \class XMLConfiguration
* \brief Saves data to configuration file.
* \note Not implemented for now.
* \throws NotImplementedException
* */
void save() override;
void set(const TString& key, const TUString& value) override;
void keys(std::list<TString>&) const override;
void get(const TString& key, std::vector<TUString>& values) const override;
TUString get(const TString& key) const override;
TUString get(const TString& key, const TUString& byValue) const override;
private:
TString m_file;
TString m_rootNode;
NodeEntryPtr m_entries;
PropertyTreePtr m_propertyTree;
mutable std::mutex m_mutex;
};
class TConfigurationJSON : public IConfiguration,
public TMoveOnly
{
public:
using PropertyTree = boost::property_tree::basic_ptree<TString, TString>;
public:
explicit TConfigurationJSON(const TString& file) noexcept ;
virtual ~TConfigurationJSON() noexcept override = default;
void load() override;
void save() override;
void set(const TString&, const TUString&) override {}
void keys(std::list<TString>&) const override;
void get(const TString& key, std::vector<TUString>& values) const override;
TUString get(const TString& key) const override;
TUString get(const TString& key, const TUString& byValue) const override;
private:
TString m_file;
TString m_rootNode;
NodeEntryPtr m_entries;
std::unique_ptr<PropertyTree> m_propertyTree;
};
class TConfigurationFactory : public TMoveOnly
{
private:
using IConfigurationPtr = std::shared_ptr<IConfiguration>;
public:
explicit TConfigurationFactory(const TString& configPath, EConfiguration type);
~TConfigurationFactory() noexcept = default;
void load();
void save();
void keys(std::list<TString>&) const;
IConfigurationPtr
getConfiguration();
EConfiguration
getType() const;
private:
EConfiguration m_type;
IConfigurationPtr m_configuration;
};
/**
* \author Alvin Ahmadov
* \class ConfigurationManager
* \implements ConfigurationManagerInterface
* \namespace Dixter
* \brief Singleton class that manages configurations
* */
class TConfigurationManager : public TNonCopyable
{
/**
* \author Alvin Ahmadov
* \class ConfigurationManager::Accessor
* \brief Class used as inner helper class to read data of ConfigurationManager.
*
* Provides easy access interfaces to data. Data is immutable.
* */
class TAccessor : public TNonCopyable
{
public:
/**
* \brief Constructs TAccessor with non-owning TConfigurationManager pointer,
* which means it doesn't delete passed pointer.
* */
explicit TAccessor(TConfigurationManager* manager) noexcept;
~TAccessor() noexcept override = default;
/**
* \class ConfigurationManager
* \brief Get value of node using key.
* \param key Node name of value.
* \returns Found value.
* \throws NotFoundException.
* */
TUString getValue(const TString& key,
const TString& root = TString()) const;
/**
* \class XMLConfiguration
* \brief Get value of node with key and with sibling value.
* \param byValue Sibling value.
* \param key Node name of sibling value.
* \returns value
* \throws NotFoundException
* */
TUString getValue(const TString& key, const TUString& byValue,
const TString& root = TString()) const;
/**
* \brief Get all values of node with specified name.
* \tparam Container Container to which save data.
* */
const TAccessor*
getValues(const TString& key, std::vector<TUString>& values,
const TString& root = TString()) const;
private:
std::shared_ptr<IConfiguration>
get(const TString& key, const TString& root = TString()) const;
private:
TConfigurationManager* m_manager;
};
/**
* \author Alvin Ahmadov
* \class ConfigurationManager::Mutator
* \brief Class used as inner helper class to write data of ConfigurationManager.
*
* Provides easy access interfaces to data. Data is mutable.
* */
class TMutator : public TNonCopyable
{
public:
/**
* \brief Constructs TMutator with non-owning TConfigurationManager pointer,
* which means it doesn't delete passed pointer.
* */
explicit TMutator(TConfigurationManager* manager) noexcept;
~TMutator() noexcept override = default;
/**
* \class ConfigurationManager
* \brief Get value of node using key.
* \param key Node name of value.
* \returns Found value.
* \throws NotFoundException.
* */
const TMutator*
setValue(const TString& key, const TUString& value,
const TString& root = "");
private:
std::shared_ptr<IConfiguration>
get(const TString& key, const TString& root = "");
private:
TConfigurationManager* m_manager;
mutable std::mutex m_mutex;
};
public:
using TSelf = TConfigurationManager;
using TInstancePtr = std::shared_ptr<TSelf>;
using TAccessorPtr = std::unique_ptr<TAccessor>;
using TMutatorPtr = std::unique_ptr<TMutator>;
using TConstIterator = IConfiguration::ConfigurationProperty::const_iterator;
virtual ~TConfigurationManager() noexcept = default;
/**
* \class ConfigurationManager
* \brief Get instance of manager.
* \param type Configuration type.
* \param paths List of paths to configuration files.
* \returns Manager instance.
*
* If there is an initialised instance and its type is different,
* then the first instance will be added to a set, and new instance
* is initialised and used. Depending on type it will return the correct instance.
* */
static TInstancePtr&
getManager(EConfiguration type, std::set<TString> paths = std::set<TString>());
const TAccessorPtr&
accessor() const;
const TMutatorPtr&
mutator();
/**
* \class ConfigurationManager
* \brief Gets the type of current instance.
* \returns Instance's type.
* */
EConfiguration
getType() const;
/**
* \class ConfigurationManager
* \brief Updates loaded configuration values.
* \returns True if values updated.
* */
// bool update();
private:
/**
* \class ConfigurationManager
* \brief ctor. Loads configuration for every configuration file.
* \param type Type of configuration to initialise.
* \param paths List of paths to configuration files.
* */
TConfigurationManager(EConfiguration type, const std::set<TString>& paths);
void read(EConfiguration type, const TString& path);
void write(EConfiguration type, const TString& path);
void checkKey(const TConstIterator key, TString errorMsg = "") const;
private:
static TInstancePtr m_instance;
EConfiguration m_type;
std::set<TString> m_paths;
IConfiguration::ConfigurationProperty m_properties;
std::unique_ptr<TAccessor> m_accessor;
std::unique_ptr<TMutator> m_mutator;
};
inline TConfigurationManager::TInstancePtr
getManager(EConfiguration type, const std::set<TString>& path)
{
return TConfigurationManager::getManager(type, path);
}
inline TConfigurationManager::TInstancePtr
getIniManager(const std::set<TString>& path)
{
return TConfigurationManager::getManager(EConfiguration::INI, path);
}
inline TConfigurationManager::TInstancePtr
getXmlManager(const std::set<TString>& path = {})
{
return TConfigurationManager::getManager(EConfiguration::XML, path);
}
inline TConfigurationManager::TInstancePtr
getJsonManager(const std::set<TString>& path = {})
{
return TConfigurationManager::getManager(EConfiguration::JSON, path);
}
} // namespace Dixter
| 25.659722 | 93 | 0.698421 | [
"vector"
] |
c120f5567528eb83b6781c78d60134a4aa97e128 | 5,996 | cpp | C++ | src/controls/cell_renderer.cpp | AndrewGrim/Agro | f065920ab665938852bc8aa7e38d4d73f7e3ec0d | [
"MIT"
] | null | null | null | src/controls/cell_renderer.cpp | AndrewGrim/Agro | f065920ab665938852bc8aa7e38d4d73f7e3ec0d | [
"MIT"
] | null | null | null | src/controls/cell_renderer.cpp | AndrewGrim/Agro | f065920ab665938852bc8aa7e38d4d73f7e3ec0d | [
"MIT"
] | 1 | 2021-04-18T12:06:55.000Z | 2021-04-18T12:06:55.000Z | #include "cell_renderer.hpp"
CellRenderer::CellRenderer() {
style.widget_background = COLOR_NONE;
}
CellRenderer::~CellRenderer() {}
bool CellRenderer::isWidget() {
return false;
}
EmptyCell::EmptyCell() {}
EmptyCell::~EmptyCell() {}
void EmptyCell::draw(DrawingContext &dc, Rect rect, int state) {
Color bg = dc.accentWidgetBackground(style);
if (state & STATE_HARD_FOCUSED) {
dc.fillRect(rect, bg);
}
if (state & STATE_HOVERED) {
dc.fillRect(rect, Color(bg.r, bg.g, bg.b, 0.2f));
}
}
Size EmptyCell::sizeHint(DrawingContext &dc) {
return Size();
}
TextCellRenderer::TextCellRenderer(std::string text, int padding) : text{text}, padding{padding} {}
TextCellRenderer::~TextCellRenderer() {}
void TextCellRenderer::draw(DrawingContext &dc, Rect rect, int state) {
Color fg = dc.textForeground(style);
Color bg = dc.widgetBackground(style); // TODO should be text_background most likely
if (state & STATE_HARD_FOCUSED) {
fg = dc.textSelected(style);
bg = dc.accentWidgetBackground(style);
}
dc.fillRect(rect, bg);
if (state & STATE_HOVERED) {
bg = dc.accentWidgetBackground(style);
dc.fillRect(rect, Color(bg.r, bg.g, bg.b, 0.2f));
}
dc.fillTextMultilineAligned(
font,
text,
h_align,
v_align,
rect,
padding,
fg
);
}
Size TextCellRenderer::sizeHint(DrawingContext &dc) {
if (m_size_changed) {
Size s = dc.measureTextMultiline(font, text);
s.w += padding * 2;
s.h += padding * 2;
m_size = s;
return s;
} else {
return m_size;
}
}
ImageCellRenderer::ImageCellRenderer(Image *image) : image{image} {}
ImageCellRenderer::~ImageCellRenderer() {
delete image;
}
void ImageCellRenderer::draw(DrawingContext &dc, Rect rect, int state) {
Color bg = dc.widgetBackground(image->style);
if (state & STATE_HARD_FOCUSED) {
bg = dc.accentWidgetBackground(style);
}
dc.fillRect(rect, bg);
if (state & STATE_HOVERED) {
bg = dc.accentWidgetBackground(style);
dc.fillRect(rect, Color(bg.r, bg.g, bg.b, 0.2f));
}
dc.drawTextureAligned(
rect,
image->size(),
image->_texture(),
image->coords(),
HorizontalAlignment::Center,
VerticalAlignment::Center,
image->foreground()
);
}
Size ImageCellRenderer::sizeHint(DrawingContext &dc) {
return image->size();
}
MultipleImagesCellRenderer::MultipleImagesCellRenderer(std::vector<Image> &&images) : images{images} {}
MultipleImagesCellRenderer::~MultipleImagesCellRenderer() {}
void MultipleImagesCellRenderer::draw(DrawingContext &dc, Rect rect, int state) {
Color bg = dc.widgetBackground(style);
if (state & STATE_HARD_FOCUSED) {
bg = dc.accentWidgetBackground(style);
}
dc.fillRect(rect, bg);
if (state & STATE_HOVERED) {
bg = dc.accentWidgetBackground(style);
dc.fillRect(rect, Color(bg.r, bg.g, bg.b, 0.2f));
}
Rect drawing_rect = rect;
Size size = sizeHint(dc);
drawing_rect.x = drawing_rect.x + (drawing_rect.w / 2) - (size.w / 2);
for (auto img : images) {
dc.drawTextureAligned(
drawing_rect,
img.size(),
img._texture(),
img.coords(),
HorizontalAlignment::Left,
VerticalAlignment::Center,
img.foreground()
);
drawing_rect.x += img.size().w;
}
}
Size MultipleImagesCellRenderer::sizeHint(DrawingContext &dc) {
if (m_size_changed) {
Size size = Size();
for (auto img : images) {
Size s = img.sizeHint(dc);
size.w += s.w;
if (s.h > size.h) { size.h = s.h; }
}
m_size = size;
}
return m_size;
}
ImageTextCellRenderer::ImageTextCellRenderer(
Image *image,
std::string text,
HorizontalAlignment h_align,
int padding
) : image{image}, text{text}, h_align{h_align}, padding{padding} {}
ImageTextCellRenderer::~ImageTextCellRenderer() {
delete image;
}
void ImageTextCellRenderer::draw(DrawingContext &dc, Rect rect, int state) {
Color fg = dc.textForeground(style);
Color bg = dc.widgetBackground(style);
if (state & STATE_HARD_FOCUSED) {
fg = dc.textSelected(style);
bg = dc.accentWidgetBackground(style);
}
dc.fillRect(rect, bg);
if (state & STATE_HOVERED) {
bg = dc.accentWidgetBackground(style);
dc.fillRect(rect, Color(bg.r, bg.g, bg.b, 0.2f));
}
Size text_size = dc.measureTextMultiline(font, text);
Rect local_rect = rect;
Size image_size = image->size();
int x = rect.x;
switch (h_align) {
case HorizontalAlignment::Right: x = rect.x + rect.w - (image_size.w + text_size.w + (padding * 2)); break;
case HorizontalAlignment::Center: x = rect.x + (rect.w / 2) - ((image_size.w + text_size.w + (padding * 2)) / 2); break;
default: break;
}
dc.drawTexture(
Point(
x,
local_rect.y + (local_rect.h * 0.5) - (image_size.h * 0.5)
),
image_size,
image->_texture(),
image->coords(),
image->foreground()
);
// Resize local_rect to account for image before the label is drawn.
local_rect.x += image_size.w;
local_rect.w -= image_size.w;
dc.fillTextMultilineAligned(
font,
text,
h_align,
VerticalAlignment::Center,
local_rect,
padding,
fg
);
}
Size ImageTextCellRenderer::sizeHint(DrawingContext &dc) {
if (m_size_changed) {
Size s = dc.measureTextMultiline(font, text);
s.w += image->size().w;
if (image->size().h > s.h) {
s.h = image->size().h;
}
s.w += padding * 2;
s.h += padding * 2;
m_size = s;
return s;
} else {
return m_size;
}
}
| 27.759259 | 128 | 0.597899 | [
"vector"
] |
c1227d0b0c83ffdbd01e9ddfd1284dbd7c252fd5 | 837,652 | cpp | C++ | src/main_2700.cpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | src/main_2700.cpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | src/main_2700.cpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | // Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Microsoft.Win32.SafeHandles.SafeFindHandle
#include "Microsoft/Win32/SafeHandles/SafeFindHandle.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Microsoft.Win32.SafeHandles.SafeFindHandle.ReleaseHandle
bool Microsoft::Win32::SafeHandles::SafeFindHandle::ReleaseHandle() {
static auto ___internal__logger = ::Logger::get().WithContext("::Microsoft::Win32::SafeHandles::SafeFindHandle::ReleaseHandle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReleaseHandle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Microsoft.Win32.SafeHandles.SafeRegistryHandle
#include "Microsoft/Win32/SafeHandles/SafeRegistryHandle.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Microsoft.Win32.SafeHandles.SafeRegistryHandle.ReleaseHandle
bool Microsoft::Win32::SafeHandles::SafeRegistryHandle::ReleaseHandle() {
static auto ___internal__logger = ::Logger::get().WithContext("::Microsoft::Win32::SafeHandles::SafeRegistryHandle::ReleaseHandle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReleaseHandle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Microsoft.Win32.SafeHandles.SafeWaitHandle
#include "Microsoft/Win32/SafeHandles/SafeWaitHandle.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Microsoft.Win32.SafeHandles.SafeWaitHandle.ReleaseHandle
bool Microsoft::Win32::SafeHandles::SafeWaitHandle::ReleaseHandle() {
static auto ___internal__logger = ::Logger::get().WithContext("::Microsoft::Win32::SafeHandles::SafeWaitHandle::ReleaseHandle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReleaseHandle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
#include "Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid.get_IsInvalid
bool Microsoft::Win32::SafeHandles::SafeHandleZeroOrMinusOneIsInvalid::get_IsInvalid() {
static auto ___internal__logger = ::Logger::get().WithContext("::Microsoft::Win32::SafeHandles::SafeHandleZeroOrMinusOneIsInvalid::get_IsInvalid");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsInvalid", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.ThrowHelper
#include "System/ThrowHelper.hpp"
// Including type: System.Exception
#include "System/Exception.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: System.ExceptionResource
#include "System/ExceptionResource.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.ThrowHelper.ThrowArgumentNullException
void System::ThrowHelper::ThrowArgumentNullException(::System::ExceptionArgument argument) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ThrowHelper::ThrowArgumentNullException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ThrowHelper", "ThrowArgumentNullException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(argument)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, argument);
}
// Autogenerated method: System.ThrowHelper.CreateArgumentNullException
::System::Exception* System::ThrowHelper::CreateArgumentNullException(::System::ExceptionArgument argument) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ThrowHelper::CreateArgumentNullException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ThrowHelper", "CreateArgumentNullException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(argument)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Exception*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, argument);
}
// Autogenerated method: System.ThrowHelper.ThrowArgumentOutOfRangeException
void System::ThrowHelper::ThrowArgumentOutOfRangeException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ThrowHelper::ThrowArgumentOutOfRangeException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ThrowHelper", "ThrowArgumentOutOfRangeException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.ThrowHelper.ThrowWrongValueTypeArgumentException
void System::ThrowHelper::ThrowWrongValueTypeArgumentException(::Il2CppObject* value, ::System::Type* targetType) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ThrowHelper::ThrowWrongValueTypeArgumentException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ThrowHelper", "ThrowWrongValueTypeArgumentException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(targetType)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, targetType);
}
// Autogenerated method: System.ThrowHelper.ThrowArgumentException
void System::ThrowHelper::ThrowArgumentException(::System::ExceptionResource resource) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ThrowHelper::ThrowArgumentException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ThrowHelper", "ThrowArgumentException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(resource)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, resource);
}
// Autogenerated method: System.ThrowHelper.ThrowArgumentOutOfRangeException
void System::ThrowHelper::ThrowArgumentOutOfRangeException(::System::ExceptionArgument argument, ::System::ExceptionResource resource) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ThrowHelper::ThrowArgumentOutOfRangeException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ThrowHelper", "ThrowArgumentOutOfRangeException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(argument), ::il2cpp_utils::ExtractType(resource)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, argument, resource);
}
// Autogenerated method: System.ThrowHelper.ThrowInvalidOperationException
void System::ThrowHelper::ThrowInvalidOperationException(::System::ExceptionResource resource) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ThrowHelper::ThrowInvalidOperationException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ThrowHelper", "ThrowInvalidOperationException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(resource)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, resource);
}
// Autogenerated method: System.ThrowHelper.ThrowNotSupportedException
void System::ThrowHelper::ThrowNotSupportedException(::System::ExceptionResource resource) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ThrowHelper::ThrowNotSupportedException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ThrowHelper", "ThrowNotSupportedException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(resource)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, resource);
}
// Autogenerated method: System.ThrowHelper.GetArgumentName
::StringW System::ThrowHelper::GetArgumentName(::System::ExceptionArgument argument) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ThrowHelper::GetArgumentName");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ThrowHelper", "GetArgumentName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(argument)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, argument);
}
// Autogenerated method: System.ThrowHelper.GetResourceName
::StringW System::ThrowHelper::GetResourceName(::System::ExceptionResource resource) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ThrowHelper::GetResourceName");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ThrowHelper", "GetResourceName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(resource)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, resource);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.ValueTuple
#include "System/ValueTuple.hpp"
// Including type: System.Collections.IEqualityComparer
#include "System/Collections/IEqualityComparer.hpp"
// Including type: System.Collections.IComparer
#include "System/Collections/IComparer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.ValueTuple.Equals
bool System::ValueTuple::Equals(::System::ValueTuple other) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(other)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, other);
}
// Autogenerated method: System.ValueTuple.System.Collections.IStructuralEquatable.Equals
bool System::ValueTuple::System_Collections_IStructuralEquatable_Equals(::Il2CppObject* other, ::System::Collections::IEqualityComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::System.Collections.IStructuralEquatable.Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.Collections.IStructuralEquatable.Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(other), ::il2cpp_utils::ExtractType(comparer)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, other, comparer);
}
// Autogenerated method: System.ValueTuple.System.IComparable.CompareTo
int System::ValueTuple::System_IComparable_CompareTo(::Il2CppObject* other) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::System.IComparable.CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IComparable.CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(other)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, other);
}
// Autogenerated method: System.ValueTuple.CompareTo
int System::ValueTuple::CompareTo(::System::ValueTuple other) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(other)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, other);
}
// Autogenerated method: System.ValueTuple.System.Collections.IStructuralComparable.CompareTo
int System::ValueTuple::System_Collections_IStructuralComparable_CompareTo(::Il2CppObject* other, ::System::Collections::IComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::System.Collections.IStructuralComparable.CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.Collections.IStructuralComparable.CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(other), ::il2cpp_utils::ExtractType(comparer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, other, comparer);
}
// Autogenerated method: System.ValueTuple.System.Collections.IStructuralEquatable.GetHashCode
int System::ValueTuple::System_Collections_IStructuralEquatable_GetHashCode(::System::Collections::IEqualityComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::System.Collections.IStructuralEquatable.GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.Collections.IStructuralEquatable.GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(comparer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, comparer);
}
// Autogenerated method: System.ValueTuple.CombineHashCodes
int System::ValueTuple::CombineHashCodes(int h1, int h2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::CombineHashCodes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ValueTuple", "CombineHashCodes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(h1), ::il2cpp_utils::ExtractType(h2)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, h1, h2);
}
// Autogenerated method: System.ValueTuple.CombineHashCodes
int System::ValueTuple::CombineHashCodes(int h1, int h2, int h3) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::CombineHashCodes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ValueTuple", "CombineHashCodes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(h1), ::il2cpp_utils::ExtractType(h2), ::il2cpp_utils::ExtractType(h3)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, h1, h2, h3);
}
// Autogenerated method: System.ValueTuple.CombineHashCodes
int System::ValueTuple::CombineHashCodes(int h1, int h2, int h3, int h4) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::CombineHashCodes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ValueTuple", "CombineHashCodes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(h1), ::il2cpp_utils::ExtractType(h2), ::il2cpp_utils::ExtractType(h3), ::il2cpp_utils::ExtractType(h4)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, h1, h2, h3, h4);
}
// Autogenerated method: System.ValueTuple.CombineHashCodes
int System::ValueTuple::CombineHashCodes(int h1, int h2, int h3, int h4, int h5) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::CombineHashCodes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ValueTuple", "CombineHashCodes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(h1), ::il2cpp_utils::ExtractType(h2), ::il2cpp_utils::ExtractType(h3), ::il2cpp_utils::ExtractType(h4), ::il2cpp_utils::ExtractType(h5)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, h1, h2, h3, h4, h5);
}
// Autogenerated method: System.ValueTuple.Equals
bool System::ValueTuple::Equals(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.ValueTuple.GetHashCode
int System::ValueTuple::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.ValueTuple.ToString
::StringW System::ValueTuple::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ValueTuple::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Array
#include "System/Array.hpp"
// Including type: System.Array/System.ArrayEnumerator
#include "System/Array_ArrayEnumerator.hpp"
// Including type: System.Array/System.InternalEnumerator`1
#include "System/Array_InternalEnumerator_1.hpp"
// Including type: System.Array/System.EmptyInternalEnumerator`1
#include "System/Array_EmptyInternalEnumerator_1.hpp"
// Including type: System.Array/System.SorterObjectArray
#include "System/Array_SorterObjectArray.hpp"
// Including type: System.Array/System.SorterGenericArray
#include "System/Array_SorterGenericArray.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: System.Collections.ObjectModel.ReadOnlyCollection`1
#include "System/Collections/ObjectModel/ReadOnlyCollection_1.hpp"
// Including type: System.Collections.IComparer
#include "System/Collections/IComparer.hpp"
// Including type: System.Collections.IEqualityComparer
#include "System/Collections/IEqualityComparer.hpp"
// Including type: System.Converter`2
#include "System/Converter_2.hpp"
// Including type: System.Action`1
#include "System/Action_1.hpp"
// Including type: System.Collections.Generic.IComparer`1
#include "System/Collections/Generic/IComparer_1.hpp"
// Including type: System.Comparison`1
#include "System/Comparison_1.hpp"
// Including type: System.Predicate`1
#include "System/Predicate_1.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
// Including type: System.Collections.Generic.IEnumerator`1
#include "System/Collections/Generic/IEnumerator_1.hpp"
// Including type: System.Exception
#include "System/Exception.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Array.System.Collections.ICollection.get_Count
int System::Array::System_Collections_ICollection_get_Count() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.ICollection.get_Count");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.ICollection.get_Count", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.System.Collections.IList.get_IsReadOnly
bool System::Array::System_Collections_IList_get_IsReadOnly() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IList.get_IsReadOnly");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IList.get_IsReadOnly", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.System.Collections.IList.get_Item
::Il2CppObject* System::Array::System_Collections_IList_get_Item(int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IList.get_Item");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IList.get_Item", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, index);
}
// Autogenerated method: System.Array.System.Collections.IList.set_Item
void System::Array::System_Collections_IList_set_Item(int index, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IList.set_Item");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IList.set_Item", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, index, value);
}
// Autogenerated method: System.Array.get_LongLength
int64_t System::Array::get_LongLength() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::get_LongLength");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_LongLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.get_IsFixedSize
bool System::Array::get_IsFixedSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::get_IsFixedSize");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsFixedSize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.get_IsReadOnly
bool System::Array::get_IsReadOnly() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::get_IsReadOnly");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsReadOnly", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.get_IsSynchronized
bool System::Array::get_IsSynchronized() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::get_IsSynchronized");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsSynchronized", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.get_SyncRoot
::Il2CppObject* System::Array::get_SyncRoot() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::get_SyncRoot");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SyncRoot", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.get_Length
int System::Array::get_Length() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::get_Length");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Length", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.get_Rank
int System::Array::get_Rank() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::get_Rank");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Rank", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.CreateInstance
::System::Array* System::Array::CreateInstance(::System::Type* elementType, ::ArrayW<int64_t> lengths) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(elementType), ::il2cpp_utils::ExtractType(lengths)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, elementType, lengths);
}
// Autogenerated method: System.Array.System.Collections.IList.Add
int System::Array::System_Collections_IList_Add(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IList.Add");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IList.Add", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Array.System.Collections.IList.Contains
bool System::Array::System_Collections_IList_Contains(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IList.Contains");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IList.Contains", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Array.System.Collections.IList.Clear
void System::Array::System_Collections_IList_Clear() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IList.Clear");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IList.Clear", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.System.Collections.IList.IndexOf
int System::Array::System_Collections_IList_IndexOf(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IList.IndexOf");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IList.IndexOf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Array.System.Collections.IList.Insert
void System::Array::System_Collections_IList_Insert(int index, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IList.Insert");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IList.Insert", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, index, value);
}
// Autogenerated method: System.Array.System.Collections.IList.Remove
void System::Array::System_Collections_IList_Remove(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IList.Remove");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IList.Remove", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Array.System.Collections.IList.RemoveAt
void System::Array::System_Collections_IList_RemoveAt(int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IList.RemoveAt");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IList.RemoveAt", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, index);
}
// Autogenerated method: System.Array.CopyTo
void System::Array::CopyTo(::System::Array* array, int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CopyTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CopyTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(index)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, array, index);
}
// Autogenerated method: System.Array.Clone
::Il2CppObject* System::Array::Clone() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Clone");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Clone", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.System.Collections.IStructuralComparable.CompareTo
int System::Array::System_Collections_IStructuralComparable_CompareTo(::Il2CppObject* other, ::System::Collections::IComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IStructuralComparable.CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IStructuralComparable.CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(other), ::il2cpp_utils::ExtractType(comparer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, other, comparer);
}
// Autogenerated method: System.Array.System.Collections.IStructuralEquatable.Equals
bool System::Array::System_Collections_IStructuralEquatable_Equals(::Il2CppObject* other, ::System::Collections::IEqualityComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IStructuralEquatable.Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IStructuralEquatable.Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(other), ::il2cpp_utils::ExtractType(comparer)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, other, comparer);
}
// Autogenerated method: System.Array.CombineHashCodes
int System::Array::CombineHashCodes(int h1, int h2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CombineHashCodes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "CombineHashCodes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(h1), ::il2cpp_utils::ExtractType(h2)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, h1, h2);
}
// Autogenerated method: System.Array.System.Collections.IStructuralEquatable.GetHashCode
int System::Array::System_Collections_IStructuralEquatable_GetHashCode(::System::Collections::IEqualityComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::System.Collections.IStructuralEquatable.GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IStructuralEquatable.GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(comparer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, comparer);
}
// Autogenerated method: System.Array.BinarySearch
int System::Array::BinarySearch(::System::Array* array, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::BinarySearch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "BinarySearch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, value);
}
// Autogenerated method: System.Array.Copy
void System::Array::Copy(::System::Array* sourceArray, ::System::Array* destinationArray, int64_t length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Copy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Copy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sourceArray), ::il2cpp_utils::ExtractType(destinationArray), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sourceArray, destinationArray, length);
}
// Autogenerated method: System.Array.Copy
void System::Array::Copy(::System::Array* sourceArray, int64_t sourceIndex, ::System::Array* destinationArray, int64_t destinationIndex, int64_t length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Copy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Copy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sourceArray), ::il2cpp_utils::ExtractType(sourceIndex), ::il2cpp_utils::ExtractType(destinationArray), ::il2cpp_utils::ExtractType(destinationIndex), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sourceArray, sourceIndex, destinationArray, destinationIndex, length);
}
// Autogenerated method: System.Array.CopyTo
void System::Array::CopyTo(::System::Array* array, int64_t index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CopyTo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CopyTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(index)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, array, index);
}
// Autogenerated method: System.Array.GetLongLength
int64_t System::Array::GetLongLength(int dimension) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetLongLength");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetLongLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dimension)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, dimension);
}
// Autogenerated method: System.Array.GetValue
::Il2CppObject* System::Array::GetValue(int64_t index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, index);
}
// Autogenerated method: System.Array.GetValue
::Il2CppObject* System::Array::GetValue(int64_t index1, int64_t index2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index1), ::il2cpp_utils::ExtractType(index2)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, index1, index2);
}
// Autogenerated method: System.Array.GetValue
::Il2CppObject* System::Array::GetValue(int64_t index1, int64_t index2, int64_t index3) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index1), ::il2cpp_utils::ExtractType(index2), ::il2cpp_utils::ExtractType(index3)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, index1, index2, index3);
}
// Autogenerated method: System.Array.GetValue
::Il2CppObject* System::Array::GetValue(::ArrayW<int64_t> indices) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(indices)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, indices);
}
// Autogenerated method: System.Array.BinarySearch
int System::Array::BinarySearch(::System::Array* array, int index, int length, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::BinarySearch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "BinarySearch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(length), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, index, length, value);
}
// Autogenerated method: System.Array.BinarySearch
int System::Array::BinarySearch(::System::Array* array, ::Il2CppObject* value, ::System::Collections::IComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::BinarySearch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "BinarySearch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(comparer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, value, comparer);
}
// Autogenerated method: System.Array.BinarySearch
int System::Array::BinarySearch(::System::Array* array, int index, int length, ::Il2CppObject* value, ::System::Collections::IComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::BinarySearch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "BinarySearch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(length), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(comparer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, index, length, value, comparer);
}
// Autogenerated method: System.Array.GetMedian
int System::Array::GetMedian(int low, int hi) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetMedian");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "GetMedian", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(low), ::il2cpp_utils::ExtractType(hi)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, low, hi);
}
// Autogenerated method: System.Array.IndexOf
int System::Array::IndexOf(::System::Array* array, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::IndexOf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "IndexOf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, value);
}
// Autogenerated method: System.Array.IndexOf
int System::Array::IndexOf(::System::Array* array, ::Il2CppObject* value, int startIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::IndexOf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "IndexOf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, value, startIndex);
}
// Autogenerated method: System.Array.IndexOf
int System::Array::IndexOf(::System::Array* array, ::Il2CppObject* value, int startIndex, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::IndexOf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "IndexOf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex), ::il2cpp_utils::ExtractType(count)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, value, startIndex, count);
}
// Autogenerated method: System.Array.LastIndexOf
int System::Array::LastIndexOf(::System::Array* array, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::LastIndexOf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "LastIndexOf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, value);
}
// Autogenerated method: System.Array.LastIndexOf
int System::Array::LastIndexOf(::System::Array* array, ::Il2CppObject* value, int startIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::LastIndexOf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "LastIndexOf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, value, startIndex);
}
// Autogenerated method: System.Array.LastIndexOf
int System::Array::LastIndexOf(::System::Array* array, ::Il2CppObject* value, int startIndex, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::LastIndexOf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "LastIndexOf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex), ::il2cpp_utils::ExtractType(count)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, value, startIndex, count);
}
// Autogenerated method: System.Array.Reverse
void System::Array::Reverse(::System::Array* array) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Reverse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Reverse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array);
}
// Autogenerated method: System.Array.Reverse
void System::Array::Reverse(::System::Array* array, int index, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Reverse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Reverse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, index, length);
}
// Autogenerated method: System.Array.SetValue
void System::Array::SetValue(::Il2CppObject* value, int64_t index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(index)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, index);
}
// Autogenerated method: System.Array.SetValue
void System::Array::SetValue(::Il2CppObject* value, int64_t index1, int64_t index2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(index1), ::il2cpp_utils::ExtractType(index2)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, index1, index2);
}
// Autogenerated method: System.Array.SetValue
void System::Array::SetValue(::Il2CppObject* value, int64_t index1, int64_t index2, int64_t index3) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(index1), ::il2cpp_utils::ExtractType(index2), ::il2cpp_utils::ExtractType(index3)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, index1, index2, index3);
}
// Autogenerated method: System.Array.SetValue
void System::Array::SetValue(::Il2CppObject* value, ::ArrayW<int64_t> indices) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(indices)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, indices);
}
// Autogenerated method: System.Array.Sort
void System::Array::Sort(::System::Array* array) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Sort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Sort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array);
}
// Autogenerated method: System.Array.Sort
void System::Array::Sort(::System::Array* array, int index, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Sort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Sort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, index, length);
}
// Autogenerated method: System.Array.Sort
void System::Array::Sort(::System::Array* array, ::System::Collections::IComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Sort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Sort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(comparer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, comparer);
}
// Autogenerated method: System.Array.Sort
void System::Array::Sort(::System::Array* array, int index, int length, ::System::Collections::IComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Sort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Sort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(length), ::il2cpp_utils::ExtractType(comparer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, index, length, comparer);
}
// Autogenerated method: System.Array.Sort
void System::Array::Sort(::System::Array* keys, ::System::Array* items) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Sort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Sort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(keys), ::il2cpp_utils::ExtractType(items)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, keys, items);
}
// Autogenerated method: System.Array.Sort
void System::Array::Sort(::System::Array* keys, ::System::Array* items, ::System::Collections::IComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Sort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Sort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(keys), ::il2cpp_utils::ExtractType(items), ::il2cpp_utils::ExtractType(comparer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, keys, items, comparer);
}
// Autogenerated method: System.Array.Sort
void System::Array::Sort(::System::Array* keys, ::System::Array* items, int index, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Sort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Sort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(keys), ::il2cpp_utils::ExtractType(items), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, keys, items, index, length);
}
// Autogenerated method: System.Array.Sort
void System::Array::Sort(::System::Array* keys, ::System::Array* items, int index, int length, ::System::Collections::IComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Sort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Sort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(keys), ::il2cpp_utils::ExtractType(items), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(length), ::il2cpp_utils::ExtractType(comparer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, keys, items, index, length, comparer);
}
// Autogenerated method: System.Array.GetEnumerator
::System::Collections::IEnumerator* System::Array::GetEnumerator() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetEnumerator");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetEnumerator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.InternalArray__ICollection_get_Count
int System::Array::InternalArray__ICollection_get_Count() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::InternalArray__ICollection_get_Count");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InternalArray__ICollection_get_Count", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.InternalArray__ICollection_get_IsReadOnly
bool System::Array::InternalArray__ICollection_get_IsReadOnly() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::InternalArray__ICollection_get_IsReadOnly");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InternalArray__ICollection_get_IsReadOnly", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.InternalArray__ICollection_Clear
void System::Array::InternalArray__ICollection_Clear() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::InternalArray__ICollection_Clear");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InternalArray__ICollection_Clear", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.InternalArray__IReadOnlyCollection_get_Count
int System::Array::InternalArray__IReadOnlyCollection_get_Count() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::InternalArray__IReadOnlyCollection_get_Count");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InternalArray__IReadOnlyCollection_get_Count", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.InternalArray__RemoveAt
void System::Array::InternalArray__RemoveAt(int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::InternalArray__RemoveAt");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InternalArray__RemoveAt", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, index);
}
// Autogenerated method: System.Array.GetRank
int System::Array::GetRank() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetRank");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetRank", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.GetLength
int System::Array::GetLength(int dimension) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetLength");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dimension)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, dimension);
}
// Autogenerated method: System.Array.GetLowerBound
int System::Array::GetLowerBound(int dimension) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetLowerBound");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetLowerBound", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dimension)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, dimension);
}
// Autogenerated method: System.Array.GetValue
::Il2CppObject* System::Array::GetValue(::ArrayW<int> indices) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(indices)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, indices);
}
// Autogenerated method: System.Array.SetValue
void System::Array::SetValue(::Il2CppObject* value, ::ArrayW<int> indices) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(indices)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, indices);
}
// Autogenerated method: System.Array.GetValueImpl
::Il2CppObject* System::Array::GetValueImpl(int pos) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetValueImpl");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValueImpl", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pos)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, pos);
}
// Autogenerated method: System.Array.SetValueImpl
void System::Array::SetValueImpl(::Il2CppObject* value, int pos) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SetValueImpl");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValueImpl", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(pos)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, pos);
}
// Autogenerated method: System.Array.FastCopy
bool System::Array::FastCopy(::System::Array* source, int source_idx, ::System::Array* dest, int dest_idx, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::FastCopy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "FastCopy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(source), ::il2cpp_utils::ExtractType(source_idx), ::il2cpp_utils::ExtractType(dest), ::il2cpp_utils::ExtractType(dest_idx), ::il2cpp_utils::ExtractType(length)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, source, source_idx, dest, dest_idx, length);
}
// Autogenerated method: System.Array.CreateInstanceImpl
::System::Array* System::Array::CreateInstanceImpl(::System::Type* elementType, ::ArrayW<int> lengths, ::ArrayW<int> bounds) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CreateInstanceImpl");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "CreateInstanceImpl", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(elementType), ::il2cpp_utils::ExtractType(lengths), ::il2cpp_utils::ExtractType(bounds)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, elementType, lengths, bounds);
}
// Autogenerated method: System.Array.GetUpperBound
int System::Array::GetUpperBound(int dimension) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetUpperBound");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetUpperBound", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dimension)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, dimension);
}
// Autogenerated method: System.Array.GetValue
::Il2CppObject* System::Array::GetValue(int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, index);
}
// Autogenerated method: System.Array.GetValue
::Il2CppObject* System::Array::GetValue(int index1, int index2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index1), ::il2cpp_utils::ExtractType(index2)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, index1, index2);
}
// Autogenerated method: System.Array.GetValue
::Il2CppObject* System::Array::GetValue(int index1, int index2, int index3) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::GetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index1), ::il2cpp_utils::ExtractType(index2), ::il2cpp_utils::ExtractType(index3)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, index1, index2, index3);
}
// Autogenerated method: System.Array.SetValue
void System::Array::SetValue(::Il2CppObject* value, int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(index)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, index);
}
// Autogenerated method: System.Array.SetValue
void System::Array::SetValue(::Il2CppObject* value, int index1, int index2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(index1), ::il2cpp_utils::ExtractType(index2)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, index1, index2);
}
// Autogenerated method: System.Array.SetValue
void System::Array::SetValue(::Il2CppObject* value, int index1, int index2, int index3) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(index1), ::il2cpp_utils::ExtractType(index2), ::il2cpp_utils::ExtractType(index3)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, index1, index2, index3);
}
// Autogenerated method: System.Array.UnsafeCreateInstance
::System::Array* System::Array::UnsafeCreateInstance(::System::Type* elementType, ::ArrayW<int> lengths, ::ArrayW<int> lowerBounds) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::UnsafeCreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "UnsafeCreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(elementType), ::il2cpp_utils::ExtractType(lengths), ::il2cpp_utils::ExtractType(lowerBounds)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, elementType, lengths, lowerBounds);
}
// Autogenerated method: System.Array.UnsafeCreateInstance
::System::Array* System::Array::UnsafeCreateInstance(::System::Type* elementType, int length1, int length2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::UnsafeCreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "UnsafeCreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(elementType), ::il2cpp_utils::ExtractType(length1), ::il2cpp_utils::ExtractType(length2)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, elementType, length1, length2);
}
// Autogenerated method: System.Array.UnsafeCreateInstance
::System::Array* System::Array::UnsafeCreateInstance(::System::Type* elementType, ::ArrayW<int> lengths) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::UnsafeCreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "UnsafeCreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(elementType), ::il2cpp_utils::ExtractType(lengths)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, elementType, lengths);
}
// Autogenerated method: System.Array.CreateInstance
::System::Array* System::Array::CreateInstance(::System::Type* elementType, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(elementType), ::il2cpp_utils::ExtractType(length)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, elementType, length);
}
// Autogenerated method: System.Array.CreateInstance
::System::Array* System::Array::CreateInstance(::System::Type* elementType, int length1, int length2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(elementType), ::il2cpp_utils::ExtractType(length1), ::il2cpp_utils::ExtractType(length2)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, elementType, length1, length2);
}
// Autogenerated method: System.Array.CreateInstance
::System::Array* System::Array::CreateInstance(::System::Type* elementType, int length1, int length2, int length3) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(elementType), ::il2cpp_utils::ExtractType(length1), ::il2cpp_utils::ExtractType(length2), ::il2cpp_utils::ExtractType(length3)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, elementType, length1, length2, length3);
}
// Autogenerated method: System.Array.CreateInstance
::System::Array* System::Array::CreateInstance(::System::Type* elementType, ::ArrayW<int> lengths) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(elementType), ::il2cpp_utils::ExtractType(lengths)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, elementType, lengths);
}
// Autogenerated method: System.Array.CreateInstance
::System::Array* System::Array::CreateInstance(::System::Type* elementType, ::ArrayW<int> lengths, ::ArrayW<int> lowerBounds) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(elementType), ::il2cpp_utils::ExtractType(lengths), ::il2cpp_utils::ExtractType(lowerBounds)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, elementType, lengths, lowerBounds);
}
// Autogenerated method: System.Array.Clear
void System::Array::Clear(::System::Array* array, int index, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Clear");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Clear", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array, index, length);
}
// Autogenerated method: System.Array.ClearInternal
void System::Array::ClearInternal(::System::Array* a, int index, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::ClearInternal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "ClearInternal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(a), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, a, index, count);
}
// Autogenerated method: System.Array.Copy
void System::Array::Copy(::System::Array* sourceArray, ::System::Array* destinationArray, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Copy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Copy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sourceArray), ::il2cpp_utils::ExtractType(destinationArray), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sourceArray, destinationArray, length);
}
// Autogenerated method: System.Array.Copy
void System::Array::Copy(::System::Array* sourceArray, int sourceIndex, ::System::Array* destinationArray, int destinationIndex, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Copy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "Copy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sourceArray), ::il2cpp_utils::ExtractType(sourceIndex), ::il2cpp_utils::ExtractType(destinationArray), ::il2cpp_utils::ExtractType(destinationIndex), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sourceArray, sourceIndex, destinationArray, destinationIndex, length);
}
// Autogenerated method: System.Array.CreateArrayTypeMismatchException
::System::Exception* System::Array::CreateArrayTypeMismatchException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CreateArrayTypeMismatchException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "CreateArrayTypeMismatchException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Exception*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Array.CanAssignArrayElement
bool System::Array::CanAssignArrayElement(::System::Type* source, ::System::Type* target) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::CanAssignArrayElement");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "CanAssignArrayElement", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(source), ::il2cpp_utils::ExtractType(target)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, source, target);
}
// Autogenerated method: System.Array.ConstrainedCopy
void System::Array::ConstrainedCopy(::System::Array* sourceArray, int sourceIndex, ::System::Array* destinationArray, int destinationIndex, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::ConstrainedCopy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "ConstrainedCopy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sourceArray), ::il2cpp_utils::ExtractType(sourceIndex), ::il2cpp_utils::ExtractType(destinationArray), ::il2cpp_utils::ExtractType(destinationIndex), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sourceArray, sourceIndex, destinationArray, destinationIndex, length);
}
// Autogenerated method: System.Array.Initialize
void System::Array::Initialize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::Initialize");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Initialize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Array.SortImpl
void System::Array::SortImpl(::System::Array* keys, ::System::Array* items, int index, int length, ::System::Collections::IComparer* comparer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SortImpl");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Array", "SortImpl", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(keys), ::il2cpp_utils::ExtractType(items), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(length), ::il2cpp_utils::ExtractType(comparer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, keys, items, index, length, comparer);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Array/System.ArrayEnumerator
#include "System/Array_ArrayEnumerator.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Array _array
::System::Array*& System::Array::ArrayEnumerator::dyn__array() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::ArrayEnumerator::dyn__array");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_array"))->offset;
return *reinterpret_cast<::System::Array**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _index
int& System::Array::ArrayEnumerator::dyn__index() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::ArrayEnumerator::dyn__index");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_index"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _endIndex
int& System::Array::ArrayEnumerator::dyn__endIndex() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::ArrayEnumerator::dyn__endIndex");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_endIndex"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Array/System.ArrayEnumerator.get_Current
::Il2CppObject* System::Array::ArrayEnumerator::get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::ArrayEnumerator::get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: System.Array/System.ArrayEnumerator.MoveNext
bool System::Array::ArrayEnumerator::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::ArrayEnumerator::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Array/System.ArrayEnumerator.Reset
void System::Array::ArrayEnumerator::Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::ArrayEnumerator::Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Array/System.ArrayEnumerator.Clone
::Il2CppObject* System::Array::ArrayEnumerator::Clone() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::ArrayEnumerator::Clone");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Clone", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Array/System.SorterObjectArray
#include "System/Array_SorterObjectArray.hpp"
// Including type: System.Collections.IComparer
#include "System/Collections/IComparer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Object[] keys
::ArrayW<::Il2CppObject*>& System::Array::SorterObjectArray::dyn_keys() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::dyn_keys");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "keys"))->offset;
return *reinterpret_cast<::ArrayW<::Il2CppObject*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object[] items
::ArrayW<::Il2CppObject*>& System::Array::SorterObjectArray::dyn_items() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::dyn_items");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "items"))->offset;
return *reinterpret_cast<::ArrayW<::Il2CppObject*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.IComparer comparer
::System::Collections::IComparer*& System::Array::SorterObjectArray::dyn_comparer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::dyn_comparer");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "comparer"))->offset;
return *reinterpret_cast<::System::Collections::IComparer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Array/System.SorterObjectArray..ctor
// ABORTED elsewhere. System::Array::SorterObjectArray::SorterObjectArray(::ArrayW<::Il2CppObject*> keys, ::ArrayW<::Il2CppObject*> items, ::System::Collections::IComparer* comparer)
// Autogenerated method: System.Array/System.SorterObjectArray.SwapIfGreaterWithItems
void System::Array::SorterObjectArray::SwapIfGreaterWithItems(int a, int b) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::SwapIfGreaterWithItems");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "SwapIfGreaterWithItems", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(a), ::il2cpp_utils::ExtractType(b)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, a, b);
}
// Autogenerated method: System.Array/System.SorterObjectArray.Swap
void System::Array::SorterObjectArray::Swap(int i, int j) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::Swap");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Swap", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(i), ::il2cpp_utils::ExtractType(j)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, i, j);
}
// Autogenerated method: System.Array/System.SorterObjectArray.Sort
void System::Array::SorterObjectArray::Sort(int left, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::Sort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Sort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(left), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, left, length);
}
// Autogenerated method: System.Array/System.SorterObjectArray.IntrospectiveSort
void System::Array::SorterObjectArray::IntrospectiveSort(int left, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::IntrospectiveSort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "IntrospectiveSort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(left), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, left, length);
}
// Autogenerated method: System.Array/System.SorterObjectArray.IntroSort
void System::Array::SorterObjectArray::IntroSort(int lo, int hi, int depthLimit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::IntroSort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "IntroSort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(lo), ::il2cpp_utils::ExtractType(hi), ::il2cpp_utils::ExtractType(depthLimit)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, lo, hi, depthLimit);
}
// Autogenerated method: System.Array/System.SorterObjectArray.PickPivotAndPartition
int System::Array::SorterObjectArray::PickPivotAndPartition(int lo, int hi) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::PickPivotAndPartition");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "PickPivotAndPartition", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(lo), ::il2cpp_utils::ExtractType(hi)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, lo, hi);
}
// Autogenerated method: System.Array/System.SorterObjectArray.Heapsort
void System::Array::SorterObjectArray::Heapsort(int lo, int hi) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::Heapsort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Heapsort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(lo), ::il2cpp_utils::ExtractType(hi)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, lo, hi);
}
// Autogenerated method: System.Array/System.SorterObjectArray.DownHeap
void System::Array::SorterObjectArray::DownHeap(int i, int n, int lo) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::DownHeap");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "DownHeap", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(i), ::il2cpp_utils::ExtractType(n), ::il2cpp_utils::ExtractType(lo)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, i, n, lo);
}
// Autogenerated method: System.Array/System.SorterObjectArray.InsertionSort
void System::Array::SorterObjectArray::InsertionSort(int lo, int hi) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterObjectArray::InsertionSort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "InsertionSort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(lo), ::il2cpp_utils::ExtractType(hi)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, lo, hi);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Array/System.SorterGenericArray
#include "System/Array_SorterGenericArray.hpp"
// Including type: System.Collections.IComparer
#include "System/Collections/IComparer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Array keys
::System::Array*& System::Array::SorterGenericArray::dyn_keys() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::dyn_keys");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "keys"))->offset;
return *reinterpret_cast<::System::Array**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Array items
::System::Array*& System::Array::SorterGenericArray::dyn_items() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::dyn_items");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "items"))->offset;
return *reinterpret_cast<::System::Array**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.IComparer comparer
::System::Collections::IComparer*& System::Array::SorterGenericArray::dyn_comparer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::dyn_comparer");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "comparer"))->offset;
return *reinterpret_cast<::System::Collections::IComparer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Array/System.SorterGenericArray..ctor
// ABORTED elsewhere. System::Array::SorterGenericArray::SorterGenericArray(::System::Array* keys, ::System::Array* items, ::System::Collections::IComparer* comparer)
// Autogenerated method: System.Array/System.SorterGenericArray.SwapIfGreaterWithItems
void System::Array::SorterGenericArray::SwapIfGreaterWithItems(int a, int b) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::SwapIfGreaterWithItems");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "SwapIfGreaterWithItems", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(a), ::il2cpp_utils::ExtractType(b)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, a, b);
}
// Autogenerated method: System.Array/System.SorterGenericArray.Swap
void System::Array::SorterGenericArray::Swap(int i, int j) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::Swap");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Swap", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(i), ::il2cpp_utils::ExtractType(j)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, i, j);
}
// Autogenerated method: System.Array/System.SorterGenericArray.Sort
void System::Array::SorterGenericArray::Sort(int left, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::Sort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Sort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(left), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, left, length);
}
// Autogenerated method: System.Array/System.SorterGenericArray.IntrospectiveSort
void System::Array::SorterGenericArray::IntrospectiveSort(int left, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::IntrospectiveSort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "IntrospectiveSort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(left), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, left, length);
}
// Autogenerated method: System.Array/System.SorterGenericArray.IntroSort
void System::Array::SorterGenericArray::IntroSort(int lo, int hi, int depthLimit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::IntroSort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "IntroSort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(lo), ::il2cpp_utils::ExtractType(hi), ::il2cpp_utils::ExtractType(depthLimit)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, lo, hi, depthLimit);
}
// Autogenerated method: System.Array/System.SorterGenericArray.PickPivotAndPartition
int System::Array::SorterGenericArray::PickPivotAndPartition(int lo, int hi) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::PickPivotAndPartition");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "PickPivotAndPartition", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(lo), ::il2cpp_utils::ExtractType(hi)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, lo, hi);
}
// Autogenerated method: System.Array/System.SorterGenericArray.Heapsort
void System::Array::SorterGenericArray::Heapsort(int lo, int hi) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::Heapsort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Heapsort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(lo), ::il2cpp_utils::ExtractType(hi)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, lo, hi);
}
// Autogenerated method: System.Array/System.SorterGenericArray.DownHeap
void System::Array::SorterGenericArray::DownHeap(int i, int n, int lo) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::DownHeap");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "DownHeap", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(i), ::il2cpp_utils::ExtractType(n), ::il2cpp_utils::ExtractType(lo)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, i, n, lo);
}
// Autogenerated method: System.Array/System.SorterGenericArray.InsertionSort
void System::Array::SorterGenericArray::InsertionSort(int lo, int hi) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Array::SorterGenericArray::InsertionSort");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "InsertionSort", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(lo), ::il2cpp_utils::ExtractType(hi)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, lo, hi);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ITupleInternal
#include "System/ITupleInternal.hpp"
// Including type: System.Text.StringBuilder
#include "System/Text/StringBuilder.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.ITupleInternal.ToString
::StringW System::ITupleInternal::ToString(::System::Text::StringBuilder* sb) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ITupleInternal::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sb)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, sb);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Tuple
#include "System/Tuple.hpp"
// Including type: System.Tuple`2
#include "System/Tuple_2.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Tuple.CombineHashCodes
int System::Tuple::CombineHashCodes(int h1, int h2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Tuple::CombineHashCodes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Tuple", "CombineHashCodes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(h1), ::il2cpp_utils::ExtractType(h2)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, h1, h2);
}
// Autogenerated method: System.Tuple.CombineHashCodes
int System::Tuple::CombineHashCodes(int h1, int h2, int h3) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Tuple::CombineHashCodes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Tuple", "CombineHashCodes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(h1), ::il2cpp_utils::ExtractType(h2), ::il2cpp_utils::ExtractType(h3)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, h1, h2, h3);
}
// Autogenerated method: System.Tuple.CombineHashCodes
int System::Tuple::CombineHashCodes(int h1, int h2, int h3, int h4) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Tuple::CombineHashCodes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Tuple", "CombineHashCodes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(h1), ::il2cpp_utils::ExtractType(h2), ::il2cpp_utils::ExtractType(h3), ::il2cpp_utils::ExtractType(h4)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, h1, h2, h3, h4);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.MonoTODOAttribute
#include "System/MonoTODOAttribute.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.String comment
::StringW& System::MonoTODOAttribute::dyn_comment() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::MonoTODOAttribute::dyn_comment");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "comment"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.MonoLimitationAttribute
#include "System/MonoLimitationAttribute.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.AggregateException
#include "System/AggregateException.hpp"
// Including type: System.Collections.ObjectModel.ReadOnlyCollection`1
#include "System/Collections/ObjectModel/ReadOnlyCollection_1.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.hpp"
// Including type: System.Collections.Generic.IList`1
#include "System/Collections/Generic/IList_1.hpp"
// Including type: System.Runtime.ExceptionServices.ExceptionDispatchInfo
#include "System/Runtime/ExceptionServices/ExceptionDispatchInfo.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Collections.ObjectModel.ReadOnlyCollection`1<System.Exception> m_innerExceptions
::System::Collections::ObjectModel::ReadOnlyCollection_1<::System::Exception*>*& System::AggregateException::dyn_m_innerExceptions() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AggregateException::dyn_m_innerExceptions");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_innerExceptions"))->offset;
return *reinterpret_cast<::System::Collections::ObjectModel::ReadOnlyCollection_1<::System::Exception*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.AggregateException.get_InnerExceptions
::System::Collections::ObjectModel::ReadOnlyCollection_1<::System::Exception*>* System::AggregateException::get_InnerExceptions() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AggregateException::get_InnerExceptions");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InnerExceptions", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::ObjectModel::ReadOnlyCollection_1<::System::Exception*>*, false>(this, ___internal__method);
}
// Autogenerated method: System.AggregateException.Flatten
::System::AggregateException* System::AggregateException::Flatten() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AggregateException::Flatten");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Flatten", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::AggregateException*, false>(this, ___internal__method);
}
// Autogenerated method: System.AggregateException.GetObjectData
void System::AggregateException::GetObjectData(::System::Runtime::Serialization::SerializationInfo* info, ::System::Runtime::Serialization::StreamingContext context) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AggregateException::GetObjectData");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetObjectData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractType(context)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, info, context);
}
// Autogenerated method: System.AggregateException.GetBaseException
::System::Exception* System::AggregateException::GetBaseException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AggregateException::GetBaseException");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetBaseException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Exception*, false>(this, ___internal__method);
}
// Autogenerated method: System.AggregateException.ToString
::StringW System::AggregateException::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AggregateException::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.AppContextSwitches
#include "System/AppContextSwitches.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly System.Boolean ThrowExceptionIfDisposedCancellationTokenSource
bool System::AppContextSwitches::_get_ThrowExceptionIfDisposedCancellationTokenSource() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AppContextSwitches::_get_ThrowExceptionIfDisposedCancellationTokenSource");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System", "AppContextSwitches", "ThrowExceptionIfDisposedCancellationTokenSource"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Boolean ThrowExceptionIfDisposedCancellationTokenSource
void System::AppContextSwitches::_set_ThrowExceptionIfDisposedCancellationTokenSource(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AppContextSwitches::_set_ThrowExceptionIfDisposedCancellationTokenSource");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AppContextSwitches", "ThrowExceptionIfDisposedCancellationTokenSource", value));
}
// Autogenerated static field getter
// Get static field: static public readonly System.Boolean SetActorAsReferenceWhenCopyingClaimsIdentity
bool System::AppContextSwitches::_get_SetActorAsReferenceWhenCopyingClaimsIdentity() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AppContextSwitches::_get_SetActorAsReferenceWhenCopyingClaimsIdentity");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System", "AppContextSwitches", "SetActorAsReferenceWhenCopyingClaimsIdentity"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Boolean SetActorAsReferenceWhenCopyingClaimsIdentity
void System::AppContextSwitches::_set_SetActorAsReferenceWhenCopyingClaimsIdentity(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AppContextSwitches::_set_SetActorAsReferenceWhenCopyingClaimsIdentity");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AppContextSwitches", "SetActorAsReferenceWhenCopyingClaimsIdentity", value));
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.__Filters
#include "System/__Filters.hpp"
// Including type: System.Reflection.MemberInfo
#include "System/Reflection/MemberInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static readonly System.__Filters Instance
::System::__Filters* System::__Filters::_get_Instance() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::__Filters::_get_Instance");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::__Filters*>("System", "__Filters", "Instance"));
}
// Autogenerated static field setter
// Set static field: static readonly System.__Filters Instance
void System::__Filters::_set_Instance(::System::__Filters* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::__Filters::_set_Instance");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "__Filters", "Instance", value));
}
// Autogenerated method: System.__Filters..cctor
void System::__Filters::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::__Filters::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "__Filters", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.__Filters.FilterAttribute
bool System::__Filters::FilterAttribute(::System::Reflection::MemberInfo* m, ::Il2CppObject* filterCriteria) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::__Filters::FilterAttribute");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FilterAttribute", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(m), ::il2cpp_utils::ExtractType(filterCriteria)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, m, filterCriteria);
}
// Autogenerated method: System.__Filters.FilterName
bool System::__Filters::FilterName(::System::Reflection::MemberInfo* m, ::Il2CppObject* filterCriteria) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::__Filters::FilterName");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FilterName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(m), ::il2cpp_utils::ExtractType(filterCriteria)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, m, filterCriteria);
}
// Autogenerated method: System.__Filters.FilterIgnoreCase
bool System::__Filters::FilterIgnoreCase(::System::Reflection::MemberInfo* m, ::Il2CppObject* filterCriteria) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::__Filters::FilterIgnoreCase");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FilterIgnoreCase", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(m), ::il2cpp_utils::ExtractType(filterCriteria)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, m, filterCriteria);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.LocalDataStoreHolder
#include "System/LocalDataStoreHolder.hpp"
// Including type: System.LocalDataStore
#include "System/LocalDataStore.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.LocalDataStore m_Store
::System::LocalDataStore*& System::LocalDataStoreHolder::dyn_m_Store() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreHolder::dyn_m_Store");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Store"))->offset;
return *reinterpret_cast<::System::LocalDataStore**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.LocalDataStoreHolder.get_Store
::System::LocalDataStore* System::LocalDataStoreHolder::get_Store() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreHolder::get_Store");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Store", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::LocalDataStore*, false>(this, ___internal__method);
}
// Autogenerated method: System.LocalDataStoreHolder.Finalize
void System::LocalDataStoreHolder::Finalize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreHolder::Finalize");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Finalize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.LocalDataStoreElement
#include "System/LocalDataStoreElement.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Object m_value
::Il2CppObject*& System::LocalDataStoreElement::dyn_m_value() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreElement::dyn_m_value");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_value"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int64 m_cookie
int64_t& System::LocalDataStoreElement::dyn_m_cookie() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreElement::dyn_m_cookie");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_cookie"))->offset;
return *reinterpret_cast<int64_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.LocalDataStoreElement.get_Value
::Il2CppObject* System::LocalDataStoreElement::get_Value() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreElement::get_Value");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Value", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: System.LocalDataStoreElement.set_Value
void System::LocalDataStoreElement::set_Value(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreElement::set_Value");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Value", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.LocalDataStoreElement.get_Cookie
int64_t System::LocalDataStoreElement::get_Cookie() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreElement::get_Cookie");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Cookie", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.LocalDataStore
#include "System/LocalDataStore.hpp"
// Including type: System.LocalDataStoreElement
#include "System/LocalDataStoreElement.hpp"
// Including type: System.LocalDataStoreMgr
#include "System/LocalDataStoreMgr.hpp"
// Including type: System.LocalDataStoreSlot
#include "System/LocalDataStoreSlot.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.LocalDataStoreElement[] m_DataTable
::ArrayW<::System::LocalDataStoreElement*>& System::LocalDataStore::dyn_m_DataTable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStore::dyn_m_DataTable");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_DataTable"))->offset;
return *reinterpret_cast<::ArrayW<::System::LocalDataStoreElement*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.LocalDataStoreMgr m_Manager
::System::LocalDataStoreMgr*& System::LocalDataStore::dyn_m_Manager() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStore::dyn_m_Manager");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Manager"))->offset;
return *reinterpret_cast<::System::LocalDataStoreMgr**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.LocalDataStore.Dispose
void System::LocalDataStore::Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStore::Dispose");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.LocalDataStore.GetData
::Il2CppObject* System::LocalDataStore::GetData(::System::LocalDataStoreSlot* slot) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStore::GetData");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(slot)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, slot);
}
// Autogenerated method: System.LocalDataStore.SetData
void System::LocalDataStore::SetData(::System::LocalDataStoreSlot* slot, ::Il2CppObject* data) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStore::SetData");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(slot), ::il2cpp_utils::ExtractType(data)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, slot, data);
}
// Autogenerated method: System.LocalDataStore.FreeData
void System::LocalDataStore::FreeData(int slot, int64_t cookie) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStore::FreeData");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FreeData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(slot), ::il2cpp_utils::ExtractType(cookie)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, slot, cookie);
}
// Autogenerated method: System.LocalDataStore.PopulateElement
::System::LocalDataStoreElement* System::LocalDataStore::PopulateElement(::System::LocalDataStoreSlot* slot) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStore::PopulateElement");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PopulateElement", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(slot)})));
return ::il2cpp_utils::RunMethodRethrow<::System::LocalDataStoreElement*, false>(this, ___internal__method, slot);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.LocalDataStoreSlot
#include "System/LocalDataStoreSlot.hpp"
// Including type: System.LocalDataStoreMgr
#include "System/LocalDataStoreMgr.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.LocalDataStoreMgr m_mgr
::System::LocalDataStoreMgr*& System::LocalDataStoreSlot::dyn_m_mgr() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreSlot::dyn_m_mgr");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_mgr"))->offset;
return *reinterpret_cast<::System::LocalDataStoreMgr**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 m_slot
int& System::LocalDataStoreSlot::dyn_m_slot() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreSlot::dyn_m_slot");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_slot"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int64 m_cookie
int64_t& System::LocalDataStoreSlot::dyn_m_cookie() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreSlot::dyn_m_cookie");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_cookie"))->offset;
return *reinterpret_cast<int64_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.LocalDataStoreSlot.get_Manager
::System::LocalDataStoreMgr* System::LocalDataStoreSlot::get_Manager() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreSlot::get_Manager");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Manager", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::LocalDataStoreMgr*, false>(this, ___internal__method);
}
// Autogenerated method: System.LocalDataStoreSlot.get_Slot
int System::LocalDataStoreSlot::get_Slot() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreSlot::get_Slot");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Slot", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.LocalDataStoreSlot.get_Cookie
int64_t System::LocalDataStoreSlot::get_Cookie() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreSlot::get_Cookie");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Cookie", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.LocalDataStoreSlot.Finalize
void System::LocalDataStoreSlot::Finalize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreSlot::Finalize");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Finalize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.LocalDataStoreMgr
#include "System/LocalDataStoreMgr.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: System.LocalDataStore
#include "System/LocalDataStore.hpp"
// Including type: System.Collections.Generic.Dictionary`2
#include "System/Collections/Generic/Dictionary_2.hpp"
// Including type: System.LocalDataStoreSlot
#include "System/LocalDataStoreSlot.hpp"
// Including type: System.LocalDataStoreHolder
#include "System/LocalDataStoreHolder.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Int32 InitialSlotTableSize
int System::LocalDataStoreMgr::_get_InitialSlotTableSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::_get_InitialSlotTableSize");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "LocalDataStoreMgr", "InitialSlotTableSize"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 InitialSlotTableSize
void System::LocalDataStoreMgr::_set_InitialSlotTableSize(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::_set_InitialSlotTableSize");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "LocalDataStoreMgr", "InitialSlotTableSize", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 SlotTableDoubleThreshold
int System::LocalDataStoreMgr::_get_SlotTableDoubleThreshold() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::_get_SlotTableDoubleThreshold");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "LocalDataStoreMgr", "SlotTableDoubleThreshold"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 SlotTableDoubleThreshold
void System::LocalDataStoreMgr::_set_SlotTableDoubleThreshold(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::_set_SlotTableDoubleThreshold");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "LocalDataStoreMgr", "SlotTableDoubleThreshold", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 LargeSlotTableSizeIncrease
int System::LocalDataStoreMgr::_get_LargeSlotTableSizeIncrease() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::_get_LargeSlotTableSizeIncrease");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "LocalDataStoreMgr", "LargeSlotTableSizeIncrease"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 LargeSlotTableSizeIncrease
void System::LocalDataStoreMgr::_set_LargeSlotTableSizeIncrease(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::_set_LargeSlotTableSizeIncrease");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "LocalDataStoreMgr", "LargeSlotTableSizeIncrease", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean[] m_SlotInfoTable
::ArrayW<bool>& System::LocalDataStoreMgr::dyn_m_SlotInfoTable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::dyn_m_SlotInfoTable");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_SlotInfoTable"))->offset;
return *reinterpret_cast<::ArrayW<bool>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 m_FirstAvailableSlot
int& System::LocalDataStoreMgr::dyn_m_FirstAvailableSlot() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::dyn_m_FirstAvailableSlot");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_FirstAvailableSlot"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<System.LocalDataStore> m_ManagedLocalDataStores
::System::Collections::Generic::List_1<::System::LocalDataStore*>*& System::LocalDataStoreMgr::dyn_m_ManagedLocalDataStores() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::dyn_m_ManagedLocalDataStores");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_ManagedLocalDataStores"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::System::LocalDataStore*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.Dictionary`2<System.String,System.LocalDataStoreSlot> m_KeyToSlotMap
::System::Collections::Generic::Dictionary_2<::StringW, ::System::LocalDataStoreSlot*>*& System::LocalDataStoreMgr::dyn_m_KeyToSlotMap() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::dyn_m_KeyToSlotMap");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_KeyToSlotMap"))->offset;
return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::StringW, ::System::LocalDataStoreSlot*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int64 m_CookieGenerator
int64_t& System::LocalDataStoreMgr::dyn_m_CookieGenerator() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::dyn_m_CookieGenerator");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_CookieGenerator"))->offset;
return *reinterpret_cast<int64_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.LocalDataStoreMgr.CreateLocalDataStore
::System::LocalDataStoreHolder* System::LocalDataStoreMgr::CreateLocalDataStore() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::CreateLocalDataStore");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateLocalDataStore", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::LocalDataStoreHolder*, false>(this, ___internal__method);
}
// Autogenerated method: System.LocalDataStoreMgr.DeleteLocalDataStore
void System::LocalDataStoreMgr::DeleteLocalDataStore(::System::LocalDataStore* store) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::DeleteLocalDataStore");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DeleteLocalDataStore", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(store)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, store);
}
// Autogenerated method: System.LocalDataStoreMgr.AllocateDataSlot
::System::LocalDataStoreSlot* System::LocalDataStoreMgr::AllocateDataSlot() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::AllocateDataSlot");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AllocateDataSlot", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::LocalDataStoreSlot*, false>(this, ___internal__method);
}
// Autogenerated method: System.LocalDataStoreMgr.AllocateNamedDataSlot
::System::LocalDataStoreSlot* System::LocalDataStoreMgr::AllocateNamedDataSlot(::StringW name) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::AllocateNamedDataSlot");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AllocateNamedDataSlot", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(name)})));
return ::il2cpp_utils::RunMethodRethrow<::System::LocalDataStoreSlot*, false>(this, ___internal__method, name);
}
// Autogenerated method: System.LocalDataStoreMgr.GetNamedDataSlot
::System::LocalDataStoreSlot* System::LocalDataStoreMgr::GetNamedDataSlot(::StringW name) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::GetNamedDataSlot");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetNamedDataSlot", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(name)})));
return ::il2cpp_utils::RunMethodRethrow<::System::LocalDataStoreSlot*, false>(this, ___internal__method, name);
}
// Autogenerated method: System.LocalDataStoreMgr.FreeNamedDataSlot
void System::LocalDataStoreMgr::FreeNamedDataSlot(::StringW name) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::FreeNamedDataSlot");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FreeNamedDataSlot", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(name)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, name);
}
// Autogenerated method: System.LocalDataStoreMgr.FreeDataSlot
void System::LocalDataStoreMgr::FreeDataSlot(int slot, int64_t cookie) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::FreeDataSlot");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FreeDataSlot", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(slot), ::il2cpp_utils::ExtractType(cookie)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, slot, cookie);
}
// Autogenerated method: System.LocalDataStoreMgr.ValidateSlot
void System::LocalDataStoreMgr::ValidateSlot(::System::LocalDataStoreSlot* slot) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::ValidateSlot");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ValidateSlot", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(slot)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, slot);
}
// Autogenerated method: System.LocalDataStoreMgr.GetSlotTableLength
int System::LocalDataStoreMgr::GetSlotTableLength() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::LocalDataStoreMgr::GetSlotTableLength");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetSlotTableLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Action
#include "System/Action.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Action.Invoke
void System::Action::Invoke() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Action::Invoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Action.BeginInvoke
::System::IAsyncResult* System::Action::BeginInvoke(::System::AsyncCallback* callback, ::Il2CppObject* object) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Action::BeginInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, callback, object);
}
// Autogenerated method: System.Action.EndInvoke
void System::Action::EndInvoke(::System::IAsyncResult* result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Action::EndInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(result)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, result);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Activator
#include "System/Activator.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: System.Reflection.BindingFlags
#include "System/Reflection/BindingFlags.hpp"
// Including type: System.Reflection.Binder
#include "System/Reflection/Binder.hpp"
// Including type: System.Globalization.CultureInfo
#include "System/Globalization/CultureInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Activator.CreateInstance
::Il2CppObject* System::Activator::CreateInstance(::System::Type* type, ::System::Reflection::BindingFlags bindingAttr, ::System::Reflection::Binder* binder, ::ArrayW<::Il2CppObject*> args, ::System::Globalization::CultureInfo* culture) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Activator::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Activator", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(bindingAttr), ::il2cpp_utils::ExtractType(binder), ::il2cpp_utils::ExtractType(args), ::il2cpp_utils::ExtractType(culture)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, type, bindingAttr, binder, args, culture);
}
// Autogenerated method: System.Activator.CreateInstance
::Il2CppObject* System::Activator::CreateInstance(::System::Type* type, ::System::Reflection::BindingFlags bindingAttr, ::System::Reflection::Binder* binder, ::ArrayW<::Il2CppObject*> args, ::System::Globalization::CultureInfo* culture, ::ArrayW<::Il2CppObject*> activationAttributes) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Activator::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Activator", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(bindingAttr), ::il2cpp_utils::ExtractType(binder), ::il2cpp_utils::ExtractType(args), ::il2cpp_utils::ExtractType(culture), ::il2cpp_utils::ExtractType(activationAttributes)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, type, bindingAttr, binder, args, culture, activationAttributes);
}
// Autogenerated method: System.Activator.CreateInstance
::Il2CppObject* System::Activator::CreateInstance(::System::Type* type, ::ArrayW<::Il2CppObject*> args) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Activator::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Activator", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(args)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, type, args);
}
// Autogenerated method: System.Activator.CreateInstance
::Il2CppObject* System::Activator::CreateInstance(::System::Type* type) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Activator::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Activator", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, type);
}
// Autogenerated method: System.Activator.CreateInstance
::Il2CppObject* System::Activator::CreateInstance(::System::Type* type, bool nonPublic) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Activator::CreateInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Activator", "CreateInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(nonPublic)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, type, nonPublic);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.AppDomainUnloadedException
#include "System/AppDomainUnloadedException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ApplicationException
#include "System/ApplicationException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ArgumentException
#include "System/ArgumentException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.String m_paramName
::StringW& System::ArgumentException::dyn_m_paramName() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ArgumentException::dyn_m_paramName");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_paramName"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.ArgumentException.get_Message
::StringW System::ArgumentException::get_Message() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ArgumentException::get_Message");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Message", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: System.ArgumentException.GetObjectData
void System::ArgumentException::GetObjectData(::System::Runtime::Serialization::SerializationInfo* info, ::System::Runtime::Serialization::StreamingContext context) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ArgumentException::GetObjectData");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetObjectData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractType(context)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, info, context);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ArgumentNullException
#include "System/ArgumentNullException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.ArgumentOutOfRangeException
#include "System/ArgumentOutOfRangeException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.String _rangeMessage
::StringW System::ArgumentOutOfRangeException::_get__rangeMessage() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ArgumentOutOfRangeException::_get__rangeMessage");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("System", "ArgumentOutOfRangeException", "_rangeMessage"));
}
// Autogenerated static field setter
// Set static field: static private System.String _rangeMessage
void System::ArgumentOutOfRangeException::_set__rangeMessage(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ArgumentOutOfRangeException::_set__rangeMessage");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ArgumentOutOfRangeException", "_rangeMessage", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Object m_actualValue
::Il2CppObject*& System::ArgumentOutOfRangeException::dyn_m_actualValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ArgumentOutOfRangeException::dyn_m_actualValue");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_actualValue"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.ArgumentOutOfRangeException.get_RangeMessage
::StringW System::ArgumentOutOfRangeException::get_RangeMessage() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ArgumentOutOfRangeException::get_RangeMessage");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "ArgumentOutOfRangeException", "get_RangeMessage", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.ArgumentOutOfRangeException.get_Message
::StringW System::ArgumentOutOfRangeException::get_Message() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ArgumentOutOfRangeException::get_Message");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Message", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: System.ArgumentOutOfRangeException.GetObjectData
void System::ArgumentOutOfRangeException::GetObjectData(::System::Runtime::Serialization::SerializationInfo* info, ::System::Runtime::Serialization::StreamingContext context) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ArgumentOutOfRangeException::GetObjectData");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetObjectData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractType(context)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, info, context);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ArithmeticException
#include "System/ArithmeticException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ArrayTypeMismatchException
#include "System/ArrayTypeMismatchException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.AsyncCallback.Invoke
void System::AsyncCallback::Invoke(::System::IAsyncResult* ar) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AsyncCallback::Invoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ar)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ar);
}
// Autogenerated method: System.AsyncCallback.BeginInvoke
::System::IAsyncResult* System::AsyncCallback::BeginInvoke(::System::IAsyncResult* ar, ::System::AsyncCallback* callback, ::Il2CppObject* object) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AsyncCallback::BeginInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ar), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ar, callback, object);
}
// Autogenerated method: System.AsyncCallback.EndInvoke
void System::AsyncCallback::EndInvoke(::System::IAsyncResult* result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AsyncCallback::EndInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(result)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, result);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Attribute
#include "System/Attribute.hpp"
// Including type: System.Reflection.PropertyInfo
#include "System/Reflection/PropertyInfo.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: System.Reflection.EventInfo
#include "System/Reflection/EventInfo.hpp"
// Including type: System.Reflection.MemberInfo
#include "System/Reflection/MemberInfo.hpp"
// Including type: System.Reflection.Assembly
#include "System/Reflection/Assembly.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Attribute.InternalGetCustomAttributes
::ArrayW<::System::Attribute*> System::Attribute::InternalGetCustomAttributes(::System::Reflection::PropertyInfo* element, ::System::Type* type, bool inherit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::InternalGetCustomAttributes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "InternalGetCustomAttributes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(inherit)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::System::Attribute*>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, type, inherit);
}
// Autogenerated method: System.Attribute.InternalGetCustomAttributes
::ArrayW<::System::Attribute*> System::Attribute::InternalGetCustomAttributes(::System::Reflection::EventInfo* element, ::System::Type* type, bool inherit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::InternalGetCustomAttributes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "InternalGetCustomAttributes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(inherit)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::System::Attribute*>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, type, inherit);
}
// Autogenerated method: System.Attribute.InternalIsDefined
bool System::Attribute::InternalIsDefined(::System::Reflection::PropertyInfo* element, ::System::Type* attributeType, bool inherit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::InternalIsDefined");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "InternalIsDefined", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(attributeType), ::il2cpp_utils::ExtractType(inherit)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, attributeType, inherit);
}
// Autogenerated method: System.Attribute.InternalIsDefined
bool System::Attribute::InternalIsDefined(::System::Reflection::EventInfo* element, ::System::Type* attributeType, bool inherit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::InternalIsDefined");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "InternalIsDefined", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(attributeType), ::il2cpp_utils::ExtractType(inherit)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, attributeType, inherit);
}
// Autogenerated method: System.Attribute.GetCustomAttributes
::ArrayW<::System::Attribute*> System::Attribute::GetCustomAttributes(::System::Reflection::MemberInfo* element, ::System::Type* type, bool inherit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::GetCustomAttributes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "GetCustomAttributes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(inherit)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::System::Attribute*>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, type, inherit);
}
// Autogenerated method: System.Attribute.IsDefined
bool System::Attribute::IsDefined(::System::Reflection::MemberInfo* element, ::System::Type* attributeType) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::IsDefined");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "IsDefined", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(attributeType)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, attributeType);
}
// Autogenerated method: System.Attribute.IsDefined
bool System::Attribute::IsDefined(::System::Reflection::MemberInfo* element, ::System::Type* attributeType, bool inherit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::IsDefined");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "IsDefined", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(attributeType), ::il2cpp_utils::ExtractType(inherit)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, attributeType, inherit);
}
// Autogenerated method: System.Attribute.GetCustomAttribute
::System::Attribute* System::Attribute::GetCustomAttribute(::System::Reflection::MemberInfo* element, ::System::Type* attributeType) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::GetCustomAttribute");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "GetCustomAttribute", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(attributeType)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Attribute*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, attributeType);
}
// Autogenerated method: System.Attribute.GetCustomAttribute
::System::Attribute* System::Attribute::GetCustomAttribute(::System::Reflection::MemberInfo* element, ::System::Type* attributeType, bool inherit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::GetCustomAttribute");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "GetCustomAttribute", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(attributeType), ::il2cpp_utils::ExtractType(inherit)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Attribute*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, attributeType, inherit);
}
// Autogenerated method: System.Attribute.GetCustomAttributes
::ArrayW<::System::Attribute*> System::Attribute::GetCustomAttributes(::System::Reflection::Assembly* element, ::System::Type* attributeType, bool inherit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::GetCustomAttributes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "GetCustomAttributes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(attributeType), ::il2cpp_utils::ExtractType(inherit)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::System::Attribute*>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, attributeType, inherit);
}
// Autogenerated method: System.Attribute.GetCustomAttribute
::System::Attribute* System::Attribute::GetCustomAttribute(::System::Reflection::Assembly* element, ::System::Type* attributeType) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::GetCustomAttribute");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "GetCustomAttribute", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(attributeType)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Attribute*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, attributeType);
}
// Autogenerated method: System.Attribute.GetCustomAttribute
::System::Attribute* System::Attribute::GetCustomAttribute(::System::Reflection::Assembly* element, ::System::Type* attributeType, bool inherit) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::GetCustomAttribute");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "GetCustomAttribute", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(element), ::il2cpp_utils::ExtractType(attributeType), ::il2cpp_utils::ExtractType(inherit)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Attribute*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, element, attributeType, inherit);
}
// Autogenerated method: System.Attribute.AreFieldValuesEqual
bool System::Attribute::AreFieldValuesEqual(::Il2CppObject* thisValue, ::Il2CppObject* thatValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::AreFieldValuesEqual");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Attribute", "AreFieldValuesEqual", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(thisValue), ::il2cpp_utils::ExtractType(thatValue)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, thisValue, thatValue);
}
// Autogenerated method: System.Attribute.Equals
bool System::Attribute::Equals(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.Attribute.GetHashCode
int System::Attribute::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Attribute::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.AttributeTargets
#include "System/AttributeTargets.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Assembly
::System::AttributeTargets System::AttributeTargets::_get_Assembly() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Assembly");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Assembly"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Assembly
void System::AttributeTargets::_set_Assembly(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Assembly");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Assembly", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Module
::System::AttributeTargets System::AttributeTargets::_get_Module() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Module");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Module"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Module
void System::AttributeTargets::_set_Module(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Module");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Module", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Class
::System::AttributeTargets System::AttributeTargets::_get_Class() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Class");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Class"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Class
void System::AttributeTargets::_set_Class(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Class");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Class", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Struct
::System::AttributeTargets System::AttributeTargets::_get_Struct() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Struct");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Struct"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Struct
void System::AttributeTargets::_set_Struct(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Struct");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Struct", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Enum
::System::AttributeTargets System::AttributeTargets::_get_Enum() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Enum");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Enum"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Enum
void System::AttributeTargets::_set_Enum(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Enum");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Enum", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Constructor
::System::AttributeTargets System::AttributeTargets::_get_Constructor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Constructor");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Constructor"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Constructor
void System::AttributeTargets::_set_Constructor(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Constructor");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Constructor", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Method
::System::AttributeTargets System::AttributeTargets::_get_Method() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Method");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Method"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Method
void System::AttributeTargets::_set_Method(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Method");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Method", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Property
::System::AttributeTargets System::AttributeTargets::_get_Property() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Property");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Property"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Property
void System::AttributeTargets::_set_Property(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Property");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Property", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Field
::System::AttributeTargets System::AttributeTargets::_get_Field() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Field");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Field"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Field
void System::AttributeTargets::_set_Field(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Field");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Field", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Event
::System::AttributeTargets System::AttributeTargets::_get_Event() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Event");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Event"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Event
void System::AttributeTargets::_set_Event(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Event");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Event", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Interface
::System::AttributeTargets System::AttributeTargets::_get_Interface() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Interface");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Interface"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Interface
void System::AttributeTargets::_set_Interface(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Interface");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Interface", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Parameter
::System::AttributeTargets System::AttributeTargets::_get_Parameter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Parameter");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Parameter"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Parameter
void System::AttributeTargets::_set_Parameter(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Parameter");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Parameter", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets Delegate
::System::AttributeTargets System::AttributeTargets::_get_Delegate() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_Delegate");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "Delegate"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets Delegate
void System::AttributeTargets::_set_Delegate(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_Delegate");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "Delegate", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets ReturnValue
::System::AttributeTargets System::AttributeTargets::_get_ReturnValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_ReturnValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "ReturnValue"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets ReturnValue
void System::AttributeTargets::_set_ReturnValue(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_ReturnValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "ReturnValue", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets GenericParameter
::System::AttributeTargets System::AttributeTargets::_get_GenericParameter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_GenericParameter");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "GenericParameter"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets GenericParameter
void System::AttributeTargets::_set_GenericParameter(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_GenericParameter");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "GenericParameter", value));
}
// Autogenerated static field getter
// Get static field: static public System.AttributeTargets All
::System::AttributeTargets System::AttributeTargets::_get_All() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_get_All");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeTargets>("System", "AttributeTargets", "All"));
}
// Autogenerated static field setter
// Set static field: static public System.AttributeTargets All
void System::AttributeTargets::_set_All(::System::AttributeTargets value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::_set_All");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeTargets", "All", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::AttributeTargets::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeTargets::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.AttributeUsageAttribute
#include "System/AttributeUsageAttribute.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static System.AttributeUsageAttribute Default
::System::AttributeUsageAttribute* System::AttributeUsageAttribute::_get_Default() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeUsageAttribute::_get_Default");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AttributeUsageAttribute*>("System", "AttributeUsageAttribute", "Default"));
}
// Autogenerated static field setter
// Set static field: static System.AttributeUsageAttribute Default
void System::AttributeUsageAttribute::_set_Default(::System::AttributeUsageAttribute* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeUsageAttribute::_set_Default");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "AttributeUsageAttribute", "Default", value));
}
// Autogenerated instance field getter
// Get instance field: System.AttributeTargets m_attributeTarget
::System::AttributeTargets& System::AttributeUsageAttribute::dyn_m_attributeTarget() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeUsageAttribute::dyn_m_attributeTarget");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_attributeTarget"))->offset;
return *reinterpret_cast<::System::AttributeTargets*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Boolean m_allowMultiple
bool& System::AttributeUsageAttribute::dyn_m_allowMultiple() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeUsageAttribute::dyn_m_allowMultiple");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_allowMultiple"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Boolean m_inherited
bool& System::AttributeUsageAttribute::dyn_m_inherited() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeUsageAttribute::dyn_m_inherited");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_inherited"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.AttributeUsageAttribute.get_AllowMultiple
bool System::AttributeUsageAttribute::get_AllowMultiple() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeUsageAttribute::get_AllowMultiple");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AllowMultiple", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.AttributeUsageAttribute.set_AllowMultiple
void System::AttributeUsageAttribute::set_AllowMultiple(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeUsageAttribute::set_AllowMultiple");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_AllowMultiple", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.AttributeUsageAttribute.get_Inherited
bool System::AttributeUsageAttribute::get_Inherited() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeUsageAttribute::get_Inherited");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Inherited", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.AttributeUsageAttribute.set_Inherited
void System::AttributeUsageAttribute::set_Inherited(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeUsageAttribute::set_Inherited");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Inherited", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.AttributeUsageAttribute..cctor
void System::AttributeUsageAttribute::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::AttributeUsageAttribute::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "AttributeUsageAttribute", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.BadImageFormatException
#include "System/BadImageFormatException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.String _fileName
::StringW& System::BadImageFormatException::dyn__fileName() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BadImageFormatException::dyn__fileName");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_fileName"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.String _fusionLog
::StringW& System::BadImageFormatException::dyn__fusionLog() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BadImageFormatException::dyn__fusionLog");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_fusionLog"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.BadImageFormatException.get_FusionLog
::StringW System::BadImageFormatException::get_FusionLog() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BadImageFormatException::get_FusionLog");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_FusionLog", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: System.BadImageFormatException.SetMessageField
void System::BadImageFormatException::SetMessageField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BadImageFormatException::SetMessageField");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetMessageField", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.BadImageFormatException.get_Message
::StringW System::BadImageFormatException::get_Message() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BadImageFormatException::get_Message");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Message", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: System.BadImageFormatException.ToString
::StringW System::BadImageFormatException::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BadImageFormatException::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: System.BadImageFormatException.GetObjectData
void System::BadImageFormatException::GetObjectData(::System::Runtime::Serialization::SerializationInfo* info, ::System::Runtime::Serialization::StreamingContext context) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BadImageFormatException::GetObjectData");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetObjectData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractType(context)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, info, context);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.BitConverter
#include "System/BitConverter.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly System.Boolean IsLittleEndian
bool System::BitConverter::_get_IsLittleEndian() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::_get_IsLittleEndian");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System", "BitConverter", "IsLittleEndian"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Boolean IsLittleEndian
void System::BitConverter::_set_IsLittleEndian(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::_set_IsLittleEndian");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "BitConverter", "IsLittleEndian", value));
}
// Autogenerated method: System.BitConverter..cctor
void System::BitConverter::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.BitConverter.AmILittleEndian
bool System::BitConverter::AmILittleEndian() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::AmILittleEndian");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "AmILittleEndian", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.BitConverter.GetBytes
::ArrayW<uint8_t> System::BitConverter::GetBytes(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::GetBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "GetBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.BitConverter.GetBytes
::ArrayW<uint8_t> System::BitConverter::GetBytes(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::GetBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "GetBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.BitConverter.GetBytes
::ArrayW<uint8_t> System::BitConverter::GetBytes(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::GetBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "GetBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.BitConverter.GetBytes
::ArrayW<uint8_t> System::BitConverter::GetBytes(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::GetBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "GetBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.BitConverter.GetBytes
::ArrayW<uint8_t> System::BitConverter::GetBytes(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::GetBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "GetBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.BitConverter.GetBytes
::ArrayW<uint8_t> System::BitConverter::GetBytes(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::GetBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "GetBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.BitConverter.GetBytes
::ArrayW<uint8_t> System::BitConverter::GetBytes(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::GetBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "GetBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.BitConverter.GetBytes
::ArrayW<uint8_t> System::BitConverter::GetBytes(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::GetBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "GetBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.BitConverter.ToInt16
int16_t System::BitConverter::ToInt16(::ArrayW<uint8_t> value, int startIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, startIndex);
}
// Autogenerated method: System.BitConverter.ToInt32
int System::BitConverter::ToInt32(::ArrayW<uint8_t> value, int startIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, startIndex);
}
// Autogenerated method: System.BitConverter.ToInt64
int64_t System::BitConverter::ToInt64(::ArrayW<uint8_t> value, int startIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, startIndex);
}
// Autogenerated method: System.BitConverter.ToUInt16
uint16_t System::BitConverter::ToUInt16(::ArrayW<uint8_t> value, int startIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, startIndex);
}
// Autogenerated method: System.BitConverter.ToUInt32
uint System::BitConverter::ToUInt32(::ArrayW<uint8_t> value, int startIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, startIndex);
}
// Autogenerated method: System.BitConverter.ToUInt64
uint64_t System::BitConverter::ToUInt64(::ArrayW<uint8_t> value, int startIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, startIndex);
}
// Autogenerated method: System.BitConverter.ToSingle
float System::BitConverter::ToSingle(::ArrayW<uint8_t> value, int startIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, startIndex);
}
// Autogenerated method: System.BitConverter.ToDouble
double System::BitConverter::ToDouble(::ArrayW<uint8_t> value, int startIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, startIndex);
}
// Autogenerated method: System.BitConverter.GetHexValue
::Il2CppChar System::BitConverter::GetHexValue(int i) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::GetHexValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "GetHexValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(i)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, i);
}
// Autogenerated method: System.BitConverter.ToString
::StringW System::BitConverter::ToString(::ArrayW<uint8_t> value, int startIndex, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::ToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(startIndex), ::il2cpp_utils::ExtractType(length)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, startIndex, length);
}
// Autogenerated method: System.BitConverter.ToString
::StringW System::BitConverter::ToString(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::ToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.BitConverter.DoubleToInt64Bits
int64_t System::BitConverter::DoubleToInt64Bits(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::DoubleToInt64Bits");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "DoubleToInt64Bits", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.BitConverter.Int64BitsToDouble
double System::BitConverter::Int64BitsToDouble(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::BitConverter::Int64BitsToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "BitConverter", "Int64BitsToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Boolean
#include "System/Boolean.hpp"
// Including type: System.String
#include "System/String.hpp"
// Including type: System.IFormatProvider
#include "System/IFormatProvider.hpp"
// Including type: System.TypeCode
#include "System/TypeCode.hpp"
// Including type: System.Decimal
#include "System/Decimal.hpp"
// Including type: System.DateTime
#include "System/DateTime.hpp"
// Including type: System.Type
#include "System/Type.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static System.Int32 True
int System::Boolean::_get_True() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_get_True");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Boolean", "True"));
}
// Autogenerated static field setter
// Set static field: static System.Int32 True
void System::Boolean::_set_True(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_set_True");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Boolean", "True", value));
}
// Autogenerated static field getter
// Get static field: static System.Int32 False
int System::Boolean::_get_False() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_get_False");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Boolean", "False"));
}
// Autogenerated static field setter
// Set static field: static System.Int32 False
void System::Boolean::_set_False(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_set_False");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Boolean", "False", value));
}
// Autogenerated static field getter
// Get static field: static System.String TrueLiteral
::StringW System::Boolean::_get_TrueLiteral() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_get_TrueLiteral");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("System", "Boolean", "TrueLiteral"));
}
// Autogenerated static field setter
// Set static field: static System.String TrueLiteral
void System::Boolean::_set_TrueLiteral(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_set_TrueLiteral");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Boolean", "TrueLiteral", value));
}
// Autogenerated static field getter
// Get static field: static System.String FalseLiteral
::StringW System::Boolean::_get_FalseLiteral() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_get_FalseLiteral");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("System", "Boolean", "FalseLiteral"));
}
// Autogenerated static field setter
// Set static field: static System.String FalseLiteral
void System::Boolean::_set_FalseLiteral(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_set_FalseLiteral");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Boolean", "FalseLiteral", value));
}
// Autogenerated static field getter
// Get static field: static public readonly System.String TrueString
::StringW System::Boolean::_get_TrueString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_get_TrueString");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("System", "Boolean", "TrueString"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.String TrueString
void System::Boolean::_set_TrueString(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_set_TrueString");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Boolean", "TrueString", value));
}
// Autogenerated static field getter
// Get static field: static public readonly System.String FalseString
::StringW System::Boolean::_get_FalseString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_get_FalseString");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("System", "Boolean", "FalseString"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.String FalseString
void System::Boolean::_set_FalseString(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::_set_FalseString");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Boolean", "FalseString", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_value
bool& System::Boolean::dyn_m_value() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::dyn_m_value");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_value"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Boolean..cctor
void System::Boolean::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Boolean", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Boolean.ToString
::StringW System::Boolean::ToString(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.Equals
bool System::Boolean::Equals(bool obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.Boolean.CompareTo
int System::Boolean::CompareTo(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.Boolean.CompareTo
int System::Boolean::CompareTo(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Boolean.Parse
bool System::Boolean::Parse(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Boolean", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Boolean.TryParse
bool System::Boolean::TryParse(::StringW value, ByRef<bool> result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::TryParse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Boolean", "TryParse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractIndependentType<bool&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, byref(result));
}
// Autogenerated method: System.Boolean.TrimWhiteSpaceAndNull
::StringW System::Boolean::TrimWhiteSpaceAndNull(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::TrimWhiteSpaceAndNull");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Boolean", "TrimWhiteSpaceAndNull", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Boolean.GetTypeCode
::System::TypeCode System::Boolean::GetTypeCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::GetTypeCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetTypeCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::TypeCode, false>(this, ___internal__method);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToBoolean
bool System::Boolean::System_IConvertible_ToBoolean(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToBoolean");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToChar
::Il2CppChar System::Boolean::System_IConvertible_ToChar(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToChar");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToSByte
int8_t System::Boolean::System_IConvertible_ToSByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToSByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToByte
uint8_t System::Boolean::System_IConvertible_ToByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToInt16
int16_t System::Boolean::System_IConvertible_ToInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToUInt16
uint16_t System::Boolean::System_IConvertible_ToUInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToUInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToInt32
int System::Boolean::System_IConvertible_ToInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToUInt32
uint System::Boolean::System_IConvertible_ToUInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToUInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToInt64
int64_t System::Boolean::System_IConvertible_ToInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToUInt64
uint64_t System::Boolean::System_IConvertible_ToUInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToUInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToSingle
float System::Boolean::System_IConvertible_ToSingle(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToSingle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToDouble
double System::Boolean::System_IConvertible_ToDouble(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToDouble");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToDecimal
::System::Decimal System::Boolean::System_IConvertible_ToDecimal(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToDecimal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToDateTime
::System::DateTime System::Boolean::System_IConvertible_ToDateTime(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToDateTime");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Boolean.System.IConvertible.ToType
::Il2CppObject* System::Boolean::System_IConvertible_ToType(::System::Type* type, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::System.IConvertible.ToType");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, type, provider);
}
// Autogenerated method: System.Boolean.GetHashCode
int System::Boolean::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Boolean.ToString
::StringW System::Boolean::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: System.Boolean.Equals
bool System::Boolean::Equals(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Boolean::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Buffer
#include "System/Buffer.hpp"
// Including type: System.Array
#include "System/Array.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Buffer.InternalBlockCopy
bool System::Buffer::InternalBlockCopy(::System::Array* src, int srcOffsetBytes, ::System::Array* dst, int dstOffsetBytes, int byteCount) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::InternalBlockCopy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "InternalBlockCopy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(src), ::il2cpp_utils::ExtractType(srcOffsetBytes), ::il2cpp_utils::ExtractType(dst), ::il2cpp_utils::ExtractType(dstOffsetBytes), ::il2cpp_utils::ExtractType(byteCount)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, src, srcOffsetBytes, dst, dstOffsetBytes, byteCount);
}
// Autogenerated method: System.Buffer.IndexOfByte
int System::Buffer::IndexOfByte(uint8_t* src, uint8_t value, int index, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::IndexOfByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "IndexOfByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(src), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(count)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, src, value, index, count);
}
// Autogenerated method: System.Buffer._ByteLength
int System::Buffer::_ByteLength(::System::Array* array) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::_ByteLength");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "_ByteLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array);
}
// Autogenerated method: System.Buffer.ZeroMemory
void System::Buffer::ZeroMemory(uint8_t* src, int64_t len) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::ZeroMemory");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "ZeroMemory", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(src), ::il2cpp_utils::ExtractType(len)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, src, len);
}
// Autogenerated method: System.Buffer.Memcpy
void System::Buffer::Memcpy(::ArrayW<uint8_t> dest, int destIndex, uint8_t* src, int srcIndex, int len) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::Memcpy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "Memcpy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dest), ::il2cpp_utils::ExtractType(destIndex), ::il2cpp_utils::ExtractType(src), ::il2cpp_utils::ExtractType(srcIndex), ::il2cpp_utils::ExtractType(len)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, dest, destIndex, src, srcIndex, len);
}
// Autogenerated method: System.Buffer.Memcpy
void System::Buffer::Memcpy(uint8_t* pDest, int destIndex, ::ArrayW<uint8_t> src, int srcIndex, int len) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::Memcpy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "Memcpy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pDest), ::il2cpp_utils::ExtractType(destIndex), ::il2cpp_utils::ExtractType(src), ::il2cpp_utils::ExtractType(srcIndex), ::il2cpp_utils::ExtractType(len)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, pDest, destIndex, src, srcIndex, len);
}
// Autogenerated method: System.Buffer.ByteLength
int System::Buffer::ByteLength(::System::Array* array) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::ByteLength");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "ByteLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, array);
}
// Autogenerated method: System.Buffer.BlockCopy
void System::Buffer::BlockCopy(::System::Array* src, int srcOffset, ::System::Array* dst, int dstOffset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::BlockCopy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "BlockCopy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(src), ::il2cpp_utils::ExtractType(srcOffset), ::il2cpp_utils::ExtractType(dst), ::il2cpp_utils::ExtractType(dstOffset), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, src, srcOffset, dst, dstOffset, count);
}
// Autogenerated method: System.Buffer.memcpy4
void System::Buffer::memcpy4(uint8_t* dest, uint8_t* src, int size) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::memcpy4");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "memcpy4", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dest), ::il2cpp_utils::ExtractType(src), ::il2cpp_utils::ExtractType(size)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, dest, src, size);
}
// Autogenerated method: System.Buffer.memcpy2
void System::Buffer::memcpy2(uint8_t* dest, uint8_t* src, int size) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::memcpy2");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "memcpy2", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dest), ::il2cpp_utils::ExtractType(src), ::il2cpp_utils::ExtractType(size)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, dest, src, size);
}
// Autogenerated method: System.Buffer.memcpy1
void System::Buffer::memcpy1(uint8_t* dest, uint8_t* src, int size) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::memcpy1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "memcpy1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dest), ::il2cpp_utils::ExtractType(src), ::il2cpp_utils::ExtractType(size)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, dest, src, size);
}
// Autogenerated method: System.Buffer.Memcpy
void System::Buffer::Memcpy(uint8_t* dest, uint8_t* src, int size) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Buffer::Memcpy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Buffer", "Memcpy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dest), ::il2cpp_utils::ExtractType(src), ::il2cpp_utils::ExtractType(size)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, dest, src, size);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Byte
#include "System/Byte.hpp"
// Including type: System.IFormatProvider
#include "System/IFormatProvider.hpp"
// Including type: System.Globalization.NumberStyles
#include "System/Globalization/NumberStyles.hpp"
// Including type: System.Globalization.NumberFormatInfo
#include "System/Globalization/NumberFormatInfo.hpp"
// Including type: System.TypeCode
#include "System/TypeCode.hpp"
// Including type: System.Decimal
#include "System/Decimal.hpp"
// Including type: System.DateTime
#include "System/DateTime.hpp"
// Including type: System.Type
#include "System/Type.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Byte MaxValue
uint8_t System::Byte::_get_MaxValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::_get_MaxValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint8_t>("System", "Byte", "MaxValue"));
}
// Autogenerated static field setter
// Set static field: static public System.Byte MaxValue
void System::Byte::_set_MaxValue(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::_set_MaxValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Byte", "MaxValue", value));
}
// Autogenerated static field getter
// Get static field: static public System.Byte MinValue
uint8_t System::Byte::_get_MinValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::_get_MinValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint8_t>("System", "Byte", "MinValue"));
}
// Autogenerated static field setter
// Set static field: static public System.Byte MinValue
void System::Byte::_set_MinValue(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::_set_MinValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Byte", "MinValue", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Byte m_value
uint8_t& System::Byte::dyn_m_value() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::dyn_m_value");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_value"))->offset;
return *reinterpret_cast<uint8_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Byte.CompareTo
int System::Byte::CompareTo(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Byte.CompareTo
int System::Byte::CompareTo(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Byte.Equals
bool System::Byte::Equals(uint8_t obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.Byte.Parse
uint8_t System::Byte::Parse(::StringW s, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Byte", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, provider);
}
// Autogenerated method: System.Byte.Parse
uint8_t System::Byte::Parse(::StringW s, ::System::Globalization::NumberStyles style, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Byte", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(style), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, style, provider);
}
// Autogenerated method: System.Byte.Parse
uint8_t System::Byte::Parse(::StringW s, ::System::Globalization::NumberStyles style, ::System::Globalization::NumberFormatInfo* info) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Byte", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(style), ::il2cpp_utils::ExtractType(info)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, style, info);
}
// Autogenerated method: System.Byte.ToString
::StringW System::Byte::ToString(::StringW format) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::ToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(format)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, format);
}
// Autogenerated method: System.Byte.ToString
::StringW System::Byte::ToString(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.ToString
::StringW System::Byte::ToString(::StringW format, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(format), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, format, provider);
}
// Autogenerated method: System.Byte.GetTypeCode
::System::TypeCode System::Byte::GetTypeCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::GetTypeCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetTypeCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::TypeCode, false>(this, ___internal__method);
}
// Autogenerated method: System.Byte.System.IConvertible.ToBoolean
bool System::Byte::System_IConvertible_ToBoolean(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToBoolean");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToChar
::Il2CppChar System::Byte::System_IConvertible_ToChar(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToChar");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToSByte
int8_t System::Byte::System_IConvertible_ToSByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToSByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToByte
uint8_t System::Byte::System_IConvertible_ToByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToInt16
int16_t System::Byte::System_IConvertible_ToInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToUInt16
uint16_t System::Byte::System_IConvertible_ToUInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToUInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToInt32
int System::Byte::System_IConvertible_ToInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToUInt32
uint System::Byte::System_IConvertible_ToUInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToUInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToInt64
int64_t System::Byte::System_IConvertible_ToInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToUInt64
uint64_t System::Byte::System_IConvertible_ToUInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToUInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToSingle
float System::Byte::System_IConvertible_ToSingle(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToSingle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToDouble
double System::Byte::System_IConvertible_ToDouble(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToDouble");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToDecimal
::System::Decimal System::Byte::System_IConvertible_ToDecimal(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToDecimal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToDateTime
::System::DateTime System::Byte::System_IConvertible_ToDateTime(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToDateTime");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Byte.System.IConvertible.ToType
::Il2CppObject* System::Byte::System_IConvertible_ToType(::System::Type* type, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::System.IConvertible.ToType");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, type, provider);
}
// Autogenerated method: System.Byte.Equals
bool System::Byte::Equals(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.Byte.GetHashCode
int System::Byte::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Byte.ToString
::StringW System::Byte::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Byte::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.CannotUnloadAppDomainException
#include "System/CannotUnloadAppDomainException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Char
#include "System/Char.hpp"
// Including type: System.Globalization.UnicodeCategory
#include "System/Globalization/UnicodeCategory.hpp"
// Including type: System.IFormatProvider
#include "System/IFormatProvider.hpp"
// Including type: System.Globalization.CultureInfo
#include "System/Globalization/CultureInfo.hpp"
// Including type: System.TypeCode
#include "System/TypeCode.hpp"
// Including type: System.Decimal
#include "System/Decimal.hpp"
// Including type: System.DateTime
#include "System/DateTime.hpp"
// Including type: System.Type
#include "System/Type.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Char MaxValue
::Il2CppChar System::Char::_get_MaxValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_get_MaxValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Il2CppChar>("System", "Char", "MaxValue"));
}
// Autogenerated static field setter
// Set static field: static public System.Char MaxValue
void System::Char::_set_MaxValue(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_set_MaxValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Char", "MaxValue", value));
}
// Autogenerated static field getter
// Get static field: static public System.Char MinValue
::Il2CppChar System::Char::_get_MinValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_get_MinValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Il2CppChar>("System", "Char", "MinValue"));
}
// Autogenerated static field setter
// Set static field: static public System.Char MinValue
void System::Char::_set_MinValue(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_set_MinValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Char", "MinValue", value));
}
// Autogenerated static field getter
// Get static field: static private readonly System.Byte[] categoryForLatin1
::ArrayW<uint8_t> System::Char::_get_categoryForLatin1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_get_categoryForLatin1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint8_t>>("System", "Char", "categoryForLatin1"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Byte[] categoryForLatin1
void System::Char::_set_categoryForLatin1(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_set_categoryForLatin1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Char", "categoryForLatin1", value));
}
// Autogenerated static field getter
// Get static field: static System.Int32 UNICODE_PLANE00_END
int System::Char::_get_UNICODE_PLANE00_END() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_get_UNICODE_PLANE00_END");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Char", "UNICODE_PLANE00_END"));
}
// Autogenerated static field setter
// Set static field: static System.Int32 UNICODE_PLANE00_END
void System::Char::_set_UNICODE_PLANE00_END(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_set_UNICODE_PLANE00_END");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Char", "UNICODE_PLANE00_END", value));
}
// Autogenerated static field getter
// Get static field: static System.Int32 UNICODE_PLANE01_START
int System::Char::_get_UNICODE_PLANE01_START() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_get_UNICODE_PLANE01_START");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Char", "UNICODE_PLANE01_START"));
}
// Autogenerated static field setter
// Set static field: static System.Int32 UNICODE_PLANE01_START
void System::Char::_set_UNICODE_PLANE01_START(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_set_UNICODE_PLANE01_START");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Char", "UNICODE_PLANE01_START", value));
}
// Autogenerated static field getter
// Get static field: static System.Int32 UNICODE_PLANE16_END
int System::Char::_get_UNICODE_PLANE16_END() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_get_UNICODE_PLANE16_END");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Char", "UNICODE_PLANE16_END"));
}
// Autogenerated static field setter
// Set static field: static System.Int32 UNICODE_PLANE16_END
void System::Char::_set_UNICODE_PLANE16_END(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_set_UNICODE_PLANE16_END");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Char", "UNICODE_PLANE16_END", value));
}
// Autogenerated static field getter
// Get static field: static System.Int32 HIGH_SURROGATE_START
int System::Char::_get_HIGH_SURROGATE_START() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_get_HIGH_SURROGATE_START");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Char", "HIGH_SURROGATE_START"));
}
// Autogenerated static field setter
// Set static field: static System.Int32 HIGH_SURROGATE_START
void System::Char::_set_HIGH_SURROGATE_START(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_set_HIGH_SURROGATE_START");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Char", "HIGH_SURROGATE_START", value));
}
// Autogenerated static field getter
// Get static field: static System.Int32 LOW_SURROGATE_END
int System::Char::_get_LOW_SURROGATE_END() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_get_LOW_SURROGATE_END");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Char", "LOW_SURROGATE_END"));
}
// Autogenerated static field setter
// Set static field: static System.Int32 LOW_SURROGATE_END
void System::Char::_set_LOW_SURROGATE_END(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::_set_LOW_SURROGATE_END");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Char", "LOW_SURROGATE_END", value));
}
// Autogenerated instance field getter
// Get instance field: System.Char m_value
::Il2CppChar& System::Char::dyn_m_value() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::dyn_m_value");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_value"))->offset;
return *reinterpret_cast<::Il2CppChar*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Char..cctor
void System::Char::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Char.IsLatin1
bool System::Char::IsLatin1(::Il2CppChar ch) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsLatin1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsLatin1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ch)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, ch);
}
// Autogenerated method: System.Char.IsAscii
bool System::Char::IsAscii(::Il2CppChar ch) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsAscii");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsAscii", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ch)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, ch);
}
// Autogenerated method: System.Char.GetLatin1UnicodeCategory
::System::Globalization::UnicodeCategory System::Char::GetLatin1UnicodeCategory(::Il2CppChar ch) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::GetLatin1UnicodeCategory");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "GetLatin1UnicodeCategory", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ch)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Globalization::UnicodeCategory, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, ch);
}
// Autogenerated method: System.Char.Equals
bool System::Char::Equals(::Il2CppChar obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.Char.CompareTo
int System::Char::CompareTo(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Char.CompareTo
int System::Char::CompareTo(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Char.ToString
::StringW System::Char::ToString(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.ToString
::StringW System::Char::ToString(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::ToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.Parse
::Il2CppChar System::Char::Parse(::StringW s) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s);
}
// Autogenerated method: System.Char.IsDigit
bool System::Char::IsDigit(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsDigit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsDigit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.CheckLetter
bool System::Char::CheckLetter(::System::Globalization::UnicodeCategory uc) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::CheckLetter");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "CheckLetter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(uc)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, uc);
}
// Autogenerated method: System.Char.IsLetter
bool System::Char::IsLetter(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsLetter");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsLetter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.IsWhiteSpaceLatin1
bool System::Char::IsWhiteSpaceLatin1(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsWhiteSpaceLatin1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsWhiteSpaceLatin1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.IsWhiteSpace
bool System::Char::IsWhiteSpace(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsWhiteSpace");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsWhiteSpace", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.IsUpper
bool System::Char::IsUpper(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsUpper");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsUpper", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.IsLower
bool System::Char::IsLower(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsLower");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsLower", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.CheckPunctuation
bool System::Char::CheckPunctuation(::System::Globalization::UnicodeCategory uc) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::CheckPunctuation");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "CheckPunctuation", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(uc)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, uc);
}
// Autogenerated method: System.Char.IsPunctuation
bool System::Char::IsPunctuation(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsPunctuation");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsPunctuation", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.CheckLetterOrDigit
bool System::Char::CheckLetterOrDigit(::System::Globalization::UnicodeCategory uc) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::CheckLetterOrDigit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "CheckLetterOrDigit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(uc)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, uc);
}
// Autogenerated method: System.Char.IsLetterOrDigit
bool System::Char::IsLetterOrDigit(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsLetterOrDigit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsLetterOrDigit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.ToUpper
::Il2CppChar System::Char::ToUpper(::Il2CppChar c, ::System::Globalization::CultureInfo* culture) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::ToUpper");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "ToUpper", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c), ::il2cpp_utils::ExtractType(culture)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c, culture);
}
// Autogenerated method: System.Char.ToUpper
::Il2CppChar System::Char::ToUpper(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::ToUpper");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "ToUpper", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.ToUpperInvariant
::Il2CppChar System::Char::ToUpperInvariant(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::ToUpperInvariant");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "ToUpperInvariant", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.ToLower
::Il2CppChar System::Char::ToLower(::Il2CppChar c, ::System::Globalization::CultureInfo* culture) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::ToLower");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "ToLower", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c), ::il2cpp_utils::ExtractType(culture)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c, culture);
}
// Autogenerated method: System.Char.ToLower
::Il2CppChar System::Char::ToLower(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::ToLower");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "ToLower", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.ToLowerInvariant
::Il2CppChar System::Char::ToLowerInvariant(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::ToLowerInvariant");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "ToLowerInvariant", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.GetTypeCode
::System::TypeCode System::Char::GetTypeCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::GetTypeCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetTypeCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::TypeCode, false>(this, ___internal__method);
}
// Autogenerated method: System.Char.System.IConvertible.ToBoolean
bool System::Char::System_IConvertible_ToBoolean(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToBoolean");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToChar
::Il2CppChar System::Char::System_IConvertible_ToChar(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToChar");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToSByte
int8_t System::Char::System_IConvertible_ToSByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToSByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToByte
uint8_t System::Char::System_IConvertible_ToByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToInt16
int16_t System::Char::System_IConvertible_ToInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToUInt16
uint16_t System::Char::System_IConvertible_ToUInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToUInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToInt32
int System::Char::System_IConvertible_ToInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToUInt32
uint System::Char::System_IConvertible_ToUInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToUInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToInt64
int64_t System::Char::System_IConvertible_ToInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToUInt64
uint64_t System::Char::System_IConvertible_ToUInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToUInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToSingle
float System::Char::System_IConvertible_ToSingle(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToSingle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToDouble
double System::Char::System_IConvertible_ToDouble(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToDouble");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToDecimal
::System::Decimal System::Char::System_IConvertible_ToDecimal(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToDecimal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToDateTime
::System::DateTime System::Char::System_IConvertible_ToDateTime(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToDateTime");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Char.System.IConvertible.ToType
::Il2CppObject* System::Char::System_IConvertible_ToType(::System::Type* type, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::System.IConvertible.ToType");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, type, provider);
}
// Autogenerated method: System.Char.IsControl
bool System::Char::IsControl(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsControl");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsControl", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.CheckNumber
bool System::Char::CheckNumber(::System::Globalization::UnicodeCategory uc) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::CheckNumber");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "CheckNumber", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(uc)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, uc);
}
// Autogenerated method: System.Char.IsNumber
bool System::Char::IsNumber(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsNumber");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsNumber", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.IsNumber
bool System::Char::IsNumber(::StringW s, int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsNumber");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsNumber", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(index)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, index);
}
// Autogenerated method: System.Char.CheckSeparator
bool System::Char::CheckSeparator(::System::Globalization::UnicodeCategory uc) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::CheckSeparator");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "CheckSeparator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(uc)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, uc);
}
// Autogenerated method: System.Char.IsSeparatorLatin1
bool System::Char::IsSeparatorLatin1(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsSeparatorLatin1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsSeparatorLatin1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.IsSeparator
bool System::Char::IsSeparator(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsSeparator");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsSeparator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.IsSurrogate
bool System::Char::IsSurrogate(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsSurrogate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsSurrogate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.IsSurrogate
bool System::Char::IsSurrogate(::StringW s, int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsSurrogate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsSurrogate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(index)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, index);
}
// Autogenerated method: System.Char.GetUnicodeCategory
::System::Globalization::UnicodeCategory System::Char::GetUnicodeCategory(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::GetUnicodeCategory");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "GetUnicodeCategory", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Globalization::UnicodeCategory, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.GetUnicodeCategory
::System::Globalization::UnicodeCategory System::Char::GetUnicodeCategory(::StringW s, int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::GetUnicodeCategory");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "GetUnicodeCategory", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(index)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Globalization::UnicodeCategory, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, index);
}
// Autogenerated method: System.Char.IsHighSurrogate
bool System::Char::IsHighSurrogate(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsHighSurrogate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsHighSurrogate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.IsHighSurrogate
bool System::Char::IsHighSurrogate(::StringW s, int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsHighSurrogate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsHighSurrogate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(index)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, index);
}
// Autogenerated method: System.Char.IsLowSurrogate
bool System::Char::IsLowSurrogate(::Il2CppChar c) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsLowSurrogate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsLowSurrogate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c);
}
// Autogenerated method: System.Char.IsSurrogatePair
bool System::Char::IsSurrogatePair(::Il2CppChar highSurrogate, ::Il2CppChar lowSurrogate) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::IsSurrogatePair");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "IsSurrogatePair", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(highSurrogate), ::il2cpp_utils::ExtractType(lowSurrogate)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, highSurrogate, lowSurrogate);
}
// Autogenerated method: System.Char.ConvertToUtf32
int System::Char::ConvertToUtf32(::Il2CppChar highSurrogate, ::Il2CppChar lowSurrogate) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::ConvertToUtf32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Char", "ConvertToUtf32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(highSurrogate), ::il2cpp_utils::ExtractType(lowSurrogate)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, highSurrogate, lowSurrogate);
}
// Autogenerated method: System.Char.GetHashCode
int System::Char::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Char.Equals
bool System::Char::Equals(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.Char.ToString
::StringW System::Char::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Char::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.CharEnumerator
#include "System/CharEnumerator.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.String str
::StringW& System::CharEnumerator::dyn_str() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::CharEnumerator::dyn_str");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "str"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 index
int& System::CharEnumerator::dyn_index() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::CharEnumerator::dyn_index");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "index"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Char currentElement
::Il2CppChar& System::CharEnumerator::dyn_currentElement() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::CharEnumerator::dyn_currentElement");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "currentElement"))->offset;
return *reinterpret_cast<::Il2CppChar*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.CharEnumerator.System.Collections.IEnumerator.get_Current
::Il2CppObject* System::CharEnumerator::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::CharEnumerator::System.Collections.IEnumerator.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: System.CharEnumerator.get_Current
::Il2CppChar System::CharEnumerator::get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::CharEnumerator::get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(this, ___internal__method);
}
// Autogenerated method: System.CharEnumerator.Clone
::Il2CppObject* System::CharEnumerator::Clone() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::CharEnumerator::Clone");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Clone", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: System.CharEnumerator.MoveNext
bool System::CharEnumerator::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::CharEnumerator::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.CharEnumerator.Dispose
void System::CharEnumerator::Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::CharEnumerator::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.CharEnumerator.Reset
void System::CharEnumerator::Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::CharEnumerator::Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.CLSCompliantAttribute
#include "System/CLSCompliantAttribute.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_compliant
bool& System::CLSCompliantAttribute::dyn_m_compliant() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::CLSCompliantAttribute::dyn_m_compliant");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_compliant"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.ConsoleCancelEventHandler
#include "System/ConsoleCancelEventHandler.hpp"
// Including type: System.ConsoleCancelEventArgs
#include "System/ConsoleCancelEventArgs.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.ConsoleCancelEventHandler.Invoke
void System::ConsoleCancelEventHandler::Invoke(::Il2CppObject* sender, ::System::ConsoleCancelEventArgs* e) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleCancelEventHandler::Invoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sender), ::il2cpp_utils::ExtractType(e)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, sender, e);
}
// Autogenerated method: System.ConsoleCancelEventHandler.BeginInvoke
::System::IAsyncResult* System::ConsoleCancelEventHandler::BeginInvoke(::Il2CppObject* sender, ::System::ConsoleCancelEventArgs* e, ::System::AsyncCallback* callback, ::Il2CppObject* object) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleCancelEventHandler::BeginInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sender), ::il2cpp_utils::ExtractType(e), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, sender, e, callback, object);
}
// Autogenerated method: System.ConsoleCancelEventHandler.EndInvoke
void System::ConsoleCancelEventHandler::EndInvoke(::System::IAsyncResult* result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleCancelEventHandler::EndInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(result)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, result);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ConsoleCancelEventArgs
#include "System/ConsoleCancelEventArgs.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.ConsoleSpecialKey _type
::System::ConsoleSpecialKey& System::ConsoleCancelEventArgs::dyn__type() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleCancelEventArgs::dyn__type");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_type"))->offset;
return *reinterpret_cast<::System::ConsoleSpecialKey*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _cancel
bool& System::ConsoleCancelEventArgs::dyn__cancel() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleCancelEventArgs::dyn__cancel");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_cancel"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.ConsoleCancelEventArgs.get_Cancel
bool System::ConsoleCancelEventArgs::get_Cancel() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleCancelEventArgs::get_Cancel");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Cancel", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ConsoleColor
#include "System/ConsoleColor.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor Black
::System::ConsoleColor System::ConsoleColor::_get_Black() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_Black");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "Black"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor Black
void System::ConsoleColor::_set_Black(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_Black");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "Black", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor DarkBlue
::System::ConsoleColor System::ConsoleColor::_get_DarkBlue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_DarkBlue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "DarkBlue"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor DarkBlue
void System::ConsoleColor::_set_DarkBlue(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_DarkBlue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "DarkBlue", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor DarkGreen
::System::ConsoleColor System::ConsoleColor::_get_DarkGreen() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_DarkGreen");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "DarkGreen"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor DarkGreen
void System::ConsoleColor::_set_DarkGreen(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_DarkGreen");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "DarkGreen", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor DarkCyan
::System::ConsoleColor System::ConsoleColor::_get_DarkCyan() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_DarkCyan");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "DarkCyan"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor DarkCyan
void System::ConsoleColor::_set_DarkCyan(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_DarkCyan");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "DarkCyan", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor DarkRed
::System::ConsoleColor System::ConsoleColor::_get_DarkRed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_DarkRed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "DarkRed"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor DarkRed
void System::ConsoleColor::_set_DarkRed(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_DarkRed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "DarkRed", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor DarkMagenta
::System::ConsoleColor System::ConsoleColor::_get_DarkMagenta() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_DarkMagenta");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "DarkMagenta"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor DarkMagenta
void System::ConsoleColor::_set_DarkMagenta(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_DarkMagenta");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "DarkMagenta", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor DarkYellow
::System::ConsoleColor System::ConsoleColor::_get_DarkYellow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_DarkYellow");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "DarkYellow"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor DarkYellow
void System::ConsoleColor::_set_DarkYellow(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_DarkYellow");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "DarkYellow", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor Gray
::System::ConsoleColor System::ConsoleColor::_get_Gray() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_Gray");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "Gray"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor Gray
void System::ConsoleColor::_set_Gray(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_Gray");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "Gray", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor DarkGray
::System::ConsoleColor System::ConsoleColor::_get_DarkGray() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_DarkGray");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "DarkGray"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor DarkGray
void System::ConsoleColor::_set_DarkGray(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_DarkGray");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "DarkGray", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor Blue
::System::ConsoleColor System::ConsoleColor::_get_Blue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_Blue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "Blue"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor Blue
void System::ConsoleColor::_set_Blue(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_Blue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "Blue", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor Green
::System::ConsoleColor System::ConsoleColor::_get_Green() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_Green");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "Green"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor Green
void System::ConsoleColor::_set_Green(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_Green");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "Green", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor Cyan
::System::ConsoleColor System::ConsoleColor::_get_Cyan() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_Cyan");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "Cyan"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor Cyan
void System::ConsoleColor::_set_Cyan(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_Cyan");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "Cyan", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor Red
::System::ConsoleColor System::ConsoleColor::_get_Red() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_Red");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "Red"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor Red
void System::ConsoleColor::_set_Red(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_Red");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "Red", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor Magenta
::System::ConsoleColor System::ConsoleColor::_get_Magenta() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_Magenta");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "Magenta"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor Magenta
void System::ConsoleColor::_set_Magenta(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_Magenta");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "Magenta", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor Yellow
::System::ConsoleColor System::ConsoleColor::_get_Yellow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_Yellow");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "Yellow"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor Yellow
void System::ConsoleColor::_set_Yellow(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_Yellow");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "Yellow", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleColor White
::System::ConsoleColor System::ConsoleColor::_get_White() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_get_White");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleColor>("System", "ConsoleColor", "White"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleColor White
void System::ConsoleColor::_set_White(::System::ConsoleColor value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::_set_White");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleColor", "White", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::ConsoleColor::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleColor::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ConsoleKey
#include "System/ConsoleKey.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Backspace
::System::ConsoleKey System::ConsoleKey::_get_Backspace() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Backspace");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Backspace"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Backspace
void System::ConsoleKey::_set_Backspace(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Backspace");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Backspace", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Tab
::System::ConsoleKey System::ConsoleKey::_get_Tab() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Tab");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Tab"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Tab
void System::ConsoleKey::_set_Tab(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Tab");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Tab", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Clear
::System::ConsoleKey System::ConsoleKey::_get_Clear() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Clear");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Clear"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Clear
void System::ConsoleKey::_set_Clear(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Clear");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Clear", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Enter
::System::ConsoleKey System::ConsoleKey::_get_Enter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Enter");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Enter"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Enter
void System::ConsoleKey::_set_Enter(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Enter");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Enter", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Pause
::System::ConsoleKey System::ConsoleKey::_get_Pause() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Pause");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Pause"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Pause
void System::ConsoleKey::_set_Pause(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Pause");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Pause", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Escape
::System::ConsoleKey System::ConsoleKey::_get_Escape() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Escape");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Escape"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Escape
void System::ConsoleKey::_set_Escape(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Escape");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Escape", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Spacebar
::System::ConsoleKey System::ConsoleKey::_get_Spacebar() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Spacebar");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Spacebar"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Spacebar
void System::ConsoleKey::_set_Spacebar(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Spacebar");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Spacebar", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey PageUp
::System::ConsoleKey System::ConsoleKey::_get_PageUp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_PageUp");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "PageUp"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey PageUp
void System::ConsoleKey::_set_PageUp(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_PageUp");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "PageUp", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey PageDown
::System::ConsoleKey System::ConsoleKey::_get_PageDown() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_PageDown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "PageDown"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey PageDown
void System::ConsoleKey::_set_PageDown(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_PageDown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "PageDown", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey End
::System::ConsoleKey System::ConsoleKey::_get_End() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_End");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "End"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey End
void System::ConsoleKey::_set_End(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_End");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "End", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Home
::System::ConsoleKey System::ConsoleKey::_get_Home() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Home");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Home"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Home
void System::ConsoleKey::_set_Home(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Home");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Home", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey LeftArrow
::System::ConsoleKey System::ConsoleKey::_get_LeftArrow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_LeftArrow");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "LeftArrow"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey LeftArrow
void System::ConsoleKey::_set_LeftArrow(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_LeftArrow");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "LeftArrow", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey UpArrow
::System::ConsoleKey System::ConsoleKey::_get_UpArrow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_UpArrow");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "UpArrow"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey UpArrow
void System::ConsoleKey::_set_UpArrow(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_UpArrow");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "UpArrow", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey RightArrow
::System::ConsoleKey System::ConsoleKey::_get_RightArrow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_RightArrow");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "RightArrow"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey RightArrow
void System::ConsoleKey::_set_RightArrow(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_RightArrow");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "RightArrow", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey DownArrow
::System::ConsoleKey System::ConsoleKey::_get_DownArrow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_DownArrow");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "DownArrow"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey DownArrow
void System::ConsoleKey::_set_DownArrow(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_DownArrow");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "DownArrow", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Select
::System::ConsoleKey System::ConsoleKey::_get_Select() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Select");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Select"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Select
void System::ConsoleKey::_set_Select(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Select");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Select", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Print
::System::ConsoleKey System::ConsoleKey::_get_Print() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Print");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Print"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Print
void System::ConsoleKey::_set_Print(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Print");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Print", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Execute
::System::ConsoleKey System::ConsoleKey::_get_Execute() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Execute");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Execute"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Execute
void System::ConsoleKey::_set_Execute(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Execute");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Execute", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey PrintScreen
::System::ConsoleKey System::ConsoleKey::_get_PrintScreen() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_PrintScreen");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "PrintScreen"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey PrintScreen
void System::ConsoleKey::_set_PrintScreen(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_PrintScreen");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "PrintScreen", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Insert
::System::ConsoleKey System::ConsoleKey::_get_Insert() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Insert");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Insert"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Insert
void System::ConsoleKey::_set_Insert(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Insert");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Insert", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Delete
::System::ConsoleKey System::ConsoleKey::_get_Delete() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Delete");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Delete"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Delete
void System::ConsoleKey::_set_Delete(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Delete");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Delete", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Help
::System::ConsoleKey System::ConsoleKey::_get_Help() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Help");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Help"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Help
void System::ConsoleKey::_set_Help(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Help");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Help", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D0
::System::ConsoleKey System::ConsoleKey::_get_D0() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D0");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D0"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D0
void System::ConsoleKey::_set_D0(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D0");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D0", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D1
::System::ConsoleKey System::ConsoleKey::_get_D1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D1"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D1
void System::ConsoleKey::_set_D1(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D1", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D2
::System::ConsoleKey System::ConsoleKey::_get_D2() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D2");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D2"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D2
void System::ConsoleKey::_set_D2(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D2");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D2", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D3
::System::ConsoleKey System::ConsoleKey::_get_D3() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D3");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D3"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D3
void System::ConsoleKey::_set_D3(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D3");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D3", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D4
::System::ConsoleKey System::ConsoleKey::_get_D4() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D4");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D4"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D4
void System::ConsoleKey::_set_D4(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D4");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D4", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D5
::System::ConsoleKey System::ConsoleKey::_get_D5() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D5");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D5"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D5
void System::ConsoleKey::_set_D5(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D5");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D5", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D6
::System::ConsoleKey System::ConsoleKey::_get_D6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D6"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D6
void System::ConsoleKey::_set_D6(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D6", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D7
::System::ConsoleKey System::ConsoleKey::_get_D7() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D7");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D7"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D7
void System::ConsoleKey::_set_D7(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D7");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D7", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D8
::System::ConsoleKey System::ConsoleKey::_get_D8() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D8");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D8"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D8
void System::ConsoleKey::_set_D8(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D8");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D8", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D9
::System::ConsoleKey System::ConsoleKey::_get_D9() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D9");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D9"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D9
void System::ConsoleKey::_set_D9(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D9");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D9", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey A
::System::ConsoleKey System::ConsoleKey::_get_A() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_A");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "A"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey A
void System::ConsoleKey::_set_A(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_A");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "A", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey B
::System::ConsoleKey System::ConsoleKey::_get_B() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_B");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "B"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey B
void System::ConsoleKey::_set_B(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_B");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "B", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey C
::System::ConsoleKey System::ConsoleKey::_get_C() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_C");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "C"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey C
void System::ConsoleKey::_set_C(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_C");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "C", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey D
::System::ConsoleKey System::ConsoleKey::_get_D() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_D");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "D"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey D
void System::ConsoleKey::_set_D(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_D");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "D", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey E
::System::ConsoleKey System::ConsoleKey::_get_E() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_E");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "E"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey E
void System::ConsoleKey::_set_E(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_E");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "E", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F
::System::ConsoleKey System::ConsoleKey::_get_F() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F
void System::ConsoleKey::_set_F(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey G
::System::ConsoleKey System::ConsoleKey::_get_G() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_G");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "G"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey G
void System::ConsoleKey::_set_G(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_G");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "G", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey H
::System::ConsoleKey System::ConsoleKey::_get_H() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_H");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "H"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey H
void System::ConsoleKey::_set_H(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_H");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "H", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey I
::System::ConsoleKey System::ConsoleKey::_get_I() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_I");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "I"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey I
void System::ConsoleKey::_set_I(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_I");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "I", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey J
::System::ConsoleKey System::ConsoleKey::_get_J() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_J");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "J"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey J
void System::ConsoleKey::_set_J(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_J");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "J", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey K
::System::ConsoleKey System::ConsoleKey::_get_K() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_K");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "K"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey K
void System::ConsoleKey::_set_K(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_K");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "K", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey L
::System::ConsoleKey System::ConsoleKey::_get_L() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_L");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "L"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey L
void System::ConsoleKey::_set_L(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_L");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "L", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey M
::System::ConsoleKey System::ConsoleKey::_get_M() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_M");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "M"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey M
void System::ConsoleKey::_set_M(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_M");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "M", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey N
::System::ConsoleKey System::ConsoleKey::_get_N() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_N");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "N"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey N
void System::ConsoleKey::_set_N(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_N");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "N", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey O
::System::ConsoleKey System::ConsoleKey::_get_O() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_O");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "O"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey O
void System::ConsoleKey::_set_O(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_O");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "O", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey P
::System::ConsoleKey System::ConsoleKey::_get_P() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_P");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "P"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey P
void System::ConsoleKey::_set_P(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_P");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "P", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Q
::System::ConsoleKey System::ConsoleKey::_get_Q() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Q");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Q"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Q
void System::ConsoleKey::_set_Q(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Q");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Q", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey R
::System::ConsoleKey System::ConsoleKey::_get_R() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_R");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "R"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey R
void System::ConsoleKey::_set_R(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_R");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "R", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey S
::System::ConsoleKey System::ConsoleKey::_get_S() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_S");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "S"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey S
void System::ConsoleKey::_set_S(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_S");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "S", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey T
::System::ConsoleKey System::ConsoleKey::_get_T() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_T");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "T"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey T
void System::ConsoleKey::_set_T(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_T");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "T", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey U
::System::ConsoleKey System::ConsoleKey::_get_U() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_U");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "U"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey U
void System::ConsoleKey::_set_U(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_U");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "U", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey V
::System::ConsoleKey System::ConsoleKey::_get_V() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_V");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "V"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey V
void System::ConsoleKey::_set_V(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_V");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "V", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey W
::System::ConsoleKey System::ConsoleKey::_get_W() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_W");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "W"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey W
void System::ConsoleKey::_set_W(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_W");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "W", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey X
::System::ConsoleKey System::ConsoleKey::_get_X() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_X");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "X"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey X
void System::ConsoleKey::_set_X(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_X");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "X", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Y
::System::ConsoleKey System::ConsoleKey::_get_Y() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Y");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Y"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Y
void System::ConsoleKey::_set_Y(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Y");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Y", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Z
::System::ConsoleKey System::ConsoleKey::_get_Z() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Z");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Z"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Z
void System::ConsoleKey::_set_Z(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Z");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Z", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey LeftWindows
::System::ConsoleKey System::ConsoleKey::_get_LeftWindows() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_LeftWindows");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "LeftWindows"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey LeftWindows
void System::ConsoleKey::_set_LeftWindows(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_LeftWindows");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "LeftWindows", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey RightWindows
::System::ConsoleKey System::ConsoleKey::_get_RightWindows() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_RightWindows");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "RightWindows"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey RightWindows
void System::ConsoleKey::_set_RightWindows(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_RightWindows");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "RightWindows", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Applications
::System::ConsoleKey System::ConsoleKey::_get_Applications() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Applications");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Applications"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Applications
void System::ConsoleKey::_set_Applications(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Applications");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Applications", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Sleep
::System::ConsoleKey System::ConsoleKey::_get_Sleep() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Sleep");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Sleep"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Sleep
void System::ConsoleKey::_set_Sleep(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Sleep");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Sleep", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NumPad0
::System::ConsoleKey System::ConsoleKey::_get_NumPad0() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NumPad0");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NumPad0"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NumPad0
void System::ConsoleKey::_set_NumPad0(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NumPad0");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NumPad0", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NumPad1
::System::ConsoleKey System::ConsoleKey::_get_NumPad1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NumPad1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NumPad1"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NumPad1
void System::ConsoleKey::_set_NumPad1(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NumPad1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NumPad1", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NumPad2
::System::ConsoleKey System::ConsoleKey::_get_NumPad2() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NumPad2");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NumPad2"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NumPad2
void System::ConsoleKey::_set_NumPad2(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NumPad2");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NumPad2", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NumPad3
::System::ConsoleKey System::ConsoleKey::_get_NumPad3() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NumPad3");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NumPad3"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NumPad3
void System::ConsoleKey::_set_NumPad3(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NumPad3");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NumPad3", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NumPad4
::System::ConsoleKey System::ConsoleKey::_get_NumPad4() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NumPad4");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NumPad4"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NumPad4
void System::ConsoleKey::_set_NumPad4(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NumPad4");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NumPad4", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NumPad5
::System::ConsoleKey System::ConsoleKey::_get_NumPad5() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NumPad5");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NumPad5"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NumPad5
void System::ConsoleKey::_set_NumPad5(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NumPad5");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NumPad5", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NumPad6
::System::ConsoleKey System::ConsoleKey::_get_NumPad6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NumPad6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NumPad6"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NumPad6
void System::ConsoleKey::_set_NumPad6(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NumPad6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NumPad6", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NumPad7
::System::ConsoleKey System::ConsoleKey::_get_NumPad7() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NumPad7");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NumPad7"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NumPad7
void System::ConsoleKey::_set_NumPad7(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NumPad7");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NumPad7", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NumPad8
::System::ConsoleKey System::ConsoleKey::_get_NumPad8() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NumPad8");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NumPad8"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NumPad8
void System::ConsoleKey::_set_NumPad8(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NumPad8");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NumPad8", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NumPad9
::System::ConsoleKey System::ConsoleKey::_get_NumPad9() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NumPad9");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NumPad9"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NumPad9
void System::ConsoleKey::_set_NumPad9(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NumPad9");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NumPad9", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Multiply
::System::ConsoleKey System::ConsoleKey::_get_Multiply() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Multiply");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Multiply"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Multiply
void System::ConsoleKey::_set_Multiply(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Multiply");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Multiply", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Add
::System::ConsoleKey System::ConsoleKey::_get_Add() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Add");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Add"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Add
void System::ConsoleKey::_set_Add(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Add");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Add", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Separator
::System::ConsoleKey System::ConsoleKey::_get_Separator() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Separator");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Separator"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Separator
void System::ConsoleKey::_set_Separator(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Separator");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Separator", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Subtract
::System::ConsoleKey System::ConsoleKey::_get_Subtract() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Subtract");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Subtract"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Subtract
void System::ConsoleKey::_set_Subtract(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Subtract");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Subtract", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Decimal
::System::ConsoleKey System::ConsoleKey::_get_Decimal() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Decimal");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Decimal"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Decimal
void System::ConsoleKey::_set_Decimal(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Decimal");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Decimal", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Divide
::System::ConsoleKey System::ConsoleKey::_get_Divide() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Divide");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Divide"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Divide
void System::ConsoleKey::_set_Divide(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Divide");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Divide", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F1
::System::ConsoleKey System::ConsoleKey::_get_F1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F1"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F1
void System::ConsoleKey::_set_F1(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F1", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F2
::System::ConsoleKey System::ConsoleKey::_get_F2() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F2");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F2"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F2
void System::ConsoleKey::_set_F2(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F2");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F2", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F3
::System::ConsoleKey System::ConsoleKey::_get_F3() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F3");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F3"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F3
void System::ConsoleKey::_set_F3(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F3");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F3", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F4
::System::ConsoleKey System::ConsoleKey::_get_F4() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F4");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F4"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F4
void System::ConsoleKey::_set_F4(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F4");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F4", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F5
::System::ConsoleKey System::ConsoleKey::_get_F5() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F5");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F5"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F5
void System::ConsoleKey::_set_F5(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F5");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F5", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F6
::System::ConsoleKey System::ConsoleKey::_get_F6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F6"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F6
void System::ConsoleKey::_set_F6(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F6", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F7
::System::ConsoleKey System::ConsoleKey::_get_F7() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F7");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F7"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F7
void System::ConsoleKey::_set_F7(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F7");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F7", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F8
::System::ConsoleKey System::ConsoleKey::_get_F8() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F8");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F8"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F8
void System::ConsoleKey::_set_F8(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F8");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F8", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F9
::System::ConsoleKey System::ConsoleKey::_get_F9() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F9");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F9"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F9
void System::ConsoleKey::_set_F9(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F9");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F9", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F10
::System::ConsoleKey System::ConsoleKey::_get_F10() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F10");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F10"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F10
void System::ConsoleKey::_set_F10(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F10");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F10", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F11
::System::ConsoleKey System::ConsoleKey::_get_F11() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F11");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F11"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F11
void System::ConsoleKey::_set_F11(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F11");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F11", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F12
::System::ConsoleKey System::ConsoleKey::_get_F12() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F12");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F12"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F12
void System::ConsoleKey::_set_F12(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F12");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F12", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F13
::System::ConsoleKey System::ConsoleKey::_get_F13() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F13");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F13"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F13
void System::ConsoleKey::_set_F13(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F13");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F13", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F14
::System::ConsoleKey System::ConsoleKey::_get_F14() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F14");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F14"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F14
void System::ConsoleKey::_set_F14(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F14");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F14", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F15
::System::ConsoleKey System::ConsoleKey::_get_F15() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F15");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F15"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F15
void System::ConsoleKey::_set_F15(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F15");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F15", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F16
::System::ConsoleKey System::ConsoleKey::_get_F16() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F16");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F16"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F16
void System::ConsoleKey::_set_F16(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F16");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F16", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F17
::System::ConsoleKey System::ConsoleKey::_get_F17() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F17");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F17"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F17
void System::ConsoleKey::_set_F17(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F17");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F17", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F18
::System::ConsoleKey System::ConsoleKey::_get_F18() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F18");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F18"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F18
void System::ConsoleKey::_set_F18(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F18");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F18", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F19
::System::ConsoleKey System::ConsoleKey::_get_F19() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F19");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F19"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F19
void System::ConsoleKey::_set_F19(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F19");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F19", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F20
::System::ConsoleKey System::ConsoleKey::_get_F20() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F20");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F20"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F20
void System::ConsoleKey::_set_F20(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F20");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F20", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F21
::System::ConsoleKey System::ConsoleKey::_get_F21() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F21");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F21"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F21
void System::ConsoleKey::_set_F21(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F21");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F21", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F22
::System::ConsoleKey System::ConsoleKey::_get_F22() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F22");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F22"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F22
void System::ConsoleKey::_set_F22(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F22");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F22", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F23
::System::ConsoleKey System::ConsoleKey::_get_F23() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F23");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F23"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F23
void System::ConsoleKey::_set_F23(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F23");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F23", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey F24
::System::ConsoleKey System::ConsoleKey::_get_F24() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_F24");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "F24"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey F24
void System::ConsoleKey::_set_F24(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_F24");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "F24", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey BrowserBack
::System::ConsoleKey System::ConsoleKey::_get_BrowserBack() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_BrowserBack");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "BrowserBack"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey BrowserBack
void System::ConsoleKey::_set_BrowserBack(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_BrowserBack");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "BrowserBack", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey BrowserForward
::System::ConsoleKey System::ConsoleKey::_get_BrowserForward() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_BrowserForward");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "BrowserForward"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey BrowserForward
void System::ConsoleKey::_set_BrowserForward(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_BrowserForward");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "BrowserForward", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey BrowserRefresh
::System::ConsoleKey System::ConsoleKey::_get_BrowserRefresh() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_BrowserRefresh");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "BrowserRefresh"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey BrowserRefresh
void System::ConsoleKey::_set_BrowserRefresh(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_BrowserRefresh");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "BrowserRefresh", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey BrowserStop
::System::ConsoleKey System::ConsoleKey::_get_BrowserStop() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_BrowserStop");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "BrowserStop"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey BrowserStop
void System::ConsoleKey::_set_BrowserStop(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_BrowserStop");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "BrowserStop", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey BrowserSearch
::System::ConsoleKey System::ConsoleKey::_get_BrowserSearch() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_BrowserSearch");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "BrowserSearch"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey BrowserSearch
void System::ConsoleKey::_set_BrowserSearch(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_BrowserSearch");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "BrowserSearch", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey BrowserFavorites
::System::ConsoleKey System::ConsoleKey::_get_BrowserFavorites() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_BrowserFavorites");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "BrowserFavorites"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey BrowserFavorites
void System::ConsoleKey::_set_BrowserFavorites(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_BrowserFavorites");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "BrowserFavorites", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey BrowserHome
::System::ConsoleKey System::ConsoleKey::_get_BrowserHome() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_BrowserHome");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "BrowserHome"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey BrowserHome
void System::ConsoleKey::_set_BrowserHome(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_BrowserHome");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "BrowserHome", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey VolumeMute
::System::ConsoleKey System::ConsoleKey::_get_VolumeMute() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_VolumeMute");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "VolumeMute"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey VolumeMute
void System::ConsoleKey::_set_VolumeMute(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_VolumeMute");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "VolumeMute", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey VolumeDown
::System::ConsoleKey System::ConsoleKey::_get_VolumeDown() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_VolumeDown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "VolumeDown"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey VolumeDown
void System::ConsoleKey::_set_VolumeDown(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_VolumeDown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "VolumeDown", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey VolumeUp
::System::ConsoleKey System::ConsoleKey::_get_VolumeUp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_VolumeUp");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "VolumeUp"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey VolumeUp
void System::ConsoleKey::_set_VolumeUp(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_VolumeUp");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "VolumeUp", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey MediaNext
::System::ConsoleKey System::ConsoleKey::_get_MediaNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_MediaNext");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "MediaNext"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey MediaNext
void System::ConsoleKey::_set_MediaNext(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_MediaNext");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "MediaNext", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey MediaPrevious
::System::ConsoleKey System::ConsoleKey::_get_MediaPrevious() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_MediaPrevious");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "MediaPrevious"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey MediaPrevious
void System::ConsoleKey::_set_MediaPrevious(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_MediaPrevious");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "MediaPrevious", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey MediaStop
::System::ConsoleKey System::ConsoleKey::_get_MediaStop() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_MediaStop");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "MediaStop"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey MediaStop
void System::ConsoleKey::_set_MediaStop(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_MediaStop");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "MediaStop", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey MediaPlay
::System::ConsoleKey System::ConsoleKey::_get_MediaPlay() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_MediaPlay");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "MediaPlay"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey MediaPlay
void System::ConsoleKey::_set_MediaPlay(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_MediaPlay");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "MediaPlay", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey LaunchMail
::System::ConsoleKey System::ConsoleKey::_get_LaunchMail() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_LaunchMail");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "LaunchMail"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey LaunchMail
void System::ConsoleKey::_set_LaunchMail(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_LaunchMail");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "LaunchMail", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey LaunchMediaSelect
::System::ConsoleKey System::ConsoleKey::_get_LaunchMediaSelect() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_LaunchMediaSelect");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "LaunchMediaSelect"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey LaunchMediaSelect
void System::ConsoleKey::_set_LaunchMediaSelect(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_LaunchMediaSelect");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "LaunchMediaSelect", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey LaunchApp1
::System::ConsoleKey System::ConsoleKey::_get_LaunchApp1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_LaunchApp1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "LaunchApp1"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey LaunchApp1
void System::ConsoleKey::_set_LaunchApp1(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_LaunchApp1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "LaunchApp1", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey LaunchApp2
::System::ConsoleKey System::ConsoleKey::_get_LaunchApp2() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_LaunchApp2");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "LaunchApp2"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey LaunchApp2
void System::ConsoleKey::_set_LaunchApp2(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_LaunchApp2");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "LaunchApp2", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Oem1
::System::ConsoleKey System::ConsoleKey::_get_Oem1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Oem1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Oem1"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Oem1
void System::ConsoleKey::_set_Oem1(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Oem1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Oem1", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey OemPlus
::System::ConsoleKey System::ConsoleKey::_get_OemPlus() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_OemPlus");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "OemPlus"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey OemPlus
void System::ConsoleKey::_set_OemPlus(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_OemPlus");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "OemPlus", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey OemComma
::System::ConsoleKey System::ConsoleKey::_get_OemComma() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_OemComma");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "OemComma"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey OemComma
void System::ConsoleKey::_set_OemComma(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_OemComma");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "OemComma", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey OemMinus
::System::ConsoleKey System::ConsoleKey::_get_OemMinus() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_OemMinus");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "OemMinus"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey OemMinus
void System::ConsoleKey::_set_OemMinus(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_OemMinus");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "OemMinus", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey OemPeriod
::System::ConsoleKey System::ConsoleKey::_get_OemPeriod() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_OemPeriod");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "OemPeriod"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey OemPeriod
void System::ConsoleKey::_set_OemPeriod(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_OemPeriod");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "OemPeriod", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Oem2
::System::ConsoleKey System::ConsoleKey::_get_Oem2() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Oem2");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Oem2"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Oem2
void System::ConsoleKey::_set_Oem2(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Oem2");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Oem2", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Oem3
::System::ConsoleKey System::ConsoleKey::_get_Oem3() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Oem3");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Oem3"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Oem3
void System::ConsoleKey::_set_Oem3(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Oem3");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Oem3", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Oem4
::System::ConsoleKey System::ConsoleKey::_get_Oem4() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Oem4");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Oem4"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Oem4
void System::ConsoleKey::_set_Oem4(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Oem4");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Oem4", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Oem5
::System::ConsoleKey System::ConsoleKey::_get_Oem5() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Oem5");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Oem5"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Oem5
void System::ConsoleKey::_set_Oem5(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Oem5");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Oem5", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Oem6
::System::ConsoleKey System::ConsoleKey::_get_Oem6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Oem6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Oem6"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Oem6
void System::ConsoleKey::_set_Oem6(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Oem6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Oem6", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Oem7
::System::ConsoleKey System::ConsoleKey::_get_Oem7() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Oem7");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Oem7"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Oem7
void System::ConsoleKey::_set_Oem7(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Oem7");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Oem7", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Oem8
::System::ConsoleKey System::ConsoleKey::_get_Oem8() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Oem8");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Oem8"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Oem8
void System::ConsoleKey::_set_Oem8(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Oem8");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Oem8", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Oem102
::System::ConsoleKey System::ConsoleKey::_get_Oem102() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Oem102");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Oem102"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Oem102
void System::ConsoleKey::_set_Oem102(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Oem102");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Oem102", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Process
::System::ConsoleKey System::ConsoleKey::_get_Process() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Process");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Process"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Process
void System::ConsoleKey::_set_Process(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Process");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Process", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Packet
::System::ConsoleKey System::ConsoleKey::_get_Packet() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Packet");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Packet"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Packet
void System::ConsoleKey::_set_Packet(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Packet");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Packet", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Attention
::System::ConsoleKey System::ConsoleKey::_get_Attention() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Attention");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Attention"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Attention
void System::ConsoleKey::_set_Attention(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Attention");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Attention", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey CrSel
::System::ConsoleKey System::ConsoleKey::_get_CrSel() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_CrSel");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "CrSel"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey CrSel
void System::ConsoleKey::_set_CrSel(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_CrSel");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "CrSel", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey ExSel
::System::ConsoleKey System::ConsoleKey::_get_ExSel() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_ExSel");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "ExSel"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey ExSel
void System::ConsoleKey::_set_ExSel(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_ExSel");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "ExSel", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey EraseEndOfFile
::System::ConsoleKey System::ConsoleKey::_get_EraseEndOfFile() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_EraseEndOfFile");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "EraseEndOfFile"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey EraseEndOfFile
void System::ConsoleKey::_set_EraseEndOfFile(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_EraseEndOfFile");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "EraseEndOfFile", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Play
::System::ConsoleKey System::ConsoleKey::_get_Play() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Play");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Play"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Play
void System::ConsoleKey::_set_Play(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Play");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Play", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Zoom
::System::ConsoleKey System::ConsoleKey::_get_Zoom() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Zoom");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Zoom"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Zoom
void System::ConsoleKey::_set_Zoom(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Zoom");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Zoom", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey NoName
::System::ConsoleKey System::ConsoleKey::_get_NoName() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_NoName");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "NoName"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey NoName
void System::ConsoleKey::_set_NoName(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_NoName");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "NoName", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey Pa1
::System::ConsoleKey System::ConsoleKey::_get_Pa1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_Pa1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "Pa1"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey Pa1
void System::ConsoleKey::_set_Pa1(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_Pa1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "Pa1", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleKey OemClear
::System::ConsoleKey System::ConsoleKey::_get_OemClear() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_get_OemClear");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleKey>("System", "ConsoleKey", "OemClear"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleKey OemClear
void System::ConsoleKey::_set_OemClear(::System::ConsoleKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::_set_OemClear");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleKey", "OemClear", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::ConsoleKey::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKey::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.ConsoleKeyInfo
#include "System/ConsoleKeyInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Char _keyChar
::Il2CppChar& System::ConsoleKeyInfo::dyn__keyChar() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKeyInfo::dyn__keyChar");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_keyChar"))->offset;
return *reinterpret_cast<::Il2CppChar*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.ConsoleKey _key
::System::ConsoleKey& System::ConsoleKeyInfo::dyn__key() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKeyInfo::dyn__key");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_key"))->offset;
return *reinterpret_cast<::System::ConsoleKey*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.ConsoleModifiers _mods
::System::ConsoleModifiers& System::ConsoleKeyInfo::dyn__mods() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKeyInfo::dyn__mods");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_mods"))->offset;
return *reinterpret_cast<::System::ConsoleModifiers*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.ConsoleKeyInfo.get_KeyChar
::Il2CppChar System::ConsoleKeyInfo::get_KeyChar() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKeyInfo::get_KeyChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_KeyChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(this, ___internal__method);
}
// Autogenerated method: System.ConsoleKeyInfo.get_Key
::System::ConsoleKey System::ConsoleKeyInfo::get_Key() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKeyInfo::get_Key");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Key", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::ConsoleKey, false>(this, ___internal__method);
}
// Autogenerated method: System.ConsoleKeyInfo..ctor
System::ConsoleKeyInfo::ConsoleKeyInfo(::Il2CppChar keyChar, ::System::ConsoleKey key, bool shift, bool alt, bool control) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKeyInfo::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(keyChar), ::il2cpp_utils::ExtractType(key), ::il2cpp_utils::ExtractType(shift), ::il2cpp_utils::ExtractType(alt), ::il2cpp_utils::ExtractType(control)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, keyChar, key, shift, alt, control);
}
// Autogenerated method: System.ConsoleKeyInfo.Equals
bool System::ConsoleKeyInfo::Equals(::System::ConsoleKeyInfo obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKeyInfo::Equals");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.ConsoleKeyInfo.Equals
bool System::ConsoleKeyInfo::Equals(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKeyInfo::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, value);
}
// Autogenerated method: System.ConsoleKeyInfo.GetHashCode
int System::ConsoleKeyInfo::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleKeyInfo::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ConsoleModifiers
#include "System/ConsoleModifiers.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.ConsoleModifiers Alt
::System::ConsoleModifiers System::ConsoleModifiers::_get_Alt() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleModifiers::_get_Alt");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleModifiers>("System", "ConsoleModifiers", "Alt"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleModifiers Alt
void System::ConsoleModifiers::_set_Alt(::System::ConsoleModifiers value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleModifiers::_set_Alt");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleModifiers", "Alt", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleModifiers Shift
::System::ConsoleModifiers System::ConsoleModifiers::_get_Shift() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleModifiers::_get_Shift");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleModifiers>("System", "ConsoleModifiers", "Shift"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleModifiers Shift
void System::ConsoleModifiers::_set_Shift(::System::ConsoleModifiers value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleModifiers::_set_Shift");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleModifiers", "Shift", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleModifiers Control
::System::ConsoleModifiers System::ConsoleModifiers::_get_Control() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleModifiers::_get_Control");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleModifiers>("System", "ConsoleModifiers", "Control"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleModifiers Control
void System::ConsoleModifiers::_set_Control(::System::ConsoleModifiers value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleModifiers::_set_Control");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleModifiers", "Control", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::ConsoleModifiers::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleModifiers::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ConsoleSpecialKey
#include "System/ConsoleSpecialKey.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.ConsoleSpecialKey ControlC
::System::ConsoleSpecialKey System::ConsoleSpecialKey::_get_ControlC() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleSpecialKey::_get_ControlC");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleSpecialKey>("System", "ConsoleSpecialKey", "ControlC"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleSpecialKey ControlC
void System::ConsoleSpecialKey::_set_ControlC(::System::ConsoleSpecialKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleSpecialKey::_set_ControlC");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleSpecialKey", "ControlC", value));
}
// Autogenerated static field getter
// Get static field: static public System.ConsoleSpecialKey ControlBreak
::System::ConsoleSpecialKey System::ConsoleSpecialKey::_get_ControlBreak() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleSpecialKey::_get_ControlBreak");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::ConsoleSpecialKey>("System", "ConsoleSpecialKey", "ControlBreak"));
}
// Autogenerated static field setter
// Set static field: static public System.ConsoleSpecialKey ControlBreak
void System::ConsoleSpecialKey::_set_ControlBreak(::System::ConsoleSpecialKey value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleSpecialKey::_set_ControlBreak");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "ConsoleSpecialKey", "ControlBreak", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::ConsoleSpecialKey::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::ConsoleSpecialKey::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ContextBoundObject
#include "System/ContextBoundObject.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.ContextStaticAttribute
#include "System/ContextStaticAttribute.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Base64FormattingOptions
#include "System/Base64FormattingOptions.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Base64FormattingOptions None
::System::Base64FormattingOptions System::Base64FormattingOptions::_get_None() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Base64FormattingOptions::_get_None");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Base64FormattingOptions>("System", "Base64FormattingOptions", "None"));
}
// Autogenerated static field setter
// Set static field: static public System.Base64FormattingOptions None
void System::Base64FormattingOptions::_set_None(::System::Base64FormattingOptions value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Base64FormattingOptions::_set_None");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Base64FormattingOptions", "None", value));
}
// Autogenerated static field getter
// Get static field: static public System.Base64FormattingOptions InsertLineBreaks
::System::Base64FormattingOptions System::Base64FormattingOptions::_get_InsertLineBreaks() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Base64FormattingOptions::_get_InsertLineBreaks");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Base64FormattingOptions>("System", "Base64FormattingOptions", "InsertLineBreaks"));
}
// Autogenerated static field setter
// Set static field: static public System.Base64FormattingOptions InsertLineBreaks
void System::Base64FormattingOptions::_set_InsertLineBreaks(::System::Base64FormattingOptions value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Base64FormattingOptions::_set_InsertLineBreaks");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Base64FormattingOptions", "InsertLineBreaks", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Base64FormattingOptions::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Base64FormattingOptions::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Convert
#include "System/Convert.hpp"
// Including type: System.RuntimeType
#include "System/RuntimeType.hpp"
// Including type: System.TypeCode
#include "System/TypeCode.hpp"
// Including type: System.IFormatProvider
#include "System/IFormatProvider.hpp"
// Including type: System.IConvertible
#include "System/IConvertible.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: System.Decimal
#include "System/Decimal.hpp"
// Including type: System.DateTime
#include "System/DateTime.hpp"
// Including type: System.Base64FormattingOptions
#include "System/Base64FormattingOptions.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static readonly System.RuntimeType[] ConvertTypes
::ArrayW<::System::RuntimeType*> System::Convert::_get_ConvertTypes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::_get_ConvertTypes");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<::System::RuntimeType*>>("System", "Convert", "ConvertTypes"));
}
// Autogenerated static field setter
// Set static field: static readonly System.RuntimeType[] ConvertTypes
void System::Convert::_set_ConvertTypes(::ArrayW<::System::RuntimeType*> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::_set_ConvertTypes");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Convert", "ConvertTypes", value));
}
// Autogenerated static field getter
// Get static field: static private readonly System.RuntimeType EnumType
::System::RuntimeType* System::Convert::_get_EnumType() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::_get_EnumType");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::RuntimeType*>("System", "Convert", "EnumType"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.RuntimeType EnumType
void System::Convert::_set_EnumType(::System::RuntimeType* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::_set_EnumType");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Convert", "EnumType", value));
}
// Autogenerated static field getter
// Get static field: static readonly System.Char[] base64Table
::ArrayW<::Il2CppChar> System::Convert::_get_base64Table() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::_get_base64Table");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<::Il2CppChar>>("System", "Convert", "base64Table"));
}
// Autogenerated static field setter
// Set static field: static readonly System.Char[] base64Table
void System::Convert::_set_base64Table(::ArrayW<::Il2CppChar> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::_set_base64Table");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Convert", "base64Table", value));
}
// Autogenerated static field getter
// Get static field: static public readonly System.Object DBNull
::Il2CppObject* System::Convert::_get_DBNull() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::_get_DBNull");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Il2CppObject*>("System", "Convert", "DBNull"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Object DBNull
void System::Convert::_set_DBNull(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::_set_DBNull");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Convert", "DBNull", value));
}
// Autogenerated method: System.Convert..cctor
void System::Convert::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Convert.GetTypeCode
::System::TypeCode System::Convert::GetTypeCode(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::GetTypeCode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "GetTypeCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::TypeCode, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ChangeType
::Il2CppObject* System::Convert::ChangeType(::Il2CppObject* value, ::System::TypeCode typeCode, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ChangeType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ChangeType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(typeCode), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, typeCode, provider);
}
// Autogenerated method: System.Convert.DefaultToType
::Il2CppObject* System::Convert::DefaultToType(::System::IConvertible* value, ::System::Type* targetType, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::DefaultToType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "DefaultToType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(targetType), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, targetType, provider);
}
// Autogenerated method: System.Convert.ChangeType
::Il2CppObject* System::Convert::ChangeType(::Il2CppObject* value, ::System::Type* conversionType, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ChangeType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ChangeType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(conversionType), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, conversionType, provider);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToBoolean
bool System::Convert::ToBoolean(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBoolean");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToChar
::Il2CppChar System::Convert::ToChar(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSByte
int8_t System::Convert::ToSByte(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToByte
uint8_t System::Convert::ToByte(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt16
int16_t System::Convert::ToInt16(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt16
uint16_t System::Convert::ToUInt16(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt32
uint System::Convert::ToUInt32(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToInt64
int64_t System::Convert::ToInt64(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToUInt64
uint64_t System::Convert::ToUInt64(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToSingle
float System::Convert::ToSingle(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToDouble
double System::Convert::ToDouble(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDecimal
::System::Decimal System::Convert::ToDecimal(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Convert.ToDateTime
::System::DateTime System::Convert::ToDateTime(::StringW value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToDateTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToString
::StringW System::Convert::ToString(::Il2CppObject* value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToString
::StringW System::Convert::ToString(::Il2CppChar value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToString
::StringW System::Convert::ToString(int value, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, provider);
}
// Autogenerated method: System.Convert.ToInt32
int System::Convert::ToInt32(::StringW value, int fromBase) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(fromBase)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, fromBase);
}
// Autogenerated method: System.Convert.ToBase64String
::StringW System::Convert::ToBase64String(::ArrayW<uint8_t> inArray) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBase64String");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBase64String", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inArray)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, inArray);
}
// Autogenerated method: System.Convert.ToBase64String
::StringW System::Convert::ToBase64String(::ArrayW<uint8_t> inArray, int offset, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBase64String");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBase64String", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inArray), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(length)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, inArray, offset, length);
}
// Autogenerated method: System.Convert.ToBase64String
::StringW System::Convert::ToBase64String(::ArrayW<uint8_t> inArray, int offset, int length, ::System::Base64FormattingOptions options) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBase64String");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBase64String", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inArray), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(length), ::il2cpp_utils::ExtractType(options)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, inArray, offset, length, options);
}
// Autogenerated method: System.Convert.ConvertToBase64Array
int System::Convert::ConvertToBase64Array(::Il2CppChar* outChars, uint8_t* inData, int offset, int length, bool insertLineBreaks) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ConvertToBase64Array");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ConvertToBase64Array", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(outChars), ::il2cpp_utils::ExtractType(inData), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(length), ::il2cpp_utils::ExtractType(insertLineBreaks)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, outChars, inData, offset, length, insertLineBreaks);
}
// Autogenerated method: System.Convert.ToBase64_CalculateAndValidateOutputLength
int System::Convert::ToBase64_CalculateAndValidateOutputLength(int inputLength, bool insertLineBreaks) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::ToBase64_CalculateAndValidateOutputLength");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "ToBase64_CalculateAndValidateOutputLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputLength), ::il2cpp_utils::ExtractType(insertLineBreaks)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, inputLength, insertLineBreaks);
}
// Autogenerated method: System.Convert.FromBase64String
::ArrayW<uint8_t> System::Convert::FromBase64String(::StringW s) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::FromBase64String");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "FromBase64String", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s);
}
// Autogenerated method: System.Convert.FromBase64CharPtr
::ArrayW<uint8_t> System::Convert::FromBase64CharPtr(::Il2CppChar* inputPtr, int inputLength) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::FromBase64CharPtr");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "FromBase64CharPtr", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputPtr), ::il2cpp_utils::ExtractType(inputLength)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, inputPtr, inputLength);
}
// Autogenerated method: System.Convert.FromBase64_Decode
int System::Convert::FromBase64_Decode(::Il2CppChar* startInputPtr, int inputLength, uint8_t* startDestPtr, int destLength) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::FromBase64_Decode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "FromBase64_Decode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(startInputPtr), ::il2cpp_utils::ExtractType(inputLength), ::il2cpp_utils::ExtractType(startDestPtr), ::il2cpp_utils::ExtractType(destLength)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, startInputPtr, inputLength, startDestPtr, destLength);
}
// Autogenerated method: System.Convert.FromBase64_ComputeResultLength
int System::Convert::FromBase64_ComputeResultLength(::Il2CppChar* inputPtr, int inputLength) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Convert::FromBase64_ComputeResultLength");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Convert", "FromBase64_ComputeResultLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputPtr), ::il2cpp_utils::ExtractType(inputLength)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, inputPtr, inputLength);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.DateTime
#include "System/DateTime.hpp"
// Including type: System.String
#include "System/String.hpp"
// Including type: System.DayOfWeek
#include "System/DayOfWeek.hpp"
// Including type: System.DateTimeKind
#include "System/DateTimeKind.hpp"
// Including type: System.TimeSpan
#include "System/TimeSpan.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
// Including type: System.Runtime.Serialization.StreamingContext
#include "System/Runtime/Serialization/StreamingContext.hpp"
// Including type: System.IFormatProvider
#include "System/IFormatProvider.hpp"
// Including type: System.Globalization.DateTimeStyles
#include "System/Globalization/DateTimeStyles.hpp"
// Including type: System.TypeCode
#include "System/TypeCode.hpp"
// Including type: System.Decimal
#include "System/Decimal.hpp"
// Including type: System.Type
#include "System/Type.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Int64 TicksPerMillisecond
int64_t System::DateTime::_get_TicksPerMillisecond() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_TicksPerMillisecond");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "TicksPerMillisecond"));
}
// Autogenerated static field setter
// Set static field: static private System.Int64 TicksPerMillisecond
void System::DateTime::_set_TicksPerMillisecond(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_TicksPerMillisecond");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "TicksPerMillisecond", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int64 TicksPerSecond
int64_t System::DateTime::_get_TicksPerSecond() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_TicksPerSecond");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "TicksPerSecond"));
}
// Autogenerated static field setter
// Set static field: static private System.Int64 TicksPerSecond
void System::DateTime::_set_TicksPerSecond(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_TicksPerSecond");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "TicksPerSecond", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int64 TicksPerMinute
int64_t System::DateTime::_get_TicksPerMinute() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_TicksPerMinute");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "TicksPerMinute"));
}
// Autogenerated static field setter
// Set static field: static private System.Int64 TicksPerMinute
void System::DateTime::_set_TicksPerMinute(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_TicksPerMinute");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "TicksPerMinute", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int64 TicksPerHour
int64_t System::DateTime::_get_TicksPerHour() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_TicksPerHour");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "TicksPerHour"));
}
// Autogenerated static field setter
// Set static field: static private System.Int64 TicksPerHour
void System::DateTime::_set_TicksPerHour(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_TicksPerHour");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "TicksPerHour", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int64 TicksPerDay
int64_t System::DateTime::_get_TicksPerDay() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_TicksPerDay");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "TicksPerDay"));
}
// Autogenerated static field setter
// Set static field: static private System.Int64 TicksPerDay
void System::DateTime::_set_TicksPerDay(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_TicksPerDay");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "TicksPerDay", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 MillisPerSecond
int System::DateTime::_get_MillisPerSecond() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_MillisPerSecond");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "MillisPerSecond"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 MillisPerSecond
void System::DateTime::_set_MillisPerSecond(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_MillisPerSecond");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "MillisPerSecond", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 MillisPerMinute
int System::DateTime::_get_MillisPerMinute() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_MillisPerMinute");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "MillisPerMinute"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 MillisPerMinute
void System::DateTime::_set_MillisPerMinute(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_MillisPerMinute");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "MillisPerMinute", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 MillisPerHour
int System::DateTime::_get_MillisPerHour() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_MillisPerHour");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "MillisPerHour"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 MillisPerHour
void System::DateTime::_set_MillisPerHour(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_MillisPerHour");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "MillisPerHour", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 MillisPerDay
int System::DateTime::_get_MillisPerDay() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_MillisPerDay");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "MillisPerDay"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 MillisPerDay
void System::DateTime::_set_MillisPerDay(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_MillisPerDay");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "MillisPerDay", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DaysPerYear
int System::DateTime::_get_DaysPerYear() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DaysPerYear");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DaysPerYear"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DaysPerYear
void System::DateTime::_set_DaysPerYear(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DaysPerYear");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DaysPerYear", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DaysPer4Years
int System::DateTime::_get_DaysPer4Years() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DaysPer4Years");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DaysPer4Years"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DaysPer4Years
void System::DateTime::_set_DaysPer4Years(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DaysPer4Years");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DaysPer4Years", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DaysPer100Years
int System::DateTime::_get_DaysPer100Years() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DaysPer100Years");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DaysPer100Years"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DaysPer100Years
void System::DateTime::_set_DaysPer100Years(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DaysPer100Years");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DaysPer100Years", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DaysPer400Years
int System::DateTime::_get_DaysPer400Years() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DaysPer400Years");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DaysPer400Years"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DaysPer400Years
void System::DateTime::_set_DaysPer400Years(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DaysPer400Years");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DaysPer400Years", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DaysTo1601
int System::DateTime::_get_DaysTo1601() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DaysTo1601");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DaysTo1601"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DaysTo1601
void System::DateTime::_set_DaysTo1601(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DaysTo1601");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DaysTo1601", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DaysTo1899
int System::DateTime::_get_DaysTo1899() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DaysTo1899");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DaysTo1899"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DaysTo1899
void System::DateTime::_set_DaysTo1899(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DaysTo1899");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DaysTo1899", value));
}
// Autogenerated static field getter
// Get static field: static System.Int32 DaysTo1970
int System::DateTime::_get_DaysTo1970() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DaysTo1970");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DaysTo1970"));
}
// Autogenerated static field setter
// Set static field: static System.Int32 DaysTo1970
void System::DateTime::_set_DaysTo1970(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DaysTo1970");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DaysTo1970", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DaysTo10000
int System::DateTime::_get_DaysTo10000() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DaysTo10000");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DaysTo10000"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DaysTo10000
void System::DateTime::_set_DaysTo10000(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DaysTo10000");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DaysTo10000", value));
}
// Autogenerated static field getter
// Get static field: static System.Int64 MinTicks
int64_t System::DateTime::_get_MinTicks() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_MinTicks");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "MinTicks"));
}
// Autogenerated static field setter
// Set static field: static System.Int64 MinTicks
void System::DateTime::_set_MinTicks(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_MinTicks");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "MinTicks", value));
}
// Autogenerated static field getter
// Get static field: static System.Int64 MaxTicks
int64_t System::DateTime::_get_MaxTicks() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_MaxTicks");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "MaxTicks"));
}
// Autogenerated static field setter
// Set static field: static System.Int64 MaxTicks
void System::DateTime::_set_MaxTicks(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_MaxTicks");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "MaxTicks", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int64 MaxMillis
int64_t System::DateTime::_get_MaxMillis() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_MaxMillis");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "MaxMillis"));
}
// Autogenerated static field setter
// Set static field: static private System.Int64 MaxMillis
void System::DateTime::_set_MaxMillis(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_MaxMillis");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "MaxMillis", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int64 FileTimeOffset
int64_t System::DateTime::_get_FileTimeOffset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_FileTimeOffset");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "FileTimeOffset"));
}
// Autogenerated static field setter
// Set static field: static private System.Int64 FileTimeOffset
void System::DateTime::_set_FileTimeOffset(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_FileTimeOffset");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "FileTimeOffset", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int64 DoubleDateOffset
int64_t System::DateTime::_get_DoubleDateOffset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DoubleDateOffset");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "DoubleDateOffset"));
}
// Autogenerated static field setter
// Set static field: static private System.Int64 DoubleDateOffset
void System::DateTime::_set_DoubleDateOffset(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DoubleDateOffset");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DoubleDateOffset", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int64 OADateMinAsTicks
int64_t System::DateTime::_get_OADateMinAsTicks() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_OADateMinAsTicks");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "OADateMinAsTicks"));
}
// Autogenerated static field setter
// Set static field: static private System.Int64 OADateMinAsTicks
void System::DateTime::_set_OADateMinAsTicks(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_OADateMinAsTicks");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "OADateMinAsTicks", value));
}
// Autogenerated static field getter
// Get static field: static private System.Double OADateMinAsDouble
double System::DateTime::_get_OADateMinAsDouble() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_OADateMinAsDouble");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<double>("System", "DateTime", "OADateMinAsDouble"));
}
// Autogenerated static field setter
// Set static field: static private System.Double OADateMinAsDouble
void System::DateTime::_set_OADateMinAsDouble(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_OADateMinAsDouble");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "OADateMinAsDouble", value));
}
// Autogenerated static field getter
// Get static field: static private System.Double OADateMaxAsDouble
double System::DateTime::_get_OADateMaxAsDouble() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_OADateMaxAsDouble");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<double>("System", "DateTime", "OADateMaxAsDouble"));
}
// Autogenerated static field setter
// Set static field: static private System.Double OADateMaxAsDouble
void System::DateTime::_set_OADateMaxAsDouble(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_OADateMaxAsDouble");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "OADateMaxAsDouble", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DatePartYear
int System::DateTime::_get_DatePartYear() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DatePartYear");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DatePartYear"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DatePartYear
void System::DateTime::_set_DatePartYear(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DatePartYear");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DatePartYear", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DatePartDayOfYear
int System::DateTime::_get_DatePartDayOfYear() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DatePartDayOfYear");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DatePartDayOfYear"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DatePartDayOfYear
void System::DateTime::_set_DatePartDayOfYear(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DatePartDayOfYear");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DatePartDayOfYear", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DatePartMonth
int System::DateTime::_get_DatePartMonth() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DatePartMonth");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DatePartMonth"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DatePartMonth
void System::DateTime::_set_DatePartMonth(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DatePartMonth");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DatePartMonth", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 DatePartDay
int System::DateTime::_get_DatePartDay() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DatePartDay");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "DatePartDay"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 DatePartDay
void System::DateTime::_set_DatePartDay(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DatePartDay");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DatePartDay", value));
}
// Autogenerated static field getter
// Get static field: static private readonly System.Int32[] DaysToMonth365
::ArrayW<int> System::DateTime::_get_DaysToMonth365() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DaysToMonth365");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<int>>("System", "DateTime", "DaysToMonth365"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Int32[] DaysToMonth365
void System::DateTime::_set_DaysToMonth365(::ArrayW<int> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DaysToMonth365");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DaysToMonth365", value));
}
// Autogenerated static field getter
// Get static field: static private readonly System.Int32[] DaysToMonth366
::ArrayW<int> System::DateTime::_get_DaysToMonth366() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DaysToMonth366");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<int>>("System", "DateTime", "DaysToMonth366"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Int32[] DaysToMonth366
void System::DateTime::_set_DaysToMonth366(::ArrayW<int> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DaysToMonth366");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DaysToMonth366", value));
}
// Autogenerated static field getter
// Get static field: static public readonly System.DateTime MinValue
::System::DateTime System::DateTime::_get_MinValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_MinValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DateTime>("System", "DateTime", "MinValue"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.DateTime MinValue
void System::DateTime::_set_MinValue(::System::DateTime value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_MinValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "MinValue", value));
}
// Autogenerated static field getter
// Get static field: static public readonly System.DateTime MaxValue
::System::DateTime System::DateTime::_get_MaxValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_MaxValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DateTime>("System", "DateTime", "MaxValue"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.DateTime MaxValue
void System::DateTime::_set_MaxValue(::System::DateTime value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_MaxValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "MaxValue", value));
}
// Autogenerated static field getter
// Get static field: static private System.UInt64 TicksMask
uint64_t System::DateTime::_get_TicksMask() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_TicksMask");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint64_t>("System", "DateTime", "TicksMask"));
}
// Autogenerated static field setter
// Set static field: static private System.UInt64 TicksMask
void System::DateTime::_set_TicksMask(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_TicksMask");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "TicksMask", value));
}
// Autogenerated static field getter
// Get static field: static private System.UInt64 FlagsMask
uint64_t System::DateTime::_get_FlagsMask() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_FlagsMask");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint64_t>("System", "DateTime", "FlagsMask"));
}
// Autogenerated static field setter
// Set static field: static private System.UInt64 FlagsMask
void System::DateTime::_set_FlagsMask(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_FlagsMask");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "FlagsMask", value));
}
// Autogenerated static field getter
// Get static field: static private System.UInt64 LocalMask
uint64_t System::DateTime::_get_LocalMask() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_LocalMask");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint64_t>("System", "DateTime", "LocalMask"));
}
// Autogenerated static field setter
// Set static field: static private System.UInt64 LocalMask
void System::DateTime::_set_LocalMask(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_LocalMask");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "LocalMask", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int64 TicksCeiling
int64_t System::DateTime::_get_TicksCeiling() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_TicksCeiling");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int64_t>("System", "DateTime", "TicksCeiling"));
}
// Autogenerated static field setter
// Set static field: static private System.Int64 TicksCeiling
void System::DateTime::_set_TicksCeiling(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_TicksCeiling");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "TicksCeiling", value));
}
// Autogenerated static field getter
// Get static field: static private System.UInt64 KindUnspecified
uint64_t System::DateTime::_get_KindUnspecified() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_KindUnspecified");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint64_t>("System", "DateTime", "KindUnspecified"));
}
// Autogenerated static field setter
// Set static field: static private System.UInt64 KindUnspecified
void System::DateTime::_set_KindUnspecified(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_KindUnspecified");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "KindUnspecified", value));
}
// Autogenerated static field getter
// Get static field: static private System.UInt64 KindUtc
uint64_t System::DateTime::_get_KindUtc() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_KindUtc");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint64_t>("System", "DateTime", "KindUtc"));
}
// Autogenerated static field setter
// Set static field: static private System.UInt64 KindUtc
void System::DateTime::_set_KindUtc(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_KindUtc");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "KindUtc", value));
}
// Autogenerated static field getter
// Get static field: static private System.UInt64 KindLocal
uint64_t System::DateTime::_get_KindLocal() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_KindLocal");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint64_t>("System", "DateTime", "KindLocal"));
}
// Autogenerated static field setter
// Set static field: static private System.UInt64 KindLocal
void System::DateTime::_set_KindLocal(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_KindLocal");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "KindLocal", value));
}
// Autogenerated static field getter
// Get static field: static private System.UInt64 KindLocalAmbiguousDst
uint64_t System::DateTime::_get_KindLocalAmbiguousDst() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_KindLocalAmbiguousDst");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint64_t>("System", "DateTime", "KindLocalAmbiguousDst"));
}
// Autogenerated static field setter
// Set static field: static private System.UInt64 KindLocalAmbiguousDst
void System::DateTime::_set_KindLocalAmbiguousDst(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_KindLocalAmbiguousDst");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "KindLocalAmbiguousDst", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 KindShift
int System::DateTime::_get_KindShift() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_KindShift");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "DateTime", "KindShift"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 KindShift
void System::DateTime::_set_KindShift(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_KindShift");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "KindShift", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TicksField
::StringW System::DateTime::_get_TicksField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_TicksField");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("System", "DateTime", "TicksField"));
}
// Autogenerated static field setter
// Set static field: static private System.String TicksField
void System::DateTime::_set_TicksField(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_TicksField");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "TicksField", value));
}
// Autogenerated static field getter
// Get static field: static private System.String DateDataField
::StringW System::DateTime::_get_DateDataField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_get_DateDataField");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("System", "DateTime", "DateDataField"));
}
// Autogenerated static field setter
// Set static field: static private System.String DateDataField
void System::DateTime::_set_DateDataField(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::_set_DateDataField");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTime", "DateDataField", value));
}
// Autogenerated instance field getter
// Get instance field: private System.UInt64 dateData
uint64_t& System::DateTime::dyn_dateData() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::dyn_dateData");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "dateData"))->offset;
return *reinterpret_cast<uint64_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.DateTime.get_InternalTicks
int64_t System::DateTime::get_InternalTicks() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_InternalTicks");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_InternalTicks", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_InternalKind
uint64_t System::DateTime::get_InternalKind() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_InternalKind");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_InternalKind", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_Date
::System::DateTime System::DateTime::get_Date() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Date");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Date", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_Day
int System::DateTime::get_Day() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Day");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Day", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_DayOfWeek
::System::DayOfWeek System::DateTime::get_DayOfWeek() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_DayOfWeek");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_DayOfWeek", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DayOfWeek, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_Hour
int System::DateTime::get_Hour() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Hour");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Hour", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_Kind
::System::DateTimeKind System::DateTime::get_Kind() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Kind");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Kind", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTimeKind, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_Millisecond
int System::DateTime::get_Millisecond() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Millisecond");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Millisecond", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_Minute
int System::DateTime::get_Minute() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Minute");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Minute", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_Month
int System::DateTime::get_Month() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Month");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Month", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_Now
::System::DateTime System::DateTime::get_Now() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Now");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "get_Now", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.DateTime.get_UtcNow
::System::DateTime System::DateTime::get_UtcNow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_UtcNow");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "get_UtcNow", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.DateTime.get_Second
int System::DateTime::get_Second() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Second");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Second", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_Ticks
int64_t System::DateTime::get_Ticks() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Ticks");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Ticks", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_TimeOfDay
::System::TimeSpan System::DateTime::get_TimeOfDay() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_TimeOfDay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_TimeOfDay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::TimeSpan, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.get_Year
int System::DateTime::get_Year() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::get_Year");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Year", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime..ctor
System::DateTime::DateTime(int64_t ticks) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ticks)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ticks);
}
// Autogenerated method: System.DateTime..ctor
// ABORTED elsewhere. System::DateTime::DateTime(uint64_t dateData)
// Autogenerated method: System.DateTime..ctor
System::DateTime::DateTime(int64_t ticks, ::System::DateTimeKind kind) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ticks), ::il2cpp_utils::ExtractType(kind)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ticks, kind);
}
// Autogenerated method: System.DateTime..ctor
System::DateTime::DateTime(int64_t ticks, ::System::DateTimeKind kind, bool isAmbiguousDst) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ticks), ::il2cpp_utils::ExtractType(kind), ::il2cpp_utils::ExtractType(isAmbiguousDst)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ticks, kind, isAmbiguousDst);
}
// Autogenerated method: System.DateTime..ctor
System::DateTime::DateTime(int year, int month, int day) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(year), ::il2cpp_utils::ExtractType(month), ::il2cpp_utils::ExtractType(day)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, year, month, day);
}
// Autogenerated method: System.DateTime..ctor
System::DateTime::DateTime(int year, int month, int day, int hour, int minute, int second) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(year), ::il2cpp_utils::ExtractType(month), ::il2cpp_utils::ExtractType(day), ::il2cpp_utils::ExtractType(hour), ::il2cpp_utils::ExtractType(minute), ::il2cpp_utils::ExtractType(second)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, year, month, day, hour, minute, second);
}
// Autogenerated method: System.DateTime..ctor
System::DateTime::DateTime(int year, int month, int day, int hour, int minute, int second, ::System::DateTimeKind kind) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(year), ::il2cpp_utils::ExtractType(month), ::il2cpp_utils::ExtractType(day), ::il2cpp_utils::ExtractType(hour), ::il2cpp_utils::ExtractType(minute), ::il2cpp_utils::ExtractType(second), ::il2cpp_utils::ExtractType(kind)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, year, month, day, hour, minute, second, kind);
}
// Autogenerated method: System.DateTime..ctor
System::DateTime::DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(year), ::il2cpp_utils::ExtractType(month), ::il2cpp_utils::ExtractType(day), ::il2cpp_utils::ExtractType(hour), ::il2cpp_utils::ExtractType(minute), ::il2cpp_utils::ExtractType(second), ::il2cpp_utils::ExtractType(millisecond)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, year, month, day, hour, minute, second, millisecond);
}
// Autogenerated method: System.DateTime..ctor
System::DateTime::DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, ::System::DateTimeKind kind) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(year), ::il2cpp_utils::ExtractType(month), ::il2cpp_utils::ExtractType(day), ::il2cpp_utils::ExtractType(hour), ::il2cpp_utils::ExtractType(minute), ::il2cpp_utils::ExtractType(second), ::il2cpp_utils::ExtractType(millisecond), ::il2cpp_utils::ExtractType(kind)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, year, month, day, hour, minute, second, millisecond, kind);
}
// Autogenerated method: System.DateTime..ctor
System::DateTime::DateTime(::System::Runtime::Serialization::SerializationInfo* info, ::System::Runtime::Serialization::StreamingContext context) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractType(context)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, info, context);
}
// Autogenerated method: System.DateTime..cctor
void System::DateTime::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.DateTime.Add
::System::DateTime System::DateTime::Add(::System::TimeSpan value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::Add");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Add", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.Add
::System::DateTime System::DateTime::Add(double value, int scale) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::Add");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Add", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(scale)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, value, scale);
}
// Autogenerated method: System.DateTime.AddDays
::System::DateTime System::DateTime::AddDays(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::AddDays");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "AddDays", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.AddHours
::System::DateTime System::DateTime::AddHours(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::AddHours");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "AddHours", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.AddMilliseconds
::System::DateTime System::DateTime::AddMilliseconds(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::AddMilliseconds");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "AddMilliseconds", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.AddMonths
::System::DateTime System::DateTime::AddMonths(int months) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::AddMonths");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "AddMonths", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(months)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, months);
}
// Autogenerated method: System.DateTime.AddSeconds
::System::DateTime System::DateTime::AddSeconds(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::AddSeconds");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "AddSeconds", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.AddTicks
::System::DateTime System::DateTime::AddTicks(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::AddTicks");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "AddTicks", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.AddYears
::System::DateTime System::DateTime::AddYears(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::AddYears");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "AddYears", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.CompareTo
int System::DateTime::CompareTo(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.CompareTo
int System::DateTime::CompareTo(::System::DateTime value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.DateToTicks
int64_t System::DateTime::DateToTicks(int year, int month, int day) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::DateToTicks");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "DateToTicks", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(year), ::il2cpp_utils::ExtractType(month), ::il2cpp_utils::ExtractType(day)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, year, month, day);
}
// Autogenerated method: System.DateTime.TimeToTicks
int64_t System::DateTime::TimeToTicks(int hour, int minute, int second) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::TimeToTicks");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "TimeToTicks", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hour), ::il2cpp_utils::ExtractType(minute), ::il2cpp_utils::ExtractType(second)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, hour, minute, second);
}
// Autogenerated method: System.DateTime.DaysInMonth
int System::DateTime::DaysInMonth(int year, int month) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::DaysInMonth");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "DaysInMonth", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(year), ::il2cpp_utils::ExtractType(month)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, year, month);
}
// Autogenerated method: System.DateTime.Equals
bool System::DateTime::Equals(::System::DateTime value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.FromBinary
::System::DateTime System::DateTime::FromBinary(int64_t dateData) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::FromBinary");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "FromBinary", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dateData)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, dateData);
}
// Autogenerated method: System.DateTime.FromBinaryRaw
::System::DateTime System::DateTime::FromBinaryRaw(int64_t dateData) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::FromBinaryRaw");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "FromBinaryRaw", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dateData)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, dateData);
}
// Autogenerated method: System.DateTime.FromFileTime
::System::DateTime System::DateTime::FromFileTime(int64_t fileTime) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::FromFileTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "FromFileTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(fileTime)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, fileTime);
}
// Autogenerated method: System.DateTime.FromFileTimeUtc
::System::DateTime System::DateTime::FromFileTimeUtc(int64_t fileTime) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::FromFileTimeUtc");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "FromFileTimeUtc", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(fileTime)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, fileTime);
}
// Autogenerated method: System.DateTime.System.Runtime.Serialization.ISerializable.GetObjectData
void System::DateTime::System_Runtime_Serialization_ISerializable_GetObjectData(::System::Runtime::Serialization::SerializationInfo* info, ::System::Runtime::Serialization::StreamingContext context) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.Runtime.Serialization.ISerializable.GetObjectData");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.Runtime.Serialization.ISerializable.GetObjectData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractType(context)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, info, context);
}
// Autogenerated method: System.DateTime.SpecifyKind
::System::DateTime System::DateTime::SpecifyKind(::System::DateTime value, ::System::DateTimeKind kind) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::SpecifyKind");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "SpecifyKind", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(kind)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value, kind);
}
// Autogenerated method: System.DateTime.ToBinaryRaw
int64_t System::DateTime::ToBinaryRaw() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToBinaryRaw");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToBinaryRaw", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.GetDatePart
int System::DateTime::GetDatePart(int part) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::GetDatePart");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetDatePart", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(part)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, part);
}
// Autogenerated method: System.DateTime.IsAmbiguousDaylightSavingTime
bool System::DateTime::IsAmbiguousDaylightSavingTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::IsAmbiguousDaylightSavingTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "IsAmbiguousDaylightSavingTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.GetSystemTimeAsFileTime
int64_t System::DateTime::GetSystemTimeAsFileTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::GetSystemTimeAsFileTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "GetSystemTimeAsFileTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.DateTime.IsLeapYear
bool System::DateTime::IsLeapYear(int year) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::IsLeapYear");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "IsLeapYear", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(year)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, year);
}
// Autogenerated method: System.DateTime.Parse
::System::DateTime System::DateTime::Parse(::StringW s, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, provider);
}
// Autogenerated method: System.DateTime.ParseExact
::System::DateTime System::DateTime::ParseExact(::StringW s, ::StringW format, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ParseExact");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "ParseExact", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(format), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, format, provider);
}
// Autogenerated method: System.DateTime.ParseExact
::System::DateTime System::DateTime::ParseExact(::StringW s, ::StringW format, ::System::IFormatProvider* provider, ::System::Globalization::DateTimeStyles style) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ParseExact");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "ParseExact", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(format), ::il2cpp_utils::ExtractType(provider), ::il2cpp_utils::ExtractType(style)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, format, provider, style);
}
// Autogenerated method: System.DateTime.ToFileTime
int64_t System::DateTime::ToFileTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToFileTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToFileTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.ToFileTimeUtc
int64_t System::DateTime::ToFileTimeUtc() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToFileTimeUtc");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToFileTimeUtc", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.ToLocalTime
::System::DateTime System::DateTime::ToLocalTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToLocalTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToLocalTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.ToLocalTime
::System::DateTime System::DateTime::ToLocalTime(bool throwOnOverflow) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToLocalTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToLocalTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(throwOnOverflow)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, throwOnOverflow);
}
// Autogenerated method: System.DateTime.ToShortDateString
::StringW System::DateTime::ToShortDateString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToShortDateString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToShortDateString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.ToString
::StringW System::DateTime::ToString(::StringW format) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(format)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, format);
}
// Autogenerated method: System.DateTime.ToString
::StringW System::DateTime::ToString(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.ToString
::StringW System::DateTime::ToString(::StringW format, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(format), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, format, provider);
}
// Autogenerated method: System.DateTime.ToUniversalTime
::System::DateTime System::DateTime::ToUniversalTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToUniversalTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToUniversalTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.TryParse
bool System::DateTime::TryParse(::StringW s, ::System::IFormatProvider* provider, ::System::Globalization::DateTimeStyles styles, ByRef<::System::DateTime> result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::TryParse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "TryParse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(provider), ::il2cpp_utils::ExtractType(styles), ::il2cpp_utils::ExtractIndependentType<::System::DateTime&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, provider, styles, byref(result));
}
// Autogenerated method: System.DateTime.TryParseExact
bool System::DateTime::TryParseExact(::StringW s, ::StringW format, ::System::IFormatProvider* provider, ::System::Globalization::DateTimeStyles style, ByRef<::System::DateTime> result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::TryParseExact");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "TryParseExact", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(format), ::il2cpp_utils::ExtractType(provider), ::il2cpp_utils::ExtractType(style), ::il2cpp_utils::ExtractIndependentType<::System::DateTime&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, format, provider, style, byref(result));
}
// Autogenerated method: System.DateTime.GetTypeCode
::System::TypeCode System::DateTime::GetTypeCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::GetTypeCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetTypeCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::TypeCode, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToBoolean
bool System::DateTime::System_IConvertible_ToBoolean(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToBoolean");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToChar
::Il2CppChar System::DateTime::System_IConvertible_ToChar(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToChar");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToSByte
int8_t System::DateTime::System_IConvertible_ToSByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToSByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToByte
uint8_t System::DateTime::System_IConvertible_ToByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToInt16
int16_t System::DateTime::System_IConvertible_ToInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToUInt16
uint16_t System::DateTime::System_IConvertible_ToUInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToUInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToInt32
int System::DateTime::System_IConvertible_ToInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToUInt32
uint System::DateTime::System_IConvertible_ToUInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToUInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToInt64
int64_t System::DateTime::System_IConvertible_ToInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToUInt64
uint64_t System::DateTime::System_IConvertible_ToUInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToUInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToSingle
float System::DateTime::System_IConvertible_ToSingle(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToSingle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToDouble
double System::DateTime::System_IConvertible_ToDouble(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToDouble");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToDecimal
::System::Decimal System::DateTime::System_IConvertible_ToDecimal(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToDecimal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToDateTime
::System::DateTime System::DateTime::System_IConvertible_ToDateTime(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToDateTime");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DateTime.System.IConvertible.ToType
::Il2CppObject* System::DateTime::System_IConvertible_ToType(::System::Type* type, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::System.IConvertible.ToType");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, type, provider);
}
// Autogenerated method: System.DateTime.TryCreate
bool System::DateTime::TryCreate(int year, int month, int day, int hour, int minute, int second, int millisecond, ByRef<::System::DateTime> result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::TryCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "TryCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(year), ::il2cpp_utils::ExtractType(month), ::il2cpp_utils::ExtractType(day), ::il2cpp_utils::ExtractType(hour), ::il2cpp_utils::ExtractType(minute), ::il2cpp_utils::ExtractType(second), ::il2cpp_utils::ExtractType(millisecond), ::il2cpp_utils::ExtractIndependentType<::System::DateTime&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, year, month, day, hour, minute, second, millisecond, byref(result));
}
// Autogenerated method: System.DateTime.Equals
bool System::DateTime::Equals(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, value);
}
// Autogenerated method: System.DateTime.GetHashCode
int System::DateTime::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.ToString
::StringW System::DateTime::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTime.op_Addition
::System::DateTime System::operator+(const ::System::DateTime& d, const ::System::TimeSpan& t) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::op_Addition");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "op_Addition", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d), ::il2cpp_utils::ExtractType(t)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d, t);
}
// Autogenerated method: System.DateTime.op_Subtraction
::System::DateTime System::operator-(const ::System::DateTime& d, const ::System::TimeSpan& t) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::op_Subtraction");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "op_Subtraction", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d), ::il2cpp_utils::ExtractType(t)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d, t);
}
// Autogenerated method: System.DateTime.op_Subtraction
::System::TimeSpan System::operator-(const ::System::DateTime& d1, const ::System::DateTime& d2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::op_Subtraction");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "op_Subtraction", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2)})));
return ::il2cpp_utils::RunMethodRethrow<::System::TimeSpan, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d1, d2);
}
// Autogenerated method: System.DateTime.op_Equality
bool System::operator ==(const ::System::DateTime& d1, const ::System::DateTime& d2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::op_Equality");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "op_Equality", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d1, d2);
}
// Autogenerated method: System.DateTime.op_Inequality
bool System::operator !=(const ::System::DateTime& d1, const ::System::DateTime& d2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::op_Inequality");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "op_Inequality", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d1, d2);
}
// Autogenerated method: System.DateTime.op_LessThan
bool System::operator <(const ::System::DateTime& t1, const ::System::DateTime& t2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::op_LessThan");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "op_LessThan", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(t1), ::il2cpp_utils::ExtractType(t2)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, t1, t2);
}
// Autogenerated method: System.DateTime.op_LessThanOrEqual
bool System::operator <=(const ::System::DateTime& t1, const ::System::DateTime& t2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::op_LessThanOrEqual");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "op_LessThanOrEqual", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(t1), ::il2cpp_utils::ExtractType(t2)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, t1, t2);
}
// Autogenerated method: System.DateTime.op_GreaterThan
bool System::operator >(const ::System::DateTime& t1, const ::System::DateTime& t2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::op_GreaterThan");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "op_GreaterThan", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(t1), ::il2cpp_utils::ExtractType(t2)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, t1, t2);
}
// Autogenerated method: System.DateTime.op_GreaterThanOrEqual
bool System::operator >=(const ::System::DateTime& t1, const ::System::DateTime& t2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTime::op_GreaterThanOrEqual");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTime", "op_GreaterThanOrEqual", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(t1), ::il2cpp_utils::ExtractType(t2)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, t1, t2);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.DateTimeKind
#include "System/DateTimeKind.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.DateTimeKind Unspecified
::System::DateTimeKind System::DateTimeKind::_get_Unspecified() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeKind::_get_Unspecified");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DateTimeKind>("System", "DateTimeKind", "Unspecified"));
}
// Autogenerated static field setter
// Set static field: static public System.DateTimeKind Unspecified
void System::DateTimeKind::_set_Unspecified(::System::DateTimeKind value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeKind::_set_Unspecified");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTimeKind", "Unspecified", value));
}
// Autogenerated static field getter
// Get static field: static public System.DateTimeKind Utc
::System::DateTimeKind System::DateTimeKind::_get_Utc() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeKind::_get_Utc");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DateTimeKind>("System", "DateTimeKind", "Utc"));
}
// Autogenerated static field setter
// Set static field: static public System.DateTimeKind Utc
void System::DateTimeKind::_set_Utc(::System::DateTimeKind value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeKind::_set_Utc");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTimeKind", "Utc", value));
}
// Autogenerated static field getter
// Get static field: static public System.DateTimeKind Local
::System::DateTimeKind System::DateTimeKind::_get_Local() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeKind::_get_Local");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DateTimeKind>("System", "DateTimeKind", "Local"));
}
// Autogenerated static field setter
// Set static field: static public System.DateTimeKind Local
void System::DateTimeKind::_set_Local(::System::DateTimeKind value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeKind::_set_Local");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTimeKind", "Local", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::DateTimeKind::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeKind::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.DateTimeOffset
#include "System/DateTimeOffset.hpp"
// Including type: System.TimeSpan
#include "System/TimeSpan.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
// Including type: System.Runtime.Serialization.StreamingContext
#include "System/Runtime/Serialization/StreamingContext.hpp"
// Including type: System.IFormatProvider
#include "System/IFormatProvider.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly System.DateTimeOffset MinValue
::System::DateTimeOffset System::DateTimeOffset::_get_MinValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::_get_MinValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DateTimeOffset>("System", "DateTimeOffset", "MinValue"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.DateTimeOffset MinValue
void System::DateTimeOffset::_set_MinValue(::System::DateTimeOffset value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::_set_MinValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTimeOffset", "MinValue", value));
}
// Autogenerated static field getter
// Get static field: static public readonly System.DateTimeOffset MaxValue
::System::DateTimeOffset System::DateTimeOffset::_get_MaxValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::_get_MaxValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DateTimeOffset>("System", "DateTimeOffset", "MaxValue"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.DateTimeOffset MaxValue
void System::DateTimeOffset::_set_MaxValue(::System::DateTimeOffset value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::_set_MaxValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DateTimeOffset", "MaxValue", value));
}
// Autogenerated instance field getter
// Get instance field: private System.DateTime m_dateTime
::System::DateTime& System::DateTimeOffset::dyn_m_dateTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::dyn_m_dateTime");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_dateTime"))->offset;
return *reinterpret_cast<::System::DateTime*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int16 m_offsetMinutes
int16_t& System::DateTimeOffset::dyn_m_offsetMinutes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::dyn_m_offsetMinutes");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_offsetMinutes"))->offset;
return *reinterpret_cast<int16_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.DateTimeOffset.get_Now
::System::DateTimeOffset System::DateTimeOffset::get_Now() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::get_Now");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTimeOffset", "get_Now", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTimeOffset, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.DateTimeOffset.get_DateTime
::System::DateTime System::DateTimeOffset::get_DateTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::get_DateTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_DateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTimeOffset.get_UtcDateTime
::System::DateTime System::DateTimeOffset::get_UtcDateTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::get_UtcDateTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_UtcDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTimeOffset.get_ClockDateTime
::System::DateTime System::DateTimeOffset::get_ClockDateTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::get_ClockDateTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_ClockDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTimeOffset.get_Offset
::System::TimeSpan System::DateTimeOffset::get_Offset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::get_Offset");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Offset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::TimeSpan, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTimeOffset..ctor
System::DateTimeOffset::DateTimeOffset(int64_t ticks, ::System::TimeSpan offset) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ticks), ::il2cpp_utils::ExtractType(offset)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ticks, offset);
}
// Autogenerated method: System.DateTimeOffset..ctor
System::DateTimeOffset::DateTimeOffset(::System::DateTime dateTime) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dateTime)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, dateTime);
}
// Autogenerated method: System.DateTimeOffset..ctor
System::DateTimeOffset::DateTimeOffset(::System::DateTime dateTime, ::System::TimeSpan offset) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dateTime), ::il2cpp_utils::ExtractType(offset)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, dateTime, offset);
}
// Autogenerated method: System.DateTimeOffset..ctor
System::DateTimeOffset::DateTimeOffset(::System::Runtime::Serialization::SerializationInfo* info, ::System::Runtime::Serialization::StreamingContext context) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractType(context)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, info, context);
}
// Autogenerated method: System.DateTimeOffset..cctor
void System::DateTimeOffset::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTimeOffset", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.DateTimeOffset.System.IComparable.CompareTo
int System::DateTimeOffset::System_IComparable_CompareTo(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::System.IComparable.CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IComparable.CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.DateTimeOffset.CompareTo
int System::DateTimeOffset::CompareTo(::System::DateTimeOffset other) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(other)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, other);
}
// Autogenerated method: System.DateTimeOffset.Equals
bool System::DateTimeOffset::Equals(::System::DateTimeOffset other) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(other)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, other);
}
// Autogenerated method: System.DateTimeOffset.System.Runtime.Serialization.IDeserializationCallback.OnDeserialization
void System::DateTimeOffset::System_Runtime_Serialization_IDeserializationCallback_OnDeserialization(::Il2CppObject* sender) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::System.Runtime.Serialization.IDeserializationCallback.OnDeserialization");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.Runtime.Serialization.IDeserializationCallback.OnDeserialization", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sender)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, sender);
}
// Autogenerated method: System.DateTimeOffset.System.Runtime.Serialization.ISerializable.GetObjectData
void System::DateTimeOffset::System_Runtime_Serialization_ISerializable_GetObjectData(::System::Runtime::Serialization::SerializationInfo* info, ::System::Runtime::Serialization::StreamingContext context) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::System.Runtime.Serialization.ISerializable.GetObjectData");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.Runtime.Serialization.ISerializable.GetObjectData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractType(context)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, info, context);
}
// Autogenerated method: System.DateTimeOffset.ToString
::StringW System::DateTimeOffset::ToString(::StringW format, ::System::IFormatProvider* formatProvider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(format), ::il2cpp_utils::ExtractType(formatProvider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, format, formatProvider);
}
// Autogenerated method: System.DateTimeOffset.ValidateOffset
int16_t System::DateTimeOffset::ValidateOffset(::System::TimeSpan offset) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::ValidateOffset");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTimeOffset", "ValidateOffset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(offset)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, offset);
}
// Autogenerated method: System.DateTimeOffset.ValidateDate
::System::DateTime System::DateTimeOffset::ValidateDate(::System::DateTime dateTime, ::System::TimeSpan offset) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::ValidateDate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DateTimeOffset", "ValidateDate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dateTime), ::il2cpp_utils::ExtractType(offset)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, dateTime, offset);
}
// Autogenerated method: System.DateTimeOffset.Equals
bool System::DateTimeOffset::Equals(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.DateTimeOffset.GetHashCode
int System::DateTimeOffset::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.DateTimeOffset.ToString
::StringW System::DateTimeOffset::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DateTimeOffset::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.DayOfWeek
#include "System/DayOfWeek.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.DayOfWeek Sunday
::System::DayOfWeek System::DayOfWeek::_get_Sunday() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_get_Sunday");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DayOfWeek>("System", "DayOfWeek", "Sunday"));
}
// Autogenerated static field setter
// Set static field: static public System.DayOfWeek Sunday
void System::DayOfWeek::_set_Sunday(::System::DayOfWeek value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_set_Sunday");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DayOfWeek", "Sunday", value));
}
// Autogenerated static field getter
// Get static field: static public System.DayOfWeek Monday
::System::DayOfWeek System::DayOfWeek::_get_Monday() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_get_Monday");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DayOfWeek>("System", "DayOfWeek", "Monday"));
}
// Autogenerated static field setter
// Set static field: static public System.DayOfWeek Monday
void System::DayOfWeek::_set_Monday(::System::DayOfWeek value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_set_Monday");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DayOfWeek", "Monday", value));
}
// Autogenerated static field getter
// Get static field: static public System.DayOfWeek Tuesday
::System::DayOfWeek System::DayOfWeek::_get_Tuesday() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_get_Tuesday");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DayOfWeek>("System", "DayOfWeek", "Tuesday"));
}
// Autogenerated static field setter
// Set static field: static public System.DayOfWeek Tuesday
void System::DayOfWeek::_set_Tuesday(::System::DayOfWeek value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_set_Tuesday");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DayOfWeek", "Tuesday", value));
}
// Autogenerated static field getter
// Get static field: static public System.DayOfWeek Wednesday
::System::DayOfWeek System::DayOfWeek::_get_Wednesday() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_get_Wednesday");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DayOfWeek>("System", "DayOfWeek", "Wednesday"));
}
// Autogenerated static field setter
// Set static field: static public System.DayOfWeek Wednesday
void System::DayOfWeek::_set_Wednesday(::System::DayOfWeek value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_set_Wednesday");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DayOfWeek", "Wednesday", value));
}
// Autogenerated static field getter
// Get static field: static public System.DayOfWeek Thursday
::System::DayOfWeek System::DayOfWeek::_get_Thursday() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_get_Thursday");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DayOfWeek>("System", "DayOfWeek", "Thursday"));
}
// Autogenerated static field setter
// Set static field: static public System.DayOfWeek Thursday
void System::DayOfWeek::_set_Thursday(::System::DayOfWeek value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_set_Thursday");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DayOfWeek", "Thursday", value));
}
// Autogenerated static field getter
// Get static field: static public System.DayOfWeek Friday
::System::DayOfWeek System::DayOfWeek::_get_Friday() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_get_Friday");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DayOfWeek>("System", "DayOfWeek", "Friday"));
}
// Autogenerated static field setter
// Set static field: static public System.DayOfWeek Friday
void System::DayOfWeek::_set_Friday(::System::DayOfWeek value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_set_Friday");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DayOfWeek", "Friday", value));
}
// Autogenerated static field getter
// Get static field: static public System.DayOfWeek Saturday
::System::DayOfWeek System::DayOfWeek::_get_Saturday() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_get_Saturday");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DayOfWeek>("System", "DayOfWeek", "Saturday"));
}
// Autogenerated static field setter
// Set static field: static public System.DayOfWeek Saturday
void System::DayOfWeek::_set_Saturday(::System::DayOfWeek value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::_set_Saturday");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DayOfWeek", "Saturday", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::DayOfWeek::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DayOfWeek::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.DBNull
#include "System/DBNull.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
// Including type: System.IFormatProvider
#include "System/IFormatProvider.hpp"
// Including type: System.TypeCode
#include "System/TypeCode.hpp"
// Including type: System.Decimal
#include "System/Decimal.hpp"
// Including type: System.DateTime
#include "System/DateTime.hpp"
// Including type: System.Type
#include "System/Type.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly System.DBNull Value
::System::DBNull* System::DBNull::_get_Value() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::_get_Value");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::DBNull*>("System", "DBNull", "Value"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.DBNull Value
void System::DBNull::_set_Value(::System::DBNull* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::_set_Value");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "DBNull", "Value", value));
}
// Autogenerated method: System.DBNull..cctor
void System::DBNull::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DBNull", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.DBNull.GetObjectData
void System::DBNull::GetObjectData(::System::Runtime::Serialization::SerializationInfo* info, ::System::Runtime::Serialization::StreamingContext context) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::GetObjectData");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetObjectData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractType(context)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, info, context);
}
// Autogenerated method: System.DBNull.ToString
::StringW System::DBNull::ToString(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.GetTypeCode
::System::TypeCode System::DBNull::GetTypeCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::GetTypeCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetTypeCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::TypeCode, false>(this, ___internal__method);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToBoolean
bool System::DBNull::System_IConvertible_ToBoolean(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToBoolean");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToChar
::Il2CppChar System::DBNull::System_IConvertible_ToChar(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToChar");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToSByte
int8_t System::DBNull::System_IConvertible_ToSByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToSByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToByte
uint8_t System::DBNull::System_IConvertible_ToByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToInt16
int16_t System::DBNull::System_IConvertible_ToInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToUInt16
uint16_t System::DBNull::System_IConvertible_ToUInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToUInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToInt32
int System::DBNull::System_IConvertible_ToInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToUInt32
uint System::DBNull::System_IConvertible_ToUInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToUInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToInt64
int64_t System::DBNull::System_IConvertible_ToInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToUInt64
uint64_t System::DBNull::System_IConvertible_ToUInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToUInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToSingle
float System::DBNull::System_IConvertible_ToSingle(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToSingle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToDouble
double System::DBNull::System_IConvertible_ToDouble(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToDouble");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToDecimal
::System::Decimal System::DBNull::System_IConvertible_ToDecimal(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToDecimal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToDateTime
::System::DateTime System::DBNull::System_IConvertible_ToDateTime(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToDateTime");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.DBNull.System.IConvertible.ToType
::Il2CppObject* System::DBNull::System_IConvertible_ToType(::System::Type* type, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::System.IConvertible.ToType");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, type, provider);
}
// Autogenerated method: System.DBNull.ToString
::StringW System::DBNull::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DBNull::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Decimal
#include "System/Decimal.hpp"
// Including type: System.Runtime.Serialization.StreamingContext
#include "System/Runtime/Serialization/StreamingContext.hpp"
// Including type: System.IFormatProvider
#include "System/IFormatProvider.hpp"
// Including type: System.Globalization.NumberStyles
#include "System/Globalization/NumberStyles.hpp"
// Including type: System.TypeCode
#include "System/TypeCode.hpp"
// Including type: System.DateTime
#include "System/DateTime.hpp"
// Including type: System.Type
#include "System/Type.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Int32 SignMask
int System::Decimal::_get_SignMask() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_SignMask");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Decimal", "SignMask"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 SignMask
void System::Decimal::_set_SignMask(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_SignMask");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "SignMask", value));
}
// Autogenerated static field getter
// Get static field: static private System.Byte DECIMAL_NEG
uint8_t System::Decimal::_get_DECIMAL_NEG() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_DECIMAL_NEG");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint8_t>("System", "Decimal", "DECIMAL_NEG"));
}
// Autogenerated static field setter
// Set static field: static private System.Byte DECIMAL_NEG
void System::Decimal::_set_DECIMAL_NEG(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_DECIMAL_NEG");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "DECIMAL_NEG", value));
}
// Autogenerated static field getter
// Get static field: static private System.Byte DECIMAL_ADD
uint8_t System::Decimal::_get_DECIMAL_ADD() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_DECIMAL_ADD");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<uint8_t>("System", "Decimal", "DECIMAL_ADD"));
}
// Autogenerated static field setter
// Set static field: static private System.Byte DECIMAL_ADD
void System::Decimal::_set_DECIMAL_ADD(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_DECIMAL_ADD");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "DECIMAL_ADD", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 ScaleMask
int System::Decimal::_get_ScaleMask() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_ScaleMask");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Decimal", "ScaleMask"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 ScaleMask
void System::Decimal::_set_ScaleMask(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_ScaleMask");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "ScaleMask", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 ScaleShift
int System::Decimal::_get_ScaleShift() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_ScaleShift");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Decimal", "ScaleShift"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 ScaleShift
void System::Decimal::_set_ScaleShift(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_ScaleShift");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "ScaleShift", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 MaxInt32Scale
int System::Decimal::_get_MaxInt32Scale() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_MaxInt32Scale");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System", "Decimal", "MaxInt32Scale"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 MaxInt32Scale
void System::Decimal::_set_MaxInt32Scale(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_MaxInt32Scale");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "MaxInt32Scale", value));
}
// Autogenerated static field getter
// Get static field: static private System.UInt32[] Powers10
::ArrayW<uint> System::Decimal::_get_Powers10() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_Powers10");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint>>("System", "Decimal", "Powers10"));
}
// Autogenerated static field setter
// Set static field: static private System.UInt32[] Powers10
void System::Decimal::_set_Powers10(::ArrayW<uint> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_Powers10");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "Powers10", value));
}
// [DecimalConstantAttribute] Offset: 0x57ECB4
// Autogenerated static field getter
// Get static field: static public readonly System.Decimal Zero
::System::Decimal System::Decimal::_get_Zero() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_Zero");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Decimal>("System", "Decimal", "Zero"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Decimal Zero
void System::Decimal::_set_Zero(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_Zero");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "Zero", value));
}
// [DecimalConstantAttribute] Offset: 0x57ECD8
// Autogenerated static field getter
// Get static field: static public readonly System.Decimal One
::System::Decimal System::Decimal::_get_One() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_One");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Decimal>("System", "Decimal", "One"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Decimal One
void System::Decimal::_set_One(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_One");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "One", value));
}
// [DecimalConstantAttribute] Offset: 0x57ECFC
// Autogenerated static field getter
// Get static field: static public readonly System.Decimal MinusOne
::System::Decimal System::Decimal::_get_MinusOne() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_MinusOne");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Decimal>("System", "Decimal", "MinusOne"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Decimal MinusOne
void System::Decimal::_set_MinusOne(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_MinusOne");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "MinusOne", value));
}
// [DecimalConstantAttribute] Offset: 0x57ED20
// Autogenerated static field getter
// Get static field: static public readonly System.Decimal MaxValue
::System::Decimal System::Decimal::_get_MaxValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_MaxValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Decimal>("System", "Decimal", "MaxValue"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Decimal MaxValue
void System::Decimal::_set_MaxValue(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_MaxValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "MaxValue", value));
}
// [DecimalConstantAttribute] Offset: 0x57ED44
// Autogenerated static field getter
// Get static field: static public readonly System.Decimal MinValue
::System::Decimal System::Decimal::_get_MinValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_MinValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Decimal>("System", "Decimal", "MinValue"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Decimal MinValue
void System::Decimal::_set_MinValue(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_MinValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "MinValue", value));
}
// [DecimalConstantAttribute] Offset: 0x57ED68
// Autogenerated static field getter
// Get static field: static private readonly System.Decimal NearNegativeZero
::System::Decimal System::Decimal::_get_NearNegativeZero() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_NearNegativeZero");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Decimal>("System", "Decimal", "NearNegativeZero"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Decimal NearNegativeZero
void System::Decimal::_set_NearNegativeZero(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_NearNegativeZero");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "NearNegativeZero", value));
}
// [DecimalConstantAttribute] Offset: 0x57ED8C
// Autogenerated static field getter
// Get static field: static private readonly System.Decimal NearPositiveZero
::System::Decimal System::Decimal::_get_NearPositiveZero() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_get_NearPositiveZero");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Decimal>("System", "Decimal", "NearPositiveZero"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Decimal NearPositiveZero
void System::Decimal::_set_NearPositiveZero(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::_set_NearPositiveZero");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Decimal", "NearPositiveZero", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 flags
int& System::Decimal::dyn_flags() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::dyn_flags");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "flags"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 hi
int& System::Decimal::dyn_hi() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::dyn_hi");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "hi"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 lo
int& System::Decimal::dyn_lo() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::dyn_lo");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "lo"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 mid
int& System::Decimal::dyn_mid() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::dyn_mid");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "mid"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Decimal..ctor
System::Decimal::Decimal(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Decimal..ctor
System::Decimal::Decimal(uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Decimal..ctor
System::Decimal::Decimal(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Decimal..ctor
System::Decimal::Decimal(uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Decimal..ctor
System::Decimal::Decimal(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Decimal..ctor
System::Decimal::Decimal(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Decimal..ctor
System::Decimal::Decimal(::ArrayW<int> bits) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(bits)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, bits);
}
// Autogenerated method: System.Decimal..ctor
System::Decimal::Decimal(int lo, int mid, int hi, bool isNegative, uint8_t scale) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::.ctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(lo), ::il2cpp_utils::ExtractType(mid), ::il2cpp_utils::ExtractType(hi), ::il2cpp_utils::ExtractType(isNegative), ::il2cpp_utils::ExtractType(scale)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, lo, mid, hi, isNegative, scale);
}
// Autogenerated method: System.Decimal..ctor
// ABORTED elsewhere. System::Decimal::Decimal(int lo, int mid, int hi, int flags)
// Autogenerated method: System.Decimal..cctor
void System::Decimal::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Decimal.SetBits
void System::Decimal::SetBits(::ArrayW<int> bits) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::SetBits");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "SetBits", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(bits)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, bits);
}
// Autogenerated method: System.Decimal.OnSerializing
void System::Decimal::OnSerializing(::System::Runtime::Serialization::StreamingContext ctx) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::OnSerializing");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "OnSerializing", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ctx)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ctx);
}
// Autogenerated method: System.Decimal.System.Runtime.Serialization.IDeserializationCallback.OnDeserialization
void System::Decimal::System_Runtime_Serialization_IDeserializationCallback_OnDeserialization(::Il2CppObject* sender) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.Runtime.Serialization.IDeserializationCallback.OnDeserialization");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.Runtime.Serialization.IDeserializationCallback.OnDeserialization", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sender)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, sender);
}
// Autogenerated method: System.Decimal.FCallAddSub
void System::Decimal::FCallAddSub(ByRef<::System::Decimal> d1, ByRef<::System::Decimal> d2, uint8_t bSign) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::FCallAddSub");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "FCallAddSub", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2), ::il2cpp_utils::ExtractType(bSign)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, byref(d1), byref(d2), bSign);
}
// Autogenerated method: System.Decimal.FCallCompare
int System::Decimal::FCallCompare(ByRef<::System::Decimal> d1, ByRef<::System::Decimal> d2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::FCallCompare");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "FCallCompare", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, byref(d1), byref(d2));
}
// Autogenerated method: System.Decimal.CompareTo
int System::Decimal::CompareTo(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Decimal.CompareTo
int System::Decimal::CompareTo(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Decimal.Equals
bool System::Decimal::Equals(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Decimal.ToString
::StringW System::Decimal::ToString(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.ToString
::StringW System::Decimal::ToString(::StringW format, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(format), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, format, provider);
}
// Autogenerated method: System.Decimal.Parse
::System::Decimal System::Decimal::Parse(::StringW s, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, provider);
}
// Autogenerated method: System.Decimal.Parse
::System::Decimal System::Decimal::Parse(::StringW s, ::System::Globalization::NumberStyles style, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(style), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, style, provider);
}
// Autogenerated method: System.Decimal.GetBits
::ArrayW<int> System::Decimal::GetBits(::System::Decimal d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::GetBits");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "GetBits", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<int>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Decimal.ToDecimal
::System::Decimal System::Decimal::ToDecimal(::ArrayW<uint8_t> buffer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToDecimal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, buffer);
}
// Autogenerated method: System.Decimal.FCallMultiply
void System::Decimal::FCallMultiply(ByRef<::System::Decimal> d1, ByRef<::System::Decimal> d2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::FCallMultiply");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "FCallMultiply", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, byref(d1), byref(d2));
}
// Autogenerated method: System.Decimal.Round
::System::Decimal System::Decimal::Round(::System::Decimal d, int decimals) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::Round");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "Round", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d), ::il2cpp_utils::ExtractType(decimals)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d, decimals);
}
// Autogenerated method: System.Decimal.FCallRound
void System::Decimal::FCallRound(ByRef<::System::Decimal> d, int decimals) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::FCallRound");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "FCallRound", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d), ::il2cpp_utils::ExtractType(decimals)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, byref(d), decimals);
}
// Autogenerated method: System.Decimal.ToByte
uint8_t System::Decimal::ToByte(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Decimal.ToSByte
int8_t System::Decimal::ToSByte(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToSByte");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Decimal.ToInt16
int16_t System::Decimal::ToInt16(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Decimal.ToDouble
double System::Decimal::ToDouble(::System::Decimal d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToDouble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Decimal.FCallToInt32
int System::Decimal::FCallToInt32(::System::Decimal d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::FCallToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "FCallToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Decimal.ToInt32
int System::Decimal::ToInt32(::System::Decimal d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Decimal.ToInt64
int64_t System::Decimal::ToInt64(::System::Decimal d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Decimal.ToUInt16
uint16_t System::Decimal::ToUInt16(::System::Decimal value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Decimal.ToUInt32
uint System::Decimal::ToUInt32(::System::Decimal d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToUInt32");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Decimal.ToUInt64
uint64_t System::Decimal::ToUInt64(::System::Decimal d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Decimal.ToSingle
float System::Decimal::ToSingle(::System::Decimal d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToSingle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Decimal.FCallTruncate
void System::Decimal::FCallTruncate(ByRef<::System::Decimal> d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::FCallTruncate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "FCallTruncate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, byref(d));
}
// Autogenerated method: System.Decimal.op_Explicit
System::Decimal::Decimal(float& value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Explicit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Explicit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
*this = ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Decimal.op_Explicit
System::Decimal::Decimal(double& value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Explicit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Explicit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
*this = ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Decimal.op_Explicit
System::Decimal::operator int64_t() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Explicit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Explicit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Decimal.op_Explicit
System::Decimal::operator uint64_t() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Explicit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Explicit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Decimal.op_Explicit
System::Decimal::operator float() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Explicit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Explicit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Decimal.op_Explicit
System::Decimal::operator double() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Explicit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Explicit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Decimal.GetTypeCode
::System::TypeCode System::Decimal::GetTypeCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::GetTypeCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetTypeCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::TypeCode, false>(this, ___internal__method);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToBoolean
bool System::Decimal::System_IConvertible_ToBoolean(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToBoolean");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToChar
::Il2CppChar System::Decimal::System_IConvertible_ToChar(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToChar");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToSByte
int8_t System::Decimal::System_IConvertible_ToSByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToSByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToByte
uint8_t System::Decimal::System_IConvertible_ToByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToInt16
int16_t System::Decimal::System_IConvertible_ToInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToUInt16
uint16_t System::Decimal::System_IConvertible_ToUInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToUInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToInt32
int System::Decimal::System_IConvertible_ToInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToUInt32
uint System::Decimal::System_IConvertible_ToUInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToUInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToInt64
int64_t System::Decimal::System_IConvertible_ToInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToUInt64
uint64_t System::Decimal::System_IConvertible_ToUInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToUInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToSingle
float System::Decimal::System_IConvertible_ToSingle(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToSingle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToDouble
double System::Decimal::System_IConvertible_ToDouble(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToDouble");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToDecimal
::System::Decimal System::Decimal::System_IConvertible_ToDecimal(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToDecimal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToDateTime
::System::DateTime System::Decimal::System_IConvertible_ToDateTime(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToDateTime");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Decimal.System.IConvertible.ToType
::Il2CppObject* System::Decimal::System_IConvertible_ToType(::System::Type* type, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::System.IConvertible.ToType");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, type, provider);
}
// Autogenerated method: System.Decimal.Equals
bool System::Decimal::Equals(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Decimal.GetHashCode
int System::Decimal::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Decimal.ToString
::StringW System::Decimal::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: System.Decimal.op_Addition
::System::Decimal System::operator+(const ::System::Decimal& d1, const ::System::Decimal& d2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Addition");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Addition", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d1, d2);
}
// Autogenerated method: System.Decimal.op_Subtraction
::System::Decimal System::operator-(const ::System::Decimal& d1, const ::System::Decimal& d2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Subtraction");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Subtraction", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d1, d2);
}
// Autogenerated method: System.Decimal.op_Multiply
::System::Decimal System::operator*(const ::System::Decimal& d1, const ::System::Decimal& d2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Multiply");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Multiply", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d1, d2);
}
// Autogenerated method: System.Decimal.op_Equality
bool System::operator ==(const ::System::Decimal& d1, const ::System::Decimal& d2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Equality");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Equality", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d1, d2);
}
// Autogenerated method: System.Decimal.op_Inequality
bool System::operator !=(const ::System::Decimal& d1, const ::System::Decimal& d2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Decimal::op_Inequality");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Decimal", "op_Inequality", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d1), ::il2cpp_utils::ExtractType(d2)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d1, d2);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.DefaultBinder
#include "System/DefaultBinder.hpp"
// Including type: System.DefaultBinder/System.BinderState
#include "System/DefaultBinder_BinderState.hpp"
// Including type: System.DefaultBinder/System.<>c
#include "System/DefaultBinder_--c.hpp"
// Including type: System.Reflection.MethodBase
#include "System/Reflection/MethodBase.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: System.Reflection.PropertyInfo
#include "System/Reflection/PropertyInfo.hpp"
// Including type: System.Reflection.ParameterInfo
#include "System/Reflection/ParameterInfo.hpp"
// Including type: System.Reflection.FieldInfo
#include "System/Reflection/FieldInfo.hpp"
// Including type: System.RuntimeType
#include "System/RuntimeType.hpp"
// Including type: System.Reflection.BindingFlags
#include "System/Reflection/BindingFlags.hpp"
// Including type: System.Globalization.CultureInfo
#include "System/Globalization/CultureInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.DefaultBinder.ExactBinding
::System::Reflection::MethodBase* System::DefaultBinder::ExactBinding(::ArrayW<::System::Reflection::MethodBase*> match, ::ArrayW<::System::Type*> types, ::ArrayW<::System::Reflection::ParameterModifier> modifiers) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::ExactBinding");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "ExactBinding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(match), ::il2cpp_utils::ExtractType(types), ::il2cpp_utils::ExtractType(modifiers)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Reflection::MethodBase*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, match, types, modifiers);
}
// Autogenerated method: System.DefaultBinder.ExactPropertyBinding
::System::Reflection::PropertyInfo* System::DefaultBinder::ExactPropertyBinding(::ArrayW<::System::Reflection::PropertyInfo*> match, ::System::Type* returnType, ::ArrayW<::System::Type*> types, ::ArrayW<::System::Reflection::ParameterModifier> modifiers) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::ExactPropertyBinding");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "ExactPropertyBinding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(match), ::il2cpp_utils::ExtractType(returnType), ::il2cpp_utils::ExtractType(types), ::il2cpp_utils::ExtractType(modifiers)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Reflection::PropertyInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, match, returnType, types, modifiers);
}
// Autogenerated method: System.DefaultBinder.FindMostSpecific
int System::DefaultBinder::FindMostSpecific(::ArrayW<::System::Reflection::ParameterInfo*> p1, ::ArrayW<int> paramOrder1, ::System::Type* paramArrayType1, ::ArrayW<::System::Reflection::ParameterInfo*> p2, ::ArrayW<int> paramOrder2, ::System::Type* paramArrayType2, ::ArrayW<::System::Type*> types, ::ArrayW<::Il2CppObject*> args) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::FindMostSpecific");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "FindMostSpecific", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(p1), ::il2cpp_utils::ExtractType(paramOrder1), ::il2cpp_utils::ExtractType(paramArrayType1), ::il2cpp_utils::ExtractType(p2), ::il2cpp_utils::ExtractType(paramOrder2), ::il2cpp_utils::ExtractType(paramArrayType2), ::il2cpp_utils::ExtractType(types), ::il2cpp_utils::ExtractType(args)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, p1, paramOrder1, paramArrayType1, p2, paramOrder2, paramArrayType2, types, args);
}
// Autogenerated method: System.DefaultBinder.FindMostSpecificType
int System::DefaultBinder::FindMostSpecificType(::System::Type* c1, ::System::Type* c2, ::System::Type* t) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::FindMostSpecificType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "FindMostSpecificType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c1), ::il2cpp_utils::ExtractType(c2), ::il2cpp_utils::ExtractType(t)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, c1, c2, t);
}
// Autogenerated method: System.DefaultBinder.FindMostSpecificMethod
int System::DefaultBinder::FindMostSpecificMethod(::System::Reflection::MethodBase* m1, ::ArrayW<int> paramOrder1, ::System::Type* paramArrayType1, ::System::Reflection::MethodBase* m2, ::ArrayW<int> paramOrder2, ::System::Type* paramArrayType2, ::ArrayW<::System::Type*> types, ::ArrayW<::Il2CppObject*> args) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::FindMostSpecificMethod");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "FindMostSpecificMethod", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(m1), ::il2cpp_utils::ExtractType(paramOrder1), ::il2cpp_utils::ExtractType(paramArrayType1), ::il2cpp_utils::ExtractType(m2), ::il2cpp_utils::ExtractType(paramOrder2), ::il2cpp_utils::ExtractType(paramArrayType2), ::il2cpp_utils::ExtractType(types), ::il2cpp_utils::ExtractType(args)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, m1, paramOrder1, paramArrayType1, m2, paramOrder2, paramArrayType2, types, args);
}
// Autogenerated method: System.DefaultBinder.FindMostSpecificField
int System::DefaultBinder::FindMostSpecificField(::System::Reflection::FieldInfo* cur1, ::System::Reflection::FieldInfo* cur2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::FindMostSpecificField");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "FindMostSpecificField", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(cur1), ::il2cpp_utils::ExtractType(cur2)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, cur1, cur2);
}
// Autogenerated method: System.DefaultBinder.FindMostSpecificProperty
int System::DefaultBinder::FindMostSpecificProperty(::System::Reflection::PropertyInfo* cur1, ::System::Reflection::PropertyInfo* cur2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::FindMostSpecificProperty");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "FindMostSpecificProperty", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(cur1), ::il2cpp_utils::ExtractType(cur2)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, cur1, cur2);
}
// Autogenerated method: System.DefaultBinder.CompareMethodSigAndName
bool System::DefaultBinder::CompareMethodSigAndName(::System::Reflection::MethodBase* m1, ::System::Reflection::MethodBase* m2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::CompareMethodSigAndName");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "CompareMethodSigAndName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(m1), ::il2cpp_utils::ExtractType(m2)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, m1, m2);
}
// Autogenerated method: System.DefaultBinder.GetHierarchyDepth
int System::DefaultBinder::GetHierarchyDepth(::System::Type* t) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::GetHierarchyDepth");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "GetHierarchyDepth", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(t)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, t);
}
// Autogenerated method: System.DefaultBinder.FindMostDerivedNewSlotMeth
::System::Reflection::MethodBase* System::DefaultBinder::FindMostDerivedNewSlotMeth(::ArrayW<::System::Reflection::MethodBase*> match, int cMatches) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::FindMostDerivedNewSlotMeth");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "FindMostDerivedNewSlotMeth", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(match), ::il2cpp_utils::ExtractType(cMatches)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Reflection::MethodBase*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, match, cMatches);
}
// Autogenerated method: System.DefaultBinder.ReorderParams
void System::DefaultBinder::ReorderParams(::ArrayW<int> paramOrder, ::ArrayW<::Il2CppObject*> vars) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::ReorderParams");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "ReorderParams", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(paramOrder), ::il2cpp_utils::ExtractType(vars)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, paramOrder, vars);
}
// Autogenerated method: System.DefaultBinder.CreateParamOrder
bool System::DefaultBinder::CreateParamOrder(::ArrayW<int> paramOrder, ::ArrayW<::System::Reflection::ParameterInfo*> pars, ::ArrayW<::StringW> names) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::CreateParamOrder");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "CreateParamOrder", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(paramOrder), ::il2cpp_utils::ExtractType(pars), ::il2cpp_utils::ExtractType(names)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, paramOrder, pars, names);
}
// Autogenerated method: System.DefaultBinder.CanConvertPrimitive
bool System::DefaultBinder::CanConvertPrimitive(::System::RuntimeType* source, ::System::RuntimeType* target) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::CanConvertPrimitive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "CanConvertPrimitive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(source), ::il2cpp_utils::ExtractType(target)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, source, target);
}
// Autogenerated method: System.DefaultBinder.CanConvertPrimitiveObjectToType
bool System::DefaultBinder::CanConvertPrimitiveObjectToType(::Il2CppObject* source, ::System::RuntimeType* type) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::CanConvertPrimitiveObjectToType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder", "CanConvertPrimitiveObjectToType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(source), ::il2cpp_utils::ExtractType(type)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, source, type);
}
// Autogenerated method: System.DefaultBinder.BindToMethod
::System::Reflection::MethodBase* System::DefaultBinder::BindToMethod(::System::Reflection::BindingFlags bindingAttr, ::ArrayW<::System::Reflection::MethodBase*> match, ByRef<::ArrayW<::Il2CppObject*>> args, ::ArrayW<::System::Reflection::ParameterModifier> modifiers, ::System::Globalization::CultureInfo* cultureInfo, ::ArrayW<::StringW> names, ByRef<::Il2CppObject*> state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::BindToMethod");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BindToMethod", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(bindingAttr), ::il2cpp_utils::ExtractType(match), ::il2cpp_utils::ExtractType(args), ::il2cpp_utils::ExtractType(modifiers), ::il2cpp_utils::ExtractType(cultureInfo), ::il2cpp_utils::ExtractType(names), ::il2cpp_utils::ExtractIndependentType<::Il2CppObject*&>()})));
return ::il2cpp_utils::RunMethodRethrow<::System::Reflection::MethodBase*, false>(this, ___internal__method, bindingAttr, match, byref(args), modifiers, cultureInfo, names, byref(state));
}
// Autogenerated method: System.DefaultBinder.BindToField
::System::Reflection::FieldInfo* System::DefaultBinder::BindToField(::System::Reflection::BindingFlags bindingAttr, ::ArrayW<::System::Reflection::FieldInfo*> match, ::Il2CppObject* value, ::System::Globalization::CultureInfo* cultureInfo) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::BindToField");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BindToField", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(bindingAttr), ::il2cpp_utils::ExtractType(match), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(cultureInfo)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Reflection::FieldInfo*, false>(this, ___internal__method, bindingAttr, match, value, cultureInfo);
}
// Autogenerated method: System.DefaultBinder.SelectMethod
::System::Reflection::MethodBase* System::DefaultBinder::SelectMethod(::System::Reflection::BindingFlags bindingAttr, ::ArrayW<::System::Reflection::MethodBase*> match, ::ArrayW<::System::Type*> types, ::ArrayW<::System::Reflection::ParameterModifier> modifiers) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::SelectMethod");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SelectMethod", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(bindingAttr), ::il2cpp_utils::ExtractType(match), ::il2cpp_utils::ExtractType(types), ::il2cpp_utils::ExtractType(modifiers)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Reflection::MethodBase*, false>(this, ___internal__method, bindingAttr, match, types, modifiers);
}
// Autogenerated method: System.DefaultBinder.SelectProperty
::System::Reflection::PropertyInfo* System::DefaultBinder::SelectProperty(::System::Reflection::BindingFlags bindingAttr, ::ArrayW<::System::Reflection::PropertyInfo*> match, ::System::Type* returnType, ::ArrayW<::System::Type*> indexes, ::ArrayW<::System::Reflection::ParameterModifier> modifiers) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::SelectProperty");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SelectProperty", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(bindingAttr), ::il2cpp_utils::ExtractType(match), ::il2cpp_utils::ExtractType(returnType), ::il2cpp_utils::ExtractType(indexes), ::il2cpp_utils::ExtractType(modifiers)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Reflection::PropertyInfo*, false>(this, ___internal__method, bindingAttr, match, returnType, indexes, modifiers);
}
// Autogenerated method: System.DefaultBinder.ChangeType
::Il2CppObject* System::DefaultBinder::ChangeType(::Il2CppObject* value, ::System::Type* type, ::System::Globalization::CultureInfo* cultureInfo) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::ChangeType");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ChangeType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(cultureInfo)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, value, type, cultureInfo);
}
// Autogenerated method: System.DefaultBinder.ReorderArgumentArray
void System::DefaultBinder::ReorderArgumentArray(ByRef<::ArrayW<::Il2CppObject*>> args, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::ReorderArgumentArray");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReorderArgumentArray", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(args), ::il2cpp_utils::ExtractType(state)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, byref(args), state);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.DefaultBinder/System.BinderState
#include "System/DefaultBinder_BinderState.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: System.Int32[] m_argsMap
::ArrayW<int>& System::DefaultBinder::BinderState::dyn_m_argsMap() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::BinderState::dyn_m_argsMap");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_argsMap"))->offset;
return *reinterpret_cast<::ArrayW<int>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Int32 m_originalSize
int& System::DefaultBinder::BinderState::dyn_m_originalSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::BinderState::dyn_m_originalSize");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_originalSize"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Boolean m_isParamArray
bool& System::DefaultBinder::BinderState::dyn_m_isParamArray() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::BinderState::dyn_m_isParamArray");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_isParamArray"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.DefaultBinder/System.<>c
#include "System/DefaultBinder_--c.hpp"
// Including type: System.Predicate`1
#include "System/Predicate_1.hpp"
// Including type: System.Type
#include "System/Type.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly System.DefaultBinder/System.<>c <>9
::System::DefaultBinder::$$c* System::DefaultBinder::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::DefaultBinder::$$c*>("System", "DefaultBinder/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly System.DefaultBinder/System.<>c <>9
void System::DefaultBinder::$$c::_set_$$9(::System::DefaultBinder::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("System", "DefaultBinder/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Predicate`1<System.Type> <>9__3_0
::System::Predicate_1<::System::Type*>* System::DefaultBinder::$$c::_get_$$9__3_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::$$c::_get_$$9__3_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Predicate_1<::System::Type*>*>("System", "DefaultBinder/<>c", "<>9__3_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Predicate`1<System.Type> <>9__3_0
void System::DefaultBinder::$$c::_set_$$9__3_0(::System::Predicate_1<::System::Type*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::$$c::_set_$$9__3_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("System", "DefaultBinder/<>c", "<>9__3_0", value)));
}
// Autogenerated method: System.DefaultBinder/System.<>c..cctor
void System::DefaultBinder::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "DefaultBinder/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.DefaultBinder/System.<>c.<SelectProperty>b__3_0
bool System::DefaultBinder::$$c::$SelectProperty$b__3_0(::System::Type* t) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::DefaultBinder::$$c::<SelectProperty>b__3_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<SelectProperty>b__3_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(t)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, t);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.DivideByZeroException
#include "System/DivideByZeroException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.DllNotFoundException
#include "System/DllNotFoundException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Double
#include "System/Double.hpp"
// Including type: System.IFormatProvider
#include "System/IFormatProvider.hpp"
// Including type: System.Globalization.NumberStyles
#include "System/Globalization/NumberStyles.hpp"
// Including type: System.Globalization.NumberFormatInfo
#include "System/Globalization/NumberFormatInfo.hpp"
// Including type: System.TypeCode
#include "System/TypeCode.hpp"
// Including type: System.Decimal
#include "System/Decimal.hpp"
// Including type: System.DateTime
#include "System/DateTime.hpp"
// Including type: System.Type
#include "System/Type.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Double MinValue
double System::Double::_get_MinValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_get_MinValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<double>("System", "Double", "MinValue"));
}
// Autogenerated static field setter
// Set static field: static public System.Double MinValue
void System::Double::_set_MinValue(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_set_MinValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Double", "MinValue", value));
}
// Autogenerated static field getter
// Get static field: static public System.Double MaxValue
double System::Double::_get_MaxValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_get_MaxValue");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<double>("System", "Double", "MaxValue"));
}
// Autogenerated static field setter
// Set static field: static public System.Double MaxValue
void System::Double::_set_MaxValue(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_set_MaxValue");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Double", "MaxValue", value));
}
// Autogenerated static field getter
// Get static field: static public System.Double Epsilon
double System::Double::_get_Epsilon() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_get_Epsilon");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<double>("System", "Double", "Epsilon"));
}
// Autogenerated static field setter
// Set static field: static public System.Double Epsilon
void System::Double::_set_Epsilon(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_set_Epsilon");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Double", "Epsilon", value));
}
// Autogenerated static field getter
// Get static field: static public System.Double NegativeInfinity
double System::Double::_get_NegativeInfinity() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_get_NegativeInfinity");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<double>("System", "Double", "NegativeInfinity"));
}
// Autogenerated static field setter
// Set static field: static public System.Double NegativeInfinity
void System::Double::_set_NegativeInfinity(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_set_NegativeInfinity");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Double", "NegativeInfinity", value));
}
// Autogenerated static field getter
// Get static field: static public System.Double PositiveInfinity
double System::Double::_get_PositiveInfinity() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_get_PositiveInfinity");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<double>("System", "Double", "PositiveInfinity"));
}
// Autogenerated static field setter
// Set static field: static public System.Double PositiveInfinity
void System::Double::_set_PositiveInfinity(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_set_PositiveInfinity");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Double", "PositiveInfinity", value));
}
// Autogenerated static field getter
// Get static field: static public System.Double NaN
double System::Double::_get_NaN() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_get_NaN");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<double>("System", "Double", "NaN"));
}
// Autogenerated static field setter
// Set static field: static public System.Double NaN
void System::Double::_set_NaN(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_set_NaN");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Double", "NaN", value));
}
// Autogenerated static field getter
// Get static field: static System.Double NegativeZero
double System::Double::_get_NegativeZero() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_get_NegativeZero");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<double>("System", "Double", "NegativeZero"));
}
// Autogenerated static field setter
// Set static field: static System.Double NegativeZero
void System::Double::_set_NegativeZero(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::_set_NegativeZero");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Double", "NegativeZero", value));
}
// Autogenerated instance field getter
// Get instance field: System.Double m_value
double& System::Double::dyn_m_value() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::dyn_m_value");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_value"))->offset;
return *reinterpret_cast<double*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Double..cctor
void System::Double::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Double.IsInfinity
bool System::Double::IsInfinity(double d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::IsInfinity");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "IsInfinity", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Double.IsPositiveInfinity
bool System::Double::IsPositiveInfinity(double d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::IsPositiveInfinity");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "IsPositiveInfinity", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Double.IsNegativeInfinity
bool System::Double::IsNegativeInfinity(double d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::IsNegativeInfinity");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "IsNegativeInfinity", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Double.IsNaN
bool System::Double::IsNaN(double d) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::IsNaN");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "IsNaN", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, d);
}
// Autogenerated method: System.Double.CompareTo
int System::Double::CompareTo(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Double.CompareTo
int System::Double::CompareTo(double value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Double.Equals
bool System::Double::Equals(double obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.Double.ToString
::StringW System::Double::ToString(::StringW format) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::ToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(format)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, format);
}
// Autogenerated method: System.Double.ToString
::StringW System::Double::ToString(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.ToString
::StringW System::Double::ToString(::StringW format, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(format), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, format, provider);
}
// Autogenerated method: System.Double.Parse
double System::Double::Parse(::StringW s) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s);
}
// Autogenerated method: System.Double.Parse
double System::Double::Parse(::StringW s, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, provider);
}
// Autogenerated method: System.Double.Parse
double System::Double::Parse(::StringW s, ::System::Globalization::NumberStyles style, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(style), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, style, provider);
}
// Autogenerated method: System.Double.Parse
double System::Double::Parse(::StringW s, ::System::Globalization::NumberStyles style, ::System::Globalization::NumberFormatInfo* info) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(style), ::il2cpp_utils::ExtractType(info)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, style, info);
}
// Autogenerated method: System.Double.TryParse
bool System::Double::TryParse(::StringW s, ByRef<double> result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::TryParse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "TryParse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractIndependentType<double&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, byref(result));
}
// Autogenerated method: System.Double.TryParse
bool System::Double::TryParse(::StringW s, ::System::Globalization::NumberStyles style, ::System::IFormatProvider* provider, ByRef<double> result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::TryParse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "TryParse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(style), ::il2cpp_utils::ExtractType(provider), ::il2cpp_utils::ExtractIndependentType<double&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, style, provider, byref(result));
}
// Autogenerated method: System.Double.TryParse
bool System::Double::TryParse(::StringW s, ::System::Globalization::NumberStyles style, ::System::Globalization::NumberFormatInfo* info, ByRef<double> result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::TryParse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Double", "TryParse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(style), ::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractIndependentType<double&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, style, info, byref(result));
}
// Autogenerated method: System.Double.GetTypeCode
::System::TypeCode System::Double::GetTypeCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::GetTypeCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetTypeCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::TypeCode, false>(this, ___internal__method);
}
// Autogenerated method: System.Double.System.IConvertible.ToBoolean
bool System::Double::System_IConvertible_ToBoolean(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToBoolean");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToChar
::Il2CppChar System::Double::System_IConvertible_ToChar(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToChar");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToSByte
int8_t System::Double::System_IConvertible_ToSByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToSByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToByte
uint8_t System::Double::System_IConvertible_ToByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToInt16
int16_t System::Double::System_IConvertible_ToInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToUInt16
uint16_t System::Double::System_IConvertible_ToUInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToUInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToInt32
int System::Double::System_IConvertible_ToInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToUInt32
uint System::Double::System_IConvertible_ToUInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToUInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToInt64
int64_t System::Double::System_IConvertible_ToInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToUInt64
uint64_t System::Double::System_IConvertible_ToUInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToUInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToSingle
float System::Double::System_IConvertible_ToSingle(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToSingle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToDouble
double System::Double::System_IConvertible_ToDouble(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToDouble");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToDecimal
::System::Decimal System::Double::System_IConvertible_ToDecimal(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToDecimal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToDateTime
::System::DateTime System::Double::System_IConvertible_ToDateTime(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToDateTime");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Double.System.IConvertible.ToType
::Il2CppObject* System::Double::System_IConvertible_ToType(::System::Type* type, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::System.IConvertible.ToType");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "System.IConvertible.ToType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, type, provider);
}
// Autogenerated method: System.Double.Equals
bool System::Double::Equals(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.Double.GetHashCode
int System::Double::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Double.ToString
::StringW System::Double::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Double::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Empty
#include "System/Empty.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
// Including type: System.Runtime.Serialization.StreamingContext
#include "System/Runtime/Serialization/StreamingContext.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly System.Empty Value
::System::Empty* System::Empty::_get_Value() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Empty::_get_Value");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Empty*>("System", "Empty", "Value"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Empty Value
void System::Empty::_set_Value(::System::Empty* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Empty::_set_Value");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Empty", "Value", value));
}
// Autogenerated method: System.Empty..cctor
void System::Empty::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Empty::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Empty", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Empty.GetObjectData
void System::Empty::GetObjectData(::System::Runtime::Serialization::SerializationInfo* info, ::System::Runtime::Serialization::StreamingContext context) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Empty::GetObjectData");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetObjectData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(info), ::il2cpp_utils::ExtractType(context)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, info, context);
}
// Autogenerated method: System.Empty.ToString
::StringW System::Empty::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Empty::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.EntryPointNotFoundException
#include "System/EntryPointNotFoundException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Enum
#include "System/Enum.hpp"
// Including type: System.Enum/System.ParseFailureKind
#include "System/Enum_ParseFailureKind.hpp"
// Including type: System.Enum/System.EnumResult
#include "System/Enum_EnumResult.hpp"
// Including type: System.Enum/System.ValuesAndNames
#include "System/Enum_ValuesAndNames.hpp"
// Including type: System.String
#include "System/String.hpp"
// Including type: System.RuntimeType
#include "System/RuntimeType.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: System.Array
#include "System/Array.hpp"
// Including type: System.IFormatProvider
#include "System/IFormatProvider.hpp"
// Including type: System.TypeCode
#include "System/TypeCode.hpp"
// Including type: System.Decimal
#include "System/Decimal.hpp"
// Including type: System.DateTime
#include "System/DateTime.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private readonly System.Char[] enumSeperatorCharArray
::ArrayW<::Il2CppChar> System::Enum::_get_enumSeperatorCharArray() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::_get_enumSeperatorCharArray");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<::Il2CppChar>>("System", "Enum", "enumSeperatorCharArray"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Char[] enumSeperatorCharArray
void System::Enum::_set_enumSeperatorCharArray(::ArrayW<::Il2CppChar> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::_set_enumSeperatorCharArray");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Enum", "enumSeperatorCharArray", value));
}
// Autogenerated static field getter
// Get static field: static private System.String enumSeperator
::StringW System::Enum::_get_enumSeperator() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::_get_enumSeperator");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("System", "Enum", "enumSeperator"));
}
// Autogenerated static field setter
// Set static field: static private System.String enumSeperator
void System::Enum::_set_enumSeperator(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::_set_enumSeperator");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Enum", "enumSeperator", value));
}
// Autogenerated method: System.Enum..cctor
void System::Enum::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Enum.GetCachedValuesAndNames
::System::Enum::ValuesAndNames* System::Enum::GetCachedValuesAndNames(::System::RuntimeType* enumType, bool getNames) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::GetCachedValuesAndNames");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "GetCachedValuesAndNames", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(getNames)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Enum::ValuesAndNames*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, getNames);
}
// Autogenerated method: System.Enum.InternalFormattedHexString
::StringW System::Enum::InternalFormattedHexString(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::InternalFormattedHexString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "InternalFormattedHexString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Enum.InternalFormat
::StringW System::Enum::InternalFormat(::System::RuntimeType* eT, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::InternalFormat");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "InternalFormat", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(eT), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, eT, value);
}
// Autogenerated method: System.Enum.InternalFlagsFormat
::StringW System::Enum::InternalFlagsFormat(::System::RuntimeType* eT, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::InternalFlagsFormat");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "InternalFlagsFormat", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(eT), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, eT, value);
}
// Autogenerated method: System.Enum.ToUInt64
uint64_t System::Enum::ToUInt64(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToUInt64");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: System.Enum.InternalCompareTo
int System::Enum::InternalCompareTo(::Il2CppObject* o1, ::Il2CppObject* o2) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::InternalCompareTo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "InternalCompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(o1), ::il2cpp_utils::ExtractType(o2)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, o1, o2);
}
// Autogenerated method: System.Enum.InternalGetUnderlyingType
::System::RuntimeType* System::Enum::InternalGetUnderlyingType(::System::RuntimeType* enumType) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::InternalGetUnderlyingType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "InternalGetUnderlyingType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType)})));
return ::il2cpp_utils::RunMethodRethrow<::System::RuntimeType*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType);
}
// Autogenerated method: System.Enum.GetEnumValuesAndNames
bool System::Enum::GetEnumValuesAndNames(::System::RuntimeType* enumType, ByRef<::ArrayW<uint64_t>> values, ByRef<::ArrayW<::StringW>> names) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::GetEnumValuesAndNames");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "GetEnumValuesAndNames", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractIndependentType<::ArrayW<uint64_t>&>(), ::il2cpp_utils::ExtractIndependentType<::ArrayW<::StringW>&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, byref(values), byref(names));
}
// Autogenerated method: System.Enum.InternalBoxEnum
::Il2CppObject* System::Enum::InternalBoxEnum(::System::RuntimeType* enumType, int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::InternalBoxEnum");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "InternalBoxEnum", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.Parse
::Il2CppObject* System::Enum::Parse(::System::Type* enumType, ::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.Parse
::Il2CppObject* System::Enum::Parse(::System::Type* enumType, ::StringW value, bool ignoreCase) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::Parse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "Parse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(ignoreCase)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value, ignoreCase);
}
// Autogenerated method: System.Enum.TryParseEnum
bool System::Enum::TryParseEnum(::System::Type* enumType, ::StringW value, bool ignoreCase, ByRef<::System::Enum::EnumResult> parseResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::TryParseEnum");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "TryParseEnum", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(ignoreCase), ::il2cpp_utils::ExtractType(parseResult)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value, ignoreCase, byref(parseResult));
}
// Autogenerated method: System.Enum.GetUnderlyingType
::System::Type* System::Enum::GetUnderlyingType(::System::Type* enumType) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::GetUnderlyingType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "GetUnderlyingType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Type*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType);
}
// Autogenerated method: System.Enum.GetValues
::System::Array* System::Enum::GetValues(::System::Type* enumType) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::GetValues");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "GetValues", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Array*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType);
}
// Autogenerated method: System.Enum.InternalGetValues
::ArrayW<uint64_t> System::Enum::InternalGetValues(::System::RuntimeType* enumType) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::InternalGetValues");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "InternalGetValues", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint64_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType);
}
// Autogenerated method: System.Enum.GetName
::StringW System::Enum::GetName(::System::Type* enumType, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::GetName");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "GetName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.GetNames
::ArrayW<::StringW> System::Enum::GetNames(::System::Type* enumType) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::GetNames");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "GetNames", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::StringW>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType);
}
// Autogenerated method: System.Enum.InternalGetNames
::ArrayW<::StringW> System::Enum::InternalGetNames(::System::RuntimeType* enumType) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::InternalGetNames");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "InternalGetNames", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::StringW>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.IsDefined
bool System::Enum::IsDefined(::System::Type* enumType, ::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::IsDefined");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "IsDefined", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.get_value
::Il2CppObject* System::Enum::get_value() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::get_value");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_value", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: System.Enum.GetValue
::Il2CppObject* System::Enum::GetValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::GetValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: System.Enum.InternalHasFlag
bool System::Enum::InternalHasFlag(::System::Enum* flags) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::InternalHasFlag");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InternalHasFlag", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(flags)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, flags);
}
// Autogenerated method: System.Enum.get_hashcode
int System::Enum::get_hashcode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::get_hashcode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_hashcode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Enum.ToString
::StringW System::Enum::ToString(::StringW format, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(format), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, format, provider);
}
// Autogenerated method: System.Enum.CompareTo
int System::Enum::CompareTo(::Il2CppObject* target) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::CompareTo");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CompareTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, target);
}
// Autogenerated method: System.Enum.ToString
::StringW System::Enum::ToString(::StringW format) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(format)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, format);
}
// Autogenerated method: System.Enum.ToString
::StringW System::Enum::ToString(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.HasFlag
bool System::Enum::HasFlag(::System::Enum* flag) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::HasFlag");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HasFlag", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(flag)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, flag);
}
// Autogenerated method: System.Enum.GetTypeCode
::System::TypeCode System::Enum::GetTypeCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::GetTypeCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetTypeCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::TypeCode, false>(this, ___internal__method);
}
// Autogenerated method: System.Enum.System.IConvertible.ToBoolean
bool System::Enum::System_IConvertible_ToBoolean(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToBoolean");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToBoolean", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToChar
::Il2CppChar System::Enum::System_IConvertible_ToChar(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToChar");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppChar, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToSByte
int8_t System::Enum::System_IConvertible_ToSByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToSByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToSByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToByte
uint8_t System::Enum::System_IConvertible_ToByte(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToInt16
int16_t System::Enum::System_IConvertible_ToInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToUInt16
uint16_t System::Enum::System_IConvertible_ToUInt16(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToUInt16");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint16_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToInt32
int System::Enum::System_IConvertible_ToInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToUInt32
uint System::Enum::System_IConvertible_ToUInt32(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToUInt32");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToUInt32", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToInt64
int64_t System::Enum::System_IConvertible_ToInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToUInt64
uint64_t System::Enum::System_IConvertible_ToUInt64(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToUInt64");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToUInt64", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<uint64_t, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToSingle
float System::Enum::System_IConvertible_ToSingle(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToSingle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToSingle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToDouble
double System::Enum::System_IConvertible_ToDouble(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToDouble");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToDouble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToDecimal
::System::Decimal System::Enum::System_IConvertible_ToDecimal(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToDecimal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToDecimal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Decimal, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToDateTime
::System::DateTime System::Enum::System_IConvertible_ToDateTime(::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToDateTime");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToDateTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(this, ___internal__method, provider);
}
// Autogenerated method: System.Enum.System.IConvertible.ToType
::Il2CppObject* System::Enum::System_IConvertible_ToType(::System::Type* type, ::System::IFormatProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::System.IConvertible.ToType");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IConvertible.ToType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(provider)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, type, provider);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, int8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, int16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, uint value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, uint64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, ::Il2CppChar value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.ToObject
::Il2CppObject* System::Enum::ToObject(::System::Type* enumType, bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "Enum", "ToObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enumType), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, enumType, value);
}
// Autogenerated method: System.Enum.Equals
bool System::Enum::Equals(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, obj);
}
// Autogenerated method: System.Enum.GetHashCode
int System::Enum::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::GetHashCode");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetHashCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Enum.ToString
::StringW System::Enum::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ToString");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Enum/System.ParseFailureKind
#include "System/Enum_ParseFailureKind.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Enum/System.ParseFailureKind None
::System::Enum::ParseFailureKind System::Enum::ParseFailureKind::_get_None() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::_get_None");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Enum::ParseFailureKind>("System", "Enum/ParseFailureKind", "None"));
}
// Autogenerated static field setter
// Set static field: static public System.Enum/System.ParseFailureKind None
void System::Enum::ParseFailureKind::_set_None(::System::Enum::ParseFailureKind value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::_set_None");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Enum/ParseFailureKind", "None", value));
}
// Autogenerated static field getter
// Get static field: static public System.Enum/System.ParseFailureKind Argument
::System::Enum::ParseFailureKind System::Enum::ParseFailureKind::_get_Argument() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::_get_Argument");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Enum::ParseFailureKind>("System", "Enum/ParseFailureKind", "Argument"));
}
// Autogenerated static field setter
// Set static field: static public System.Enum/System.ParseFailureKind Argument
void System::Enum::ParseFailureKind::_set_Argument(::System::Enum::ParseFailureKind value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::_set_Argument");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Enum/ParseFailureKind", "Argument", value));
}
// Autogenerated static field getter
// Get static field: static public System.Enum/System.ParseFailureKind ArgumentNull
::System::Enum::ParseFailureKind System::Enum::ParseFailureKind::_get_ArgumentNull() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::_get_ArgumentNull");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Enum::ParseFailureKind>("System", "Enum/ParseFailureKind", "ArgumentNull"));
}
// Autogenerated static field setter
// Set static field: static public System.Enum/System.ParseFailureKind ArgumentNull
void System::Enum::ParseFailureKind::_set_ArgumentNull(::System::Enum::ParseFailureKind value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::_set_ArgumentNull");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Enum/ParseFailureKind", "ArgumentNull", value));
}
// Autogenerated static field getter
// Get static field: static public System.Enum/System.ParseFailureKind ArgumentWithParameter
::System::Enum::ParseFailureKind System::Enum::ParseFailureKind::_get_ArgumentWithParameter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::_get_ArgumentWithParameter");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Enum::ParseFailureKind>("System", "Enum/ParseFailureKind", "ArgumentWithParameter"));
}
// Autogenerated static field setter
// Set static field: static public System.Enum/System.ParseFailureKind ArgumentWithParameter
void System::Enum::ParseFailureKind::_set_ArgumentWithParameter(::System::Enum::ParseFailureKind value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::_set_ArgumentWithParameter");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Enum/ParseFailureKind", "ArgumentWithParameter", value));
}
// Autogenerated static field getter
// Get static field: static public System.Enum/System.ParseFailureKind UnhandledException
::System::Enum::ParseFailureKind System::Enum::ParseFailureKind::_get_UnhandledException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::_get_UnhandledException");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Enum::ParseFailureKind>("System", "Enum/ParseFailureKind", "UnhandledException"));
}
// Autogenerated static field setter
// Set static field: static public System.Enum/System.ParseFailureKind UnhandledException
void System::Enum::ParseFailureKind::_set_UnhandledException(::System::Enum::ParseFailureKind value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::_set_UnhandledException");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "Enum/ParseFailureKind", "UnhandledException", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Enum::ParseFailureKind::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ParseFailureKind::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Enum/System.EnumResult
#include "System/Enum_EnumResult.hpp"
// Including type: System.Exception
#include "System/Exception.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: System.Object parsedEnum
::Il2CppObject*& System::Enum::EnumResult::dyn_parsedEnum() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::dyn_parsedEnum");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "parsedEnum"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Boolean canThrow
bool& System::Enum::EnumResult::dyn_canThrow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::dyn_canThrow");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "canThrow"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Enum/System.ParseFailureKind m_failure
::System::Enum::ParseFailureKind& System::Enum::EnumResult::dyn_m_failure() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::dyn_m_failure");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_failure"))->offset;
return *reinterpret_cast<::System::Enum::ParseFailureKind*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.String m_failureMessageID
::StringW& System::Enum::EnumResult::dyn_m_failureMessageID() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::dyn_m_failureMessageID");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_failureMessageID"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.String m_failureParameter
::StringW& System::Enum::EnumResult::dyn_m_failureParameter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::dyn_m_failureParameter");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_failureParameter"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Object m_failureMessageFormatArgument
::Il2CppObject*& System::Enum::EnumResult::dyn_m_failureMessageFormatArgument() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::dyn_m_failureMessageFormatArgument");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_failureMessageFormatArgument"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Exception m_innerException
::System::Exception*& System::Enum::EnumResult::dyn_m_innerException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::dyn_m_innerException");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_innerException"))->offset;
return *reinterpret_cast<::System::Exception**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Enum/System.EnumResult.Init
void System::Enum::EnumResult::Init(bool canMethodThrow) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::Init");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Init", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(canMethodThrow)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, canMethodThrow);
}
// Autogenerated method: System.Enum/System.EnumResult.SetFailure
void System::Enum::EnumResult::SetFailure(::System::Exception* unhandledException) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::SetFailure");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "SetFailure", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(unhandledException)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, unhandledException);
}
// Autogenerated method: System.Enum/System.EnumResult.SetFailure
void System::Enum::EnumResult::SetFailure(::System::Enum::ParseFailureKind failure, ::StringW failureParameter) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::SetFailure");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "SetFailure", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(failure), ::il2cpp_utils::ExtractType(failureParameter)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, failure, failureParameter);
}
// Autogenerated method: System.Enum/System.EnumResult.SetFailure
void System::Enum::EnumResult::SetFailure(::System::Enum::ParseFailureKind failure, ::StringW failureMessageID, ::Il2CppObject* failureMessageFormatArgument) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::SetFailure");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "SetFailure", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(failure), ::il2cpp_utils::ExtractType(failureMessageID), ::il2cpp_utils::ExtractType(failureMessageFormatArgument)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, failure, failureMessageID, failureMessageFormatArgument);
}
// Autogenerated method: System.Enum/System.EnumResult.GetEnumParseException
::System::Exception* System::Enum::EnumResult::GetEnumParseException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::EnumResult::GetEnumParseException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "GetEnumParseException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Exception*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Enum/System.ValuesAndNames
#include "System/Enum_ValuesAndNames.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.UInt64[] Values
::ArrayW<uint64_t>& System::Enum::ValuesAndNames::dyn_Values() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ValuesAndNames::dyn_Values");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Values"))->offset;
return *reinterpret_cast<::ArrayW<uint64_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String[] Names
::ArrayW<::StringW>& System::Enum::ValuesAndNames::dyn_Names() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Enum::ValuesAndNames::dyn_Names");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Names"))->offset;
return *reinterpret_cast<::ArrayW<::StringW>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.EventArgs
#include "System/EventArgs.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly System.EventArgs Empty
::System::EventArgs* System::EventArgs::_get_Empty() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::EventArgs::_get_Empty");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::EventArgs*>("System", "EventArgs", "Empty"));
}
// Autogenerated static field setter
// Set static field: static public readonly System.EventArgs Empty
void System::EventArgs::_set_Empty(::System::EventArgs* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::EventArgs::_set_Empty");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System", "EventArgs", "Empty", value));
}
// Autogenerated method: System.EventArgs..cctor
void System::EventArgs::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::EventArgs::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System", "EventArgs", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.EventHandler
#include "System/EventHandler.hpp"
// Including type: System.EventArgs
#include "System/EventArgs.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.EventHandler.Invoke
void System::EventHandler::Invoke(::Il2CppObject* sender, ::System::EventArgs* e) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::EventHandler::Invoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sender), ::il2cpp_utils::ExtractType(e)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, sender, e);
}
// Autogenerated method: System.EventHandler.BeginInvoke
::System::IAsyncResult* System::EventHandler::BeginInvoke(::Il2CppObject* sender, ::System::EventArgs* e, ::System::AsyncCallback* callback, ::Il2CppObject* object) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::EventHandler::BeginInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sender), ::il2cpp_utils::ExtractType(e), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, sender, e, callback, object);
}
// Autogenerated method: System.EventHandler.EndInvoke
void System::EventHandler::EndInvoke(::System::IAsyncResult* result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::EventHandler::EndInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(result)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, result);
}
| 77.617865 | 509 | 0.761388 | [
"object",
"vector"
] |
c1237030def0bf99531430dc39dfc3f5dccd6618 | 3,775 | cpp | C++ | src/demo/mxm_homework.cpp | KIwabuchi/gbtl | 62c6b1e3262f3623359e793edb5ec4fa7bb471f0 | [
"Unlicense"
] | 112 | 2016-04-26T05:54:30.000Z | 2022-03-27T05:56:16.000Z | src/demo/mxm_homework.cpp | KIwabuchi/gbtl | 62c6b1e3262f3623359e793edb5ec4fa7bb471f0 | [
"Unlicense"
] | 21 | 2016-03-22T19:06:46.000Z | 2021-10-07T15:40:18.000Z | src/demo/mxm_homework.cpp | KIwabuchi/gbtl | 62c6b1e3262f3623359e793edb5ec4fa7bb471f0 | [
"Unlicense"
] | 22 | 2016-04-26T05:54:35.000Z | 2021-12-21T03:33:20.000Z | /*
* GraphBLAS Template Library (GBTL), Version 3.0
*
* Copyright 2020 Carnegie Mellon University, Battelle Memorial Institute, and
* Authors.
*
* THIS MATERIAL WAS PREPARED AS AN ACCOUNT OF WORK SPONSORED BY AN AGENCY OF
* THE UNITED STATES GOVERNMENT. NEITHER THE UNITED STATES GOVERNMENT NOR THE
* UNITED STATES DEPARTMENT OF ENERGY, NOR THE UNITED STATES DEPARTMENT OF
* DEFENSE, NOR CARNEGIE MELLON UNIVERSITY, NOR BATTELLE, NOR ANY OF THEIR
* EMPLOYEES, NOR ANY JURISDICTION OR ORGANIZATION THAT HAS COOPERATED IN THE
* DEVELOPMENT OF THESE MATERIALS, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
* ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS,
* OR USEFULNESS OR ANY INFORMATION, APPARATUS, PRODUCT, SOFTWARE, OR PROCESS
* DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED
* RIGHTS.
*
* Released under a BSD-style license, please see LICENSE file or contact
* permission@sei.cmu.edu for full terms.
*
* [DISTRIBUTION STATEMENT A] This material has been approved for public release
* and unlimited distribution. Please see Copyright notice for non-US
* Government use and distribution.
*
* DM20-0442
*/
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <vector>
#include <graphblas/graphblas.hpp>
using namespace grb;
//****************************************************************************
int main(int, char**)
{
// syntatic sugar
using ScalarType = double;
IndexType const NUM_ROWS = 3;
IndexType const NUM_COLS = 3;
// Note: size of dimensions require at ccnstruction
Matrix<ScalarType> a(NUM_ROWS, NUM_COLS);
Matrix<ScalarType> b(NUM_ROWS, NUM_COLS);
Matrix<ScalarType> c(NUM_ROWS, NUM_COLS);
// initialize matrices
IndexArrayType i = {0, 1, 2};
IndexArrayType j = {0, 1, 2};
std::vector<ScalarType> v = {1., 1., 1.};
a.build(i.begin(), j.begin(), v.begin(), i.size());
b.build(i.begin(), j.begin(), v.begin(), i.size());
print_matrix(std::cout, a, "Matrix A");
print_matrix(std::cout, b, "Matrix B");
// matrix multiply (default parameter values used for some)
mxm(c, NoMask(), NoAccumulate(), ArithmeticSemiring<ScalarType>(), a, b);
print_matrix(std::cout, c, "A +.* B");
// extract the results: nvals() method tells us how big
IndexType nvals = c.nvals();
IndexArrayType rows(nvals), cols(nvals);
std::vector<ScalarType> result(nvals);
c.extractTuples(rows, cols, result);
IndexArrayType i_ans = {0, 1, 2};
IndexArrayType j_ans = {0, 1, 2};
std::vector<ScalarType> v_ans = {1., 1., 1.};
bool success = true;
for (IndexType ix = 0; ix < result.size(); ++ix)
{
// Note: no semantics defined for extractTuples regarding the
// order of returned values, so using an O(N^2) approach
// without sorting:
bool found = false;
for (IndexType iy = 0; iy < v_ans.size(); ++iy)
{
if ((i_ans[iy] == rows[ix]) && (j_ans[iy] == cols[ix]))
{
std::cout << "Found result: result index, answer index = "
<< ix << ", " << iy
<< ": res(" << rows[ix] << "," << cols[ix]
<< ") ?= ans(" << i_ans[iy] << "," << j_ans[iy] << "), "
<< result[ix] << " ?= " << v_ans[iy] << std::endl;
found = true;
if (v_ans[iy] != result[ix])
{
std::cerr << "ERROR" << std::endl;
success = false;
}
break;
}
}
if (!found)
{
success = false;
}
}
return (success ? 0 : 1);
}
| 34.318182 | 82 | 0.581987 | [
"vector"
] |
c12efdab05f5f0685cdba02aa5b982c0da3c386d | 11,370 | cpp | C++ | src/gdb_session.cpp | VP-Vibes/DBT-RISE-Core | 87ecbd4ae12a3a1adc24dd1d5cfee4889b1b5866 | [
"BSD-3-Clause"
] | 2 | 2021-03-17T15:50:41.000Z | 2021-03-19T17:09:26.000Z | src/gdb_session.cpp | VP-Vibes/DBT-RISE-Core | 87ecbd4ae12a3a1adc24dd1d5cfee4889b1b5866 | [
"BSD-3-Clause"
] | null | null | null | src/gdb_session.cpp | VP-Vibes/DBT-RISE-Core | 87ecbd4ae12a3a1adc24dd1d5cfee4889b1b5866 | [
"BSD-3-Clause"
] | null | null | null | /*******************************************************************************
* Copyright (C) 2017, 2018, MINRES Technologies GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* Contributors:
* eyck@minres.com - initial API and implementation
******************************************************************************/
#include <algorithm>
#include <exception>
#include <iomanip>
#include <iostream>
#include <iss/debugger/gdb_session.h>
#include <string>
#include <util/logging.h>
namespace iss {
namespace debugger {
class packet_parse_error : public std::exception {};
}
}
using namespace iss::debugger;
using namespace std;
const int THREAD_ID = 1;
const int CORE_ID = 0;
const std::string ack("+");
const std::string sig_trap("S05");
template <class TContainer> bool begins_with(const TContainer &input, const TContainer &match) {
return input.size() >= match.size() && equal(match.begin(), match.end(), input.begin());
}
inline bool compare(string input, string match, size_t offset = 0) {
return (input.length() >= (offset + match.length())) && (input.compare(offset, match.length(), match) == 0);
}
class gdb_resp_msg {
public:
gdb_resp_msg() = default;
explicit gdb_resp_msg(bool is_notification)
: start_char(is_notification ? '%' : '$') {}
void add(uint8_t m) {
if (m == '#' || m == '$' || m == '}') {
buffer.push_back('}');
m ^= 0x20;
}
buffer.push_back(m);
check_sum += m;
}
char get_checksum_char(int idx) const {
assert(idx == 0 || idx == 1);
const char c = (check_sum >> (4 - 4 * idx)) & 0x0F;
assert(c < 16);
return c > 9 ? (c + 'a' - 10) : (c + '0');
}
gdb_resp_msg &operator<<(const char *msg) {
body = true;
while (msg && *msg) add(*(msg++));
return *this;
}
template <typename T> gdb_resp_msg &operator<<(T val) {
stringstream ss;
ss << std::hex << val;
this->operator<<(ss.str().c_str());
return *this;
}
template <typename T> gdb_resp_msg &operator<<(boost::optional<T> val) {
if (val) {
stringstream ss;
ss << std::hex << val.get();
this->operator<<(ss.str().c_str());
}
return *this;
}
unsigned char operator[](unsigned int idx) const { return buffer.at(idx); }
operator bool() { return /*ack||*/ body; }
operator std::string() {
std::stringstream ss;
if (body) {
ss << start_char;
for (std::vector<uint8_t>::const_iterator it = buffer.begin(); it != buffer.end(); ++it) ss << *it;
ss << "#" << get_checksum_char(0) << get_checksum_char(1);
}
return ss.str();
}
protected:
std::vector<uint8_t> buffer;
uint8_t check_sum = 0;
bool body = false;
const char start_char = '$';
};
gdb_session::gdb_session(server_if *server_, boost::asio::io_service &io_service)
: stop_callback([this](unsigned handle) {
gdb_resp_msg resp;
resp << (handle > 0 ? "S05" : "S02");
std::string msg(resp);
CLOG(TRACE, connection) << "Responding to client with '" << msg << "'";
last_msg = msg;
conn_shptr->write_data(msg);
})
, server(server_)
, conn_shptr(new connection<std::string, std::string>(io_service))
, handler(*server, stop_callback) {}
int gdb_session::start() {
conn_shptr->add_listener(shared_from_this());
boost::asio::ip::tcp::endpoint endpoint = conn_shptr->socket().remote_endpoint();
CLOG(TRACE, connection) << "gdb_session::start(), got connected to remote port " << endpoint.port() << " on "
<< endpoint.address().to_string();
conn_shptr->async_read(); // start listening
return 0;
}
void gdb_session::send_completed(const boost::system::error_code &e) {
if (!e) {
conn_shptr->async_read();
} else {
LOG(ERROR) << e.message() << "(" << e << ")";
}
}
bool is_all_hex(char *input) { // destroys input
return (strtok(input, "0123456789ABCDEFabcdef") == nullptr);
}
bool gdb_session::message_completed(std::vector<char> &buffer) {
// std::cout << "Checking for "; for (auto i = buffer.begin(); i !=
// buffer.end(); ++i) std::cout << (int)*i << '('<<*i<<")
//";std::cout<<std::endl;
size_t s = buffer.size();
if (s == 1 && (buffer[0] == '+' || buffer[0] == '-' || buffer[0] == 3)) return true;
if (s == 2 && (buffer[0] == -1 && buffer[1] == -13)) return true;
if (s > 4 && buffer[0] == '$' && buffer[s - 3] == '#') return true;
return false;
}
void gdb_session::receive_completed(const boost::system::error_code &e, std::string *msg) {
if (e.value() == 2) {
CLOG(WARNING, connection) << "Client closed connection (" << e.message() << ")";
// TODO: cleanup settings like: server.remove_breakpoint(CORE_ID, 0);
handler.t->close();
return;
} else if (e) {
CLOG(ERROR, connection) << "Communication error (" << e.message() << ")";
handler.t->close();
return;
}
// CLOG(TRACE, connection) << "Received message '"<<*msg<<"'";
if (msg->compare("+") == 0) {
CLOG(TRACE, connection) << "Received ACK";
last_msg = "";
conn_shptr->async_read();
} else if (msg->compare("-") == 0) {
CLOG(TRACE, connection) << "Received NACK, repeating msg '" << last_msg << "'";
conn_shptr->write_data(last_msg);
conn_shptr->async_read();
} else if (msg->at(0) == 3 || (msg->at(0) == -1 && msg->at(1) == -13)) {
CLOG(TRACE, connection) << "Received BREAK, interrupting target";
handler.t->stop();
respond("+");
} else {
CLOG(TRACE, connection) << "Received packet '" << *msg << "', processing it";
std::string data = check_packet(*msg);
if (data.size()) {
conn_shptr->write_data(ack);
parse_n_execute(data);
} else
respond("-");
}
return;
}
void gdb_session::parse_n_execute(std::string &data) {
try {
gdb_resp_msg resp;
std::string out_buf;
int do_connect;
bool do_reinitialize = false, input_error = false;
switch (data[0]) {
case '!':
/* Set extended operation */
CLOG(DEBUG, connection) << __FUNCTION__ << ": switching to extended protocol mode";
if (handler.can_restart) {
handler.extended_protocol = true;
resp << "OK";
} else {
/* Some GDBs will accept any response as a good one. Let us bark in the
* log at least */
CLOG(ERROR, connection) << __FUNCTION__ << ": extended operations required, but not supported";
}
break;
case '?':
/* Report the last signal status */
resp << "T0" << BREAKPOINT; // ABORTED;
break;
case 'A':
/* Set the argv[] array of the target */
// TODO: implement this!
break;
case 'C':
case 'S':
case 'c':
case 's':
resp << handler.running(data, false);
break;
case 'D':
resp << handler.detach(data); // TODO: pass socket handling
do_reinitialize = true;
break;
case 'g':
resp << handler.read_registers(data);
break;
case 'G':
resp << handler.write_registers(data);
break;
case 'H':
resp << handler.threads(data);
break;
case 'k':
do_connect = handler.kill(data, out_buf); // TODO: pass socket handling
if (do_connect == -1) input_error = true;
if (!do_connect) do_reinitialize = true;
resp << out_buf;
break;
case 'm':
resp << handler.read_memory(data);
break;
case 'M':
resp << handler.write_memory(data);
break;
case 'p':
resp << handler.read_single_register(data);
break;
case 'P':
resp << handler.write_single_register(data);
break;
case 'q':
resp << handler.query(data);
break;
case 'Q':
resp << handler.set(data);
break;
case 'R':
do_connect = handler.restart_target(data, out_buf); // TODO: pass socket handling
if (do_connect == -1) do_reinitialize = true;
resp << out_buf;
if (do_connect) break;
break;
case 't':
resp << handler.search_memory(data);
break;
case 'T':
resp << handler.thread_alive(data);
break;
case 'v':
resp << handler.handle_extended(data);
break;
case 'Z':
case 'z':
resp << handler.breakpoint(data);
break;
default:
resp << "";
break;
}
respond(resp);
} catch (boost::system::system_error const &e1) {
CLOG(ERROR, connection) << "Caught boost error " << e1.what();
} catch (std::exception const &e2) {
CLOG(ERROR, connection) << "Caught std::exception (" << typeid(e2).name() << "): " << e2.what();
}
}
std::string gdb_session::check_packet(std::string &msg) {
std::string::size_type start = msg.find_first_of('$');
std::string::size_type end = msg.find_first_of('#', start);
unsigned checksum = 0;
for (unsigned i = start + 1; i < end; i++) checksum += msg.at(i);
std::istringstream in(msg.substr(end + 1, 2));
unsigned long xmit;
in >> std::hex >> xmit;
if (xmit == (checksum & 0xff)) return msg.substr(start + 1, end - 1);
// throw(iss::debugger::packet_parse_error());
return "";
}
| 35.867508 | 113 | 0.562093 | [
"vector"
] |
c130287ddcab4d612c85deeb8e5f42fc69b05900 | 6,407 | cpp | C++ | src_ext/as_addon/scriptmath/scriptmathcomplex.cpp | suxinde2009/oge2d | 8386762bed546db083f77736e7da0010cdd0082b | [
"MIT"
] | null | null | null | src_ext/as_addon/scriptmath/scriptmathcomplex.cpp | suxinde2009/oge2d | 8386762bed546db083f77736e7da0010cdd0082b | [
"MIT"
] | null | null | null | src_ext/as_addon/scriptmath/scriptmathcomplex.cpp | suxinde2009/oge2d | 8386762bed546db083f77736e7da0010cdd0082b | [
"MIT"
] | null | null | null | #include <assert.h>
#include <string.h> // strstr
#include <new> // new()
#include <math.h>
#include "scriptmathcomplex.h"
#ifdef __BORLANDC__
// C++Builder doesn't define a non-standard "sqrtf" function but rather an overload of "sqrt"
// for float arguments.
inline float sqrtf (float x) { return sqrt (x); }
#endif
BEGIN_AS_NAMESPACE
Complex::Complex()
{
r = 0;
i = 0;
}
Complex::Complex(const Complex &other)
{
r = other.r;
i = other.i;
}
Complex::Complex(float _r, float _i)
{
r = _r;
i = _i;
}
bool Complex::operator==(const Complex &o) const
{
return (r == o.r) && (i == o.i);
}
bool Complex::operator!=(const Complex &o) const
{
return !(*this == o);
}
Complex &Complex::operator=(const Complex &other)
{
r = other.r;
i = other.i;
return *this;
}
Complex &Complex::operator+=(const Complex &other)
{
r += other.r;
i += other.i;
return *this;
}
Complex &Complex::operator-=(const Complex &other)
{
r -= other.r;
i -= other.i;
return *this;
}
Complex &Complex::operator*=(const Complex &other)
{
*this = *this * other;
return *this;
}
Complex &Complex::operator/=(const Complex &other)
{
*this = *this / other;
return *this;
}
float Complex::length() const
{
return sqrtf(r*r + i*i);
}
Complex Complex::operator+(const Complex &other) const
{
Complex res(r + other.r, i + other.i);
return res;
}
Complex Complex::operator-(const Complex &other) const
{
Complex res(r - other.r, i + other.i);
return res;
}
Complex Complex::operator*(const Complex &other) const
{
Complex res(r*other.r - i*other.i, r*other.i + i*other.r);
return res;
}
Complex Complex::operator/(const Complex &other) const
{
float len = other.length();
if( len == 0 ) return Complex(0,0);
Complex res((r*other.r + i*other.i)/len, (i*other.r - r*other.i)/len);
return res;
}
//-----------------------
// Swizzle operators
//-----------------------
Complex Complex::get_ri() const
{
return *this;
}
Complex Complex::get_ir() const
{
return Complex(r,i);
}
void Complex::set_ri(const Complex &o)
{
*this = o;
}
void Complex::set_ir(const Complex &o)
{
r = o.i;
i = o.r;
}
//-----------------------
// AngelScript functions
//-----------------------
static void ComplexDefaultConstructor(Complex *self)
{
new(self) Complex();
}
static void ComplexCopyConstructor(const Complex &other, Complex *self)
{
new(self) Complex(other);
}
static void ComplexInitConstructor(float r, float i, Complex *self)
{
new(self) Complex(r,i);
}
//--------------------------------
// Registration
//-------------------------------------
static void RegisterScriptMathComplex_Native(asIScriptEngine *engine)
{
int r;
// Register the type
r = engine->RegisterObjectType("complex", sizeof(Complex), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CAK | asOBJ_APP_CLASS_ALLFLOATS); assert( r >= 0 );
// Register the object properties
r = engine->RegisterObjectProperty("complex", "float r", asOFFSET(Complex, r)); assert( r >= 0 );
r = engine->RegisterObjectProperty("complex", "float i", asOFFSET(Complex, i)); assert( r >= 0 );
// Register the constructors
r = engine->RegisterObjectBehaviour("complex", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ComplexDefaultConstructor), asCALL_CDECL_OBJLAST); assert( r >= 0 );
r = engine->RegisterObjectBehaviour("complex", asBEHAVE_CONSTRUCT, "void f(const complex &in)", asFUNCTION(ComplexCopyConstructor), asCALL_CDECL_OBJLAST); assert( r >= 0 );
r = engine->RegisterObjectBehaviour("complex", asBEHAVE_CONSTRUCT, "void f(float, float i = 0)", asFUNCTION(ComplexInitConstructor), asCALL_CDECL_OBJLAST); assert( r >= 0 );
// Register the operator overloads
r = engine->RegisterObjectMethod("complex", "complex &opAddAssign(const complex &in)", asMETHODPR(Complex, operator+=, (const Complex &), Complex&), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "complex &opSubAssign(const complex &in)", asMETHODPR(Complex, operator-=, (const Complex &), Complex&), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "complex &opMulAssign(const complex &in)", asMETHODPR(Complex, operator*=, (const Complex &), Complex&), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "complex &opDivAssign(const complex &in)", asMETHODPR(Complex, operator/=, (const Complex &), Complex&), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "bool opEquals(const complex &in) const", asMETHODPR(Complex, operator==, (const Complex &) const, bool), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "complex opAdd(const complex &in) const", asMETHODPR(Complex, operator+, (const Complex &) const, Complex), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "complex opSub(const complex &in) const", asMETHODPR(Complex, operator-, (const Complex &) const, Complex), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "complex opMul(const complex &in) const", asMETHODPR(Complex, operator*, (const Complex &) const, Complex), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "complex opDiv(const complex &in) const", asMETHODPR(Complex, operator/, (const Complex &) const, Complex), asCALL_THISCALL); assert( r >= 0 );
// Register the object methods
r = engine->RegisterObjectMethod("complex", "float abs() const", asMETHOD(Complex,length), asCALL_THISCALL); assert( r >= 0 );
// Register the swizzle operators
r = engine->RegisterObjectMethod("complex", "complex get_ri() const", asMETHOD(Complex, get_ri), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "complex get_ir() const", asMETHOD(Complex, get_ir), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "void set_ri(const complex &in)", asMETHOD(Complex, set_ri), asCALL_THISCALL); assert( r >= 0 );
r = engine->RegisterObjectMethod("complex", "void set_ir(const complex &in)", asMETHOD(Complex, set_ir), asCALL_THISCALL); assert( r >= 0 );
}
void RegisterScriptMathComplex(asIScriptEngine *engine)
{
if( strstr(asGetLibraryOptions(), "AS_MAX_PORTABILITY") )
{
assert( false );
// TODO: implement support for generic calling convention
// RegisterScriptMathComplex_Generic(engine);
}
else
RegisterScriptMathComplex_Native(engine);
}
END_AS_NAMESPACE
| 31.253659 | 188 | 0.682847 | [
"object"
] |
c131c38525eb43ff95e2b6c5950d8433804d70f5 | 1,808 | cpp | C++ | codeforces/784/G.cpp | metaflow/contests | 5e9ffcb72c3e7da54b5e0818b1afa59f5778ffa2 | [
"MIT"
] | 1 | 2019-05-12T23:41:00.000Z | 2019-05-12T23:41:00.000Z | codeforces/784/G.cpp | metaflow/contests | 5e9ffcb72c3e7da54b5e0818b1afa59f5778ffa2 | [
"MIT"
] | null | null | null | codeforces/784/G.cpp | metaflow/contests | 5e9ffcb72c3e7da54b5e0818b1afa59f5778ffa2 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>; using vvi = vector<vi>;
using ii = pair<int,int>; using vii = vector<ii>;
using l = long long; using vl = vector<l>; using vvl = vector<vl>;
using ll = pair<l,l>; using vll = vector<ll>; using vvll = vector<vll>;
using lu = unsigned long long;
using vb = vector<bool>; using vvb = vector<vb>;
using vd = vector<double>; using vvd = vector<vd>;
const int INF = numeric_limits<int>::max();
const double EPS = 1e-10;
const l e0=1, e3=1000, e5=100000, e6=e3*e3, e7=10*e6, e8=10*e7, e9=10*e8;
#define ALL(x) begin(x), end(x)
#define F(a,b,c) for (l a = l(b); a < l(c); a++)
#define B(a,b,c) for (l a = l(b); a > l(c); a--)
// #define ONLINE_JUDGE
#if defined ONLINE_JUDGE
const bool enable_log = false;
#else
const bool enable_log = true;
#endif
struct VoidStream { void operator&(std::ostream&) { } };
#define LOG !(enable_log) ? (void) 0 : VoidStream() & cerr
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
string s;
while (cin >> s) {
l answer = 0;
bool plus = true;
l x = 0;
for (char c : s) {
switch (c) {
case '+':
if (not plus) x = -x;
answer += x;
x = 0;
plus = true;
break;
case '-':
if (not plus) x = -x;
answer += x;
x = 0;
plus = false;
break;
default:
l t = c - '0';
x = x * 10 + t;
break;
}
}
if (not plus) x = -x;
answer += x;
vl v;
while (answer) {
v.emplace_back(answer % 10);
answer /= 10;
}
if (v.empty()) v.emplace_back(0);
reverse(ALL(v));
for (l i : v) {
cout << ">++++++++++++++++++++++++++++++++++++++++++++++++";
F(j, 0, i) cout << '+';
cout << '.';
}
cout << '\n';
}
}
| 25.111111 | 73 | 0.510509 | [
"vector"
] |
c131f20c281a8bffc91c051058fa68a6430487a5 | 8,571 | cpp | C++ | wcda_txt.cpp | Devlit/WCDA | 885045f4f45562feab8b19efd8ec465202293ee4 | [
"MIT"
] | null | null | null | wcda_txt.cpp | Devlit/WCDA | 885045f4f45562feab8b19efd8ec465202293ee4 | [
"MIT"
] | null | null | null | wcda_txt.cpp | Devlit/WCDA | 885045f4f45562feab8b19efd8ec465202293ee4 | [
"MIT"
] | null | null | null | #include "wcda_txt.h"
#include <locale>
#include <limits>
#include <thread>
#include "utils.h"
Wcda_txt::Wcda_txt()
{
init_range(id_prim);
init_range(E_prim);
init_range(theta_prim);
init_range(phi_prim);
init_range(x_prim);
init_range(y_prim);
init_range(z_first_inter);
init_range(num);
init_range(number_of_weighted_particlesber_of_particles);
init_range(first_time);
init_range(n_EM);
init_range(EM_energy);
init_range(n_MU);
init_range(MU_energy);
init_range(N_Hadron);
init_range(Hadron_energy);
}
Wcda_txt* Wcda_txt::m_instance = nullptr;
bool Wcda_txt::transformAllFiles(const std::string & input_dir, const std::string & ouput_dir)
{
auto&& files = listDir(input_dir);
for (auto& file:files)
{
auto&& input_path = path_join(input_dir, file);
auto&& ouput_path = path_join(ouput_dir, file);
transformSingleFile(input_path, ouput_path);
}
save_range();
return true;
}
bool Wcda_txt::transformSingleFile(const std::string & input_file, const std::string & ouput_file)
{
vector<SelectedItemInfo> data_info;
if (!scanFile(input_file, data_info)) {
cout << "error in <bool scanFile(const string& file_name, vector<SelectedItemInfo>& output)>" << endl;
return false;
}
if (!this->extractData(data_info, ouput_file)) {
cout << "error in <bool extractData(const vector<SelectedItemInfo>& data_info, const string & output_file)>" << endl;
return false;
}
cout << input_file << " extracted!" << endl;
return true;
}
void Wcda_txt::transformBatchedFiles(const vector<string>& input_paths, const vector<string>& output_paths)
{
for (int i = 0; i < input_paths.size(); i++)
transformSingleFile(input_paths[i], output_paths[i]);
}
bool Wcda_txt::scanFile(const string & file_name, vector<SelectedItemInfo>& output)
{
fstream g4_file(file_name);
if (!g4_file.is_open())
{
cout << "open file failed!" << endl;
return false;
}
char buffer[256] = {};
int idx = 0;
while (idx++ < header_lines_count)
g4_file.getline(buffer, 256);
while (!g4_file.eof())
{
// 1
g4_file.getline(buffer, 256);
vector<string> line1 = split(buffer);
if (line1.size() != 4)
break;
////cout << buffer << endl;
g4_file.getline(buffer, 256);
vector<string> line2 = split(buffer);
////cout << buffer << endl;
g4_file.getline(buffer, 256);
vector<string> line3 = split(buffer);
////cout << buffer << endl;
g4_file.getline(buffer, 256);
vector<string> line4 = split(buffer);
////cout << buffer << endl;
SelectedItemInfo selected_info;
// line1
selected_info.id_prim = line1.at(0);
selected_info.E_prim = line1.at(1);
selected_info.theta_prim = line1.at(2);
selected_info.phi_prim = line1.at(3);
// line2
selected_info.x_prim = line2.at(0);
selected_info.y_prim = line2.at(1);
// line3
selected_info.z_first_inter = line3.at(0);
selected_info.num = line3.at(1);
selected_info.number_of_weighted_particlesber_of_particles = line3.at(2);
selected_info.first_time = line3.at(3);
// line4
selected_info.n_EM = line4.at(0);
selected_info.EM_energy = line4.at(1);
selected_info.n_MU = line4.at(2);
selected_info.MU_energy = line4.at(3);
selected_info.N_Hadron = line4.at(4);
selected_info.Hadron_energy = line4.at(5);
// 2
g4_file.getline(buffer, 256);
vector<string> line5_npmt = split(buffer);
//cout << buffer << endl;
if (line5_npmt.size() == 0)
break;
if (line5_npmt.at(0) != "0")
{
selected_info.nPMT = line5_npmt.at(0);
int nPmt = 0;
str2any(selected_info.nPMT,nPmt);
for (int i = 0; i < nPmt; i++)
{
g4_file.getline(buffer, 256);
//cout << buffer << endl;
vector<string> pmt_info_line = split(buffer);
PMT_Info pmt_info;
pmt_info.id = pmt_info_line.at(0);
pmt_info.nHIT = pmt_info_line.at(1);
pmt_info.time_first = pmt_info_line.at(2);
pmt_info.time_from_corsika = pmt_info_line.at(3);
int nHit = 0;
str2any(pmt_info.nHIT, nHit);
for (int j = 0; j < nHit; j++)
{
g4_file.getline(buffer, 256);
//cout << buffer << endl;
vector<string> items = split(buffer);
pair<string, string> time_pair;
str2any(items.at(0), time_pair.first);
str2any(items.at(1), time_pair.second);
pmt_info.hit_info.push_back(time_pair);
}// for
selected_info.pmt_info.push_back(pmt_info);
}// for
output.push_back(selected_info);
} //if
else {
selected_info.nPMT = "0";
output.push_back(selected_info);
}
// nPrints
g4_file.getline(buffer, 256);
//cout << buffer << endl;
vector<string> items2 = split(buffer);
int print_lines = 0;
str2any(items2.at(0), print_lines);
if (print_lines == 0)
continue;
else
{
while (print_lines--) {
g4_file.getline(buffer, 256);
//cout << buffer << endl;
}
}
}// while
g4_file.close();
return true;
}
bool Wcda_txt::extractData(const vector<SelectedItemInfo>& data_info, const string & output_file)
{
fstream file(output_file, std::ios::out | std::ios::app);
if (file.fail())
return false;
for (auto& info : data_info) {
update_range(info);
if (info.nPMT == "0")
continue;
file << info.id_prim << " " << info.E_prim << " " << info.theta_prim << " " << info.phi_prim << " ";
// line2
file << info.x_prim << " " << info.y_prim << " ";
// line3
file << info.z_first_inter << " " << info.num << " " << info.number_of_weighted_particlesber_of_particles << " " << info.first_time << " ";
// line4
file << info.n_EM << " " << info.n_MU << " " << info.MU_energy << " " << info.N_Hadron << " " << info.Hadron_energy << endl;
// line5
//file << info.nPMT << endl;
for (auto& pmt : info.pmt_info) {
file << pmt.id << " " << pmt.nHIT << endl;
for (auto& hit : pmt.hit_info) {
file << hit.first<<endl;
}
}
}
file.close();
return true;
}
void Wcda_txt::update_range(val_range & val, const string& new_val_str)
{
double new_val = 0.0;
str2any(new_val_str, new_val);
if (new_val > val.second)
val.second = new_val;
if (new_val < val.first)
val.first = new_val;
}
void Wcda_txt::update_range(const SelectedItemInfo & info)
{
update_range(id_prim,info.id_prim);
update_range(E_prim,info.E_prim);
update_range(theta_prim,info.theta_prim);
update_range(phi_prim,info.phi_prim);
update_range(x_prim,info.x_prim);
update_range(y_prim,info.y_prim);
update_range(z_first_inter,info.z_first_inter);
update_range(num,info.num);
update_range(number_of_weighted_particlesber_of_particles,info.number_of_weighted_particlesber_of_particles);
update_range(first_time,info.first_time);
update_range(n_EM,info.n_EM);
update_range(n_MU,info.n_MU);
update_range(MU_energy,info.MU_energy);
update_range(N_Hadron,info.N_Hadron);
update_range(Hadron_energy,info.Hadron_energy);
}
void Wcda_txt::init_range(val_range & val)
{
val.first = std::numeric_limits<double>::max();
val.second = std::numeric_limits<double>::min();
}
void Wcda_txt::save_range()
{
fstream file("corsika_vals_range.txt", std::ios::out);
file << "id_prim:" << id_prim.first << "," << id_prim.second << endl;
file << "E_prim:" << E_prim.first << "," << E_prim.second << endl;
file << "theta_prim:" << theta_prim.first << "," << theta_prim.second << endl;
file << "phi_prim:" << phi_prim.first << "," << phi_prim.second << endl;
file << "x_prim:" << x_prim.first << "," << x_prim.second << endl;
file << "y_prim:" << y_prim.first << "," << y_prim.second << endl;
file << "z_first_inter:" << z_first_inter.first << "," << z_first_inter.second << endl;
file << "num:" << num.first << "," << num.second << endl;
file << "number_of_weighted_particlesber_of_particles:" << number_of_weighted_particlesber_of_particles.first << "," << number_of_weighted_particlesber_of_particles.second << endl;
file << "first_time:" << first_time.first << "," << first_time.second << endl;
file << "n_EM:" << n_EM.first << "," << n_EM.second << endl;
file << "EM_energy:" << EM_energy.first << "," << EM_energy.second << endl;
file << "n_MU:" << n_MU.first << "," << n_MU.second << endl;
file << "MU_energy:" << MU_energy.first << "," << MU_energy.second << endl;
file << "N_Hadron:" << N_Hadron.first << "," << N_Hadron.second << endl;
file << "Hadron_energy:" << Hadron_energy.first << "," << Hadron_energy.second << endl;
file.close();
}
| 28.761745 | 182 | 0.646716 | [
"vector"
] |
c135f4921c0b40cd9e334f28651b0090546aadd7 | 27,747 | cpp | C++ | src/main/cpp/kernelscore_gen_vanilla.cpp | ehsantn/data-analytics-benchmarks | db6ecf8c3e1d899a146ced47a8cc3e92b52fca69 | [
"BSD-2-Clause"
] | 1 | 2017-06-19T17:09:06.000Z | 2017-06-19T17:09:06.000Z | src/main/cpp/kernelscore_gen_vanilla.cpp | ehsantn/data-analytics-benchmarks | db6ecf8c3e1d899a146ced47a8cc3e92b52fca69 | [
"BSD-2-Clause"
] | null | null | null | src/main/cpp/kernelscore_gen_vanilla.cpp | ehsantn/data-analytics-benchmarks | db6ecf8c3e1d899a146ced47a8cc3e92b52fca69 | [
"BSD-2-Clause"
] | null | null | null | #include <random>
#include <mpi.h>
#include <stdint.h>
#include <float.h>
#include <limits.h>
#include <complex>
#include <math.h>
#include <stdio.h>
#include <iostream>
#include "/home/etotoni/.julia/v0.5/ParallelAccelerator/src/../deps/include/j2c-array.h"
#include "/home/etotoni/.julia/v0.5/ParallelAccelerator/src/../deps/include/pse-types.h"
#include "/home/etotoni/.julia/v0.5/ParallelAccelerator/src/../deps/include/cgen_intrinsics.h"
#include <sstream>
#include <vector>
#include <string>
#include <ctime>
#include <stdlib.h>
#include "/home/etotoni/.julia/v0.5/HPAT/src/../deps/include/hpat.h"
unsigned main_count = 0;
typedef struct
{
} pppkernelscore_testp271;
typedef struct
{
double f0;
double f1;
double f2;
} TupleFloat64Float64Float64;
typedef struct
{
} Basepvect;
typedef struct
{
int64_t start;
int64_t stop;
} UnitRangeInt64;
typedef struct
{
int64_t f0;
int64_t f1;
} TupleInt64Int64;
j2c_array< double > _Base_vect(double X1, double X2, double X3);
j2c_array< double > _Base_vect(double X1, double X2, double X3)
{
TupleFloat64Float64Float64 X = {X1, X2, X3};
Basepvect pselfp;
int64_t ptempp;
int64_t ppptempp_4p293;
int64_t ppptempp_5p294;
int64_t i;
int64_t ppptempp_7p295;
UnitRangeInt64 SSAValue0;
int64_t SSAValue1;
j2c_array< double > SSAValue2;
int64_t SSAValue3;
TupleInt64Int64 SSAValue4;
TupleInt64Int64 SSAValue5;
TupleInt64Int64 SSAValue6;
double SSAValue7;
int64_t SSAValue8;
int64_t SSAValue9;
int64_t SSAValue10;
int64_t SSAValue11;
int64_t SSAValue12;
int64_t SSAValue13;
int64_t SSAValue14;
SSAValue8 = 3;
SSAValue10 = ((1) <= (SSAValue8)) ? (SSAValue8) : ((1) - (1));
SSAValue1 = ((SSAValue10) - (1)) + (1);
SSAValue2 = j2c_array<double>::new_j2c_array_1d(NULL, SSAValue1);
ptempp = 1;
ppptempp_4p293 = 1;
ppptempp_5p294 = 0;
label8 : ;
if (!(!((ppptempp_5p294 == SSAValue1)))) goto label28;
SSAValue3 = (ppptempp_5p294) + (1);
ppptempp_5p294 = SSAValue3;
SSAValue11 = ppptempp_4p293;
SSAValue12 = (ppptempp_4p293) + (1);
ppptempp_7p295 = 1;
SSAValue13 = (1) + (1);
i = SSAValue11;
ppptempp_7p295 = SSAValue13;
SSAValue14 = (2) + (1);
ppptempp_4p293 = SSAValue12;
ppptempp_7p295 = SSAValue14;
SSAValue7 = ((double *)&X)[i - 1];
SSAValue2.ARRAYELEM(ptempp) = SSAValue7;
ptempp = (ptempp) + (1);
label26 : ;
goto label8;
label28 : ;
return SSAValue2;
}
void ppkernelscore_testp271(int64_t n, double * __restrict ret0)
{
pppkernelscore_testp271 pselfp;
j2c_array< double > X;
j2c_array< double > points;
int64_t N;
double b;
double exps;
j2c_array< double > arr;
int64_t SSAValue9;
int64_t SSAValue11;
bool SSAValue13;
int64_t SSAValue14;
int64_t SSAValue16;
int64_t SSAValue18;
int64_t parfor_index_1_1;
int64_t parallel_ir_save_array_len_1_1;
double SSAValue19;
double parallel_ir_array_temp__10_4_2;
int64_t ppip273p280;
double parallel_ir_reduction_input_5_1;
double pptemp_neutral_valp281;
j2c_array< double > d;
double m;
j2c_array< double > SSAValue20;
double SSAValue21;
double SSAValue22;
double SSAValue23;
double SSAValue24;
double SSAValue25;
double SSAValue16pp1;
j2c_array< double > SSAValue26;
j2c_array< double > SSAValue27;
int32_t SSAValue28;
double SSAValue0;
double SSAValue25pp2;
double SSAValue1;
double SSAValue2;
j2c_array< double > SSAValue3;
j2c_array< double > SSAValue4;
double SSAValue5;
double parallel_ir_array_temp__7_16_1;
int64_t parfor_index_1_15;
int64_t parallel_ir_save_array_len_1_15;
double SSAValue6;
j2c_array< double > parallel_ir_new_array_name_15_1;
double parallel_ir_array_temp__23_18_1;
double parallel_ir_array_temp_SSAValue17_20_1;
int64_t parfor_index_1_19;
int64_t parallel_ir_save_array_len_1_19;
int32_t SSAValue7;
double SSAValue8;
j2c_array< double > parallel_ir_new_array_name_19_1;
double parallel_ir_array_temp__29_22_1;
double parallel_ir_array_temp_SSAValue18_24_1;
int64_t parfor_index_1_23;
int64_t parallel_ir_save_array_len_1_23;
double SSAValue10;
j2c_array< double > parallel_ir_new_array_name_23_1;
double parallel_ir_array_temp__35_26_1;
double parallel_ir_array_temp_SSAValue2_28_1;
int64_t parfor_index_1_27;
int64_t parallel_ir_save_array_len_1_27;
double SSAValue12;
j2c_array< double > parallel_ir_new_array_name_27_1;
double parallel_ir_array_temp__41_30_1;
int64_t parfor_index_1_31;
double parallel_ir_array_temp__4_33_1;
int64_t parallel_ir_save_array_len_1_31;
double parallel_ir_reduction_output_31;
double parallel_ir_array_temp__4_36_1;
int64_t parfor_index_1_35;
int64_t parallel_ir_save_array_len_1_35;
double SSAValue15;
j2c_array< double > parallel_ir_new_array_name_35_1;
double parallel_ir_array_temp__52_38_1;
double parallel_ir_array_temp_SSAValue31_40_1;
int64_t parfor_index_1_39;
int64_t parallel_ir_save_array_len_1_39;
double SSAValue17;
j2c_array< double > parallel_ir_new_array_name_39_1;
double parallel_ir_array_temp__58_42_1;
int64_t parfor_index_1_43;
double parallel_ir_array_temp_SSAValue32_45_1;
int64_t parallel_ir_save_array_len_1_43;
double parallel_ir_reduction_output_43;
int32_t __hpat_num_pes;
int32_t __hpat_node_id;
int64_t __hpat_dist_arr_start_1;
int64_t __hpat_dist_arr_div_1;
int64_t __hpat_dist_arr_count_1;
int64_t __hpat_loop_start_1;
int64_t __hpat_loop_end_1;
int64_t __hpat_loop_div_1;
int64_t __hpat_loop_start_5;
int64_t __hpat_loop_end_5;
int64_t __hpat_loop_div_5;
double __hpat_reduce_2;
std::random_device cgen_rand_device;
std::uniform_real_distribution<double> cgen_distribution(0.0,1.0);
std::normal_distribution<double> cgen_n_distribution(0.0,1.0);
std::default_random_engine cgen_rand_generator(cgen_rand_device());
;;
MPI_Comm_size(MPI_COMM_WORLD,&__hpat_num_pes);;
MPI_Comm_rank(MPI_COMM_WORLD,&__hpat_node_id);;
SSAValue14 = (1) - (1);
exps = 0.0;
__hpat_dist_arr_div_1 = (n) / (__hpat_num_pes);
__hpat_dist_arr_start_1 = (__hpat_node_id) * (__hpat_dist_arr_div_1);
__hpat_dist_arr_count_1 = ((__hpat_node_id==__hpat_num_pes-1) ? n-__hpat_node_id*__hpat_dist_arr_div_1 : __hpat_dist_arr_div_1);
arr = j2c_array<double>::new_j2c_array_1d(NULL, __hpat_dist_arr_count_1);
parallel_ir_save_array_len_1_1 = n;
__hpat_loop_div_1 = (parallel_ir_save_array_len_1_1) / (__hpat_num_pes);
__hpat_loop_start_1 = ((__hpat_node_id) * (__hpat_loop_div_1)) + (1);
__hpat_loop_end_1 = ((__hpat_node_id==__hpat_num_pes-1) ? parallel_ir_save_array_len_1_1 : (__hpat_node_id+1)*__hpat_loop_div_1);
for ( parfor_index_1_1 = __hpat_loop_start_1; parfor_index_1_1 <= (int64_t)__hpat_loop_end_1; parfor_index_1_1 += 1)
{
;
SSAValue19 = cgen_distribution(cgen_rand_generator);
;
parallel_ir_array_temp__10_4_2 = SSAValue19;
arr.ARRAYELEM(((parfor_index_1_1) - (__hpat_loop_start_1)) + (1)) = parallel_ir_array_temp__10_4_2;
}
;
X = arr;
t1 = MPI_Wtime();
points = _Base_vect(-1.0,2.0,5.0);
N = points.ARRAYSIZE(1);
b = 0.5;
SSAValue9 = n;
SSAValue13 = (1) <= (SSAValue9);
SSAValue11 = (SSAValue13) ? (SSAValue9) : (SSAValue14);
SSAValue16 = (SSAValue11) - (1);
SSAValue18 = (SSAValue16) + (1);
__hpat_loop_div_5 = (SSAValue18) / (__hpat_num_pes);
__hpat_loop_start_5 = ((__hpat_node_id) * (__hpat_loop_div_5)) + (1);
__hpat_loop_end_5 = ((__hpat_node_id==__hpat_num_pes-1) ? SSAValue18 : (__hpat_node_id+1)*__hpat_loop_div_5);
// #pragma simd reduction(+: exps)
for ( ppip273p280 = __hpat_loop_start_5; ppip273p280 <= (int64_t)__hpat_loop_end_5; ppip273p280 += 1)
{
;
SSAValue28 = (int32_t)(2);
SSAValue21 = pow(b, SSAValue28);
SSAValue0 = (double)2;
SSAValue25pp2 = (SSAValue0) * (SSAValue21);
SSAValue1 = (double)N;
SSAValue2 = (b) * (SSAValue1);
SSAValue22 = log(SSAValue2);;
SSAValue16pp1 = X.ARRAYELEM(((ppip273p280) - (__hpat_loop_start_5)) + (1));
parallel_ir_save_array_len_1_15 = points.ARRAYSIZE(1);
parallel_ir_new_array_name_15_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_15);
for ( parfor_index_1_15 = 1; parfor_index_1_15 <= (int64_t)parallel_ir_save_array_len_1_15; parfor_index_1_15 += 1)
{
;
parallel_ir_array_temp__7_16_1 = points.ARRAYELEM(parfor_index_1_15);
SSAValue6 = (SSAValue16pp1) - (parallel_ir_array_temp__7_16_1);
parallel_ir_array_temp__23_18_1 = SSAValue6;
parallel_ir_new_array_name_15_1.ARRAYELEM(parfor_index_1_15) = parallel_ir_array_temp__23_18_1;
}
;
SSAValue26 = parallel_ir_new_array_name_15_1;
parallel_ir_save_array_len_1_19 = SSAValue26.ARRAYSIZE(1);
parallel_ir_new_array_name_19_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_19);
for ( parfor_index_1_19 = 1; parfor_index_1_19 <= (int64_t)parallel_ir_save_array_len_1_19; parfor_index_1_19 += 1)
{
;
parallel_ir_array_temp_SSAValue17_20_1 = SSAValue26.ARRAYELEM(parfor_index_1_19);
SSAValue7 = (int32_t)(2);
SSAValue8 = pow(parallel_ir_array_temp_SSAValue17_20_1, SSAValue7);
parallel_ir_array_temp__29_22_1 = SSAValue8;
parallel_ir_new_array_name_19_1.ARRAYELEM(parfor_index_1_19) = parallel_ir_array_temp__29_22_1;
}
;
SSAValue27 = parallel_ir_new_array_name_19_1;
parallel_ir_save_array_len_1_23 = SSAValue27.ARRAYSIZE(1);
parallel_ir_new_array_name_23_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_23);
for ( parfor_index_1_23 = 1; parfor_index_1_23 <= (int64_t)parallel_ir_save_array_len_1_23; parfor_index_1_23 += 1)
{
;
parallel_ir_array_temp_SSAValue18_24_1 = SSAValue27.ARRAYELEM(parfor_index_1_23);
SSAValue10 = -(parallel_ir_array_temp_SSAValue18_24_1);
parallel_ir_array_temp__35_26_1 = SSAValue10;
parallel_ir_new_array_name_23_1.ARRAYELEM(parfor_index_1_23) = parallel_ir_array_temp__35_26_1;
}
;
SSAValue20 = parallel_ir_new_array_name_23_1;
parallel_ir_save_array_len_1_27 = SSAValue20.ARRAYSIZE(1);
parallel_ir_new_array_name_27_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_27);
for ( parfor_index_1_27 = 1; parfor_index_1_27 <= (int64_t)parallel_ir_save_array_len_1_27; parfor_index_1_27 += 1)
{
;
parallel_ir_array_temp_SSAValue2_28_1 = SSAValue20.ARRAYELEM(parfor_index_1_27);
SSAValue12 = (parallel_ir_array_temp_SSAValue2_28_1) / (SSAValue25pp2);
parallel_ir_array_temp__41_30_1 = SSAValue12;
parallel_ir_new_array_name_27_1.ARRAYELEM(parfor_index_1_27) = parallel_ir_array_temp__41_30_1;
}
;
d = parallel_ir_new_array_name_27_1;
parallel_ir_save_array_len_1_31 = d.ARRAYSIZE(1);
parallel_ir_reduction_output_31 = DBL_MAX;
for ( parfor_index_1_31 = 1; parfor_index_1_31 <= (int64_t)parallel_ir_save_array_len_1_31; parfor_index_1_31 += 1)
{
;
parallel_ir_array_temp__4_33_1 = d.ARRAYELEM(parfor_index_1_31);
parallel_ir_reduction_output_31 = std::min((double)parallel_ir_reduction_output_31,(double)parallel_ir_array_temp__4_33_1);
}
;
m = parallel_ir_reduction_output_31;
SSAValue23 = (m) - (SSAValue22);
parallel_ir_save_array_len_1_35 = d.ARRAYSIZE(1);
parallel_ir_new_array_name_35_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_35);
for ( parfor_index_1_35 = 1; parfor_index_1_35 <= (int64_t)parallel_ir_save_array_len_1_35; parfor_index_1_35 += 1)
{
;
parallel_ir_array_temp__4_36_1 = d.ARRAYELEM(parfor_index_1_35);
SSAValue15 = (parallel_ir_array_temp__4_36_1) - (m);
parallel_ir_array_temp__52_38_1 = SSAValue15;
parallel_ir_new_array_name_35_1.ARRAYELEM(parfor_index_1_35) = parallel_ir_array_temp__52_38_1;
}
;
SSAValue3 = parallel_ir_new_array_name_35_1;
parallel_ir_save_array_len_1_39 = SSAValue3.ARRAYSIZE(1);
parallel_ir_new_array_name_39_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_39);
for ( parfor_index_1_39 = 1; parfor_index_1_39 <= (int64_t)parallel_ir_save_array_len_1_39; parfor_index_1_39 += 1)
{
;
parallel_ir_array_temp_SSAValue31_40_1 = SSAValue3.ARRAYELEM(parfor_index_1_39);
SSAValue17 = exp(parallel_ir_array_temp_SSAValue31_40_1);
parallel_ir_array_temp__58_42_1 = SSAValue17;
parallel_ir_new_array_name_39_1.ARRAYELEM(parfor_index_1_39) = parallel_ir_array_temp__58_42_1;
}
;
SSAValue4 = parallel_ir_new_array_name_39_1;
parallel_ir_save_array_len_1_43 = SSAValue4.ARRAYSIZE(1);
parallel_ir_reduction_output_43 = 0.0;
for ( parfor_index_1_43 = 1; parfor_index_1_43 <= (int64_t)parallel_ir_save_array_len_1_43; parfor_index_1_43 += 1)
{
;
parallel_ir_array_temp_SSAValue32_45_1 = SSAValue4.ARRAYELEM(parfor_index_1_43);
parallel_ir_reduction_output_43 = (parallel_ir_reduction_output_43+parallel_ir_array_temp_SSAValue32_45_1);
}
;
SSAValue5 = parallel_ir_reduction_output_43;
SSAValue24 = log(SSAValue5);;
SSAValue25 = (SSAValue23) + (SSAValue24);
exps = (exps) + (SSAValue25);
}
;
__hpat_reduce_2 = 0;
MPI_Allreduce(&exps, &__hpat_reduce_2, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);;
exps = __hpat_reduce_2;
t2 = MPI_Wtime();
*ret0 = exps;
return;
}
void ppkernelscore_testp271_unaliased(int64_t n, double * __restrict ret0)
{
pppkernelscore_testp271 pselfp;
j2c_array< double > X;
j2c_array< double > points;
int64_t N;
double b;
double exps;
j2c_array< double > arr;
int64_t SSAValue9;
int64_t SSAValue11;
bool SSAValue13;
int64_t SSAValue14;
int64_t SSAValue16;
int64_t SSAValue18;
int64_t parfor_index_1_1;
int64_t parallel_ir_save_array_len_1_1;
double SSAValue19;
double parallel_ir_array_temp__10_4_2;
int64_t ppip273p280;
double parallel_ir_reduction_input_5_1;
double pptemp_neutral_valp281;
j2c_array< double > d;
double m;
j2c_array< double > SSAValue20;
double SSAValue21;
double SSAValue22;
double SSAValue23;
double SSAValue24;
double SSAValue25;
double SSAValue16pp1;
j2c_array< double > SSAValue26;
j2c_array< double > SSAValue27;
int32_t SSAValue28;
double SSAValue0;
double SSAValue25pp2;
double SSAValue1;
double SSAValue2;
j2c_array< double > SSAValue3;
j2c_array< double > SSAValue4;
double SSAValue5;
double parallel_ir_array_temp__7_16_1;
int64_t parfor_index_1_15;
int64_t parallel_ir_save_array_len_1_15;
double SSAValue6;
j2c_array< double > parallel_ir_new_array_name_15_1;
double parallel_ir_array_temp__23_18_1;
double parallel_ir_array_temp_SSAValue17_20_1;
int64_t parfor_index_1_19;
int64_t parallel_ir_save_array_len_1_19;
int32_t SSAValue7;
double SSAValue8;
j2c_array< double > parallel_ir_new_array_name_19_1;
double parallel_ir_array_temp__29_22_1;
double parallel_ir_array_temp_SSAValue18_24_1;
int64_t parfor_index_1_23;
int64_t parallel_ir_save_array_len_1_23;
double SSAValue10;
j2c_array< double > parallel_ir_new_array_name_23_1;
double parallel_ir_array_temp__35_26_1;
double parallel_ir_array_temp_SSAValue2_28_1;
int64_t parfor_index_1_27;
int64_t parallel_ir_save_array_len_1_27;
double SSAValue12;
j2c_array< double > parallel_ir_new_array_name_27_1;
double parallel_ir_array_temp__41_30_1;
int64_t parfor_index_1_31;
double parallel_ir_array_temp__4_33_1;
int64_t parallel_ir_save_array_len_1_31;
double parallel_ir_reduction_output_31;
double parallel_ir_array_temp__4_36_1;
int64_t parfor_index_1_35;
int64_t parallel_ir_save_array_len_1_35;
double SSAValue15;
j2c_array< double > parallel_ir_new_array_name_35_1;
double parallel_ir_array_temp__52_38_1;
double parallel_ir_array_temp_SSAValue31_40_1;
int64_t parfor_index_1_39;
int64_t parallel_ir_save_array_len_1_39;
double SSAValue17;
j2c_array< double > parallel_ir_new_array_name_39_1;
double parallel_ir_array_temp__58_42_1;
int64_t parfor_index_1_43;
double parallel_ir_array_temp_SSAValue32_45_1;
int64_t parallel_ir_save_array_len_1_43;
double parallel_ir_reduction_output_43;
int32_t __hpat_num_pes;
int32_t __hpat_node_id;
int64_t __hpat_dist_arr_start_1;
int64_t __hpat_dist_arr_div_1;
int64_t __hpat_dist_arr_count_1;
int64_t __hpat_loop_start_1;
int64_t __hpat_loop_end_1;
int64_t __hpat_loop_div_1;
int64_t __hpat_loop_start_5;
int64_t __hpat_loop_end_5;
int64_t __hpat_loop_div_5;
double __hpat_reduce_2;
std::random_device cgen_rand_device;
std::uniform_real_distribution<double> cgen_distribution(0.0,1.0);
std::normal_distribution<double> cgen_n_distribution(0.0,1.0);
std::default_random_engine cgen_rand_generator(cgen_rand_device());
;;
MPI_Comm_size(MPI_COMM_WORLD,&__hpat_num_pes);;
MPI_Comm_rank(MPI_COMM_WORLD,&__hpat_node_id);;
SSAValue14 = (1) - (1);
exps = 0.0;
__hpat_dist_arr_div_1 = (n) / (__hpat_num_pes);
__hpat_dist_arr_start_1 = (__hpat_node_id) * (__hpat_dist_arr_div_1);
__hpat_dist_arr_count_1 = ((__hpat_node_id==__hpat_num_pes-1) ? n-__hpat_node_id*__hpat_dist_arr_div_1 : __hpat_dist_arr_div_1);
arr = j2c_array<double>::new_j2c_array_1d(NULL, __hpat_dist_arr_count_1);
parallel_ir_save_array_len_1_1 = n;
__hpat_loop_div_1 = (parallel_ir_save_array_len_1_1) / (__hpat_num_pes);
__hpat_loop_start_1 = ((__hpat_node_id) * (__hpat_loop_div_1)) + (1);
__hpat_loop_end_1 = ((__hpat_node_id==__hpat_num_pes-1) ? parallel_ir_save_array_len_1_1 : (__hpat_node_id+1)*__hpat_loop_div_1);
for ( parfor_index_1_1 = __hpat_loop_start_1; parfor_index_1_1 <= (int64_t)__hpat_loop_end_1; parfor_index_1_1 += 1)
{
;
SSAValue19 = cgen_distribution(cgen_rand_generator);
;
parallel_ir_array_temp__10_4_2 = SSAValue19;
arr.ARRAYELEM(((parfor_index_1_1) - (__hpat_loop_start_1)) + (1)) = parallel_ir_array_temp__10_4_2;
}
;
X = arr;
points = _Base_vect(-1.0,2.0,5.0);
N = points.ARRAYSIZE(1);
b = 0.5;
SSAValue9 = n;
SSAValue13 = (1) <= (SSAValue9);
SSAValue11 = (SSAValue13) ? (SSAValue9) : (SSAValue14);
SSAValue16 = (SSAValue11) - (1);
SSAValue18 = (SSAValue16) + (1);
__hpat_loop_div_5 = (SSAValue18) / (__hpat_num_pes);
__hpat_loop_start_5 = ((__hpat_node_id) * (__hpat_loop_div_5)) + (1);
__hpat_loop_end_5 = ((__hpat_node_id==__hpat_num_pes-1) ? SSAValue18 : (__hpat_node_id+1)*__hpat_loop_div_5);
#pragma simd reduction(+: exps)
for ( ppip273p280 = __hpat_loop_start_5; ppip273p280 <= (int64_t)__hpat_loop_end_5; ppip273p280 += 1)
{
;
SSAValue28 = (int32_t)(2);
SSAValue21 = pow(b, SSAValue28);
SSAValue0 = (double)2;
SSAValue25pp2 = (SSAValue0) * (SSAValue21);
SSAValue1 = (double)N;
SSAValue2 = (b) * (SSAValue1);
SSAValue22 = log(SSAValue2);;
SSAValue16pp1 = X.ARRAYELEM(((ppip273p280) - (__hpat_loop_start_5)) + (1));
parallel_ir_save_array_len_1_15 = points.ARRAYSIZE(1);
parallel_ir_new_array_name_15_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_15);
for ( parfor_index_1_15 = 1; parfor_index_1_15 <= (int64_t)parallel_ir_save_array_len_1_15; parfor_index_1_15 += 1)
{
;
parallel_ir_array_temp__7_16_1 = points.ARRAYELEM(parfor_index_1_15);
SSAValue6 = (SSAValue16pp1) - (parallel_ir_array_temp__7_16_1);
parallel_ir_array_temp__23_18_1 = SSAValue6;
parallel_ir_new_array_name_15_1.ARRAYELEM(parfor_index_1_15) = parallel_ir_array_temp__23_18_1;
}
;
SSAValue26 = parallel_ir_new_array_name_15_1;
parallel_ir_save_array_len_1_19 = SSAValue26.ARRAYSIZE(1);
parallel_ir_new_array_name_19_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_19);
for ( parfor_index_1_19 = 1; parfor_index_1_19 <= (int64_t)parallel_ir_save_array_len_1_19; parfor_index_1_19 += 1)
{
;
parallel_ir_array_temp_SSAValue17_20_1 = SSAValue26.ARRAYELEM(parfor_index_1_19);
SSAValue7 = (int32_t)(2);
SSAValue8 = pow(parallel_ir_array_temp_SSAValue17_20_1, SSAValue7);
parallel_ir_array_temp__29_22_1 = SSAValue8;
parallel_ir_new_array_name_19_1.ARRAYELEM(parfor_index_1_19) = parallel_ir_array_temp__29_22_1;
}
;
SSAValue27 = parallel_ir_new_array_name_19_1;
parallel_ir_save_array_len_1_23 = SSAValue27.ARRAYSIZE(1);
parallel_ir_new_array_name_23_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_23);
for ( parfor_index_1_23 = 1; parfor_index_1_23 <= (int64_t)parallel_ir_save_array_len_1_23; parfor_index_1_23 += 1)
{
;
parallel_ir_array_temp_SSAValue18_24_1 = SSAValue27.ARRAYELEM(parfor_index_1_23);
SSAValue10 = -(parallel_ir_array_temp_SSAValue18_24_1);
parallel_ir_array_temp__35_26_1 = SSAValue10;
parallel_ir_new_array_name_23_1.ARRAYELEM(parfor_index_1_23) = parallel_ir_array_temp__35_26_1;
}
;
SSAValue20 = parallel_ir_new_array_name_23_1;
parallel_ir_save_array_len_1_27 = SSAValue20.ARRAYSIZE(1);
parallel_ir_new_array_name_27_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_27);
for ( parfor_index_1_27 = 1; parfor_index_1_27 <= (int64_t)parallel_ir_save_array_len_1_27; parfor_index_1_27 += 1)
{
;
parallel_ir_array_temp_SSAValue2_28_1 = SSAValue20.ARRAYELEM(parfor_index_1_27);
SSAValue12 = (parallel_ir_array_temp_SSAValue2_28_1) / (SSAValue25pp2);
parallel_ir_array_temp__41_30_1 = SSAValue12;
parallel_ir_new_array_name_27_1.ARRAYELEM(parfor_index_1_27) = parallel_ir_array_temp__41_30_1;
}
;
d = parallel_ir_new_array_name_27_1;
parallel_ir_save_array_len_1_31 = d.ARRAYSIZE(1);
parallel_ir_reduction_output_31 = DBL_MAX;
for ( parfor_index_1_31 = 1; parfor_index_1_31 <= (int64_t)parallel_ir_save_array_len_1_31; parfor_index_1_31 += 1)
{
;
parallel_ir_array_temp__4_33_1 = d.ARRAYELEM(parfor_index_1_31);
parallel_ir_reduction_output_31 = std::min((double)parallel_ir_reduction_output_31,(double)parallel_ir_array_temp__4_33_1);
}
;
m = parallel_ir_reduction_output_31;
SSAValue23 = (m) - (SSAValue22);
parallel_ir_save_array_len_1_35 = d.ARRAYSIZE(1);
parallel_ir_new_array_name_35_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_35);
for ( parfor_index_1_35 = 1; parfor_index_1_35 <= (int64_t)parallel_ir_save_array_len_1_35; parfor_index_1_35 += 1)
{
;
parallel_ir_array_temp__4_36_1 = d.ARRAYELEM(parfor_index_1_35);
SSAValue15 = (parallel_ir_array_temp__4_36_1) - (m);
parallel_ir_array_temp__52_38_1 = SSAValue15;
parallel_ir_new_array_name_35_1.ARRAYELEM(parfor_index_1_35) = parallel_ir_array_temp__52_38_1;
}
;
SSAValue3 = parallel_ir_new_array_name_35_1;
parallel_ir_save_array_len_1_39 = SSAValue3.ARRAYSIZE(1);
parallel_ir_new_array_name_39_1 = j2c_array<double>::new_j2c_array_1d(NULL, parallel_ir_save_array_len_1_39);
for ( parfor_index_1_39 = 1; parfor_index_1_39 <= (int64_t)parallel_ir_save_array_len_1_39; parfor_index_1_39 += 1)
{
;
parallel_ir_array_temp_SSAValue31_40_1 = SSAValue3.ARRAYELEM(parfor_index_1_39);
SSAValue17 = exp(parallel_ir_array_temp_SSAValue31_40_1);
parallel_ir_array_temp__58_42_1 = SSAValue17;
parallel_ir_new_array_name_39_1.ARRAYELEM(parfor_index_1_39) = parallel_ir_array_temp__58_42_1;
}
;
SSAValue4 = parallel_ir_new_array_name_39_1;
parallel_ir_save_array_len_1_43 = SSAValue4.ARRAYSIZE(1);
parallel_ir_reduction_output_43 = 0.0;
for ( parfor_index_1_43 = 1; parfor_index_1_43 <= (int64_t)parallel_ir_save_array_len_1_43; parfor_index_1_43 += 1)
{
;
parallel_ir_array_temp_SSAValue32_45_1 = SSAValue4.ARRAYELEM(parfor_index_1_43);
parallel_ir_reduction_output_43 = (parallel_ir_reduction_output_43+parallel_ir_array_temp_SSAValue32_45_1);
}
;
SSAValue5 = parallel_ir_reduction_output_43;
SSAValue24 = log(SSAValue5);;
SSAValue25 = (SSAValue23) + (SSAValue24);
exps = (exps) + (SSAValue25);
}
;
__hpat_reduce_2 = 0;
MPI_Allreduce(&exps, &__hpat_reduce_2, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);;
exps = __hpat_reduce_2;
*ret0 = exps;
return;
}
extern "C" void _ppkernelscore_testp271_unaliased_(int run_where, int64_t n , double* __restrict ret0 , bool genMain = true)
{
if (genMain)
{
++main_count;
std::stringstream newMain;
std::stringstream newMainData;
std::stringstream newMainSh;
std::stringstream newMainExe;
newMain << "main" << main_count << ".cc";
newMainData << "main" << main_count << ".data";
newMainSh << "main" << main_count << ".sh";
newMainExe << "main" << main_count;
std::cout << "Main will be generated in file " << newMain.str() << std::endl;
std::cout << "Data for main will be in file " << newMainData.str() << std::endl;
std::cout << "Script to compile is in " << newMainSh.str() << std::endl;
std::ofstream mainFileData(newMainData.str(), std::ios::out | std::ios::binary);
mainFileData << run_where << std::endl;
mainFileData << n << std::endl;
mainFileData.close();
std::ofstream mainFile(newMain.str());
mainFile << "#include \"" << __FILE__ << "\"" << std::endl;
mainFile << "int main(int argc, char *argv[]) {" << std::endl;
mainFile << " MPI_Init(&argc, &argv);" << std::endl;
mainFile << " std::ifstream mainFileData(\"" << newMainData.str() << "\", std::ios::in | std::ios::binary);" << std::endl;
mainFile << " int runwhere;" << std::endl;
mainFile << " mainFileData >> runwhere;" << std::endl;
mainFile << " double ret0;" << std::endl;
mainFile << " int64_t n;" << std::endl;
mainFile << " mainFileData >> n;" << std::endl;
mainFile << " _ppkernelscore_testp271_unaliased_(runwhere, n, &ret0, false);" << std::endl;
mainFile << " MPI_Finalize();" << std::endl;
mainFile << " return 0;" << std::endl;
mainFile << "}" << std::endl;
mainFile.close();
std::ofstream mainFileSh(newMainSh.str());
mainFileSh << "#!/bin/sh" << std::endl;
mainFileSh << "mpiicpc -O3 -std=c++11 -I/usr/local/hdf5/include -g -fpic -o " << newMainExe.str() << " " << newMain.str() << " -lm " << std::endl;
mainFileSh.close();
}
ppkernelscore_testp271_unaliased(n, ret0);
}
extern "C" void _ppkernelscore_testp271_(int run_where, int64_t n , double* __restrict ret0 , bool genMain = true)
{
if (genMain)
{
++main_count;
std::stringstream newMain;
std::stringstream newMainData;
std::stringstream newMainSh;
std::stringstream newMainExe;
newMain << "main" << main_count << ".cc";
newMainData << "main" << main_count << ".data";
newMainSh << "main" << main_count << ".sh";
newMainExe << "main" << main_count;
std::cout << "Main will be generated in file " << newMain.str() << std::endl;
std::cout << "Data for main will be in file " << newMainData.str() << std::endl;
std::cout << "Script to compile is in " << newMainSh.str() << std::endl;
std::ofstream mainFileData(newMainData.str(), std::ios::out | std::ios::binary);
mainFileData << run_where << std::endl;
mainFileData << n << std::endl;
mainFileData.close();
std::ofstream mainFile(newMain.str());
mainFile << "#include \"" << __FILE__ << "\"" << std::endl;
mainFile << "int main(int argc, char *argv[]) {" << std::endl;
mainFile << " MPI_Init(&argc, &argv);" << std::endl;
mainFile << " std::ifstream mainFileData(\"" << newMainData.str() << "\", std::ios::in | std::ios::binary);" << std::endl;
mainFile << " int runwhere;" << std::endl;
mainFile << " mainFileData >> runwhere;" << std::endl;
mainFile << " double ret0;" << std::endl;
mainFile << " int64_t n;" << std::endl;
mainFile << " mainFileData >> n;" << std::endl;
mainFile << " _ppkernelscore_testp271_(runwhere, n, &ret0, false);" << std::endl;
mainFile << " MPI_Finalize();" << std::endl;
mainFile << " return 0;" << std::endl;
mainFile << "}" << std::endl;
mainFile.close();
std::ofstream mainFileSh(newMainSh.str());
mainFileSh << "#!/bin/sh" << std::endl;
mainFileSh << "mpiicpc -O3 -std=c++11 -I/usr/local/hdf5/include -g -fpic -o " << newMainExe.str() << " " << newMain.str() << " -lm " << std::endl;
mainFileSh.close();
}
ppkernelscore_testp271(n, ret0);
}
extern "C"
void *j2c_array_new(int key, void*data, unsigned ndim, int64_t *dims)
{
void *a = NULL;
switch(key)
{
default:
fprintf(stderr, "j2c_array_new called with invalid key %d", key);
assert(false);
break;
}
return a;
}
| 38.698745 | 153 | 0.768083 | [
"vector"
] |
c138ce3f9e68e125fecb4a8397697939f0f60fc0 | 3,647 | cc | C++ | runtime/exec_utils_test.cc | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | 20 | 2021-06-24T16:38:42.000Z | 2022-01-20T16:15:57.000Z | runtime/exec_utils_test.cc | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | null | null | null | runtime/exec_utils_test.cc | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | 4 | 2021-11-03T06:01:12.000Z | 2022-02-24T02:57:31.000Z | /*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "exec_utils.h"
#include "base/file_utils.h"
#include "base/memory_tool.h"
#include "common_runtime_test.h"
namespace art {
std::string PrettyArguments(const char* signature);
std::string PrettyReturnType(const char* signature);
class ExecUtilsTest : public CommonRuntimeTest {};
TEST_F(ExecUtilsTest, ExecSuccess) {
std::vector<std::string> command;
if (kIsTargetBuild) {
std::string android_root(GetAndroidRoot());
command.push_back(android_root + "/bin/id");
} else {
command.push_back("/usr/bin/id");
}
std::string error_msg;
// Historical note: Running on Valgrind failed due to some memory
// that leaks in thread alternate signal stacks.
EXPECT_TRUE(Exec(command, &error_msg));
EXPECT_EQ(0U, error_msg.size()) << error_msg;
}
TEST_F(ExecUtilsTest, ExecError) {
// This will lead to error messages in the log.
ScopedLogSeverity sls(LogSeverity::FATAL);
std::vector<std::string> command;
command.push_back("bogus");
std::string error_msg;
// Historical note: Running on Valgrind failed due to some memory
// that leaks in thread alternate signal stacks.
EXPECT_FALSE(Exec(command, &error_msg));
EXPECT_FALSE(error_msg.empty());
}
TEST_F(ExecUtilsTest, EnvSnapshotAdditionsAreNotVisible) {
static constexpr const char* kModifiedVariable = "EXEC_SHOULD_NOT_EXPORT_THIS";
static constexpr int kOverwrite = 1;
// Set an variable in the current environment.
EXPECT_EQ(setenv(kModifiedVariable, "NEVER", kOverwrite), 0);
// Test that it is not exported.
std::vector<std::string> command;
if (kIsTargetBuild) {
std::string android_root(GetAndroidRoot());
command.push_back(android_root + "/bin/printenv");
} else {
command.push_back("/usr/bin/printenv");
}
command.push_back(kModifiedVariable);
std::string error_msg;
// Historical note: Running on Valgrind failed due to some memory
// that leaks in thread alternate signal stacks.
EXPECT_FALSE(Exec(command, &error_msg));
EXPECT_NE(0U, error_msg.size()) << error_msg;
}
TEST_F(ExecUtilsTest, EnvSnapshotDeletionsAreNotVisible) {
static constexpr const char* kDeletedVariable = "PATH";
static constexpr int kOverwrite = 1;
// Save the variable's value.
const char* save_value = getenv(kDeletedVariable);
EXPECT_NE(save_value, nullptr);
// Delete the variable.
EXPECT_EQ(unsetenv(kDeletedVariable), 0);
// Test that it is not exported.
std::vector<std::string> command;
if (kIsTargetBuild) {
std::string android_root(GetAndroidRoot());
command.push_back(android_root + "/bin/printenv");
} else {
command.push_back("/usr/bin/printenv");
}
command.push_back(kDeletedVariable);
std::string error_msg;
// Historical note: Running on Valgrind failed due to some memory
// that leaks in thread alternate signal stacks.
EXPECT_TRUE(Exec(command, &error_msg));
EXPECT_EQ(0U, error_msg.size()) << error_msg;
// Restore the variable's value.
EXPECT_EQ(setenv(kDeletedVariable, save_value, kOverwrite), 0);
}
} // namespace art
| 34.40566 | 81 | 0.733205 | [
"vector"
] |
c13ed01de63ac52be7c31bb2eb0b85b86a7e7cdc | 2,694 | cpp | C++ | src/Module/Extractor/RSC/Extractor_RSC.cpp | FredrikBlomgren/aff3ct | fa616bd923b2dcf03a4cf119cceca51cf810d483 | [
"MIT"
] | 315 | 2016-06-21T13:32:14.000Z | 2022-03-28T09:33:59.000Z | src/Module/Extractor/RSC/Extractor_RSC.cpp | a-panella/aff3ct | 61509eb756ae3725b8a67c2d26a5af5ba95186fb | [
"MIT"
] | 153 | 2017-01-17T03:51:06.000Z | 2022-03-24T15:39:26.000Z | src/Module/Extractor/RSC/Extractor_RSC.cpp | a-panella/aff3ct | 61509eb756ae3725b8a67c2d26a5af5ba95186fb | [
"MIT"
] | 119 | 2017-01-04T14:31:58.000Z | 2022-03-21T08:34:16.000Z | #include <algorithm>
#include <memory>
#include "Module/Extractor/RSC/Extractor_RSC.hpp"
using namespace aff3ct;
using namespace aff3ct::module;
template <typename B, typename Q>
Extractor_RSC<B,Q>
::Extractor_RSC(const int K, const int N, const int tail_length, const bool buffered_encoding)
: Extractor<B,Q>(K, N, tail_length),
buffered_encoding(buffered_encoding), info_bits_pos(K, 0)
{
const std::string name = "Extractor_RSC";
this->set_name(name);
}
template <typename B, typename Q>
Extractor_RSC<B,Q>* Extractor_RSC<B,Q>
::clone() const
{
auto m = new Extractor_RSC(*this);
m->deep_copy(*this);
return m;
}
template <typename B, typename Q>
void Extractor_RSC<B,Q>
::_get_sys_and_par_llr(const Q* Y_N, Q* sys, Q* par, const size_t frame_id)
{
const auto tb_2 = this->tail_length / 2;
const auto K = this->K;
const auto N = this->N;
if (buffered_encoding)
{
std::copy(Y_N, Y_N + K + tb_2, sys);
std::copy(Y_N + K + tb_2, Y_N + N, par);
}
else
{
for (auto i = 0; i < K + tb_2; i++)
{
sys[i] = Y_N[i*2 +0];
par[i] = Y_N[i*2 +1];
}
}
}
template <typename B, typename Q>
void Extractor_RSC<B,Q>
::_get_sys_llr(const Q* Y_N, Q* sys, const size_t frame_id)
{
if (buffered_encoding)
std::copy(Y_N, Y_N + this->K, sys);
else
for (auto i = 0; i < this->K; i++)
sys[i] = Y_N[i*2];
}
template <typename B, typename Q>
void Extractor_RSC<B,Q>
::_add_sys_and_ext_llr(const Q* ext, Q* Y_N, const size_t frame_id)
{
if (buffered_encoding)
for (auto i = 0; i < this->K; i++)
Y_N[i] += ext[i];
else
for (auto i = 0; i < this->K; i++)
Y_N[i*2] += ext[i];
}
template <typename B, typename Q>
void Extractor_RSC<B,Q>
::_get_sys_bit(const Q *Y_N, B *V_K, const size_t frame_id)
{
if (buffered_encoding)
for (auto i = 0; i < this->K; i++)
V_K[i] = Y_N[i] >= 0 ? (B)0 : (B)1;
else
for (auto i = 0; i < this->K; i++)
V_K[i] = Y_N[2*i] >= 0 ? (B)0 : (B)1;
}
template <typename B, typename Q>
const std::vector<uint32_t>& Extractor_RSC<B,Q>
::get_info_bits_pos()
{
throw tools::unimplemented_error(__FILE__, __LINE__, __func__);
}
// ==================================================================================== explicit template instantiation
#include "Tools/types.h"
#ifdef AFF3CT_MULTI_PREC
template class aff3ct::module::Extractor_RSC<B_8,Q_8>;
template class aff3ct::module::Extractor_RSC<B_16,Q_16>;
template class aff3ct::module::Extractor_RSC<B_32,Q_32>;
template class aff3ct::module::Extractor_RSC<B_64,Q_64>;
#else
template class aff3ct::module::Extractor_RSC<B,Q>;
#endif
// ==================================================================================== explicit template instantiation
| 25.657143 | 119 | 0.626206 | [
"vector"
] |
c142bbc25642ad26767ef9af72fa67ddc10fc7ad | 836 | cpp | C++ | codechef/nov 10/august challenge/problem difficulties.cpp | punnapavankumar9/coding-platforms | 264803330f5b3857160ec809c0d79cba1aa479a3 | [
"MIT"
] | null | null | null | codechef/nov 10/august challenge/problem difficulties.cpp | punnapavankumar9/coding-platforms | 264803330f5b3857160ec809c0d79cba1aa479a3 | [
"MIT"
] | null | null | null | codechef/nov 10/august challenge/problem difficulties.cpp | punnapavankumar9/coding-platforms | 264803330f5b3857160ec809c0d79cba1aa479a3 | [
"MIT"
] | null | null | null | #include <iostream>
#include <bits/stdc++.h>
#define endl "\n"
typedef long long ll;
typedef unsigned long long ull;
const int mod = 1e9 + 7;
using namespace std;
int main(){
cin.tie(0)->sync_with_stdio(false);cout.tie(0);
int t;
cin >> t;
while(t--){
vector<int> arr(11, 0);
for(int i = 0 ;i < 4; i++){
int x;cin >> x;
arr[x]++;
}
int diff = 0;
int same = 0;
for(int i = 0;i < 11; i++){
if(arr[i]) diff++;
same = max(same, arr[i]);
}
if(diff == 1){
cout << "0\n";
}else if(diff == 2){
if(same == 2){
cout << "2\n";
}else{
cout << "1\n";
}
}else{
cout << "2\n";
}
}
return 0;
} | 20.9 | 51 | 0.392344 | [
"vector"
] |
c147bb32b1c94a798731fd57390d4af4d23a6ef8 | 6,818 | hpp | C++ | src/ds_emitter.hpp | calvinmetcalf/node-mapnik | 3d26f2089dee3cfc901965f6646d50004a0e0e56 | [
"BSD-3-Clause"
] | null | null | null | src/ds_emitter.hpp | calvinmetcalf/node-mapnik | 3d26f2089dee3cfc901965f6646d50004a0e0e56 | [
"BSD-3-Clause"
] | null | null | null | src/ds_emitter.hpp | calvinmetcalf/node-mapnik | 3d26f2089dee3cfc901965f6646d50004a0e0e56 | [
"BSD-3-Clause"
] | null | null | null | #ifndef __NODE_MAPNIK_DS_EMITTER_H__
#define __NODE_MAPNIK_DS_EMITTER_H__
// v8
#include <v8.h>
#include "utils.hpp"
// mapnik
#include <mapnik/attribute_descriptor.hpp> // for attribute_descriptor, etc
#include <mapnik/datasource.hpp> // for datasource, etc
#include <mapnik/feature.hpp> // for feature_impl::iterator, etc
#include <mapnik/feature_layer_desc.hpp> // for layer_descriptor
#include <mapnik/query.hpp> // for query
#include <mapnik/value.hpp> // for value_base, value
#include <mapnik/version.hpp> // for MAPNIK_VERSION
using namespace v8;
namespace node_mapnik {
static void describe_datasource(Local<Object> description, mapnik::datasource_ptr ds)
{
try
{
// type
if (ds->type() == mapnik::datasource::Raster)
{
description->Set(String::NewSymbol("type"), String::New("raster"));
}
else
{
description->Set(String::NewSymbol("type"), String::New("vector"));
}
mapnik::layer_descriptor ld = ds->get_descriptor();
// encoding
description->Set(String::NewSymbol("encoding"), String::New(ld.get_encoding().c_str()));
// field names and types
Local<Object> fields = Object::New();
std::vector<mapnik::attribute_descriptor> const& desc = ld.get_descriptors();
std::vector<mapnik::attribute_descriptor>::const_iterator itr = desc.begin();
std::vector<mapnik::attribute_descriptor>::const_iterator end = desc.end();
while (itr != end)
{
unsigned field_type = itr->get_type();
std::string type("");
if (field_type == mapnik::Integer) type = "Number";
else if (field_type == mapnik::Float) type = "Number";
else if (field_type == mapnik::Double) type = "Number";
else if (field_type == mapnik::String) type = "String";
else if (field_type == mapnik::Boolean) type = "Boolean";
else if (field_type == mapnik::Geometry) type = "Geometry";
else if (field_type == mapnik::Object) type = "Object";
else type = "Unknown";
fields->Set(String::NewSymbol(itr->get_name().c_str()),String::New(type.c_str()));
++itr;
}
description->Set(String::NewSymbol("fields"), fields);
Local<String> js_type = String::New("unknown");
if (ds->type() == mapnik::datasource::Raster)
{
js_type = String::New("raster");
}
else
{
#if MAPNIK_VERSION >= 200100
boost::optional<mapnik::datasource::geometry_t> geom_type = ds->get_geometry_type();
if (geom_type)
{
mapnik::datasource::geometry_t g_type = *geom_type;
switch (g_type)
{
case mapnik::datasource::Point:
{
js_type = String::New("point");
break;
}
case mapnik::datasource::LineString:
{
js_type = String::New("linestring");
break;
}
case mapnik::datasource::Polygon:
{
js_type = String::New("polygon");
break;
}
case mapnik::datasource::Collection:
{
js_type = String::New("collection");
break;
}
default:
{
break;
}
}
}
#endif
}
description->Set(String::NewSymbol("geometry_type"), js_type);
}
catch (std::exception const& ex)
{
ThrowException(Exception::Error(
String::New(ex.what())));
}
catch (...)
{
ThrowException(Exception::Error(
String::New("unknown exception happened when calling describe_datasource, please file bug")));
}
}
static void datasource_features(Local<Array> a, mapnik::datasource_ptr ds, unsigned first, unsigned last)
{
try
{
mapnik::query q(ds->envelope());
mapnik::layer_descriptor ld = ds->get_descriptor();
std::vector<mapnik::attribute_descriptor> const& desc = ld.get_descriptors();
std::vector<mapnik::attribute_descriptor>::const_iterator itr = desc.begin();
std::vector<mapnik::attribute_descriptor>::const_iterator end = desc.end();
while (itr != end)
{
q.add_property_name(itr->get_name());
++itr;
}
mapnik::featureset_ptr fs = ds->features(q);
if (fs)
{
mapnik::feature_ptr fp;
unsigned idx = 0;
while ((fp = fs->next()))
{
if ((idx >= first) && (idx <= last || last == 0)) {
Local<Object> feat = Object::New();
#if MAPNIK_VERSION >= 200100
mapnik::feature_impl::iterator f_itr = fp->begin();
mapnik::feature_impl::iterator f_end = fp->end();
for ( ;f_itr!=f_end; ++f_itr)
{
node_mapnik::params_to_object serializer( feat , boost::get<0>(*f_itr));
// need to call base() since this is a mapnik::value
// not a mapnik::value_holder
boost::apply_visitor( serializer, boost::get<1>(*f_itr).base() );
}
#else
std::map<std::string,mapnik::value> const& fprops = fp->props();
std::map<std::string,mapnik::value>::const_iterator it = fprops.begin();
std::map<std::string,mapnik::value>::const_iterator end = fprops.end();
for (; it != end; ++it)
{
node_mapnik::params_to_object serializer( feat , it->first);
// need to call base() since this is a mapnik::value
// not a mapnik::value_holder
boost::apply_visitor( serializer, it->second.base() );
}
#endif
// add feature id
feat->Set(String::NewSymbol("__id__"), Number::New(fp->id()));
a->Set(idx, feat);
}
++idx;
}
}
}
catch (std::exception const& ex)
{
ThrowException(Exception::Error(
String::New(ex.what())));
}
catch (...)
{
ThrowException(Exception::Error(
String::New("unknown exception happened when calling datasource_features, please file bug")));
}
}
}
#endif
| 35.510417 | 121 | 0.51188 | [
"geometry",
"object",
"vector"
] |
c14aff218da1794a3a4962b9466858e0edee00d0 | 52,865 | cpp | C++ | Engine/Source/Editor/Kismet/Private/Tests/BlueprintEditorTests.cpp | windystrife/UnrealEngine_NVIDIAGameWork | b50e6338a7c5b26374d66306ebc7807541ff815e | [
"MIT"
] | 1 | 2022-01-29T18:36:12.000Z | 2022-01-29T18:36:12.000Z | Engine/Source/Editor/Kismet/Private/Tests/BlueprintEditorTests.cpp | windystrife/UnrealEngine_NVIDIAGameWork | b50e6338a7c5b26374d66306ebc7807541ff815e | [
"MIT"
] | null | null | null | Engine/Source/Editor/Kismet/Private/Tests/BlueprintEditorTests.cpp | windystrife/UnrealEngine_NVIDIAGameWork | b50e6338a7c5b26374d66306ebc7807541ff815e | [
"MIT"
] | null | null | null | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "HAL/FileManager.h"
#include "Misc/Paths.h"
#include "Misc/AutomationTest.h"
#include "Modules/ModuleManager.h"
#include "UObject/Class.h"
#include "UObject/Package.h"
#include "Misc/PackageName.h"
#include "Framework/Commands/InputChord.h"
#include "Templates/SubclassOf.h"
#include "EdGraph/EdGraphPin.h"
#include "Components/ActorComponent.h"
#include "GameFramework/Actor.h"
#include "Engine/Blueprint.h"
#include "Components/StaticMeshComponent.h"
#include "EdGraph/EdGraph.h"
#include "Factories/BlueprintFactory.h"
#include "Particles/ParticleSystem.h"
#include "Engine/StaticMesh.h"
#include "Kismet/KismetSystemLibrary.h"
#include "Engine/BlueprintGeneratedClass.h"
#include "AssetData.h"
#include "Editor.h"
#include "Toolkits/AssetEditorManager.h"
#include "Kismet2/KismetEditorUtilities.h"
#include "EdGraphSchema_K2.h"
#include "EdGraphSchema_K2_Actions.h"
#include "K2Node_Event.h"
#include "K2Node_CallFunction.h"
#include "K2Node_AddComponent.h"
#include "K2Node_CustomEvent.h"
#include "K2Node_FunctionEntry.h"
#include "K2Node_VariableGet.h"
#include "K2Node_VariableSet.h"
#include "Engine/SCS_Node.h"
#include "BlueprintEditorModes.h"
#include "Kismet2/BlueprintEditorUtils.h"
#include "ComponentAssetBroker.h"
#include "ARFilter.h"
#include "ScopedTransaction.h"
#include "ObjectTools.h"
// Automation
#include "AssetRegistryModule.h"
#include "Tests/AutomationTestSettings.h"
#include "Tests/AutomationEditorCommon.h"
#include "Tests/AutomationEditorPromotionCommon.h"
#if WITH_DEV_AUTOMATION_TESTS
#define LOCTEXT_NAMESPACE "BlueprintEditorPromotionTests"
DEFINE_LOG_CATEGORY_STATIC(LogBlueprintEditorPromotionTests, Log, All);
IMPLEMENT_SIMPLE_AUTOMATION_TEST(FBlueprintEditorPromotionTest, "System.Promotion.Editor.Blueprint Editor", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter);
/**
* Helper functions used by the blueprint editor promotion automation test
*/
namespace BlueprintEditorPromotionUtils
{
/**
* Constants
*/
static const FString BlueprintNameString = TEXT("BlueprintEditorPromotionBlueprint");
static const FName BlueprintStringVariableName(TEXT("MyStringVariable"));
/**
* Gets the full path to the folder on disk
*/
static FString GetFullPath()
{
return FPackageName::FilenameToLongPackageName(FPaths::ProjectContentDir() + TEXT("BlueprintEditorPromotionTest"));
}
/**
* Helper class to track once a certain time has passed
*/
class FDelayHelper
{
public:
/**
* Constructor
*/
FDelayHelper() :
bIsRunning(false),
StartTime(0.f),
Duration(0.f)
{
}
/**
* Returns if the delay is still running
*/
bool IsRunning()
{
return bIsRunning;
}
/**
* Sets the helper state to not running
*/
void Reset()
{
bIsRunning = false;
}
/**
* Starts the delay timer
*
* @param InDuration - How long to delay for in seconds
*/
void Start(double InDuration)
{
bIsRunning = true;
StartTime = FPlatformTime::Seconds();
Duration = InDuration;
}
/**
* Returns true if the desired amount of time has passed
*/
bool IsComplete()
{
if (IsRunning())
{
const double CurrentTime = FPlatformTime::Seconds();
return CurrentTime - StartTime >= Duration;
}
else
{
return false;
}
}
private:
/** If true, this delay timer is active */
bool bIsRunning;
/** The time the delay started */
double StartTime;
/** How long the timer is for */
double Duration;
};
/**
* Sends the AssetEditor->SaveAsset UI command
*/
static void SendBlueprintResetViewCommand()
{
const FString Context = TEXT("BlueprintEditor");
const FString Command = TEXT("ResetCamera");
FInputChord CurrentSaveChord = FEditorPromotionTestUtilities::GetOrSetUICommand(Context, Command);
const FName FocusWidgetType(TEXT("SSCSEditorViewport"));
FEditorPromotionTestUtilities::SendCommandToCurrentEditor(CurrentSaveChord, FocusWidgetType);
}
/**
* Compiles the blueprint
*
* @param InBlueprint - The blueprint to compile
*/
static void CompileBlueprint(UBlueprint* InBlueprint)
{
FBlueprintEditorUtils::RefreshAllNodes(InBlueprint);
FKismetEditorUtilities::CompileBlueprint(InBlueprint, EBlueprintCompileOptions::SkipGarbageCollection);
if (InBlueprint->Status == EBlueprintStatus::BS_UpToDate)
{
UE_LOG(LogBlueprintEditorPromotionTests, Display, TEXT("Blueprint compiled successfully (%s)"), *InBlueprint->GetName());
}
else if (InBlueprint->Status == EBlueprintStatus::BS_UpToDateWithWarnings)
{
UE_LOG(LogBlueprintEditorPromotionTests, Display, TEXT("Blueprint compiled successfully with warnings(%s)"), *InBlueprint->GetName());
}
else if (InBlueprint->Status == EBlueprintStatus::BS_Error)
{
UE_LOG(LogBlueprintEditorPromotionTests, Display, TEXT("Blueprint failed to compile (%s)"), *InBlueprint->GetName());
}
else
{
UE_LOG(LogBlueprintEditorPromotionTests, Error, TEXT("Blueprint is in an unexpected state after compiling (%s)"), *InBlueprint->GetName());
}
}
/**
* Creates a blueprint component based off the supplied asset
*
* @param InBlueprint - The blueprint to modify
* @param InAsset - The asset to use for the component
*/
static USCS_Node* CreateBlueprintComponent(UBlueprint* InBlueprint, UObject* InAsset)
{
IAssetEditorInstance* OpenEditor = FAssetEditorManager::Get().FindEditorForAsset(InBlueprint, true);
FBlueprintEditor* CurrentBlueprintEditor = (FBlueprintEditor*)OpenEditor;
TSubclassOf<UActorComponent> ComponentClass = FComponentAssetBrokerage::GetPrimaryComponentForAsset(InAsset->GetClass());
USCS_Node* NewNode = InBlueprint->SimpleConstructionScript->CreateNode(ComponentClass);
// Assign the asset to the template
FComponentAssetBrokerage::AssignAssetToComponent(NewNode->ComponentTemplate, InAsset);
// Add node to the SCS
TArray<USCS_Node*> AllNodes = InBlueprint->SimpleConstructionScript->GetAllNodes();
USCS_Node* RootNode = AllNodes.Num() > 0 ? AllNodes[0] : NULL;
if (!RootNode || (RootNode == InBlueprint->SimpleConstructionScript->GetDefaultSceneRootNode()))
{
//New Root
InBlueprint->SimpleConstructionScript->AddNode(NewNode);
}
else
{
//Add as a child
RootNode->AddChildNode(NewNode);
}
// Recompile skeleton because of the new component we added
FKismetEditorUtilities::GenerateBlueprintSkeleton(InBlueprint, true);
CurrentBlueprintEditor->UpdateSCSPreview(true);
return NewNode;
}
/**
* Sets a new component as the root
*
* @param InBlueprint - The blueprint to modify
* @param NewRoot - The new root
*/
static void SetComponentAsRoot(UBlueprint* InBlueprint, USCS_Node* NewRoot)
{
// @FIXME: Current usages doesn't guarantee NewRoot is valid!!! Check first!
//Get all the construction script nodes
TArray<USCS_Node*> AllNodes = InBlueprint->SimpleConstructionScript->GetAllNodes();
USCS_Node* OldRootNode = AllNodes[0];
USCS_Node* OldParent = NULL;
//Find old parent
for (int32 NodeIndex = 0; NodeIndex < AllNodes.Num(); ++NodeIndex)
{
if (AllNodes[NodeIndex]->ChildNodes.Contains(NewRoot))
{
OldParent = AllNodes[NodeIndex];
break;
}
}
check(OldParent);
//Remove the new root from its old parent and
OldParent->ChildNodes.Remove(NewRoot);
NewRoot->Modify();
NewRoot->AttachToName = NAME_None;
//Remove the old root, add the new root, and attach the old root as a child
InBlueprint->SimpleConstructionScript->RemoveNode(OldRootNode);
InBlueprint->SimpleConstructionScript->AddNode(NewRoot);
NewRoot->AddChildNode(OldRootNode);
}
/**
* Removes a blueprint component from the simple construction script
*
* @param InBlueprint - The blueprint to modify
* @param InNode - The node of the component to remove
*/
static void RemoveBlueprintComponent(UBlueprint* InBlueprint, USCS_Node* InNode)
{
if (InNode != NULL)
{
// Remove node from SCS tree
InNode->GetSCS()->RemoveNodeAndPromoteChildren(InNode);
// Clear the delegate
InNode->SetOnNameChanged(FSCSNodeNameChanged());
}
}
/**
* Creates a new graph node from a given template
*
* @param NodeTemplate - The template to use for the node
* @param InGraph - The graph to create the new node in
* @param GraphLocation - The location to place the node
* @param ConnectPin - The pin to connect the node to
*/
static UEdGraphNode* CreateNewGraphNodeFromTemplate(UK2Node* NodeTemplate, UEdGraph* InGraph, const FVector2D& GraphLocation, UEdGraphPin* ConnectPin = NULL)
{
TSharedPtr<FEdGraphSchemaAction_K2NewNode> Action = TSharedPtr<FEdGraphSchemaAction_K2NewNode>(new FEdGraphSchemaAction_K2NewNode(FText::GetEmpty(), FText::GetEmpty(), FText::GetEmpty(), 0));
Action->NodeTemplate = NodeTemplate;
return Action->PerformAction(InGraph, ConnectPin, GraphLocation, false);
}
/**
* Creates an AddComponent action to the blueprint graph
*
* @param InBlueprint - The blueprint to modify
* @param InGraph - The blueprint graph to use
* @param InAsset - The asset to use
*/
static UEdGraphNode* CreateAddComponentActionNode(UBlueprint* InBlueprint, UEdGraph* InGraph, UObject* InAsset)
{
UEdGraph* TempOuter = NewObject<UEdGraph>((UObject*)InBlueprint);
TempOuter->SetFlags(RF_Transient);
const FScopedTransaction PropertyChanged(LOCTEXT("AddedGraphNode", "Added a graph node"));
InGraph->Modify();
// Make an add component node
UK2Node_CallFunction* CallFuncNode = NewObject<UK2Node_AddComponent>(TempOuter);
UFunction* AddComponentFn = FindFieldChecked<UFunction>(AActor::StaticClass(), UK2Node_AddComponent::GetAddComponentFunctionName());
CallFuncNode->FunctionReference.SetFromField<UFunction>(AddComponentFn, FBlueprintEditorUtils::IsActorBased(InBlueprint));
UEdGraphNode* NewNode = CreateNewGraphNodeFromTemplate(CallFuncNode, InGraph, FVector2D(200, 0));
TSubclassOf<UActorComponent> ComponentClass = InAsset ? FComponentAssetBrokerage::GetPrimaryComponentForAsset(InAsset->GetClass()) : NULL;
if ((NewNode != NULL) && (InBlueprint != NULL))
{
UK2Node_AddComponent* AddCompNode = CastChecked<UK2Node_AddComponent>(NewNode);
ensure(NULL != Cast<UBlueprintGeneratedClass>(InBlueprint->GeneratedClass));
// Then create a new template object, and add to array in
UActorComponent* NewTemplate = NewObject<UActorComponent>(InBlueprint->GeneratedClass, ComponentClass, NAME_None, RF_ArchetypeObject | RF_Public);
InBlueprint->ComponentTemplates.Add(NewTemplate);
// Set the name of the template as the default for the TemplateName param
UEdGraphPin* TemplateNamePin = AddCompNode->GetTemplateNamePinChecked();
if (TemplateNamePin)
{
TemplateNamePin->DefaultValue = NewTemplate->GetName();
}
// Set the return type to be the type of the template
UEdGraphPin* ReturnPin = AddCompNode->GetReturnValuePin();
if (ReturnPin)
{
ReturnPin->PinType.PinSubCategoryObject = *ComponentClass;
}
// Set the asset
if (InAsset != NULL)
{
FComponentAssetBrokerage::AssignAssetToComponent(NewTemplate, InAsset);
}
AddCompNode->ReconstructNode();
}
FBlueprintEditorUtils::MarkBlueprintAsModified(InBlueprint);
return NewNode;
}
/**
* Creates a SetStaticMesh action in the blueprint graph
*
* @param InBlueprint - The blueprint to modify
* @param InGraph - The blueprint graph to use
*/
static UEdGraphNode* AddSetStaticMeshNode(UBlueprint* InBlueprint, UEdGraph* InGraph)
{
UEdGraph* TempOuter = NewObject<UEdGraph>((UObject*)InBlueprint);
TempOuter->SetFlags(RF_Transient);
// Make a call function template
UK2Node_CallFunction* CallFuncNode = NewObject<UK2Node_CallFunction>(TempOuter);
static FName PrintStringFunctionName(TEXT("SetStaticMesh"));
UFunction* DelayFn = FindFieldChecked<UFunction>(UStaticMeshComponent::StaticClass(), PrintStringFunctionName);
CallFuncNode->FunctionReference.SetFromField<UFunction>(DelayFn, false);
return CreateNewGraphNodeFromTemplate(CallFuncNode, InGraph, FVector2D(850, 0));
}
/**
* Connects two nodes using the supplied pin names
*
* @param NodeA - The first node to connect
* @param PinAName - The name of the pin on the first node
* @param NodeB - The second node to connect
* @param PinBName - The name of the pin on the second node
*/
static void ConnectGraphNodes(UEdGraphNode* NodeA, const FString& PinAName, UEdGraphNode* NodeB, const FString& PinBName)
{
const FScopedTransaction PropertyChanged(LOCTEXT("ConnectedNode", "Connected graph nodes"));
NodeA->GetGraph()->Modify();
UEdGraphPin* PinA = NodeA->FindPin(PinAName);
UEdGraphPin* PinB = NodeB->FindPin(PinBName);
if (PinA && PinB)
{
PinA->MakeLinkTo(PinB);
}
else
{
UE_LOG(LogBlueprintEditorPromotionTests, Error, TEXT("Could not connect pins %s and %s "), *PinAName, *PinBName);
}
}
/**
* Promotes a pin to a variable
*
* @param InBlueprint - The blueprint to modify
* @param Node - The node that owns the pin
* @param PinName - The name of the pin to promote
*/
static void PromotePinToVariable(UBlueprint* InBlueprint, UEdGraphNode* Node, const FString& PinName)
{
IAssetEditorInstance* OpenEditor = FAssetEditorManager::Get().FindEditorForAsset(InBlueprint, true);
FBlueprintEditor* CurrentBlueprintEditor = (FBlueprintEditor*)OpenEditor;
UEdGraphPin* PinToPromote = Node->FindPin(PinName);
CurrentBlueprintEditor->DoPromoteToVariable(InBlueprint, PinToPromote, true);
}
/**
* Creates a ReceiveBeginPlay event node
*
* @param InBlueprint - The blueprint to modify
* @param InGraph - The graph to use for the new node
*/
static UEdGraphNode* CreatePostBeginPlayEvent(UBlueprint* InBlueprint, UEdGraph* InGraph)
{
UEdGraph* TempOuter = NewObject<UEdGraph>((UObject*)InBlueprint);
TempOuter->SetFlags(RF_Transient);
// Make an add component node
UK2Node_Event* NewEventNode = NewObject<UK2Node_Event>(TempOuter);
NewEventNode->EventReference.SetExternalMember(FName(TEXT("ReceiveBeginPlay")), AActor::StaticClass());
NewEventNode->bOverrideFunction = true;
//Check for existing events
UK2Node_Event* ExistingEvent = FBlueprintEditorUtils::FindOverrideForFunction(InBlueprint, NewEventNode->EventReference.GetMemberParentClass(NewEventNode->GetBlueprintClassFromNode()), NewEventNode->EventReference.GetMemberName());
if (!ExistingEvent)
{
return CreateNewGraphNodeFromTemplate(NewEventNode, InGraph, FVector2D(200, 0));
}
return ExistingEvent;
}
/**
* Creates a custom event node
*
* @param InBlueprint - The blueprint to modify
* @param InGraph - The graph to use for the new node
* @param EventName - The name of the event
*/
static UEdGraphNode* CreateCustomEvent(UBlueprint* InBlueprint, UEdGraph* InGraph, const FString& EventName)
{
UEdGraph* TempOuter = NewObject<UEdGraph>((UObject*)InBlueprint);
TempOuter->SetFlags(RF_Transient);
// Make an add component node
UK2Node_CustomEvent* NewEventNode = NewObject<UK2Node_CustomEvent>(TempOuter);
NewEventNode->CustomFunctionName = "EventName";
return CreateNewGraphNodeFromTemplate(NewEventNode, InGraph, FVector2D(1200, 0));
}
/**
* Creates a node template for a UKismetSystemLibrary function
*
* @param NodeOuter - The outer to use for the template
* @param InGraph - The function to use for the node
*/
static UK2Node* CreateKismetFunctionTemplate(UObject* NodeOuter, const FName& FunctionName)
{
// Make a call function template
UK2Node_CallFunction* CallFuncNode = NewObject<UK2Node_CallFunction>(NodeOuter);
UFunction* Function = FindFieldChecked<UFunction>(UKismetSystemLibrary::StaticClass(), FunctionName);
CallFuncNode->FunctionReference.SetFromField<UFunction>(Function, false);
return CallFuncNode;
}
/**
* Creates a delay node
*
* @param InBlueprint - The blueprint to modify
* @param InGraph - The graph to use for the new node
* @param ConnectPin - The pin to connect the new node to
*/
static UEdGraphNode* AddDelayNode(UBlueprint* InBlueprint, UEdGraph* InGraph, UEdGraphPin* ConnectPin = NULL)
{
UEdGraph* TempOuter = NewObject<UEdGraph>((UObject*)InBlueprint);
TempOuter->SetFlags(RF_Transient);
const FScopedTransaction PropertyChanged(LOCTEXT("AddedGraphNode", "Added a graph node"));
InGraph->Modify();
// Make a call function template
static FName DelayFunctionName(TEXT("Delay"));
UK2Node* CallFuncNode = CreateKismetFunctionTemplate(TempOuter, DelayFunctionName);
//Create the node
return CreateNewGraphNodeFromTemplate(CallFuncNode, InGraph, FVector2D(400, 0), ConnectPin);
}
/**
* Creates a PrintString node
*
* @param InBlueprint - The blueprint to modify
* @param InGraph - The graph to use for the new node
* @param ConnectPin - The pin to connect the new node to
*/
static UEdGraphNode* AddPrintStringNode(UBlueprint* InBlueprint, UEdGraph* InGraph, UEdGraphPin* ConnectPin = NULL)
{
UEdGraph* TempOuter = NewObject<UEdGraph>((UObject*)InBlueprint);
TempOuter->SetFlags(RF_Transient);
// Make a call function template
static FName PrintStringFunctionName(TEXT("PrintString"));
UK2Node* CallFuncNode = CreateKismetFunctionTemplate(TempOuter, PrintStringFunctionName);
return CreateNewGraphNodeFromTemplate(CallFuncNode, InGraph, FVector2D(680, 0), ConnectPin);
}
/**
* Creates a call function node
*
* @param InBlueprint - The blueprint to modify
* @param InGraph - The graph to use for the new node
* @param FunctionName - The name of the function to call
* @param ConnectPin - The pin to connect the new node to
*/
static UEdGraphNode* AddCallFunctionGraphNode(UBlueprint* InBlueprint, UEdGraph* InGraph, const FName& FunctionName, UEdGraphPin* ConnectPin = NULL)
{
UEdGraph* TempOuter = NewObject<UEdGraph>((UObject*)InBlueprint);
TempOuter->SetFlags(RF_Transient);
// Make a call function template
UK2Node_CallFunction* CallFuncNode = NewObject<UK2Node_CallFunction>(TempOuter);
CallFuncNode->FunctionReference.SetSelfMember(FunctionName);
return CreateNewGraphNodeFromTemplate(CallFuncNode, InGraph, FVector2D(1200, 0), ConnectPin);
}
/**
* Creates Get or Set node
*
* @param InBlueprint - The blueprint to modify
* @param InGraph - The graph to use for the new node
* @param VarName - The name of the variable to use
* @param bGet - If true, create a Get node. If false, create a Set node.
* @param XOffset - How far to offset the node in the graph
*/
static UEdGraphNode* AddGetSetNode(UBlueprint* InBlueprint, UEdGraph* InGraph, const FString& VarName, bool bGet, float XOffset = 0.f)
{
const FScopedTransaction PropertyChanged(LOCTEXT("AddedGraphNode", "Added a graph node"));
InGraph->Modify();
FEdGraphSchemaAction_K2NewNode NodeInfo;
// Create get or set node, depending on whether we clicked on an input or output pin
UK2Node_Variable* TemplateNode = NULL;
if (bGet)
{
TemplateNode = NewObject<UK2Node_VariableGet>();
}
else
{
TemplateNode = NewObject<UK2Node_VariableSet>();
}
TemplateNode->VariableReference.SetSelfMember(FName(*VarName));
NodeInfo.NodeTemplate = TemplateNode;
return NodeInfo.PerformAction(InGraph, NULL, FVector2D(XOffset, 130), true);
}
/**
* Sets the default value for a pin
*
* @param Node - The node that owns the pin to set
* @param PinName - The name of the pin
* @param PinValue - The new default value
*/
static void SetPinDefaultValue(UEdGraphNode* Node, const FString& PinName, const FString& PinValue)
{
UEdGraphPin* Pin = Node->FindPin(PinName);
Pin->DefaultValue = PinValue;
}
/**
* Sets the default object for a pin
*
* @param Node - The node that owns the pin to set
* @param PinName - The name of the pin
* @param PinObject - The new default object
*/
static void SetPinDefaultObject(UEdGraphNode* Node, const FString& PinName, UObject* PinObject)
{
UEdGraphPin* Pin = Node->FindPin(PinName);
Pin->DefaultObject = PinObject;
}
/**
* Adds a string member variable to a blueprint
*
* @param InBlueprint - The blueprint to modify
* @param VariableName - The name of the new string variable
*/
static void AddStringMemberValue(UBlueprint* InBlueprint, const FName& VariableName)
{
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
FEdGraphPinType StringPinType(K2Schema->PC_String, FString(), nullptr, EPinContainerType::None, false, FEdGraphTerminalType());
FBlueprintEditorUtils::AddMemberVariable(InBlueprint, VariableName, StringPinType);
}
/**
* Creates a new function graph
*
* @param InBlueprint - The blueprint to modify
* @param FunctionName - The function name to use for the new graph
*/
static UEdGraph* CreateNewFunctionGraph(UBlueprint* InBlueprint, const FName& FunctionName)
{
UEdGraph* NewGraph = FBlueprintEditorUtils::CreateNewGraph(InBlueprint, FunctionName, UEdGraph::StaticClass(), UEdGraphSchema_K2::StaticClass());
FBlueprintEditorUtils::AddFunctionGraph<UClass>(InBlueprint, NewGraph, /*bIsUserCreated=*/ true, NULL);
return NewGraph;
}
}
/**
* Container for items related to the blueprint editor test
*/
namespace BlueprintEditorPromotionTestHelper
{
/**
* The main build promotion test class
*/
struct FBlueprintEditorPromotionTestHelper
{
/** Pointer to running automation test instance */
FBlueprintEditorPromotionTest* Test;
/** Function definition for the test stage functions */
typedef bool(BlueprintEditorPromotionTestHelper::FBlueprintEditorPromotionTestHelper::*TestStageFn)();
/** List of test stage functions */
TArray<TestStageFn> TestStages;
TArray<FString> StageNames;
/** The index of the test stage we are on */
int32 CurrentStage;
/** Pointer to the active editor world */
UWorld* CurrentWorld;
/** Particle System loaded from Automation Settings for Blueprint Pass */
UParticleSystem* LoadedParticleSystem;
/** Meshes to use for the blueprint */
UStaticMesh* FirstBlueprintMesh;
UStaticMesh* SecondBlueprintMesh;
/** Objects created by the Blueprint stages */
UBlueprint* BlueprintObject;
UPackage* BlueprintPackage;
UEdGraph* CustomGraph;
USCS_Node* MeshNode;
USCS_Node* OtherMeshNode;
USCS_Node* PSNode;
UEdGraphNode* AddMeshNode;
UEdGraphNode* PostBeginPlayEventNode;
UEdGraphNode* DelayNode;
UEdGraphNode* SetNode;
UEdGraphNode* GetNode;
UEdGraphNode* PrintNode;
UEdGraphNode* SetStaticMeshNode;
UEdGraphNode* CustomEventNode;
UEdGraphNode* AddParticleSystemNode;
UEdGraphNode* CallFunctionNode;
/** Delay helper */
BlueprintEditorPromotionUtils::FDelayHelper DelayHelper;
/** List of skipped tests */
TArray<FString> SkippedTests;
/** summary logs to display at the end */
TArray<FString> SummaryLines;
/** Keeps track of errors generated by building the map */
int32 BuildStartErrorCount;
int32 SectionSuccessCount;
int32 SectionTestCount;
int32 SectionErrorCount;
int32 SectionWarningCount;
int32 SectionLogCount;
#define ADD_TEST_STAGE(FuncName,StageName) \
TestStages.Add(&BlueprintEditorPromotionTestHelper::FBlueprintEditorPromotionTestHelper::FuncName); \
StageNames.Add(StageName);
/**
* Constructor
*/
FBlueprintEditorPromotionTestHelper()
: CurrentStage(0)
{
FMemory::Memzero(this, sizeof(FBlueprintEditorPromotionTestHelper));
ADD_TEST_STAGE(Cleanup, TEXT("Pre-start cleanup"));
ADD_TEST_STAGE(Setup, TEXT("Setup"));
ADD_TEST_STAGE(Blueprint_CreateNewBlueprint_Part1, TEXT("Create a new Blueprint"));
ADD_TEST_STAGE(Blueprint_CreateNewBlueprint_Part2, TEXT("Create a new Blueprint"));
ADD_TEST_STAGE(Blueprint_DataOnlyBlueprint_Part1, TEXT("Data-only Blueprint"));
ADD_TEST_STAGE(Blueprint_DataOnlyBlueprint_Part2, TEXT("Data-only Blueprint"));
ADD_TEST_STAGE(Blueprint_DataOnlyBlueprint_Part3, TEXT("Data-only Blueprint"));
ADD_TEST_STAGE(Blueprint_ComponentsMode_Part1, TEXT("Components Mode"));
ADD_TEST_STAGE(Blueprint_ComponentsMode_Part2, TEXT("Components Mode"));
ADD_TEST_STAGE(Blueprint_ConstructionScript, TEXT("Construction Script"));
ADD_TEST_STAGE(Blueprint_PromoteVariable_Part1, TEXT("Variable from Component Mode 1"));
ADD_TEST_STAGE(Blueprint_PromoteVariable_Part2, TEXT("Variable from Component Mode 2"));
//ADD_TEST_STAGE(Blueprint_PromoteVariable_Part3, TEXT("Variable from Component Mode 3"));
ADD_TEST_STAGE(Blueprint_EventGraph, TEXT("Event Graph"));
ADD_TEST_STAGE(Blueprint_CustomVariable, TEXT("Custom Variables"));
ADD_TEST_STAGE(Blueprint_UsingVariables, TEXT("Using Variables"));
ADD_TEST_STAGE(Blueprint_RenameCustomEvent, TEXT("Renaming Custom Event"));
ADD_TEST_STAGE(Blueprint_NewFunctions, TEXT("New Function"));
ADD_TEST_STAGE(Blueprint_CompleteBlueprint, TEXT("Completing the Blueprint"));
ADD_TEST_STAGE(Cleanup, TEXT("Teardown"));
}
/**
* Runs the current test stage
*/
bool Update()
{
Test->PushContext(StageNames[CurrentStage]);
bool bStageComplete = (this->*TestStages[CurrentStage])();
Test->PopContext();
if (bStageComplete)
{
CurrentStage++;
}
return CurrentStage >= TestStages.Num();
}
private:
bool Cleanup()
{
//Make sure no editors are open
FAssetEditorManager::Get().CloseAllAssetEditors();
//remove all assets in the build package
// Load the asset registry module
IAssetRegistry& AssetRegistry = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry")).Get();
// Form a filter from the paths
FARFilter Filter;
Filter.bRecursivePaths = true;
new (Filter.PackagePaths) FName(*FEditorPromotionTestUtilities::GetGamePath());
// Query for a list of assets in the selected paths
TArray<FAssetData> AssetList;
AssetRegistry.GetAssets(Filter, AssetList);
// Clear and try to delete all assets
for (int32 AssetIdx = 0; AssetIdx < AssetList.Num(); ++AssetIdx)
{
Test->AddInfo(*FString::Printf(TEXT("Removing asset: %s"), *AssetList[AssetIdx].AssetName.ToString()));
if (AssetList[AssetIdx].IsAssetLoaded())
{
UObject* LoadedAsset = AssetList[AssetIdx].GetAsset();
AssetRegistry.AssetDeleted(LoadedAsset);
bool bSuccessful = ObjectTools::DeleteSingleObject(LoadedAsset, false);
//If we failed to delete this object manually clear any references and try again
if (!bSuccessful)
{
//Clear references to the object so we can delete it
FAutomationEditorCommonUtils::NullReferencesToObject(LoadedAsset);
bSuccessful = ObjectTools::DeleteSingleObject(LoadedAsset, false);
}
}
}
Test->AddInfo(*FString::Printf(TEXT("Clearing Path: %s"), *FEditorPromotionTestUtilities::GetGamePath()));
AssetRegistry.RemovePath(FEditorPromotionTestUtilities::GetGamePath());
//Remove the directory
bool bEnsureExists = false;
bool bDeleteEntireTree = true;
FString PackageDirectory = FPaths::ProjectContentDir() / TEXT("BuildPromotionTest");
IFileManager::Get().DeleteDirectory(*PackageDirectory, bEnsureExists, bDeleteEntireTree);
Test->AddInfo(*FString::Printf(TEXT("Deleting Folder: %s"), *PackageDirectory));
return true;
}
bool Setup()
{
//Make sure we have the required assets
UAutomationTestSettings const* AutomationTestSettings = GetDefault<UAutomationTestSettings>();
check(AutomationTestSettings);
FAssetData AssetData;
const FString FirstMeshPath = AutomationTestSettings->BlueprintEditorPromotionTest.FirstMeshPath.FilePath;
if (FirstMeshPath.Len() > 0)
{
AssetData = FAutomationEditorCommonUtils::GetAssetDataFromPackagePath(FirstMeshPath);
FirstBlueprintMesh = Cast<UStaticMesh>(AssetData.GetAsset());
}
const FString SecondMeshPath = AutomationTestSettings->BlueprintEditorPromotionTest.SecondMeshPath.FilePath;
if (SecondMeshPath.Len() > 0)
{
AssetData = FAutomationEditorCommonUtils::GetAssetDataFromPackagePath(SecondMeshPath);
SecondBlueprintMesh = Cast<UStaticMesh>(AssetData.GetAsset());
}
const FString ParticleSystemPath = AutomationTestSettings->BlueprintEditorPromotionTest.DefaultParticleAsset.FilePath;
if (ParticleSystemPath.Len() > 0)
{
AssetData = FAutomationEditorCommonUtils::GetAssetDataFromPackagePath(ParticleSystemPath);
LoadedParticleSystem = Cast<UParticleSystem>(AssetData.GetAsset());
}
if (!(FirstBlueprintMesh && SecondBlueprintMesh && LoadedParticleSystem))
{
SkippedTests.Add(TEXT("All Blueprint tests. (Missing a required mesh or particle system)"));
if (FirstMeshPath.IsEmpty() || SecondMeshPath.IsEmpty())
{
Test->AddInfo(TEXT("SKIPPING BLUEPRINT TESTS. FirstMeshPath or SecondMeshPath not configured in AutomationTestSettings."));
}
else
{
Test->AddWarning(TEXT("SKIPPING BLUEPRINT TESTS. Invalid FirstMeshPath or SecondMeshPath in AutomationTestSettings, or particle system was not created."));
}
}
return true;
}
/**
* Blueprint Test Stage: Create a new Blueprint (Part 1)
* Creates a new actor based blueprint and opens the editor
*/
bool Blueprint_CreateNewBlueprint_Part1()
{
// Exit early if any of the required assets are missing
if (!(FirstBlueprintMesh && SecondBlueprintMesh && LoadedParticleSystem))
{
return true;
}
UBlueprintFactory* Factory = NewObject<UBlueprintFactory>();
Factory->ParentClass = AActor::StaticClass();
const FString PackageName = FEditorPromotionTestUtilities::GetGamePath() + TEXT("/") + BlueprintEditorPromotionUtils::BlueprintNameString;
BlueprintPackage = CreatePackage(NULL, *PackageName);
EObjectFlags Flags = RF_Public | RF_Standalone;
UObject* ExistingBlueprint = FindObject<UBlueprint>(BlueprintPackage, *BlueprintEditorPromotionUtils::BlueprintNameString);
Test->TestNull(TEXT("Blueprint asset does not already exist (delete blueprint and restart editor)"), ExistingBlueprint);
// Exit early since test will not be valid with pre-existing assets
if (ExistingBlueprint)
{
return true;
}
BlueprintObject = Cast<UBlueprint>(Factory->FactoryCreateNew(UBlueprint::StaticClass(), BlueprintPackage, FName(*BlueprintEditorPromotionUtils::BlueprintNameString), Flags, NULL, GWarn));
Test->TestNotNull(TEXT("Created new Actor-based blueprint"), BlueprintObject);
if (BlueprintObject)
{
// Update asset registry and mark package dirty
FAssetRegistryModule::AssetCreated(BlueprintObject);
BlueprintPackage->MarkPackageDirty();
Test->AddInfo(TEXT("Opening the blueprint editor for the first time"));
FAssetEditorManager::Get().OpenEditorForAsset(BlueprintObject);
}
return true;
}
/**
* Blueprint Test Stage: Create a new Blueprint (Part 2)
* Checks that the blueprint editor opened in the correct mode
*/
bool Blueprint_CreateNewBlueprint_Part2()
{
if (BlueprintObject)
{
IAssetEditorInstance* AssetEditor = FAssetEditorManager::Get().FindEditorForAsset(BlueprintObject, true);
IBlueprintEditor* BlueprintEditor = (IBlueprintEditor*)AssetEditor;
Test->TestTrue(TEXT("Opened correct initial editor"), BlueprintEditor->GetCurrentMode() != FBlueprintEditorApplicationModes::BlueprintDefaultsMode);
}
return true;
}
/**
* Blueprint Test Stage: Data-only Blueprint (Part 1)
* Closes the blueprint editor
*/
bool Blueprint_DataOnlyBlueprint_Part1()
{
if (BlueprintObject)
{
Test->AddInfo(TEXT("Closing the blueprint editor"));
FAssetEditorManager::Get().CloseAllAssetEditors();
}
return true;
}
/**
* Blueprint Test Stage: Data-only Blueprint (Part 2)
* Re opens the blueprint editor
*/
bool Blueprint_DataOnlyBlueprint_Part2()
{
if (BlueprintObject)
{
Test->AddInfo(TEXT("Opening the blueprint editor for the second time"));
FAssetEditorManager::Get().OpenEditorForAsset(BlueprintObject);
}
return true;
}
/**
* Blueprint Test Stage: Data-only Blueprint (Part 3)
* Checks that the editor opened in the Defaults mode
*/
bool Blueprint_DataOnlyBlueprint_Part3()
{
if (BlueprintObject)
{
IAssetEditorInstance* AssetEditor = FAssetEditorManager::Get().FindEditorForAsset(BlueprintObject, true);
IBlueprintEditor* BlueprintEditor = (IBlueprintEditor*)AssetEditor;
bool bCorrectEditorOpened = BlueprintEditor->GetCurrentMode() == FBlueprintEditorApplicationModes::BlueprintDefaultsMode;
Test->TestTrue(TEXT("Correct defaults editor opened"), bCorrectEditorOpened);
if (bCorrectEditorOpened)
{
Test->AddInfo(TEXT("Switching to components mode"));
BlueprintEditor->SetCurrentMode(FBlueprintEditorApplicationModes::BlueprintComponentsMode);
}
}
return true;
}
/**
* Blueprint Test Stage: Components Mode (Part 1)
* Adds 3 new components to the blueprint, changes the root component, renames the components, and compiles the blueprint
*/
bool Blueprint_ComponentsMode_Part1()
{
if (BlueprintObject)
{
IAssetEditorInstance* AssetEditor = FAssetEditorManager::Get().FindEditorForAsset(BlueprintObject, true);
IBlueprintEditor* BlueprintEditor = (IBlueprintEditor*)AssetEditor;
MeshNode = BlueprintEditorPromotionUtils::CreateBlueprintComponent(BlueprintObject, FirstBlueprintMesh);
Test->TestNotNull(TEXT("First mesh component added"), MeshNode);
OtherMeshNode = BlueprintEditorPromotionUtils::CreateBlueprintComponent(BlueprintObject, SecondBlueprintMesh);
Test->TestNotNull(TEXT("Second mesh component added"), OtherMeshNode);
PSNode = BlueprintEditorPromotionUtils::CreateBlueprintComponent(BlueprintObject, LoadedParticleSystem);
Test->TestNotNull(TEXT("Particle system component added"), PSNode);
//Set the Particle System as the root
BlueprintEditorPromotionUtils::SetComponentAsRoot(BlueprintObject, PSNode);
Test->TestTrue(TEXT("Particle system set as root"), PSNode->IsRootNode());
//Set Names
const FName MeshName(TEXT("FirstMesh"));
FBlueprintEditorUtils::RenameComponentMemberVariable(BlueprintObject, MeshNode, MeshName);
Test->AddInfo(TEXT("Renamed the first mesh component to FirstMesh"));
const FName OtherMeshName(TEXT("SecondMesh"));
FBlueprintEditorUtils::RenameComponentMemberVariable(BlueprintObject, OtherMeshNode, OtherMeshName);
Test->AddInfo(TEXT("Renamed the second mesh component to SecondMesh"));
const FName PSName(TEXT("ParticleSys"));
FBlueprintEditorUtils::RenameComponentMemberVariable(BlueprintObject, PSNode, PSName);
Test->AddInfo(TEXT("Renamed the particle system component to ParticleSys"));
BlueprintEditorPromotionUtils::CompileBlueprint(BlueprintObject);
Test->AddInfo(TEXT("Switched to graph editing mode"));
BlueprintEditor->SetCurrentMode(FBlueprintEditorApplicationModes::StandardBlueprintEditorMode);
}
return true;
}
/**
* Blueprint Test Stage: Components Mode (Part 2)
* Removes the 3 components added before and compiles the blueprint
*/
bool Blueprint_ComponentsMode_Part2()
{
if (BlueprintObject)
{
IAssetEditorInstance* AssetEditor = FAssetEditorManager::Get().FindEditorForAsset(BlueprintObject, true);
IBlueprintEditor* BlueprintEditor = (IBlueprintEditor*)AssetEditor;
//FEditorPromotionTestUtilities::TakeScreenshot(TEXT("BlueprintComponentVariables"), true);
Test->AddInfo(TEXT("Switched to components mode"));
BlueprintEditor->SetCurrentMode(FBlueprintEditorApplicationModes::BlueprintComponentsMode);
BlueprintEditorPromotionUtils::RemoveBlueprintComponent(BlueprintObject, MeshNode);
BlueprintEditorPromotionUtils::RemoveBlueprintComponent(BlueprintObject, OtherMeshNode);
BlueprintEditorPromotionUtils::RemoveBlueprintComponent(BlueprintObject, PSNode);
//There should only be the scene component left
Test->TestTrue(TEXT("Successfully removed blueprint components"), BlueprintObject->SimpleConstructionScript->GetAllNodes().Num() == 1);
MeshNode = NULL;
OtherMeshNode = NULL;
PSNode = NULL;
Test->AddInfo(TEXT("Switched to graph mode"));
BlueprintEditor->SetCurrentMode(FBlueprintEditorApplicationModes::StandardBlueprintEditorMode);
BlueprintEditorPromotionUtils::CompileBlueprint(BlueprintObject);
}
return true;
}
/**
* Blueprint Test Stage: Construction Script
* Adds an AddStaticMeshComponent to the construction graph and links it to the entry node
*/
bool Blueprint_ConstructionScript()
{
if (BlueprintObject)
{
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
IAssetEditorInstance* AssetEditor = FAssetEditorManager::Get().FindEditorForAsset(BlueprintObject, true);
FBlueprintEditor* BlueprintEditor = (FBlueprintEditor*)AssetEditor;
UEdGraph* ConstructionGraph = FBlueprintEditorUtils::FindUserConstructionScript(BlueprintObject);
BlueprintEditor->OpenGraphAndBringToFront(ConstructionGraph);
AddMeshNode = BlueprintEditorPromotionUtils::CreateAddComponentActionNode(BlueprintObject, ConstructionGraph, FirstBlueprintMesh);
Test->TestNotNull(TEXT("Add Static Mesh Component node created"), AddMeshNode);
GEditor->UndoTransaction();
Test->TestTrue(TEXT("Undo add component node completed"), ConstructionGraph->Nodes.Num() == 0 || ConstructionGraph->Nodes[ConstructionGraph->Nodes.Num() - 1] != AddMeshNode);
GEditor->RedoTransaction();
Test->TestTrue(TEXT("Redo add component node completed"), ConstructionGraph->Nodes.Num() > 0 && ConstructionGraph->Nodes[ConstructionGraph->Nodes.Num() - 1] == AddMeshNode);
TArray<UK2Node_FunctionEntry*> EntryNodes;
ConstructionGraph->GetNodesOfClass(EntryNodes);
UEdGraphNode* EntryNode = EntryNodes.Num() > 0 ? EntryNodes[0] : NULL;
Test->TestNotNull(TEXT("Found entry node to connect Add Static Mesh to"), EntryNode);
if (EntryNode)
{
BlueprintEditorPromotionUtils::ConnectGraphNodes(AddMeshNode, K2Schema->PN_Execute, EntryNode, K2Schema->PN_Then);
UEdGraphPin* EntryOutPin = EntryNode->FindPin(K2Schema->PN_Then);
UEdGraphPin* AddStaticMeshInPin = AddMeshNode->FindPin(K2Schema->PN_Execute);
Test->TestTrue(TEXT("Connected entry node to Add Static Mesh node"), EntryOutPin->LinkedTo.Contains(AddStaticMeshInPin));
GEditor->UndoTransaction();
Test->TestTrue(TEXT("Undo connection to Add Static Mesh Node succeeded"), EntryOutPin->LinkedTo.Num() == 0);
GEditor->RedoTransaction();
Test->TestTrue(TEXT("Redo connection to Add Static Mesh Node succeeded"), EntryOutPin->LinkedTo.Contains(AddStaticMeshInPin));
}
BlueprintEditorPromotionUtils::CompileBlueprint(BlueprintObject);
}
return true;
}
/**
* Saves the blueprint stored in BlueprintObject
*/
void SaveBlueprint()
{
if (BlueprintObject && BlueprintPackage)
{
BlueprintPackage->SetDirtyFlag(true);
BlueprintPackage->FullyLoad();
const FString PackagePath = FEditorPromotionTestUtilities::GetGamePath() + TEXT("/") + BlueprintEditorPromotionUtils::BlueprintNameString;
bool bBlueprintSaved = UPackage::SavePackage(BlueprintPackage, NULL, RF_Standalone, *FPackageName::LongPackageNameToFilename(PackagePath, FPackageName::GetAssetPackageExtension()), GLog, nullptr, false, true, SAVE_None);
Test->TestTrue(*FString::Printf(TEXT("Blueprint saved successfully (%s)"), *BlueprintObject->GetName()), bBlueprintSaved);
}
}
/**
* Blueprint Test Stage: Variable from component mode (Part 1)
* Promotes the return pin of the AddStaticMeshNode to a variable and then renames it
*/
bool Blueprint_PromoteVariable_Part1()
{
if (BlueprintObject)
{
IAssetEditorInstance* AssetEditor = FAssetEditorManager::Get().FindEditorForAsset(BlueprintObject, true);
FBlueprintEditor* BlueprintEditor = (FBlueprintEditor*)AssetEditor;
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
BlueprintEditorPromotionUtils::PromotePinToVariable(BlueprintObject, AddMeshNode, K2Schema->PN_ReturnValue);
Test->AddInfo(TEXT("Promoted the return pin on the add mesh node to a variable"));
const FName OldVarName(TEXT("NewVar_0")); // Default variable name
const FName NewVarName(TEXT("MyMesh"));
FBlueprintEditorUtils::RenameMemberVariable(BlueprintObject, OldVarName, NewVarName);
Test->TestNotEqual(TEXT("New variable was renamed"), FBlueprintEditorUtils::FindMemberVariableGuidByName(BlueprintObject, OldVarName), FBlueprintEditorUtils::FindMemberVariableGuidByName(BlueprintObject, NewVarName));
BlueprintEditorPromotionUtils::CompileBlueprint(BlueprintObject);
Test->AddInfo(TEXT("Switched to graph mode"));
BlueprintEditor->SetCurrentMode(FBlueprintEditorApplicationModes::StandardBlueprintEditorMode);
}
return true;
}
bool Blueprint_PromoteVariable_Part2()
{
if (BlueprintObject)
{
IAssetEditorInstance* AssetEditor = FAssetEditorManager::Get().FindEditorForAsset(BlueprintObject, true);
FBlueprintEditor* BlueprintEditor = (FBlueprintEditor*)AssetEditor;
//FEditorPromotionTestUtilities::TakeScreenshot(TEXT("BlueprintMeshVariable"), true);
Test->AddInfo(TEXT("Switched to components mode"));
BlueprintEditor->SetCurrentMode(FBlueprintEditorApplicationModes::BlueprintComponentsMode);
BlueprintEditorPromotionUtils::SendBlueprintResetViewCommand();
}
return true;
}
///**
//* Blueprint Test Stage: Variable from component mode (Part 3)
//* Takes a screenshot of the mesh variable
//*/
//bool Blueprint_PromoteVariable_Part3()
//{
// if (BlueprintObject)
// {
// FEditorPromotionTestUtilities::TakeScreenshot(TEXT("BlueprintComponent"), true);
// }
// return true;
//}
/**
* Blueprint Test Stage: Event Graph
* Adds a ReceiveBeginPlay and Delay node to the event graph
*/
bool Blueprint_EventGraph()
{
if (BlueprintObject)
{
IAssetEditorInstance* AssetEditor = FAssetEditorManager::Get().FindEditorForAsset(BlueprintObject, true);
FBlueprintEditor* BlueprintEditor = (FBlueprintEditor*)AssetEditor;
UEdGraph* EventGraph = FBlueprintEditorUtils::FindEventGraph(BlueprintObject);
BlueprintEditor->OpenGraphAndBringToFront(EventGraph);
Test->AddInfo(TEXT("Opened the event graph"));
PostBeginPlayEventNode = BlueprintEditorPromotionUtils::CreatePostBeginPlayEvent(BlueprintObject, EventGraph);
Test->TestNotNull(TEXT("Created EventBeginPlay node"), PostBeginPlayEventNode);
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
UEdGraphPin* PlayThenPin = PostBeginPlayEventNode->FindPin(K2Schema->PN_Then);
DelayNode = BlueprintEditorPromotionUtils::AddDelayNode(BlueprintObject, EventGraph, PlayThenPin);
Test->TestNotNull(TEXT("Created Delay node"), DelayNode);
GEditor->UndoTransaction();
Test->TestTrue(TEXT("Undo adding Delay node succeeded"), EventGraph->Nodes.Num() == 0 || EventGraph->Nodes[EventGraph->Nodes.Num() - 1] != DelayNode);
GEditor->RedoTransaction();
Test->TestTrue(TEXT("Redo adding Delay node succeeded"), EventGraph->Nodes.Num() > 0 && EventGraph->Nodes[EventGraph->Nodes.Num() - 1] == DelayNode);
// Update Delay node's Duration pin with new default value
const FString DelayDurationPinName = TEXT("Duration");
const FString NewDurationDefaultValue = TEXT("2.0");
BlueprintEditorPromotionUtils::SetPinDefaultValue(DelayNode, DelayDurationPinName, NewDurationDefaultValue);
Test->TestEqual(TEXT("Delay node default duration set to 2.0 seconds"), DelayNode->FindPin(DelayDurationPinName)->DefaultValue, NewDurationDefaultValue);
BlueprintEditorPromotionUtils::CompileBlueprint(BlueprintObject);
}
return true;
}
/**
* Blueprint Test Stage: Custom Variable
* Creates a custom string variable and adds Get/Set nodes for it
*/
bool Blueprint_CustomVariable()
{
if (BlueprintObject)
{
UEdGraph* EventGraph = FBlueprintEditorUtils::FindEventGraph(BlueprintObject);
Test->AddInfo(TEXT("Added a string member variable"));
BlueprintEditorPromotionUtils::AddStringMemberValue(BlueprintObject, BlueprintEditorPromotionUtils::BlueprintStringVariableName);
SetNode = BlueprintEditorPromotionUtils::AddGetSetNode(BlueprintObject, EventGraph, BlueprintEditorPromotionUtils::BlueprintStringVariableName.ToString(), false);
Test->TestNotNull(TEXT("Added Set node for string variable"), SetNode);
GEditor->UndoTransaction();
Test->TestTrue(TEXT("Undo adding Set node succeeded"), EventGraph->Nodes.Num() == 0 || EventGraph->Nodes[EventGraph->Nodes.Num() - 1] != SetNode);
GEditor->RedoTransaction();
Test->TestTrue(TEXT("Redo adding Set node succeeded"), EventGraph->Nodes.Num() > 0 && EventGraph->Nodes[EventGraph->Nodes.Num() - 1] == SetNode);
GetNode = BlueprintEditorPromotionUtils::AddGetSetNode(BlueprintObject, EventGraph, BlueprintEditorPromotionUtils::BlueprintStringVariableName.ToString(), true, 400);
Test->TestNotNull(TEXT("Added Get node for string variable"), GetNode);
GEditor->UndoTransaction();
Test->TestTrue(TEXT("Undo adding Get node succeeded"), EventGraph->Nodes.Num() == 0 || EventGraph->Nodes[EventGraph->Nodes.Num() - 1] != GetNode);
GEditor->RedoTransaction();
Test->TestTrue(TEXT("Redo adding Get node succeeded"), EventGraph->Nodes.Num() > 0 && EventGraph->Nodes[EventGraph->Nodes.Num() - 1] == GetNode);
EventGraph->RemoveNode(SetNode);
Test->TestFalse(TEXT("Set node removed from EventGraph"), EventGraph->Nodes.Contains(SetNode));
SetNode = NULL;
}
return true;
}
/**
* Blueprint Test Stage: Using Variables
* Adds a PrintString and SetStaticMesh then connects all the existing nodes
*/
bool Blueprint_UsingVariables()
{
if (BlueprintObject)
{
const bool bVariableIsHidden = false;
FBlueprintEditorUtils::SetBlueprintOnlyEditableFlag(BlueprintObject, BlueprintEditorPromotionUtils::BlueprintStringVariableName, bVariableIsHidden);
Test->AddInfo(TEXT("Exposed the blueprint string variable"));
UEdGraph* EventGraph = FBlueprintEditorUtils::FindEventGraph(BlueprintObject);
PrintNode = BlueprintEditorPromotionUtils::AddPrintStringNode(BlueprintObject, EventGraph);
Test->TestNotNull(TEXT("Added Print String node"), PrintNode);
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
//Connect Get to printstring
UEdGraphPin* GetVarPin = GetNode->FindPin(BlueprintEditorPromotionUtils::BlueprintStringVariableName.ToString());
UEdGraphPin* InStringPin = PrintNode->FindPin(TEXT("InString"));
GetVarPin->MakeLinkTo(InStringPin);
Test->TestTrue(TEXT("Connected string variable Get node to the Print String node"), GetVarPin->LinkedTo.Contains(InStringPin));
//Connect Delay to PrintString
UEdGraphPin* DelayExecPin = DelayNode->FindPin(K2Schema->PN_Then);
UEdGraphPin* PrintStringPin = PrintNode->FindPin(K2Schema->PN_Execute);
DelayExecPin->MakeLinkTo(PrintStringPin);
Test->TestTrue(TEXT("Connected Delay nod to Print String node"), DelayExecPin->LinkedTo.Contains(PrintStringPin));
const FName MyMeshVarName(TEXT("MyMesh"));
GetNode = BlueprintEditorPromotionUtils::AddGetSetNode(BlueprintObject, EventGraph, MyMeshVarName.ToString(), true, 680);
Test->TestNotNull(TEXT("Added Get node for MyMesh variable"), GetNode);
SetStaticMeshNode = BlueprintEditorPromotionUtils::AddSetStaticMeshNode(BlueprintObject, EventGraph);
Test->TestNotNull(TEXT("Added Set Static Mesh node"), SetStaticMeshNode);
UEdGraphPin* GetExecPin = GetNode->FindPin(TEXT("MyMesh"));
UEdGraphPin* SetStaticMeshSelfPin = SetStaticMeshNode->FindPin(K2Schema->PN_Self);
GetExecPin->MakeLinkTo(SetStaticMeshSelfPin);
Test->TestTrue(TEXT("Connected Get MyMesh node to Set Static Mesh node"), GetExecPin->LinkedTo.Contains(SetStaticMeshSelfPin));
UEdGraphPin* SetStaticMeshMeshPin = SetStaticMeshNode->FindPin(TEXT("NewMesh"));
SetStaticMeshMeshPin->DefaultObject = SecondBlueprintMesh;
Test->TestEqual(*FString::Printf(TEXT("Set Static Mesh default mesh updated to %s"), *SecondBlueprintMesh->GetName()), Cast<UStaticMesh>(SetStaticMeshMeshPin->DefaultObject), SecondBlueprintMesh);
//Connect SetStaticMeshMesh to PrintString
UEdGraphPin* PrintStringThenPin = PrintNode->FindPin(K2Schema->PN_Then);
UEdGraphPin* SetStaticMeshExecPin = SetStaticMeshNode->FindPin(K2Schema->PN_Execute);
PrintStringThenPin->MakeLinkTo(SetStaticMeshExecPin);
Test->TestTrue(TEXT("Connected Print String node to Set Static Mesh node"), PrintStringThenPin->LinkedTo.Contains(SetStaticMeshExecPin));
}
return true;
}
/**
* Blueprint Test Stage: Renaming custom event
* Creates, renames, and then removes a custom event node
*/
bool Blueprint_RenameCustomEvent()
{
if (BlueprintObject)
{
UEdGraph* EventGraph = FBlueprintEditorUtils::FindEventGraph(BlueprintObject);
CustomEventNode = BlueprintEditorPromotionUtils::CreateCustomEvent(BlueprintObject, EventGraph, TEXT("NewEvent"));
Test->TestNotNull(TEXT("Custom event node created"), CustomEventNode);
if (CustomEventNode)
{
//Rename the event
const FString NewEventNodeName = TEXT("RenamedEvent");
CustomEventNode->Rename(*NewEventNodeName);
Test->TestEqual(TEXT("Custom event rename succeeded"), CustomEventNode->GetName(), NewEventNodeName);
EventGraph->RemoveNode(CustomEventNode);
Test->TestFalse(TEXT("Blueprint EventGraph does not contain removed custom event node"), EventGraph->Nodes.Contains(CustomEventNode));
CustomEventNode = NULL;
}
}
return true;
}
/**
* Blueprint Test Stage: New function
* Creates a new function graph and then hooks up a new AddParticleSystem inside it
*/
bool Blueprint_NewFunctions()
{
if (BlueprintObject)
{
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
CustomGraph = BlueprintEditorPromotionUtils::CreateNewFunctionGraph(BlueprintObject, TEXT("NewFunction"));
Test->TestNotNull(TEXT("Created new function graph"), CustomGraph);
AddParticleSystemNode = BlueprintEditorPromotionUtils::CreateAddComponentActionNode(BlueprintObject, CustomGraph, LoadedParticleSystem);
Test->TestNotNull(TEXT("Created Add Particle System node"), AddParticleSystemNode);
UEdGraphPin* ExecutePin = AddParticleSystemNode ? AddParticleSystemNode->FindPin(K2Schema->PN_Execute) : NULL;
//Find the input for the function graph
TArray<UK2Node_FunctionEntry*> EntryNodes;
CustomGraph->GetNodesOfClass(EntryNodes);
UEdGraphNode* EntryNode = EntryNodes.Num() > 0 ? EntryNodes[0] : NULL;
if (EntryNode && ExecutePin)
{
UEdGraphPin* EntryPin = EntryNode->FindPin(K2Schema->PN_Then);
EntryPin->MakeLinkTo(ExecutePin);
Test->TestTrue(TEXT("Connected Add Particle System node to entry node"), EntryPin->LinkedTo.Contains(ExecutePin));
}
BlueprintEditorPromotionUtils::CompileBlueprint(BlueprintObject);
}
return true;
}
/**
* Blueprint Test Stage: Completing the blueprint
* Adds a CallFunction node to call the custom function created in the previous step.
*/
bool Blueprint_CompleteBlueprint()
{
if (BlueprintObject)
{
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
UEdGraph* EventGraph = FBlueprintEditorUtils::FindEventGraph(BlueprintObject);
UEdGraphPin* SetStaticMeshThenPin = SetStaticMeshNode->FindPin(K2Schema->PN_Then);
CallFunctionNode = BlueprintEditorPromotionUtils::AddCallFunctionGraphNode(BlueprintObject, EventGraph, TEXT("NewFunction"), SetStaticMeshThenPin);
Test->TestNotNull(TEXT("Created Call Function node"), CallFunctionNode);
if (CallFunctionNode)
{
Test->TestTrue(TEXT("Connected Set Static Mesh node to Call Function node"), SetStaticMeshThenPin->LinkedTo.Contains(CallFunctionNode->FindPin(K2Schema->PN_Execute)));
}
BlueprintEditorPromotionUtils::CompileBlueprint(BlueprintObject);
SaveBlueprint();
}
return true;
}
};
}
/**
* Latent command to run the main build promotion test
*/
DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FRunPromotionTestCommand, TSharedPtr<BlueprintEditorPromotionTestHelper::FBlueprintEditorPromotionTestHelper>, BlueprintEditorTestInfo);
bool FRunPromotionTestCommand::Update()
{
return BlueprintEditorTestInfo->Update();
}
/**
* Automation test that handles the blueprint editor promotion process
*/
bool FBlueprintEditorPromotionTest::RunTest(const FString& Parameters)
{
TSharedPtr<BlueprintEditorPromotionTestHelper::FBlueprintEditorPromotionTestHelper> BuildPromotionTest = MakeShareable(new BlueprintEditorPromotionTestHelper::FBlueprintEditorPromotionTestHelper());
BuildPromotionTest->Test = this;
ADD_LATENT_AUTOMATION_COMMAND(FRunPromotionTestCommand(BuildPromotionTest));
return true;
}
#undef LOCTEXT_NAMESPACE
#endif //WITH_DEV_AUTOMATION_TESTS
| 37.466336 | 233 | 0.755074 | [
"mesh",
"object"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.