hexsha stringlengths 40 40 | size int64 7 1.05M | ext stringclasses 13
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 269 | max_stars_repo_name stringlengths 5 109 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 9 | max_stars_count int64 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 4 269 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 9 | max_issues_count int64 1 48.5k ⌀ | 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 4 269 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 9 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 7 1.05M | avg_line_length float64 1.21 330k | max_line_length int64 6 990k | alphanum_fraction float64 0.01 0.99 | author_id stringlengths 2 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f242339b31e7cf08ca2b32322798dcfb737dece4 | 604 | cpp | C++ | problems/acmicpc_5639.cpp | qawbecrdtey/BOJ-sol | e3f410e8f4e3a6ade51b68ce2024529870edac64 | [
"MIT"
] | null | null | null | problems/acmicpc_5639.cpp | qawbecrdtey/BOJ-sol | e3f410e8f4e3a6ade51b68ce2024529870edac64 | [
"MIT"
] | null | null | null | problems/acmicpc_5639.cpp | qawbecrdtey/BOJ-sol | e3f410e8f4e3a6ade51b68ce2024529870edac64 | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <vector>
using namespace std;
void search(int const root,int const r,vector<int> const &v){
if(root+1>r)return;
if(root+1==r){
printf("%d\n",v[root]);
return;
}
int const l=root+1;
int const rtv=v[root];
int lv=l,rv=r;
while(lv<rv){
int m=(lv+rv)/2;
if(rtv>v[m])lv=m+1;
else rv=m;
}
search(l,lv,v);
search(lv,r,v);
printf("%d\n",v[root]);
}
int main(){
int n;
int t;
vector<int> v;
while(scanf("%d",&n)!=EOF){
v.push_back(n);
}
n=v.size();
search(0,n,v);
} | 19.483871 | 61 | 0.503311 | qawbecrdtey |
f254244cfde391a02b65a69db47a22302c374e6c | 6,084 | cpp | C++ | GLWrapper/GLView.cpp | filipkunc/GLGraphics | fb696948034832e1fbc60b7c6095560a79952875 | [
"MIT"
] | 6 | 2015-12-29T11:24:29.000Z | 2021-07-17T06:00:30.000Z | GLWrapper/GLView.cpp | filipkunc/GLGraphics | fb696948034832e1fbc60b7c6095560a79952875 | [
"MIT"
] | null | null | null | GLWrapper/GLView.cpp | filipkunc/GLGraphics | fb696948034832e1fbc60b7c6095560a79952875 | [
"MIT"
] | 1 | 2021-05-27T07:35:57.000Z | 2021-05-27T07:35:57.000Z | #include "stdafx.h"
#include "DesignModeDevenv.h"
#include "GLCanvas.h"
#include "EventArgs.h"
#include "GLView.h"
bool WGLExtensionSupported(const char *extension_name)
{
// this is pointer to function which returns pointer to string with list of all wgl extensions
PFNWGLGETEXTENSIONSSTRINGEXTPROC wglGetExtensionsStringEXT = nullptr;
// determine pointer to wglGetExtensionsStringEXT function
wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC) wglGetProcAddress("wglGetExtensionsStringEXT");
if (strstr(wglGetExtensionsStringEXT(), extension_name) == nullptr)
{
// string was not found
return false;
}
// extension is supported
return true;
}
namespace GLWrapper
{
GLView::GLView(void)
{
deviceContext = nullptr;
glRenderingContext = nullptr;
sharedContextView = nullptr;
glCanvas = nullptr;
glEnabled = true;
neverInitGL = false;
testGLErrors = false;
}
GLView::~GLView()
{
EndGL();
if (glRenderingContext)
{
wglDeleteContext(glRenderingContext);
glRenderingContext = nullptr;
}
if (components)
{
delete components;
}
}
GLView ^GLView::SharedContextView::get()
{
return sharedContextView;
}
void GLView::SharedContextView::set(GLView ^value)
{
sharedContextView = value;
}
#pragma region OnEvents
void GLView::OnLoad(EventArgs ^e)
{
UserControl::OnLoad(e);
try
{
InitGL();
}
catch (Exception ^e)
{
glEnabled = false;
InitGLErrorHandler(this, gcnew ExceptionEventArgs(e));
}
}
void GLView::OnSizeChanged(EventArgs ^e)
{
UserControl::OnSizeChanged(e);
Invalidate();
}
void GLView::OnPaint(PaintEventArgs ^e)
{
if (DesignModeDevenv::DesignMode)
{
UserControl::OnPaint(e);
return;
}
if (!glEnabled)
UserControl::OnPaint(e);
else
PaintGL(e);
}
void GLView::OnPaintBackground(PaintEventArgs ^e)
{
if (DesignModeDevenv::DesignMode || !glEnabled)
UserControl::OnPaintBackground(e);
}
#pragma endregion
GLError GLView::GetGLError()
{
GLenum errorCode = glGetError();
GLError glError = (GLError)errorCode;
return glError;
}
void GLView::PaintGL(PaintEventArgs ^paintArgs)
{
if (!deviceContext || !glRenderingContext)
return;
try
{
BeginGL();
}
catch (Exception ^e)
{
glEnabled = false;
InitGLErrorHandler(this, gcnew ExceptionEventArgs(e));
}
DrawGL(paintArgs);
if (testGLErrors)
{
GLenum errorCode = glGetError();
GLError glError = (GLError)errorCode;
GLErrorHandler(this, gcnew GLErrorEventArgs(glError));
}
SwapBuffers(deviceContext);
EndGL();
}
void GLView::InitGL()
{
if (DesignModeDevenv::DesignMode || neverInitGL)
return;
deviceContext = GetDC((HWND)this->Handle.ToPointer());
// CAUTION: Not doing the following SwapBuffers() on the DC will
// result in a failure to subsequently create the RC.
SwapBuffers(deviceContext);
//Get the pixel format
PIXELFORMATDESCRIPTOR pfd;
ZeroMemory(&pfd, sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 32;
pfd.cDepthBits = 0;
pfd.iLayerType = PFD_MAIN_PLANE;
int pixelFormatIndex = ChoosePixelFormat(deviceContext, &pfd);
if (pixelFormatIndex == 0)
{
throw gcnew Win32Exception(Marshal::GetLastWin32Error(), "Unable to retrieve pixel format");
}
if (SetPixelFormat(deviceContext, pixelFormatIndex, &pfd) == 0)
{
throw gcnew Win32Exception(Marshal::GetLastWin32Error(), "Unable to set pixel format");
}
wglMakeCurrent(0, 0);
//Create rendering context
glRenderingContext = wglCreateContext(deviceContext);
if (sharedContextView != nullptr)
{
wglShareLists(sharedContextView->glRenderingContext, glRenderingContext);
}
if (!glRenderingContext)
{
throw gcnew Win32Exception(Marshal::GetLastWin32Error(), "Unable to get rendering context");
}
if (wglMakeCurrent(deviceContext, glRenderingContext) == 0)
{
throw gcnew Win32Exception(Marshal::GetLastWin32Error(), "Unable to make rendering context current");
}
if (WGLExtensionSupported("WGL_EXT_swap_control"))
{
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
wglSwapIntervalEXT(0); // Disable VSYNC
}
}
void GLView::BeginGL()
{
if (wglMakeCurrent(deviceContext, glRenderingContext) == 0)
{
throw gcnew Win32Exception(Marshal::GetLastWin32Error(), "Unable to make rendering context current");
}
}
void GLView::EndGL()
{
wglMakeCurrent(NULL, NULL);
}
void GLView::ReshapeFlippedOrtho2D()
{
System::Drawing::Rectangle rect = this->ClientRectangle;
glViewport(0, 0, rect.Width, rect.Height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, rect.Width, 0, rect.Height, -1.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef((float)-rect.X, (float)rect.Y + (float)rect.Height, 0);
glScalef(1, -1, 1);
//glTranslatef(0.5f, 0.5f, 0.0f);
}
void GLView::DrawGL(PaintEventArgs ^paintArgs)
{
ReshapeFlippedOrtho2D();
if (glCanvas == nullptr)
glCanvas = gcnew GLCanvas(this->BackColor);
else
glCanvas->Clear(this->BackColor);
glCanvas->CanvasSize = this->ClientSize;
glCanvas->Dpi = PointF(paintArgs->Graphics->DpiX, paintArgs->Graphics->DpiY);
glPushMatrix();
CanvasEventArgs ^args = gcnew CanvasEventArgs(glCanvas, paintArgs);
PaintCanvas(this, args);
glPopMatrix();
}
}
| 24.336 | 127 | 0.646121 | filipkunc |
f2559aebfae3e6270306e8f9d26943ba92a58248 | 2,392 | cpp | C++ | src/rtl/JitteredRenderer.cpp | potato3d/rtrt | cac9f2f80d94bf60adf0bbd009f5076973ee10c6 | [
"MIT"
] | 2 | 2021-02-13T14:18:39.000Z | 2021-11-04T07:21:21.000Z | src/rtl/JitteredRenderer.cpp | potato3d/rtrt | cac9f2f80d94bf60adf0bbd009f5076973ee10c6 | [
"MIT"
] | null | null | null | src/rtl/JitteredRenderer.cpp | potato3d/rtrt | cac9f2f80d94bf60adf0bbd009f5076973ee10c6 | [
"MIT"
] | null | null | null | #include <rtl/JitteredRenderer.h>
#include <rtu/random.h>
namespace rtl {
static const float TWO_BY_TWO_GRID[] = { -0.25f, -0.25f, // line 0
0.25f, -0.25f,
-0.25f, 0.25f, // line 1
0.25f, 0.25f };
static const float FOUR_BY_FOUR_GRID[] = { -0.375f, -0.375f, // line 0
-0.125f, -0.375f,
0.125f, -0.375f,
0.375f, -0.375f,
-0.375f, -0.125f, // line 1
-0.125f, -0.125f,
0.125f, -0.125f,
0.375f, -0.125f,
-0.375f, 0.125f, // line 2
-0.125f, 0.125f,
0.125f, 0.125f,
0.375f, 0.125f,
-0.375f, 0.375f, // line 3
-0.125f, 0.375f,
0.125f, 0.375f,
0.375f, 0.375f };
void JitteredRenderer::init()
{
rtu::Random::autoSeed();
_gridRes = FOUR_BY_FOUR;
}
void JitteredRenderer::render()
{
unsigned int width;
unsigned int height;
rtsViewport( width, height );
int w = (int)width;
int h = (int)height;
float* frameBuffer = rtsFrameBuffer();
rts::RTstate sample;
rtu::float3 resultColor;
int x, y;
const float* grid;
unsigned int gridSize;
float ratio;
switch( _gridRes )
{
case TWO_BY_TWO:
grid = TWO_BY_TWO_GRID;
gridSize = 8;
ratio = 0.25f;
break;
case FOUR_BY_FOUR:
grid = FOUR_BY_FOUR_GRID;
gridSize = 32;
ratio = 0.0625f;
break;
default:
return;
}
int chunk = 16;
#pragma omp parallel for shared( frameBuffer, h, w ) private( y ) schedule( dynamic, chunk )
for( y = 0; y < h; ++y )
{
#pragma omp parallel for shared( frameBuffer, h, w, y, grid, gridSize, ratio ) private( x, resultColor, sample ) schedule( dynamic, chunk )
for( x = 0; x < w; ++x )
{
resultColor.set( 0.0f, 0.0f, 0.0f );
unsigned int i = 0;
while( i < gridSize )
{
rtsInitPrimaryRayState( sample, (float)x + grid[i++] + rtu::Random::real( -ratio, ratio ),
(float)y + grid[i++] + rtu::Random::real( -ratio, ratio ) );
rtsTraceRay( sample );
resultColor += rtsResultColor( sample );
}
resultColor *= ratio;
frameBuffer[(x+y*w)*3] = resultColor.r;
frameBuffer[(x+y*w)*3+1] = resultColor.g;
frameBuffer[(x+y*w)*3+2] = resultColor.b;
}
}
}
void JitteredRenderer::setGridResolution( GridResolution res )
{
_gridRes = res;
}
} // namespace rtl
| 23.45098 | 141 | 0.557692 | potato3d |
f26bcb26cc4ff77c6d2d9b35e450db33172027db | 20,699 | cpp | C++ | Examples/crosscurrencylgm.cpp | universe1987/QuantLib | bbb0145aff285853755b9f6ed013f53a41163acb | [
"BSD-3-Clause"
] | 4 | 2016-03-28T15:05:23.000Z | 2020-02-17T23:05:57.000Z | Examples/crosscurrencylgm.cpp | universe1987/QuantLib | bbb0145aff285853755b9f6ed013f53a41163acb | [
"BSD-3-Clause"
] | 1 | 2015-02-02T20:32:43.000Z | 2015-02-02T20:32:43.000Z | Examples/crosscurrencylgm.cpp | pcaspers/quantlib | bbb0145aff285853755b9f6ed013f53a41163acb | [
"BSD-3-Clause"
] | 10 | 2015-01-26T14:50:24.000Z | 2015-10-23T07:41:30.000Z | #include <ql/quantlib.hpp>
#include <boost/make_shared.hpp>
// example / tests for multicurrency lgm model
using namespace QuantLib;
void nodelete() {}
int main() {
try {
Date referenceDate(30, July, 2015);
Settings::instance().evaluationDate() = referenceDate;
// the single currency models
// they can be calibrated in the usual way
Handle<YieldTermStructure> eurYts(boost::make_shared<FlatForward>(
referenceDate, 0.02, Actual365Fixed()));
Handle<YieldTermStructure> usdYts(boost::make_shared<FlatForward>(
referenceDate, 0.05, Actual365Fixed()));
std::vector<Date> volstepdates;
std::vector<Real> volsteptimes;
Array volsteptimes_a(0);
std::vector<Real> eurVols(1, atof(getenv("EURVOL")));
std::vector<Real> usdVols(1, atof(getenv("USDVOL")));
std::vector<Real> fxSigmas(1, atof(getenv("FXVOL")));
Array fxSigmas_a(fxSigmas.begin(), fxSigmas.end());
boost::shared_ptr<Lgm1> eurLgm = boost::make_shared<Lgm1>(
eurYts, volstepdates, eurVols, atof(getenv("EURMR")));
boost::shared_ptr<Lgm1> usdLgm = boost::make_shared<Lgm1>(
usdYts, volstepdates, usdVols, atof(getenv("USDMR")));
std::vector<boost::shared_ptr<Lgm1> > singleModels;
singleModels.push_back(eurLgm);
singleModels.push_back(usdLgm);
std::vector<Handle<YieldTermStructure> > curves;
curves.push_back(eurYts);
curves.push_back(usdYts);
// build cc parametrization from scratch
// lgm parametrizations
std::vector<boost::shared_ptr<detail::LgmParametrization<
detail::LgmPiecewiseAlphaConstantKappa> > > lgmParametrizations;
boost::shared_ptr<
detail::LgmParametrization<detail::LgmPiecewiseAlphaConstantKappa> >
eurParam = eurLgm->parametrization();
boost::shared_ptr<
detail::LgmParametrization<detail::LgmPiecewiseAlphaConstantKappa> >
usdParam = usdLgm->parametrization();
lgmParametrizations.push_back(eurParam);
lgmParametrizations.push_back(usdParam);
// fx parametrizations
std::vector<boost::shared_ptr<detail::LgmFxParametrization<
detail::LgmFxPiecewiseSigma> > > fxParametrizations;
boost::shared_ptr<detail::LgmFxParametrization<
detail::LgmFxPiecewiseSigma> > fxParam =
boost::make_shared<detail::LgmFxPiecewiseSigma>(volsteptimes_a,
fxSigmas_a);
fxParametrizations.push_back(fxParam);
// the fx vols, correlations and the cclgmm parametrization / process /
// model
std::vector<Handle<Quote> > fxSpots;
fxSpots.push_back(Handle<Quote>(boost::make_shared<SimpleQuote>(
std::log(0.9090)))); // EUR-USD ~ 1.10
Matrix c(3, 3);
// FX EUR USD
c[0][0] = 1.0; c[0][1] = 0.99; c[0][2] = 0.99; // FX
c[1][0] = 0.99; c[1][1] = 1.0; c[1][2] = 0.99; // EUR
c[2][0] = 0.99; c[2][1] = 0.99; c[2][2] = 1.0; // USD
boost::shared_ptr<detail::CcLgmPiecewise> ccParam =
boost::make_shared<detail::CcLgmPiecewise>(fxParametrizations,
lgmParametrizations, c);
ccParam->update();
// test parametrization
std::clog.precision(12);
// std::clog << "H0(0.0) = " << ccParam->H_i(0,0.0) << std::endl;
// std::clog << "H0(1.0) = " << ccParam->H_i(0,1.0) << std::endl;
// std::clog << "H0(2.0) = " << ccParam->H_i(0,2.0) << std::endl;
// std::clog << "H1(0.0) = " << ccParam->H_i(1,0.0) << std::endl;
// std::clog << "H1(1.0) = " << ccParam->H_i(1,1.0) << std::endl;
// std::clog << "H1(2.0) = " << ccParam->H_i(1,2.0) << std::endl;
// std::clog << "zeta0(0.0) = " << ccParam->zeta_i(0,0.0) << std::endl;
// std::clog << "zeta0(1.0) = " << ccParam->zeta_i(0,1.0) << std::endl;
// std::clog << "zeta0(2.0) = " << ccParam->zeta_i(0,2.0) << std::endl;
// std::clog << "zeta0(3.0) = " << ccParam->zeta_i(0,3.0) << std::endl;
// std::clog << "zeta1(0.0) = " << ccParam->zeta_i(1,0.0) << std::endl;
// std::clog << "zeta1(1.0) = " << ccParam->zeta_i(1,1.0) << std::endl;
// std::clog << "zeta1(2.0) = " << ccParam->zeta_i(1,2.0) << std::endl;
// std::clog << "zeta1(3.0) = " << ccParam->zeta_i(1,3.0) << std::endl;
// std::clog << "alphaialphaj(0.0) = " <<
// ccParam->alpha_i_alpha_j(0,0,0.0) << std::endl;
// std::clog << "alphaialphaj(1.0) = " <<
// ccParam->alpha_i_alpha_j(0,0,1.0) << std::endl;
// std::clog << "alphaialphaj(2.0) = " <<
// ccParam->alpha_i_alpha_j(0,0,2.0) << std::endl;
// std::clog << "alphaialphaj(0.0) = " <<
// ccParam->alpha_i_alpha_j(1,1,0.0) << std::endl;
// std::clog << "alphaialphaj(1.0) = " <<
// ccParam->alpha_i_alpha_j(1,1,1.0) << std::endl;
// std::clog << "alphaialphaj(2.0) = " <<
// ccParam->alpha_i_alpha_j(1,1,2.0) << std::endl;
// std::clog << "alphaialphaj(0.0) = " <<
// ccParam->alpha_i_alpha_j(0,1,0.0) << std::endl;
// std::clog << "alphaialphaj(1.0) = " <<
// ccParam->alpha_i_alpha_j(0,1,1.0) << std::endl;
// std::clog << "alphaialphaj(2.0) = " <<
// ccParam->alpha_i_alpha_j(0,1,2.0) << std::endl;
// std::clog << "alphaialphaj(0.0) = " <<
// ccParam->alpha_i_alpha_j(1,0,0.0) << std::endl;
// std::clog << "alphaialphaj(1.0) = " <<
// ccParam->alpha_i_alpha_j(1,0,1.0) << std::endl;
// std::clog << "alphaialphaj(2.0) = " <<
// ccParam->alpha_i_alpha_j(1,0,2.0) << std::endl;
// std::clog << "sigmaisigmaj(0.0) = " <<
// ccParam->sigma_i_sigma_j(0,0,0.0) << std::endl;
// std::clog << "sigmaisigmaj(1.0) = " <<
// ccParam->sigma_i_sigma_j(0,0,1.0) << std::endl;
// std::clog << "sigmaisigmaj(2.0) = " <<
// ccParam->sigma_i_sigma_j(0,0,2.0) << std::endl;
// std::clog << "alphaisigmaj(0.0) = " <<
// ccParam->alpha_i_sigma_j(0,0,0.0) << std::endl;
// std::clog << "alphaisigmaj(1.0) = " <<
// ccParam->alpha_i_sigma_j(0,0,1.0) << std::endl;
// std::clog << "alphaisigmaj(2.0) = " <<
// ccParam->alpha_i_sigma_j(0,0,2.0) << std::endl;
// std::clog << "alphaisigmaj(0.0) = " <<
// ccParam->alpha_i_sigma_j(1,0,0.0) << std::endl;
// std::clog << "alphaisigmaj(1.0) = " <<
// ccParam->alpha_i_sigma_j(1,0,1.0) << std::endl;
// std::clog << "alphaisigmaj(2.0) = " <<
// ccParam->alpha_i_sigma_j(1,0,2.0) << std::endl;
// std::clog << "HiAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_alpha_i_alpha_j(0,0,0.0) << std::endl;
// std::clog << "HiAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_alpha_i_alpha_j(0,0,1.0) << std::endl;
// std::clog << "HiAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_alpha_i_alpha_j(0,0,2.0) << std::endl;
// std::clog << "HiAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_alpha_i_alpha_j(1,1,0.0) << std::endl;
// std::clog << "HiAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_alpha_i_alpha_j(1,1,1.0) << std::endl;
// std::clog << "HiAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_alpha_i_alpha_j(1,1,2.0) << std::endl;
// std::clog << "HiAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_alpha_i_alpha_j(1,0,0.0) << std::endl;
// std::clog << "HiAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_alpha_i_alpha_j(1,0,1.0) << std::endl;
// std::clog << "HiAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_alpha_i_alpha_j(1,0,2.0) << std::endl;
// std::clog << "HiHjAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_H_j_alpha_i_alpha_j(0,0,0.0) << std::endl;
// std::clog << "HiHjAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_H_j_alpha_i_alpha_j(0,0,1.0) << std::endl;
// std::clog << "HiHjAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_H_j_alpha_i_alpha_j(0,0,2.0) << std::endl;
// std::clog << "HiHjAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_H_j_alpha_i_alpha_j(1,1,0.0) << std::endl;
// std::clog << "HiHjAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_H_j_alpha_i_alpha_j(1,1,1.0) << std::endl;
// std::clog << "HiHjAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_H_j_alpha_i_alpha_j(1,1,2.0) << std::endl;
// std::clog << "HiHjAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_H_j_alpha_i_alpha_j(1,0,0.0) << std::endl;
// std::clog << "HiHjAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_H_j_alpha_i_alpha_j(1,0,1.0) << std::endl;
// std::clog << "HiHjAlphaIAlphaJ(0.0) = " <<
// ccParam->H_i_H_j_alpha_i_alpha_j(1,0,2.0) << std::endl;
// std::clog << "HiAlphaISigmaJ(0.0) = " <<
// ccParam->H_i_alpha_i_sigma_j(0,0,0.0) << std::endl;
// std::clog << "HiAlphaISigmaJ(0.0) = " <<
// ccParam->H_i_alpha_i_sigma_j(0,0,1.0) << std::endl;
// std::clog << "HiAlphaISigmaJ(0.0) = " <<
// ccParam->H_i_alpha_i_sigma_j(0,0,2.0) << std::endl;
// std::clog << "HiAlphaISigmaJ(0.0) = " <<
// ccParam->H_i_alpha_i_sigma_j(1,0,0.0) << std::endl;
// std::clog << "HiAlphaISigmaJ(0.0) = " <<
// ccParam->H_i_alpha_i_sigma_j(1,0,1.0) << std::endl;
// std::clog << "HiAlphaISigmaJ(0.0) = " <<
// ccParam->H_i_alpha_i_sigma_j(1,0,2.0) << std::endl;
// std::clog << "int_alphaialphaj(0.0) = " <<
// ccParam->int_alpha_i_alpha_j(0,0,0.0,0.0) << std::endl;
// std::clog << "int_alphaialphaj(1.0) = " <<
// ccParam->int_alpha_i_alpha_j(0,0,0.0,1.0) << std::endl;
// std::clog << "int_alphaialphaj(2.0) = " <<
// ccParam->int_alpha_i_alpha_j(0,0,0.0,2.0) << std::endl;
// std::clog << "int_alphaialphaj(0.0) = " <<
// ccParam->int_alpha_i_alpha_j(1,1,0.0,0.0) << std::endl;
// std::clog << "int_alphaialphaj(1.0) = " <<
// ccParam->int_alpha_i_alpha_j(1,1,0.0,1.0) << std::endl;
// std::clog << "int_alphaialphaj(2.0) = " <<
// ccParam->int_alpha_i_alpha_j(1,1,0.0,2.0) << std::endl;
// std::clog << "int_alphaialphaj(0.0) = " <<
// ccParam->int_alpha_i_alpha_j(0,1,0.0,0.0) << std::endl;
// std::clog << "int_alphaialphaj(1.0) = " <<
// ccParam->int_alpha_i_alpha_j(0,1,0.0,1.0) << std::endl;
// std::clog << "int_alphaialphaj(2.0) = " <<
// ccParam->int_alpha_i_alpha_j(0,1,0.0,2.0) << std::endl;
// std::clog << "int_alphaialphaj(0.0) = " <<
// ccParam->int_alpha_i_alpha_j(1,0,0.0,0.0) << std::endl;
// std::clog << "int_alphaialphaj(1.0) = " <<
// ccParam->int_alpha_i_alpha_j(1,0,0.0,1.0) << std::endl;
// std::clog << "int_alphaialphaj(2.0) = " <<
// ccParam->int_alpha_i_alpha_j(1,0,0.0,2.0) << std::endl;
// std::clog << "int_sigmaisigmaj(0.0) = " <<
// ccParam->int_sigma_i_sigma_j(0,0,0.0,0.0) << std::endl;
// std::clog << "int_sigmaisigmaj(1.0) = " <<
// ccParam->int_sigma_i_sigma_j(0,0,0.0,1.0) << std::endl;
// std::clog << "int_sigmaisigmaj(2.0) = " <<
// ccParam->int_sigma_i_sigma_j(0,0,0.0,2.0) << std::endl;
// std::clog << "int_alphaisigmaj(0.0) = " <<
// ccParam->int_alpha_i_sigma_j(0,0,0.0,0.0) << std::endl;
// std::clog << "int_alphaisigmaj(1.0) = " <<
// ccParam->int_alpha_i_sigma_j(0,0,0.0,1.0) << std::endl;
// std::clog << "int_alphaisigmaj(2.0) = " <<
// ccParam->int_alpha_i_sigma_j(0,0,0.0,2.0) << std::endl;
// std::clog << "int_alphaisigmaj(0.0) = " <<
// ccParam->int_alpha_i_sigma_j(1,0,0.0,0.0) << std::endl;
// std::clog << "int_alphaisigmaj(1.0) = " <<
// ccParam->int_alpha_i_sigma_j(1,0,0.0,1.0) << std::endl;
// std::clog << "int_alphaisigmaj(2.0) = " <<
// ccParam->int_alpha_i_sigma_j(1,0,0.0,2.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(0.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(0,0,0.0,0.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(1.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(0,0,0.0,1.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(2.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(0,0,0.0,2.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(0.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(1,1,0.0,0.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(1.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(1,1,0.0,1.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(2.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(1,1,0.0,2.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(0.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(0,1,0.0,0.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(1.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(0,1,0.0,1.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(2.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(0,1,0.0,2.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(0.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(1,0,0.0,0.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(1.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(1,0,0.0,1.0) << std::endl;
// std::clog << "int_H_i_alphaialphaj(2.0) = " <<
// ccParam->int_H_i_alpha_i_alpha_j(1,0,0.0,2.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(0.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(0,0,0.0,0.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(1.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(0,0,0.0,1.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(2.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(0,0,0.0,2.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(0.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(1,1,0.0,0.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(1.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(1,1,0.0,1.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(2.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(1,1,0.0,2.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(0.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(0,1,0.0,0.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(1.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(0,1,0.0,1.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(2.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(0,1,0.0,2.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(0.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(1,0,0.0,0.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(1.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(1,0,0.0,1.0) << std::endl;
// std::clog << "int_H_i_H_j_alphaialphaj(2.0) = " <<
// ccParam->int_H_i_H_j_alpha_i_alpha_j(1,0,0.0,2.0) << std::endl;
// std::clog << "int_H_i_alphaisigmaj(0.0) = " <<
// ccParam->int_H_i_alpha_i_sigma_j(0,0,0.0,0.0) << std::endl;
// std::clog << "int_H_i_alphaisigmaj(1.0) = " <<
// ccParam->int_H_i_alpha_i_sigma_j(0,0,0.0,1.0) << std::endl;
// std::clog << "int_H_i_alphaisigmaj(2.0) = " <<
// ccParam->int_H_i_alpha_i_sigma_j(0,0,0.0,2.0) << std::endl;
// std::clog << "int_H_i_alphaisigmaj(0.0) = " <<
// ccParam->int_H_i_alpha_i_sigma_j(1,0,0.0,0.0) << std::endl;
// std::clog << "int_H_i_alphaisigmaj(1.0) = " <<
// ccParam->int_H_i_alpha_i_sigma_j(1,0,0.0,1.0) << std::endl;
// std::clog << "int_H_i_alphaisigmaj(2.0) = " <<
// ccParam->int_H_i_alpha_i_sigma_j(1,0,0.0,2.0) << std::endl;
// std::clog << "rho alpha-alpha 00" << ccParam->rho_alpha_alpha(0,0) <<
// std::endl;
// std::clog << "rho alpha-alpha 01" << ccParam->rho_alpha_alpha(0,1) <<
// std::endl;
// std::clog << "rho alpha-alpha 10" << ccParam->rho_alpha_alpha(1,0) <<
// std::endl;
// std::clog << "rho alpha-alpha 11" << ccParam->rho_alpha_alpha(1,1) <<
// std::endl;
// std::clog << "rho alpha-sigma 00" << ccParam->rho_alpha_sigma(0,0) <<
// std::endl;
// std::clog << "rho alpha-sigma 10" << ccParam->rho_alpha_sigma(1,0) <<
// std::endl;
// std::clog << "rho sigma-sigma 00" << ccParam->rho_sigma_sigma(0,0) <<
// std::endl;
// end test parametrization
boost::shared_ptr<
CcLgmProcess<detail::CcLgmPiecewise, detail::LgmFxPiecewiseSigma,
detail::LgmPiecewiseAlphaConstantKappa> > process =
boost::make_shared<CcLgmProcess<
detail::CcLgmPiecewise, detail::LgmFxPiecewiseSigma,
detail::LgmPiecewiseAlphaConstantKappa> >(ccParam, fxSpots,
curves);
// generate paths
Size n = atoi(getenv("N")); // N paths
Time T = atof(getenv("T")); // cashflow time
Size steps = static_cast<Size>(
T * atof(getenv("STEPS"))); // STEPS steps per year
Size seed = atoi(getenv("SEED")); // rng seed
TimeGrid grid(T, steps);
PseudoRandom::rsg_type sg =
PseudoRandom::make_sequence_generator(steps * 3, seed);
MultiPathGenerator<PseudoRandom::rsg_type> pg(process, grid, sg, false);
PseudoRandom::rsg_type sg2 =
PseudoRandom::make_sequence_generator(steps, seed);
PathGenerator<PseudoRandom::rsg_type> pg2(usdLgm->stateProcess(), grid,
sg2, false);
std::vector<Sample<MultiPath> > paths;
for (Size j = 0; j < n; ++j) {
paths.push_back(pg.next());
}
std::vector<Sample<Path> > paths2;
for (Size j = 0; j < n; ++j) {
paths2.push_back(pg2.next());
}
// output paths for visual inspection in gnuplot
if (atoi(getenv("OUTPUT"))) {
// cc model paths
for (Size i = 0; i < paths[0].value[0].length(); ++i) {
std::cout << grid[i] << " ";
for (Size j = 0; j < n; ++j) {
std::cout << std::exp(paths[j].value[0][i]) << " "
<< paths[j].value[1][i] << " "
<< paths[j].value[2][i] << " "
<< paths2[j].value[i] << " ";
}
std::cout << "\n";
}
}
// test: 1 USD in 1y, priced in domestic measure
Size l = paths[0].value[0].length() - 1;
IncrementalStatistics stat, stat2;
for (Size j = 0; j < n; ++j) {
Real fx = std::exp(paths[j].value[0][l]);
Real zeur = paths[j].value[1][l];
Real zusd = paths[j].value[2][l];
Real zusd2 = paths2[j].value[l];
Real stddev = eurLgm->stateProcess()->stdDeviation(0.0, 0.0, T);
Real stddev2 = usdLgm->stateProcess()->stdDeviation(0.0, 0.0, T);
Real y = (zeur - eurLgm->stateProcess()->expectation(0.0, 0.0, T)) /
(!close_enough(stddev, 0.0) ? stddev : 1.0);
Real y2 =
(zusd2 - usdLgm->stateProcess()->expectation(0.0, 0.0, T)) /
(!close_enough(stddev2, 0.0) ? stddev2 : 1.0);
stat.add(1.0 * fx / eurLgm->numeraire(T, y));
stat2.add(1.0 / usdLgm->numeraire(T, y2));
}
std::clog << "1 USD @ 1y = " << stat.mean() << " EUR +/- "
<< stat.errorEstimate() << std::endl;
;
std::clog << "curve price = " << usdYts->discount(T) << " spot "
<< std::exp(fxSpots[0]->value()) << " EUR price "
<< usdYts->discount(T) * std::exp(fxSpots[0]->value())
<< "\n";
std::clog << "1 USD @ 1y = " << stat2.mean() << " USD +/-"
<< stat2.errorEstimate() << std::endl;
return 0;
} catch (QuantLib::Error e) {
std::clog << "ql exception : " << e.what() << "\n";
} catch (std::exception e) {
std::clog << "std exception: " << e.what() << "\n";
}
}
| 49.997585 | 80 | 0.529977 | universe1987 |
f26bd1be8170507920e279813564d69867ee8aa1 | 22,112 | cpp | C++ | unittests/adt/test_sstring_view.cpp | paulhuggett/pstore2 | a0c663d10a2e2713fdf39ecdae1f9c1e96041f5c | [
"Apache-2.0"
] | 11 | 2018-02-02T21:24:49.000Z | 2020-12-11T04:06:03.000Z | unittests/adt/test_sstring_view.cpp | SNSystems/pstore | 74e9dd960245d6bfc125af03ed964d8ad660a62d | [
"Apache-2.0"
] | 63 | 2018-02-05T17:24:59.000Z | 2022-03-22T17:26:28.000Z | unittests/adt/test_sstring_view.cpp | paulhuggett/pstore | 067be94d87c87fce524c8d76c6f47c347d8f1853 | [
"Apache-2.0"
] | 5 | 2020-01-13T22:47:11.000Z | 2021-05-14T09:31:15.000Z | //===- unittests/adt/test_sstring_view.cpp --------------------------------===//
//* _ _ _ *
//* ___ ___| |_ _ __(_)_ __ __ _ __ _(_) _____ __ *
//* / __/ __| __| '__| | '_ \ / _` | \ \ / / |/ _ \ \ /\ / / *
//* \__ \__ \ |_| | | | | | | (_| | \ V /| | __/\ V V / *
//* |___/___/\__|_| |_|_| |_|\__, | \_/ |_|\___| \_/\_/ *
//* |___/ *
//===----------------------------------------------------------------------===//
//
// Part of the pstore project, under the Apache License v2.0 with LLVM Exceptions.
// See https://github.com/SNSystems/pstore/blob/master/LICENSE.txt for license
// information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "pstore/adt/sstring_view.hpp"
// Standard library includes
#include <cstring>
#include <sstream>
// 3rd party
#include <gmock/gmock.h>
namespace {
std::shared_ptr<char> new_shared (std::string const & s) {
auto result = std::shared_ptr<char> (new char[s.size ()], [] (char * p) { delete[] p; });
std::copy (std::begin (s), std::end (s), result.get ());
return result;
}
template <typename T>
struct string_maker {};
template <typename CharType>
struct string_maker<std::shared_ptr<CharType>> {
std::shared_ptr<CharType> operator() (std::string const & str) const {
auto ptr =
std::shared_ptr<char> (new char[str.length ()], [] (char * p) { delete[] p; });
std::copy (std::begin (str), std::end (str), ptr.get ());
return std::static_pointer_cast<CharType> (ptr);
}
};
template <typename CharType>
struct string_maker<std::unique_ptr<CharType[]>> {
std::unique_ptr<CharType[]> operator() (std::string const & str) const {
auto ptr =
std::make_unique<typename std::remove_const<CharType>::type[]> (str.length ());
std::copy (std::begin (str), std::end (str), ptr.get ());
return std::unique_ptr<CharType[]>{ptr.release ()};
}
};
template <>
struct string_maker<char const *> {
char const * operator() (std::string const & str) const noexcept { return str.data (); }
};
template <typename StringType>
class SStringViewInit : public ::testing::Test {};
using SStringViewInitTypes =
::testing::Types<string_maker<std::shared_ptr<char>>,
string_maker<std::shared_ptr<char const>>,
string_maker<std::unique_ptr<char[]>>,
string_maker<std::unique_ptr<char const[]>>, string_maker<char const *>>;
// The pstore APIs that return shared_ptr<> and unique_ptr<> sstring_views is named
// make_shared_sstring_view() and make_unique_sstring_view() respectively to try to avoid
// confusion about the ownership of the memory. However, here, I'd like all of the functions to
// have the same name.
template <typename ValueType>
inline pstore::sstring_view<std::shared_ptr<ValueType>>
make_sstring_view (std::shared_ptr<ValueType> const & ptr, std::size_t length) {
return pstore::make_shared_sstring_view (ptr, length);
}
template <typename ValueType>
inline pstore::sstring_view<std::unique_ptr<ValueType>>
make_sstring_view (std::unique_ptr<ValueType> ptr, std::size_t length) {
return pstore::make_unique_sstring_view (std::move (ptr), length);
}
} // end anonymous namespace
#ifdef PSTORE_IS_INSIDE_LLVM
TYPED_TEST_CASE (SStringViewInit, SStringViewInitTypes);
#else
TYPED_TEST_SUITE (SStringViewInit, SStringViewInitTypes, );
#endif // PSTORE_IS_INSIDE_LLVM
TYPED_TEST (SStringViewInit, Empty) {
using namespace pstore;
TypeParam t;
std::string const src;
auto ptr = t (src);
auto sv = make_sstring_view (std::move (ptr), src.length ());
EXPECT_EQ (sv.size (), 0U);
EXPECT_EQ (sv.length (), 0U);
EXPECT_EQ (sv.max_size (), std::numeric_limits<std::size_t>::max ());
EXPECT_TRUE (sv.empty ());
EXPECT_EQ (std::distance (std::begin (sv), std::end (sv)), 0);
}
TYPED_TEST (SStringViewInit, Short) {
using namespace pstore;
TypeParam t;
std::string const src{"hello"};
auto ptr = t (src);
auto sv = make_sstring_view (std::move (ptr), src.length ());
EXPECT_EQ (sv.size (), 5U);
EXPECT_EQ (sv.length (), 5U);
EXPECT_EQ (sv.max_size (), std::numeric_limits<std::size_t>::max ());
EXPECT_FALSE (sv.empty ());
EXPECT_EQ (std::distance (std::begin (sv), std::end (sv)), 5);
}
TEST (SStringView, FromSpan) {
using namespace pstore;
std::array<char, 5> const src{{'a', 'r', 'r', 'a', 'y'}};
auto sv = make_sstring_view (gsl::make_span (src));
EXPECT_THAT (sv, ::testing::ElementsAreArray (src));
}
TEST (SStringView, OperatorIndex) {
std::string const src{"ABCDE"};
pstore::sstring_view<char const *> sv = pstore::make_sstring_view (src.data (), src.length ());
ASSERT_EQ (sv.length (), src.length ());
EXPECT_FALSE (sv.empty ());
EXPECT_EQ (sv[0], 'A');
EXPECT_EQ (sv[1], 'B');
EXPECT_EQ (sv[4], 'E');
}
TEST (SStringView, At) {
std::string const src{"ABCDE"};
pstore::sstring_view<char const *> sv = pstore::make_sstring_view (src.data (), src.length ());
ASSERT_EQ (sv.length (), src.length ());
EXPECT_FALSE (sv.empty ());
EXPECT_EQ (sv.at (0), 'A');
EXPECT_EQ (sv.at (1), 'B');
EXPECT_EQ (sv.at (4), 'E');
#ifdef PSTORE_EXCEPTIONS
EXPECT_THROW (sv.at (5), std::out_of_range);
#endif // PSTORE_EXCEPTIONS
}
TEST (SStringView, Back) {
std::string const src{"ABCDE"};
auto const length = src.length ();
std::shared_ptr<char> ptr = new_shared (src);
pstore::sstring_view<std::shared_ptr<char>> sv = pstore::make_shared_sstring_view (ptr, length);
ASSERT_EQ (sv.length (), length);
EXPECT_EQ (sv.back (), src[length - 1]);
EXPECT_EQ (&sv.back (), sv.data () + length - 1U);
}
TEST (SStringView, Data) {
std::string const src{"ABCDE"};
auto const length = src.length ();
std::shared_ptr<char> ptr = new_shared (src);
pstore::sstring_view<std::shared_ptr<char>> sv = pstore::make_shared_sstring_view (ptr, length);
ASSERT_EQ (sv.length (), length);
EXPECT_EQ (sv.data (), ptr.get ());
}
TEST (SStringView, Front) {
std::string const src{"ABCDE"};
auto const length = src.length ();
std::shared_ptr<char> ptr = new_shared (src);
pstore::sstring_view<std::shared_ptr<char>> sv = pstore::make_shared_sstring_view (ptr, length);
ASSERT_EQ (sv.length (), length);
EXPECT_EQ (sv.front (), src[0]);
EXPECT_EQ (&sv.front (), sv.data ());
}
TEST (SStringView, Index) {
std::string const src{"ABCDE"};
auto const length = src.length ();
std::shared_ptr<char> ptr = new_shared (src);
pstore::sstring_view<std::shared_ptr<char>> sv = pstore::make_shared_sstring_view (ptr, length);
EXPECT_EQ (sv[0], src[0]);
EXPECT_EQ (&sv[0], ptr.get () + 0);
EXPECT_EQ (sv[1], src[1]);
EXPECT_EQ (&sv[1], ptr.get () + 1);
EXPECT_EQ (sv[4], src[4]);
EXPECT_EQ (&sv[4], ptr.get () + 4);
}
TEST (SStringView, RBeginEmpty) {
std::string const src;
using sv_type = pstore::sstring_view<char const *>;
sv_type sv = pstore::make_sstring_view (src.data (), src.length ());
sv_type const & csv = sv;
sv_type::reverse_iterator rbegin = sv.rbegin ();
sv_type::const_reverse_iterator const_rbegin1 = csv.rbegin ();
sv_type::const_reverse_iterator const_rbegin2 = sv.crbegin ();
EXPECT_EQ (rbegin, const_rbegin1);
EXPECT_EQ (rbegin, const_rbegin2);
EXPECT_EQ (const_rbegin1, const_rbegin2);
}
TEST (SStringView, RBegin) {
std::string const src{"abc"};
using sv_type = pstore::sstring_view<char const *>;
sv_type sv = pstore::make_sstring_view (src.data (), src.length ());
sv_type const & csv = sv;
sv_type::reverse_iterator rbegin = sv.rbegin ();
sv_type::const_reverse_iterator const_begin1 = csv.rbegin ();
sv_type::const_reverse_iterator const_begin2 = sv.crbegin ();
std::size_t const last = sv.size () - 1;
EXPECT_EQ (*rbegin, sv[last]);
EXPECT_EQ (&*rbegin, &sv[last]);
EXPECT_EQ (*const_begin1, sv[last]);
EXPECT_EQ (&*const_begin1, &sv[last]);
EXPECT_EQ (*const_begin2, sv[last]);
EXPECT_EQ (&*const_begin2, &sv[last]);
EXPECT_EQ (rbegin, const_begin1);
EXPECT_EQ (rbegin, const_begin2);
EXPECT_EQ (const_begin1, const_begin2);
}
TEST (SStringView, REndEmpty) {
std::string const src{""};
using sv_type = pstore::sstring_view<char const *>;
sv_type sv = pstore::make_sstring_view (src.data (), src.length ());
sv_type const & csv = sv;
sv_type::reverse_iterator rend = sv.rend ();
sv_type::const_reverse_iterator const_rend1 = csv.rend ();
sv_type::const_reverse_iterator const_rend2 = sv.crend ();
EXPECT_EQ (rend, sv.rbegin ());
EXPECT_EQ (const_rend1, csv.rbegin ());
EXPECT_EQ (const_rend2, sv.rbegin ());
EXPECT_EQ (rend - sv.rbegin (), 0);
EXPECT_EQ (const_rend1 - csv.rbegin (), 0);
EXPECT_EQ (const_rend2 - sv.crbegin (), 0);
EXPECT_EQ (rend, const_rend1);
EXPECT_EQ (rend, const_rend2);
EXPECT_EQ (const_rend1, const_rend2);
}
TEST (SStringView, REnd) {
std::string const src{"abc"};
using sv_type = pstore::sstring_view<char const *>;
sv_type sv = pstore::make_sstring_view (src.data (), src.length ());
sv_type const & csv = sv;
sv_type::reverse_iterator rend = sv.rend ();
sv_type::const_reverse_iterator const_rend1 = csv.rend ();
sv_type::const_reverse_iterator const_rend2 = sv.crend ();
EXPECT_NE (rend, sv.rbegin ());
EXPECT_NE (const_rend1, csv.rbegin ());
EXPECT_NE (const_rend2, sv.rbegin ());
EXPECT_EQ (rend - sv.rbegin (), 3);
EXPECT_EQ (const_rend1 - csv.rbegin (), 3);
EXPECT_EQ (const_rend2 - sv.crbegin (), 3);
EXPECT_EQ (rend, const_rend1);
EXPECT_EQ (rend, const_rend2);
EXPECT_EQ (const_rend1, const_rend2);
}
TEST (SStringView, Clear) {
std::string const empty_str;
pstore::sstring_view<char const *> empty =
pstore::make_sstring_view (empty_str.data (), empty_str.length ());
{
std::string const abc_str{"abc"};
pstore::sstring_view<char const *> sv1 =
pstore::make_sstring_view (abc_str.data (), abc_str.length ());
sv1.clear ();
EXPECT_EQ (sv1.size (), 0U);
EXPECT_EQ (sv1, empty);
}
{
pstore::sstring_view<char const *> sv2 =
pstore::make_sstring_view (empty_str.data (), empty_str.length ());
sv2.clear ();
EXPECT_EQ (sv2.size (), 0U);
EXPECT_EQ (sv2, empty);
}
}
TEST (SStringView, FindChar) {
std::string const src{"abc"};
using sv_type = pstore::sstring_view<char const *>;
sv_type sv = pstore::make_sstring_view (src.data (), src.length ());
EXPECT_EQ (sv.find ('a'), 0U);
EXPECT_EQ (sv.find ('c'), 2U);
EXPECT_EQ (sv.find ('d'), sv_type::npos);
EXPECT_EQ (sv.find ('c', 1U), 2U);
EXPECT_EQ (sv.find ('c', 3U), sv_type::npos);
}
TEST (SStringView, Substr) {
std::string const src{"abc"};
using sv_type = pstore::sstring_view<char const *>;
sv_type sv = pstore::make_sstring_view (src.data (), src.length ());
EXPECT_EQ (sv.substr (0U, 1U), "a");
EXPECT_EQ (sv.substr (0U, 4U), "abc");
EXPECT_EQ (sv.substr (1U, 1U), "b");
EXPECT_EQ (sv.substr (3U, 1U), "");
}
TEST (SStringView, OperatorWrite) {
auto check = [] (std::string const & str) {
auto view = pstore::make_sstring_view (str.data (), str.length ());
std::ostringstream stream;
stream << view;
EXPECT_EQ (stream.str (), str);
};
check ("");
check ("abcdef");
check ("hello world");
}
namespace {
template <typename StringType>
class SStringViewRelational : public ::testing::Test {};
class sstringview_maker {
public:
explicit sstringview_maker (char const * s)
: view_ (pstore::make_sstring_view (s, std::strlen (s))) {}
operator pstore::sstring_view<char const *> () const noexcept { return view_; }
private:
pstore::sstring_view<char const *> view_;
};
using StringTypes = ::testing::Types<sstringview_maker, sstringview_maker const, char const *>;
} // end anonymous namespace
namespace pstore {
template <>
struct string_traits<sstringview_maker> {
static std::size_t length (sstring_view<char const *> const & s) noexcept {
return string_traits<sstring_view<char const *>>::length (s);
}
static char const * data (sstring_view<char const *> const & s) noexcept {
return string_traits<sstring_view<char const *>>::data (s);
}
};
} // end namespace pstore
#ifdef PSTORE_IS_INSIDE_LLVM
TYPED_TEST_CASE (SStringViewRelational, StringTypes);
#else
TYPED_TEST_SUITE (SStringViewRelational, StringTypes, );
#endif
TYPED_TEST (SStringViewRelational, Eq) {
#define EQ(lhs, rhs, x) \
do { \
auto const lhs_view = pstore::make_sstring_view ((lhs), std::strlen (lhs)); \
EXPECT_EQ (lhs_view == (rhs), (x)); \
EXPECT_EQ ((rhs) == lhs_view, (x)); \
} while (0)
EQ ("", TypeParam (""), true);
EQ ("", TypeParam ("abcde"), false);
EQ ("", TypeParam ("abcdefghij"), false);
EQ ("", TypeParam ("abcdefghijklmnopqrst"), false);
EQ ("abcde", TypeParam (""), false);
EQ ("abcde", TypeParam ("abcde"), true);
EQ ("abcde", TypeParam ("abcdefghij"), false);
EQ ("abcde", TypeParam ("abcdefghijklmnopqrst"), false);
EQ ("abcdefghij", TypeParam (""), false);
EQ ("abcdefghij", TypeParam ("abcde"), false);
EQ ("abcdefghij", TypeParam ("abcdefghij"), true);
EQ ("abcdefghij", TypeParam ("abcdefghijklmnopqrst"), false);
EQ ("abcdefghijklmnopqrst", TypeParam (""), false);
EQ ("abcdefghijklmnopqrst", TypeParam ("abcde"), false);
EQ ("abcdefghijklmnopqrst", TypeParam ("abcdefghij"), false);
EQ ("abcdefghijklmnopqrst", TypeParam ("abcdefghijklmnopqrst"), true);
#undef EQ
}
TYPED_TEST (SStringViewRelational, Ne) {
#define NE(lhs, rhs, x) \
do { \
auto const lhs_view = pstore::make_sstring_view ((lhs), std::strlen (lhs)); \
EXPECT_EQ (lhs_view != (rhs), (x)); \
EXPECT_EQ ((rhs) != lhs_view, (x)); \
} while (0)
NE ("", TypeParam (""), false);
NE ("", TypeParam ("abcde"), true);
NE ("", TypeParam ("abcdefghij"), true);
NE ("", TypeParam ("abcdefghijklmnopqrst"), true);
NE ("abcde", TypeParam (""), true);
NE ("abcde", TypeParam ("abcde"), false);
NE ("abcde", TypeParam ("abcdefghij"), true);
NE ("abcde", TypeParam ("abcdefghijklmnopqrst"), true);
NE ("abcdefghij", TypeParam (""), true);
NE ("abcdefghij", TypeParam ("abcde"), true);
NE ("abcdefghij", TypeParam ("abcdefghij"), false);
NE ("abcdefghij", TypeParam ("abcdefghijklmnopqrst"), true);
NE ("abcdefghijklmnopqrst", TypeParam (""), true);
NE ("abcdefghijklmnopqrst", TypeParam ("abcde"), true);
NE ("abcdefghijklmnopqrst", TypeParam ("abcdefghij"), true);
NE ("abcdefghijklmnopqrst", TypeParam ("abcdefghijklmnopqrst"), false);
#undef NE
}
TYPED_TEST (SStringViewRelational, Ge) {
#define GE(lhs, rhs, x, y) \
do { \
auto const lhs_view = pstore::make_sstring_view ((lhs), std::strlen (lhs)); \
EXPECT_EQ (lhs_view >= (rhs), (x)); \
EXPECT_EQ ((rhs) >= lhs_view, (y)); \
} while (0)
GE ("", TypeParam (""), true, true);
GE ("", TypeParam ("abcde"), false, true);
GE ("", TypeParam ("abcdefghij"), false, true);
GE ("", TypeParam ("abcdefghijklmnopqrst"), false, true);
GE ("abcde", TypeParam (""), true, false);
GE ("abcde", TypeParam ("abcde"), true, true);
GE ("abcde", TypeParam ("abcdefghij"), false, true);
GE ("abcde", TypeParam ("abcdefghijklmnopqrst"), false, true);
GE ("abcdefghij", TypeParam (""), true, false);
GE ("abcdefghij", TypeParam ("abcde"), true, false);
GE ("abcdefghij", TypeParam ("abcdefghij"), true, true);
GE ("abcdefghij", TypeParam ("abcdefghijklmnopqrst"), false, true);
GE ("abcdefghijklmnopqrst", TypeParam (""), true, false);
GE ("abcdefghijklmnopqrst", TypeParam ("abcde"), true, false);
GE ("abcdefghijklmnopqrst", TypeParam ("abcdefghij"), true, false);
GE ("abcdefghijklmnopqrst", TypeParam ("abcdefghijklmnopqrst"), true, true);
#undef GE
}
TYPED_TEST (SStringViewRelational, Gt) {
#define GT(lhs, rhs, x, y) \
do { \
auto const lhs_view = pstore::make_sstring_view ((lhs), std::strlen (lhs)); \
EXPECT_EQ (lhs_view > (rhs), (x)); \
EXPECT_EQ ((rhs) > lhs_view, (y)); \
} while (0)
GT ("", TypeParam (""), false, false);
GT ("", TypeParam ("abcde"), false, true);
GT ("", TypeParam ("abcdefghij"), false, true);
GT ("", TypeParam ("abcdefghijklmnopqrst"), false, true);
GT ("abcde", TypeParam (""), true, false);
GT ("abcde", TypeParam ("abcde"), false, false);
GT ("abcde", TypeParam ("abcdefghij"), false, true);
GT ("abcde", TypeParam ("abcdefghijklmnopqrst"), false, true);
GT ("abcdefghij", TypeParam (""), true, false);
GT ("abcdefghij", TypeParam ("abcde"), true, false);
GT ("abcdefghij", TypeParam ("abcdefghij"), false, false);
GT ("abcdefghij", TypeParam ("abcdefghijklmnopqrst"), false, true);
GT ("abcdefghijklmnopqrst", TypeParam (""), true, false);
GT ("abcdefghijklmnopqrst", TypeParam ("abcde"), true, false);
GT ("abcdefghijklmnopqrst", TypeParam ("abcdefghij"), true, false);
GT ("abcdefghijklmnopqrst", TypeParam ("abcdefghijklmnopqrst"), false, false);
#undef GT
}
TYPED_TEST (SStringViewRelational, Le) {
#define LE(lhs, rhs, x, y) \
do { \
auto const lhs_view = pstore::make_sstring_view ((lhs), std::strlen (lhs)); \
EXPECT_EQ (lhs_view <= (rhs), bool{(x)}); \
EXPECT_EQ ((rhs) <= lhs_view, bool{(y)}); \
} while (0)
LE ("", TypeParam (""), true, true);
LE ("", TypeParam ("abcde"), true, false);
LE ("", TypeParam ("abcdefghij"), true, false);
LE ("", TypeParam ("abcdefghijklmnopqrst"), true, false);
LE ("abcde", TypeParam (""), false, true);
LE ("abcde", TypeParam ("abcde"), true, true);
LE ("abcde", TypeParam ("abcdefghij"), true, false);
LE ("abcde", TypeParam ("abcdefghijklmnopqrst"), true, false);
LE ("abcdefghij", TypeParam (""), false, true);
LE ("abcdefghij", TypeParam ("abcde"), false, true);
LE ("abcdefghij", TypeParam ("abcdefghij"), true, true);
LE ("abcdefghij", TypeParam ("abcdefghijklmnopqrst"), true, false);
LE ("abcdefghijklmnopqrst", TypeParam (""), false, true);
LE ("abcdefghijklmnopqrst", TypeParam ("abcde"), false, true);
LE ("abcdefghijklmnopqrst", TypeParam ("abcdefghij"), false, true);
LE ("abcdefghijklmnopqrst", TypeParam ("abcdefghijklmnopqrst"), true, true);
#undef LE
}
TYPED_TEST (SStringViewRelational, Lt) {
#define LT(lhs, rhs, x, y) \
do { \
auto const lhs_view = pstore::make_sstring_view ((lhs), std::strlen (lhs)); \
EXPECT_EQ ((lhs_view < rhs), bool{(x)}); \
EXPECT_EQ ((rhs < lhs_view), bool{(y)}); \
} while (0)
LT ("", TypeParam (""), false, false);
LT ("", TypeParam ("abcde"), true, false);
LT ("", TypeParam ("abcdefghij"), true, false);
LT ("", TypeParam ("abcdefghijklmnopqrst"), true, false);
LT ("abcde", TypeParam (""), false, true);
LT ("abcde", TypeParam ("abcde"), false, false);
LT ("abcde", TypeParam ("abcdefghij"), true, false);
LT ("abcde", TypeParam ("abcdefghijklmnopqrst"), true, false);
LT ("abcdefghij", TypeParam (""), false, true);
LT ("abcdefghij", TypeParam ("abcde"), false, true);
LT ("abcdefghij", TypeParam ("abcdefghij"), false, false);
LT ("abcdefghij", TypeParam ("abcdefghijklmnopqrst"), true, false);
LT ("abcdefghijklmnopqrst", TypeParam (""), false, true);
LT ("abcdefghijklmnopqrst", TypeParam ("abcde"), false, true);
LT ("abcdefghijklmnopqrst", TypeParam ("abcdefghij"), false, true);
LT ("abcdefghijklmnopqrst", TypeParam ("abcdefghijklmnopqrst"), false, false);
#undef LE
}
| 41.56391 | 100 | 0.566751 | paulhuggett |
f26c090c52e3139604be765557f6fe10cb2b2fd4 | 9,734 | cpp | C++ | ModulePlayer2.cpp | Alejandromo125/3DPhysicsProject | 89976b0c6f28881c9eb4aac008c010b348cb4dbb | [
"MIT"
] | null | null | null | ModulePlayer2.cpp | Alejandromo125/3DPhysicsProject | 89976b0c6f28881c9eb4aac008c010b348cb4dbb | [
"MIT"
] | null | null | null | ModulePlayer2.cpp | Alejandromo125/3DPhysicsProject | 89976b0c6f28881c9eb4aac008c010b348cb4dbb | [
"MIT"
] | null | null | null | #include "Globals.h"
#include "Application.h"
#include "ModulePlayer.h"
#include "Primitive.h"
#include "PhysVehicle3D.h"
#include "PhysBody3D.h"
#include "ModuleCamera3D.h"
#include "ModuleSceneIntro.h"
#include "Timer.h"
ModulePlayer2::ModulePlayer2(Application* app, bool start_enabled) : Module(app, start_enabled), vehicle(NULL)
{
turn = acceleration = brake = 0.0f;
jump_coolddown.Start();
}
ModulePlayer2::~ModulePlayer2()
{}
// Load assets
bool ModulePlayer2::Start()
{
LOG("Loading player");
VehicleInfo car;
// Car properties ----------------------------------------
car.chassis_size.Set(0.85, 2, 4.5);
car.chassis2_size.Set(1.3, 2, 1.5);
car.chassis3_size.Set(1, 1.4, 1.3);
car.chassis4_size.Set(1.25, 1, 1);
car.chassis10_size.Set(2.5, 0.4, 0.6);
car.chassis_offset.Set(0, 1, 0);
car.chassis2_offset.Set(0, 1.8, -0.2);
car.chassis3_offset.Set(0, 0.7, 1.8);
car.chassis4_offset.Set(0, 2.2, -2.4);
car.chassis10_offset.Set(0, 2.1, 2.3);
car.mass = 130.0f;
car.suspensionStiffness = 26.10f;
car.suspensionCompression = 1.42f;
car.suspensionDamping = 2.35f;
car.maxSuspensionTravelCm = 510.0f;
car.frictionSlip = 100.5;
car.maxSuspensionForce = 1000.0f;
// Wheel properties ---------------------------------------
float connection_height = 0.8f;
float wheel_radius = 0.6f;
float wheel_width = 0.5f;
float suspensionRestLength = 0.8f;
// Don't change anything below this line ------------------
float half_width = car.chassis_size.x * 0.65f;
float half_length = car.chassis_size.z * 0.65f;
vec3 direction(0, -1, 0);
vec3 axis(-1, 0, 0);
car.num_wheels = 4;
car.wheels = new Wheel[4];
// FRONT-LEFT ------------------------
car.wheels[0].connection.Set(half_width - 0.6f * wheel_width, connection_height, half_length - wheel_radius);
car.wheels[0].direction = direction;
car.wheels[0].axis = axis;
car.wheels[0].suspensionRestLength = suspensionRestLength;
car.wheels[0].radius = wheel_radius;
car.wheels[0].width = wheel_width;
car.wheels[0].front = true;
car.wheels[0].drive = true;
car.wheels[0].brake = false;
car.wheels[0].steering = true;
// FRONT-RIGHT ------------------------
car.wheels[1].connection.Set(-half_width + 0.6f * wheel_width, connection_height, half_length - wheel_radius);
car.wheels[1].direction = direction;
car.wheels[1].axis = axis;
car.wheels[1].suspensionRestLength = suspensionRestLength;
car.wheels[1].radius = wheel_radius;
car.wheels[1].width = wheel_width;
car.wheels[1].front = true;
car.wheels[1].drive = true;
car.wheels[1].brake = false;
car.wheels[1].steering = true;
// REAR-LEFT ------------------------
car.wheels[2].connection.Set(half_width - 0.6f * wheel_width, connection_height, -half_length + wheel_radius);
car.wheels[2].direction = direction;
car.wheels[2].axis = axis;
car.wheels[2].suspensionRestLength = suspensionRestLength;
car.wheels[2].radius = wheel_radius;
car.wheels[2].width = wheel_width;
car.wheels[2].front = false;
car.wheels[2].drive = false;
car.wheels[2].brake = true;
car.wheels[2].steering = false;
// REAR-RIGHT ------------------------
car.wheels[3].connection.Set(-half_width + 0.6f * wheel_width, connection_height, -half_length + wheel_radius);
car.wheels[3].direction = direction;
car.wheels[3].axis = axis;
car.wheels[3].suspensionRestLength = suspensionRestLength;
car.wheels[3].radius = wheel_radius;
car.wheels[3].width = wheel_width;
car.wheels[3].front = false;
car.wheels[3].drive = false;
car.wheels[3].brake = true;
car.wheels[3].steering = false;
vehicle = App->physics->AddVehicle(car);
vehicle->SetPos(4, 5, 0);
//vehicle->collision_listeners.add(this);
vehicle->collision_listeners.add(App->scene_intro);
vehicle->vehicle->getRigidBody()->setUserPointer(vehicle);
initialPosition = vehicle->vehicle->getChassisWorldTransform().getOrigin();
currentPlayerPosition = vehicle->vehicle->getChassisWorldTransform().getOrigin();
//App->physics->AddConstraintP2P(*decorBody->body, *vehicle->body, car.rear_chassis_offset, car.rear_chassis_offset);
inDirt = false;
return true;
}
// Unload assets
bool ModulePlayer2::CleanUp()
{
LOG("Unloading player");
return true;
}
// Update: draw background
update_status ModulePlayer2::Update(float dt)
{
if (App->scene_intro->vehicleIndex == 2)
{
turn = acceleration = brake = 0.0f;
if ((winCondition == false && looseCondition == false && App->scene_intro->trueLooseCondition == false) && App->scene_intro->sceneBeginTimer > 220)
{
if (App->input->GetKey(SDL_SCANCODE_UP) == KEY_REPEAT && (vehicle->GetKmh() < 120))
{
acceleration = MAX_ACCELERATION;
}
if (App->input->GetKey(SDL_SCANCODE_DOWN) == KEY_REPEAT && (vehicle->GetKmh() > -30))
{
if (vehicle->GetKmh() > 10)
{
brake = BRAKE_POWER / 24;
}
else
{
if (vehicle->GetKmh() < -30)
{
acceleration = MAX_ACCELERATION * 5;
}
acceleration = -MAX_ACCELERATION * 5;
}
}
if (App->input->GetKey(SDL_SCANCODE_LEFT) == KEY_REPEAT)
{
if (turn < TURN_DEGREES)
turn += TURN_DEGREES;
}
if (App->input->GetKey(SDL_SCANCODE_RIGHT) == KEY_REPEAT)
{
if (turn > -TURN_DEGREES)
turn -= TURN_DEGREES;
}
if (App->input->GetKey(SDL_SCANCODE_SPACE) == KEY_DOWN)
{
if ((jump_coolddown.Read() * 0.001) >= JUMP_COOLDOWN)
{
vehicle->Push(0.0f, JUMP_IMPULSE, 0.0f);
jump_coolddown.Start();
}
}
}
if (App->input->GetKey(SDL_SCANCODE_R) == KEY_DOWN)
{
App->scene_intro->lapSensorActivated = false;
App->player->vehicle->SetPos(initialPosition.x(), initialPosition.y(), initialPosition.z());
mat4x4 tr;
tr.rotate(0, vec3(0, 1, 0));
vehicle->vehicle->getRigidBody()->setAngularVelocity(btVector3(0, 0, 0));
vehicle->SetTransform(&tr);
vehicle->SetLinearVelocity(0, 0, 0);
}
vehicle->ApplyEngineForce(acceleration);
vehicle->Turn(turn);
vehicle->Brake(brake);
if (!App->input->GetKey(SDL_SCANCODE_UP) && !App->input->GetKey(SDL_SCANCODE_DOWN))
{
vehicle->ApplyEngineForce(App->physics->DragForce(vehicle->GetKmh()));
}
vehicle->Render();
float jump_cooldown_calc = 0.0f;
jump_cooldown_calc = JUMP_COOLDOWN - jump_coolddown.Read() * 0.001f;
if (jump_cooldown_calc < 0)
jump_cooldown_calc = 0;
int tiemer_milisec_read = 0;
//tiemer_milisec_read = game_timer.Read() - chickens_taken * 2000;
if (tiemer_milisec_read <= 0)
{
tiemer_milisec_read = 0;
}
if (winCondition == false || looseCondition == false)delay++;
if ((delay % 60) == 0 && winCondition == false)
{
seconds++;
}
if (seconds == 60 && winCondition == false)
{
seconds = 0;
minutes++;
}
if (winCondition == true || looseCondition == true)
{
seconds = seconds;
minutes = minutes;
}
if (App->input->GetKey(SDL_SCANCODE_P) == KEY_DOWN)
{
winCondition = true;
}
if (lap1 == true && lapDone == true)
{
lastSeconds = seconds;
lastMinutes = minutes;
lap2 = true;
lapDone = false;
lap1 = false;
}
if (lap2 == true && lapDone == true)
{
lastSeconds = seconds;
lastMinutes = minutes;
lap3 = true;
lapDone = false;
lap2 = false;
}
if (lap3 == true && lapDone == true)
{
lastSeconds = seconds;
lastMinutes = minutes;
lap4 = true;
lapDone = false;
lap3 = false;
}
if (lap4 == true && lapDone == true)
{
lastSeconds = seconds;
lastMinutes = minutes;
winCondition = true;
lapDone = false;
}
if (inDirt == true)
{
if (vehicle->GetKmh() > 50)
{
vehicle->ApplyEngineForce(App->physics->DragForce(vehicle->GetKmh() + 400.0f));
}
}
if (inDirt == false)
{
if (vehicle->GetKmh() > 120)
{
vehicle->ApplyEngineForce(App->physics->DragForce(vehicle->GetKmh()));
}
}
//AIR CONTROL
btVector3 PositionInTheAir;
PositionInTheAir = vehicle->vehicle->getChassisWorldTransform().getOrigin();
if (PositionInTheAir.getY() > 1)
{
Euler angles = vehicle->GetEulerAngles(vehicle->vehicle->getChassisWorldTransform().getRotation());
if (App->input->GetKey(SDL_SCANCODE_RIGHT) == KEY_REPEAT)
{
angles.yaw -= (DEGTORAD * 4);
btQuaternion q;
q.setEulerZYX(btScalar(angles.yaw), btScalar(angles.pitch), btScalar(angles.roll));
vehicle->SetRotation(q);
}
else if (App->input->GetKey(SDL_SCANCODE_LEFT) == KEY_REPEAT)
{
angles.yaw += (DEGTORAD * 4);
btQuaternion q;
q.setEulerZYX(btScalar(angles.yaw), btScalar(angles.pitch), btScalar(angles.roll));
vehicle->SetRotation(q);
}
}
else if (PositionInTheAir.getY() < -2)
{
App->scene_intro->lapSensorActivated = false;
App->player->vehicle->SetPos(initialPosition.x(), initialPosition.y(), initialPosition.z());
mat4x4 tr;
tr.rotate(0, vec3(0, 1, 0));
vehicle->vehicle->getRigidBody()->setAngularVelocity(btVector3(0, 0, 0));
vehicle->SetTransform(&tr);
vehicle->SetLinearVelocity(0, 0, 0);
}
else
{
vehicle->SetRotation({0, 0,0,1});
}
char title[80];
if (minutes == 4 && seconds == 0)
{
looseCondition == true;
sprintf(title, "You have lost the race");
}
if (winCondition == false)
{
sprintf_s(title, "%.1f Km/h Your Current Time: %d m %d s Your Last Time: %d m %d s", vehicle->GetKmh(), minutes, seconds, lastMinutes, lastSeconds);
}
if (winCondition == true)
{
sprintf_s(title, "Your Final Time: %d m %d s", minutes, seconds);
}
if (winCondition == true)
{
if (vehicle->GetKmh() > 0)
{
vehicle->ApplyEngineForce(App->physics->DragForce(vehicle->GetKmh() + 1000.0f));
}
}
App->window->SetTitle(title);
currentPlayerPosition = vehicle->vehicle->getChassisWorldTransform().getOrigin();
}
return UPDATE_CONTINUE;
}
| 25.548556 | 162 | 0.654818 | Alejandromo125 |
f26ecc78689c1db3b28d14bb7668b1973dcc0f55 | 12,120 | cpp | C++ | 3_Utilities/stream/pezy.cpp | denjiry/samples | 1b97f83cd9077777595b0435c515d0a17701924b | [
"BSD-3-Clause"
] | null | null | null | 3_Utilities/stream/pezy.cpp | denjiry/samples | 1b97f83cd9077777595b0435c515d0a17701924b | [
"BSD-3-Clause"
] | null | null | null | 3_Utilities/stream/pezy.cpp | denjiry/samples | 1b97f83cd9077777595b0435c515d0a17701924b | [
"BSD-3-Clause"
] | 2 | 2019-04-13T05:04:32.000Z | 2019-04-15T07:59:36.000Z | /*!
* @author PEZY Computing, K.K.
* @date 2019
* @copyright BSD-3-Clause
*/
#include "pezy.hpp"
#include <chrono>
#include <fstream>
#include <iostream>
#include <sstream>
#include <stdexcept>
namespace {
inline size_t getFileSize(std::ifstream& file)
{
file.seekg(0, std::ios::end);
size_t ret = file.tellg();
file.seekg(0, std::ios::beg);
return ret;
}
inline void loadFile(std::ifstream& file, std::vector<char>& d, size_t size)
{
d.resize(size);
file.read(reinterpret_cast<char*>(d.data()), size);
}
cl::Program createProgram(cl::Context& context, const std::vector<cl::Device>& devices, const std::string& filename)
{
std::ifstream file;
file.open(filename, std::ios::in | std::ios::binary);
if (file.fail()) {
throw "can not open kernel file";
}
size_t filesize = getFileSize(file);
std::vector<char> binary_data;
loadFile(file, binary_data, filesize);
cl::Program::Binaries binaries;
binaries.push_back(std::make_pair(&binary_data[0], filesize));
return cl::Program(context, devices, binaries, nullptr, nullptr);
}
cl::Program createProgram(cl::Context& context, const cl::Device& device, const std::string& filename)
{
std::vector<cl::Device> devices { device };
return createProgram(context, devices, filename);
}
double empty_kernel_execute_time = 0;
void checkSTREAMresults(const double* a, const double* b, const double* c,
size_t STREAM_ARRAY_SIZE, size_t NTIMES)
{
using STREAM_TYPE = double;
STREAM_TYPE aj, bj, cj, scalar;
STREAM_TYPE aSumErr, bSumErr, cSumErr;
STREAM_TYPE aAvgErr, bAvgErr, cAvgErr;
double epsilon;
int ierr, err;
/* reproduce initialization */
aj = 1.0;
bj = 2.0;
cj = 0.0;
/* a[] is modified during timing check */
aj = 2.0E0 * aj;
/* now execute timing loop */
scalar = 3.0;
for (size_t k = 0; k < NTIMES; k++) {
cj = aj;
bj = scalar * cj;
cj = aj + bj;
aj = bj + scalar * cj;
}
/* accumulate deltas between observed and expected results */
aSumErr = 0.0;
bSumErr = 0.0;
cSumErr = 0.0;
for (size_t j = 0; j < STREAM_ARRAY_SIZE; j++) {
aSumErr += abs(a[j] - aj);
bSumErr += abs(b[j] - bj);
cSumErr += abs(c[j] - cj);
// if (j == 417) printf("Index 417: c[j]: %f, cj: %f\n",c[j],cj); // MCCALPIN
}
aAvgErr = aSumErr / (STREAM_TYPE)STREAM_ARRAY_SIZE;
bAvgErr = bSumErr / (STREAM_TYPE)STREAM_ARRAY_SIZE;
cAvgErr = cSumErr / (STREAM_TYPE)STREAM_ARRAY_SIZE;
if (sizeof(STREAM_TYPE) == 4) {
epsilon = 1.e-6;
} else if (sizeof(STREAM_TYPE) == 8) {
epsilon = 1.e-13;
} else {
printf("WEIRD: sizeof(STREAM_TYPE) = %lu\n", sizeof(STREAM_TYPE));
epsilon = 1.e-6;
}
err = 0;
if (abs(aAvgErr / aj) > epsilon) {
err++;
printf("Failed Validation on array a[], AvgRelAbsErr > epsilon (%e)\n", epsilon);
printf(" Expected Value: %e, AvgAbsErr: %e, AvgRelAbsErr: %e\n", aj, aAvgErr, abs(aAvgErr) / aj);
ierr = 0;
for (size_t j = 0; j < STREAM_ARRAY_SIZE; j++) {
if (abs(a[j] / aj - 1.0) > epsilon) {
ierr++;
#ifdef VERBOSE
if (ierr < 10) {
printf(" array a: index: %ld, expected: %e, observed: %e, relative error: %e\n",
j, aj, a[j], abs((aj - a[j]) / aAvgErr));
}
#endif
}
}
printf(" For array a[], %d errors were found.\n", ierr);
}
if (abs(bAvgErr / bj) > epsilon) {
err++;
printf("Failed Validation on array b[], AvgRelAbsErr > epsilon (%e)\n", epsilon);
printf(" Expected Value: %e, AvgAbsErr: %e, AvgRelAbsErr: %e\n", bj, bAvgErr, abs(bAvgErr) / bj);
printf(" AvgRelAbsErr > Epsilon (%e)\n", epsilon);
ierr = 0;
for (size_t j = 0; j < STREAM_ARRAY_SIZE; j++) {
if (abs(b[j] / bj - 1.0) > epsilon) {
ierr++;
#ifdef VERBOSE
if (ierr < 10) {
printf(" array b: index: %ld, expected: %e, observed: %e, relative error: %e\n",
j, bj, b[j], abs((bj - b[j]) / bAvgErr));
}
#endif
}
}
printf(" For array b[], %d errors were found.\n", ierr);
}
if (abs(cAvgErr / cj) > epsilon) {
err++;
printf("Failed Validation on array c[], AvgRelAbsErr > epsilon (%e)\n", epsilon);
printf(" Expected Value: %e, AvgAbsErr: %e, AvgRelAbsErr: %e\n", cj, cAvgErr, abs(cAvgErr) / cj);
printf(" AvgRelAbsErr > Epsilon (%e)\n", epsilon);
ierr = 0;
for (size_t j = 0; j < STREAM_ARRAY_SIZE; j++) {
if (abs(c[j] / cj - 1.0) > epsilon) {
ierr++;
#ifdef VERBOSE
if (ierr < 10) {
printf(" array c: index: %ld, expected: %e, observed: %e, relative error: %e\n",
j, cj, c[j], abs((cj - c[j]) / cAvgErr));
}
#endif
}
}
printf(" For array c[], %d errors were found.\n", ierr);
}
if (err == 0) {
printf("Solution Validates: avg error less than %e on all three arrays\n", epsilon);
}
#ifdef VERBOSE
printf("Results Validation Verbose Results: \n");
printf(" Expected a(1), b(1), c(1): %f %f %f \n", aj, bj, cj);
printf(" Observed a(1), b(1), c(1): %f %f %f \n", a[1], b[1], c[1]);
printf(" Rel Errors on a, b, c: %e %e %e \n", abs(aAvgErr / aj), abs(bAvgErr / bj), abs(cAvgErr / cj));
#endif
}
}
pezy::pezy(size_t device_id)
{
init(device_id);
}
void pezy::init(size_t device_id)
{
try {
// Get Platform
std::vector<cl::Platform> platforms;
cl::Platform::get(&platforms);
const auto& Platform = platforms[0];
// Get devices
std::vector<cl::Device> devices;
Platform.getDevices(CL_DEVICE_TYPE_DEFAULT, &devices);
if (device_id > devices.size()) {
std::cerr << "Invalid device id. Use first device." << std::endl;
device_id = 0;
}
const auto& device = devices[device_id];
context = cl::Context(device);
queue = cl::CommandQueue(context, device, 0);
auto program = createProgram(context, device, "kernel/kernel.pz");
kernels.push_back(cl::Kernel(program, "Empty"));
kernels.push_back(cl::Kernel(program, "Copy"));
kernels.push_back(cl::Kernel(program, "Scale"));
kernels.push_back(cl::Kernel(program, "Add"));
kernels.push_back(cl::Kernel(program, "Triad"));
typedef CL_API_ENTRY pzcl_int(CL_API_CALL * pfnPezyExtSetCacheWriteBuffer)(pzcl_context context, size_t index, bool enable);
pfnPezyExtSetCacheWriteBuffer clExtSetCacheWriteBuffer = (pfnPezyExtSetCacheWriteBuffer)clGetExtensionFunctionAddress("pezy_set_cache_writebuffer");
if (!clExtSetCacheWriteBuffer) {
throw cl::Error(-1, "clGetExtensionFunctionAddress: Can not get pezy_set_cache_writebuffer");
}
if ((clExtSetCacheWriteBuffer(context(), 0, CL_TRUE)) != CL_SUCCESS) {
throw cl::Error(-1, "clExtSetCacheWriteBuffer failed");
}
// Get global work size.
// sc1-64: 8192 (1024 PEs * 8 threads)
// sc2 : 15782 (1984 PEs * 8 threads)
{
std::string device_name;
device.getInfo(CL_DEVICE_NAME, &device_name);
size_t global_work_size_[3] = { 0 };
device.getInfo(CL_DEVICE_MAX_WORK_ITEM_SIZES, &global_work_size_);
global_work_size = global_work_size_[0];
if (device_name.find("PEZY-SC2") != std::string::npos) {
global_work_size = std::min(global_work_size, (size_t)15872);
}
std::cout << "Use device : " << device_name << std::endl;
std::cout << "workitem : " << global_work_size << std::endl;
}
} catch (const cl::Error& e) {
std::stringstream msg;
msg << "CL Error : " << e.what() << " " << e.err();
throw std::runtime_error(msg.str());
}
}
std::vector<std::vector<double>> pezy::run(size_t STREAM_ARRAY_SIZE, size_t NTIMES, size_t OFFSET)
{
std::vector<std::vector<double>> times(NTIMES);
for (auto& t : times) {
t.resize(4);
}
// create buffer
size_t allocate_num = STREAM_ARRAY_SIZE + OFFSET;
double* h_a = new double[allocate_num];
double* h_b = new double[allocate_num];
double* h_c = new double[allocate_num];
std::fill(h_a, h_a + allocate_num, 1.0);
std::fill(h_b, h_b + allocate_num, 2.0);
std::fill(h_c, h_c + allocate_num, 0.0);
for (size_t i = 0; i < allocate_num; ++i) {
h_a[i] *= 2.0;
}
double scalar = 3.0;
try {
// empty kernel run
for (size_t i = 0; i < NTIMES; ++i) {
empty_kernel_execute_time += Empty();
}
empty_kernel_execute_time /= static_cast<double>(NTIMES);
// create device buffer & write
auto d_a = cl::Buffer(context, CL_MEM_READ_WRITE, sizeof(double) * allocate_num);
auto d_b = cl::Buffer(context, CL_MEM_READ_WRITE, sizeof(double) * allocate_num);
auto d_c = cl::Buffer(context, CL_MEM_READ_WRITE, sizeof(double) * allocate_num);
queue.enqueueWriteBuffer(d_a, true, 0, sizeof(double) * allocate_num, h_a);
queue.enqueueWriteBuffer(d_b, true, 0, sizeof(double) * allocate_num, h_b);
queue.enqueueWriteBuffer(d_c, true, 0, sizeof(double) * allocate_num, h_c);
for (size_t i = 0; i < NTIMES; ++i) {
times[i][0] = Copy(d_c, d_a, STREAM_ARRAY_SIZE);
times[i][1] = Scale(d_b, d_c, scalar, STREAM_ARRAY_SIZE);
times[i][2] = Add(d_c, d_a, d_b, STREAM_ARRAY_SIZE);
times[i][3] = Triad(d_a, d_b, d_c, scalar, STREAM_ARRAY_SIZE);
}
queue.enqueueReadBuffer(d_a, true, 0, sizeof(double) * allocate_num, h_a);
queue.enqueueReadBuffer(d_b, true, 0, sizeof(double) * allocate_num, h_b);
queue.enqueueReadBuffer(d_c, true, 0, sizeof(double) * allocate_num, h_c);
} catch (const cl::Error& e) {
std::stringstream msg;
msg << "CL Error : " << e.what() << " " << e.err();
throw std::runtime_error(msg.str());
}
// verify
checkSTREAMresults(h_a, h_b, h_c, STREAM_ARRAY_SIZE, NTIMES);
delete[] h_a;
delete[] h_b;
delete[] h_c;
return times;
}
double pezy::Kick(cl::Kernel& kernel)
{
auto start = std::chrono::high_resolution_clock::now();
cl::Event event;
queue.enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(global_work_size), cl::NDRange(), nullptr, &event);
event.wait();
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::milli> dur = (end - start);
return dur.count() / 1000.0;
}
double pezy::Empty()
{
auto& kernel = kernels[0];
return Kick(kernel);
}
double pezy::Copy(cl::Buffer c, cl::Buffer a, size_t num)
{
auto& kernel = kernels[1];
kernel.setArg(0, c);
kernel.setArg(1, a);
kernel.setArg(2, num);
return Kick(kernel);
}
double pezy::Scale(cl::Buffer b, cl::Buffer c, double scalar, size_t num)
{
auto& kernel = kernels[2];
kernel.setArg(0, b);
kernel.setArg(1, c);
kernel.setArg(2, scalar);
kernel.setArg(3, num);
return Kick(kernel);
}
double pezy::Add(cl::Buffer c, cl::Buffer a, cl::Buffer b, size_t num)
{
auto& kernel = kernels[3];
kernel.setArg(0, c);
kernel.setArg(1, a);
kernel.setArg(2, b);
kernel.setArg(3, num);
return Kick(kernel);
}
double pezy::Triad(cl::Buffer a, cl::Buffer b, cl::Buffer c, double scalar, size_t num)
{
auto& kernel = kernels[4];
kernel.setArg(0, a);
kernel.setArg(1, b);
kernel.setArg(2, c);
kernel.setArg(3, scalar);
kernel.setArg(4, num);
return Kick(kernel);
}
| 32.148541 | 156 | 0.572607 | denjiry |
f275977141ce0ab0a9da12f8f20b41b89411457c | 730 | cpp | C++ | hdu/2109.cpp | bashell/oj | 9471e32d735168148390d42029998187e0e04e2b | [
"MIT"
] | null | null | null | hdu/2109.cpp | bashell/oj | 9471e32d735168148390d42029998187e0e04e2b | [
"MIT"
] | null | null | null | hdu/2109.cpp | bashell/oj | 9471e32d735168148390d42029998187e0e04e2b | [
"MIT"
] | null | null | null | #include <cstdio>
#include <algorithm>
using namespace std;
int china[101];
int japan[101];
int main()
{
//freopen("in.txt", "r", stdin);
int n;
while(scanf("%d", &n) && n) {
for(int i = 0; i < n; ++i)
scanf("%d", &china[i]);
for(int i = 0; i < n; ++i)
scanf("%d", &japan[i]);
sort(china, china+n);
sort(japan, japan+n);
int score1 = 0, score2 = 0;
for(int i = 0; i < n; ++i) {
if(china[i] > japan[i])
score1 += 2;
else if(china[i] < japan[i])
score2 += 2;
else
++score1, ++score2;
}
printf("%d vs %d\n", score1, score2);
}
return 0;
}
| 22.8125 | 45 | 0.419178 | bashell |
f276e5ae0dc07829c7d03206726169e309cd3e57 | 1,590 | cpp | C++ | test.cpp | yuanzhubi/mpsc_wait_free | 5a1f966c228756dbed6f8ec4d3cdc63833d20540 | [
"MIT"
] | 2 | 2018-08-27T11:43:51.000Z | 2019-03-28T08:41:31.000Z | test.cpp | yuanzhubi/mpsc_wait_free | 5a1f966c228756dbed6f8ec4d3cdc63833d20540 | [
"MIT"
] | null | null | null | test.cpp | yuanzhubi/mpsc_wait_free | 5a1f966c228756dbed6f8ec4d3cdc63833d20540 | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "mpsc.h"
#include <time.h>
size_t produce_failed_count = 0;
struct X {
clock_t start;
X(){
start = clock();
}
~X(){
char buf[32];
snprintf(buf, 32,"%f %f",(double)(clock()-start), double(produce_failed_count));
perror(buf);
}
}timer;
__thread int gindex = 0;
#define BUF_STRING2(x) #x
#define BUF_STRING(x) BUF_STRING2(x)
#define LOG_PATTERN "File: " __FILE__ ", line: " BUF_STRING(__LINE__) ", "
bool produce(char* dest, unsigned int length){
snprintf(dest, length, LOG_PATTERN "|%d\r\n", gindex++);
return true;
}
void consume(char* dest, unsigned int length){
printf(dest);
}
/*
void consume(char* dest, unsigned int length){
write(1, dest, length);
memset(dest, ' ', length);
}
*/
mpsc_queue mpsc_er(1<<12, 18);
void* producer(void*){
while(gindex < 1000000){
if(!mpsc_er.produce(produce, 64)){
++produce_failed_count;
}
}
return 0;
}
volatile bool bisexit = false;
void* consumer(void*){
while(!bisexit){
mpsc_er.consume(consume);
}
return 0;
}
#include <pthread.h>
int main(){
const int max_threads = 18;
pthread_t ntid[max_threads + 1];
pthread_create(ntid, NULL, consumer, NULL);
for(int i = 1; i<=max_threads;++i){
pthread_create(ntid + i, NULL, producer, NULL);
}
for(int i = 1; i<=max_threads;++i){
pthread_join(ntid[i], NULL);
}
bisexit = true;
pthread_join(ntid[0], NULL);
return 0;
}
| 21.2 | 96 | 0.603145 | yuanzhubi |
f27fbf234d770d6edc4402b271a95e0a0599243b | 6,068 | cpp | C++ | Source/ComputeEngine/Cuda/Buffers/CudaHostBuffer.cpp | Fillo7/KTT | a0c252efb75a8366450e2df589f0ae641f015312 | [
"MIT"
] | 32 | 2017-09-12T23:52:52.000Z | 2020-12-09T07:13:24.000Z | Source/ComputeEngine/Cuda/Buffers/CudaHostBuffer.cpp | Fillo7/KTT | a0c252efb75a8366450e2df589f0ae641f015312 | [
"MIT"
] | 23 | 2017-05-11T14:38:45.000Z | 2021-02-03T13:45:14.000Z | Source/ComputeEngine/Cuda/Buffers/CudaHostBuffer.cpp | Fillo7/KTT | a0c252efb75a8366450e2df589f0ae641f015312 | [
"MIT"
] | 5 | 2017-11-06T12:40:05.000Z | 2020-06-16T13:11:24.000Z | #ifdef KTT_API_CUDA
#include <algorithm>
#include <Api/KttException.h>
#include <ComputeEngine/Cuda/Actions/CudaTransferAction.h>
#include <ComputeEngine/Cuda/Buffers/CudaHostBuffer.h>
#include <ComputeEngine/Cuda/CudaStream.h>
#include <ComputeEngine/Cuda/CudaUtility.h>
#include <Utility/ErrorHandling/Assert.h>
#include <Utility/Logger/Logger.h>
namespace ktt
{
CudaHostBuffer::CudaHostBuffer(KernelArgument& argument, IdGenerator<TransferActionId>& generator) :
CudaBuffer(argument, generator),
m_RawBuffer(nullptr)
{
Logger::LogDebug("Initializing CUDA host buffer with id " + std::to_string(m_Argument.GetId()));
KttAssert(GetMemoryLocation() == ArgumentMemoryLocation::Host || GetMemoryLocation() == ArgumentMemoryLocation::HostZeroCopy,
"Argument memory location mismatch");
if (GetMemoryLocation() == ArgumentMemoryLocation::Host)
{
CheckError(cuMemAllocHost(&m_RawBuffer, m_BufferSize), "cuMemAllocHost");
}
else
{
m_RawBuffer = argument.GetData();
CheckError(cuMemHostRegister(m_RawBuffer, m_BufferSize, CU_MEMHOSTREGISTER_DEVICEMAP), "cuMemHostRegister");
}
CheckError(cuMemHostGetDevicePointer(&m_Buffer, m_RawBuffer, 0), "cuMemHostGetDevicePointer");
}
CudaHostBuffer::CudaHostBuffer(KernelArgument& argument, IdGenerator<TransferActionId>& generator, ComputeBuffer userBuffer) :
CudaBuffer(argument, generator, userBuffer),
m_RawBuffer(nullptr)
{
Logger::LogDebug("Initializing CUDA host buffer with id " + std::to_string(m_Argument.GetId()));
KttAssert(GetMemoryLocation() == ArgumentMemoryLocation::Host || GetMemoryLocation() == ArgumentMemoryLocation::HostZeroCopy,
"Argument memory location mismatch");
if (userBuffer == nullptr)
{
throw KttException("The provided user CUDA buffer is not valid");
}
m_Buffer = reinterpret_cast<CUdeviceptr>(userBuffer);
}
CudaHostBuffer::~CudaHostBuffer()
{
Logger::LogDebug("Releasing CUDA host buffer with id " + std::to_string(m_Argument.GetId()));
if (m_UserOwned)
{
return;
}
if (GetMemoryLocation() == ArgumentMemoryLocation::Host)
{
CheckError(cuMemFreeHost(m_RawBuffer), "cuMemFreeHost");
}
else
{
CheckError(cuMemHostUnregister(m_RawBuffer), "cuMemHostUnregister");
}
}
std::unique_ptr<CudaTransferAction> CudaHostBuffer::UploadData(const CudaStream& stream, const void* source,
const size_t dataSize)
{
Logger::LogDebug("Uploading data into CUDA host buffer with id " + std::to_string(m_Argument.GetId()));
if (m_BufferSize < dataSize)
{
throw KttException("Size of data to upload is larger than size of buffer");
}
const auto id = m_Generator.GenerateId();
auto action = std::make_unique<CudaTransferAction>(id);
CheckError(cuEventRecord(action->GetStartEvent(), stream.GetStream()), "cuEventRecord");
CheckError(cuMemcpyHtoDAsync(m_Buffer, source, dataSize, stream.GetStream()), "cuMemcpyHtoDAsync");
CheckError(cuEventRecord(action->GetEndEvent(), stream.GetStream()), "cuEventRecord");
return action;
}
std::unique_ptr<CudaTransferAction> CudaHostBuffer::DownloadData(const CudaStream& stream, void* destination,
const size_t dataSize) const
{
Logger::LogDebug("Downloading data from CUDA host buffer with id " + std::to_string(m_Argument.GetId()));
if (m_BufferSize < dataSize)
{
throw KttException("Size of data to download is larger than size of buffer");
}
const auto id = m_Generator.GenerateId();
auto action = std::make_unique<CudaTransferAction>(id);
CheckError(cuEventRecord(action->GetStartEvent(), stream.GetStream()), "cuEventRecord");
CheckError(cuMemcpyDtoHAsync(destination, m_Buffer, dataSize, stream.GetStream()), "cuMemcpyDtoHAsync");
CheckError(cuEventRecord(action->GetEndEvent(), stream.GetStream()), "cuEventRecord");
return action;
}
std::unique_ptr<CudaTransferAction> CudaHostBuffer::CopyData(const CudaStream& stream, const CudaBuffer& source,
const size_t dataSize)
{
Logger::LogDebug("Copying data into CUDA host buffer with id " + std::to_string(m_Argument.GetId())
+ " from buffer with id " + std::to_string(source.GetArgumentId()));
if (m_BufferSize < dataSize)
{
throw KttException("Size of data to copy is larger than size of target buffer");
}
if (source.GetSize() < dataSize)
{
throw KttException("Size of data to copy is larger than size of source buffer");
}
const auto id = m_Generator.GenerateId();
auto action = std::make_unique<CudaTransferAction>(id);
CheckError(cuEventRecord(action->GetStartEvent(), stream.GetStream()), "cuEventRecord");
CheckError(cuMemcpyDtoDAsync(m_Buffer, *source.GetBuffer(), dataSize, stream.GetStream()), "cuMemcpyDtoDAsync");
CheckError(cuEventRecord(action->GetEndEvent(), stream.GetStream()), "cuEventRecord");
return action;
}
void CudaHostBuffer::Resize(const size_t newSize, const bool preserveData)
{
Logger::LogDebug("Resizing CUDA host buffer with id " + std::to_string(m_Argument.GetId()));
if (m_UserOwned)
{
throw KttException("Resize operation on user owned buffer is not supported");
}
if (GetMemoryLocation() == ArgumentMemoryLocation::HostZeroCopy)
{
throw KttException("Resize operation on registered host buffer is not supported");
}
if (m_BufferSize == newSize)
{
return;
}
void* newRawBuffer = nullptr;
CUdeviceptr newBuffer;
CheckError(cuMemAllocHost(&newRawBuffer, newSize), "cuMemAllocHost");
CheckError(cuMemHostGetDevicePointer(&newBuffer, newRawBuffer, 0), "cuMemHostGetDevicePointer");
if (preserveData)
{
CheckError(cuMemcpyDtoD(newBuffer, m_Buffer, std::min(m_BufferSize, newSize)), "cuMemcpyDtoD");
}
CheckError(cuMemFreeHost(m_RawBuffer), "cuMemFreeHost");
m_RawBuffer = newRawBuffer;
m_Buffer = newBuffer;
m_BufferSize = newSize;
}
} // namespace ktt
#endif // KTT_API_CUDA
| 34.477273 | 129 | 0.718029 | Fillo7 |
f281acac1787036957d6edba0581e7c13580b91f | 24,586 | cpp | C++ | Documents/RacimoAire/RacimoAire3/racimo3.cpp | JoseSalamancaCoy/RACIMO_AIRE | 628d6ff184a30af0efd25bff675b0006500d4ba2 | [
"MIT"
] | null | null | null | Documents/RacimoAire/RacimoAire3/racimo3.cpp | JoseSalamancaCoy/RACIMO_AIRE | 628d6ff184a30af0efd25bff675b0006500d4ba2 | [
"MIT"
] | null | null | null | Documents/RacimoAire/RacimoAire3/racimo3.cpp | JoseSalamancaCoy/RACIMO_AIRE | 628d6ff184a30af0efd25bff675b0006500d4ba2 | [
"MIT"
] | null | null | null | #include "racimo3.h"
Racimo3::Racimo3(QObject *parent)
: QObject(parent)
{
blinkLed = false;
AlertRAM = false;
AlertTemperatura = false;
NewData = false;
InitAPP =true;
AlertWifi =false;
_timeoutlectura =false;
AlertPMS=false;
AlertOPC=false;
ShutdownManual=false;
RebootManual=false;
_CerrarApp=false;
Delta_muestra_muestra = 10000;
contReboot_rstApp = 0;
MetaData._StatusWIFI =false;
contReboot_rstApp = 0;
BlinkLeds = new QTimer;
BlinkLeds->setInterval(250);
BlinkLeds->start();
connect(BlinkLeds,&QTimer::timeout,this, &Racimo3::Blink);
RA_cGPIO1 = new Crpigpio(true,this);
RA_cGPIO2 = new Crpigpio(false,this);
RA_cGPIO3 = new Crpigpio(false,this);
_DataJson2 = new DataJson2("/home/pi/RACIMOAIRE/Configuracion/JsonBase.json","/home/pi/RACIMOAIRE/");
RA_cGPIO1->SetPinMode(GPIOWiFi,PI_OUTPUT);
RA_cGPIO1->SetPinMode(GPIOTransmision,PI_OUTPUT);
RA_cGPIO1->SetPinMode(GPIOButton,PI_INPUT); //Configura como entrada
RA_cGPIO1->SetPullUpDown(GPIOButton,PI_PUD_DOWN); //Abilita resistencias de positivo
RA_cGPIO1->SetISRgpio(GPIOButton,2,100000); //Configura la interrupcion (pin,flanco,timeout uS) flanco=0 = rising
connect(RA_cGPIO1,&Crpigpio::OnCallBackISR, this, &Racimo3::OnISR);
RA_cPMS = new PMS(RA_cGPIO1,GPIOPMSSet, GPIOPMSReSet, GPIOPMSRX,Delta_muestra_muestra);
RA_cGPS = new GPS(RA_cGPIO1, GPIOGPSRX, GPIOGPSPPS);
RA_cOPC = new OPCN2(RA_cGPIO1,0,0);
RA_cBME280 = new Adafruit_BME280(RA_cGPIO1,0x77);
RA_cOPC->setFanAndLaserOff();
RA_cPMS->sleep();
RA_cGADC = new ADS1115(RA_cGPIO2);
RA_cGADC->setGain(GAIN_TWOTHIRDS);
RA_cGADC->setRate(RATE_128); // 128SPS (default)
RA_cGADC->setOSMode(OSMODE_SINGLE); // Set to start a single-conversion
RA_cCorriente = new Adafruit_INA219(RA_cGPIO3);
uint32_t MuestraPromedio = (3*60000) + 20000 ;
RA_cDataParticulado1 = new DataParticulado(RA_cOPC , RA_cPMS ,Delta_muestra_muestra, MuestraPromedio,this);
RA_cDataParticulado1->Pasivo();
DateTimer = new CDateTimer("/home/pi/RACIMOAIRE/Configuracion/TimeConfig.txt",this);
connect(DateTimer,&CDateTimer::timeout, this, &Racimo3::Muestra);
TimeoutLectura = new QTimer();
TimeoutLectura->setInterval(250000);
connect(TimeoutLectura,&QTimer::timeout, this, &Racimo3::setTimeoutlectura);
TimerAlertWifi = new QTimer;
TimerAlertWifi->setInterval(60000);
connect(TimerAlertWifi, &QTimer::timeout, this, &Racimo3::timeoutAlertWifi);
Timer = new QTimer();
Timer->setInterval(500);
Timer->start();
connect(RA_cDataParticulado1,&DataParticulado::DataOk,this, &Racimo3::DataOk1);
connect(RA_cDataParticulado1,&DataParticulado::DataOkPMS,this, &Racimo3::DataParticuladoOkPMS1);
connect(RA_cDataParticulado1,&DataParticulado::DataOkOPC,this, &Racimo3::DataParticuladoOkOPC1);
connect(Timer, &QTimer::timeout, this, &Racimo3::Show);
TimeDataLogs =new QTimer;
TimeDataLogs->setInterval(5000);
TimeDataLogs->start();
LogsThread = new LogsSystem(this);
connect(TimeDataLogs,&QTimer::timeout, this, &Racimo3::DataLogs);
connect(LogsThread,&LogsSystem::SignalTemperatura,this, &Racimo3::SlotTemperatura);
connect(LogsThread,&LogsSystem::SignalRAM,this, &Racimo3::SlotRAM);
connect(LogsThread,&LogsSystem::SignalProcesos,this, &Racimo3::SlotProcesos);
connect(LogsThread,&LogsSystem::SignalSOCKET,this, &Racimo3::SlotSOCKET);
connect(LogsThread,&LogsSystem::SignalStatusWIFI,this, &Racimo3::SlotStatusWIFI);
connect(LogsThread,&LogsSystem::SignalEspacioDisco,this, &Racimo3::SlotEspacioDisco);
connect(RA_cGPS, &GPS::newData,this, &Racimo3::newDataGPS);
LogsThread->start(QThread::HighPriority);
RstData();
Serial =new NextionRaspberrypi(RA_cGPIO1,9600,15);
nexInit(Serial);
txt_temp = new NexText(Serial,0,9,"t7");
txt_Presion = new NexText(Serial,0,10,"t8");
txt_hum = new NexText(Serial,0,13,"t11");
txt_longitud = new NexText(Serial,0,15,"t13");
txt_latitud = new NexText(Serial,0,18,"t16");
txt_Altitud = new NexText(Serial,0,19,"t17");
txt_Fix = new NexText(Serial,0,17,"t15");
txt_wifi = new NexText(Serial,0,20,"t18");
txt_PM25_P = new NexText(Serial,0,25,"t23");
txt_PM25_O = new NexText(Serial,0,29,"t27");
txt_PM10_P = new NexText(Serial,0,26,"t24");
txt_PM10_0 = new NexText(Serial,0,30,"t28");
txt_temp->setText("null");QThread::msleep(10);
txt_Presion->setText("null");QThread::msleep(10);
txt_hum->setText("null");QThread::msleep(10);
txt_longitud->setText("null");QThread::msleep(10);
txt_latitud->setText("null");QThread::msleep(10);
txt_Altitud->setText("null");QThread::msleep(10);
txt_Fix->setText("0");QThread::msleep(10);
txt_wifi->setText("No");QThread::msleep(10);
txt_PM25_P->setText("null");QThread::msleep(10);
txt_PM25_O->setText("null");QThread::msleep(10);
txt_PM10_P->setText("null");QThread::msleep(10);
txt_PM10_0->setText("null");QThread::msleep(10);
QTimer::singleShot(4*1000,this,SLOT(check_InitAPP()));
}
Racimo3::~Racimo3()
{
RA_cOPC->setFanAndLaserOff();
RA_cPMS->sleep();
delete RA_cBME280;
delete RA_cGPS;
delete _DataJson2;
delete RA_cDataParticulado1;
delete RA_cOPC;
delete RA_cPMS;
delete RA_cGADC;
delete RA_cCorriente;
delete txt_hum;
delete txt_Presion;
delete txt_temp;
delete txt_longitud;
delete txt_latitud;
delete txt_Altitud;
delete txt_Fix;
delete txt_wifi;
delete txt_PM25_P;
delete txt_PM25_O;
delete txt_PM10_P;
delete txt_PM10_0;
delete Serial;
delete RA_cGPIO1;
delete this;
}
bool Racimo3:: POSTHttp(char *charjson)
{
CURL *hnd = curl_easy_init();
if(hnd)
{
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "http://racimo.mpsig.com:3000/racimohub/v013dev/datasets");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Postman-Token: d75df676-a5e1-448a-8b70-177609f83454");
headers = curl_slist_append(headers, "Cache-Control: no-cache");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, charjson ); //Envio
CURLcode ret = curl_easy_perform(hnd);
if(ret != CURLE_OK) return false;
curl_easy_cleanup(hnd);
curl_global_cleanup();
return true;
}
return false;
}
void Racimo3::SetHora()
{
system("GetHttpCurl >/home/pi/RACIMOAIRE/DataIntercambio/FechaHora.json");
QFile ArchivoFechaHora("/home/pi/RACIMOAIRE/DataIntercambio/FechaHora.json");
if(!ArchivoFechaHora.open(QIODevice::ReadOnly | QIODevice::Text))
{
return;
}
QJsonObject obj;
QJsonDocument doc = QJsonDocument::fromJson(QString(ArchivoFechaHora.readAll()).toUtf8());
// check validity of the document
if(!doc.isNull())
{
if(doc.isObject())
{
obj = doc.object();
}
else
{
qDebug() << "Document is not an object" << endl;
}
}
else
{
qDebug() << "Invalid JSON...\n" << QString(ArchivoFechaHora.readAll()) << endl;
}
QDateTime DateTime = QDateTime::fromString(obj.value("fechahora").toString(),Qt::DateFormat::ISODate);
QString StringFechaHora =DateTime.toLocalTime().toString(Qt::DateFormat::ISODate).replace('T',' ');
char SetHora[38];
sprintf(SetHora,"sudo date --set \"%s\"",StringFechaHora.toStdString().c_str());
qDebug() <<"SetHora en "<<StringFechaHora;
system(SetHora);
}
void Racimo3::check_InitAPP()
{
if(RA_cBME280->InitOk() < 0)
{
_DataJson2->SetDato("alert","Falla al iniciar BME280");
StateBME280 =false;
NewData =true;
}
else StateBME280 =true;
if(RA_cCorriente->getInitOK() < 0)
{
_DataJson2->SetDato("alert","Falla al iniciar IN219");
NewData =true;
StateINA219 =false;
}
else StateINA219 =true;
if(RA_cGADC->getInitOk() < 0)
{
_DataJson2->SetDato("alert","Falla al iniciar ADS1115");
NewData =true;
StateADS1115 =false;
}
else StateADS1115 =true;
QFile file("/home/pi/RACIMOAIRE/RSTRaspi.txt");
if(!file.open(QIODevice::ReadOnly|QIODevice::Text))
{
_DataJson2->SetDato("alert","Inicio de App por cierre inesperado");
qDebug() << "Inicio de App por cierre inesperado";
NewData = true; //habilita la transmision
}
else
{
_DataJson2->SetDato("alert","Inicio de App por reboot");
file.close();
system("rm /home/pi/RACIMOAIRE/RSTRaspi.txt");
qDebug() << "Inicio de App por rst inesperado";
NewData = true; //habilita la transmision
}
_DataJson2->WriteJson(); // genera un .json
_DataJson2->ClearArray(); //elimino cualquier dato cargado en el buffer
DateTimer->StartTimer();
}
bool Racimo3::Transmision()
{\
QStringList _DataJsonString;
if(_DataJson2->readJson(&_DataJsonString)) qDebug() << "Se leyeron los archivos Json";
else qDebug() << "Problemas al leer los archivo Json";
for(int i=0;i<_DataJsonString.length() ; i++)
{
std::string STR = QString(_DataJsonString.operator [](i)).toStdString();
char *String = new char[STR.length() + 1];
strcpy(String, STR.c_str());;
qDebug() << String;
if(!POSTHttp(String)) return false;
delete [] String;
}
return true;
}
void Racimo3::SabeDataCsv()
{
/* QFile file("/home/pi/PMS.csv");
if(!file.open(QIODevice::Append|QIODevice::Text))
{
qDebug() << "Error al abrir el archivo";
return;
}
QString str;
str="";
str += QString::number(PMS_PM1) + ";";
str += QString::number(PMS_PM2_5) + ";";
str += QString::number(PMS_PM10) + ";";
str+= QDateTime::currentDateTimeUtc().toString(Qt::ISODate).replace("Z","."+QString::number(QTime::currentTime().msec())+"Z");
str+="\n";
QTextStream Strem(&file);
Strem << str;
file.close();
QFile file2("/home/pi/OPC.csv");
if(!file2.open(QIODevice::Append|QIODevice::Text))
{
qDebug() << "Error al abrir el archivo";
return;
}
QString str2;
str2="";
str2 += QString::number(OPC_PM1) + ";";
str2 += QString::number(OPC_PM2_5) + ";";
str2 += QString::number(OPC_PM10) + ";";
str2+= QDateTime::currentDateTimeUtc().toString(Qt::ISODate).replace("Z","."+QString::number(QTime::currentTime().msec())+"Z");
str2+="\n";
QTextStream Strem2(&file2);
Strem2 << str2;
file2.close();*/
}
void Racimo3::RstData()
{
PMS_PM1 = 0.0; PMS_PM2_5 = 0.0; PMS_PM10 =0.0;
OPC_PM1 = 0.0; OPC_PM2_5 = 0.0; OPC_PM10 =0.0;
Check_PMS = false; Check_OPC =false;
}
void Racimo3::checkRst_App_Raspi()
{
if(contReboot_rstApp == 2)
{
_CerrarApp = true;
_DataJson2->SetDato("alert", "Alerta Cerrando app manualmente");
_DataJson2->WriteJson();
_DataJson2->ClearArray();
NewData = true;
BlinkLeds->stop();
QTimer::singleShot(20*1000,this,SLOT(CerrarApp()));
Blink();
}
else
{
if(contReboot_rstApp == 3)
{
NewData = true;
BlinkLeds->stop();
RebootManual=true;
_DataJson2->SetDato("alert", "Alerta Reboot manual inminente");
_DataJson2->WriteJson();
_DataJson2->ClearArray();
QTimer::singleShot(20*1000,this,SLOT(ReinicioRaspi()));
Blink();
}
}
contReboot_rstApp = 0;
}
void Racimo3::OnISR(int gpio,int level,quint32 timeout)
{
switch (gpio)
{
case GPIOButton:
if(level) {
TimePushButton.start();
if(contReboot_rstApp == 0) QTimer::singleShot(4*1000,this,SLOT(checkRst_App_Raspi()));
}
else {
int mseconds = TimePushButton.elapsed();
if(mseconds>=2000 && mseconds<=5000)
{
_DataJson2->SetDato("alert", "Alerta apagado manual inminente");
_DataJson2->WriteJson();
_DataJson2->ClearArray();
ShutdownManual =true;
BlinkLeds->stop();
NewData = true;
QTimer::singleShot(20*1000,this,SLOT(ShutdownRaspi()));
Blink();
}
if(mseconds<=1500) contReboot_rstApp++;
qDebug() << contReboot_rstApp;
}
break;
default:
break;
}
return;
qDebug()<< timeout;
}
void Racimo3::Blink()
{
if(RebootManual)
{
for(int i=0; i<18; i++){
RA_cGPIO1->WriteGpio(GPIOWiFi,PI_OFF);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_ON);
QThread::msleep(200);
RA_cGPIO1->WriteGpio(GPIOWiFi,PI_ON);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_OFF);
QThread::msleep(200);
RA_cGPIO1->WriteGpio(GPIOWiFi,PI_OFF);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_OFF);
QThread::msleep(500);
}
}
if(ShutdownManual)
{
for(int i=0; i<50;i++){
RA_cGPIO1->WriteGpio(GPIOWiFi,PI_ON);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_ON);
QThread::msleep(200);
RA_cGPIO1->WriteGpio(GPIOWiFi,PI_OFF);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_OFF);
QThread::msleep(200);
}
}
if(_CerrarApp)
{
for(int i=0; i <8 ; i++){
RA_cGPIO1->WriteGpio(GPIOWiFi,PI_OFF);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_ON);
QThread::msleep(200);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_OFF);
QThread::msleep(200);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_ON);
QThread::msleep(200);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_OFF);
QThread::msleep(200);
RA_cGPIO1->WriteGpio(GPIOWiFi,PI_ON);
QThread::msleep(200);
RA_cGPIO1->WriteGpio(GPIOWiFi,PI_OFF);
QThread::msleep(200);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_ON);
QThread::msleep(200);
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_OFF);
QThread::msleep(500);
}
}
blinkLed = !blinkLed;
if(AlertWifi) RA_cGPIO1->WriteGpio(GPIOWiFi,PI_OFF);
else RA_cGPIO1->WriteGpio(GPIOWiFi,blinkLed);
if(NewData) RA_cGPIO1->WriteGpio(GPIOTransmision,PI_ON);
else RA_cGPIO1->WriteGpio(GPIOTransmision,PI_OFF);
}
void Racimo3::timeoutAlertWifi()
{
AlertWifi = true;
TimerAlertWifi->stop();
_DataJson2->SetDato("alert", "Alerta sin acceso a internet");
}
void Racimo3::DataOk1()
{
}
void Racimo3::DataParticuladoOkPMS1(float PM1Promedio, float PM2_5Promedio, float PM10Promedio)
{
PMS_PM1 = PM1Promedio; PMS_PM2_5 = PM2_5Promedio; PMS_PM10 = PM10Promedio;
Check_PMS=true;
qDebug() << QString("Data PMS1 PM1 = %1 PM2_5 = %2 PM10 = %3 ").arg(PM1Promedio).arg(PM2_5Promedio).arg(PM10Promedio);
_DataJson2->SetDato(_DataJson2->PM10_A,PMS_PM10);
_DataJson2->SetDato(_DataJson2->PM2_5_A,PMS_PM2_5);
_DataJson2->SetDato(_DataJson2->PM1_A,PMS_PM1);
txt_PM25_P->setText(QString::number(static_cast<int>(PM2_5Promedio)).toStdString().c_str());
txt_PM10_P->setText(QString::number(static_cast<int>(PM10Promedio)).toStdString().c_str());
}
void Racimo3::DataParticuladoOkOPC1(float PM1Promedio, float PM2_5Promedio, float PM10Promedio)
{
OPC_PM1 = PM1Promedio; OPC_PM2_5 = PM2_5Promedio; OPC_PM10 = PM10Promedio;
qDebug() << QString("Data OPC1 PM1 = %1 PM2_5 = %2 PM10 = %3 ").arg(PM1Promedio).arg(PM2_5Promedio).arg(PM10Promedio);
Check_OPC= true;
_DataJson2->SetDato(_DataJson2->PM10,OPC_PM10);
_DataJson2->SetDato(_DataJson2->PM2_5, OPC_PM2_5);
_DataJson2->SetDato(_DataJson2->PM1,OPC_PM1);
txt_PM25_O->setText(QString::number(PM2_5Promedio).toStdString().c_str());
txt_PM10_0->setText(QString::number(PM10Promedio).toStdString().c_str());
}
void Racimo3::setTimeoutlectura()
{
_timeoutlectura = true;
}
void Racimo3::Muestra()
{
RA_cDataParticulado1->Muestra();
TimeoutLectura->start();
QThread::msleep(300);
uint16_t CH1 = RA_cGADC->Measure_SingleEnded(0);
uint16_t CH2 = RA_cGADC->Measure_SingleEnded(1);
uint16_t CH3 = RA_cGADC->Measure_SingleEnded(2);
uint16_t CH4 = RA_cGADC->Measure_SingleEnded(3);
int16_t Corriente =RA_cCorriente->getCurrent_mA();
qDebug() << "Corriente" << Corriente;
if(RA_cCorriente->getInitOK() >= 0)
{
_DataJson2->SetDato("c",Corriente*-1);
if(!StateINA219)
{
_DataJson2->SetDato("alert", "Alerta INA219 Reconectado");
StateINA219 =true;
}
}
else
{
if(StateINA219)
{
_DataJson2->SetDato("alert", "Alerta INA219 Desconectado");
StateINA219 =false;
}
if(RA_cCorriente->getInitOK() >= 0) _DataJson2->SetDato("alert", "INA219 Reconectado");
}
if(RA_cGADC->getInitOk()>= 0)
{
_DataJson2->SetDato("v_O",CH1*(6.144/32767)*1.6666);
_DataJson2->SetDato("v_P",CH2*(6.144/32767)*1.6666);
_DataJson2->SetDato("v_B",CH3*(6.144/32767));
_DataJson2->SetDato("v_G",CH4*(6.144/32767));
if(!StateADS1115)
{
_DataJson2->SetDato("alert", "Alerta ADS115 Reconectado");
StateADS1115 =true;
}
}
else
{
if(StateADS1115)
{
_DataJson2->SetDato("alert", "Alerta ADS1115 Desconectado");
StateADS1115 =false;
}
}
}
//Despliegue de datos
void Racimo3::Show()
{
if( _timeoutlectura || (Check_PMS && Check_OPC))
{
if(_timeoutlectura)
{
if(!Check_PMS){
if(!AlertPMS) _DataJson2->SetDato("alert", "Fallo PMS no responde");
AlertPMS = true;
}
else {
if(AlertPMS) _DataJson2->SetDato("alert", "Alerta PMS activo");
AlertPMS = false;
}
if(!Check_OPC){
if(!AlertOPC) _DataJson2->SetDato("alert", "Fallo OPC no responde");
AlertOPC = true;
}
else {
if(AlertOPC) _DataJson2->SetDato("alert", "Alerta OPC activo");
AlertOPC = false;
}
}
TimeoutLectura->stop();
_timeoutlectura= false;
RA_cBME280->takeForcedMeasurement();
float Humedad = RA_cBME280->readHumidity();
RA_cBME280->takeForcedMeasurement();
float Temperatura = RA_cBME280->readTemperature();
RA_cBME280->takeForcedMeasurement();
float Presion = RA_cBME280->readPressure()/100.0F;
RA_cBME280->takeForcedMeasurement();
float Altura = RA_cBME280->readAltitude(1013.25);
if(Humedad!=0 && Temperatura!=0 && Presion!=0 && (RA_cBME280->InitOk() >= 0) )
{
_DataJson2->SetDato(_DataJson2->Temperatura,Temperatura);
_DataJson2->SetDato(_DataJson2->Humedad, Humedad);
_DataJson2->SetDato(_DataJson2->Presion, Presion);
_DataJson2->SetDato("a_BME", Altura);
txt_temp->setText(QString::number(Temperatura).toStdString().c_str());
txt_Presion->setText(QString::number(Presion).toStdString().c_str());
txt_hum->setText(QString::number(Humedad).toStdString().c_str());
if(!StateBME280)
{
_DataJson2->SetDato("alert", "Alerta BME280 Reconectado");
StateBME280 =true;
}
}
else
{
txt_temp->setText("null");
txt_Presion->setText("null");
txt_hum->setText("null");
if(StateBME280)
{
_DataJson2->SetDato("alert", "Alerta BME280 Desconectado");
StateBME280 =false;
}
}
if(_DataGPS.fix !=0)
{
_DataGPS.fix = 0;
_DataJson2->SetDato(_DataJson2->longitud, _DataGPS.longitud);
_DataJson2->SetDato(_DataJson2->latitud, _DataGPS.latitud);
_DataJson2->SetDato("a_GPS", _DataGPS.altura);
_DataJson2->SetDato("fixgps", _DataGPS.fix);
}
else txt_Fix->setText("null");
_DataJson2->SetDato("l_t",MetaData._Temperatura);
_DataJson2->SetDato("l_r",MetaData._RAM);
_DataJson2->SetDato("l_s",MetaData._SOCKET);
_DataJson2->SetDato("l_p",MetaData._Procesos);
_DataJson2->SetDato("l_e",MetaData._EspacioDisco);
if(_DataJson2->WriteJson()) {
qDebug() << "Escribio archivo Json \n";
}
else qDebug() << "Problemas al escribir archivo JSon \n";
_DataJson2->ClearArray();
NewData=true;
SabeDataCsv();
RstData();
DateTimer->StartTimer();
}
}
void Racimo3::DataLogs()
{
LogsThread->CheckESpacioDisco();
LogsThread->CheckProcesos();
LogsThread->CheckRAM();
LogsThread->CheckSOCKET();
LogsThread->CheckStatusWIFI();
LogsThread->CheckTemperatura();
if(MetaData._StatusWIFI)
{
txt_wifi->setText("Si");
if(InitAPP){ SetHora(); InitAPP =false; DateTimer->StartTimer(); }
TimerAlertWifi->stop();
if(AlertWifi) _DataJson2->SetDato("alert", "Alerta con acceso a internet");
AlertWifi =false;
if(NewData)
{
if(Transmision())
{
_DataJson2->ClearJson();
RA_cGPIO1->WriteGpio(GPIOTransmision,PI_OFF);
NewData=false;
}
else _DataJson2->SetDato("alert", "Falla al transmitir datos");
}
}
else
{
txt_wifi->setText("No");
if(!AlertWifi && !TimerAlertWifi->isActive()) TimerAlertWifi->start(); // solo se inicia una vez cada que se queda sin internet por mas de 1 minuto
}
}
void Racimo3::newDataGPS()
{
txt_longitud->setText(QString::number(RA_cGPS->longitudeDegrees).toStdString().c_str());
txt_latitud->setText(QString::number(RA_cGPS->latitudeDegrees).toStdString().c_str());
txt_Altitud->setText(QString::number(RA_cGPS->altitude).toStdString().c_str());
txt_Fix->setText(QString::number(static_cast<int>(RA_cGPS->fixquality)).toStdString().c_str());
_DataGPS.fix = RA_cGPS->fixquality;
_DataGPS.longitud = QString::number(RA_cGPS->longitudeDegrees);
_DataGPS.longitud = QString::number(RA_cGPS->longitudeDegrees);
_DataGPS.altura = RA_cGPS->altitude;
}
void Racimo3::SlotTemperatura(float temperatura)
{
//qDebug() << "temperatura =" << temperatura;
MetaData._Temperatura =temperatura;
if(temperatura > 75){
if(!AlertTemperatura)QTimer::singleShot(40*1000,this,SLOT(check_AlertTemperatura()));
AlertTemperatura = true;
}
}
void Racimo3::SlotRAM(float RAM)
{
//qDebug() << "RAM =" << RAM;
MetaData._RAM =RAM;
if(RAM > 60){
if(!AlertRAM)QTimer::singleShot(4*1000,this,SLOT(check_AlertRAM()));
AlertRAM = true;
}
}
void Racimo3::SlotSOCKET(int SOCKET)
{
//qDebug() << "SOCKET =" << SOCKET;
MetaData._SOCKET =SOCKET;
}
void Racimo3::SlotProcesos(int Procesos)
{
//qDebug() << "Procesos =" << Procesos;
MetaData._Procesos = Procesos;
}
void Racimo3::SlotStatusWIFI(bool StatusWIFI)
{
//qDebug() << "StatusWIFI =" << StatusWIFI;
MetaData._StatusWIFI =StatusWIFI;
}
void Racimo3::SlotEspacioDisco(int EspacioDisco)
{
//qDebug() << "EspacioDisco =" << EspacioDisco;
MetaData._EspacioDisco =EspacioDisco;
}
void Racimo3::check_AlertRAM()
{
if(MetaData._RAM > 60)
{
_DataJson2->SetDato("alert", "Alerta excesivo consumo de RAM reinicio inminente!");
_DataJson2->WriteJson();
NewData= true;
QTimer::singleShot(30*1000,this,SLOT(ReinicioRaspi()));
}
else AlertRAM =false;
}
void Racimo3::check_AlertTemperatura()
{
if(MetaData._Temperatura > 75 )
{
_DataJson2->SetDato("alert", "Alerta temperatura muy alta reinicio inminente!");
_DataJson2->WriteJson();
NewData= true;
QTimer::singleShot(30*1000,this,SLOT(ReinicioRaspi()));
}
else AlertTemperatura =false;
}
void Racimo3::ReinicioRaspi()
{
system("sudo reboot now");
}
void Racimo3::ShutdownRaspi()
{
system("sudo shutdown now");
}
void Racimo3::CerrarApp()
{
this->~Racimo3();
}
| 30.093023 | 155 | 0.630684 | JoseSalamancaCoy |
f289d09358b32968f0bbb4c848d8b910b9fd0490 | 3,023 | cpp | C++ | src/HttpCURL.cpp | Daivuk/onut | b02c5969b36897813de9c574a26d9437b67f189e | [
"MIT"
] | 50 | 2015-06-01T19:23:24.000Z | 2021-12-22T02:14:23.000Z | src/HttpCURL.cpp | Daivuk/onut | b02c5969b36897813de9c574a26d9437b67f189e | [
"MIT"
] | 109 | 2015-07-20T07:43:03.000Z | 2021-01-31T21:52:36.000Z | src/HttpCURL.cpp | Daivuk/onut | b02c5969b36897813de9c574a26d9437b67f189e | [
"MIT"
] | 9 | 2015-07-02T21:36:20.000Z | 2019-10-19T04:18:02.000Z | // Onut
#include <onut/Async.h>
#include <onut/Dispatcher.h>
#include <onut/Strings.h>
#include <onut/Texture.h>
// Internal
#include "HttpCURL.h"
// Third party
#include <curl/curl.h>
// STL
#include <locale>
namespace onut
{
OHttpRef Http::create()
{
return std::shared_ptr<Http>(new HttpCURL());
}
HttpCURL::HttpCURL()
{
curl_global_init(CURL_GLOBAL_SSL);
}
HttpCURL::~HttpCURL()
{
curl_global_cleanup();
}
static size_t curlWrite(void *buffer, size_t size, size_t nmemb, void *userp)
{
auto& ret = *(Http::Body*)userp;
auto totalSize = size * nmemb;
auto pos = ret.size();
ret.resize(pos + totalSize);
memcpy(ret.data() + pos, buffer, totalSize);
return totalSize;
}
std::string HttpCURL::post(const std::string& url, const Body& body, const ErrorCallback& onError)
{
auto easyhandle = curl_easy_init();
if (!easyhandle)
{
if (onError)
{
onError(0, "curl_easy_init failed");
}
return {};
}
Body ret;
curl_easy_setopt(easyhandle, CURLOPT_URL, url.c_str());
curl_easy_setopt(easyhandle, CURLOPT_POST, 1);
curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDSIZE, (long)body.size());
curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDS, (char*)body.data());
curl_easy_setopt(easyhandle, CURLOPT_WRITEDATA, &ret);
curl_easy_setopt(easyhandle, CURLOPT_WRITEFUNCTION, curlWrite);
auto performRet = curl_easy_perform(easyhandle);
curl_easy_cleanup(easyhandle);
if (performRet != CURLE_OK)
{
if (onError)
{
onError(0, "curl_easy_perform failed");
}
return {};
}
if (ret.empty()) return "";
if (ret[ret.size() - 1] != 0) ret.push_back(0);
return (char*)ret.data();
}
Http::Body HttpCURL::get(const std::string& url, const Arguments& arguments, const ErrorCallback& onError)
{
auto args = packArguments(arguments);
auto fullUrl = url;
if (!args.empty())
{
fullUrl = url + "?" + args;
}
auto easyhandle = curl_easy_init();
if (!easyhandle)
{
if (onError)
{
onError(0, "curl_easy_init failed");
}
return {};
}
Body ret;
curl_easy_setopt(easyhandle, CURLOPT_URL, fullUrl.c_str());
curl_easy_setopt(easyhandle, CURLOPT_WRITEDATA, &ret);
curl_easy_setopt(easyhandle, CURLOPT_WRITEFUNCTION, curlWrite);
auto performRet = curl_easy_perform(easyhandle);
curl_easy_cleanup(easyhandle);
if (performRet != CURLE_OK)
{
if (onError)
{
onError(0, "curl_easy_perform failed");
}
return {};
}
return std::move(ret);
}
}
| 25.191667 | 110 | 0.556732 | Daivuk |
f28a84be683355d46fe86e4074c33d12c0bc0ef1 | 1,165 | hpp | C++ | Source/DequeSearcher.hpp | jamesfer/Pathfinder | c1e770624a3b163f2dd173f38228e93d7eb80367 | [
"MIT"
] | null | null | null | Source/DequeSearcher.hpp | jamesfer/Pathfinder | c1e770624a3b163f2dd173f38228e93d7eb80367 | [
"MIT"
] | null | null | null | Source/DequeSearcher.hpp | jamesfer/Pathfinder | c1e770624a3b163f2dd173f38228e93d7eb80367 | [
"MIT"
] | null | null | null | #ifndef DequeSearcher_hpp
#define DequeSearcher_hpp
#include "Searcher.hpp"
#include <deque>
/**
* Utility class that implements a deque as the frontier structure.
* Does not implement the nextInFrontier method as it depends on the
* search strategy
*/
template <class State_type, class Success_functor = IsGoalCheck<State_type>>
class DequeSearcher : public Searcher<State_type, Success_functor>
{
public:
typedef Searcher<State_type, Success_functor> Super;
typedef typename Super::Node_ptr Node_ptr;
typedef typename Super::Path_ptr Path_ptr;
protected:
deque<Node_ptr> frontier;
public:
DequeSearcher(Success_functor functor = Success_functor()) : Super(functor)
{
}
virtual ~DequeSearcher()
{
}
/**
* Overrides to also clear the frontier
*/
virtual void reset() override
{
Super::reset();
frontier.clear();
}
/**
* Adds a node to the frontier
*/
virtual void addToFrontier(Node_ptr node) override
{
frontier.push_back(node);
}
/**
* Returns the size of the frontier
*/
virtual unsigned long frontierSize() const override
{
return frontier.size();
}
};
#endif /* DequeSearcher_hpp */
| 17.651515 | 76 | 0.718455 | jamesfer |
f29096fcc997deeb21771d7b3c73af0ec9321e64 | 454 | cc | C++ | Adapter/Adapter.cc | Yescafe/pattern_demo | b87d8d588683773cd37efff0e9e12fc70b13f187 | [
"MIT"
] | 1 | 2020-07-11T04:36:14.000Z | 2020-07-11T04:36:14.000Z | Adapter/Adapter.cc | Yescafe/pattern_demo | b87d8d588683773cd37efff0e9e12fc70b13f187 | [
"MIT"
] | null | null | null | Adapter/Adapter.cc | Yescafe/pattern_demo | b87d8d588683773cd37efff0e9e12fc70b13f187 | [
"MIT"
] | null | null | null | #include "Adapter.hpp"
#include <iostream>
Target::Target()
{ }
Target::~Target()
{ }
void Target::Request()
{
std::cout << "Target::Request..." << std::endl;
}
Adaptee::Adaptee()
{ }
Adaptee::~Adaptee()
{ }
void Adaptee::SpecificRequest()
{
std::cout << "Adaptee::SpecificRequest..." << std::endl;
}
Adapter::Adapter(Adaptee* ade)
{
this->ade = ade;
}
Adapter::~Adapter()
{ }
void Adapter::Request()
{
ade->SpecificRequest();
}
| 11.947368 | 60 | 0.603524 | Yescafe |
f2971416f9f158bb2a68da0a246ec15394aacc06 | 587 | cpp | C++ | compiler/tst_flowchartcompiler.cpp | UnnamedCompany/UnnamedSoftware | 3251dc9844f35622f616fd3d5a40cb8c89ac0b28 | [
"MIT"
] | 4 | 2016-02-18T00:48:10.000Z | 2016-03-02T23:41:54.000Z | compiler/tst_flowchartcompiler.cpp | UnnamedCompany/UnnamedSoftware | 3251dc9844f35622f616fd3d5a40cb8c89ac0b28 | [
"MIT"
] | null | null | null | compiler/tst_flowchartcompiler.cpp | UnnamedCompany/UnnamedSoftware | 3251dc9844f35622f616fd3d5a40cb8c89ac0b28 | [
"MIT"
] | 1 | 2016-02-29T18:13:34.000Z | 2016-02-29T18:13:34.000Z | #include <QTest>
#include <QString>
#include "flowchart.h"
class TestFlowChartCompiler : public QObject {
Q_OBJECT
public:
TestFlowChartCompiler() { }
private Q_SLOTS:
void testIsExpandable() {
QWARN("No test implemented");
}
void testExtractUniqueBlockNames() {
QWARN("No test implemented");
}
void testExtractInputBlocks() {
QWARN("No test implemented");
}
void testGeneratePicCode() {
QWARN("No test implemented");
}
};
QTEST_APPLESS_MAIN(TestFlowChartCompiler)
#include "tst_flowchartcompiler.moc"
| 15.864865 | 46 | 0.662692 | UnnamedCompany |
f2990f0ecaebf3f073258a45108df106a7411240 | 16,892 | cpp | C++ | alienfx-cli/alienfx-cli.cpp | T-Troll/alienfx-tools | 70d3b4be158b9ff2cafd87cc3c09b695fdab384c | [
"MIT"
] | 55 | 2020-07-24T13:50:59.000Z | 2022-03-31T02:15:09.000Z | alienfx-cli/alienfx-cli.cpp | T-Troll/alienfx-tools | 70d3b4be158b9ff2cafd87cc3c09b695fdab384c | [
"MIT"
] | 41 | 2020-07-25T14:37:25.000Z | 2022-03-28T02:36:15.000Z | alienfx-cli/alienfx-cli.cpp | T-Troll/alienfx-tools | 70d3b4be158b9ff2cafd87cc3c09b695fdab384c | [
"MIT"
] | 9 | 2020-12-24T05:19:35.000Z | 2022-03-30T01:52:32.000Z | #define WIN32_LEAN_AND_MEAN
#include <iostream>
#include "stdafx.h"
#include "LFXUtil.h"
#include "LFXDecl.h"
#include "AlienFX_SDK.h"
namespace
{
LFXUtil::LFXUtilC lfxUtil;
}
using namespace std;
unsigned GetZoneCode(string name, int mode) {
switch (mode) {
case 1: return atoi(name.c_str()) | 0x10000;
case 0:
if (name == "left") return LFX_ALL_LEFT;
if (name == "right") return LFX_ALL_RIGHT;
if (name == "top") return LFX_ALL_UPPER;
if (name == "bottom") return LFX_ALL_LOWER;
if (name == "front") return LFX_ALL_FRONT;
if (name == "rear") return LFX_ALL_REAR;
}
return LFX_ALL;
}
unsigned GetActionCode(string name, int mode) {
if (name == "pulse") {
return mode ? AlienFX_SDK::Action::AlienFX_A_Pulse : LFX_ACTION_PULSE;
}
if (name == "morph") {
return mode ? AlienFX_SDK::Action::AlienFX_A_Morph : LFX_ACTION_MORPH;
}
if (name == "breath") {
return mode ? AlienFX_SDK::Action::AlienFX_A_Breathing : LFX_ACTION_MORPH;
}
else if (name == "spectrum") {
return mode ? AlienFX_SDK::Action::AlienFX_A_Spectrum : LFX_ACTION_MORPH;
}
else if (name == "rainbow") {
return mode ? AlienFX_SDK::Action::AlienFX_A_Rainbow : LFX_ACTION_MORPH;
}
return mode ? AlienFX_SDK::Action::AlienFX_A_Color : LFX_ACTION_COLOR;
}
void SetBrighness(ColorS *color) {
color->red = ((unsigned) color->red * color->brightness) / 255;// >> 8;
color->green = ((unsigned) color->green * color->brightness) / 255;// >> 8;
color->blue = ((unsigned) color->blue * color->brightness) / 255;// >> 8;
}
void printUsage()
{
cerr << "Usage: alienfx-cli [command=option,option,option] ... [command=option,option,option] [loop]" << endl
<< "Commands:\tOptions:" << endl
<< "set-all\t\tr,g,b[,br] - set all device lights." << endl
<< "set-one\t\tpid,light,r,g,b[,br] - set one light." << endl
<< "set-zone\tzone,r,g,b[,br] - set one zone lights." << endl
<< "set-action\tpid,light,action,r,g,b[,br,[action,r,g,b,br]] - set light and enable it's action." << endl
<< "set-zone-action\tzone,action,r,g,b[,br,[action,r,g,b,br]] - set all zone lights and enable it's action." << endl
<< "set-power\tlight,r,g,b,r2,g2,b2 - set power button colors (low-level only)." << endl
<< "set-tempo\ttempo - set light action tempo (in milliseconds)." << endl
<< "set-dev\t\tpid - set active device for low-level." << endl
<< "set-dim\t\tbr - set active device dim level." << endl
<< "low-level\tswitch to low-level SDK (USB driver)." << endl
<< "high-level\tswitch to high-level SDK (Alienware LightFX)." << endl
<< "status\t\tshows devices and lights id's, names and statuses." << endl
<< "lightson\tturn all current device lights on." << endl
<< "lightsoff\tturn all current device lights off." << endl
<< "update\t\tupdates light status (for looped commands or old devices)." << endl
<< "reset\t\treset device state." << endl
<< "loop\t\trepeat all commands endlessly, until user press ^c. Should be the last command." << endl << endl
<< "Zones:\tleft, right, top, bottom, front, rear (high-level) or ID of the Group (low-level)." << endl
<< "Actions:color (disable action), pulse, morph (you need 2 colors)," << endl
<< "\t(only for low-level v4) breath, spectrum, rainbow (up to 9 colors each)." << endl;
}
int main(int argc, char* argv[])
{
int devType = -1; bool have_low = false, have_high = false;
UINT sleepy = 0;
cerr << "alienfx-cli v5.0.6" << endl;
if (argc < 2)
{
printUsage();
return 1;
}
AlienFX_SDK::Mappings* afx_map = new AlienFX_SDK::Mappings();
AlienFX_SDK::Functions* afx_dev = new AlienFX_SDK::Functions();
int res = -1;
vector<pair<DWORD,DWORD>> devs = afx_map->AlienFXEnumDevices();
int pid = -1;
if (devs.size() > 0)
{
pid = afx_dev->AlienFXInitialize(devs[0].first, devs[0].second);
if (pid > 0) {
for (int rcount = 0; rcount < 10 && !afx_dev->IsDeviceReady(); rcount++)
Sleep(20);
if (!afx_dev->IsDeviceReady()) {
afx_dev->Reset();
}
afx_map->LoadMappings();
cout << "Low-level device ready" << endl;
have_low = true;
devType = 1;
}
}
else {
cerr << "No low-level devices found, trying high-level..." << endl;
}
if (res = lfxUtil.InitLFX() != -1) {
switch (res) {
case 0: cerr << "Dell library DLL not found (no library?)!" << endl; break;
case 1: cerr << "Can't init Dell library!" << endl; break;
case 2: cerr << "No high-level devices found!" << endl; break;
default: cerr << "Dell library unknown error!" << endl; break;
}
}
else {
cout << "Dell API ready" << endl;
have_high = true;
if (!have_low)
devType = 0;
}
if (devType == -1) {
cout << "Both low-levl and high-level devices not found, exiting!" << endl;
goto deinit;
}
const char* command = argv[1];
for (int cc = 1; cc < argc; cc++) {
if (devType > 0 && cc > 1) {
Sleep(sleepy);
}
else
Sleep(100);
string arg = string(argv[cc]);
size_t vid = arg.find_first_of('=');
string command = arg.substr(0, vid);
string values;
vector<string> args;
if (vid != string::npos) {
size_t vpos = 0;
values = arg.substr(vid + 1, arg.size());
while (vpos < values.size()) {
size_t tvpos = values.find(',', vpos);
args.push_back(values.substr(vpos, tvpos-vpos));
vpos = tvpos == string::npos ? values.size() : tvpos+1;
}
}
//cerr << "Executing " << command << " with " << values << endl;
if (command == "low-level") {
if (have_low)
devType = 1;
continue;
}
if (command == "high-level") {
if (have_high)
devType = 0;
continue;
}
if (command == "loop") {
cc = 1;
switch (devType) {
case 1:
afx_dev->UpdateColors(); break;
case 0:
lfxUtil.Update(); break;
}
continue;
}
if (command == "status") {
switch (devType) {
case 1:
for (int i = 0; i < devs.size(); i++) {
cout << "Device VID#" << devs[i].first << ", PID#" << devs[i].second;
int dn;
for (dn = 0; dn < afx_map->GetDevices()->size(); dn++) {
if (devs[i].second == afx_map->GetDevices()->at(i).devid) {
cout << " - " << afx_map->GetDevices()->at(i).name;
if (devs[i].second == afx_dev->GetPID()) {
cout << " (Active, V" << afx_dev->GetVersion() << ")";
}
break;
}
}
cout << endl;
for (int k = 0; k < afx_map->GetMappings()->size(); k++) {
AlienFX_SDK::mapping *lgh = afx_map->GetMappings()->at(k);
if (devs[i].second == lgh->devid) {
cout << " Light ID#" << lgh->lightid
<< " - " << lgh->name;
if (lgh->flags & ALIENFX_FLAG_POWER)
cout << " (Power button)";
if (lgh->flags & ALIENFX_FLAG_INACTIVE)
cout << " (Indicator)";
cout << endl;
}
}
}
// now groups...
for (int i = 0; i < afx_map->GetGroups()->size(); i++)
cout << "Group #" << (afx_map->GetGroups()->at(i).gid & 0xffff)
<< " - " << afx_map->GetGroups()->at(i).name
<< " (" << afx_map->GetGroups()->at(i).lights.size() << " lights)" << endl;
break;
case 0:
lfxUtil.GetStatus(); break;
}
continue;
}
if (command == "set-tempo") {
if (args.size() < 1) {
cerr << "set-tempo: Incorrect argument" << endl;
continue;
}
switch (devType) {
case 1:
sleepy = atoi(args.at(0).c_str());
break;
case 0:
{
unsigned tempo = atoi(args.at(0).c_str());
lfxUtil.SetTempo(tempo);
lfxUtil.Update();
} break;
}
continue;
}
if (command == "set-dev") {
if (args.size() < 1) {
cerr << "set-dev: Incorrect argument" << endl;
continue;
}
if (devType) {
int newDev = atoi(args.at(0).c_str());
if (newDev == afx_dev->GetPID())
continue;
pid = afx_dev->AlienFXChangeDevice(0, newDev);// devs[i].first, devs[i].second);
//for (int i = 0; i < devs.size(); i++)
// if (devs[i].second == newDev) {
// afx_dev->UpdateColors();
// afx_dev->AlienFXClose();
// pid = afx_dev->AlienFXChangeDevice(devs[i].first, devs[i].second);
if (pid < 0) {
cerr << "Can't init device ID#" << newDev << ", exiting!" << endl;
continue;
}
// break;
//}
}
continue;
}
if (command == "reset") {
switch (devType) {
case 1:
afx_dev->Reset(); break;
case 0:
lfxUtil.Reset(); break;
}
continue;
}
if (command == "update") {
switch (devType) {
case 1:
afx_dev->UpdateColors(); break;
case 0:
lfxUtil.Update(); break;
}
continue;
}
if (command == "set-dim") {
byte dim = atoi(args.at(0).c_str());
if (devType)
afx_dev->ToggleState(dim, afx_map->GetMappings(), false);
continue;
}
if (command == "lightson") {
if (devType)
afx_dev->ToggleState(255, afx_map->GetMappings(), false);
continue;
}
if (command == "lightsoff") {
if (devType)
afx_dev->ToggleState(0, afx_map->GetMappings(), false);
continue;
}
if (command == "set-all") {
if (args.size() < 3) {
cerr << "set-all: Incorrect arguments" << endl;
continue;
}
unsigned zoneCode = LFX_ALL;
static ColorU color;
color.cs.red = atoi(args.at(0).c_str());
color.cs.green = atoi(args.at(1).c_str());
color.cs.blue = atoi(args.at(2).c_str());
color.cs.brightness = args.size() > 3 ? atoi(args.at(3).c_str()) : 255;
switch (devType) {
case 1:
{
SetBrighness(&color.cs);
vector<UCHAR> lights;
for (int i = 0; i < afx_map->GetMappings()->size(); i++) {
AlienFX_SDK::mapping *lgh = afx_map->GetMappings()->at(i);
if (lgh->devid == pid &&
!(lgh->flags & ALIENFX_FLAG_POWER))
lights.push_back((UCHAR) lgh->lightid);
}
afx_dev->SetMultiLights((int) lights.size(), lights.data(), color.cs.red, color.cs.green, color.cs.blue);
afx_dev->UpdateColors();
} break;
case 0:
lfxUtil.SetLFXColor(zoneCode, color.ci);
lfxUtil.Update();
break;
}
continue;
}
if (command == "set-one") {
if (args.size() < 5) {
cerr << "set-one: Incorrect arguments" << endl;
continue;
}
static ColorU color;
int devid = atoi(args.at(0).c_str());
color.cs.red = atoi(args.at(4).c_str());
color.cs.green = atoi(args.at(3).c_str());
color.cs.blue = atoi(args.at(2).c_str());
color.cs.brightness = args.size() > 5 ? atoi(args.at(5).c_str()) : 255;
switch (devType) {
case 1:
{
SetBrighness(&color.cs);
if (devid != 0 && devid != afx_dev->GetPID()) {
afx_dev->UpdateColors();
afx_dev->AlienFXClose();
//pair<DWORD, DWORD>* dev = LocateDev(&devs, devid);
afx_dev->AlienFXChangeDevice(0, devid);// dev->first, dev->second);
}
afx_dev->SetColor(atoi(args.at(1).c_str()),
color.cs.blue, color.cs.green, color.cs.red);
} break;
case 0:
lfxUtil.SetOneLFXColor(devid, atoi(args.at(1).c_str()), &color.ci);
lfxUtil.Update();
break;
}
continue;
}
if (command == "set-zone") {
if (args.size() < 4) {
cerr << "set-zone: Incorrect arguments" << endl;
continue;
}
static ColorU color;
unsigned zoneCode = LFX_ALL;
color.cs.red = atoi(args.at(1).c_str());
color.cs.green = atoi(args.at(2).c_str());
color.cs.blue = atoi(args.at(3).c_str());
color.cs.brightness = args.size() > 4 ? atoi(args.at(4).c_str()) : 255;
zoneCode = GetZoneCode(args[0], devType);
switch (devType) {
case 1:
{
SetBrighness(&color.cs);
AlienFX_SDK::group* grp = afx_map->GetGroupById(zoneCode);
if (grp) {
int oldPid = afx_dev->GetPID(), oldVid = afx_dev->GetVid();
for (int j = 0; j < devs.size(); j++) {
vector<UCHAR> lights;
afx_dev->AlienFXChangeDevice(devs[j].first, devs[j].second);
for (int i = 0; i < grp->lights.size(); i++) {
if (grp->lights[i]->devid == afx_dev->GetPID())
lights.push_back((UCHAR) afx_map->GetMappings()->at(i)->lightid);
}
afx_dev->SetMultiLights((int) lights.size(), lights.data(), color.cs.red, color.cs.green, color.cs.blue);
afx_dev->UpdateColors();
}
afx_dev->AlienFXChangeDevice(oldVid, oldPid);
}
} break;
case 0:
{
lfxUtil.SetLFXColor(zoneCode, color.ci);
lfxUtil.Update();
} break;
}
continue;
}
if (command == "set-power") {
if (args.size() != 7) {
cerr << "set-power: Incorrect arguments" << endl;
continue;
}
static ColorU color, color2;
color.cs.red = atoi(args.at(1).c_str());
color.cs.green = atoi(args.at(2).c_str());
color.cs.blue = atoi(args.at(3).c_str());
color2.cs.red = atoi(args.at(4).c_str());
color2.cs.green = atoi(args.at(5).c_str());
color2.cs.blue = atoi(args.at(6).c_str());
if (devType) {
afx_dev->SetPowerAction(atoi(args.at(0).c_str()),
color.cs.red, color.cs.green, color.cs.blue,
color2.cs.red, color2.cs.green, color2.cs.blue);
}
else {
cerr << "High-level API doesn't support set-power!" << endl;
}
continue;
}
if (command == "set-action") {
if (args.size() < 6) {
cerr << "set-action: Incorrect arguments" << endl;
continue;
}
unsigned actionCode = LFX_ACTION_COLOR;
std::vector<AlienFX_SDK::afx_act> act;
std::vector<ColorU> clrs;
int argPos = 2;
int devid = atoi(args.at(0).c_str()),
lightid = atoi(args.at(1).c_str());
while (argPos + 3 < args.size()) {
ColorU c;
actionCode = GetActionCode(args[argPos], devType);
c.cs.blue = atoi(args.at(argPos+1).c_str());
c.cs.green = atoi(args.at(argPos + 2).c_str());
c.cs.red = atoi(args.at(argPos + 3).c_str());
c.cs.brightness = argPos + 4 < args.size() ? atoi(args.at(argPos + 4).c_str()) : 255;
if (devType) {
SetBrighness(&c.cs);
act.push_back(AlienFX_SDK::afx_act({(BYTE) actionCode, (BYTE) sleepy, 7, (BYTE) c.cs.blue, (BYTE) c.cs.green, (BYTE) c.cs.red}));
} else
clrs.push_back(c);
argPos += 5;
}
switch (devType) {
case 1:
if (devid != 0 && devid != afx_dev->GetPID()) {
afx_dev->UpdateColors();
afx_dev->AlienFXClose();
afx_dev->AlienFXChangeDevice(0, devid);// dev->first, dev->second);
}
if (act.size() < 2) {
act.push_back(AlienFX_SDK::afx_act({(BYTE) actionCode, (BYTE) sleepy, 7, 0, 0, 0}));
}
afx_dev->SetAction(lightid, act);
break;
case 0:
if (clrs.size() < 2) {
clrs.push_back(ColorU({0}));
}
lfxUtil.SetLFXAction(actionCode, devid, lightid, &clrs[0].ci, &clrs[1].ci);
lfxUtil.Update();
break;
}
continue;
}
if (command == "set-zone-action") {
if (args.size() < 5) {
cerr << "set-zone-action: Incorrect arguments" << endl;
continue;
}
unsigned zoneCode = GetZoneCode(args[0], devType);
unsigned actionCode = LFX_ACTION_COLOR;
std::vector<AlienFX_SDK::afx_act> act;
std::vector<ColorU> clrs;
int argPos = 1;
while (argPos + 3 < args.size()) {
ColorU c;
actionCode = GetActionCode(args[argPos], devType);
c.cs.red = atoi(args.at(argPos+1).c_str());
c.cs.green = atoi(args.at(argPos + 2).c_str());
c.cs.blue = atoi(args.at(argPos + 3).c_str());
c.cs.brightness = argPos + 4 < args.size() ? atoi(args.at(argPos + 4).c_str()) : 255;
if (devType) {
SetBrighness(&c.cs);
act.push_back(AlienFX_SDK::afx_act({(BYTE) actionCode, (BYTE) sleepy, 7, (BYTE) c.cs.red, (BYTE) c.cs.green, (BYTE) c.cs.blue}));
} else
clrs.push_back(c);
argPos += 5;
}
switch (devType) {
case 1:
{
AlienFX_SDK::group* grp = afx_map->GetGroupById(zoneCode);
int oldPid = afx_dev->GetPID(), oldVid = afx_dev->GetVid();
if (act.size() < 2) {
act.push_back(AlienFX_SDK::afx_act({(BYTE) actionCode, (BYTE) sleepy, 7, 0, 0, 0}));
}
if (grp) {
for (int j = 0; j < devs.size(); j++) {
afx_dev->AlienFXChangeDevice(devs[j].first, devs[j].second);
for (int i = 0; i < grp->lights.size(); i++)
if (grp->lights[i]->devid == afx_dev->GetPID())
afx_dev->SetAction(grp->lights[i]->lightid, act);
afx_dev->UpdateColors();
}
} else {
// set all!
for (int j = 0; j < devs.size(); j++) {
afx_dev->AlienFXChangeDevice(devs[j].first, devs[j].second);
for (int i = 0; i < afx_map->GetMappings()->size(); i++) {
AlienFX_SDK::mapping *lgh = afx_map->GetMappings()->at(i);
if (lgh->devid == afx_dev->GetPID() &&
!(lgh->flags & ALIENFX_FLAG_POWER))
afx_dev->SetAction(lgh->lightid, act);
}
afx_dev->UpdateColors();
}
}
afx_dev->AlienFXChangeDevice(oldVid, oldPid);
} break;
case 0:
if (clrs.size() < 2)
clrs.push_back(ColorU({0}));
lfxUtil.SetLFXZoneAction(actionCode, zoneCode, clrs[0].ci, clrs[1].ci);
lfxUtil.Update();
break;
}
continue;
}
cerr << "Unknown command: " << command << endl;
}
cout << "Done." << endl;
deinit:
if (have_low)
afx_dev->UpdateColors();
afx_dev->AlienFXClose();
if (have_high)
lfxUtil.Release();
delete afx_map;
delete afx_dev;
return 0;
}
| 30.994495 | 134 | 0.590753 | T-Troll |
f29b05a35709c839a7fe8cf70b351995e71a9f04 | 1,181 | cpp | C++ | S-Digit_Sum.cpp | geegatomar/Educational-DP-contest-Atcoder | f32cb87cc58609e3c0cd51b9d54b632dd215b6ef | [
"MIT"
] | null | null | null | S-Digit_Sum.cpp | geegatomar/Educational-DP-contest-Atcoder | f32cb87cc58609e3c0cd51b9d54b632dd215b6ef | [
"MIT"
] | null | null | null | S-Digit_Sum.cpp | geegatomar/Educational-DP-contest-Atcoder | f32cb87cc58609e3c0cd51b9d54b632dd215b6ef | [
"MIT"
] | null | null | null | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int M = 1e9 + 7;
const int N = (int)1e4;
// Concept used: Digit DP
int dp[N][2][100];
int f(int ind, int is_tight, int sum_of_dig, string &k, int &d)
{
sum_of_dig %= d;
if(ind >= k.size())
return ((sum_of_dig % d == 0) ? 1 : 0);
if(dp[ind][is_tight][sum_of_dig] != -1)
return dp[ind][is_tight][sum_of_dig];
int ans = 0;
int curr_dig = k[ind] - '0';
if(is_tight)
{
for(int i = 0; i <= curr_dig; i++)
{
if(i == curr_dig)
ans += f(ind + 1, 1, i + sum_of_dig, k, d);
else
ans += f(ind + 1, 0, i + sum_of_dig, k, d);
ans %= M;
}
}
else
{
for(int i = 0; i <= 9; i++)
{
ans += f(ind + 1, 0, i + sum_of_dig, k, d);
ans %= M;
}
}
return dp[ind][is_tight][sum_of_dig] = ans % M;
}
int32_t main()
{
string k;
int d;
cin >> k >> d;
memset(dp, -1, sizeof(dp));
cout << (f(0, 1, 0, k, d) - 1 + M) % M;
// subtracting 1 because '0' would have been counted as an answer too
}
| 20.016949 | 73 | 0.461473 | geegatomar |
f2a0a3cfd5f3ff212cb788c6b2b6b7f6bd5660ed | 1,206 | cpp | C++ | code_process/src/RCB.cpp | NewtonVan/OS2020 | 223bc0d190ddad352777587792f4bf12d4d0081d | [
"MIT"
] | 1 | 2021-12-16T07:49:37.000Z | 2021-12-16T07:49:37.000Z | code_process/src/RCB.cpp | NewtonVan/OS2020 | 223bc0d190ddad352777587792f4bf12d4d0081d | [
"MIT"
] | null | null | null | code_process/src/RCB.cpp | NewtonVan/OS2020 | 223bc0d190ddad352777587792f4bf12d4d0081d | [
"MIT"
] | null | null | null | #include "RCB.h"
RCB::RCB()
: rid_(-1), available_(0), total_(0)
{}
RCB::RCB(int rid, int available, int total)
: rid_(rid), available_(available), total_(total)
{}
RCB::RCB(int rid, int total)
: rid_(rid), available_(total), total_(total)
{}
RCB::~RCB()= default;
// get the member of RCB
int RCB::getRid()
{
return rid_;
}
int RCB::getAvailable()
{
return available_;
}
int RCB::getTotal()
{
return total_;
}
// set the member
int RCB::setRid(int rid)
{
return rid_= rid;
}
int RCB::setAvailable(int available)
{
return available_= available;
}
int RCB::setTotal(int total)
{
return total_= total;
}
/**
* @available: positive means increase, negative means decrease
*/
int RCB::changeAvailable(int available)
{
available_+= available;
return available_;
}
void RCB::inLine(PCB* wait)
{
wait_l_.push_back(wait);
}
void RCB::outLine(PCB* wait)
{
for (std::list<PCB*>::iterator w_iter= wait_l_.begin();
wait_l_.end()!= w_iter; ++w_iter){
if (wait== *w_iter){
wait_l_.erase(w_iter);
break;
}
}
}
int RCB::waitEmpty()
{
return wait_l_.empty();
}
PCB* RCB::waitFront()
{
return wait_l_.front();
} | 14.707317 | 63 | 0.624378 | NewtonVan |
f2a2164401b9df5cb867f9e81692410f1cb60e3e | 3,169 | hpp | C++ | OptiX-Path-Tracer/programs/vec.hpp | trevortheblack/OptiX-Path-Tracer | e52394a80966057f8968c008078f0372277fdc8e | [
"Apache-2.0"
] | 77 | 2018-11-27T12:17:52.000Z | 2022-02-22T23:25:06.000Z | OptiX-Path-Tracer/programs/vec.hpp | trevortheblack/OptiX-Path-Tracer | e52394a80966057f8968c008078f0372277fdc8e | [
"Apache-2.0"
] | 1 | 2019-06-14T18:43:07.000Z | 2019-06-14T18:43:07.000Z | OptiX-Path-Tracer/programs/vec.hpp | trevortheblack/OptiX-Path-Tracer | e52394a80966057f8968c008078f0372277fdc8e | [
"Apache-2.0"
] | 3 | 2019-06-14T15:28:58.000Z | 2021-10-13T16:32:09.000Z | // ======================================================================== //
// Copyright 2018 Ingo Wald //
// //
// 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. //
// ======================================================================== //
#pragma once
#include "common.hpp"
inline __host__ __device__ float squared_length(const float3 &a) {
return length(a) * length(a);
}
// returns true if all components are zero
inline __host__ __device__ bool isNull(const float3 &a) {
return (a.x == 0.f) && (a.y == 0.f) && (a.z == 0.f);
}
/*! return absolute value of each component */
inline __host__ __device__ float3 abs(const float3 &v) {
return make_float3(fabsf(v.x), fabsf(v.y), fabsf(v.z));
}
/*! return sqrt value of each component */
inline __host__ __device__ float3 sqrt(const float3 &v) {
return make_float3(sqrt(v.x), sqrt(v.y), sqrt(v.z));
}
/*! return sqr value of each component */
inline __host__ __device__ float3 sqr(const float3 &v) {
return make_float3(v.x * v.x, v.y * v.y, v.z * v.z);
}
/* return unit vector */
inline __host__ __device__ float3 unit_vector(const float3 &v) {
return v / length(v);
}
/*! return mod between two vectors */
inline __host__ __device__ float3 mod(const float3 &a, const float3 &b) {
return make_float3(fmodf(a.x, b.x), fmodf(a.y, b.y), fmodf(a.z, b.z));
}
// if (a < b), return a, else return b
inline __host__ __device__ float ffmin(const float &a, const float &b) {
return a < b ? a : b;
}
// if (a > b), return a, else return b
inline __host__ __device__ float ffmax(const float &a, const float &b) {
return a > b ? a : b;
}
// return pairwise min vector
inline __host__ __device__ float3 min_vec(const float3 &a, const float3 &b) {
return make_float3(ffmin(a.x, b.x), ffmin(a.y, b.y), ffmin(a.z, b.z));
}
// return pairwise max vector
inline __host__ __device__ float3 max_vec(float3 a, float3 b) {
return make_float3(ffmax(a.x, b.x), ffmax(a.y, b.y), ffmax(a.z, b.z));
}
// return max component of vector
inline __host__ __device__ float max_component(float3 a) {
return ffmax(ffmax(a.x, a.y), a.z);
}
// return max component of vector
inline __host__ __device__ float min_component(float3 a) {
return ffmin(ffmin(a.x, a.y), a.z);
} | 37.72619 | 78 | 0.565478 | trevortheblack |
f2a822ce0f18fc221e92014cb95187deeff85435 | 2,986 | cc | C++ | src/poly/string.cc | jdarpinian/xenia | 609d7c755f260e86a865703dc1dcd6df064b1fa0 | [
"BSD-3-Clause"
] | 1 | 2016-11-18T23:12:53.000Z | 2016-11-18T23:12:53.000Z | src/poly/string.cc | jdarpinian/xenia | 609d7c755f260e86a865703dc1dcd6df064b1fa0 | [
"BSD-3-Clause"
] | null | null | null | src/poly/string.cc | jdarpinian/xenia | 609d7c755f260e86a865703dc1dcd6df064b1fa0 | [
"BSD-3-Clause"
] | null | null | null | /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2014 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include <poly/string.h>
#include <codecvt>
#include <locale>
namespace poly {
std::string to_string(const std::wstring& source) {
static std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
return converter.to_bytes(source);
}
std::wstring to_wstring(const std::string& source) {
static std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
return converter.from_bytes(source);
}
std::string::size_type find_first_of_case(const std::string& target,
const std::string& search) {
const char* str = target.c_str();
while (*str) {
if (!strncasecmp(str, search.c_str(), search.size())) {
break;
}
str++;
}
if (*str) {
return str - target.c_str();
} else {
return std::string::npos;
}
}
std::wstring to_absolute_path(const std::wstring& path) {
#if XE_LIKE_WIN32
wchar_t buffer[poly::max_path];
_wfullpath(buffer, path.c_str(), sizeof(buffer) / sizeof(wchar_t));
return buffer;
#else
char buffer[poly::max_path];
realpath(poly::to_string(path).c_str(), buffer);
return poly::to_wstring(buffer);
#endif // XE_LIKE_WIN32
}
std::vector<std::string> split_path(const std::string& path) {
std::vector<std::string> parts;
size_t n = 0;
size_t last = 0;
while ((n = path.find_first_of("\\/", last)) != path.npos) {
if (last != n) {
parts.push_back(path.substr(last, n - last));
}
last = n + 1;
}
if (last != path.size()) {
parts.push_back(path.substr(last));
}
return parts;
}
std::wstring join_paths(const std::wstring& left, const std::wstring& right,
wchar_t sep) {
if (!left.size()) {
return right;
} else if (!right.size()) {
return left;
}
if (left[left.size() - 1] == sep) {
return left + right;
} else {
return left + sep + right;
}
}
std::wstring fix_path_separators(const std::wstring& source, wchar_t new_sep) {
// Swap all separators to new_sep.
wchar_t old_sep = new_sep == '\\' ? '/' : '\\';
std::wstring::size_type pos = 0;
std::wstring dest = source;
while ((pos = source.find_first_of(old_sep, pos)) != std::wstring::npos) {
dest[pos] = new_sep;
++pos;
}
// Replace redundant separators.
pos = 0;
while ((pos = dest.find_first_of(new_sep, pos)) != std::wstring::npos) {
if (pos < dest.size() - 1) {
if (dest[pos + 1] == new_sep) {
dest.erase(pos + 1, 1);
}
}
++pos;
}
return dest;
}
} // namespace poly
| 27.648148 | 79 | 0.558607 | jdarpinian |
f2a9d07a41acfc84fd8f119e5fa61f252cefb836 | 1,091 | cpp | C++ | hw2/q1/Date.cpp | BenEf97/BarBenCPP | 556eebfeeadd210cc9552915d58c274b8f881eb7 | [
"MIT"
] | 1 | 2022-03-01T19:09:52.000Z | 2022-03-01T19:09:52.000Z | hw2/q1/Date.cpp | BenEf97/BarBenCPP | 556eebfeeadd210cc9552915d58c274b8f881eb7 | [
"MIT"
] | 1 | 2022-03-01T19:14:11.000Z | 2022-03-01T19:14:34.000Z | hw2/q1/Date.cpp | BenEf97/BarBenCPP | 556eebfeeadd210cc9552915d58c274b8f881eb7 | [
"MIT"
] | null | null | null | #include "Date.h"
#include <iostream>
using namespace std;
//Work on date, all the functions.
Date::Date(int d, int m, int y)
{
setDay(d);
setMonth(m);
setYear(y);
}
//Empty constructor
Date::Date()
{
day = 1;
month = 1;
year = 2000;
}
//returns the day
int Date::getDay() const
{
return day;
}
//returns the month
int Date::getMonth() const
{
return month;
}
//returns the year
int Date::getYear() const
{
return year;
}
//setting the day, checks for valid input.
void Date::setDay(int d)
{
//Checks for valid input, assuming month has 30 days. If the input is invalid, will set day=0.
if (d < 1 || d > 30)
day = 0;
else
day = d;
}
//setting the month, checks for valid input.
void Date::setMonth(int m)
{
//Checks for valid inout, if there is invalid input will be set month=0
if (m < 1 || m > 12)
month = 0 ;
else
month = m;
}
//setting the year
void Date::setYear(int y)
{
if (y>0)
year = y;
else year = 2000;
}
//Prints the date in dd/mm/yy format.
void Date::PrintDate() const
{
cout << "The Date: "<<day<<"/"<<month<<"/"<<year<<"\n"<<endl;
}
| 14.168831 | 95 | 0.629698 | BenEf97 |
f2ab7d41580507baa21e49b214b9807de8575698 | 742 | cpp | C++ | src/autoc4player.cpp | ghostdart/connect-four | 5910c7e5952b1f1dbeafb0eb0f9eb94fc6bd0f69 | [
"MIT"
] | null | null | null | src/autoc4player.cpp | ghostdart/connect-four | 5910c7e5952b1f1dbeafb0eb0f9eb94fc6bd0f69 | [
"MIT"
] | null | null | null | src/autoc4player.cpp | ghostdart/connect-four | 5910c7e5952b1f1dbeafb0eb0f9eb94fc6bd0f69 | [
"MIT"
] | null | null | null | #include "autoc4player.h"
AutoC4Player::AutoC4Player(char Color) : Player("Auto:Random", Color)
{
// Just call the base constructor
}
double AutoC4Player::EvaluateState(GameBoard *Board)
{
// Board Evaluation Area;
// This auto-player is not using it.
return 0;
}
Connect4Move *AutoC4Player::SuggestMove(GameState *State)
{
Connect4Move *Move = new Connect4Move;
std::vector<GameMove *> Moves = State->GetPossibleMoves();
int Total = int(Moves.size());
if (Total == 0)
{
return nullptr;
}
int MoveIndex = int(float(rand()) / RAND_MAX * Total);
Move->SetMove(static_cast<Connect4Move *>(Moves[MoveIndex])->GetMove());
for (int i = 0; i < Total; i++)
delete Moves[i];
Moves.clear();
return Move;
}
| 20.611111 | 74 | 0.673854 | ghostdart |
f2aba9e999a6b84c6f9dd7cdfa8d600bd785d8b8 | 18,712 | cpp | C++ | lib/Front/Input.cpp | axia-sw/Doll | a5846a6553d9809e9a0ea50db2dc18b95eb21921 | [
"Zlib"
] | 1 | 2021-07-19T14:40:15.000Z | 2021-07-19T14:40:15.000Z | lib/Front/Input.cpp | axia-sw/Doll | a5846a6553d9809e9a0ea50db2dc18b95eb21921 | [
"Zlib"
] | null | null | null | lib/Front/Input.cpp | axia-sw/Doll | a5846a6553d9809e9a0ea50db2dc18b95eb21921 | [
"Zlib"
] | null | null | null | #define DOLL_TRACE_FACILITY doll::kLog_FrontendInput
#include "../BuildSettings.hpp"
#include "doll/Front/Input.hpp"
#include "doll/Front/Frontend.hpp"
#include "doll/Core/Logger.hpp"
#include "doll/OS/App.hpp"
#include "doll/OS/Window.hpp"
namespace doll
{
struct SWndInputState
{
static const UPtr kNumFieldBits = sizeof(UPtr)*8;
static const UPtr kNumKeyFields = 0x100/kNumFieldBits;
static const UPtr kNumMouseBtns = 8;
UPtr keys[ kNumKeyFields ];
UPtr mouse;
MutStr entry;
Bool entryEnabled;
S32 mouseX, mouseY;
F32 mouseZ;
Bool mouseInWindow;
S32 mouseDeltaX, mouseDeltaY;
F32 mouseDeltaZ;
Bool mouseDeltaDirty;
U8 keyHits[ 0x100 ];
U8 keyRels[ 0x100 ];
U8 mouseHits[ kNumMouseBtns ];
U8 mouseRels[ kNumMouseBtns ];
U8 keyPressed;
U32 cActions;
SCoreInputAction actions[ kMaxInputActions ];
inline SWndInputState()
: mouse(0)
, entry()
, entryEnabled( false )
, mouseX( 0 )
, mouseY( 0 )
, mouseZ( 0.0f )
, mouseInWindow( false )
, mouseDeltaX( 0 )
, mouseDeltaY( 0 )
, mouseDeltaZ( 0.0f )
, mouseDeltaDirty( true )
, keyPressed( 0 )
, cActions( 0 )
{
memset( &keys[0], 0, sizeof(keys) );
memset( &keyHits[0], 0, sizeof(keyHits) );
memset( &keyRels[0], 0, sizeof(keyRels) );
memset( &mouseHits[0], 0, sizeof(mouseHits) );
memset( &mouseRels[0], 0, sizeof(mouseRels) );
}
inline Void setKey( U8 index )
{
const U8 i = index/kNumFieldBits;
const U8 j = index%kNumFieldBits;
keys[i] |= UPtr(1)<<j;
}
inline Void clearKey( U8 index )
{
const U8 i = index/kNumFieldBits;
const U8 j = index%kNumFieldBits;
keys[i] &= ~(UPtr(1)<<j);
}
inline Bool testKey( U8 index ) const
{
const U8 i = index/kNumFieldBits;
const U8 j = index%kNumFieldBits;
return ( keys[i] & (UPtr(1)<<j) ) != 0;
}
inline Void hitKey( U8 index )
{
if( keyHits[index] < 0xFF ) {
++keyHits[index];
}
}
inline Void relKey( U8 index )
{
if( keyRels[ index ] < 0xFF ) {
++keyRels[index];
}
}
inline Void hitMouse( U8 index )
{
if( index >= kNumMouseBtns ) {
return;
}
if( mouseHits[ index ] < 0xFF ) {
++mouseHits[index];
}
}
inline Void relMouse( U8 index )
{
if( index >= kNumMouseBtns ) {
return;
}
if( mouseRels[ index ] < 0xFF ) {
++mouseRels[index];
}
}
inline Void setMouse( U8 index )
{
mouse |= UPtr(1)<<index;
}
inline Void clearMouse( U8 index )
{
mouse &= ~(UPtr(1)<<index);
}
inline Bool testMouse( U8 index ) const
{
return ( mouse & (UPtr(1)<<index) ) != 0;
}
inline Bool setEntry( const Str &newEntry )
{
return entry.tryAssign( newEntry );
}
inline Void entryBackspace()
{
U8 x;
do {
x = entry.lastByte();
entry.dropMe();
} while( ( x & 0x80 ) != 0 );
}
inline Bool handleEntryChar( U32 utf32Char )
{
if( !utf32Char ) {
return true;
}
if( utf32Char == '\b' ) {
entryBackspace();
return true;
}
axstr_utf8_t buf[ 5 ] = { 0, 0, 0, 0, 0 };
const axstr_utf32_t src[ 2 ] = { utf32Char, 0 };
axstr_utf32_to_utf8( buf, sizeof( buf ), src );
return entry.tryAppend( Str( ( char * )buf ) );
}
inline Void handleMouseMove( S32 clientPosX, S32 clientPosY )
{
if( mouseDeltaDirty ) {
mouseDeltaDirty = false;
} else {
mouseDeltaX += clientPosX - mouseX;
mouseDeltaY += clientPosY - mouseY;
}
mouseX = clientPosX;
mouseY = clientPosY;
}
SCoreInputAction *findAction( ECoreInputAction cmd )
{
for( U32 i = 0; i < cActions; ++i ) {
if( actions[ i ].command == cmd ) {
return &actions[ i ];
}
}
return nullptr;
}
const SCoreInputAction *findAction( EKey key, U32 uMods ) const
{
for( U32 i = 0; i < cActions; ++i ) {
const SCoreInputAction &act = actions[ i ];
if( act.key == key && act.uMods == uMods ) {
return &act;
}
}
return nullptr;
}
Bool addAction( const SCoreInputAction &act )
{
// Don't add exact duplicates
for( U32 i = 0; i < cActions; ++i ) {
const SCoreInputAction &cmpAct = actions[ i ];
if( act.command == cmpAct.command && act.key == cmpAct.key && act.uMods == cmpAct.uMods ) {
return true;
}
}
// Check if we're at the limit
if( cActions >= kMaxInputActions ) {
return false;
}
actions[ cActions++ ] = act;
return true;
}
Bool setAction( const SCoreInputAction &act )
{
SCoreInputAction *pAct = findAction( act.command );
if( !pAct ) {
return addAction( act );
}
*pAct = act;
return true;
}
Void removeAction( const SCoreInputAction &act )
{
for( U32 i = 0; i < cActions; ++i ) {
SCoreInputAction &cmpAct = actions[ i ];
if( act.command != cmpAct.command || act.key != cmpAct.key || act.uMods != cmpAct.uMods ) {
continue;
}
if( i < --cActions ) {
cmpAct = actions[ cActions ];
}
}
}
Bool hasAction( const SCoreInputAction &act ) const
{
for( U32 i = 0; i < cActions; ++i ) {
const SCoreInputAction &cmpAct = actions[ i ];
if( act.command == cmpAct.command && act.key == cmpAct.key && act.uMods == cmpAct.uMods ) {
return true;
}
}
return false;
}
Void issueCommand( ECoreInputAction cmd )
{
switch( cmd ) {
case ECoreInputAction::Quit:
g_DebugLog += "'Quit' action issued. (Probably pressed the 'Esc' key.)";
os_submitQuitEvent();
return;
case ECoreInputAction::ToggleFullscreen:
DOLL_WARNING_LOG += "'ToggleFullscreen' action not implemented";
return;
case ECoreInputAction::CaptureScreenshot:
DOLL_WARNING_LOG += "'CaptureScreenshot' action not implemented";
return;
case ECoreInputAction::OpenDevcon:
DOLL_WARNING_LOG += "'OpenDevcon' action not implemented";
return;
case ECoreInputAction::ToggleGraphs:
DOLL_WARNING_LOG += "'ToggleGraphs' action not implemented";
return;
}
char szBuf[128];
DOLL_ERROR_LOG += (axspf(szBuf,"Unknown action '%u'",U32(cmd)),szBuf);
}
Bool checkCommand( EKey key, U32 uMods )
{
const SCoreInputAction *const pAct = findAction( key, uMods );
if( !pAct ) {
return false;
}
issueCommand( pAct->command );
return true;
}
};
static SWndInputState *getWndInput( OSWindow wnd )
{
static SWndInputState mainWndInputState;
if( ~g_core.input.uFlags & kCoreInF_Enabled ) {
return nullptr;
}
#if DOLL__USE_GLFW
if( !wnd ) {
return &mainWndInputState;
}
#else
if( !wnd || wnd == g_core.view.window ) {
return &mainWndInputState;
}
#endif
return nullptr;
}
// ------------------------------------------------------------------ //
DOLL_FUNC EWndReply in_onAcceptKey_f( OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return EWndReply::NotHandled;
}
// FIXME: Load all current key state up here (at the time of the
// message's delivery)
return EWndReply::Handled;
}
DOLL_FUNC EWndReply in_onResignKey_f( OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return EWndReply::NotHandled;
}
// FIXME: This should probably do something useful or be removed
return EWndReply::Handled;
}
DOLL_FUNC EWndReply in_onKeyPress_f( OSWindow wnd, EKey key, U32 uModFlags, Bool isRepeat )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return EWndReply::NotHandled;
}
if( !isRepeat ) {
if( p->checkCommand( key, uModFlags ) ) {
return EWndReply::Handled;
}
p->hitKey( (U8)key );
p->keyPressed = (U8)key;
}
p->setKey( (U8)key );
return EWndReply::Handled;
}
DOLL_FUNC EWndReply in_onKeyRelease_f( OSWindow wnd, EKey key, U32 uModFlags )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return EWndReply::NotHandled;
}
( Void )uModFlags;
p->relKey( (U8)key );
if( p->keyPressed == ( U8 )key ) {
p->keyPressed = 0;
}
p->clearKey( (U8)key );
return EWndReply::Handled;
}
DOLL_FUNC EWndReply in_onKeyChar_f( OSWindow wnd, U32 utf32Char )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return EWndReply::NotHandled;
}
// FIXME: Check return value and do something useful (like notify the user)
p->handleEntryChar( utf32Char );
return EWndReply::Handled;
}
DOLL_FUNC EWndReply in_onMousePress_f( OSWindow wnd, EMouse button, S32 clientPosX, S32 clientPosY, U32 uModFlags )
{
SWndInputState *const p = getWndInput( wnd );
if( !p || button == EMouse::None ) {
return EWndReply::NotHandled;
}
( Void )uModFlags;
p->setMouse( U8(button) - 1 );
p->handleMouseMove( clientPosX, clientPosY );
p->mouseInWindow = true;
p->hitMouse( U8(button) - 1 );
return EWndReply::Handled;
}
DOLL_FUNC EWndReply in_onMouseRelease_f( OSWindow wnd, EMouse button, S32 clientPosX, S32 clientPosY, U32 uModFlags )
{
SWndInputState *const p = getWndInput( wnd );
if( !p || button == EMouse::None ) {
return EWndReply::NotHandled;
}
( Void )uModFlags;
p->clearMouse( U8(button) - 1 );
p->handleMouseMove( clientPosX, clientPosY );
p->mouseInWindow = true;
p->relMouse( U8(button) - 1 );
return EWndReply::Handled;
}
DOLL_FUNC EWndReply in_onMouseWheel_f( OSWindow wnd, F32 fDelta, S32 clientPosX, S32 clientPosY, U32 uModFlags )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return EWndReply::NotHandled;
}
( Void )uModFlags;
p->mouseZ += fDelta;
p->mouseDeltaZ += fDelta;
p->handleMouseMove( clientPosX, clientPosY );
p->mouseInWindow = true;
return EWndReply::Handled;
}
DOLL_FUNC EWndReply in_onMouseMove_f( OSWindow wnd, S32 clientPosX, S32 clientPosY, U32 uModFlags )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return EWndReply::NotHandled;
}
( void )uModFlags;
p->handleMouseMove( clientPosX, clientPosY );
p->mouseInWindow = true;
return EWndReply::Handled;
}
DOLL_FUNC EWndReply in_onMouseExit_f( OSWindow wnd, U32 uModFlags )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return EWndReply::NotHandled;
}
( Void )uModFlags;
p->mouseInWindow = false;
return EWndReply::Handled;
}
// ------------------------------------------------------------------ //
DOLL_FUNC Void DOLL_API in_enableAll()
{
g_core.input.uFlags |= kCoreInF_Enabled;
}
DOLL_FUNC Void DOLL_API in_disableAll()
{
g_core.input.uFlags &= ~kCoreInF_Enabled;
}
DOLL_FUNC Bool DOLL_API in_allEnabled()
{
return ( g_core.input.uFlags & kCoreInF_Enabled ) != 0;
}
DOLL_FUNC Bool DOLL_API in_keyState( EKey key, OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p ) {
return false;
}
return p->testKey( (U8)key );
}
DOLL_FUNC Bool DOLL_API in_keyHit( EKey key, OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return false;
}
if( p->keyHits[ ( U8 )key ] > 0 ) {
--p->keyHits[ (U8)key ];
return true;
}
return false;
}
DOLL_FUNC Bool DOLL_API in_keyReleased( EKey key, OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return false;
}
if( p->keyRels[ ( U8 )key ] > 0 ) {
--p->keyRels[ (U8)key ];
return true;
}
return false;
}
DOLL_FUNC U8 DOLL_API in_scancode( OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p ) {
return 0;
}
return p->keyPressed;
}
DOLL_FUNC Bool DOLL_API in_mouseState( EMouse button, OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p || button == EMouse::None ) {
return false;
}
return p->testMouse( U8(button) - 1 );
}
DOLL_FUNC Bool DOLL_API in_mouseHit( EMouse button, OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p || button == EMouse::None ) {
return false;
}
const U8 index = U8( button ) - 1;
if( index >= SWndInputState::kNumMouseBtns ) {
return false;
}
if( p->mouseHits[ index ] > 0 ) {
--p->mouseHits[ index ];
return true;
}
return false;
}
DOLL_FUNC Bool DOLL_API in_mouseReleased( EMouse button, OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p || button == EMouse::None ) {
return false;
}
const U8 index = U8( button ) - 1;
if( index >= SWndInputState::kNumMouseBtns ) {
return false;
}
if( p->mouseRels[ index ] > 0 ) {
--p->mouseRels[ index ];
return true;
}
return false;
}
DOLL_FUNC S32 DOLL_API in_mouseX( OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p ) {
return 0;
}
return p->mouseX;
}
DOLL_FUNC S32 DOLL_API in_mouseY( OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p ) {
return 0;
}
return p->mouseY;
}
DOLL_FUNC F32 DOLL_API in_mouseZ( OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p ) {
return 0.0f;
}
return p->mouseZ;
}
DOLL_FUNC Void DOLL_API in_setMouseZ( F32 z, OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return;
}
p->mouseZ = z;
}
DOLL_FUNC S32 DOLL_API in_mouseMoveX( OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p ) {
return 0;
}
return p->mouseDeltaX;
}
DOLL_FUNC S32 DOLL_API in_mouseMoveY( OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p ) {
return 0;
}
return p->mouseDeltaY;
}
DOLL_FUNC F32 DOLL_API in_mouseMoveZ( OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p ) {
return 0.0f;
}
return p->mouseDeltaZ;
}
DOLL_FUNC Void DOLL_API in_resetMouseMove( OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return;
}
p->mouseDeltaX = 0;
p->mouseDeltaY = 0;
p->mouseDeltaZ = 0;
}
DOLL_FUNC Void DOLL_API in_enableEntry( OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return;
}
p->entryEnabled = true;
}
DOLL_FUNC Void DOLL_API in_disableEntry( OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return;
}
p->entryEnabled = false;
}
DOLL_FUNC Bool DOLL_API in_isEntryEnabled( OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p ) {
return false;
}
return p->entryEnabled;
}
DOLL_FUNC Bool DOLL_API in_setEntry( Str entry, OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return false;
}
return p->entry.tryAssign( entry );
}
DOLL_FUNC Bool DOLL_API in_getEntry( Str &dst, OSWindow wnd )
{
SWndInputState const *const p = getWndInput( wnd );
if( !p ) {
dst = Str();
return false;
}
dst = p->entry;
return true;
}
DOLL_FUNC Bool DOLL_API in_addAction( const SCoreInputAction &act, OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return false;
}
return p->addAction( act );
}
DOLL_FUNC Bool DOLL_API in_setAction( const SCoreInputAction &act, OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return false;
}
return p->setAction( act );
}
DOLL_FUNC Void DOLL_API in_removeAction( const SCoreInputAction &act, OSWindow wnd )
{
SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return;
}
p->removeAction( act );
}
DOLL_FUNC Bool DOLL_API in_hasAction( const SCoreInputAction &act, OSWindow wnd )
{
const SWndInputState *const p = getWndInput( wnd );
if( !p ) {
return false;
}
return p->hasAction( act );
}
static const SCoreInputAction g_escapeAct = { EKey::Esc, 0, ECoreInputAction::Quit };
DOLL_FUNC Void DOLL_API in_enableEscapeKey( OSWindow wnd )
{
in_setAction( g_escapeAct, wnd );
}
DOLL_FUNC Void DOLL_API in_disableEscapeKey( OSWindow wnd )
{
in_removeAction( g_escapeAct, wnd );
}
DOLL_FUNC Bool DOLL_API in_escapeKeyEnabled( OSWindow wnd )
{
return in_hasAction( g_escapeAct, wnd );
}
static const SCoreInputAction g_togfullAct1 = { EKey::Enter, kMF_Shift, ECoreInputAction::ToggleFullscreen };
static const SCoreInputAction g_togfullAct2 = { EKey::F11, 0, ECoreInputAction::ToggleFullscreen };
DOLL_FUNC Void DOLL_API in_enableToggleFullscreen( OSWindow wnd )
{
in_setAction( g_togfullAct1, wnd );
in_setAction( g_togfullAct2, wnd );
}
DOLL_FUNC Void DOLL_API in_disableToggleFullscreen( OSWindow wnd )
{
in_removeAction( g_togfullAct2, wnd );
in_removeAction( g_togfullAct1, wnd );
}
DOLL_FUNC Bool DOLL_API in_toggleFullscreenEnabled( OSWindow wnd )
{
return in_hasAction( g_togfullAct1, wnd ) || in_hasAction( g_togfullAct2, wnd );
}
static const SCoreInputAction g_screencapAct = { EKey::F2, 0, ECoreInputAction::CaptureScreenshot };
DOLL_FUNC Void DOLL_API in_enableScreenshot( OSWindow wnd )
{
in_setAction( g_screencapAct, wnd );
}
DOLL_FUNC Void DOLL_API in_disableScreenshot( OSWindow wnd )
{
in_removeAction( g_screencapAct, wnd );
}
DOLL_FUNC Bool DOLL_API in_screenshotEnabled( OSWindow wnd )
{
return in_hasAction( g_screencapAct, wnd );
}
static const SCoreInputAction g_devconAct = { EKey::Grave, 0, ECoreInputAction::OpenDevcon };
DOLL_FUNC Void DOLL_API in_enableDevcon( OSWindow wnd )
{
in_setAction( g_devconAct, wnd );
}
DOLL_FUNC Void DOLL_API in_disableDevcon( OSWindow wnd )
{
in_removeAction( g_devconAct, wnd );
}
DOLL_FUNC Bool DOLL_API in_devconEnabled( OSWindow wnd )
{
return in_hasAction( g_devconAct, wnd );
}
static const SCoreInputAction g_devdbgAct = { EKey::F3, 0, ECoreInputAction::ToggleGraphs };
DOLL_FUNC Void DOLL_API in_enableDevDebug( OSWindow wnd )
{
in_setAction( g_devdbgAct, wnd );
}
DOLL_FUNC Void DOLL_API in_disableDevDebug( OSWindow wnd )
{
in_removeAction( g_devdbgAct, wnd );
}
DOLL_FUNC Bool DOLL_API in_devDebugEnabled( OSWindow wnd )
{
return in_hasAction( g_devdbgAct, wnd );
}
}
| 23.01599 | 119 | 0.617946 | axia-sw |
f2aced26cc0b0822d6a78a499e7cb8f779b3bb62 | 348 | cpp | C++ | native/src/iid.cpp | kekekeks/prowingen | 35585859cca66c2b1c4d865570b6ca1debf7ff60 | [
"MIT"
] | 6 | 2015-03-13T20:27:58.000Z | 2017-09-26T07:01:37.000Z | native/src/iid.cpp | kekekeks/prowingen | 35585859cca66c2b1c4d865570b6ca1debf7ff60 | [
"MIT"
] | null | null | null | native/src/iid.cpp | kekekeks/prowingen | 35585859cca66c2b1c4d865570b6ca1debf7ff60 | [
"MIT"
] | null | null | null | #include "api.h"
// [Guid("918cfa9b-a766-41e7-9c4b-330954d01b47")]
const GUID IID_IHttpServer = { 0x918cfa9b, 0xa766, 0x41e7, { 0x9c, 0x4b, 0x33, 0x9, 0x54, 0xd0, 0x1b, 0x47 } };
// [Guid("e4ea9822-30c8-4319-9d80-5a0e48de0be5")]
const GUID IID_IProwingenFactory = { 0xe4ea9822, 0x30c8, 0x4319, { 0x9d, 0x80, 0x5a, 0xe, 0x48, 0xde, 0xb, 0xe5 } };
| 43.5 | 116 | 0.695402 | kekekeks |
f2ae01098e156f31bd614060b130104bbfb76693 | 2,164 | cpp | C++ | raw-examples/cpp11/doublebufferedqueue/main.cpp | paoqi1997/pqnet | 3413916bdc355b0a4eea8ef934a3ff658b047b19 | [
"BSD-3-Clause"
] | null | null | null | raw-examples/cpp11/doublebufferedqueue/main.cpp | paoqi1997/pqnet | 3413916bdc355b0a4eea8ef934a3ff658b047b19 | [
"BSD-3-Clause"
] | null | null | null | raw-examples/cpp11/doublebufferedqueue/main.cpp | paoqi1997/pqnet | 3413916bdc355b0a4eea8ef934a3ff658b047b19 | [
"BSD-3-Clause"
] | null | null | null | #include <chrono>
#include <iostream>
#include <thread>
#include "doublebufferedqueue.h"
using std::cout;
using std::endl;
using std::chrono::system_clock;
using std::chrono::time_point;
using std::chrono::time_point_cast;
using us_type = std::chrono::microseconds;
std::uint64_t now()
{
time_point<system_clock, us_type> tp = time_point_cast<us_type>(system_clock::now());
return tp.time_since_epoch().count();
}
int cnt1 = 0, cnt2 = 0;
int sum = 10000;
void producerFunc1(Queue<int> *queue);
void producerFunc2(DoubleBufferedQueue<int> *queue);
void consumerFunc1(Queue<int> *queue);
void consumerFunc2(DoubleBufferedQueue<int> *queue);
int main()
{
std::uint64_t t1, t2;
for (int i = 0; i < 5; ++i) {
// Queue
{
Queue<int> queue;
auto beginTime = now();
std::thread producer(producerFunc1, &queue);
std::thread consumer(consumerFunc1, &queue);
producer.join();
consumer.join();
t1 = now() - beginTime;
}
// DoubleBufferedQueue
{
DoubleBufferedQueue<int> queue;
auto beginTime = now();
std::thread producer(producerFunc2, &queue);
std::thread consumer(consumerFunc2, &queue);
producer.join();
consumer.join();
t2 = now() - beginTime;
}
// 输出耗时
cout << t1 << ' ' << t2 << endl;
}
return 0;
}
void producerFunc1(Queue<int> *queue) {
for (int i = 0; i < sum; ++i) {
queue->push(i);
}
}
void producerFunc2(DoubleBufferedQueue<int> *queue) {
for (int i = 0; i < sum; ++i) {
queue->push(i);
}
}
void consumerFunc1(Queue<int> *queue) {
for (;;) {
if (cnt1 == sum) {
cnt1 = 0;
break;
} else if (!queue->empty()) {
queue->pop();
++cnt1;
}
}
}
void consumerFunc2(DoubleBufferedQueue<int> *queue) {
for (;;) {
if (cnt2 == sum) {
cnt2 = 0;
break;
} else if (!queue->empty()) {
queue->pop();
++cnt2;
}
}
}
| 20.807692 | 89 | 0.530961 | paoqi1997 |
f2b11ebe42929f3001cb71231fe45ac346fd57fc | 23,364 | cxx | C++ | SimModel_Python_API/simmodel_swig/SimModel_Dll_lib/framework/SimWallParams.cxx | EnEff-BIM/EnEffBIM-Framework | 6328d39b498dc4065a60b5cc9370b8c2a9a1cddf | [
"MIT"
] | 3 | 2016-05-30T15:12:16.000Z | 2022-03-22T08:11:13.000Z | SimModel_Python_API/simmodel_swig/SimModel_Dll_lib/framework/SimWallParams.cxx | EnEff-BIM/EnEffBIM-Framework | 6328d39b498dc4065a60b5cc9370b8c2a9a1cddf | [
"MIT"
] | 21 | 2016-06-13T11:33:45.000Z | 2017-05-23T09:46:52.000Z | SimModel_Python_API/simmodel_swig/SimModel_Dll_lib/framework/SimWallParams.cxx | EnEff-BIM/EnEffBIM-Framework | 6328d39b498dc4065a60b5cc9370b8c2a9a1cddf | [
"MIT"
] | null | null | null | // Copyright (c) 2005-2014 Code Synthesis Tools CC
//
// This program was generated by CodeSynthesis XSD, an XML Schema to
// C++ data binding compiler.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 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 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 St, Fifth Floor, Boston, MA 02110-1301 USA
//
// In addition, as a special exception, Code Synthesis Tools CC gives
// permission to link this program with the Xerces-C++ library (or with
// modified versions of Xerces-C++ that use the same license as Xerces-C++),
// and distribute linked combinations including the two. You must obey
// the GNU General Public License version 2 in all respects for all of
// the code used other than Xerces-C++. If you modify this copy of the
// program, you may extend this exception to your version of the program,
// but you are not obligated to do so. If you do not wish to do so, delete
// this exception statement from your version.
//
// Furthermore, Code Synthesis Tools CC makes a special exception for
// the Free/Libre and Open Source Software (FLOSS) which is described
// in the accompanying FLOSSE file.
//
// Begin prologue.
//
//
// End prologue.
#include <xsd/cxx/pre.hxx>
#include "SimWallParams.hxx"
namespace schema
{
namespace simxml
{
namespace ResourcesGeneral
{
// SimWallParams
//
const SimWallParams::Thickness_optional& SimWallParams::
Thickness () const
{
return this->Thickness_;
}
SimWallParams::Thickness_optional& SimWallParams::
Thickness ()
{
return this->Thickness_;
}
void SimWallParams::
Thickness (const Thickness_type& x)
{
this->Thickness_.set (x);
}
void SimWallParams::
Thickness (const Thickness_optional& x)
{
this->Thickness_ = x;
}
const SimWallParams::Length_optional& SimWallParams::
Length () const
{
return this->Length_;
}
SimWallParams::Length_optional& SimWallParams::
Length ()
{
return this->Length_;
}
void SimWallParams::
Length (const Length_type& x)
{
this->Length_.set (x);
}
void SimWallParams::
Length (const Length_optional& x)
{
this->Length_ = x;
}
const SimWallParams::Height_optional& SimWallParams::
Height () const
{
return this->Height_;
}
SimWallParams::Height_optional& SimWallParams::
Height ()
{
return this->Height_;
}
void SimWallParams::
Height (const Height_type& x)
{
this->Height_.set (x);
}
void SimWallParams::
Height (const Height_optional& x)
{
this->Height_ = x;
}
const SimWallParams::BaseElevation_optional& SimWallParams::
BaseElevation () const
{
return this->BaseElevation_;
}
SimWallParams::BaseElevation_optional& SimWallParams::
BaseElevation ()
{
return this->BaseElevation_;
}
void SimWallParams::
BaseElevation (const BaseElevation_type& x)
{
this->BaseElevation_.set (x);
}
void SimWallParams::
BaseElevation (const BaseElevation_optional& x)
{
this->BaseElevation_ = x;
}
const SimWallParams::RefLinePosition_optional& SimWallParams::
RefLinePosition () const
{
return this->RefLinePosition_;
}
SimWallParams::RefLinePosition_optional& SimWallParams::
RefLinePosition ()
{
return this->RefLinePosition_;
}
void SimWallParams::
RefLinePosition (const RefLinePosition_type& x)
{
this->RefLinePosition_.set (x);
}
void SimWallParams::
RefLinePosition (const RefLinePosition_optional& x)
{
this->RefLinePosition_ = x;
}
void SimWallParams::
RefLinePosition (::std::auto_ptr< RefLinePosition_type > x)
{
this->RefLinePosition_.set (x);
}
const SimWallParams::RefLinePath_optional& SimWallParams::
RefLinePath () const
{
return this->RefLinePath_;
}
SimWallParams::RefLinePath_optional& SimWallParams::
RefLinePath ()
{
return this->RefLinePath_;
}
void SimWallParams::
RefLinePath (const RefLinePath_type& x)
{
this->RefLinePath_.set (x);
}
void SimWallParams::
RefLinePath (const RefLinePath_optional& x)
{
this->RefLinePath_ = x;
}
void SimWallParams::
RefLinePath (::std::auto_ptr< RefLinePath_type > x)
{
this->RefLinePath_.set (x);
}
const SimWallParams::DegreeOfNormal_optional& SimWallParams::
DegreeOfNormal () const
{
return this->DegreeOfNormal_;
}
SimWallParams::DegreeOfNormal_optional& SimWallParams::
DegreeOfNormal ()
{
return this->DegreeOfNormal_;
}
void SimWallParams::
DegreeOfNormal (const DegreeOfNormal_type& x)
{
this->DegreeOfNormal_.set (x);
}
void SimWallParams::
DegreeOfNormal (const DegreeOfNormal_optional& x)
{
this->DegreeOfNormal_ = x;
}
const SimWallParams::CompassNsewDirection_optional& SimWallParams::
CompassNsewDirection () const
{
return this->CompassNsewDirection_;
}
SimWallParams::CompassNsewDirection_optional& SimWallParams::
CompassNsewDirection ()
{
return this->CompassNsewDirection_;
}
void SimWallParams::
CompassNsewDirection (const CompassNsewDirection_type& x)
{
this->CompassNsewDirection_.set (x);
}
void SimWallParams::
CompassNsewDirection (const CompassNsewDirection_optional& x)
{
this->CompassNsewDirection_ = x;
}
void SimWallParams::
CompassNsewDirection (::std::auto_ptr< CompassNsewDirection_type > x)
{
this->CompassNsewDirection_.set (x);
}
const SimWallParams::WallIsExternal_optional& SimWallParams::
WallIsExternal () const
{
return this->WallIsExternal_;
}
SimWallParams::WallIsExternal_optional& SimWallParams::
WallIsExternal ()
{
return this->WallIsExternal_;
}
void SimWallParams::
WallIsExternal (const WallIsExternal_type& x)
{
this->WallIsExternal_.set (x);
}
void SimWallParams::
WallIsExternal (const WallIsExternal_optional& x)
{
this->WallIsExternal_ = x;
}
const SimWallParams::Justify_optional& SimWallParams::
Justify () const
{
return this->Justify_;
}
SimWallParams::Justify_optional& SimWallParams::
Justify ()
{
return this->Justify_;
}
void SimWallParams::
Justify (const Justify_type& x)
{
this->Justify_.set (x);
}
void SimWallParams::
Justify (const Justify_optional& x)
{
this->Justify_ = x;
}
const SimWallParams::ContainedWinArrayParams_optional& SimWallParams::
ContainedWinArrayParams () const
{
return this->ContainedWinArrayParams_;
}
SimWallParams::ContainedWinArrayParams_optional& SimWallParams::
ContainedWinArrayParams ()
{
return this->ContainedWinArrayParams_;
}
void SimWallParams::
ContainedWinArrayParams (const ContainedWinArrayParams_type& x)
{
this->ContainedWinArrayParams_.set (x);
}
void SimWallParams::
ContainedWinArrayParams (const ContainedWinArrayParams_optional& x)
{
this->ContainedWinArrayParams_ = x;
}
void SimWallParams::
ContainedWinArrayParams (::std::auto_ptr< ContainedWinArrayParams_type > x)
{
this->ContainedWinArrayParams_.set (x);
}
const SimWallParams::ContainedWindowParams_optional& SimWallParams::
ContainedWindowParams () const
{
return this->ContainedWindowParams_;
}
SimWallParams::ContainedWindowParams_optional& SimWallParams::
ContainedWindowParams ()
{
return this->ContainedWindowParams_;
}
void SimWallParams::
ContainedWindowParams (const ContainedWindowParams_type& x)
{
this->ContainedWindowParams_.set (x);
}
void SimWallParams::
ContainedWindowParams (const ContainedWindowParams_optional& x)
{
this->ContainedWindowParams_ = x;
}
void SimWallParams::
ContainedWindowParams (::std::auto_ptr< ContainedWindowParams_type > x)
{
this->ContainedWindowParams_.set (x);
}
const SimWallParams::ContainedDoorArrayParams_optional& SimWallParams::
ContainedDoorArrayParams () const
{
return this->ContainedDoorArrayParams_;
}
SimWallParams::ContainedDoorArrayParams_optional& SimWallParams::
ContainedDoorArrayParams ()
{
return this->ContainedDoorArrayParams_;
}
void SimWallParams::
ContainedDoorArrayParams (const ContainedDoorArrayParams_type& x)
{
this->ContainedDoorArrayParams_.set (x);
}
void SimWallParams::
ContainedDoorArrayParams (const ContainedDoorArrayParams_optional& x)
{
this->ContainedDoorArrayParams_ = x;
}
void SimWallParams::
ContainedDoorArrayParams (::std::auto_ptr< ContainedDoorArrayParams_type > x)
{
this->ContainedDoorArrayParams_.set (x);
}
const SimWallParams::ContainedDoorParams_optional& SimWallParams::
ContainedDoorParams () const
{
return this->ContainedDoorParams_;
}
SimWallParams::ContainedDoorParams_optional& SimWallParams::
ContainedDoorParams ()
{
return this->ContainedDoorParams_;
}
void SimWallParams::
ContainedDoorParams (const ContainedDoorParams_type& x)
{
this->ContainedDoorParams_.set (x);
}
void SimWallParams::
ContainedDoorParams (const ContainedDoorParams_optional& x)
{
this->ContainedDoorParams_ = x;
}
void SimWallParams::
ContainedDoorParams (::std::auto_ptr< ContainedDoorParams_type > x)
{
this->ContainedDoorParams_.set (x);
}
const SimWallParams::ProfilePath_optional& SimWallParams::
ProfilePath () const
{
return this->ProfilePath_;
}
SimWallParams::ProfilePath_optional& SimWallParams::
ProfilePath ()
{
return this->ProfilePath_;
}
void SimWallParams::
ProfilePath (const ProfilePath_type& x)
{
this->ProfilePath_.set (x);
}
void SimWallParams::
ProfilePath (const ProfilePath_optional& x)
{
this->ProfilePath_ = x;
}
void SimWallParams::
ProfilePath (::std::auto_ptr< ProfilePath_type > x)
{
this->ProfilePath_.set (x);
}
}
}
}
#include <xsd/cxx/xml/dom/parsing-source.hxx>
#include <xsd/cxx/tree/type-factory-map.hxx>
namespace _xsd
{
static
const ::xsd::cxx::tree::type_factory_plate< 0, char >
type_factory_plate_init;
}
namespace schema
{
namespace simxml
{
namespace ResourcesGeneral
{
// SimWallParams
//
SimWallParams::
SimWallParams ()
: ::schema::simxml::SimModelCore::SimBldgModelParams (),
Thickness_ (this),
Length_ (this),
Height_ (this),
BaseElevation_ (this),
RefLinePosition_ (this),
RefLinePath_ (this),
DegreeOfNormal_ (this),
CompassNsewDirection_ (this),
WallIsExternal_ (this),
Justify_ (this),
ContainedWinArrayParams_ (this),
ContainedWindowParams_ (this),
ContainedDoorArrayParams_ (this),
ContainedDoorParams_ (this),
ProfilePath_ (this)
{
}
SimWallParams::
SimWallParams (const RefId_type& RefId)
: ::schema::simxml::SimModelCore::SimBldgModelParams (RefId),
Thickness_ (this),
Length_ (this),
Height_ (this),
BaseElevation_ (this),
RefLinePosition_ (this),
RefLinePath_ (this),
DegreeOfNormal_ (this),
CompassNsewDirection_ (this),
WallIsExternal_ (this),
Justify_ (this),
ContainedWinArrayParams_ (this),
ContainedWindowParams_ (this),
ContainedDoorArrayParams_ (this),
ContainedDoorParams_ (this),
ProfilePath_ (this)
{
}
SimWallParams::
SimWallParams (const SimWallParams& x,
::xml_schema::flags f,
::xml_schema::container* c)
: ::schema::simxml::SimModelCore::SimBldgModelParams (x, f, c),
Thickness_ (x.Thickness_, f, this),
Length_ (x.Length_, f, this),
Height_ (x.Height_, f, this),
BaseElevation_ (x.BaseElevation_, f, this),
RefLinePosition_ (x.RefLinePosition_, f, this),
RefLinePath_ (x.RefLinePath_, f, this),
DegreeOfNormal_ (x.DegreeOfNormal_, f, this),
CompassNsewDirection_ (x.CompassNsewDirection_, f, this),
WallIsExternal_ (x.WallIsExternal_, f, this),
Justify_ (x.Justify_, f, this),
ContainedWinArrayParams_ (x.ContainedWinArrayParams_, f, this),
ContainedWindowParams_ (x.ContainedWindowParams_, f, this),
ContainedDoorArrayParams_ (x.ContainedDoorArrayParams_, f, this),
ContainedDoorParams_ (x.ContainedDoorParams_, f, this),
ProfilePath_ (x.ProfilePath_, f, this)
{
}
SimWallParams::
SimWallParams (const ::xercesc::DOMElement& e,
::xml_schema::flags f,
::xml_schema::container* c)
: ::schema::simxml::SimModelCore::SimBldgModelParams (e, f | ::xml_schema::flags::base, c),
Thickness_ (this),
Length_ (this),
Height_ (this),
BaseElevation_ (this),
RefLinePosition_ (this),
RefLinePath_ (this),
DegreeOfNormal_ (this),
CompassNsewDirection_ (this),
WallIsExternal_ (this),
Justify_ (this),
ContainedWinArrayParams_ (this),
ContainedWindowParams_ (this),
ContainedDoorArrayParams_ (this),
ContainedDoorParams_ (this),
ProfilePath_ (this)
{
if ((f & ::xml_schema::flags::base) == 0)
{
::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
this->parse (p, f);
}
}
void SimWallParams::
parse (::xsd::cxx::xml::dom::parser< char >& p,
::xml_schema::flags f)
{
this->::schema::simxml::SimModelCore::SimBldgModelParams::parse (p, f);
for (; p.more_content (); p.next_content (false))
{
const ::xercesc::DOMElement& i (p.cur_element ());
const ::xsd::cxx::xml::qualified_name< char > n (
::xsd::cxx::xml::dom::name< char > (i));
// Thickness
//
if (n.name () == "Thickness" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
if (!this->Thickness_)
{
this->Thickness_.set (Thickness_traits::create (i, f, this));
continue;
}
}
// Length
//
if (n.name () == "Length" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
if (!this->Length_)
{
this->Length_.set (Length_traits::create (i, f, this));
continue;
}
}
// Height
//
if (n.name () == "Height" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
if (!this->Height_)
{
this->Height_.set (Height_traits::create (i, f, this));
continue;
}
}
// BaseElevation
//
if (n.name () == "BaseElevation" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
if (!this->BaseElevation_)
{
this->BaseElevation_.set (BaseElevation_traits::create (i, f, this));
continue;
}
}
// RefLinePosition
//
if (n.name () == "RefLinePosition" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
::std::auto_ptr< RefLinePosition_type > r (
RefLinePosition_traits::create (i, f, this));
if (!this->RefLinePosition_)
{
this->RefLinePosition_.set (r);
continue;
}
}
// RefLinePath
//
if (n.name () == "RefLinePath" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
::std::auto_ptr< RefLinePath_type > r (
RefLinePath_traits::create (i, f, this));
if (!this->RefLinePath_)
{
this->RefLinePath_.set (r);
continue;
}
}
// DegreeOfNormal
//
if (n.name () == "DegreeOfNormal" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
if (!this->DegreeOfNormal_)
{
this->DegreeOfNormal_.set (DegreeOfNormal_traits::create (i, f, this));
continue;
}
}
// CompassNsewDirection
//
if (n.name () == "CompassNsewDirection" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
::std::auto_ptr< CompassNsewDirection_type > r (
CompassNsewDirection_traits::create (i, f, this));
if (!this->CompassNsewDirection_)
{
this->CompassNsewDirection_.set (r);
continue;
}
}
// WallIsExternal
//
if (n.name () == "WallIsExternal" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
if (!this->WallIsExternal_)
{
this->WallIsExternal_.set (WallIsExternal_traits::create (i, f, this));
continue;
}
}
// Justify
//
if (n.name () == "Justify" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
if (!this->Justify_)
{
this->Justify_.set (Justify_traits::create (i, f, this));
continue;
}
}
// ContainedWinArrayParams
//
if (n.name () == "ContainedWinArrayParams" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
::std::auto_ptr< ContainedWinArrayParams_type > r (
ContainedWinArrayParams_traits::create (i, f, this));
if (!this->ContainedWinArrayParams_)
{
this->ContainedWinArrayParams_.set (r);
continue;
}
}
// ContainedWindowParams
//
if (n.name () == "ContainedWindowParams" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
::std::auto_ptr< ContainedWindowParams_type > r (
ContainedWindowParams_traits::create (i, f, this));
if (!this->ContainedWindowParams_)
{
this->ContainedWindowParams_.set (r);
continue;
}
}
// ContainedDoorArrayParams
//
if (n.name () == "ContainedDoorArrayParams" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
::std::auto_ptr< ContainedDoorArrayParams_type > r (
ContainedDoorArrayParams_traits::create (i, f, this));
if (!this->ContainedDoorArrayParams_)
{
this->ContainedDoorArrayParams_.set (r);
continue;
}
}
// ContainedDoorParams
//
if (n.name () == "ContainedDoorParams" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
::std::auto_ptr< ContainedDoorParams_type > r (
ContainedDoorParams_traits::create (i, f, this));
if (!this->ContainedDoorParams_)
{
this->ContainedDoorParams_.set (r);
continue;
}
}
// ProfilePath
//
if (n.name () == "ProfilePath" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/ResourcesGeneral")
{
::std::auto_ptr< ProfilePath_type > r (
ProfilePath_traits::create (i, f, this));
if (!this->ProfilePath_)
{
this->ProfilePath_.set (r);
continue;
}
}
break;
}
}
SimWallParams* SimWallParams::
_clone (::xml_schema::flags f,
::xml_schema::container* c) const
{
return new class SimWallParams (*this, f, c);
}
SimWallParams& SimWallParams::
operator= (const SimWallParams& x)
{
if (this != &x)
{
static_cast< ::schema::simxml::SimModelCore::SimBldgModelParams& > (*this) = x;
this->Thickness_ = x.Thickness_;
this->Length_ = x.Length_;
this->Height_ = x.Height_;
this->BaseElevation_ = x.BaseElevation_;
this->RefLinePosition_ = x.RefLinePosition_;
this->RefLinePath_ = x.RefLinePath_;
this->DegreeOfNormal_ = x.DegreeOfNormal_;
this->CompassNsewDirection_ = x.CompassNsewDirection_;
this->WallIsExternal_ = x.WallIsExternal_;
this->Justify_ = x.Justify_;
this->ContainedWinArrayParams_ = x.ContainedWinArrayParams_;
this->ContainedWindowParams_ = x.ContainedWindowParams_;
this->ContainedDoorArrayParams_ = x.ContainedDoorArrayParams_;
this->ContainedDoorParams_ = x.ContainedDoorParams_;
this->ProfilePath_ = x.ProfilePath_;
}
return *this;
}
SimWallParams::
~SimWallParams ()
{
}
}
}
}
#include <istream>
#include <xsd/cxx/xml/sax/std-input-source.hxx>
#include <xsd/cxx/tree/error-handler.hxx>
namespace schema
{
namespace simxml
{
namespace ResourcesGeneral
{
}
}
}
#include <xsd/cxx/post.hxx>
// Begin epilogue.
//
//
// End epilogue.
| 27.715302 | 130 | 0.581279 | EnEff-BIM |
f2b2feb092193c235224344928d5e1d42b0e5438 | 90 | cxx | C++ | app/create_date.cxx | engrvivs/tutorial-nptel-ppd | eecf699d579d13e2ef7c8352798b514b760b7d06 | [
"MIT"
] | null | null | null | app/create_date.cxx | engrvivs/tutorial-nptel-ppd | eecf699d579d13e2ef7c8352798b514b760b7d06 | [
"MIT"
] | null | null | null | app/create_date.cxx | engrvivs/tutorial-nptel-ppd | eecf699d579d13e2ef7c8352798b514b760b7d06 | [
"MIT"
] | null | null | null | #include "Date.hpp"
int main() {
Date date(30, 7, 1961);
date.print();
return 0;
}
| 11.25 | 25 | 0.577778 | engrvivs |
f2b36aa3a7811f6b2f5c6c74600110ee0725331d | 407 | cpp | C++ | solution/day1/part1.cpp | Desheen/AdventOfCode-2018 | 4d633f51ba5f906c365bb8ef2512465dea941d24 | [
"BSD-3-Clause"
] | 1 | 2018-12-02T20:17:59.000Z | 2018-12-02T20:17:59.000Z | solution/day1/part1.cpp | Desheen/AdventOfCode-2018 | 4d633f51ba5f906c365bb8ef2512465dea941d24 | [
"BSD-3-Clause"
] | null | null | null | solution/day1/part1.cpp | Desheen/AdventOfCode-2018 | 4d633f51ba5f906c365bb8ef2512465dea941d24 | [
"BSD-3-Clause"
] | null | null | null | #include <iostream>
#include <string>
#include <fstream>
#include <numeric>
#include <vector>
int
main( int argc ,char**argv )
{
std::string line;
std::vector<int> v;
std::ifstream file;
file.open("input", std::ifstream::in);
while(std::getline( file , line ))
{
v.push_back( std::stoi(line) );
}
file.close();
std::cout << std::accumulate(v.begin(), v.end() , 0) << std::endl;
return 0;
} | 17.695652 | 67 | 0.628993 | Desheen |
f2d996b2d16885b9545177a711799c2281713796 | 15,816 | cpp | C++ | src/legwork.cpp | gamepoet/legwork | 8071182cf73d278e7e950cc77209a8961b43fafa | [
"MIT"
] | null | null | null | src/legwork.cpp | gamepoet/legwork | 8071182cf73d278e7e950cc77209a8961b43fafa | [
"MIT"
] | null | null | null | src/legwork.cpp | gamepoet/legwork | 8071182cf73d278e7e950cc77209a8961b43fafa | [
"MIT"
] | null | null | null | #include <atomic>
#include <condition_variable>
#include <mutex>
#include <queue>
#include <stack>
#include <stdlib.h>
#include <thread>
#include <vector>
#include "legwork.h"
#include "fcontext.h"
#define DEFAULT_FIBER_COUNT 256
#define DEFAULT_FIBER_STACK_SIZE_BYTES (64 * 1024)
#define DEFAULT_WORKER_THREAD_SPIN_COUNT_BEFORE_WAIT (1024)
#define INVALID_FIBER_ID 0
#define legwork_assert(expr, message) ((expr) ? true : (s_config.assert_func(__FILE__, __LINE__, __func__, #expr, message), false))
#define legwork_alloc(size) s_config.alloc(size, s_config.alloc_user_data, __FILE__, __LINE__, __func__)
#define legwork_free(ptr) s_config.free(ptr, s_config.alloc_user_data, __FILE__, __LINE__, __func__)
struct sleeping_fiber_t {
int fiber_id;
uint32_t wait_value;
legwork_counter_t* counter;
};
struct legwork_counter_t {
std::atomic<uint32_t> value;
};
struct task_queue_entry_t {
legwork_task_desc_t task_desc;
legwork_counter_t* counter;
};
struct fiber_t {
int id;
fcontext_t fcontext;
legwork_task_desc_t task_desc;
legwork_counter_t* counter;
};
struct worker_tls_t {
int worker_id;
int active_fiber_id;
int worker_fiber_id; // the fiber that decides what fibers to run
int sleep_fiber_id; // put this fiber to sleep
legwork_counter_t* sleep_fiber_counter;
uint32_t sleep_fiber_wait_value;
int free_fiber_id; // free this fiber
};
static legwork_config_t s_config;
static std::thread* s_threads; // the worker threads
static std::atomic<bool> s_shutdown; // global shutdown request flag
static legwork_counter_t* s_counters;
static std::stack<int> s_counter_free_pool;
static std::mutex s_counter_free_pool_mutex;
static char* s_fiber_stack_memory; // static memory for all the fibers
static fiber_t* s_fibers; // each fiber's instance data
thread_local static worker_tls_t s_tls_worker; // TLS data for the current worker thread
static std::stack<int> s_fiber_free_pool; // pool of free fibers
static std::mutex s_fiber_free_pool_mutex; // lock for the fiber free pool
static std::vector<sleeping_fiber_t> s_sleeping_fibers;
static std::mutex s_sleeping_fibers_mutex;
static std::atomic<uint32_t> s_waiting_worker_count;
static std::mutex s_waiting_worker_mutex;
static std::condition_variable s_waiting_worker_cond_var;
// TODO: replace with lock-free queue
static std::mutex s_task_queue_mutex;
static std::queue<task_queue_entry_t> s_task_queue;
static void default_assert(const char* file, int line, const char* func, const char* expression, const char* message) {
fprintf(stderr, "ASSERT FAILURE: %s\n%s\nfile: %s\nline: %d\nfunc: %s\n", message, expression, file, line, func);
exit(EXIT_FAILURE);
}
static void* default_alloc(unsigned int size, void* user_data, const char* file, int line, const char* func) {
return malloc(size);
}
static void default_free(void* ptr, void* user_data, const char* file, int line, const char* func) {
free(ptr);
}
static legwork_counter_t* counter_alloc() {
std::lock_guard<std::mutex> lock(s_counter_free_pool_mutex);
if (!s_counter_free_pool.empty()) {
int index = s_counter_free_pool.top();
s_counter_free_pool.pop();
return s_counters + index;
}
return nullptr;
}
static void counter_free(legwork_counter_t* counter) {
int index = (int)(counter - s_counters);
std::lock_guard<std::mutex> lock(s_counter_free_pool_mutex);
s_counter_free_pool.push(index);
}
// puts the current thread into a wait state until it is woken up by a worker_thread_notify().
static void worker_thread_wait() {
// increment the waiting worker count
s_waiting_worker_count.fetch_add(1);
// go to sleep
{
std::unique_lock<std::mutex> lock(s_waiting_worker_mutex);
// pessimistically double-check that a shutdown hasn't been requested
if (!s_shutdown.load(std::memory_order_seq_cst)) {
s_waiting_worker_cond_var.wait(lock);
}
}
// decrement the waiting worker count
s_waiting_worker_count.fetch_sub(1);
}
// wakes up one worker thread if any are waiting
static void worker_thread_maybe_notify_one() {
const uint32_t wait_count = s_waiting_worker_count.load(std::memory_order_seq_cst);
if (wait_count > 0) {
s_waiting_worker_cond_var.notify_one();
}
}
// wakes up all the worker threads
static void worker_thread_notify_all() {
// take the lock here so that we can be sure no threads will wait AFTER the notify
std::lock_guard<std::mutex> lock(s_waiting_worker_mutex);
s_waiting_worker_cond_var.notify_all();
}
static void task_queue_push(const legwork_task_desc_t* task_desc, legwork_counter_t* counter) {
task_queue_entry_t entry;
entry.task_desc = *task_desc;
entry.counter = counter;
{
std::lock_guard<std::mutex> lock(s_task_queue_mutex);
s_task_queue.emplace(entry);
}
worker_thread_maybe_notify_one();
}
static bool task_queue_pop(task_queue_entry_t* entry) {
std::lock_guard<std::mutex> lock(s_task_queue_mutex);
if (!s_task_queue.empty()) {
*entry = s_task_queue.front();
s_task_queue.pop();
return true;
}
return false;
}
static void sleeping_fibers_push(int fiber_id, legwork_counter_t* counter, unsigned int wait_value) {
sleeping_fiber_t entry;
entry.fiber_id = fiber_id;
entry.wait_value = wait_value;
entry.counter = counter;
{
std::lock_guard<std::mutex> lock(s_sleeping_fibers_mutex);
s_sleeping_fibers.emplace_back(entry);
}
worker_thread_maybe_notify_one();
}
static int sleeping_fibers_pop_first_ready() {
std::lock_guard<std::mutex> lock(s_sleeping_fibers_mutex);
for (size_t index = 0, count = s_sleeping_fibers.size(); index < count; ++index) {
sleeping_fiber_t* sleeping_fiber = &s_sleeping_fibers[index];
const unsigned int value = sleeping_fiber->counter->value.load(std::memory_order_relaxed);
if (value <= sleeping_fiber->wait_value) {
// found a ready fiber, remove it from the list
int fiber_id = sleeping_fiber->fiber_id;
s_sleeping_fibers.erase(s_sleeping_fibers.begin() + index);
return fiber_id;
}
}
return INVALID_FIBER_ID;
}
static void fiber_switch_to(int target_fiber_id) {
// update the TLS for the active fiber id
const int active_fiber_id = s_tls_worker.active_fiber_id;
s_tls_worker.active_fiber_id = target_fiber_id;
fiber_t* fiber_from = s_fibers + active_fiber_id;
fiber_t* fiber_to = s_fibers + target_fiber_id;
jump_fcontext(&fiber_from->fcontext, fiber_to->fcontext, fiber_to->task_desc.task, 1);
}
static void fiber_proc(void* task) {
// run the fiber func
const int self_fiber_id = s_tls_worker.active_fiber_id;
const fiber_t* fiber = s_fibers + self_fiber_id;
fiber->task_desc.func(task);
// run the on_complete func
if (fiber->task_desc.on_complete != nullptr) {
fiber->task_desc.on_complete(task);
}
// denote the fiber as completed
legwork_counter_t* counter = fiber->counter;
if (counter != nullptr) {
counter->value.fetch_sub(1, std::memory_order_seq_cst);
}
// ask to have this fiber be freed
s_tls_worker.free_fiber_id = self_fiber_id;
// switch back to the worker fiber
fiber_switch_to(s_tls_worker.worker_fiber_id);
}
static int fiber_alloc(legwork_task_desc_t* task_desc, legwork_counter_t* counter) {
fiber_t* fiber = nullptr;
{
// grab a fiber off the free pool
std::lock_guard<std::mutex> lock(s_fiber_free_pool_mutex);
if (!s_fiber_free_pool.empty()) {
int fiber_id = s_fiber_free_pool.top();
s_fiber_free_pool.pop();
fiber = s_fibers + fiber_id;
}
}
// bail on allocation failure
if (fiber == nullptr) {
return INVALID_FIBER_ID;
}
// initialize the fiber
const int fiber_id = fiber->id;
void* stack_ptr = s_fiber_stack_memory + (fiber_id * s_config.fiber_stack_size_bytes);
fiber->fcontext = make_fcontext(stack_ptr, s_config.fiber_stack_size_bytes, &fiber_proc);
fiber->task_desc = *task_desc;
fiber->counter = counter;
return fiber_id;
}
static void fiber_free(int fiber_id) {
fiber_t* fiber = s_fibers + fiber_id;
fiber->fcontext = nullptr;
fiber->task_desc.func = nullptr;
fiber->task_desc.task = nullptr;
fiber->counter = nullptr;
{
std::lock_guard<std::mutex> lock(s_fiber_free_pool_mutex);
s_fiber_free_pool.push(fiber_id);
}
}
static int get_next_fiber() {
int fiber_id = INVALID_FIBER_ID;
// try grabbing a fiber that was waiting but is now ready
fiber_id = sleeping_fibers_pop_first_ready();
if (fiber_id != INVALID_FIBER_ID) {
return fiber_id;
}
// grab a job from the queue
task_queue_entry_t task_queue_entry;
const bool task_is_valid = task_queue_pop(&task_queue_entry);
if (task_is_valid) {
fiber_id = fiber_alloc(&task_queue_entry.task_desc, task_queue_entry.counter);
}
return fiber_id;
}
static void worker_fiber_proc(void* task) {
printf("shouldn't be here\n");
}
static void worker_thread_proc(int worker_id) {
// printf("worker %d!\n", worker_id);
s_tls_worker.worker_id = worker_id;
s_tls_worker.active_fiber_id = INVALID_FIBER_ID;
s_tls_worker.worker_fiber_id = INVALID_FIBER_ID;
s_tls_worker.sleep_fiber_id = INVALID_FIBER_ID;
s_tls_worker.sleep_fiber_counter = nullptr;
s_tls_worker.sleep_fiber_wait_value = 0;
s_tls_worker.free_fiber_id = INVALID_FIBER_ID;
// alloc a fiber for this worker even though it won't execute. the fiber is used to record the current stack so that
// completing fibers can switch back to this worker
legwork_task_desc_t worker_task_desc = {};
worker_task_desc.func = &worker_fiber_proc;
s_tls_worker.worker_fiber_id = fiber_alloc(&worker_task_desc, nullptr);
s_tls_worker.active_fiber_id = s_tls_worker.worker_fiber_id;
unsigned int spin_wait_count = 0;
while (!s_shutdown.load(std::memory_order_relaxed)) {
int fiber_id = get_next_fiber();
if (fiber_id == INVALID_FIBER_ID) {
// no work to do. spin
++spin_wait_count;
if (spin_wait_count > s_config.worker_thread_spin_count_before_wait) {
// this thread spun too many times, so go into a wait state so CPU cycles are waited
worker_thread_wait();
}
continue;
}
// we have work! reset the spin wait count
spin_wait_count = 0;
// run the fiber
fiber_switch_to(fiber_id);
// if the previous fiber asked to be marked as asleep, do so now
if (s_tls_worker.sleep_fiber_id != INVALID_FIBER_ID) {
sleeping_fibers_push(s_tls_worker.sleep_fiber_id, s_tls_worker.sleep_fiber_counter, s_tls_worker.sleep_fiber_wait_value);
s_tls_worker.sleep_fiber_id = INVALID_FIBER_ID;
s_tls_worker.sleep_fiber_counter = nullptr;
s_tls_worker.sleep_fiber_wait_value = 0;
}
// if the previous fiber asked to be freed, do so now
if (s_tls_worker.free_fiber_id != INVALID_FIBER_ID) {
fiber_free(s_tls_worker.free_fiber_id);
s_tls_worker.free_fiber_id = INVALID_FIBER_ID;
}
}
// printf("[%d] worker is done\n", worker_id);
}
void legwork_config_init(legwork_config_t* config) {
config->fiber_count = DEFAULT_FIBER_COUNT;
config->fiber_stack_size_bytes = DEFAULT_FIBER_STACK_SIZE_BYTES;
config->worker_thread_count = std::thread::hardware_concurrency();
config->worker_thread_spin_count_before_wait = DEFAULT_WORKER_THREAD_SPIN_COUNT_BEFORE_WAIT;
config->alloc = &default_alloc;
config->free = &default_free;
config->alloc_user_data = NULL;
config->assert_func = &default_assert;
}
void legwork_lib_init(const legwork_config_t* config) {
if (config) {
s_config = *config;
}
else {
legwork_config_init(&s_config);
}
// create the wait counters
s_counters = (legwork_counter_t*)legwork_alloc(sizeof(legwork_counter_t) * s_config.fiber_count);
for (int index = s_config.fiber_count - 1; index >= 0; --index) {
new (s_counters + index) legwork_counter_t;
s_counter_free_pool.push(index);
}
// create the fibers
s_fiber_stack_memory = (char*)legwork_alloc(s_config.fiber_stack_size_bytes * s_config.fiber_count);
s_fibers = (fiber_t*)legwork_alloc(sizeof(fiber_t) * s_config.fiber_count);
for (int index = s_config.fiber_count - 1; index >= 1; --index) {
fiber_t* fiber = s_fibers + index;
fiber->id = index;
fiber->fcontext = nullptr;
fiber->task_desc.func = nullptr;
fiber->task_desc.task = nullptr;
s_fiber_free_pool.push(index);
}
// start the worker threads
s_shutdown.store(false, std::memory_order_seq_cst);
s_threads = (std::thread*)legwork_alloc(sizeof(std::thread) * s_config.worker_thread_count);
for (unsigned int index = 0; index < s_config.worker_thread_count; ++index) {
new (s_threads + index) std::thread(&worker_thread_proc, index);
}
}
void legwork_lib_shutdown() {
// stop the worker threads
s_shutdown.store(true, std::memory_order_seq_cst);
worker_thread_notify_all();
for (unsigned int index = 0; index < s_config.worker_thread_count; ++index) {
s_threads[index].join();
s_threads[index].~thread();
}
legwork_free(s_threads);
s_threads = nullptr;
// destroy the fibers
legwork_free(s_fiber_stack_memory);
s_fiber_stack_memory = nullptr;
legwork_free(s_fibers);
s_fibers = nullptr;
while (!s_fiber_free_pool.empty()) {
s_fiber_free_pool.pop();
}
// destroy the wait counters
legwork_free(s_counters);
s_counters = nullptr;
while (!s_counter_free_pool.empty()) {
s_counter_free_pool.pop();
}
}
void legwork_task_add(const legwork_task_desc_t* task_descs, unsigned int task_desc_count, legwork_counter_t** counter) {
legwork_assert(task_descs != NULL, "task_descs cannot be null");
legwork_assert(task_desc_count > 0, "task_desc_count must be greater than zero");
legwork_counter_t* wait_counter = nullptr;
if (counter != nullptr) {
wait_counter = counter_alloc();
if (wait_counter == nullptr) {
// spin wait for a counter to become available
while (wait_counter == nullptr) {
wait_counter = counter_alloc();
}
}
*counter = wait_counter;
// add to the wait counter
wait_counter->value.store(task_desc_count, std::memory_order_seq_cst);
}
// queue the task_descs
for (unsigned int index = 0; index < task_desc_count; ++index) {
task_queue_push(task_descs + index, wait_counter);
}
}
void legwork_wait(legwork_counter_t* counter) {
legwork_wait_value(counter, 0);
}
void legwork_wait_value(legwork_counter_t* counter, unsigned int value) {
legwork_assert(counter != nullptr, "counter must be a valid pointer");
// check if the requirement is already satisfied
// TODO: is it worth it to force this API to *ALWAYS* be async?
if (counter->value.load(std::memory_order_relaxed) <= value) {
// if all the tasks have completed, free the conuter
if (value == 0) {
counter_free(counter);
}
return;
}
// if the current thread isn't running a fiber, then we'll need to spin wait
const int self_fiber_id = s_tls_worker.active_fiber_id;
if (self_fiber_id == INVALID_FIBER_ID) {
while (counter->value.load(std::memory_order_relaxed) > value) {
// spin
}
return;
}
// tell the next fiber to put us to sleep
s_tls_worker.sleep_fiber_id = self_fiber_id;
s_tls_worker.sleep_fiber_counter = counter;
s_tls_worker.sleep_fiber_wait_value = value;
// switch to the worker's fiber
fiber_switch_to(s_tls_worker.worker_fiber_id);
// and we're back. should be good to go now.
// if all the tasks have completed, free the counter
if (value == 0) {
counter_free(counter);
}
}
bool legwork_is_complete(legwork_counter_t* counter) {
legwork_assert(counter != nullptr, "counter must be a valid pointer");
if (counter->value.load(std::memory_order_relaxed) == 0) {
return true;
}
return false;
}
int legwork_get_fiber_id() {
return s_tls_worker.active_fiber_id;
}
| 31.759036 | 131 | 0.736027 | gamepoet |
f2e0f249b3827d6a25a9476806e9b2f48ee040ae | 339 | cpp | C++ | src/widgets/multiinfolistentry.cpp | jpcima/iconnconfig | 626dbda20366d5814a7cc6bdc29b42c3dfe2d938 | [
"MIT"
] | null | null | null | src/widgets/multiinfolistentry.cpp | jpcima/iconnconfig | 626dbda20366d5814a7cc6bdc29b42c3dfe2d938 | [
"MIT"
] | null | null | null | src/widgets/multiinfolistentry.cpp | jpcima/iconnconfig | 626dbda20366d5814a7cc6bdc29b42c3dfe2d938 | [
"MIT"
] | null | null | null | #include "multiinfolistentry.h"
MultiInfoListEntry::MultiInfoListEntry() {}
MultiInfoListEntry::MultiInfoListEntry(
MultiInfoListEntry::ListEntryCode entryCode, std::string name, int index)
: entryCode(entryCode), name(name), index(index) {
icon = QIcon();
if (entryCode == SECTION) {
enabled = false;
selectable = false;
}
}
| 24.214286 | 75 | 0.734513 | jpcima |
f2e550e8214d01a5eda16dbe4d7cfb21d2dec5f2 | 819 | cpp | C++ | Engine/00_Unit_Tests/Test_eventSystem.cpp | TB989/Fierce-Engine | 4fa97b55fafdf97ee0b9eb72203425490b7a01c5 | [
"Apache-2.0"
] | null | null | null | Engine/00_Unit_Tests/Test_eventSystem.cpp | TB989/Fierce-Engine | 4fa97b55fafdf97ee0b9eb72203425490b7a01c5 | [
"Apache-2.0"
] | 43 | 2020-03-01T12:55:12.000Z | 2021-07-10T20:51:23.000Z | Engine/00_Unit_Tests/Test_eventSystem.cpp | TB989/Fierce-Engine | 4fa97b55fafdf97ee0b9eb72203425490b7a01c5 | [
"Apache-2.0"
] | null | null | null | #include "UnitTests.h"
#include "02_system/01_logging/Logger.h"
#include "02_system/02_event/EventSystem.h"
Test_eventSystem::Test_eventSystem(){
eventSystem->addListener(this, &Test_eventSystem::onAppInit);
eventSystem->addListener(this, &Test_eventSystem::onAppUpdate);
eventSystem->addListener(this, &Test_eventSystem::onAppRender);
eventSystem->addListener(this, &Test_eventSystem::onAppCleanUp);
}
void Test_eventSystem::onAppInit(AppInitEvent * event) {
Loggers::CORE->info("On app init!");
}
void Test_eventSystem::onAppUpdate(AppUpdateEvent* event) {
Loggers::CORE->info("On app update!");
}
void Test_eventSystem::onAppRender(AppRenderEvent* event) {
Loggers::CORE->info("On app render!");
}
void Test_eventSystem::onAppCleanUp(AppCleanUpEvent* event) {
Loggers::CORE->info("On app clean up!");
} | 30.333333 | 65 | 0.769231 | TB989 |
f2e6f51e281f5be04192510a1e5280d779b8cfe5 | 5,975 | cxx | C++ | Examples/ANTSIntegrateVelocityField.cxx | KevinScholtes/ANTsX | 5462269c0c32e5d65560bae4014c5a05cb02588d | [
"BSD-3-Clause"
] | null | null | null | Examples/ANTSIntegrateVelocityField.cxx | KevinScholtes/ANTsX | 5462269c0c32e5d65560bae4014c5a05cb02588d | [
"BSD-3-Clause"
] | null | null | null | Examples/ANTSIntegrateVelocityField.cxx | KevinScholtes/ANTsX | 5462269c0c32e5d65560bae4014c5a05cb02588d | [
"BSD-3-Clause"
] | 1 | 2019-10-06T07:31:58.000Z | 2019-10-06T07:31:58.000Z |
#include "antsUtilities.h"
#include "antsAllocImage.h"
#include <algorithm>
#include "itkVectorIndexSelectionCastImageFilter.h"
#include "itkImageRegionIteratorWithIndex.h"
#include "vnl/algo/vnl_determinant.h"
#include "itkANTSImageRegistrationOptimizer.h"
#include "itkTimeVaryingVelocityFieldIntegrationImageFilter.h"
#include "itkWarpImageFilter.h"
#include "itkTimeVaryingVelocityFieldTransform.h"
#include "itkImageFileWriter.h"
#include "itkRescaleIntensityImageFilter.h"
#include "vnl/algo/vnl_determinant.h"
#include "itkDiscreteGaussianImageFilter.h"
#include "itkVectorLinearInterpolateImageFunction.h"
#include "itkGradientRecursiveGaussianImageFilter.h"
#include "itkVectorCurvatureAnisotropicDiffusionImageFilter.h"
#include "itkLaplacianRecursiveGaussianImageFilter.h"
#include "itkGradientRecursiveGaussianImageFilter.h"
#include "ReadWriteData.h"
namespace ants
{
template <unsigned int ImageDimension>
int IntegrateVelocityField(int argc, char *argv[])
{
int argct = 1;
std::string imgfn = std::string(argv[argct]); argct++;
std::string vectorfn = std::string(argv[argct]); argct++;
std::string outname = std::string(argv[argct]); argct++;
typedef float PixelType;
PixelType timezero = 0;
PixelType timeone = 1;
PixelType dT = 0.01;
if( argc > argct )
{
timezero = atof(argv[argct]);
}
argct++;
if( argc > argct )
{
timeone = atof(argv[argct]);
}
argct++;
if( argc > argct )
{
dT = atof(argv[argct]);
}
argct++;
std::cout << " time-0 " << timezero << " dt " << dT << " time-1 " << timeone << std::endl;
PixelType starttime = timezero;
PixelType finishtime = timeone;
typedef float PixelType;
typedef itk::Vector<PixelType, ImageDimension> VectorType;
typedef itk::Image<VectorType, ImageDimension> DisplacementFieldType;
typedef itk::Image<VectorType, ImageDimension + 1> TimeVaryingVelocityFieldType;
typedef itk::Image<PixelType, ImageDimension> ImageType;
typename ImageType::Pointer image;
ReadImage<ImageType>(image, imgfn.c_str() );
typedef TimeVaryingVelocityFieldType tvt;
typename tvt::Pointer timeVaryingVelocity;
ReadImage<tvt>(timeVaryingVelocity, vectorfn.c_str() );
VectorType zero;
zero.Fill(0);
typename DisplacementFieldType::Pointer deformation =
AllocImage<DisplacementFieldType>(image, zero);
if( !timeVaryingVelocity )
{
std::cerr << " No TV Field " << std::endl; return EXIT_FAILURE;
}
if( starttime < 0 )
{
starttime = 0;
}
if( starttime > 1 )
{
starttime = 1;
}
if( finishtime < 0 )
{
finishtime = 0;
}
if( finishtime > 1 )
{
finishtime = 1;
}
typedef itk::TimeVaryingVelocityFieldIntegrationImageFilter
<TimeVaryingVelocityFieldType, DisplacementFieldType> IntegratorType;
typename IntegratorType::Pointer integrator = IntegratorType::New();
integrator->SetInput( timeVaryingVelocity );
integrator->SetLowerTimeBound( starttime );
integrator->SetUpperTimeBound( finishtime );
integrator->SetNumberOfIntegrationSteps( (unsigned int ) 1 / dT );
integrator->Update();
WriteImage<DisplacementFieldType>( integrator->GetOutput(), outname.c_str() );
return 0;
}
// entry point for the library; parameter 'args' is equivalent to 'argv' in (argc,argv) of commandline parameters to
// 'main()'
int ANTSIntegrateVelocityField( std::vector<std::string> args, std::ostream* /*out_stream = nullptr */)
{
// put the arguments coming in as 'args' into standard (argc,argv) format;
// 'args' doesn't have the command name as first, argument, so add it manually;
// 'args' may have adjacent arguments concatenated into one argument,
// which the parser should handle
args.insert( args.begin(), "ANTSIntegrateVelocityField" );
int argc = args.size();
char* * argv = new char *[args.size() + 1];
for( unsigned int i = 0; i < args.size(); ++i )
{
// allocate space for the string plus a null character
argv[i] = new char[args[i].length() + 1];
std::strncpy( argv[i], args[i].c_str(), args[i].length() );
// place the null character in the end
argv[i][args[i].length()] = '\0';
}
argv[argc] = nullptr;
// class to automatically cleanup argv upon destruction
class Cleanup_argv
{
public:
Cleanup_argv( char* * argv_, int argc_plus_one_ ) : argv( argv_ ), argc_plus_one( argc_plus_one_ )
{
}
~Cleanup_argv()
{
for( unsigned int i = 0; i < argc_plus_one; ++i )
{
delete[] argv[i];
}
delete[] argv;
}
private:
char* * argv;
unsigned int argc_plus_one;
};
Cleanup_argv cleanup_argv( argv, argc + 1 );
// antscout->set_stream( out_stream );
if( argc < 4 )
{
std::cerr << "Usage: " << argv[0]
<< " reference_image VelocityIn.mhd DeformationOut.nii.gz time0 time1 dT " << std::endl;
if( argc >= 2 &&
( std::string( argv[1] ) == std::string("--help") || std::string( argv[1] ) == std::string("-h") ) )
{
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
}
std::cout << " start " << std::endl;
std::string ifn = std::string(argv[1]);
itk::ImageIOBase::Pointer imageIO =
itk::ImageIOFactory::CreateImageIO(ifn.c_str(), itk::ImageIOFactory::ReadMode);
imageIO->SetFileName(ifn.c_str() );
imageIO->ReadImageInformation();
unsigned int dim = imageIO->GetNumberOfDimensions();
std::cout << " dim " << dim << std::endl;
switch( dim )
{
case 2:
{
IntegrateVelocityField<2>(argc, argv);
}
break;
case 3:
{
IntegrateVelocityField<3>(argc, argv);
}
break;
case 4:
{
IntegrateVelocityField<4>(argc, argv);
}
break;
default:
std::cerr << "Unsupported dimension" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
} // namespace ants
| 29.433498 | 116 | 0.658577 | KevinScholtes |
f2eaeb4224e5d8299e60e4aa642275745f785ba2 | 7,284 | cpp | C++ | LevelEditorNativeRendering/LvEdRenderingEngine/Renderer/WireframeShader.cpp | T-rvw/LevelEditor | 12c3a0d66e7870d4d27edb7f6b351ab467ca968b | [
"Apache-2.0"
] | null | null | null | LevelEditorNativeRendering/LvEdRenderingEngine/Renderer/WireframeShader.cpp | T-rvw/LevelEditor | 12c3a0d66e7870d4d27edb7f6b351ab467ca968b | [
"Apache-2.0"
] | null | null | null | LevelEditorNativeRendering/LvEdRenderingEngine/Renderer/WireframeShader.cpp | T-rvw/LevelEditor | 12c3a0d66e7870d4d27edb7f6b351ab467ca968b | [
"Apache-2.0"
] | null | null | null | //Copyright ?2014 Sony Computer Entertainment America LLC. See License.txt.
#include "WireFrameShader.h"
#include "../Core/NonCopyable.h"
#include <D3D11.h>
#include "Renderable.h"
#include "RenderBuffer.h"
#include "RenderUtil.h"
#include "../Core/Utils.h"
#include "RenderContext.h"
#include "RenderState.h"
#include "Model.h"
#include "GpuResourceFactory.h"
using namespace LvEdEngine;
void WireFrameShader::Update(const FrameTime& fr, UpdateTypeEnum updateType)
{
m_theta += fr.ElapsedTime * TwoPi;
if (m_theta >= TwoPi) m_theta -= TwoPi;
else if (m_theta < 0.0f) m_theta += TwoPi;
m_diffuseModulator = 0.5f * sinf(m_theta) + 1.0f;
}
void WireFrameShader::Begin(RenderContext* context)
{
if(m_rcntx) return;
m_rcntx = context;
ID3D11DeviceContext* d3dContext = context->Context();
m_cbPerFrame.Data.viewport = context->ViewPort();
Matrix::Transpose(m_rcntx->Cam().View(),m_cbPerFrame.Data.viewXform);
Matrix::Transpose(m_rcntx->Cam().Proj(),m_cbPerFrame.Data.projXform);
m_cbPerFrame.Update(d3dContext);
auto perframe = m_cbPerFrame.GetBuffer();
auto perObject = m_cbPerObject.GetBuffer();
d3dContext->VSSetConstantBuffers(0,1,&perframe);
d3dContext->VSSetConstantBuffers(1,1,&perObject);
d3dContext->GSSetConstantBuffers(0,1,&perframe);
d3dContext->PSSetConstantBuffers(1,1,&perObject);
d3dContext->VSSetShader(m_vsShader,NULL,0);
d3dContext->GSSetShader(m_gsShader,NULL,0);
d3dContext->PSSetShader(m_psShader,NULL,0);
d3dContext->IASetInputLayout( m_layoutP);
d3dContext->RSSetState(m_rsFillCullBack);
d3dContext->OMSetDepthStencilState(m_dpLessEqual,0);
float bf[] = {0,0,0,0};
d3dContext->OMSetBlendState(m_bsBlending,bf,0xFFFFFFFF);
}
void WireFrameShader::End()
{
m_rcntx->Context()->GSSetShader(NULL,NULL,0);
m_rcntx = NULL;
}
void WireFrameShader::SetCullMode(CullModeEnum cullMode)
{
ID3D11DeviceContext* d3dContext = m_rcntx->Context();
if(cullMode == CullMode::NONE)
d3dContext->RSSetState(m_rsFillCullNone);
else if(cullMode == CullMode::BACK)
d3dContext->RSSetState(m_rsFillCullBack);
else if(cullMode == CullMode::FRONT)
d3dContext->RSSetState(m_rsFillCullFront);
}
void WireFrameShader::DrawNodes(const RenderNodeList& renderNodes)
{
ID3D11DeviceContext* d3dContext = m_rcntx->Context();
for ( auto it = renderNodes.begin(); it != renderNodes.end(); ++it )
{
const RenderableNode& r = (*it);
bool selected = (m_rcntx->selection.find(r.objectId) != m_rcntx->selection.end());
Matrix::Transpose(r.WorldXform,m_cbPerObject.Data.worldXform);
m_cbPerObject.Data.color = r.diffuse;
if (selected)
{
//float f = Lerp(0.5f, 1.2f, m_diffuseModulator);
//float4 di = m_rcntx->State()->GetSelectionColor() * f;
float4 di = r.diffuse * m_diffuseModulator;
di.w = 1;
m_cbPerObject.Data.color = di;
}
m_cbPerObject.Update(d3dContext);
uint32_t stride = r.mesh->vertexBuffer->GetStride();
uint32_t offset = 0;
uint32_t startIndex = 0;
uint32_t indexCount = r.mesh->indexBuffer->GetCount();;
uint32_t startVertex = 0;
ID3D11Buffer* d3dvb = r.mesh->vertexBuffer->GetBuffer();
ID3D11Buffer* d3dib = r.mesh->indexBuffer->GetBuffer();
d3dContext->IASetPrimitiveTopology( (D3D11_PRIMITIVE_TOPOLOGY)r.mesh->primitiveType );
d3dContext->IASetVertexBuffers( 0, 1, &d3dvb, &stride, &offset );
d3dContext->IASetIndexBuffer(d3dib,(DXGI_FORMAT) r.mesh->indexBuffer->GetFormat(),0);
d3dContext->DrawIndexed(indexCount,startIndex,startVertex);
}
}
WireFrameShader::WireFrameShader(ID3D11Device* device)
: Shader( Shaders::WireFrameShader)
{
m_rcntx = NULL;
m_gsShader = NULL;
m_diffuseModulator = 0.0f;
m_theta = 0.0f;
// create cbuffers.
m_cbPerFrame.Construct(device);
m_cbPerObject.Construct(device);
ID3DBlob* vsBlob = CompileShaderFromResource(L"WireFrameShader.hlsl", "VSSolidWire","vs_4_0", NULL);
ID3DBlob* gsBlob = CompileShaderFromResource(L"WireFrameShader.hlsl", "GSSolidWire","gs_4_0", NULL);
ID3DBlob* psBlob = CompileShaderFromResource(L"WireFrameShader.hlsl", "PSSolidWire","ps_4_0", NULL);
assert(vsBlob);
assert(gsBlob);
assert(psBlob);
m_vsShader = GpuResourceFactory::CreateVertexShader(vsBlob);
m_gsShader = GpuResourceFactory::CreateGeometryShader(gsBlob);
m_psShader = GpuResourceFactory::CreatePixelShader(psBlob);
assert(m_vsShader);
assert(m_gsShader);
assert(m_psShader);
// create input layout
m_layoutP = GpuResourceFactory::CreateInputLayout(vsBlob, VertexFormat::VF_P);
assert(m_layoutP);
// release the blobs
vsBlob->Release();
gsBlob->Release();
psBlob->Release();
// create state blocks
RSCache* rsCache = RSCache::Inst();
D3D11_RASTERIZER_DESC rsDcr = rsCache->GetDefaultRsDcr();
rsDcr.CullMode = D3D11_CULL_NONE;
rsDcr.MultisampleEnable = true;
rsDcr.DepthBias = -10; // tweak the depth bias so that wireframe rendering wont z fight with 'normal' rendering.
device->CreateRasterizerState(&rsDcr, &m_rsFillCullNone);
rsDcr.CullMode = D3D11_CULL_BACK;
device->CreateRasterizerState(&rsDcr, &m_rsFillCullBack);
rsDcr.CullMode = D3D11_CULL_FRONT;
device->CreateRasterizerState(&rsDcr, &m_rsFillCullFront);
D3D11_DEPTH_STENCIL_DESC dsDcr = rsCache->GetDefaultDpDcr();
dsDcr.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
dsDcr.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
device->CreateDepthStencilState(&dsDcr,&m_dpLessEqual);
D3D11_BLEND_DESC blendDcr = rsCache->GetDefaultBsDcr();
D3D11_RENDER_TARGET_BLEND_DESC rtblendDcr = blendDcr.RenderTarget[0];
rtblendDcr.BlendEnable = TRUE;
rtblendDcr.SrcBlend = D3D11_BLEND_SRC_ALPHA;
rtblendDcr.DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
rtblendDcr.BlendOp = D3D11_BLEND_OP_ADD;
rtblendDcr.SrcBlendAlpha = D3D11_BLEND_ONE;
rtblendDcr.DestBlendAlpha = D3D11_BLEND_ZERO;
rtblendDcr.BlendOpAlpha = D3D11_BLEND_OP_ADD;
rtblendDcr.RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
blendDcr.RenderTarget[0] = rtblendDcr;
device->CreateBlendState(&blendDcr,&m_bsBlending);
}
// --------------------------------------------------------------------------------------------------
WireFrameShader::~WireFrameShader()
{
SAFE_RELEASE(m_layoutP);
SAFE_RELEASE(m_vsShader);
SAFE_RELEASE(m_psShader);
SAFE_RELEASE(m_gsShader);
SAFE_RELEASE(m_rsFillCullNone);
SAFE_RELEASE(m_rsFillCullBack);
SAFE_RELEASE(m_rsFillCullFront);
SAFE_RELEASE(m_dpLessEqual);
SAFE_RELEASE(m_bsBlending);
}
void WireFrameShader::SetRenderFlag(RenderFlagsEnum rf)
{
if( rf & RenderFlags::RenderBackFace)
{
SetCullMode(CullMode::NONE);
}
else
{
SetCullMode(CullMode::BACK);
}
}
| 33.87907 | 122 | 0.672433 | T-rvw |
f2edefa51e60328650aa1e0358070c64fc59f8fb | 9,043 | cpp | C++ | misc/cg_ddf.cpp | georeth/OJLIBS | de59d4fd21255cc2f0a580db7726b634449e6885 | [
"MIT"
] | 15 | 2017-03-26T03:54:16.000Z | 2021-04-04T13:10:43.000Z | misc/cg_ddf.cpp | georeth/OJLIBS | de59d4fd21255cc2f0a580db7726b634449e6885 | [
"MIT"
] | null | null | null | misc/cg_ddf.cpp | georeth/OJLIBS | de59d4fd21255cc2f0a580db7726b634449e6885 | [
"MIT"
] | 1 | 2018-03-06T09:59:14.000Z | 2018-03-06T09:59:14.000Z | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define per(i,a,n) for(int i=(n)-1;i>=(a);i--)
#define mp make_pair
#define pb push_back
typedef double db;
const db EPS = 1e-8;
inline int sign(db a) {
return a < -EPS ? -1 : a > EPS;
}
inline int cmp(db a, db b){
return sign(a-b);
}
struct P {
db x, y;
P() {}
P(db _x, db _y) : x(_x), y(_y) {}
P operator+(P p) { return P(x + p.x, y + p.y); }
P operator-(P p) { return P(x - p.x, y - p.y); }
P operator*(db d) { return P(x * d, y * d); }
P operator/(db d) { return P(x / d, y / d); }
bool operator<(P p) const {
int c = cmp(x, p.x);
if (c) return c == -1;
return cmp(y, p.y) == -1;
}
db dot(P p) { return x * p.x + y * p.y; }
db det(P p) { return x * p.y - y * p.x; }
db distTo(P p) { return (*this-p).abs(); }
db alpha() { return atan2(y, x); }
void read() { cin>>x>>y; }
db abs() { return sqrt(abs2());}
db abs2() { return x * x + y * y; }
P rot90() { return P(-y,x);}
P unit() { return *this/abs(); }
int quad() const { return sign(y) == 1 || (sign(y) == 0 && sign(x) >= 0); }
};
struct L{ //ps[0] -> ps[1]
P ps[2];
P& operator[](int i) { return ps[i]; }
P dir() { return ps[1] - ps[0]; }
bool include(P p) { return sign((ps[1] - ps[0]).det(p - ps[0])) > 0; }
L push(){ // push eps outward
const double eps = 1e-6;
P delta = (ps[1] - ps[0]).rot90().unit() * eps;
return {ps[0] - delta, ps[1] - delta};
}
};
#define cross(p1,p2,p3) ((p2.x-p1.x)*(p3.y-p1.y)-(p3.x-p1.x)*(p2.y-p1.y))
#define crossOp(p1,p2,p3) sign(cross(p1,p2,p3))
P isLL(P p1, P p2, P q1, P q2) {
db a1 = cross(q1, q2, p1), a2 = -cross(q1, q2, p2);
return (p1 * a2 + p2 * a1) / (a1 + a2);
}
P isLL(L l1,L l2){ return isLL(l1[0],l1[1],l2[0],l2[1]); }
bool intersect(db l1,db r1,db l2,db r2){
if(l1>r1) swap(l1,r1); if(l2>r2) swap(l2,r2);
return !( cmp(r1,l2) == -1 || cmp(r2,l1) == -1 );
}
bool isSS(P p1, P p2, P q1, P q2){
return intersect(p1.x,p2.x,q1.x,q2.x) && intersect(p1.y,p2.y,q1.y,q2.y) &&
crossOp(p1,p2,q1) * crossOp(p1,p2,q2) <= 0 && crossOp(q1,q2,p1)
* crossOp(q1,q2,p2) <= 0;
}
bool isMiddle(db a, db m, db b) {
return sign(a - m) == 0 || sign(b - m) == 0 || (a < m != b < m);
}
bool isMiddle(P a, P m, P b) {
return isMiddle(a.x, m.x, b.x) && isMiddle(a.y, m.y, b.y);
}
bool onSeg(P p1, P p2, P q){
return crossOp(p1,p2,q) == 0 && isMiddle(p1, q, p2);
}
P proj(P p1, P p2, P q) {
P dir = p2 - p1;
return p1 + dir * (dir.dot(q - p1) / dir.abs2());
}
P reflect(P p1, P p2, P q){
return proj(p1,p2,q) * 2 - q;
}
db nearest(P p1,P p2,P q){
P h = proj(p1,p2,q);
if(isMiddle(p1,h,p2))
return q.distTo(h);
return min(p1.distTo(q),p2.distTo(q));
}
db disSS(P p1, P p2, P q1, P q2){
if(isSS(p1,p2,q1,q2)) return 0;
return min(min(nearest(p1,p2,q1),nearest(p1,p2,q2)), min(nearest(q1,q2,p1),nearest(q1,q2,p2)) );
}
db rad(P p1,P p2){
return atan2l(p1.det(p2),p1.dot(p2));
}
db incircle(P p1, P p2, P p3){
db A = p1.distTo(p2);
db B = p2.distTo(p3);
db C = p3.distTo(p1);
return sqrtl(A*B*C/(A+B+C));
}
//polygon
db area(vector<P> ps){
db ret = 0; rep(i,0,ps.size()) ret += ps[i].det(ps[(i+1)%ps.size()]);
return abs(ret/2);
}
int contain(vector<P> ps, P p){ //2:inside,1:on_seg,0:outside
int n = ps.size(), ret = 0;
rep(i,0,n){
P u=ps[i],v=ps[(i+1)%n];
if(onSeg(u,v,p)) return 1;
if(cmp(u.y,v.y)<=0) swap(u,v);
if(cmp(p.y,u.y) >0 || cmp(p.y,v.y) <= 0) continue;
ret ^= crossOp(p,u,v) > 0;
}
return ret*2;
}
vector<P> convexHull(vector<P> ps) {
int n = ps.size(); if(n <= 1) return ps;
sort(ps.begin(), ps.end());
vector<P> qs(n * 2); int k = 0;
for (int i = 0; i < n; qs[k++] = ps[i++])
while (k > 1 && crossOp(qs[k - 2], qs[k - 1], ps[i]) <= 0) --k;
for (int i = n - 2, t = k; i >= 0; qs[k++] = ps[i--])
while (k > t && crossOp(qs[k - 2], qs[k - 1], ps[i]) <= 0) --k;
qs.resize(k - 1);
return qs;
}
vector<P> convexHullNonStrict(vector<P> ps) {
//caution: need to unique the Ps first
int n = ps.size(); if(n <= 1) return ps;
sort(ps.begin(), ps.end());
vector<P> qs(n * 2); int k = 0;
for (int i = 0; i < n; qs[k++] = ps[i++])
while (k > 1 && crossOp(qs[k - 2], qs[k - 1], ps[i]) < 0) --k;
for (int i = n - 2, t = k; i >= 0; qs[k++] = ps[i--])
while (k > t && crossOp(qs[k - 2], qs[k - 1], ps[i]) < 0) --k;
qs.resize(k - 1);
return qs;
}
db convexDiameter(vector<P> ps){
int n = ps.size(); if(n <= 1) return 0;
int is = 0, js = 0; rep(k,1,n) is = ps[k]<ps[is]?k:is, js = ps[js] < ps[k]?k:js;
int i = is, j = js;
db ret = ps[i].distTo(ps[j]);
do{
if((ps[(i+1)%n]-ps[i]).det(ps[(j+1)%n]-ps[j]) >= 0)
(++j)%=n;
else
(++i)%=n;
ret = max(ret,ps[i].distTo(ps[j]));
}while(i!=is || j!=js);
return ret;
}
vector<P> convexCut(const vector<P>&ps, P q1, P q2) {
vector<P> qs;
int n = ps.size();
rep(i,0,n){
P p1 = ps[i], p2 = ps[(i+1)%n];
int d1 = crossOp(q1,q2,p1), d2 = crossOp(q1,q2,p2);
if(d1 >= 0) qs.pb(p1);
if(d1 * d2 < 0) qs.pb(isLL(p1,p2,q1,q2));
}
return qs;
}
//min_dist
db min_dist(vector<P>&ps,int l,int r){
if(r-l<=5){
db ret = 1e100;
rep(i,l,r) rep(j,l,i) ret = min(ret,ps[i].distTo(ps[j]));
return ret;
}
int m = (l+r)>>1;
db ret = min(min_dist(ps,l,m),min_dist(ps,m,r));
vector<P> qs; rep(i,l,r) if(abs(ps[i].x-ps[m].x)<= ret) qs.pb(ps[i]);
sort(qs.begin(), qs.end(),[](P a,P b) -> bool {return a.y<b.y; });
rep(i,1,qs.size()) for(int j=i-1;j>=0&&qs[j].y>=qs[i].y-ret;--j) ret = min(ret,qs[i].distTo(qs[j]));
return ret;
}
int type(P o1,db r1,P o2,db r2){
db d = o1.distTo(o2);
if(cmp(d,r1+r2) == 1) return 4;
if(cmp(d,r1+r2) == 0) return 3;
if(cmp(d,abs(r1-r2)) == 1) return 2;
if(cmp(d,abs(r1-r2)) == 0) return 1;
return 0;
}
vector<P> isCL(P o,db r,P p1,P p2){
db x = (p1-o).dot(p2-p1), y = (p2-p1).abs2(), d = x * x - y * ((p1-o).abs2() - r*r);
if(sign(d) < 0) return {};
d = max(d,0.0); P m = p1 - (p2-p1)*(x/y), dr = (p2-p1)*(sqrt(d)/y);
return {m-dr,m+dr}; //along dir: p1->p2
}
vector<P> isCC(P o1, db r1, P o2, db r2) { //need to check whether two circles are the same
db d = o1.distTo(o2);
if (cmp(d, r1 + r2) == 1) return {};
d = min(d, r1 + r2);
db y = (r1 * r1 + d * d - r2 * r2) / (2 * d), x = sqrt(r1 * r1 - y * y);
P dr = (o2 - o1).unit();
P q1 = o1 + dr * y, q2 = dr.rot90() * x;
return {q1-q2,q1+q2};//along circle 1
}
vector<P> tanCP(P o, db r, P p) {
db x = (p - o).abs2(), d = x - r * r;
if (sign(d) <= 0) return {}; // on circle => no tangent
P q1 = o + (p - o) * (r * r / x);
P q2 = (p - o).rot90() * (r * sqrt(d) / x);
return {q1-q2,q1+q2}; //counter clock-wise
}
vector<L> extanCC(P o1, db r1, P o2, db r2) {
vector<L> ret;
if (cmp(r1, r2) == 0) {
P dr = (o2 - o1).unit().rot90() * r1;
ret.pb({o1 + dr, o2 + dr}), ret.pb({o1 - dr, o2 - dr});
} else {
P p = (o2 * r1 - o1 * r2) / (r1 - r2);
vector<P> ps = tanCP(o1, r1, p), qs = tanCP(o2, r2, p);
rep(i,0,min(ps.size(),qs.size())) ret.pb({ps[i], qs[i]}); //c1 counter-clock wise
}
return ret;
}
vector<L> intanCC(P o1, db r1, P o2, db r2) {
vector<L> ret;
P p = (o1 * r2 + o2 * r1) / (r1 + r2);
vector<P> ps = tanCP(o1,r1,p), qs = tanCP(o2,r2,p);
rep(i,0,min(ps.size(),qs.size())) ret.pb({ps[i], qs[i]}); //c1 counter-clock wise
return ret;
}
db areaCT(db r, P p1, P p2){
vector<P> is = isCL(P(0,0),r,p1,p2);
if(is.empty()) return r*r*rad(p1,p2)/2;
bool b1 = cmp(p1.abs2(),r*r) == 1, b2 = cmp(p2.abs2(), r*r) == 1;
if(b1 && b2){
if(sign((p1-is[0]).dot(p2-is[0])) <= 0 &&
sign((p1-is[0]).dot(p2-is[0])) <= 0)
return r*r*(rad(p1,is[0]) + rad(is[1],p2))/2 + is[0].det(is[1])/2;
else return r*r*rad(p1,p2)/2;
}
if(b1) return (r*r*rad(p1,is[0]) + is[0].det(p2))/2;
if(b2) return (p1.det(is[1]) + r*r*rad(is[1],p2))/2;
return p1.det(p2)/2;
}
bool parallel(L l0, L l1) { return sign( l0.dir().det( l1.dir() ) ) == 0; }
bool sameDir(L l0, L l1) { return parallel(l0, l1) && sign(l0.dir().dot(l1.dir()) ) == 1; }
bool cmp (P a, P b) {
if (a.quad() != b.quad()) {
return a.quad() < b.quad();
} else {
return sign( a.det(b) ) > 0;
}
}
bool operator < (L l0, L l1) {
if (sameDir(l0, l1)) {
return l1.include(l0[0]);
} else {
return cmp( l0.dir(), l1.dir() );
}
}
bool check(L u, L v, L w) {
return w.include(isLL(u,v));
}
vector<P> halfPlaneIS(vector<L> &l) {
sort(l.begin(), l.end());
deque<L> q;
for (int i = 0; i < (int)l.size(); ++i) {
if (i && sameDir(l[i], l[i - 1])) continue;
while (q.size() > 1 && !check(q[q.size() - 2], q[q.size() - 1], l[i])) q.pop_back();
while (q.size() > 1 && !check(q[1], q[0], l[i])) q.pop_front();
q.push_back(l[i]);
}
while (q.size() > 2 && !check(q[q.size() - 2], q[q.size() - 1], q[0])) q.pop_back();
while (q.size() > 2 && !check(q[1], q[0], q[q.size() - 1])) q.pop_front();
vector<P> ret;
for (int i = 0; i < (int)q.size(); ++i) ret.push_back(isLL(q[i], q[(i + 1) % q.size()]));
return ret;
}
int main(){
return 0;
}
| 27.996904 | 101 | 0.512219 | georeth |
f2f5eca24d303a74be9a63d60d4f79aae6f080cd | 2,044 | cpp | C++ | src_smartcontract_db/schema_table/table_store/AlterRecordValueExecutor.cpp | alinous-core/codable-cash | 32a86a152a146c592bcfd8cc712f4e8cb38ee1a0 | [
"MIT"
] | 6 | 2019-01-06T05:02:39.000Z | 2020-10-01T11:45:32.000Z | src_smartcontract_db/schema_table/table_store/AlterRecordValueExecutor.cpp | Codablecash/codablecash | 8816b69db69ff2f5da6cdb6af09b8fb21d3df1d9 | [
"MIT"
] | 209 | 2018-05-18T03:07:02.000Z | 2022-03-26T11:42:41.000Z | src_smartcontract_db/schema_table/table_store/AlterRecordValueExecutor.cpp | Codablecash/codablecash | 8816b69db69ff2f5da6cdb6af09b8fb21d3df1d9 | [
"MIT"
] | 3 | 2019-07-06T09:16:36.000Z | 2020-10-15T08:23:28.000Z | /*
* AlterRecordValueExecutor.cpp
*
* Created on: 2020/10/09
* Author: iizuka
*/
#include <cstdint>
#include "schema_table/table_store/AlterRecordValueExecutor.h"
#include "schema_table/table/CdbTableColumn.h"
#include "schema_table/record/table_record/CdbRecord.h"
#include "schema_table/record/table_record_value/CdbValueCaster.h"
#include "schema_table/table_store/TableStore.h"
#include "schema_table/table_store/RecordStore.h"
#include "btree/Btree.h"
#include "btree/BtreeScanner.h"
#include "base/StackRelease.h"
namespace codablecash {
AlterRecordValueExecutor::AlterRecordValueExecutor(const CdbTableColumn* column) {
this->column = column;
}
AlterRecordValueExecutor::~AlterRecordValueExecutor() {
this->column = nullptr;
}
void AlterRecordValueExecutor::addColumn(TableStore* store) {
uint8_t cdbType = this->column->getType();
const UnicodeString* defstr = this->column->getDefaultValue();
AbstractCdbValue* defaultValue = CdbValueCaster::convertFromString(defstr, cdbType); __STP(defaultValue);
RecordStore* recordStore = store->getRecordStore();
Btree* btree = recordStore->getBtree();
BtreeScanner* scanner = btree->getScanner(); __STP(scanner);
scanner->begin();
while(scanner->hasNext()){
const IBlockObject* obj = scanner->next();
CdbRecord* record = dynamic_cast<CdbRecord*>(obj->copyData()); __STP(record);
record->addValue(defaultValue != nullptr ? defaultValue->copy() : nullptr);
recordStore->insert(record);
}
}
void AlterRecordValueExecutor::removeColumn(TableStore* store) {
RecordStore* recordStore = store->getRecordStore();
Btree* btree = recordStore->getBtree();
BtreeScanner* scanner = btree->getScanner(); __STP(scanner);
int removePosition = this->column->getPosition();
scanner->begin();
while(scanner->hasNext()){
const IBlockObject* obj = scanner->next();
CdbRecord* record = dynamic_cast<CdbRecord*>(obj->copyData()); __STP(record);
record->removeColumnValue(removePosition);
recordStore->insert(record);
}
}
} /* namespace codablecash */
| 26.894737 | 106 | 0.752446 | alinous-core |
f2fadc5885ac33fdf5f2f5c7d6d3e1a1c2528bbf | 13,319 | cpp | C++ | tests/Basic/TransfersSubscription/main.cpp | CASH2-js/cash2 | 17d5582ec41149567fcad12ba58c392fab502097 | [
"BSD-3-Clause"
] | null | null | null | tests/Basic/TransfersSubscription/main.cpp | CASH2-js/cash2 | 17d5582ec41149567fcad12ba58c392fab502097 | [
"BSD-3-Clause"
] | null | null | null | tests/Basic/TransfersSubscription/main.cpp | CASH2-js/cash2 | 17d5582ec41149567fcad12ba58c392fab502097 | [
"BSD-3-Clause"
] | 1 | 2020-05-13T19:39:58.000Z | 2020-05-13T19:39:58.000Z | // Copyright (c) 2018-2020 The Cash2 developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "gtest/gtest.h"
#include "helperFunctions.h"
#include "Transfers/TransfersSubscription.h"
#include "Transfers/TransfersContainer.h"
#include "CryptoNoteCore/Currency.h"
#include "Logging/ConsoleLogger.h"
#include "CryptoNoteCore/Transaction.cpp"
using namespace CryptoNote;
/*
My Notes
class TransfersSubscription
public
TransfersSubscription()
getSyncStart();
onBlockchainDetach()
onError()
advanceHeight()
getKeys()
addTransaction()
deleteUnconfirmedTransaction()
markTransactionConfirmed()
getAddress()
getContainer()
private
TransfersContainer transfers
AccountSubscription subscription
*/
// constructor()
TEST(TransfersSubscription, 1)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription(currency, subscription);
}
// getSyncStart()
TEST(TransfersSubscription, 2)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription transfersSubscription(currency, subscription);
SynchronizationStart syncStart = transfersSubscription.getSyncStart();
ASSERT_EQ(subscription.syncStart.timestamp, syncStart.timestamp);
ASSERT_EQ(subscription.syncStart.height, syncStart.height);
}
// onBlockchainDetach()
TEST(TransfersSubscription, 3)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription transfersSubscription(currency, subscription);
uint32_t height = 0;
ASSERT_NO_THROW(transfersSubscription.onBlockchainDetach(height));
}
// onError()
TEST(TransfersSubscription, 4)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription transfersSubscription(currency, subscription);
std::error_code errorCode;
uint32_t height = 0;
ASSERT_NO_THROW(transfersSubscription.onError(errorCode, height));
}
// advanceHeight()
TEST(TransfersSubscription, 5)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription transfersSubscription(currency, subscription);
uint32_t height = 0;
ASSERT_TRUE(transfersSubscription.advanceHeight(height));
height = 10;
ASSERT_TRUE(transfersSubscription.advanceHeight(height));
}
// getKeys()
TEST(TransfersSubscription, 6)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription transfersSubscription(currency, subscription);
AccountKeys accountKeysRet = transfersSubscription.getKeys();
ASSERT_TRUE(publicKeysEqual(accountKeys.address.viewPublicKey, accountKeysRet.address.viewPublicKey));
ASSERT_TRUE(publicKeysEqual(accountKeys.address.spendPublicKey, accountKeysRet.address.spendPublicKey));
ASSERT_TRUE(secretKeysEqual(accountKeys.viewSecretKey, accountKeysRet.viewSecretKey));
ASSERT_TRUE(secretKeysEqual(accountKeys.spendSecretKey, accountKeysRet.spendSecretKey));
}
// addTransaction()
TEST(TransfersSubscription, 7)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription transfersSubscription(currency, subscription);
TransactionBlockInfo blockInfo;
Transaction transaction = getRandTransaction();
TransactionImpl transactionImpl(transaction);
std::vector<TransactionOutputInformationIn> transfers;
TransactionOutputInformationIn txOutputInfo;
txOutputInfo.keyImage = getRandKeyImage();
txOutputInfo.type = TransactionTypes::OutputType::Key;
txOutputInfo.amount = 1;
txOutputInfo.globalOutputIndex = 0;
txOutputInfo.outputInTransaction = 0;
txOutputInfo.transactionHash = getRandHash();
txOutputInfo.transactionPublicKey = getRandPublicKey();
txOutputInfo.outputKey = getRandPublicKey();
transfers.push_back(txOutputInfo);
ASSERT_TRUE(transfersSubscription.addTransaction(blockInfo, transactionImpl, transfers));
}
// deleteUnconfirmedTransaction()
TEST(TransfersSubscription, 8)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription transfersSubscription(currency, subscription);
TransactionBlockInfo blockInfo;
Transaction transaction = getRandTransaction();
TransactionImpl transactionImpl(transaction);
std::vector<TransactionOutputInformationIn> transfers;
TransactionOutputInformationIn txOutputInfo;
txOutputInfo.keyImage = getRandKeyImage();
txOutputInfo.type = TransactionTypes::OutputType::Key;
txOutputInfo.amount = 1;
txOutputInfo.globalOutputIndex = 0;
txOutputInfo.outputInTransaction = 0;
txOutputInfo.transactionHash = getRandHash();
txOutputInfo.transactionPublicKey = getRandPublicKey();
txOutputInfo.outputKey = getRandPublicKey();
transfers.push_back(txOutputInfo);
ASSERT_TRUE(transfersSubscription.addTransaction(blockInfo, transactionImpl, transfers));
Crypto::Hash transactionHash = getObjectHash(transaction);
ASSERT_NO_THROW(transfersSubscription.deleteUnconfirmedTransaction(transactionHash));
}
// markTransactionConfirmed()
TEST(TransfersSubscription, 9)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription transfersSubscription(currency, subscription);
TransactionBlockInfo blockInfo;
Transaction transaction = getRandTransaction();
TransactionImpl transactionImpl(transaction);
std::vector<TransactionOutputInformationIn> transfers;
TransactionOutputInformationIn txOutputInfo;
txOutputInfo.keyImage = getRandKeyImage();
txOutputInfo.type = TransactionTypes::OutputType::Key;
txOutputInfo.amount = 1;
txOutputInfo.globalOutputIndex = 0;
txOutputInfo.outputInTransaction = 0;
txOutputInfo.transactionHash = getRandHash();
txOutputInfo.transactionPublicKey = getRandPublicKey();
txOutputInfo.outputKey = getRandPublicKey();
transfers.push_back(txOutputInfo);
ASSERT_TRUE(transfersSubscription.addTransaction(blockInfo, transactionImpl, transfers));
Crypto::Hash transactionHash = getObjectHash(transaction);
std::vector<uint32_t> globalIndexes = {0};
ASSERT_NO_THROW(transfersSubscription.markTransactionConfirmed(blockInfo, transactionHash, globalIndexes));
}
// getAddress()
TEST(TransfersSubscription, 10)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription transfersSubscription(currency, subscription);
AccountPublicAddress accountPublicAddressRet = transfersSubscription.getAddress();
Crypto::Hash hash1 = getObjectHash(accountPublicAddressRet);
Crypto::Hash hash2 = getObjectHash(accountKeys.address);
ASSERT_TRUE(hashesEqual(hash1, hash2));
}
// getContainer()
TEST(TransfersSubscription, 11)
{
Logging::ConsoleLogger logger;
Currency currency = CurrencyBuilder(logger).currency();
AccountSubscription subscription;
AccountKeys accountKeys;
KeyPair viewKeyPair = generateKeyPair();
KeyPair spendKeyPair = generateKeyPair();
accountKeys.address.viewPublicKey = viewKeyPair.publicKey;
accountKeys.address.spendPublicKey = spendKeyPair.publicKey;
accountKeys.viewSecretKey = viewKeyPair.secretKey;
accountKeys.spendSecretKey = spendKeyPair.secretKey;
subscription.keys = accountKeys;
subscription.syncStart.timestamp = time(nullptr);
subscription.syncStart.height = 0;
subscription.transactionSpendableAge = 0;
TransfersSubscription transfersSubscription(currency, subscription);
ASSERT_NO_THROW(transfersSubscription.getContainer());
}
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
} | 31.940048 | 109 | 0.803664 | CASH2-js |
f2fb77025dadd84bcfb60d1ef6cda901db9578d5 | 370,541 | cpp | C++ | src/main_12400.cpp | RedBrumbler/BeatSaber-Quest-Codegen | 73dda50b5a3e51f10d86b766dcaa24b0c6226e25 | [
"Unlicense"
] | null | null | null | src/main_12400.cpp | RedBrumbler/BeatSaber-Quest-Codegen | 73dda50b5a3e51f10d86b766dcaa24b0c6226e25 | [
"Unlicense"
] | null | null | null | src/main_12400.cpp | RedBrumbler/BeatSaber-Quest-Codegen | 73dda50b5a3e51f10d86b766dcaa24b0c6226e25 | [
"Unlicense"
] | null | null | null | // Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.PrefabResourceBindingFinalizer
#include "Zenject/PrefabResourceBindingFinalizer.hpp"
// Including type: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_0
#include "Zenject/PrefabResourceBindingFinalizer_--c__DisplayClass5_0.hpp"
// Including type: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_1
#include "Zenject/PrefabResourceBindingFinalizer_--c__DisplayClass5_1.hpp"
// Including type: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_0
#include "Zenject/PrefabResourceBindingFinalizer_--c__DisplayClass6_0.hpp"
// Including type: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_1
#include "Zenject/PrefabResourceBindingFinalizer_--c__DisplayClass6_1.hpp"
// Including type: Zenject.GameObjectCreationParameters
#include "Zenject/GameObjectCreationParameters.hpp"
// Including type: System.Func`3
#include "System/Func_3.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.IPrefabInstantiator
#include "Zenject/IPrefabInstantiator.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: Zenject.BindInfo
#include "Zenject/BindInfo.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.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 readonly Zenject.GameObjectCreationParameters _gameObjectBindInfo
::Zenject::GameObjectCreationParameters*& Zenject::PrefabResourceBindingFinalizer::dyn__gameObjectBindInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::dyn__gameObjectBindInfo");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_gameObjectBindInfo"))->offset;
return *reinterpret_cast<::Zenject::GameObjectCreationParameters**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.String _resourcePath
::StringW& Zenject::PrefabResourceBindingFinalizer::dyn__resourcePath() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::dyn__resourcePath");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_resourcePath"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Func`3<System.Type,Zenject.IPrefabInstantiator,Zenject.IProvider> _providerFactory
::System::Func_3<::System::Type*, ::Zenject::IPrefabInstantiator*, ::Zenject::IProvider*>*& Zenject::PrefabResourceBindingFinalizer::dyn__providerFactory() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::dyn__providerFactory");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_providerFactory"))->offset;
return *reinterpret_cast<::System::Func_3<::System::Type*, ::Zenject::IPrefabInstantiator*, ::Zenject::IProvider*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer.FinalizeBindingConcrete
void Zenject::PrefabResourceBindingFinalizer::FinalizeBindingConcrete(::Zenject::DiContainer* container, ::System::Collections::Generic::List_1<::System::Type*>* concreteTypes) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::FinalizeBindingConcrete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FinalizeBindingConcrete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container), ::il2cpp_utils::ExtractType(concreteTypes)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container, concreteTypes);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer.FinalizeBindingSelf
void Zenject::PrefabResourceBindingFinalizer::FinalizeBindingSelf(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::FinalizeBindingSelf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FinalizeBindingSelf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer.OnFinalizeBinding
void Zenject::PrefabResourceBindingFinalizer::OnFinalizeBinding(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::OnFinalizeBinding");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnFinalizeBinding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_0
#include "Zenject/PrefabResourceBindingFinalizer_--c__DisplayClass5_0.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.PrefabResourceBindingFinalizer <>4__this
::Zenject::PrefabResourceBindingFinalizer*& Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::PrefabResourceBindingFinalizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.DiContainer container
::Zenject::DiContainer*& Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::dyn_container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::dyn_container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Collections.Generic.List`1<System.Type> concreteTypes
::System::Collections::Generic::List_1<::System::Type*>*& Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::dyn_concreteTypes() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::dyn_concreteTypes");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "concreteTypes"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::System::Type*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_0.<FinalizeBindingConcrete>b__0
::Zenject::IProvider* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::$FinalizeBindingConcrete$b__0(::Zenject::DiContainer* _, ::System::Type* concreteType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::<FinalizeBindingConcrete>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingConcrete>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(concreteType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, concreteType);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_0.__zenCreate
::Il2CppObject* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PrefabResourceBindingFinalizer/<>c__DisplayClass5_0", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_0.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PrefabResourceBindingFinalizer/<>c__DisplayClass5_0", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_1
#include "Zenject/PrefabResourceBindingFinalizer_--c__DisplayClass5_1.hpp"
// Including type: Zenject.PrefabInstantiatorCached
#include "Zenject/PrefabInstantiatorCached.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.hpp"
// Including type: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_0
#include "Zenject/PrefabResourceBindingFinalizer_--c__DisplayClass5_0.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 Zenject.PrefabInstantiatorCached prefabCreator
::Zenject::PrefabInstantiatorCached*& Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_1::dyn_prefabCreator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_1::dyn_prefabCreator");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "prefabCreator"))->offset;
return *reinterpret_cast<::Zenject::PrefabInstantiatorCached**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_0 CS$<>8__locals1
::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0*& Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_1::dyn_CS$$$8__locals1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_1::dyn_CS$$$8__locals1");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "CS$<>8__locals1"))->offset;
return *reinterpret_cast<::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_0**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_1.<FinalizeBindingConcrete>b__1
::Zenject::IProvider* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_1::$FinalizeBindingConcrete$b__1(::Zenject::DiContainer* _, ::System::Type* concreteType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_1::<FinalizeBindingConcrete>b__1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingConcrete>b__1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(concreteType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, concreteType);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_1.__zenCreate
::Il2CppObject* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_1::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_1::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PrefabResourceBindingFinalizer/<>c__DisplayClass5_1", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass5_1.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_1::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass5_1::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PrefabResourceBindingFinalizer/<>c__DisplayClass5_1", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_0
#include "Zenject/PrefabResourceBindingFinalizer_--c__DisplayClass6_0.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.PrefabResourceBindingFinalizer <>4__this
::Zenject::PrefabResourceBindingFinalizer*& Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::PrefabResourceBindingFinalizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.DiContainer container
::Zenject::DiContainer*& Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0::dyn_container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0::dyn_container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_0.<FinalizeBindingSelf>b__0
::Zenject::IProvider* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0::$FinalizeBindingSelf$b__0(::Zenject::DiContainer* _, ::System::Type* contractType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0::<FinalizeBindingSelf>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingSelf>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(contractType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, contractType);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_0.__zenCreate
::Il2CppObject* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PrefabResourceBindingFinalizer/<>c__DisplayClass6_0", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_0.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PrefabResourceBindingFinalizer/<>c__DisplayClass6_0", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_1
#include "Zenject/PrefabResourceBindingFinalizer_--c__DisplayClass6_1.hpp"
// Including type: Zenject.PrefabInstantiatorCached
#include "Zenject/PrefabInstantiatorCached.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.hpp"
// Including type: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_0
#include "Zenject/PrefabResourceBindingFinalizer_--c__DisplayClass6_0.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 Zenject.PrefabInstantiatorCached prefabCreator
::Zenject::PrefabInstantiatorCached*& Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_1::dyn_prefabCreator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_1::dyn_prefabCreator");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "prefabCreator"))->offset;
return *reinterpret_cast<::Zenject::PrefabInstantiatorCached**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_0 CS$<>8__locals1
::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0*& Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_1::dyn_CS$$$8__locals1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_1::dyn_CS$$$8__locals1");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "CS$<>8__locals1"))->offset;
return *reinterpret_cast<::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_0**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_1.<FinalizeBindingSelf>b__1
::Zenject::IProvider* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_1::$FinalizeBindingSelf$b__1(::Zenject::DiContainer* _, ::System::Type* contractType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_1::<FinalizeBindingSelf>b__1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingSelf>b__1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(contractType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, contractType);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_1.__zenCreate
::Il2CppObject* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_1::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_1::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PrefabResourceBindingFinalizer/<>c__DisplayClass6_1", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.PrefabResourceBindingFinalizer/Zenject.<>c__DisplayClass6_1.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_1::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PrefabResourceBindingFinalizer::$$c__DisplayClass6_1::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PrefabResourceBindingFinalizer/<>c__DisplayClass6_1", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.ProviderBindingFinalizer
#include "Zenject/ProviderBindingFinalizer.hpp"
// Including type: Zenject.ProviderBindingFinalizer/Zenject.<>c
#include "Zenject/ProviderBindingFinalizer_--c.hpp"
// Including type: Zenject.BindInfo
#include "Zenject/BindInfo.hpp"
// Including type: Zenject.BindingInheritanceMethods
#include "Zenject/BindingInheritanceMethods.hpp"
// Including type: Zenject.ScopeTypes
#include "Zenject/ScopeTypes.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: System.Func`3
#include "System/Func_3.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.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 Zenject.BindInfo <BindInfo>k__BackingField
::Zenject::BindInfo*& Zenject::ProviderBindingFinalizer::dyn_$BindInfo$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::dyn_$BindInfo$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<BindInfo>k__BackingField"))->offset;
return *reinterpret_cast<::Zenject::BindInfo**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.get_BindingInheritanceMethod
::Zenject::BindingInheritanceMethods Zenject::ProviderBindingFinalizer::get_BindingInheritanceMethod() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::get_BindingInheritanceMethod");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_BindingInheritanceMethod", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::BindingInheritanceMethods, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.get_BindInfo
::Zenject::BindInfo* Zenject::ProviderBindingFinalizer::get_BindInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::get_BindInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_BindInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::BindInfo*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.set_BindInfo
void Zenject::ProviderBindingFinalizer::set_BindInfo(::Zenject::BindInfo* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::set_BindInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_BindInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.GetScope
::Zenject::ScopeTypes Zenject::ProviderBindingFinalizer::GetScope() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::GetScope");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetScope", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::ScopeTypes, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.FinalizeBinding
void Zenject::ProviderBindingFinalizer::FinalizeBinding(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::FinalizeBinding");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FinalizeBinding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.OnFinalizeBinding
void Zenject::ProviderBindingFinalizer::OnFinalizeBinding(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::OnFinalizeBinding");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnFinalizeBinding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.RegisterProvider
void Zenject::ProviderBindingFinalizer::RegisterProvider(::Zenject::DiContainer* container, ::System::Type* contractType, ::Zenject::IProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::RegisterProvider");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RegisterProvider", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container), ::il2cpp_utils::ExtractType(contractType), ::il2cpp_utils::ExtractType(provider)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container, contractType, provider);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.RegisterProviderPerContract
void Zenject::ProviderBindingFinalizer::RegisterProviderPerContract(::Zenject::DiContainer* container, ::System::Func_3<::Zenject::DiContainer*, ::System::Type*, ::Zenject::IProvider*>* providerFunc) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::RegisterProviderPerContract");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RegisterProviderPerContract", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container), ::il2cpp_utils::ExtractType(providerFunc)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container, providerFunc);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.RegisterProviderForAllContracts
void Zenject::ProviderBindingFinalizer::RegisterProviderForAllContracts(::Zenject::DiContainer* container, ::Zenject::IProvider* provider) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::RegisterProviderForAllContracts");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RegisterProviderForAllContracts", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container), ::il2cpp_utils::ExtractType(provider)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container, provider);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.RegisterProvidersPerContractAndConcreteType
void Zenject::ProviderBindingFinalizer::RegisterProvidersPerContractAndConcreteType(::Zenject::DiContainer* container, ::System::Collections::Generic::List_1<::System::Type*>* concreteTypes, ::System::Func_3<::System::Type*, ::System::Type*, ::Zenject::IProvider*>* providerFunc) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::RegisterProvidersPerContractAndConcreteType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RegisterProvidersPerContractAndConcreteType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container), ::il2cpp_utils::ExtractType(concreteTypes), ::il2cpp_utils::ExtractType(providerFunc)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container, concreteTypes, providerFunc);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.ValidateBindTypes
bool Zenject::ProviderBindingFinalizer::ValidateBindTypes(::System::Type* concreteType, ::System::Type* contractType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::ValidateBindTypes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ValidateBindTypes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(concreteType), ::il2cpp_utils::ExtractType(contractType)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, concreteType, contractType);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer.RegisterProvidersForAllContractsPerConcreteType
void Zenject::ProviderBindingFinalizer::RegisterProvidersForAllContractsPerConcreteType(::Zenject::DiContainer* container, ::System::Collections::Generic::List_1<::System::Type*>* concreteTypes, ::System::Func_3<::Zenject::DiContainer*, ::System::Type*, ::Zenject::IProvider*>* providerFunc) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::RegisterProvidersForAllContractsPerConcreteType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RegisterProvidersForAllContractsPerConcreteType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container), ::il2cpp_utils::ExtractType(concreteTypes), ::il2cpp_utils::ExtractType(providerFunc)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container, concreteTypes, providerFunc);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.ProviderBindingFinalizer/Zenject.<>c
#include "Zenject/ProviderBindingFinalizer_--c.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.ProviderBindingFinalizer/Zenject.<>c <>9
::Zenject::ProviderBindingFinalizer::$$c* Zenject::ProviderBindingFinalizer::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::Zenject::ProviderBindingFinalizer::$$c*>("Zenject", "ProviderBindingFinalizer/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly Zenject.ProviderBindingFinalizer/Zenject.<>c <>9
void Zenject::ProviderBindingFinalizer::$$c::_set_$$9(::Zenject::ProviderBindingFinalizer::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "ProviderBindingFinalizer/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Type,System.String> <>9__7_0
::System::Func_2<::System::Type*, ::StringW>* Zenject::ProviderBindingFinalizer::$$c::_get_$$9__7_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::_get_$$9__7_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Type*, ::StringW>*>("Zenject", "ProviderBindingFinalizer/<>c", "<>9__7_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Type,System.String> <>9__7_0
void Zenject::ProviderBindingFinalizer::$$c::_set_$$9__7_0(::System::Func_2<::System::Type*, ::StringW>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::_set_$$9__7_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "ProviderBindingFinalizer/<>c", "<>9__7_0", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Type,System.String> <>9__8_0
::System::Func_2<::System::Type*, ::StringW>* Zenject::ProviderBindingFinalizer::$$c::_get_$$9__8_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::_get_$$9__8_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Type*, ::StringW>*>("Zenject", "ProviderBindingFinalizer/<>c", "<>9__8_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Type,System.String> <>9__8_0
void Zenject::ProviderBindingFinalizer::$$c::_set_$$9__8_0(::System::Func_2<::System::Type*, ::StringW>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::_set_$$9__8_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "ProviderBindingFinalizer/<>c", "<>9__8_0", value)));
}
// Autogenerated method: Zenject.ProviderBindingFinalizer/Zenject.<>c..cctor
void Zenject::ProviderBindingFinalizer::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ProviderBindingFinalizer/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer/Zenject.<>c.<GetScope>b__7_0
::StringW Zenject::ProviderBindingFinalizer::$$c::$GetScope$b__7_0(::System::Type* x) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::<GetScope>b__7_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GetScope>b__7_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(x)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, x);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer/Zenject.<>c.<FinalizeBinding>b__8_0
::StringW Zenject::ProviderBindingFinalizer::$$c::$FinalizeBinding$b__8_0(::System::Type* x) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::<FinalizeBinding>b__8_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBinding>b__8_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(x)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, x);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer/Zenject.<>c.__zenCreate
::Il2CppObject* Zenject::ProviderBindingFinalizer::$$c::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ProviderBindingFinalizer/<>c", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.ProviderBindingFinalizer/Zenject.<>c.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::ProviderBindingFinalizer::$$c::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProviderBindingFinalizer::$$c::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ProviderBindingFinalizer/<>c", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.ScopableBindingFinalizer
#include "Zenject/ScopableBindingFinalizer.hpp"
// Including type: Zenject.ScopableBindingFinalizer/Zenject.<>c__DisplayClass3_0
#include "Zenject/ScopableBindingFinalizer_--c__DisplayClass3_0.hpp"
// Including type: Zenject.ScopableBindingFinalizer/Zenject.<>c__DisplayClass4_0
#include "Zenject/ScopableBindingFinalizer_--c__DisplayClass4_0.hpp"
// Including type: System.Func`3
#include "System/Func_3.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: Zenject.BindInfo
#include "Zenject/BindInfo.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.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 readonly System.Func`3<Zenject.DiContainer,System.Type,Zenject.IProvider> _providerFactory
::System::Func_3<::Zenject::DiContainer*, ::System::Type*, ::Zenject::IProvider*>*& Zenject::ScopableBindingFinalizer::dyn__providerFactory() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::dyn__providerFactory");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_providerFactory"))->offset;
return *reinterpret_cast<::System::Func_3<::Zenject::DiContainer*, ::System::Type*, ::Zenject::IProvider*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.ScopableBindingFinalizer.FinalizeBindingConcrete
void Zenject::ScopableBindingFinalizer::FinalizeBindingConcrete(::Zenject::DiContainer* container, ::System::Collections::Generic::List_1<::System::Type*>* concreteTypes) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::FinalizeBindingConcrete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FinalizeBindingConcrete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container), ::il2cpp_utils::ExtractType(concreteTypes)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container, concreteTypes);
}
// Autogenerated method: Zenject.ScopableBindingFinalizer.FinalizeBindingSelf
void Zenject::ScopableBindingFinalizer::FinalizeBindingSelf(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::FinalizeBindingSelf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FinalizeBindingSelf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated method: Zenject.ScopableBindingFinalizer.OnFinalizeBinding
void Zenject::ScopableBindingFinalizer::OnFinalizeBinding(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::OnFinalizeBinding");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnFinalizeBinding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.ScopableBindingFinalizer/Zenject.<>c__DisplayClass3_0
#include "Zenject/ScopableBindingFinalizer_--c__DisplayClass3_0.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.ScopableBindingFinalizer <>4__this
::Zenject::ScopableBindingFinalizer*& Zenject::ScopableBindingFinalizer::$$c__DisplayClass3_0::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::$$c__DisplayClass3_0::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::ScopableBindingFinalizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.DiContainer container
::Zenject::DiContainer*& Zenject::ScopableBindingFinalizer::$$c__DisplayClass3_0::dyn_container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::$$c__DisplayClass3_0::dyn_container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.ScopableBindingFinalizer/Zenject.<>c__DisplayClass3_0.<FinalizeBindingConcrete>b__0
::Zenject::IProvider* Zenject::ScopableBindingFinalizer::$$c__DisplayClass3_0::$FinalizeBindingConcrete$b__0(::Zenject::DiContainer* _, ::System::Type* concreteType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::$$c__DisplayClass3_0::<FinalizeBindingConcrete>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingConcrete>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(concreteType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, concreteType);
}
// Autogenerated method: Zenject.ScopableBindingFinalizer/Zenject.<>c__DisplayClass3_0.__zenCreate
::Il2CppObject* Zenject::ScopableBindingFinalizer::$$c__DisplayClass3_0::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::$$c__DisplayClass3_0::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ScopableBindingFinalizer/<>c__DisplayClass3_0", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.ScopableBindingFinalizer/Zenject.<>c__DisplayClass3_0.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::ScopableBindingFinalizer::$$c__DisplayClass3_0::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::$$c__DisplayClass3_0::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ScopableBindingFinalizer/<>c__DisplayClass3_0", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.ScopableBindingFinalizer/Zenject.<>c__DisplayClass4_0
#include "Zenject/ScopableBindingFinalizer_--c__DisplayClass4_0.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.ScopableBindingFinalizer <>4__this
::Zenject::ScopableBindingFinalizer*& Zenject::ScopableBindingFinalizer::$$c__DisplayClass4_0::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::$$c__DisplayClass4_0::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::ScopableBindingFinalizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.DiContainer container
::Zenject::DiContainer*& Zenject::ScopableBindingFinalizer::$$c__DisplayClass4_0::dyn_container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::$$c__DisplayClass4_0::dyn_container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.ScopableBindingFinalizer/Zenject.<>c__DisplayClass4_0.<FinalizeBindingSelf>b__0
::Zenject::IProvider* Zenject::ScopableBindingFinalizer::$$c__DisplayClass4_0::$FinalizeBindingSelf$b__0(::Zenject::DiContainer* _, ::System::Type* contractType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::$$c__DisplayClass4_0::<FinalizeBindingSelf>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingSelf>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(contractType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, contractType);
}
// Autogenerated method: Zenject.ScopableBindingFinalizer/Zenject.<>c__DisplayClass4_0.__zenCreate
::Il2CppObject* Zenject::ScopableBindingFinalizer::$$c__DisplayClass4_0::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::$$c__DisplayClass4_0::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ScopableBindingFinalizer/<>c__DisplayClass4_0", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.ScopableBindingFinalizer/Zenject.<>c__DisplayClass4_0.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::ScopableBindingFinalizer::$$c__DisplayClass4_0::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScopableBindingFinalizer::$$c__DisplayClass4_0::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ScopableBindingFinalizer/<>c__DisplayClass4_0", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.SingleProviderBindingFinalizer
#include "Zenject/SingleProviderBindingFinalizer.hpp"
// Including type: System.Func`3
#include "System/Func_3.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: Zenject.BindInfo
#include "Zenject/BindInfo.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 readonly System.Func`3<Zenject.DiContainer,System.Type,Zenject.IProvider> _providerFactory
::System::Func_3<::Zenject::DiContainer*, ::System::Type*, ::Zenject::IProvider*>*& Zenject::SingleProviderBindingFinalizer::dyn__providerFactory() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SingleProviderBindingFinalizer::dyn__providerFactory");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_providerFactory"))->offset;
return *reinterpret_cast<::System::Func_3<::Zenject::DiContainer*, ::System::Type*, ::Zenject::IProvider*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SingleProviderBindingFinalizer.OnFinalizeBinding
void Zenject::SingleProviderBindingFinalizer::OnFinalizeBinding(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SingleProviderBindingFinalizer::OnFinalizeBinding");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnFinalizeBinding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SubContainerBindingFinalizer
#include "Zenject/SubContainerBindingFinalizer.hpp"
// Including type: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_0
#include "Zenject/SubContainerBindingFinalizer_--c__DisplayClass5_0.hpp"
// Including type: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_1
#include "Zenject/SubContainerBindingFinalizer_--c__DisplayClass5_1.hpp"
// Including type: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_0
#include "Zenject/SubContainerBindingFinalizer_--c__DisplayClass6_0.hpp"
// Including type: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_1
#include "Zenject/SubContainerBindingFinalizer_--c__DisplayClass6_1.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.ISubContainerCreator
#include "Zenject/ISubContainerCreator.hpp"
// Including type: Zenject.BindInfo
#include "Zenject/BindInfo.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_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 instance field getter
// Get instance field: private readonly System.Object _subIdentifier
::Il2CppObject*& Zenject::SubContainerBindingFinalizer::dyn__subIdentifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::dyn__subIdentifier");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_subIdentifier"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Boolean _resolveAll
bool& Zenject::SubContainerBindingFinalizer::dyn__resolveAll() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::dyn__resolveAll");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_resolveAll"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Func`2<Zenject.DiContainer,Zenject.ISubContainerCreator> _creatorFactory
::System::Func_2<::Zenject::DiContainer*, ::Zenject::ISubContainerCreator*>*& Zenject::SubContainerBindingFinalizer::dyn__creatorFactory() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::dyn__creatorFactory");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_creatorFactory"))->offset;
return *reinterpret_cast<::System::Func_2<::Zenject::DiContainer*, ::Zenject::ISubContainerCreator*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer.FinalizeBindingConcrete
void Zenject::SubContainerBindingFinalizer::FinalizeBindingConcrete(::Zenject::DiContainer* container, ::System::Collections::Generic::List_1<::System::Type*>* concreteTypes) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::FinalizeBindingConcrete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FinalizeBindingConcrete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container), ::il2cpp_utils::ExtractType(concreteTypes)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container, concreteTypes);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer.FinalizeBindingSelf
void Zenject::SubContainerBindingFinalizer::FinalizeBindingSelf(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::FinalizeBindingSelf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FinalizeBindingSelf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer.OnFinalizeBinding
void Zenject::SubContainerBindingFinalizer::OnFinalizeBinding(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::OnFinalizeBinding");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnFinalizeBinding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_0
#include "Zenject/SubContainerBindingFinalizer_--c__DisplayClass5_0.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.SubContainerBindingFinalizer <>4__this
::Zenject::SubContainerBindingFinalizer*& Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::SubContainerBindingFinalizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.DiContainer container
::Zenject::DiContainer*& Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0::dyn_container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0::dyn_container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_0.<FinalizeBindingConcrete>b__0
::Zenject::IProvider* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0::$FinalizeBindingConcrete$b__0(::Zenject::DiContainer* _, ::System::Type* concreteType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0::<FinalizeBindingConcrete>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingConcrete>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(concreteType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, concreteType);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_0.__zenCreate
::Il2CppObject* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerBindingFinalizer/<>c__DisplayClass5_0", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_0.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerBindingFinalizer/<>c__DisplayClass5_0", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_1
#include "Zenject/SubContainerBindingFinalizer_--c__DisplayClass5_1.hpp"
// Including type: Zenject.SubContainerCreatorCached
#include "Zenject/SubContainerCreatorCached.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.hpp"
// Including type: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_0
#include "Zenject/SubContainerBindingFinalizer_--c__DisplayClass5_0.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 Zenject.SubContainerCreatorCached containerCreator
::Zenject::SubContainerCreatorCached*& Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_1::dyn_containerCreator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_1::dyn_containerCreator");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "containerCreator"))->offset;
return *reinterpret_cast<::Zenject::SubContainerCreatorCached**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_0 CS$<>8__locals1
::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0*& Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_1::dyn_CS$$$8__locals1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_1::dyn_CS$$$8__locals1");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "CS$<>8__locals1"))->offset;
return *reinterpret_cast<::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_0**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_1.<FinalizeBindingConcrete>b__1
::Zenject::IProvider* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_1::$FinalizeBindingConcrete$b__1(::Zenject::DiContainer* _, ::System::Type* concreteType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_1::<FinalizeBindingConcrete>b__1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingConcrete>b__1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(concreteType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, concreteType);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_1.__zenCreate
::Il2CppObject* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_1::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_1::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerBindingFinalizer/<>c__DisplayClass5_1", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass5_1.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_1::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass5_1::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerBindingFinalizer/<>c__DisplayClass5_1", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_0
#include "Zenject/SubContainerBindingFinalizer_--c__DisplayClass6_0.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.SubContainerBindingFinalizer <>4__this
::Zenject::SubContainerBindingFinalizer*& Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::SubContainerBindingFinalizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.DiContainer container
::Zenject::DiContainer*& Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0::dyn_container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0::dyn_container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_0.<FinalizeBindingSelf>b__0
::Zenject::IProvider* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0::$FinalizeBindingSelf$b__0(::Zenject::DiContainer* _, ::System::Type* contractType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0::<FinalizeBindingSelf>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingSelf>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(contractType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, contractType);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_0.__zenCreate
::Il2CppObject* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerBindingFinalizer/<>c__DisplayClass6_0", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_0.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerBindingFinalizer/<>c__DisplayClass6_0", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_1
#include "Zenject/SubContainerBindingFinalizer_--c__DisplayClass6_1.hpp"
// Including type: Zenject.SubContainerCreatorCached
#include "Zenject/SubContainerCreatorCached.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.hpp"
// Including type: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_0
#include "Zenject/SubContainerBindingFinalizer_--c__DisplayClass6_0.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 Zenject.SubContainerCreatorCached containerCreator
::Zenject::SubContainerCreatorCached*& Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_1::dyn_containerCreator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_1::dyn_containerCreator");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "containerCreator"))->offset;
return *reinterpret_cast<::Zenject::SubContainerCreatorCached**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_0 CS$<>8__locals1
::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0*& Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_1::dyn_CS$$$8__locals1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_1::dyn_CS$$$8__locals1");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "CS$<>8__locals1"))->offset;
return *reinterpret_cast<::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_0**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_1.<FinalizeBindingSelf>b__1
::Zenject::IProvider* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_1::$FinalizeBindingSelf$b__1(::Zenject::DiContainer* _, ::System::Type* contractType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_1::<FinalizeBindingSelf>b__1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingSelf>b__1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(contractType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, contractType);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_1.__zenCreate
::Il2CppObject* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_1::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_1::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerBindingFinalizer/<>c__DisplayClass6_1", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SubContainerBindingFinalizer/Zenject.<>c__DisplayClass6_1.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_1::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerBindingFinalizer::$$c__DisplayClass6_1::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerBindingFinalizer/<>c__DisplayClass6_1", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SubContainerPrefabBindingFinalizer
#include "Zenject/SubContainerPrefabBindingFinalizer.hpp"
// Including type: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_0
#include "Zenject/SubContainerPrefabBindingFinalizer_--c__DisplayClass5_0.hpp"
// Including type: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_1
#include "Zenject/SubContainerPrefabBindingFinalizer_--c__DisplayClass5_1.hpp"
// Including type: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_0
#include "Zenject/SubContainerPrefabBindingFinalizer_--c__DisplayClass6_0.hpp"
// Including type: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_1
#include "Zenject/SubContainerPrefabBindingFinalizer_--c__DisplayClass6_1.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.ISubContainerCreator
#include "Zenject/ISubContainerCreator.hpp"
// Including type: Zenject.BindInfo
#include "Zenject/BindInfo.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_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 instance field getter
// Get instance field: private readonly System.Object _subIdentifier
::Il2CppObject*& Zenject::SubContainerPrefabBindingFinalizer::dyn__subIdentifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::dyn__subIdentifier");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_subIdentifier"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Boolean _resolveAll
bool& Zenject::SubContainerPrefabBindingFinalizer::dyn__resolveAll() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::dyn__resolveAll");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_resolveAll"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Func`2<Zenject.DiContainer,Zenject.ISubContainerCreator> _subContainerCreatorFactory
::System::Func_2<::Zenject::DiContainer*, ::Zenject::ISubContainerCreator*>*& Zenject::SubContainerPrefabBindingFinalizer::dyn__subContainerCreatorFactory() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::dyn__subContainerCreatorFactory");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_subContainerCreatorFactory"))->offset;
return *reinterpret_cast<::System::Func_2<::Zenject::DiContainer*, ::Zenject::ISubContainerCreator*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer.FinalizeBindingConcrete
void Zenject::SubContainerPrefabBindingFinalizer::FinalizeBindingConcrete(::Zenject::DiContainer* container, ::System::Collections::Generic::List_1<::System::Type*>* concreteTypes) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::FinalizeBindingConcrete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FinalizeBindingConcrete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container), ::il2cpp_utils::ExtractType(concreteTypes)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container, concreteTypes);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer.FinalizeBindingSelf
void Zenject::SubContainerPrefabBindingFinalizer::FinalizeBindingSelf(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::FinalizeBindingSelf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FinalizeBindingSelf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer.OnFinalizeBinding
void Zenject::SubContainerPrefabBindingFinalizer::OnFinalizeBinding(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::OnFinalizeBinding");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnFinalizeBinding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_0
#include "Zenject/SubContainerPrefabBindingFinalizer_--c__DisplayClass5_0.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.SubContainerPrefabBindingFinalizer <>4__this
::Zenject::SubContainerPrefabBindingFinalizer*& Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::SubContainerPrefabBindingFinalizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.DiContainer container
::Zenject::DiContainer*& Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0::dyn_container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0::dyn_container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_0.<FinalizeBindingConcrete>b__0
::Zenject::IProvider* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0::$FinalizeBindingConcrete$b__0(::Zenject::DiContainer* _, ::System::Type* concreteType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0::<FinalizeBindingConcrete>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingConcrete>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(concreteType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, concreteType);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_0.__zenCreate
::Il2CppObject* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerPrefabBindingFinalizer/<>c__DisplayClass5_0", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_0.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerPrefabBindingFinalizer/<>c__DisplayClass5_0", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_1
#include "Zenject/SubContainerPrefabBindingFinalizer_--c__DisplayClass5_1.hpp"
// Including type: Zenject.SubContainerCreatorCached
#include "Zenject/SubContainerCreatorCached.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.hpp"
// Including type: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_0
#include "Zenject/SubContainerPrefabBindingFinalizer_--c__DisplayClass5_0.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 Zenject.SubContainerCreatorCached containerCreator
::Zenject::SubContainerCreatorCached*& Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_1::dyn_containerCreator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_1::dyn_containerCreator");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "containerCreator"))->offset;
return *reinterpret_cast<::Zenject::SubContainerCreatorCached**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_0 CS$<>8__locals1
::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0*& Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_1::dyn_CS$$$8__locals1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_1::dyn_CS$$$8__locals1");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "CS$<>8__locals1"))->offset;
return *reinterpret_cast<::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_0**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_1.<FinalizeBindingConcrete>b__1
::Zenject::IProvider* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_1::$FinalizeBindingConcrete$b__1(::Zenject::DiContainer* _, ::System::Type* concreteType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_1::<FinalizeBindingConcrete>b__1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingConcrete>b__1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(concreteType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, concreteType);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_1.__zenCreate
::Il2CppObject* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_1::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_1::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerPrefabBindingFinalizer/<>c__DisplayClass5_1", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass5_1.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_1::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass5_1::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerPrefabBindingFinalizer/<>c__DisplayClass5_1", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_0
#include "Zenject/SubContainerPrefabBindingFinalizer_--c__DisplayClass6_0.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.SubContainerPrefabBindingFinalizer <>4__this
::Zenject::SubContainerPrefabBindingFinalizer*& Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::SubContainerPrefabBindingFinalizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.DiContainer container
::Zenject::DiContainer*& Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0::dyn_container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0::dyn_container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_0.<FinalizeBindingSelf>b__0
::Zenject::IProvider* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0::$FinalizeBindingSelf$b__0(::Zenject::DiContainer* _, ::System::Type* contractType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0::<FinalizeBindingSelf>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingSelf>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(contractType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, contractType);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_0.__zenCreate
::Il2CppObject* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerPrefabBindingFinalizer/<>c__DisplayClass6_0", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_0.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerPrefabBindingFinalizer/<>c__DisplayClass6_0", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_1
#include "Zenject/SubContainerPrefabBindingFinalizer_--c__DisplayClass6_1.hpp"
// Including type: Zenject.SubContainerCreatorCached
#include "Zenject/SubContainerCreatorCached.hpp"
// Including type: Zenject.IProvider
#include "Zenject/IProvider.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.hpp"
// Including type: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_0
#include "Zenject/SubContainerPrefabBindingFinalizer_--c__DisplayClass6_0.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 Zenject.SubContainerCreatorCached containerCreator
::Zenject::SubContainerCreatorCached*& Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_1::dyn_containerCreator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_1::dyn_containerCreator");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "containerCreator"))->offset;
return *reinterpret_cast<::Zenject::SubContainerCreatorCached**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_0 CS$<>8__locals1
::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0*& Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_1::dyn_CS$$$8__locals1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_1::dyn_CS$$$8__locals1");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "CS$<>8__locals1"))->offset;
return *reinterpret_cast<::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_0**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_1.<FinalizeBindingSelf>b__1
::Zenject::IProvider* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_1::$FinalizeBindingSelf$b__1(::Zenject::DiContainer* _, ::System::Type* contractType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_1::<FinalizeBindingSelf>b__1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FinalizeBindingSelf>b__1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(_), ::il2cpp_utils::ExtractType(contractType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::IProvider*, false>(this, ___internal__method, _, contractType);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_1.__zenCreate
::Il2CppObject* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_1::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_1::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerPrefabBindingFinalizer/<>c__DisplayClass6_1", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SubContainerPrefabBindingFinalizer/Zenject.<>c__DisplayClass6_1.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_1::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SubContainerPrefabBindingFinalizer::$$c__DisplayClass6_1::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SubContainerPrefabBindingFinalizer/<>c__DisplayClass6_1", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.IMemoryPool
#include "Zenject/IMemoryPool.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 method: Zenject.IMemoryPool.get_NumTotal
int Zenject::IMemoryPool::get_NumTotal() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IMemoryPool::get_NumTotal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_NumTotal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.IMemoryPool.get_NumActive
int Zenject::IMemoryPool::get_NumActive() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IMemoryPool::get_NumActive");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_NumActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.IMemoryPool.get_NumInactive
int Zenject::IMemoryPool::get_NumInactive() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IMemoryPool::get_NumInactive");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_NumInactive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.IMemoryPool.get_ItemType
::System::Type* Zenject::IMemoryPool::get_ItemType() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IMemoryPool::get_ItemType");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ItemType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Type*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.IMemoryPool.Resize
void Zenject::IMemoryPool::Resize(int desiredPoolSize) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IMemoryPool::Resize");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Resize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(desiredPoolSize)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, desiredPoolSize);
}
// Autogenerated method: Zenject.IMemoryPool.Clear
void Zenject::IMemoryPool::Clear() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IMemoryPool::Clear");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Clear", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.IMemoryPool.ExpandBy
void Zenject::IMemoryPool::ExpandBy(int numToAdd) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IMemoryPool::ExpandBy");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ExpandBy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(numToAdd)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, numToAdd);
}
// Autogenerated method: Zenject.IMemoryPool.ShrinkBy
void Zenject::IMemoryPool::ShrinkBy(int numToRemove) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IMemoryPool::ShrinkBy");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ShrinkBy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(numToRemove)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, numToRemove);
}
// Autogenerated method: Zenject.IMemoryPool.Despawn
void Zenject::IMemoryPool::Despawn(::Il2CppObject* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IMemoryPool::Despawn");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Despawn", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(obj)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, obj);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.PoolExceededFixedSizeException
#include "Zenject/PoolExceededFixedSizeException.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: Zenject.MemoryPoolSettings
#include "Zenject/MemoryPoolSettings.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.MemoryPoolSettings Default
::Zenject::MemoryPoolSettings* Zenject::MemoryPoolSettings::_get_Default() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MemoryPoolSettings::_get_Default");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Zenject::MemoryPoolSettings*>("Zenject", "MemoryPoolSettings", "Default"));
}
// Autogenerated static field setter
// Set static field: static public readonly Zenject.MemoryPoolSettings Default
void Zenject::MemoryPoolSettings::_set_Default(::Zenject::MemoryPoolSettings* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MemoryPoolSettings::_set_Default");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "MemoryPoolSettings", "Default", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 InitialSize
int& Zenject::MemoryPoolSettings::dyn_InitialSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MemoryPoolSettings::dyn_InitialSize");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "InitialSize"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 MaxSize
int& Zenject::MemoryPoolSettings::dyn_MaxSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MemoryPoolSettings::dyn_MaxSize");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "MaxSize"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.PoolExpandMethods ExpandMethod
::Zenject::PoolExpandMethods& Zenject::MemoryPoolSettings::dyn_ExpandMethod() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MemoryPoolSettings::dyn_ExpandMethod");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "ExpandMethod"))->offset;
return *reinterpret_cast<::Zenject::PoolExpandMethods*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Boolean ShowExpandWarning
bool& Zenject::MemoryPoolSettings::dyn_ShowExpandWarning() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MemoryPoolSettings::dyn_ShowExpandWarning");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "ShowExpandWarning"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.MemoryPoolSettings..cctor
void Zenject::MemoryPoolSettings::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MemoryPoolSettings::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "MemoryPoolSettings", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.MemoryPoolSettings.__zenCreate
::Il2CppObject* Zenject::MemoryPoolSettings::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MemoryPoolSettings::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "MemoryPoolSettings", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.MemoryPoolSettings.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::MemoryPoolSettings::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MemoryPoolSettings::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "MemoryPoolSettings", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.PoolCleanupChecker
#include "Zenject/PoolCleanupChecker.hpp"
// Including type: Zenject.PoolCleanupChecker/Zenject.<>c
#include "Zenject/PoolCleanupChecker_--c.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: Zenject.IMemoryPool
#include "Zenject/IMemoryPool.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 readonly System.Collections.Generic.List`1<Zenject.IMemoryPool> _poolFactories
::System::Collections::Generic::List_1<::Zenject::IMemoryPool*>*& Zenject::PoolCleanupChecker::dyn__poolFactories() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::dyn__poolFactories");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_poolFactories"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::Zenject::IMemoryPool*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Collections.Generic.List`1<System.Type> _ignoredPools
::System::Collections::Generic::List_1<::System::Type*>*& Zenject::PoolCleanupChecker::dyn__ignoredPools() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::dyn__ignoredPools");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_ignoredPools"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::System::Type*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.PoolCleanupChecker.LateDispose
void Zenject::PoolCleanupChecker::LateDispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::LateDispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LateDispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.PoolCleanupChecker.__zenCreate
::Il2CppObject* Zenject::PoolCleanupChecker::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PoolCleanupChecker", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.PoolCleanupChecker.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::PoolCleanupChecker::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PoolCleanupChecker", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.PoolCleanupChecker/Zenject.<>c
#include "Zenject/PoolCleanupChecker_--c.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.PoolCleanupChecker/Zenject.<>c <>9
::Zenject::PoolCleanupChecker::$$c* Zenject::PoolCleanupChecker::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::Zenject::PoolCleanupChecker::$$c*>("Zenject", "PoolCleanupChecker/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly Zenject.PoolCleanupChecker/Zenject.<>c <>9
void Zenject::PoolCleanupChecker::$$c::_set_$$9(::Zenject::PoolCleanupChecker::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "PoolCleanupChecker/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Type,System.Boolean> <>9__2_0
::System::Func_2<::System::Type*, bool>* Zenject::PoolCleanupChecker::$$c::_get_$$9__2_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::$$c::_get_$$9__2_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Type*, bool>*>("Zenject", "PoolCleanupChecker/<>c", "<>9__2_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Type,System.Boolean> <>9__2_0
void Zenject::PoolCleanupChecker::$$c::_set_$$9__2_0(::System::Func_2<::System::Type*, bool>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::$$c::_set_$$9__2_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "PoolCleanupChecker/<>c", "<>9__2_0", value)));
}
// Autogenerated method: Zenject.PoolCleanupChecker/Zenject.<>c..cctor
void Zenject::PoolCleanupChecker::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PoolCleanupChecker/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.PoolCleanupChecker/Zenject.<>c.<.ctor>b__2_0
bool Zenject::PoolCleanupChecker::$$c::$_ctor$b__2_0(::System::Type* x) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::$$c::<.ctor>b__2_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.ctor>b__2_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(x)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, x);
}
// Autogenerated method: Zenject.PoolCleanupChecker/Zenject.<>c.__zenCreate
::Il2CppObject* Zenject::PoolCleanupChecker::$$c::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::$$c::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PoolCleanupChecker/<>c", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.PoolCleanupChecker/Zenject.<>c.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::PoolCleanupChecker::$$c::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::PoolCleanupChecker::$$c::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "PoolCleanupChecker/<>c", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.InjectContext
#include "Zenject/InjectContext.hpp"
// Including type: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52
#include "Zenject/InjectContext_-get_ParentContexts-d__52.hpp"
// Including type: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54
#include "Zenject/InjectContext_-get_ParentContextsAndSelf-d__54.hpp"
// Including type: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56
#include "Zenject/InjectContext_-get_AllObjectTypes-d__56.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.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 Zenject.BindingId _bindingId
::Zenject::BindingId& Zenject::InjectContext::dyn__bindingId() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::dyn__bindingId");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bindingId"))->offset;
return *reinterpret_cast<::Zenject::BindingId*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Type _objectType
::System::Type*& Zenject::InjectContext::dyn__objectType() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::dyn__objectType");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_objectType"))->offset;
return *reinterpret_cast<::System::Type**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.InjectContext _parentContext
::Zenject::InjectContext*& Zenject::InjectContext::dyn__parentContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::dyn__parentContext");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_parentContext"))->offset;
return *reinterpret_cast<::Zenject::InjectContext**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object _objectInstance
::Il2CppObject*& Zenject::InjectContext::dyn__objectInstance() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::dyn__objectInstance");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_objectInstance"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.String _memberName
::StringW& Zenject::InjectContext::dyn__memberName() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::dyn__memberName");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_memberName"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _optional
bool& Zenject::InjectContext::dyn__optional() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::dyn__optional");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_optional"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.InjectSources _sourceType
::Zenject::InjectSources& Zenject::InjectContext::dyn__sourceType() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::dyn__sourceType");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_sourceType"))->offset;
return *reinterpret_cast<::Zenject::InjectSources*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object _fallBackValue
::Il2CppObject*& Zenject::InjectContext::dyn__fallBackValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::dyn__fallBackValue");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_fallBackValue"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object _concreteIdentifier
::Il2CppObject*& Zenject::InjectContext::dyn__concreteIdentifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::dyn__concreteIdentifier");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_concreteIdentifier"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.DiContainer _container
::Zenject::DiContainer*& Zenject::InjectContext::dyn__container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::dyn__container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.InjectContext.get_BindingId
::Zenject::BindingId Zenject::InjectContext::get_BindingId() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_BindingId");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_BindingId", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::BindingId, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.get_ObjectType
::System::Type* Zenject::InjectContext::get_ObjectType() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_ObjectType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ObjectType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Type*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_ObjectType
void Zenject::InjectContext::set_ObjectType(::System::Type* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_ObjectType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ObjectType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_ParentContext
::Zenject::InjectContext* Zenject::InjectContext::get_ParentContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_ParentContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ParentContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectContext*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_ParentContext
void Zenject::InjectContext::set_ParentContext(::Zenject::InjectContext* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_ParentContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ParentContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_ObjectInstance
::Il2CppObject* Zenject::InjectContext::get_ObjectInstance() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_ObjectInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ObjectInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_ObjectInstance
void Zenject::InjectContext::set_ObjectInstance(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_ObjectInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ObjectInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_Identifier
::Il2CppObject* Zenject::InjectContext::get_Identifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_Identifier");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Identifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_Identifier
void Zenject::InjectContext::set_Identifier(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_Identifier");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Identifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_MemberName
::StringW Zenject::InjectContext::get_MemberName() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_MemberName");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MemberName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_MemberName
void Zenject::InjectContext::set_MemberName(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_MemberName");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_MemberName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_MemberType
::System::Type* Zenject::InjectContext::get_MemberType() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_MemberType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MemberType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Type*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_MemberType
void Zenject::InjectContext::set_MemberType(::System::Type* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_MemberType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_MemberType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_Optional
bool Zenject::InjectContext::get_Optional() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_Optional");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Optional", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_Optional
void Zenject::InjectContext::set_Optional(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_Optional");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Optional", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_SourceType
::Zenject::InjectSources Zenject::InjectContext::get_SourceType() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_SourceType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SourceType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectSources, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_SourceType
void Zenject::InjectContext::set_SourceType(::Zenject::InjectSources value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_SourceType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_SourceType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_ConcreteIdentifier
::Il2CppObject* Zenject::InjectContext::get_ConcreteIdentifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_ConcreteIdentifier");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ConcreteIdentifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_ConcreteIdentifier
void Zenject::InjectContext::set_ConcreteIdentifier(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_ConcreteIdentifier");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ConcreteIdentifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_FallBackValue
::Il2CppObject* Zenject::InjectContext::get_FallBackValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_FallBackValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_FallBackValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_FallBackValue
void Zenject::InjectContext::set_FallBackValue(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_FallBackValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_FallBackValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_Container
::Zenject::DiContainer* Zenject::InjectContext::get_Container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_Container");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.set_Container
void Zenject::InjectContext::set_Container(::Zenject::DiContainer* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::set_Container");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.InjectContext.get_ParentContexts
::System::Collections::Generic::IEnumerable_1<::Zenject::InjectContext*>* Zenject::InjectContext::get_ParentContexts() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_ParentContexts");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ParentContexts", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::InjectContext*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.get_ParentContextsAndSelf
::System::Collections::Generic::IEnumerable_1<::Zenject::InjectContext*>* Zenject::InjectContext::get_ParentContextsAndSelf() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_ParentContextsAndSelf");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ParentContextsAndSelf", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::InjectContext*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.get_AllObjectTypes
::System::Collections::Generic::IEnumerable_1<::System::Type*>* Zenject::InjectContext::get_AllObjectTypes() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::get_AllObjectTypes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AllObjectTypes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::System::Type*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.Dispose
void Zenject::InjectContext::Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::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: Zenject.InjectContext.Reset
void Zenject::InjectContext::Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::Reset");
static 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: Zenject.InjectContext.CreateSubContext
::Zenject::InjectContext* Zenject::InjectContext::CreateSubContext(::System::Type* memberType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::CreateSubContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateSubContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(memberType)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectContext*, false>(this, ___internal__method, memberType);
}
// Autogenerated method: Zenject.InjectContext.CreateSubContext
::Zenject::InjectContext* Zenject::InjectContext::CreateSubContext(::System::Type* memberType, ::Il2CppObject* identifier) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::CreateSubContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateSubContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(memberType), ::il2cpp_utils::ExtractType(identifier)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectContext*, false>(this, ___internal__method, memberType, identifier);
}
// Autogenerated method: Zenject.InjectContext.Clone
::Zenject::InjectContext* Zenject::InjectContext::Clone() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::Clone");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Clone", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectContext*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext.GetObjectGraphString
::StringW Zenject::InjectContext::GetObjectGraphString() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::GetObjectGraphString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetObjectGraphString", 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: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52
#include "Zenject/InjectContext_-get_ParentContexts-d__52.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.Int32 <>1__state
int& Zenject::InjectContext::$get_ParentContexts$d__52::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.InjectContext <>2__current
::Zenject::InjectContext*& Zenject::InjectContext::$get_ParentContexts$d__52::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::Zenject::InjectContext**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>l__initialThreadId
int& Zenject::InjectContext::$get_ParentContexts$d__52::dyn_$$l__initialThreadId() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::dyn_$$l__initialThreadId");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>l__initialThreadId"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.InjectContext <>4__this
::Zenject::InjectContext*& Zenject::InjectContext::$get_ParentContexts$d__52::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::InjectContext**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.IEnumerator`1<Zenject.InjectContext> <>7__wrap1
::System::Collections::Generic::IEnumerator_1<::Zenject::InjectContext*>*& Zenject::InjectContext::$get_ParentContexts$d__52::dyn_$$7__wrap1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::dyn_$$7__wrap1");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>7__wrap1"))->offset;
return *reinterpret_cast<::System::Collections::Generic::IEnumerator_1<::Zenject::InjectContext*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52.System.Collections.Generic.IEnumerator<Zenject.InjectContext>.get_Current
::Zenject::InjectContext* Zenject::InjectContext::$get_ParentContexts$d__52::System_Collections_Generic_IEnumerator$Zenject_InjectContext$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::System.Collections.Generic.IEnumerator<Zenject.InjectContext>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<Zenject.InjectContext>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectContext*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52.System.Collections.IEnumerator.get_Current
::Il2CppObject* Zenject::InjectContext::$get_ParentContexts$d__52::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::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: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52.System.IDisposable.Dispose
void Zenject::InjectContext::$get_ParentContexts$d__52::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52.MoveNext
bool Zenject::InjectContext::$get_ParentContexts$d__52::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::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: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52.<>m__Finally1
void Zenject::InjectContext::$get_ParentContexts$d__52::$$m__Finally1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::<>m__Finally1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<>m__Finally1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52.System.Collections.IEnumerator.Reset
void Zenject::InjectContext::$get_ParentContexts$d__52::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52.System.Collections.Generic.IEnumerable<Zenject.InjectContext>.GetEnumerator
::System::Collections::Generic::IEnumerator_1<::Zenject::InjectContext*>* Zenject::InjectContext::$get_ParentContexts$d__52::System_Collections_Generic_IEnumerable$Zenject_InjectContext$_GetEnumerator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::System.Collections.Generic.IEnumerable<Zenject.InjectContext>.GetEnumerator");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerable<Zenject.InjectContext>.GetEnumerator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerator_1<::Zenject::InjectContext*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52.System.Collections.IEnumerable.GetEnumerator
::System::Collections::IEnumerator* Zenject::InjectContext::$get_ParentContexts$d__52::System_Collections_IEnumerable_GetEnumerator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::System.Collections.IEnumerable.GetEnumerator");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerable.GetEnumerator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52.__zenCreate
::Il2CppObject* Zenject::InjectContext::$get_ParentContexts$d__52::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectContext/<get_ParentContexts>d__52", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContexts>d__52.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::InjectContext::$get_ParentContexts$d__52::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContexts$d__52::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectContext/<get_ParentContexts>d__52", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54
#include "Zenject/InjectContext_-get_ParentContextsAndSelf-d__54.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.Int32 <>1__state
int& Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.InjectContext <>2__current
::Zenject::InjectContext*& Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::Zenject::InjectContext**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>l__initialThreadId
int& Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::dyn_$$l__initialThreadId() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::dyn_$$l__initialThreadId");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>l__initialThreadId"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.InjectContext <>4__this
::Zenject::InjectContext*& Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::InjectContext**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.IEnumerator`1<Zenject.InjectContext> <>7__wrap1
::System::Collections::Generic::IEnumerator_1<::Zenject::InjectContext*>*& Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::dyn_$$7__wrap1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::dyn_$$7__wrap1");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>7__wrap1"))->offset;
return *reinterpret_cast<::System::Collections::Generic::IEnumerator_1<::Zenject::InjectContext*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54.System.Collections.Generic.IEnumerator<Zenject.InjectContext>.get_Current
::Zenject::InjectContext* Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System_Collections_Generic_IEnumerator$Zenject_InjectContext$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System.Collections.Generic.IEnumerator<Zenject.InjectContext>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<Zenject.InjectContext>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectContext*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54.System.Collections.IEnumerator.get_Current
::Il2CppObject* Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::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: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54.System.IDisposable.Dispose
void Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54.MoveNext
bool Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::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: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54.<>m__Finally1
void Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::$$m__Finally1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::<>m__Finally1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<>m__Finally1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54.System.Collections.IEnumerator.Reset
void Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54.System.Collections.Generic.IEnumerable<Zenject.InjectContext>.GetEnumerator
::System::Collections::Generic::IEnumerator_1<::Zenject::InjectContext*>* Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System_Collections_Generic_IEnumerable$Zenject_InjectContext$_GetEnumerator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System.Collections.Generic.IEnumerable<Zenject.InjectContext>.GetEnumerator");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerable<Zenject.InjectContext>.GetEnumerator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerator_1<::Zenject::InjectContext*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54.System.Collections.IEnumerable.GetEnumerator
::System::Collections::IEnumerator* Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System_Collections_IEnumerable_GetEnumerator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::System.Collections.IEnumerable.GetEnumerator");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerable.GetEnumerator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54.__zenCreate
::Il2CppObject* Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectContext/<get_ParentContextsAndSelf>d__54", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_ParentContextsAndSelf>d__54.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_ParentContextsAndSelf$d__54::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectContext/<get_ParentContextsAndSelf>d__54", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56
#include "Zenject/InjectContext_-get_AllObjectTypes-d__56.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.Int32 <>1__state
int& Zenject::InjectContext::$get_AllObjectTypes$d__56::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Type <>2__current
::System::Type*& Zenject::InjectContext::$get_AllObjectTypes$d__56::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::System::Type**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>l__initialThreadId
int& Zenject::InjectContext::$get_AllObjectTypes$d__56::dyn_$$l__initialThreadId() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::dyn_$$l__initialThreadId");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>l__initialThreadId"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Zenject.InjectContext <>4__this
::Zenject::InjectContext*& Zenject::InjectContext::$get_AllObjectTypes$d__56::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::Zenject::InjectContext**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.IEnumerator`1<Zenject.InjectContext> <>7__wrap1
::System::Collections::Generic::IEnumerator_1<::Zenject::InjectContext*>*& Zenject::InjectContext::$get_AllObjectTypes$d__56::dyn_$$7__wrap1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::dyn_$$7__wrap1");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>7__wrap1"))->offset;
return *reinterpret_cast<::System::Collections::Generic::IEnumerator_1<::Zenject::InjectContext*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56.System.Collections.Generic.IEnumerator<System.Type>.get_Current
::System::Type* Zenject::InjectContext::$get_AllObjectTypes$d__56::System_Collections_Generic_IEnumerator$System_Type$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::System.Collections.Generic.IEnumerator<System.Type>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<System.Type>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Type*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56.System.Collections.IEnumerator.get_Current
::Il2CppObject* Zenject::InjectContext::$get_AllObjectTypes$d__56::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::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: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56.System.IDisposable.Dispose
void Zenject::InjectContext::$get_AllObjectTypes$d__56::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56.MoveNext
bool Zenject::InjectContext::$get_AllObjectTypes$d__56::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::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: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56.<>m__Finally1
void Zenject::InjectContext::$get_AllObjectTypes$d__56::$$m__Finally1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::<>m__Finally1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<>m__Finally1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56.System.Collections.IEnumerator.Reset
void Zenject::InjectContext::$get_AllObjectTypes$d__56::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56.System.Collections.Generic.IEnumerable<System.Type>.GetEnumerator
::System::Collections::Generic::IEnumerator_1<::System::Type*>* Zenject::InjectContext::$get_AllObjectTypes$d__56::System_Collections_Generic_IEnumerable$System_Type$_GetEnumerator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::System.Collections.Generic.IEnumerable<System.Type>.GetEnumerator");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerable<System.Type>.GetEnumerator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerator_1<::System::Type*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56.System.Collections.IEnumerable.GetEnumerator
::System::Collections::IEnumerator* Zenject::InjectContext::$get_AllObjectTypes$d__56::System_Collections_IEnumerable_GetEnumerator() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::System.Collections.IEnumerable.GetEnumerator");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerable.GetEnumerator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56.__zenCreate
::Il2CppObject* Zenject::InjectContext::$get_AllObjectTypes$d__56::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectContext/<get_AllObjectTypes>d__56", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.InjectContext/Zenject.<get_AllObjectTypes>d__56.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::InjectContext::$get_AllObjectTypes$d__56::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectContext::$get_AllObjectTypes$d__56::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectContext/<get_AllObjectTypes>d__56", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.TypeValuePair
#include "Zenject/TypeValuePair.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 instance field getter
// Get instance field: public System.Type Type
::System::Type*& Zenject::TypeValuePair::dyn_Type() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::TypeValuePair::dyn_Type");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Type"))->offset;
return *reinterpret_cast<::System::Type**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Object Value
::Il2CppObject*& Zenject::TypeValuePair::dyn_Value() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::TypeValuePair::dyn_Value");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Value"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.TypeValuePair..ctor
// ABORTED elsewhere. Zenject::TypeValuePair::TypeValuePair(::System::Type* type, ::Il2CppObject* value)
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.InjectUtil
#include "Zenject/InjectUtil.hpp"
// Including type: Zenject.InjectUtil/Zenject.<>c
#include "Zenject/InjectUtil_--c.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_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 method: Zenject.InjectUtil.CreateArgList
::System::Collections::Generic::List_1<::Zenject::TypeValuePair>* Zenject::InjectUtil::CreateArgList(::System::Collections::Generic::IEnumerable_1<::Il2CppObject*>* args) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectUtil::CreateArgList");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectUtil", "CreateArgList", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(args)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::List_1<::Zenject::TypeValuePair>*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, args);
}
// Autogenerated method: Zenject.InjectUtil.PopValueWithType
bool Zenject::InjectUtil::PopValueWithType(::System::Collections::Generic::List_1<::Zenject::TypeValuePair>* extraArgMap, ::System::Type* injectedFieldType, ByRef<::Il2CppObject*> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectUtil::PopValueWithType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectUtil", "PopValueWithType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(extraArgMap), ::il2cpp_utils::ExtractType(injectedFieldType), ::il2cpp_utils::ExtractIndependentType<::Il2CppObject*&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, extraArgMap, injectedFieldType, byref(value));
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.InjectUtil/Zenject.<>c
#include "Zenject/InjectUtil_--c.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.InjectUtil/Zenject.<>c <>9
::Zenject::InjectUtil::$$c* Zenject::InjectUtil::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectUtil::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::Zenject::InjectUtil::$$c*>("Zenject", "InjectUtil/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly Zenject.InjectUtil/Zenject.<>c <>9
void Zenject::InjectUtil::$$c::_set_$$9(::Zenject::InjectUtil::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectUtil::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "InjectUtil/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Object,Zenject.TypeValuePair> <>9__0_0
::System::Func_2<::Il2CppObject*, ::Zenject::TypeValuePair>* Zenject::InjectUtil::$$c::_get_$$9__0_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectUtil::$$c::_get_$$9__0_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::Il2CppObject*, ::Zenject::TypeValuePair>*>("Zenject", "InjectUtil/<>c", "<>9__0_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Object,Zenject.TypeValuePair> <>9__0_0
void Zenject::InjectUtil::$$c::_set_$$9__0_0(::System::Func_2<::Il2CppObject*, ::Zenject::TypeValuePair>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectUtil::$$c::_set_$$9__0_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "InjectUtil/<>c", "<>9__0_0", value)));
}
// Autogenerated method: Zenject.InjectUtil/Zenject.<>c..cctor
void Zenject::InjectUtil::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectUtil::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectUtil/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.InjectUtil/Zenject.<>c.<CreateArgList>b__0_0
::Zenject::TypeValuePair Zenject::InjectUtil::$$c::$CreateArgList$b__0_0(::Il2CppObject* x) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectUtil::$$c::<CreateArgList>b__0_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<CreateArgList>b__0_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(x)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::TypeValuePair, false>(this, ___internal__method, x);
}
// Autogenerated method: Zenject.InjectUtil/Zenject.<>c.__zenCreate
::Il2CppObject* Zenject::InjectUtil::$$c::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectUtil::$$c::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectUtil/<>c", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.InjectUtil/Zenject.<>c.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::InjectUtil::$$c::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InjectUtil::$$c::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InjectUtil/<>c", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.Context
#include "Zenject/Context.hpp"
// Including type: Zenject.Context/Zenject.<>c
#include "Zenject/Context_--c.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: Zenject.ScriptableObjectInstaller
#include "Zenject/ScriptableObjectInstaller.hpp"
// Including type: Zenject.MonoInstaller
#include "Zenject/MonoInstaller.hpp"
// Including type: Zenject.InstallerBase
#include "Zenject/InstallerBase.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: Zenject.ZenjectBinding
#include "Zenject/ZenjectBinding.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.Generic.List`1<Zenject.ScriptableObjectInstaller> _scriptableObjectInstallers
::System::Collections::Generic::List_1<::Zenject::ScriptableObjectInstaller*>*& Zenject::Context::dyn__scriptableObjectInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::dyn__scriptableObjectInstallers");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scriptableObjectInstallers"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::Zenject::ScriptableObjectInstaller*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<Zenject.MonoInstaller> _monoInstallers
::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>*& Zenject::Context::dyn__monoInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::dyn__monoInstallers");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_monoInstallers"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<Zenject.MonoInstaller> _installerPrefabs
::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>*& Zenject::Context::dyn__installerPrefabs() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::dyn__installerPrefabs");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_installerPrefabs"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<Zenject.InstallerBase> _normalInstallers
::System::Collections::Generic::List_1<::Zenject::InstallerBase*>*& Zenject::Context::dyn__normalInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::dyn__normalInstallers");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_normalInstallers"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::Zenject::InstallerBase*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<System.Type> _normalInstallerTypes
::System::Collections::Generic::List_1<::System::Type*>*& Zenject::Context::dyn__normalInstallerTypes() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::dyn__normalInstallerTypes");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_normalInstallerTypes"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::System::Type*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.Context.get_Installers
::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>* Zenject::Context::get_Installers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::get_Installers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Installers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.Context.set_Installers
void Zenject::Context::set_Installers(::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::set_Installers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Installers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.Context.get_InstallerPrefabs
::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>* Zenject::Context::get_InstallerPrefabs() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::get_InstallerPrefabs");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InstallerPrefabs", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.Context.set_InstallerPrefabs
void Zenject::Context::set_InstallerPrefabs(::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::set_InstallerPrefabs");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_InstallerPrefabs", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.Context.get_ScriptableObjectInstallers
::System::Collections::Generic::IEnumerable_1<::Zenject::ScriptableObjectInstaller*>* Zenject::Context::get_ScriptableObjectInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::get_ScriptableObjectInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ScriptableObjectInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::ScriptableObjectInstaller*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.Context.set_ScriptableObjectInstallers
void Zenject::Context::set_ScriptableObjectInstallers(::System::Collections::Generic::IEnumerable_1<::Zenject::ScriptableObjectInstaller*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::set_ScriptableObjectInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ScriptableObjectInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.Context.get_NormalInstallerTypes
::System::Collections::Generic::IEnumerable_1<::System::Type*>* Zenject::Context::get_NormalInstallerTypes() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::get_NormalInstallerTypes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_NormalInstallerTypes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::System::Type*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.Context.set_NormalInstallerTypes
void Zenject::Context::set_NormalInstallerTypes(::System::Collections::Generic::IEnumerable_1<::System::Type*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::set_NormalInstallerTypes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_NormalInstallerTypes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.Context.get_NormalInstallers
::System::Collections::Generic::IEnumerable_1<::Zenject::InstallerBase*>* Zenject::Context::get_NormalInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::get_NormalInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_NormalInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::InstallerBase*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.Context.set_NormalInstallers
void Zenject::Context::set_NormalInstallers(::System::Collections::Generic::IEnumerable_1<::Zenject::InstallerBase*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::set_NormalInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_NormalInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.Context.get_Container
::Zenject::DiContainer* Zenject::Context::get_Container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::get_Container");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.Context.GetRootGameObjects
::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>* Zenject::Context::GetRootGameObjects() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::GetRootGameObjects");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetRootGameObjects", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.Context.AddNormalInstallerType
void Zenject::Context::AddNormalInstallerType(::System::Type* installerType) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::AddNormalInstallerType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AddNormalInstallerType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(installerType)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, installerType);
}
// Autogenerated method: Zenject.Context.AddNormalInstaller
void Zenject::Context::AddNormalInstaller(::Zenject::InstallerBase* installer) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::AddNormalInstaller");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AddNormalInstaller", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(installer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, installer);
}
// Autogenerated method: Zenject.Context.CheckInstallerPrefabTypes
void Zenject::Context::CheckInstallerPrefabTypes(::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>* installers, ::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>* installerPrefabs) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::CheckInstallerPrefabTypes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CheckInstallerPrefabTypes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(installers), ::il2cpp_utils::ExtractType(installerPrefabs)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, installers, installerPrefabs);
}
// Autogenerated method: Zenject.Context.InstallInstallers
void Zenject::Context::InstallInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::InstallInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.Context.InstallInstallers
void Zenject::Context::InstallInstallers(::System::Collections::Generic::List_1<::Zenject::InstallerBase*>* normalInstallers, ::System::Collections::Generic::List_1<::System::Type*>* normalInstallerTypes, ::System::Collections::Generic::List_1<::Zenject::ScriptableObjectInstaller*>* scriptableObjectInstallers, ::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>* installers, ::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>* installerPrefabs) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::InstallInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(normalInstallers), ::il2cpp_utils::ExtractType(normalInstallerTypes), ::il2cpp_utils::ExtractType(scriptableObjectInstallers), ::il2cpp_utils::ExtractType(installers), ::il2cpp_utils::ExtractType(installerPrefabs)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, normalInstallers, normalInstallerTypes, scriptableObjectInstallers, installers, installerPrefabs);
}
// Autogenerated method: Zenject.Context.InstallSceneBindings
void Zenject::Context::InstallSceneBindings(::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>* injectableMonoBehaviours) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::InstallSceneBindings");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallSceneBindings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(injectableMonoBehaviours)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, injectableMonoBehaviours);
}
// Autogenerated method: Zenject.Context.InstallZenjectBinding
void Zenject::Context::InstallZenjectBinding(::Zenject::ZenjectBinding* binding) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::InstallZenjectBinding");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallZenjectBinding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(binding)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, binding);
}
// Autogenerated method: Zenject.Context.GetInjectableMonoBehaviours
void Zenject::Context::GetInjectableMonoBehaviours(::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>* components) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::GetInjectableMonoBehaviours");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetInjectableMonoBehaviours", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(components)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, components);
}
// Autogenerated method: Zenject.Context.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::Context::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "Context", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.Context/Zenject.<>c
#include "Zenject/Context_--c.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
// Including type: System.Type
#include "System/Type.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.Context/Zenject.<>c <>9
::Zenject::Context::$$c* Zenject::Context::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::Zenject::Context::$$c*>("Zenject", "Context/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly Zenject.Context/Zenject.<>c <>9
void Zenject::Context::$$c::_set_$$9(::Zenject::Context::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "Context/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Type,System.Boolean> <>9__16_0
::System::Func_2<::System::Type*, bool>* Zenject::Context::$$c::_get_$$9__16_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::$$c::_get_$$9__16_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Type*, bool>*>("Zenject", "Context/<>c", "<>9__16_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Type,System.Boolean> <>9__16_0
void Zenject::Context::$$c::_set_$$9__16_0(::System::Func_2<::System::Type*, bool>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::$$c::_set_$$9__16_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "Context/<>c", "<>9__16_0", value)));
}
// Autogenerated method: Zenject.Context/Zenject.<>c..cctor
void Zenject::Context::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "Context/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.Context/Zenject.<>c.<set_NormalInstallerTypes>b__16_0
bool Zenject::Context::$$c::$set_NormalInstallerTypes$b__16_0(::System::Type* x) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::$$c::<set_NormalInstallerTypes>b__16_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<set_NormalInstallerTypes>b__16_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(x)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, x);
}
// Autogenerated method: Zenject.Context/Zenject.<>c.__zenCreate
::Il2CppObject* Zenject::Context::$$c::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::$$c::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "Context/<>c", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.Context/Zenject.<>c.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::Context::$$c::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Context::$$c::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "Context/<>c", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.GameObjectContext
#include "Zenject/GameObjectContext.hpp"
// Including type: System.Action
#include "System/Action.hpp"
// Including type: Zenject.MonoKernel
#include "Zenject/MonoKernel.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.Action PreInstall
::System::Action*& Zenject::GameObjectContext::dyn_PreInstall() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::dyn_PreInstall");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PreInstall"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Action PostInstall
::System::Action*& Zenject::GameObjectContext::dyn_PostInstall() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::dyn_PostInstall");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PostInstall"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Action PreResolve
::System::Action*& Zenject::GameObjectContext::dyn_PreResolve() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::dyn_PreResolve");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PreResolve"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Action PostResolve
::System::Action*& Zenject::GameObjectContext::dyn_PostResolve() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::dyn_PostResolve");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PostResolve"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.MonoKernel _kernel
::Zenject::MonoKernel*& Zenject::GameObjectContext::dyn__kernel() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::dyn__kernel");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_kernel"))->offset;
return *reinterpret_cast<::Zenject::MonoKernel**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.DiContainer _container
::Zenject::DiContainer*& Zenject::GameObjectContext::dyn__container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::dyn__container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.GameObjectContext.add_PreInstall
void Zenject::GameObjectContext::add_PreInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::add_PreInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PreInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.GameObjectContext.remove_PreInstall
void Zenject::GameObjectContext::remove_PreInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::remove_PreInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PreInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.GameObjectContext.add_PostInstall
void Zenject::GameObjectContext::add_PostInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::add_PostInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PostInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.GameObjectContext.remove_PostInstall
void Zenject::GameObjectContext::remove_PostInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::remove_PostInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PostInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.GameObjectContext.add_PreResolve
void Zenject::GameObjectContext::add_PreResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::add_PreResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PreResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.GameObjectContext.remove_PreResolve
void Zenject::GameObjectContext::remove_PreResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::remove_PreResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PreResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.GameObjectContext.add_PostResolve
void Zenject::GameObjectContext::add_PostResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::add_PostResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PostResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.GameObjectContext.remove_PostResolve
void Zenject::GameObjectContext::remove_PostResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::remove_PostResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PostResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.GameObjectContext.Construct
void Zenject::GameObjectContext::Construct(::Zenject::DiContainer* parentContainer) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::Construct");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Construct", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parentContainer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, parentContainer);
}
// Autogenerated method: Zenject.GameObjectContext.InstallBindings
void Zenject::GameObjectContext::InstallBindings(::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>* injectableMonoBehaviours) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::InstallBindings");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallBindings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(injectableMonoBehaviours)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, injectableMonoBehaviours);
}
// Autogenerated method: Zenject.GameObjectContext.__zenInjectMethod0
void Zenject::GameObjectContext::__zenInjectMethod0(::Il2CppObject* P_0, ::ArrayW<::Il2CppObject*> P_1) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::__zenInjectMethod0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "GameObjectContext", "__zenInjectMethod0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0), ::il2cpp_utils::ExtractType(P_1)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0, P_1);
}
// Autogenerated method: Zenject.GameObjectContext.get_Container
::Zenject::DiContainer* Zenject::GameObjectContext::get_Container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::get_Container");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.GameObjectContext.GetRootGameObjects
::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>* Zenject::GameObjectContext::GetRootGameObjects() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::GetRootGameObjects");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetRootGameObjects", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.GameObjectContext.RunInternal
void Zenject::GameObjectContext::RunInternal() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::RunInternal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RunInternal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.GameObjectContext.GetInjectableMonoBehaviours
void Zenject::GameObjectContext::GetInjectableMonoBehaviours(::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>* monoBehaviours) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::GetInjectableMonoBehaviours");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetInjectableMonoBehaviours", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(monoBehaviours)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, monoBehaviours);
}
// Autogenerated method: Zenject.GameObjectContext.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::GameObjectContext::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::GameObjectContext::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "GameObjectContext", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.ProjectContext
#include "Zenject/ProjectContext.hpp"
// Including type: System.Action
#include "System/Action.hpp"
// Including type: Zenject.ZenjectSettings
#include "Zenject/ZenjectSettings.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: System.String
#include "System/String.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.String ProjectContextResourcePath
::StringW Zenject::ProjectContext::_get_ProjectContextResourcePath() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::_get_ProjectContextResourcePath");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("Zenject", "ProjectContext", "ProjectContextResourcePath"));
}
// Autogenerated static field setter
// Set static field: static public System.String ProjectContextResourcePath
void Zenject::ProjectContext::_set_ProjectContextResourcePath(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::_set_ProjectContextResourcePath");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "ProjectContext", "ProjectContextResourcePath", value));
}
// Autogenerated static field getter
// Get static field: static public System.String ProjectContextResourcePathOld
::StringW Zenject::ProjectContext::_get_ProjectContextResourcePathOld() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::_get_ProjectContextResourcePathOld");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("Zenject", "ProjectContext", "ProjectContextResourcePathOld"));
}
// Autogenerated static field setter
// Set static field: static public System.String ProjectContextResourcePathOld
void Zenject::ProjectContext::_set_ProjectContextResourcePathOld(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::_set_ProjectContextResourcePathOld");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "ProjectContext", "ProjectContextResourcePathOld", value));
}
// Autogenerated static field getter
// Get static field: static private Zenject.ProjectContext _instance
::Zenject::ProjectContext* Zenject::ProjectContext::_get__instance() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::_get__instance");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Zenject::ProjectContext*>("Zenject", "ProjectContext", "_instance"));
}
// Autogenerated static field setter
// Set static field: static private Zenject.ProjectContext _instance
void Zenject::ProjectContext::_set__instance(::Zenject::ProjectContext* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::_set__instance");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "ProjectContext", "_instance", value));
}
// Autogenerated static field getter
// Get static field: static private System.Boolean <ValidateOnNextRun>k__BackingField
bool Zenject::ProjectContext::_get_$ValidateOnNextRun$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::_get_$ValidateOnNextRun$k__BackingField");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<bool>("Zenject", "ProjectContext", "<ValidateOnNextRun>k__BackingField")));
}
// Autogenerated static field setter
// Set static field: static private System.Boolean <ValidateOnNextRun>k__BackingField
void Zenject::ProjectContext::_set_$ValidateOnNextRun$k__BackingField(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::_set_$ValidateOnNextRun$k__BackingField");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "ProjectContext", "<ValidateOnNextRun>k__BackingField", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Action PreInstall
::System::Action*& Zenject::ProjectContext::dyn_PreInstall() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::dyn_PreInstall");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PreInstall"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Action PostInstall
::System::Action*& Zenject::ProjectContext::dyn_PostInstall() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::dyn_PostInstall");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PostInstall"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Action PreResolve
::System::Action*& Zenject::ProjectContext::dyn_PreResolve() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::dyn_PreResolve");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PreResolve"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Action PostResolve
::System::Action*& Zenject::ProjectContext::dyn_PostResolve() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::dyn_PostResolve");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PostResolve"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _parentNewObjectsUnderContext
bool& Zenject::ProjectContext::dyn__parentNewObjectsUnderContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::dyn__parentNewObjectsUnderContext");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_parentNewObjectsUnderContext"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.ReflectionBakingCoverageModes _editorReflectionBakingCoverageMode
::Zenject::ReflectionBakingCoverageModes& Zenject::ProjectContext::dyn__editorReflectionBakingCoverageMode() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::dyn__editorReflectionBakingCoverageMode");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_editorReflectionBakingCoverageMode"))->offset;
return *reinterpret_cast<::Zenject::ReflectionBakingCoverageModes*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.ReflectionBakingCoverageModes _buildsReflectionBakingCoverageMode
::Zenject::ReflectionBakingCoverageModes& Zenject::ProjectContext::dyn__buildsReflectionBakingCoverageMode() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::dyn__buildsReflectionBakingCoverageMode");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_buildsReflectionBakingCoverageMode"))->offset;
return *reinterpret_cast<::Zenject::ReflectionBakingCoverageModes*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.ZenjectSettings _settings
::Zenject::ZenjectSettings*& Zenject::ProjectContext::dyn__settings() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::dyn__settings");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_settings"))->offset;
return *reinterpret_cast<::Zenject::ZenjectSettings**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.DiContainer _container
::Zenject::DiContainer*& Zenject::ProjectContext::dyn__container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::dyn__container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.ProjectContext.get_HasInstance
bool Zenject::ProjectContext::get_HasInstance() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::get_HasInstance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ProjectContext", "get_HasInstance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.ProjectContext.get_Instance
::Zenject::ProjectContext* Zenject::ProjectContext::get_Instance() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::get_Instance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ProjectContext", "get_Instance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::ProjectContext*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.ProjectContext.get_ValidateOnNextRun
bool Zenject::ProjectContext::get_ValidateOnNextRun() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::get_ValidateOnNextRun");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ProjectContext", "get_ValidateOnNextRun", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.ProjectContext.set_ValidateOnNextRun
void Zenject::ProjectContext::set_ValidateOnNextRun(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::set_ValidateOnNextRun");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ProjectContext", "set_ValidateOnNextRun", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, value);
}
// Autogenerated method: Zenject.ProjectContext.get_ParentNewObjectsUnderContext
bool Zenject::ProjectContext::get_ParentNewObjectsUnderContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::get_ParentNewObjectsUnderContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ParentNewObjectsUnderContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ProjectContext.set_ParentNewObjectsUnderContext
void Zenject::ProjectContext::set_ParentNewObjectsUnderContext(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::set_ParentNewObjectsUnderContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ParentNewObjectsUnderContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ProjectContext.add_PreInstall
void Zenject::ProjectContext::add_PreInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::add_PreInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PreInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ProjectContext.remove_PreInstall
void Zenject::ProjectContext::remove_PreInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::remove_PreInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PreInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ProjectContext.add_PostInstall
void Zenject::ProjectContext::add_PostInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::add_PostInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PostInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ProjectContext.remove_PostInstall
void Zenject::ProjectContext::remove_PostInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::remove_PostInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PostInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ProjectContext.add_PreResolve
void Zenject::ProjectContext::add_PreResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::add_PreResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PreResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ProjectContext.remove_PreResolve
void Zenject::ProjectContext::remove_PreResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::remove_PreResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PreResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ProjectContext.add_PostResolve
void Zenject::ProjectContext::add_PostResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::add_PostResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PostResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ProjectContext.remove_PostResolve
void Zenject::ProjectContext::remove_PostResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::remove_PostResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PostResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ProjectContext.TryGetPrefab
::UnityEngine::GameObject* Zenject::ProjectContext::TryGetPrefab() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::TryGetPrefab");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ProjectContext", "TryGetPrefab", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::GameObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.ProjectContext.InstantiateAndInitialize
void Zenject::ProjectContext::InstantiateAndInitialize() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::InstantiateAndInitialize");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ProjectContext", "InstantiateAndInitialize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.ProjectContext.EnsureIsInitialized
void Zenject::ProjectContext::EnsureIsInitialized() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::EnsureIsInitialized");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EnsureIsInitialized", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ProjectContext.Awake
void Zenject::ProjectContext::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ProjectContext.Initialize
void Zenject::ProjectContext::Initialize() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::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: Zenject.ProjectContext.InstallBindings
void Zenject::ProjectContext::InstallBindings(::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>* injectableMonoBehaviours) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::InstallBindings");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallBindings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(injectableMonoBehaviours)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, injectableMonoBehaviours);
}
// Autogenerated method: Zenject.ProjectContext.get_Container
::Zenject::DiContainer* Zenject::ProjectContext::get_Container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::get_Container");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ProjectContext.GetRootGameObjects
::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>* Zenject::ProjectContext::GetRootGameObjects() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::GetRootGameObjects");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetRootGameObjects", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ProjectContext.GetInjectableMonoBehaviours
void Zenject::ProjectContext::GetInjectableMonoBehaviours(::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>* monoBehaviours) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::GetInjectableMonoBehaviours");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetInjectableMonoBehaviours", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(monoBehaviours)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, monoBehaviours);
}
// Autogenerated method: Zenject.ProjectContext.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::ProjectContext::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ProjectContext::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ProjectContext", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.RunnableContext
#include "Zenject/RunnableContext.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.Boolean _staticAutoRun
bool Zenject::RunnableContext::_get__staticAutoRun() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::_get__staticAutoRun");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("Zenject", "RunnableContext", "_staticAutoRun"));
}
// Autogenerated static field setter
// Set static field: static private System.Boolean _staticAutoRun
void Zenject::RunnableContext::_set__staticAutoRun(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::_set__staticAutoRun");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "RunnableContext", "_staticAutoRun", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _autoRun
bool& Zenject::RunnableContext::dyn__autoRun() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::dyn__autoRun");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_autoRun"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean <Initialized>k__BackingField
bool& Zenject::RunnableContext::dyn_$Initialized$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::dyn_$Initialized$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Initialized>k__BackingField"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.RunnableContext.get_Initialized
bool Zenject::RunnableContext::get_Initialized() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::get_Initialized");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Initialized", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.RunnableContext.set_Initialized
void Zenject::RunnableContext::set_Initialized(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::set_Initialized");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Initialized", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.RunnableContext.Initialize
void Zenject::RunnableContext::Initialize() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::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: Zenject.RunnableContext.Run
void Zenject::RunnableContext::Run() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::Run");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Run", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.RunnableContext.RunInternal
void Zenject::RunnableContext::RunInternal() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::RunInternal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RunInternal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.RunnableContext..cctor
void Zenject::RunnableContext::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "RunnableContext", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.RunnableContext.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::RunnableContext::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::RunnableContext::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "RunnableContext", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.SceneContext
#include "Zenject/SceneContext.hpp"
// Including type: Zenject.SceneContext/Zenject.<>c__DisplayClass49_0
#include "Zenject/SceneContext_--c__DisplayClass49_0.hpp"
// Including type: Zenject.SceneContext/Zenject.<>c
#include "Zenject/SceneContext_--c.hpp"
// Including type: Zenject.SceneContext/Zenject.<>c__DisplayClass51_0
#include "Zenject/SceneContext_--c__DisplayClass51_0.hpp"
// Including type: System.Action
#include "System/Action.hpp"
// Including type: UnityEngine.Events.UnityEvent
#include "UnityEngine/Events/UnityEvent.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.SceneDecoratorContext
#include "Zenject/SceneDecoratorContext.hpp"
// Including type: System.Action`1
#include "System/Action_1.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.hpp"
// Including type: UnityEngine.MonoBehaviour
#include "UnityEngine/MonoBehaviour.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.Action`1<Zenject.DiContainer> ExtraBindingsEarlyInstallMethod
::System::Action_1<::Zenject::DiContainer*>* Zenject::SceneContext::_get_ExtraBindingsEarlyInstallMethod() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::_get_ExtraBindingsEarlyInstallMethod");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action_1<::Zenject::DiContainer*>*>("Zenject", "SceneContext", "ExtraBindingsEarlyInstallMethod"));
}
// Autogenerated static field setter
// Set static field: static public System.Action`1<Zenject.DiContainer> ExtraBindingsEarlyInstallMethod
void Zenject::SceneContext::_set_ExtraBindingsEarlyInstallMethod(::System::Action_1<::Zenject::DiContainer*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::_set_ExtraBindingsEarlyInstallMethod");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "SceneContext", "ExtraBindingsEarlyInstallMethod", value));
}
// Autogenerated static field getter
// Get static field: static public System.Action`1<Zenject.DiContainer> ExtraBindingsInstallMethod
::System::Action_1<::Zenject::DiContainer*>* Zenject::SceneContext::_get_ExtraBindingsInstallMethod() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::_get_ExtraBindingsInstallMethod");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action_1<::Zenject::DiContainer*>*>("Zenject", "SceneContext", "ExtraBindingsInstallMethod"));
}
// Autogenerated static field setter
// Set static field: static public System.Action`1<Zenject.DiContainer> ExtraBindingsInstallMethod
void Zenject::SceneContext::_set_ExtraBindingsInstallMethod(::System::Action_1<::Zenject::DiContainer*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::_set_ExtraBindingsInstallMethod");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "SceneContext", "ExtraBindingsInstallMethod", value));
}
// Autogenerated static field getter
// Get static field: static public System.Action`1<Zenject.DiContainer> ExtraBindingsLateInstallMethod
::System::Action_1<::Zenject::DiContainer*>* Zenject::SceneContext::_get_ExtraBindingsLateInstallMethod() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::_get_ExtraBindingsLateInstallMethod");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action_1<::Zenject::DiContainer*>*>("Zenject", "SceneContext", "ExtraBindingsLateInstallMethod"));
}
// Autogenerated static field setter
// Set static field: static public System.Action`1<Zenject.DiContainer> ExtraBindingsLateInstallMethod
void Zenject::SceneContext::_set_ExtraBindingsLateInstallMethod(::System::Action_1<::Zenject::DiContainer*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::_set_ExtraBindingsLateInstallMethod");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "SceneContext", "ExtraBindingsLateInstallMethod", value));
}
// Autogenerated static field getter
// Get static field: static public System.Action`1<Zenject.DiContainer> ExtraPostInstallMethod
::System::Action_1<::Zenject::DiContainer*>* Zenject::SceneContext::_get_ExtraPostInstallMethod() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::_get_ExtraPostInstallMethod");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action_1<::Zenject::DiContainer*>*>("Zenject", "SceneContext", "ExtraPostInstallMethod"));
}
// Autogenerated static field setter
// Set static field: static public System.Action`1<Zenject.DiContainer> ExtraPostInstallMethod
void Zenject::SceneContext::_set_ExtraPostInstallMethod(::System::Action_1<::Zenject::DiContainer*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::_set_ExtraPostInstallMethod");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "SceneContext", "ExtraPostInstallMethod", value));
}
// Autogenerated static field getter
// Get static field: static public System.Collections.Generic.IEnumerable`1<Zenject.DiContainer> ParentContainers
::System::Collections::Generic::IEnumerable_1<::Zenject::DiContainer*>* Zenject::SceneContext::_get_ParentContainers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::_get_ParentContainers");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Collections::Generic::IEnumerable_1<::Zenject::DiContainer*>*>("Zenject", "SceneContext", "ParentContainers"));
}
// Autogenerated static field setter
// Set static field: static public System.Collections.Generic.IEnumerable`1<Zenject.DiContainer> ParentContainers
void Zenject::SceneContext::_set_ParentContainers(::System::Collections::Generic::IEnumerable_1<::Zenject::DiContainer*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::_set_ParentContainers");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "SceneContext", "ParentContainers", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Action PreInstall
::System::Action*& Zenject::SceneContext::dyn_PreInstall() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn_PreInstall");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PreInstall"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Action PostInstall
::System::Action*& Zenject::SceneContext::dyn_PostInstall() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn_PostInstall");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PostInstall"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Action PreResolve
::System::Action*& Zenject::SceneContext::dyn_PreResolve() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn_PreResolve");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PreResolve"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Action PostResolve
::System::Action*& Zenject::SceneContext::dyn_PostResolve() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn_PostResolve");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "PostResolve"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Events.UnityEvent OnPreInstall
::UnityEngine::Events::UnityEvent*& Zenject::SceneContext::dyn_OnPreInstall() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn_OnPreInstall");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnPreInstall"))->offset;
return *reinterpret_cast<::UnityEngine::Events::UnityEvent**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Events.UnityEvent OnPostInstall
::UnityEngine::Events::UnityEvent*& Zenject::SceneContext::dyn_OnPostInstall() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn_OnPostInstall");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnPostInstall"))->offset;
return *reinterpret_cast<::UnityEngine::Events::UnityEvent**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Events.UnityEvent OnPreResolve
::UnityEngine::Events::UnityEvent*& Zenject::SceneContext::dyn_OnPreResolve() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn_OnPreResolve");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnPreResolve"))->offset;
return *reinterpret_cast<::UnityEngine::Events::UnityEvent**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Events.UnityEvent OnPostResolve
::UnityEngine::Events::UnityEvent*& Zenject::SceneContext::dyn_OnPostResolve() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn_OnPostResolve");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnPostResolve"))->offset;
return *reinterpret_cast<::UnityEngine::Events::UnityEvent**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _parentNewObjectsUnderSceneContext
bool& Zenject::SceneContext::dyn__parentNewObjectsUnderSceneContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn__parentNewObjectsUnderSceneContext");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_parentNewObjectsUnderSceneContext"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<System.String> _contractNames
::System::Collections::Generic::List_1<::StringW>*& Zenject::SceneContext::dyn__contractNames() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn__contractNames");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_contractNames"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::StringW>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<System.String> _parentContractNames
::System::Collections::Generic::List_1<::StringW>*& Zenject::SceneContext::dyn__parentContractNames() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn__parentContractNames");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_parentContractNames"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::StringW>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.DiContainer _container
::Zenject::DiContainer*& Zenject::SceneContext::dyn__container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn__container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Collections.Generic.List`1<Zenject.SceneDecoratorContext> _decoratorContexts
::System::Collections::Generic::List_1<::Zenject::SceneDecoratorContext*>*& Zenject::SceneContext::dyn__decoratorContexts() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn__decoratorContexts");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_decoratorContexts"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::Zenject::SceneDecoratorContext*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _hasInstalled
bool& Zenject::SceneContext::dyn__hasInstalled() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn__hasInstalled");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hasInstalled"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _hasResolved
bool& Zenject::SceneContext::dyn__hasResolved() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::dyn__hasResolved");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hasResolved"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SceneContext.get_HasResolved
bool Zenject::SceneContext::get_HasResolved() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::get_HasResolved");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_HasResolved", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.get_HasInstalled
bool Zenject::SceneContext::get_HasInstalled() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::get_HasInstalled");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_HasInstalled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.get_IsValidating
bool Zenject::SceneContext::get_IsValidating() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::get_IsValidating");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsValidating", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.get_ContractNames
::System::Collections::Generic::IEnumerable_1<::StringW>* Zenject::SceneContext::get_ContractNames() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::get_ContractNames");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ContractNames", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::StringW>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.set_ContractNames
void Zenject::SceneContext::set_ContractNames(::System::Collections::Generic::IEnumerable_1<::StringW>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::set_ContractNames");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ContractNames", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.get_ParentContractNames
::System::Collections::Generic::IEnumerable_1<::StringW>* Zenject::SceneContext::get_ParentContractNames() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::get_ParentContractNames");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ParentContractNames", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::StringW>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.set_ParentContractNames
void Zenject::SceneContext::set_ParentContractNames(::System::Collections::Generic::IEnumerable_1<::StringW>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::set_ParentContractNames");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ParentContractNames", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.get_ParentNewObjectsUnderSceneContext
bool Zenject::SceneContext::get_ParentNewObjectsUnderSceneContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::get_ParentNewObjectsUnderSceneContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ParentNewObjectsUnderSceneContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.set_ParentNewObjectsUnderSceneContext
void Zenject::SceneContext::set_ParentNewObjectsUnderSceneContext(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::set_ParentNewObjectsUnderSceneContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ParentNewObjectsUnderSceneContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.add_PreInstall
void Zenject::SceneContext::add_PreInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::add_PreInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PreInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.remove_PreInstall
void Zenject::SceneContext::remove_PreInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::remove_PreInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PreInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.add_PostInstall
void Zenject::SceneContext::add_PostInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::add_PostInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PostInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.remove_PostInstall
void Zenject::SceneContext::remove_PostInstall(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::remove_PostInstall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PostInstall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.add_PreResolve
void Zenject::SceneContext::add_PreResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::add_PreResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PreResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.remove_PreResolve
void Zenject::SceneContext::remove_PreResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::remove_PreResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PreResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.add_PostResolve
void Zenject::SceneContext::add_PostResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::add_PostResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "add_PostResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.remove_PostResolve
void Zenject::SceneContext::remove_PostResolve(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::remove_PostResolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "remove_PostResolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneContext.Awake
void Zenject::SceneContext::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.Validate
void Zenject::SceneContext::Validate() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::Validate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Validate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.GetParentContainers
::System::Collections::Generic::IEnumerable_1<::Zenject::DiContainer*>* Zenject::SceneContext::GetParentContainers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::GetParentContainers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetParentContainers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::DiContainer*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.LookupDecoratorContexts
::System::Collections::Generic::List_1<::Zenject::SceneDecoratorContext*>* Zenject::SceneContext::LookupDecoratorContexts() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::LookupDecoratorContexts");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LookupDecoratorContexts", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::List_1<::Zenject::SceneDecoratorContext*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.Install
void Zenject::SceneContext::Install() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::Install");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Install", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.Resolve
void Zenject::SceneContext::Resolve() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::Resolve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Resolve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.InstallBindings
void Zenject::SceneContext::InstallBindings(::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>* injectableMonoBehaviours) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::InstallBindings");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallBindings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(injectableMonoBehaviours)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, injectableMonoBehaviours);
}
// Autogenerated method: Zenject.SceneContext.Create
::Zenject::SceneContext* Zenject::SceneContext::Create() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::Create");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SceneContext", "Create", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::SceneContext*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.<LookupDecoratorContexts>b__50_2
bool Zenject::SceneContext::$LookupDecoratorContexts$b__50_2(::Zenject::SceneDecoratorContext* decoratorContext) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::<LookupDecoratorContexts>b__50_2");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<LookupDecoratorContexts>b__50_2", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(decoratorContext)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, decoratorContext);
}
// Autogenerated method: Zenject.SceneContext.get_Container
::Zenject::DiContainer* Zenject::SceneContext::get_Container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::get_Container");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.RunInternal
void Zenject::SceneContext::RunInternal() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::RunInternal");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RunInternal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.GetRootGameObjects
::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>* Zenject::SceneContext::GetRootGameObjects() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::GetRootGameObjects");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetRootGameObjects", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneContext.GetInjectableMonoBehaviours
void Zenject::SceneContext::GetInjectableMonoBehaviours(::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>* monoBehaviours) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::GetInjectableMonoBehaviours");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetInjectableMonoBehaviours", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(monoBehaviours)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, monoBehaviours);
}
// Autogenerated method: Zenject.SceneContext.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SceneContext::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SceneContext", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SceneContext/Zenject.<>c__DisplayClass49_0
#include "Zenject/SceneContext_--c__DisplayClass49_0.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.Collections.Generic.IEnumerable`1<System.String> parentContractNames
::System::Collections::Generic::IEnumerable_1<::StringW>*& Zenject::SceneContext::$$c__DisplayClass49_0::dyn_parentContractNames() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c__DisplayClass49_0::dyn_parentContractNames");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "parentContractNames"))->offset;
return *reinterpret_cast<::System::Collections::Generic::IEnumerable_1<::StringW>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Func`2<System.String,System.Boolean> <>9__4
::System::Func_2<::StringW, bool>*& Zenject::SceneContext::$$c__DisplayClass49_0::dyn_$$9__4() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c__DisplayClass49_0::dyn_$$9__4");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>9__4"))->offset;
return *reinterpret_cast<::System::Func_2<::StringW, bool>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c__DisplayClass49_0.<GetParentContainers>b__2
bool Zenject::SceneContext::$$c__DisplayClass49_0::$GetParentContainers$b__2(::Zenject::SceneContext* sceneContext) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c__DisplayClass49_0::<GetParentContainers>b__2");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GetParentContainers>b__2", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sceneContext)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, sceneContext);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c__DisplayClass49_0.<GetParentContainers>b__4
bool Zenject::SceneContext::$$c__DisplayClass49_0::$GetParentContainers$b__4(::StringW x) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c__DisplayClass49_0::<GetParentContainers>b__4");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GetParentContainers>b__4", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(x)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, x);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c__DisplayClass49_0.__zenCreate
::Il2CppObject* Zenject::SceneContext::$$c__DisplayClass49_0::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c__DisplayClass49_0::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SceneContext/<>c__DisplayClass49_0", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c__DisplayClass49_0.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SceneContext::$$c__DisplayClass49_0::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c__DisplayClass49_0::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SceneContext/<>c__DisplayClass49_0", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SceneContext/Zenject.<>c
#include "Zenject/SceneContext_--c.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.SceneDecoratorContext
#include "Zenject/SceneDecoratorContext.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.SceneContext/Zenject.<>c <>9
::Zenject::SceneContext::$$c* Zenject::SceneContext::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::Zenject::SceneContext::$$c*>("Zenject", "SceneContext/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly Zenject.SceneContext/Zenject.<>c <>9
void Zenject::SceneContext::$$c::_set_$$9(::Zenject::SceneContext::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "SceneContext/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<UnityEngine.SceneManagement.Scene,System.Collections.Generic.IEnumerable`1<UnityEngine.GameObject>> <>9__49_0
::System::Func_2<::UnityEngine::SceneManagement::Scene, ::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*>* Zenject::SceneContext::$$c::_get_$$9__49_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_get_$$9__49_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::UnityEngine::SceneManagement::Scene, ::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*>*>("Zenject", "SceneContext/<>c", "<>9__49_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<UnityEngine.SceneManagement.Scene,System.Collections.Generic.IEnumerable`1<UnityEngine.GameObject>> <>9__49_0
void Zenject::SceneContext::$$c::_set_$$9__49_0(::System::Func_2<::UnityEngine::SceneManagement::Scene, ::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_set_$$9__49_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "SceneContext/<>c", "<>9__49_0", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<UnityEngine.GameObject,System.Collections.Generic.IEnumerable`1<Zenject.SceneContext>> <>9__49_1
::System::Func_2<::UnityEngine::GameObject*, ::System::Collections::Generic::IEnumerable_1<::Zenject::SceneContext*>*>* Zenject::SceneContext::$$c::_get_$$9__49_1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_get_$$9__49_1");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::UnityEngine::GameObject*, ::System::Collections::Generic::IEnumerable_1<::Zenject::SceneContext*>*>*>("Zenject", "SceneContext/<>c", "<>9__49_1")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<UnityEngine.GameObject,System.Collections.Generic.IEnumerable`1<Zenject.SceneContext>> <>9__49_1
void Zenject::SceneContext::$$c::_set_$$9__49_1(::System::Func_2<::UnityEngine::GameObject*, ::System::Collections::Generic::IEnumerable_1<::Zenject::SceneContext*>*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_set_$$9__49_1");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "SceneContext/<>c", "<>9__49_1", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<Zenject.SceneContext,Zenject.DiContainer> <>9__49_3
::System::Func_2<::Zenject::SceneContext*, ::Zenject::DiContainer*>* Zenject::SceneContext::$$c::_get_$$9__49_3() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_get_$$9__49_3");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::Zenject::SceneContext*, ::Zenject::DiContainer*>*>("Zenject", "SceneContext/<>c", "<>9__49_3")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<Zenject.SceneContext,Zenject.DiContainer> <>9__49_3
void Zenject::SceneContext::$$c::_set_$$9__49_3(::System::Func_2<::Zenject::SceneContext*, ::Zenject::DiContainer*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_set_$$9__49_3");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "SceneContext/<>c", "<>9__49_3", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<UnityEngine.SceneManagement.Scene,System.Collections.Generic.IEnumerable`1<UnityEngine.GameObject>> <>9__50_0
::System::Func_2<::UnityEngine::SceneManagement::Scene, ::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*>* Zenject::SceneContext::$$c::_get_$$9__50_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_get_$$9__50_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::UnityEngine::SceneManagement::Scene, ::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*>*>("Zenject", "SceneContext/<>c", "<>9__50_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<UnityEngine.SceneManagement.Scene,System.Collections.Generic.IEnumerable`1<UnityEngine.GameObject>> <>9__50_0
void Zenject::SceneContext::$$c::_set_$$9__50_0(::System::Func_2<::UnityEngine::SceneManagement::Scene, ::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_set_$$9__50_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "SceneContext/<>c", "<>9__50_0", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<UnityEngine.GameObject,System.Collections.Generic.IEnumerable`1<Zenject.SceneDecoratorContext>> <>9__50_1
::System::Func_2<::UnityEngine::GameObject*, ::System::Collections::Generic::IEnumerable_1<::Zenject::SceneDecoratorContext*>*>* Zenject::SceneContext::$$c::_get_$$9__50_1() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_get_$$9__50_1");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::UnityEngine::GameObject*, ::System::Collections::Generic::IEnumerable_1<::Zenject::SceneDecoratorContext*>*>*>("Zenject", "SceneContext/<>c", "<>9__50_1")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<UnityEngine.GameObject,System.Collections.Generic.IEnumerable`1<Zenject.SceneDecoratorContext>> <>9__50_1
void Zenject::SceneContext::$$c::_set_$$9__50_1(::System::Func_2<::UnityEngine::GameObject*, ::System::Collections::Generic::IEnumerable_1<::Zenject::SceneDecoratorContext*>*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::_set_$$9__50_1");
THROW_UNLESS((il2cpp_utils::SetFieldValue("Zenject", "SceneContext/<>c", "<>9__50_1", value)));
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c..cctor
void Zenject::SceneContext::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SceneContext/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c.<GetParentContainers>b__49_0
::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>* Zenject::SceneContext::$$c::$GetParentContainers$b__49_0(::UnityEngine::SceneManagement::Scene scene) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::<GetParentContainers>b__49_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GetParentContainers>b__49_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(scene)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*, false>(this, ___internal__method, scene);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c.<GetParentContainers>b__49_1
::System::Collections::Generic::IEnumerable_1<::Zenject::SceneContext*>* Zenject::SceneContext::$$c::$GetParentContainers$b__49_1(::UnityEngine::GameObject* root) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::<GetParentContainers>b__49_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GetParentContainers>b__49_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(root)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::SceneContext*>*, false>(this, ___internal__method, root);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c.<GetParentContainers>b__49_3
::Zenject::DiContainer* Zenject::SceneContext::$$c::$GetParentContainers$b__49_3(::Zenject::SceneContext* x) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::<GetParentContainers>b__49_3");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GetParentContainers>b__49_3", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(x)})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(this, ___internal__method, x);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c.<LookupDecoratorContexts>b__50_0
::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>* Zenject::SceneContext::$$c::$LookupDecoratorContexts$b__50_0(::UnityEngine::SceneManagement::Scene scene) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::<LookupDecoratorContexts>b__50_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<LookupDecoratorContexts>b__50_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(scene)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*, false>(this, ___internal__method, scene);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c.<LookupDecoratorContexts>b__50_1
::System::Collections::Generic::IEnumerable_1<::Zenject::SceneDecoratorContext*>* Zenject::SceneContext::$$c::$LookupDecoratorContexts$b__50_1(::UnityEngine::GameObject* root) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::<LookupDecoratorContexts>b__50_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<LookupDecoratorContexts>b__50_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(root)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::SceneDecoratorContext*>*, false>(this, ___internal__method, root);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c.__zenCreate
::Il2CppObject* Zenject::SceneContext::$$c::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SceneContext/<>c", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SceneContext::$$c::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SceneContext/<>c", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.SceneContext/Zenject.<>c__DisplayClass51_0
#include "Zenject/SceneContext_--c__DisplayClass51_0.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.Collections.Generic.IEnumerable`1<Zenject.DiContainer> parents
::System::Collections::Generic::IEnumerable_1<::Zenject::DiContainer*>*& Zenject::SceneContext::$$c__DisplayClass51_0::dyn_parents() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c__DisplayClass51_0::dyn_parents");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "parents"))->offset;
return *reinterpret_cast<::System::Collections::Generic::IEnumerable_1<::Zenject::DiContainer*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c__DisplayClass51_0.<Install>b__0
bool Zenject::SceneContext::$$c__DisplayClass51_0::$Install$b__0(::Zenject::DiContainer* x) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c__DisplayClass51_0::<Install>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Install>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(x)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, x);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c__DisplayClass51_0.__zenCreate
::Il2CppObject* Zenject::SceneContext::$$c__DisplayClass51_0::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c__DisplayClass51_0::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SceneContext/<>c__DisplayClass51_0", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.SceneContext/Zenject.<>c__DisplayClass51_0.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SceneContext::$$c__DisplayClass51_0::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneContext::$$c__DisplayClass51_0::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SceneContext/<>c__DisplayClass51_0", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.SceneDecoratorContext
#include "Zenject/SceneDecoratorContext.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: Zenject.MonoInstaller
#include "Zenject/MonoInstaller.hpp"
// Including type: Zenject.ScriptableObjectInstaller
#include "Zenject/ScriptableObjectInstaller.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: UnityEngine.MonoBehaviour
#include "UnityEngine/MonoBehaviour.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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.Generic.List`1<Zenject.MonoInstaller> _lateInstallers
::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>*& Zenject::SceneDecoratorContext::dyn__lateInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::dyn__lateInstallers");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lateInstallers"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<Zenject.MonoInstaller> _lateInstallerPrefabs
::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>*& Zenject::SceneDecoratorContext::dyn__lateInstallerPrefabs() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::dyn__lateInstallerPrefabs");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lateInstallerPrefabs"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::Zenject::MonoInstaller*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<Zenject.ScriptableObjectInstaller> _lateScriptableObjectInstallers
::System::Collections::Generic::List_1<::Zenject::ScriptableObjectInstaller*>*& Zenject::SceneDecoratorContext::dyn__lateScriptableObjectInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::dyn__lateScriptableObjectInstallers");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lateScriptableObjectInstallers"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::Zenject::ScriptableObjectInstaller*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.String _decoratedContractName
::StringW& Zenject::SceneDecoratorContext::dyn__decoratedContractName() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::dyn__decoratedContractName");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_decoratedContractName"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.DiContainer _container
::Zenject::DiContainer*& Zenject::SceneDecoratorContext::dyn__container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::dyn__container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Collections.Generic.List`1<UnityEngine.MonoBehaviour> _injectableMonoBehaviours
::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>*& Zenject::SceneDecoratorContext::dyn__injectableMonoBehaviours() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::dyn__injectableMonoBehaviours");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_injectableMonoBehaviours"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.SceneDecoratorContext.get_LateInstallers
::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>* Zenject::SceneDecoratorContext::get_LateInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::get_LateInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_LateInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneDecoratorContext.set_LateInstallers
void Zenject::SceneDecoratorContext::set_LateInstallers(::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::set_LateInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_LateInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneDecoratorContext.get_LateInstallerPrefabs
::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>* Zenject::SceneDecoratorContext::get_LateInstallerPrefabs() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::get_LateInstallerPrefabs");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_LateInstallerPrefabs", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneDecoratorContext.set_LateInstallerPrefabs
void Zenject::SceneDecoratorContext::set_LateInstallerPrefabs(::System::Collections::Generic::IEnumerable_1<::Zenject::MonoInstaller*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::set_LateInstallerPrefabs");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_LateInstallerPrefabs", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneDecoratorContext.get_LateScriptableObjectInstallers
::System::Collections::Generic::IEnumerable_1<::Zenject::ScriptableObjectInstaller*>* Zenject::SceneDecoratorContext::get_LateScriptableObjectInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::get_LateScriptableObjectInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_LateScriptableObjectInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::Zenject::ScriptableObjectInstaller*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneDecoratorContext.set_LateScriptableObjectInstallers
void Zenject::SceneDecoratorContext::set_LateScriptableObjectInstallers(::System::Collections::Generic::IEnumerable_1<::Zenject::ScriptableObjectInstaller*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::set_LateScriptableObjectInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_LateScriptableObjectInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.SceneDecoratorContext.get_DecoratedContractName
::StringW Zenject::SceneDecoratorContext::get_DecoratedContractName() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::get_DecoratedContractName");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DecoratedContractName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneDecoratorContext.Initialize
void Zenject::SceneDecoratorContext::Initialize(::Zenject::DiContainer* container) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::Initialize");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Initialize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(container)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, container);
}
// Autogenerated method: Zenject.SceneDecoratorContext.InstallDecoratorSceneBindings
void Zenject::SceneDecoratorContext::InstallDecoratorSceneBindings() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::InstallDecoratorSceneBindings");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallDecoratorSceneBindings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneDecoratorContext.InstallDecoratorInstallers
void Zenject::SceneDecoratorContext::InstallDecoratorInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::InstallDecoratorInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallDecoratorInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneDecoratorContext.InstallLateDecoratorInstallers
void Zenject::SceneDecoratorContext::InstallLateDecoratorInstallers() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::InstallLateDecoratorInstallers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallLateDecoratorInstallers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneDecoratorContext.get_Container
::Zenject::DiContainer* Zenject::SceneDecoratorContext::get_Container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::get_Container");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneDecoratorContext.GetRootGameObjects
::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>* Zenject::SceneDecoratorContext::GetRootGameObjects() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::GetRootGameObjects");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetRootGameObjects", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::UnityEngine::GameObject*>*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.SceneDecoratorContext.GetInjectableMonoBehaviours
void Zenject::SceneDecoratorContext::GetInjectableMonoBehaviours(::System::Collections::Generic::List_1<::UnityEngine::MonoBehaviour*>* monoBehaviours) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::GetInjectableMonoBehaviours");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetInjectableMonoBehaviours", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(monoBehaviours)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, monoBehaviours);
}
// Autogenerated method: Zenject.SceneDecoratorContext.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::SceneDecoratorContext::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::SceneDecoratorContext::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "SceneDecoratorContext", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.StaticContext
#include "Zenject/StaticContext.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.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 Zenject.DiContainer _container
::Zenject::DiContainer* Zenject::StaticContext::_get__container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::StaticContext::_get__container");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Zenject::DiContainer*>("Zenject", "StaticContext", "_container"));
}
// Autogenerated static field setter
// Set static field: static private Zenject.DiContainer _container
void Zenject::StaticContext::_set__container(::Zenject::DiContainer* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::StaticContext::_set__container");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "StaticContext", "_container", value));
}
// Autogenerated method: Zenject.StaticContext.get_HasContainer
bool Zenject::StaticContext::get_HasContainer() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::StaticContext::get_HasContainer");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "StaticContext", "get_HasContainer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.StaticContext.get_Container
::Zenject::DiContainer* Zenject::StaticContext::get_Container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::StaticContext::get_Container");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "StaticContext", "get_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Zenject.StaticContext.Clear
void Zenject::StaticContext::Clear() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::StaticContext::Clear");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "StaticContext", "Clear", 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: Zenject.IInstaller
#include "Zenject/IInstaller.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Zenject.IInstaller.get_IsEnabled
bool Zenject::IInstaller::get_IsEnabled() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IInstaller::get_IsEnabled");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsEnabled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.IInstaller.InstallBindings
void Zenject::IInstaller::InstallBindings() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::IInstaller::InstallBindings");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallBindings", 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: Zenject.Installer
#include "Zenject/Installer.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Zenject.Installer.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::Installer::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::Installer::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "Installer", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.InstallerBase
#include "Zenject/InstallerBase.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.DiContainer _container
::Zenject::DiContainer*& Zenject::InstallerBase::dyn__container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InstallerBase::dyn__container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.InstallerBase.get_Container
::Zenject::DiContainer* Zenject::InstallerBase::get_Container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InstallerBase::get_Container");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InstallerBase.get_IsEnabled
bool Zenject::InstallerBase::get_IsEnabled() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InstallerBase::get_IsEnabled");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsEnabled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InstallerBase.InstallBindings
void Zenject::InstallerBase::InstallBindings() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InstallerBase::InstallBindings");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallBindings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.InstallerBase.__zenFieldSetter0
void Zenject::InstallerBase::__zenFieldSetter0(::Il2CppObject* P_0, ::Il2CppObject* P_1) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InstallerBase::__zenFieldSetter0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InstallerBase", "__zenFieldSetter0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0), ::il2cpp_utils::ExtractType(P_1)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0, P_1);
}
// Autogenerated method: Zenject.InstallerBase.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::InstallerBase::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::InstallerBase::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "InstallerBase", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.MonoInstaller
#include "Zenject/MonoInstaller.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Zenject.MonoInstaller.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::MonoInstaller::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MonoInstaller::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "MonoInstaller", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.MonoInstallerUtil
#include "Zenject/MonoInstallerUtil.hpp"
// Including type: Zenject.MonoInstallerBase
#include "Zenject/MonoInstallerBase.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.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: Zenject.MonoInstallerBase
#include "Zenject/MonoInstallerBase.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.DiContainer <Container>k__BackingField
::Zenject::DiContainer*& Zenject::MonoInstallerBase::dyn_$Container$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MonoInstallerBase::dyn_$Container$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Container>k__BackingField"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.MonoInstallerBase.get_Container
::Zenject::DiContainer* Zenject::MonoInstallerBase::get_Container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MonoInstallerBase::get_Container");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.MonoInstallerBase.set_Container
void Zenject::MonoInstallerBase::set_Container(::Zenject::DiContainer* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MonoInstallerBase::set_Container");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.MonoInstallerBase.get_IsEnabled
bool Zenject::MonoInstallerBase::get_IsEnabled() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MonoInstallerBase::get_IsEnabled");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsEnabled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.MonoInstallerBase.Start
void Zenject::MonoInstallerBase::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MonoInstallerBase::Start");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.MonoInstallerBase.InstallBindings
void Zenject::MonoInstallerBase::InstallBindings() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MonoInstallerBase::InstallBindings");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallBindings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.MonoInstallerBase.__zenPropertySetter0
void Zenject::MonoInstallerBase::__zenPropertySetter0(::Il2CppObject* P_0, ::Il2CppObject* P_1) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MonoInstallerBase::__zenPropertySetter0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "MonoInstallerBase", "__zenPropertySetter0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0), ::il2cpp_utils::ExtractType(P_1)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0, P_1);
}
// Autogenerated method: Zenject.MonoInstallerBase.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::MonoInstallerBase::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::MonoInstallerBase::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "MonoInstallerBase", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.ScriptableObjectInstaller
#include "Zenject/ScriptableObjectInstaller.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Zenject.ScriptableObjectInstaller.__zenCreate
::Il2CppObject* Zenject::ScriptableObjectInstaller::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScriptableObjectInstaller::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ScriptableObjectInstaller", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.ScriptableObjectInstaller.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::ScriptableObjectInstaller::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScriptableObjectInstaller::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ScriptableObjectInstaller", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.ScriptableObjectInstallerUtil
#include "Zenject/ScriptableObjectInstallerUtil.hpp"
// Including type: Zenject.ScriptableObjectInstallerBase
#include "Zenject/ScriptableObjectInstallerBase.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.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: Zenject.ScriptableObjectInstallerBase
#include "Zenject/ScriptableObjectInstallerBase.hpp"
// Including type: Zenject.DiContainer
#include "Zenject/DiContainer.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 Zenject.DiContainer _container
::Zenject::DiContainer*& Zenject::ScriptableObjectInstallerBase::dyn__container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScriptableObjectInstallerBase::dyn__container");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_container"))->offset;
return *reinterpret_cast<::Zenject::DiContainer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.ScriptableObjectInstallerBase.get_Container
::Zenject::DiContainer* Zenject::ScriptableObjectInstallerBase::get_Container() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScriptableObjectInstallerBase::get_Container");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Container", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::DiContainer*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ScriptableObjectInstallerBase.Zenject.IInstaller.get_IsEnabled
bool Zenject::ScriptableObjectInstallerBase::Zenject_IInstaller_get_IsEnabled() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScriptableObjectInstallerBase::Zenject.IInstaller.get_IsEnabled");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Zenject.IInstaller.get_IsEnabled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ScriptableObjectInstallerBase.InstallBindings
void Zenject::ScriptableObjectInstallerBase::InstallBindings() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScriptableObjectInstallerBase::InstallBindings");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallBindings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ScriptableObjectInstallerBase.__zenCreate
::Il2CppObject* Zenject::ScriptableObjectInstallerBase::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScriptableObjectInstallerBase::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ScriptableObjectInstallerBase", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.ScriptableObjectInstallerBase.__zenFieldSetter0
void Zenject::ScriptableObjectInstallerBase::__zenFieldSetter0(::Il2CppObject* P_0, ::Il2CppObject* P_1) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScriptableObjectInstallerBase::__zenFieldSetter0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ScriptableObjectInstallerBase", "__zenFieldSetter0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0), ::il2cpp_utils::ExtractType(P_1)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0, P_1);
}
// Autogenerated method: Zenject.ScriptableObjectInstallerBase.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::ScriptableObjectInstallerBase::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ScriptableObjectInstallerBase::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ScriptableObjectInstallerBase", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.ZenjectBinding
#include "Zenject/ZenjectBinding.hpp"
// Including type: UnityEngine.Component
#include "UnityEngine/Component.hpp"
// Including type: Zenject.Context
#include "Zenject/Context.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.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 UnityEngine.Component[] _components
::ArrayW<::UnityEngine::Component*>& Zenject::ZenjectBinding::dyn__components() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::dyn__components");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_components"))->offset;
return *reinterpret_cast<::ArrayW<::UnityEngine::Component*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.String _identifier
::StringW& Zenject::ZenjectBinding::dyn__identifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::dyn__identifier");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_identifier"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _useSceneContext
bool& Zenject::ZenjectBinding::dyn__useSceneContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::dyn__useSceneContext");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_useSceneContext"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _ifNotBound
bool& Zenject::ZenjectBinding::dyn__ifNotBound() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::dyn__ifNotBound");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_ifNotBound"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.Context _context
::Zenject::Context*& Zenject::ZenjectBinding::dyn__context() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::dyn__context");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_context"))->offset;
return *reinterpret_cast<::Zenject::Context**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Zenject.ZenjectBinding/Zenject.BindTypes _bindType
::Zenject::ZenjectBinding::BindTypes& Zenject::ZenjectBinding::dyn__bindType() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::dyn__bindType");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bindType"))->offset;
return *reinterpret_cast<::Zenject::ZenjectBinding::BindTypes*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.ZenjectBinding.get_UseSceneContext
bool Zenject::ZenjectBinding::get_UseSceneContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::get_UseSceneContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UseSceneContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ZenjectBinding.get_IfNotBound
bool Zenject::ZenjectBinding::get_IfNotBound() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::get_IfNotBound");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IfNotBound", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ZenjectBinding.get_Context
::Zenject::Context* Zenject::ZenjectBinding::get_Context() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::get_Context");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Context", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::Context*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ZenjectBinding.set_Context
void Zenject::ZenjectBinding::set_Context(::Zenject::Context* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::set_Context");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Context", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.ZenjectBinding.get_Components
::ArrayW<::UnityEngine::Component*> Zenject::ZenjectBinding::get_Components() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::get_Components");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Components", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::UnityEngine::Component*>, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ZenjectBinding.get_Identifier
::StringW Zenject::ZenjectBinding::get_Identifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::get_Identifier");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Identifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ZenjectBinding.get_BindType
::Zenject::ZenjectBinding::BindTypes Zenject::ZenjectBinding::get_BindType() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::get_BindType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_BindType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::ZenjectBinding::BindTypes, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ZenjectBinding.Start
void Zenject::ZenjectBinding::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ZenjectBinding.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::ZenjectBinding::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ZenjectBinding", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Zenject.ZenjectBinding/Zenject.BindTypes
#include "Zenject/ZenjectBinding.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 Zenject.ZenjectBinding/Zenject.BindTypes Self
::Zenject::ZenjectBinding::BindTypes Zenject::ZenjectBinding::BindTypes::_get_Self() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::BindTypes::_get_Self");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Zenject::ZenjectBinding::BindTypes>("Zenject", "ZenjectBinding/BindTypes", "Self"));
}
// Autogenerated static field setter
// Set static field: static public Zenject.ZenjectBinding/Zenject.BindTypes Self
void Zenject::ZenjectBinding::BindTypes::_set_Self(::Zenject::ZenjectBinding::BindTypes value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::BindTypes::_set_Self");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "ZenjectBinding/BindTypes", "Self", value));
}
// Autogenerated static field getter
// Get static field: static public Zenject.ZenjectBinding/Zenject.BindTypes AllInterfaces
::Zenject::ZenjectBinding::BindTypes Zenject::ZenjectBinding::BindTypes::_get_AllInterfaces() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::BindTypes::_get_AllInterfaces");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Zenject::ZenjectBinding::BindTypes>("Zenject", "ZenjectBinding/BindTypes", "AllInterfaces"));
}
// Autogenerated static field setter
// Set static field: static public Zenject.ZenjectBinding/Zenject.BindTypes AllInterfaces
void Zenject::ZenjectBinding::BindTypes::_set_AllInterfaces(::Zenject::ZenjectBinding::BindTypes value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::BindTypes::_set_AllInterfaces");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "ZenjectBinding/BindTypes", "AllInterfaces", value));
}
// Autogenerated static field getter
// Get static field: static public Zenject.ZenjectBinding/Zenject.BindTypes AllInterfacesAndSelf
::Zenject::ZenjectBinding::BindTypes Zenject::ZenjectBinding::BindTypes::_get_AllInterfacesAndSelf() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::BindTypes::_get_AllInterfacesAndSelf");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Zenject::ZenjectBinding::BindTypes>("Zenject", "ZenjectBinding/BindTypes", "AllInterfacesAndSelf"));
}
// Autogenerated static field setter
// Set static field: static public Zenject.ZenjectBinding/Zenject.BindTypes AllInterfacesAndSelf
void Zenject::ZenjectBinding::BindTypes::_set_AllInterfacesAndSelf(::Zenject::ZenjectBinding::BindTypes value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::BindTypes::_set_AllInterfacesAndSelf");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "ZenjectBinding/BindTypes", "AllInterfacesAndSelf", value));
}
// Autogenerated static field getter
// Get static field: static public Zenject.ZenjectBinding/Zenject.BindTypes BaseType
::Zenject::ZenjectBinding::BindTypes Zenject::ZenjectBinding::BindTypes::_get_BaseType() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::BindTypes::_get_BaseType");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Zenject::ZenjectBinding::BindTypes>("Zenject", "ZenjectBinding/BindTypes", "BaseType"));
}
// Autogenerated static field setter
// Set static field: static public Zenject.ZenjectBinding/Zenject.BindTypes BaseType
void Zenject::ZenjectBinding::BindTypes::_set_BaseType(::Zenject::ZenjectBinding::BindTypes value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::BindTypes::_set_BaseType");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Zenject", "ZenjectBinding/BindTypes", "BaseType", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& Zenject::ZenjectBinding::BindTypes::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectBinding::BindTypes::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: Zenject.ZenjectManagersInstaller
#include "Zenject/ZenjectManagersInstaller.hpp"
// Including type: Zenject.InjectTypeInfo
#include "Zenject/InjectTypeInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Zenject.ZenjectManagersInstaller.__zenCreate
::Il2CppObject* Zenject::ZenjectManagersInstaller::__zenCreate(::ArrayW<::Il2CppObject*> P_0) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectManagersInstaller::__zenCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ZenjectManagersInstaller", "__zenCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(P_0)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, P_0);
}
// Autogenerated method: Zenject.ZenjectManagersInstaller.InstallBindings
void Zenject::ZenjectManagersInstaller::InstallBindings() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectManagersInstaller::InstallBindings");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InstallBindings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.ZenjectManagersInstaller.__zenCreateInjectTypeInfo
::Zenject::InjectTypeInfo* Zenject::ZenjectManagersInstaller::__zenCreateInjectTypeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::ZenjectManagersInstaller::__zenCreateInjectTypeInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "ZenjectManagersInstaller", "__zenCreateInjectTypeInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Zenject::InjectTypeInfo*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.BindingId
#include "Zenject/BindingId.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 instance field getter
// Get instance field: private System.Type _type
::System::Type*& Zenject::BindingId::dyn__type() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::dyn__type");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_type"))->offset;
return *reinterpret_cast<::System::Type**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object _identifier
::Il2CppObject*& Zenject::BindingId::dyn__identifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::dyn__identifier");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_identifier"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Zenject.BindingId.get_Type
::System::Type* Zenject::BindingId::get_Type() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::get_Type");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Type", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Type*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.BindingId.set_Type
void Zenject::BindingId::set_Type(::System::Type* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::set_Type");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "set_Type", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.BindingId.get_Identifier
::Il2CppObject* Zenject::BindingId::get_Identifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::get_Identifier");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "get_Identifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: Zenject.BindingId.set_Identifier
void Zenject::BindingId::set_Identifier(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::set_Identifier");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "set_Identifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Zenject.BindingId..ctor
// ABORTED elsewhere. Zenject::BindingId::BindingId(::System::Type* type, ::Il2CppObject* identifier)
// Autogenerated method: Zenject.BindingId.Equals
bool Zenject::BindingId::Equals(::Zenject::BindingId that) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::Equals");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "Equals", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(that)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, that);
}
// Autogenerated method: Zenject.BindingId.ToString
::StringW Zenject::BindingId::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::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: Zenject.BindingId.GetHashCode
int Zenject::BindingId::GetHashCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::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: Zenject.BindingId.Equals
bool Zenject::BindingId::Equals(::Il2CppObject* other) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::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: Zenject.BindingId.op_Equality
bool Zenject::operator ==(const ::Zenject::BindingId& left, const ::Zenject::BindingId& right) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::op_Equality");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "BindingId", "op_Equality", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(left), ::il2cpp_utils::ExtractType(right)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, left, right);
}
// Autogenerated method: Zenject.BindingId.op_Inequality
bool Zenject::operator !=(const ::Zenject::BindingId& left, const ::Zenject::BindingId& right) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingId::op_Inequality");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Zenject", "BindingId", "op_Inequality", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(left), ::il2cpp_utils::ExtractType(right)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, left, right);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: Zenject.BindingCondition
#include "Zenject/BindingCondition.hpp"
// Including type: Zenject.InjectContext
#include "Zenject/InjectContext.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: Zenject.BindingCondition.Invoke
bool Zenject::BindingCondition::Invoke(::Zenject::InjectContext* c) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingCondition::Invoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, c);
}
// Autogenerated method: Zenject.BindingCondition.BeginInvoke
::System::IAsyncResult* Zenject::BindingCondition::BeginInvoke(::Zenject::InjectContext* c, ::System::AsyncCallback* callback, ::Il2CppObject* object) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingCondition::BeginInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, c, callback, object);
}
// Autogenerated method: Zenject.BindingCondition.EndInvoke
bool Zenject::BindingCondition::EndInvoke(::System::IAsyncResult* result) {
static auto ___internal__logger = ::Logger::get().WithContext("::Zenject::BindingCondition::EndInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(result)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, result);
}
| 81.563064 | 477 | 0.779369 | RedBrumbler |
84096a855d6bb313ae7cb6519d30d522f42d0fce | 1,402 | cpp | C++ | aws-cpp-sdk-ecs/source/model/DeploymentCircuitBreaker.cpp | perfectrecall/aws-sdk-cpp | fb8cbebf2fd62720b65aeff841ad2950e73d8ebd | [
"Apache-2.0"
] | 1 | 2022-02-12T08:09:30.000Z | 2022-02-12T08:09:30.000Z | aws-cpp-sdk-ecs/source/model/DeploymentCircuitBreaker.cpp | perfectrecall/aws-sdk-cpp | fb8cbebf2fd62720b65aeff841ad2950e73d8ebd | [
"Apache-2.0"
] | 1 | 2021-10-14T16:57:00.000Z | 2021-10-18T10:47:24.000Z | aws-cpp-sdk-ecs/source/model/DeploymentCircuitBreaker.cpp | ravindra-wagh/aws-sdk-cpp | 7d5ff01b3c3b872f31ca98fb4ce868cd01e97696 | [
"Apache-2.0"
] | 1 | 2021-11-09T11:58:03.000Z | 2021-11-09T11:58:03.000Z | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ecs/model/DeploymentCircuitBreaker.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace ECS
{
namespace Model
{
DeploymentCircuitBreaker::DeploymentCircuitBreaker() :
m_enable(false),
m_enableHasBeenSet(false),
m_rollback(false),
m_rollbackHasBeenSet(false)
{
}
DeploymentCircuitBreaker::DeploymentCircuitBreaker(JsonView jsonValue) :
m_enable(false),
m_enableHasBeenSet(false),
m_rollback(false),
m_rollbackHasBeenSet(false)
{
*this = jsonValue;
}
DeploymentCircuitBreaker& DeploymentCircuitBreaker::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("enable"))
{
m_enable = jsonValue.GetBool("enable");
m_enableHasBeenSet = true;
}
if(jsonValue.ValueExists("rollback"))
{
m_rollback = jsonValue.GetBool("rollback");
m_rollbackHasBeenSet = true;
}
return *this;
}
JsonValue DeploymentCircuitBreaker::Jsonize() const
{
JsonValue payload;
if(m_enableHasBeenSet)
{
payload.WithBool("enable", m_enable);
}
if(m_rollbackHasBeenSet)
{
payload.WithBool("rollback", m_rollback);
}
return payload;
}
} // namespace Model
} // namespace ECS
} // namespace Aws
| 17.746835 | 82 | 0.718973 | perfectrecall |
8409c438c70edcb8e9b50301c0cc9aa89d05cae4 | 658 | cpp | C++ | Lab7(part2)/main.cpp | sdeng006/CS10 | 5eb00d4cda1b1cba8c24eea54b60cd09f8faa1ee | [
"MIT"
] | null | null | null | Lab7(part2)/main.cpp | sdeng006/CS10 | 5eb00d4cda1b1cba8c24eea54b60cd09f8faa1ee | [
"MIT"
] | null | null | null | Lab7(part2)/main.cpp | sdeng006/CS10 | 5eb00d4cda1b1cba8c24eea54b60cd09f8faa1ee | [
"MIT"
] | null | null | null | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
double percentHeads(int times) {
srand(4444);
double numOf0 = 0.0;
int rollresult;
int i = 0;
while ( i < times ) {
rollresult = rand () % 2;
if (rollresult == 0) {
numOf0++;
}
i++;
}
return 100 * numOf0 / times;
}
int main() {
int userInput;
cout << "Enter the number of times you want to toss the coin: ";
cin >> userInput;
cout << endl;
cout <<"Heads came up " << percentHeads(userInput) << "% of the time." << endl;
return 0;
} | 17.315789 | 84 | 0.50304 | sdeng006 |
84111bf66a456cc9b701d044b39ab4fc85fdcade | 4,744 | cpp | C++ | src/Driver.cpp | gavv/libASPL | 3139692c9aef6896b184e4599842f3de9fa479bd | [
"AML",
"MIT"
] | 22 | 2021-07-15T08:31:52.000Z | 2022-01-20T15:13:18.000Z | src/Driver.cpp | gavv/libASPL | 3139692c9aef6896b184e4599842f3de9fa479bd | [
"AML",
"MIT"
] | 1 | 2021-12-19T07:36:15.000Z | 2022-02-02T18:40:29.000Z | src/Driver.cpp | gavv/libASPL | 3139692c9aef6896b184e4599842f3de9fa479bd | [
"AML",
"MIT"
] | 1 | 2022-01-11T16:06:20.000Z | 2022-01-11T16:06:20.000Z | // Copyright (c) libASPL authors
// Licensed under MIT
#include <aspl/Driver.hpp>
#include "Bridge.hpp"
#include <cstddef>
namespace aspl {
Driver::Driver(const std::shared_ptr<Context>& context,
const std::shared_ptr<Plugin>& plugin)
: context_(context ? context : std::make_shared<Context>())
, plugin_(plugin ? plugin : std::make_shared<Plugin>(context_))
{
GetContext()->Tracer->Message("Driver::Driver()");
driverInterfacePointer_ = &driverInterface_;
driverInterface_ = {
// Reserved
nullptr,
// Service methods, handled by driver itself
Driver::QueryInterface,
Driver::AddRef,
Driver::Release,
Driver::Initialize,
Driver::CreateDevice,
Driver::DestroyDevice,
// Methods redirected to objects found in Context::Dispatcher
Bridge::AddClient,
Bridge::RemoveClient,
Bridge::PerformConfigurationChange,
Bridge::AbortConfigurationChange,
Bridge::HasProperty,
Bridge::IsPropertySettable,
Bridge::GetPropertyDataSize,
Bridge::GetPropertyData,
Bridge::SetPropertyData,
Bridge::StartIO,
Bridge::StopIO,
Bridge::GetZeroTimeStamp,
Bridge::WillDoIOOperation,
Bridge::BeginIOOperation,
Bridge::DoIOOperation,
Bridge::EndIOOperation,
};
}
Driver::~Driver()
{
GetContext()->Tracer->Message("Driver::~Driver()");
}
std::shared_ptr<const Context> Driver::GetContext() const
{
return plugin_->GetContext();
}
std::shared_ptr<Plugin> Driver::GetPlugin() const
{
return plugin_;
}
const AudioServerPlugInDriverInterface& Driver::GetPluginInterface() const
{
return driverInterface_;
}
AudioServerPlugInDriverRef Driver::GetReference()
{
return &driverInterfacePointer_;
}
Driver* Driver::GetDriver(AudioServerPlugInDriverRef driverRef)
{
AudioServerPlugInDriverInterface* driverInterface = *driverRef;
return reinterpret_cast<Driver*>(
reinterpret_cast<UInt8*>(driverInterface) - offsetof(Driver, driverInterface_));
}
HRESULT Driver::QueryInterface(void* driverRef, REFIID iid, LPVOID* outInterface)
{
const auto driver =
Driver::GetDriver(reinterpret_cast<AudioServerPlugInDriverRef>(driverRef));
CFUUIDRef interfaceID = CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault, iid);
const bool isSupportedInterface =
CFEqual(interfaceID, IUnknownUUID) ||
CFEqual(interfaceID, kAudioServerPlugInDriverInterfaceUUID);
CFRelease(interfaceID);
if (!isSupportedInterface) {
driver->GetContext()->Tracer->Message("Driver::QueryInterface() E_NOINTERFACE");
return E_NOINTERFACE;
}
*outInterface = driver->GetReference();
const auto counter = ++driver->refCounter_;
driver->GetContext()->Tracer->Message("Driver::QueryInterface() S_OK refCounter=%lu",
static_cast<unsigned long>(counter));
return S_OK;
}
ULONG Driver::AddRef(void* driverRef)
{
const auto driver =
Driver::GetDriver(reinterpret_cast<AudioServerPlugInDriverRef>(driverRef));
const auto counter = ++driver->refCounter_;
driver->GetContext()->Tracer->Message(
"Driver::AddRef() refCounter=%lu", static_cast<unsigned long>(counter));
return counter;
}
ULONG Driver::Release(void* driverRef)
{
const auto driver =
Driver::GetDriver(reinterpret_cast<AudioServerPlugInDriverRef>(driverRef));
const auto counter = --driver->refCounter_;
driver->GetContext()->Tracer->Message(
"Driver::Release() refCounter=%lu", static_cast<unsigned long>(counter));
return counter;
}
OSStatus Driver::Initialize(AudioServerPlugInDriverRef driverRef,
AudioServerPlugInHostRef hostRef)
{
const auto driver = Driver::GetDriver(driverRef);
driver->context_->Host = hostRef;
driver->GetContext()->Tracer->Message("Driver::Initialize()");
return kAudioHardwareNoError;
}
OSStatus Driver::CreateDevice(AudioServerPlugInDriverRef driverRef,
CFDictionaryRef description,
const AudioServerPlugInClientInfo* clientInfo,
AudioObjectID* outDeviceObjectID)
{
const auto driver = Driver::GetDriver(driverRef);
driver->GetContext()->Tracer->Message(
"Driver::CreateDevice() status=kAudioHardwareUnsupportedOperationError");
return kAudioHardwareUnsupportedOperationError;
}
OSStatus Driver::DestroyDevice(AudioServerPlugInDriverRef driverRef,
AudioObjectID objectID)
{
const auto driver = Driver::GetDriver(driverRef);
driver->GetContext()->Tracer->Message(
"Driver::DestroyDevice() status=kAudioHardwareUnsupportedOperationError");
return kAudioHardwareUnsupportedOperationError;
}
} // namespace aspl
| 26.954545 | 89 | 0.708263 | gavv |
8412c967fdc691c43b088f07dba185c6a6407637 | 616 | cpp | C++ | c++/.leetcode/868.binary-gap.cpp | ming197/MyLeetCode | eba575765976b12db07be0857faad85b9c60d723 | [
"Apache-2.0"
] | null | null | null | c++/.leetcode/868.binary-gap.cpp | ming197/MyLeetCode | eba575765976b12db07be0857faad85b9c60d723 | [
"Apache-2.0"
] | null | null | null | c++/.leetcode/868.binary-gap.cpp | ming197/MyLeetCode | eba575765976b12db07be0857faad85b9c60d723 | [
"Apache-2.0"
] | null | null | null | /*
* @lc app=leetcode id=868 lang=cpp
*
* [868] Binary Gap
*/
// @lc code=start
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int binaryGap(int n) {
int l = -1, r = -1;
int i = 0;
int res = 0;
while (n){
/* code */
int bit = n&1;
n >>= 1;
if(bit){
if(l == -1){
l = i;
}else{
res = max(res, i - l);
l = i;
}
}
i++;
}
return res;
}
};
// @lc code=end
| 17.6 | 42 | 0.327922 | ming197 |
841b635a0402031608af9a37f51396c551df7065 | 287 | cpp | C++ | prog_100.cpp | Jairfsj/learning_C | 8c876059132ca19bcf55ac1a0c81d97a3d175e95 | [
"MIT"
] | null | null | null | prog_100.cpp | Jairfsj/learning_C | 8c876059132ca19bcf55ac1a0c81d97a3d175e95 | [
"MIT"
] | null | null | null | prog_100.cpp | Jairfsj/learning_C | 8c876059132ca19bcf55ac1a0c81d97a3d175e95 | [
"MIT"
] | null | null | null | #include <iostream>
using namespace std;
int main()
{
int num,maior,ind;
maior = 0;
for (ind= 1; ind <=100; ind=ind+1)
{
scanf("%d",&num);
if (num > maior)
maior=num;
}
printf ("%d é o maior dos números lidos ",maior);
system ("pause");
return 0;
}
| 11.958333 | 51 | 0.550523 | Jairfsj |
84261eabc5f8ee4bab9f75520df31faf25ac2eeb | 569 | cc | C++ | google_interview_practice/Rotate_Image/solve.cc | ldy121/algorithm | 7939cb4c15e2bc655219c934f00c2bb74ddb4eec | [
"Apache-2.0"
] | 1 | 2020-04-11T22:04:23.000Z | 2020-04-11T22:04:23.000Z | google_interview_practice/Rotate_Image/solve.cc | ldy121/algorithm | 7939cb4c15e2bc655219c934f00c2bb74ddb4eec | [
"Apache-2.0"
] | null | null | null | google_interview_practice/Rotate_Image/solve.cc | ldy121/algorithm | 7939cb4c15e2bc655219c934f00c2bb74ddb4eec | [
"Apache-2.0"
] | null | null | null | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
int len = matrix.size();
for (int i = 0; i < matrix.size() / 2; ++i) {
for (int j = 0; j < len - 1; ++j) {
int tmp = matrix[i][i + j];
matrix[i][i + j] = matrix[i + len - 1 - j][i];
matrix[i + len - 1 - j][i] = matrix[i + len - 1][i + len - 1 - j];
matrix[i + len - 1][i + len - 1 - j] = matrix[i + j][i + len - 1];
matrix[i + j][i + len - 1] = tmp;
}
len -= 2;
}
}
};
| 29.947368 | 82 | 0.383128 | ldy121 |
842933e06b74aedab6b790190a14e71dec7c6831 | 2,844 | hh | C++ | packages/spatial/Weak_Spatial_Discretization_Factory.hh | brbass/ibex | 5a4cc5b4d6d46430d9667970f8a34f37177953d4 | [
"MIT"
] | 2 | 2020-04-13T20:06:41.000Z | 2021-02-12T17:55:54.000Z | packages/spatial/Weak_Spatial_Discretization_Factory.hh | brbass/ibex | 5a4cc5b4d6d46430d9667970f8a34f37177953d4 | [
"MIT"
] | 1 | 2018-10-22T21:03:35.000Z | 2018-10-22T21:03:35.000Z | packages/spatial/Weak_Spatial_Discretization_Factory.hh | brbass/ibex | 5a4cc5b4d6d46430d9667970f8a34f37177953d4 | [
"MIT"
] | 3 | 2019-04-03T02:15:37.000Z | 2022-01-04T05:50:23.000Z | #ifndef Weak_Spatial_Discretization_Factory_hh
#define Weak_Spatial_Discretization_Factory_hh
#include <memory>
#include <string>
#include <vector>
#include "Meshless_Function_Factory.hh"
class Basis_Function;
class Cartesian_Plane;
class Dimensional_Moments;
class KD_Tree;
class Meshless_Function;
class Solid_Geometry;
class Weak_Spatial_Discretization;
class Weak_Spatial_Discretization_Options;
class Weight_Function;
class Weight_Function_Options;
class Weak_Spatial_Discretization_Factory
{
public:
// Constructor
Weak_Spatial_Discretization_Factory(std::shared_ptr<Solid_Geometry> solid_geometry,
std::vector<std::shared_ptr<Cartesian_Plane> > const &boundary_surfaces);
// Get basis functions
void get_basis_functions(int number_of_points,
std::vector<std::shared_ptr<Meshless_Function> > const &functions,
std::vector<std::shared_ptr<Basis_Function> > &bases) const;
// Get weight functions
void get_weight_functions(int number_of_points,
std::shared_ptr<Weight_Function_Options> weight_options,
std::shared_ptr<Weak_Spatial_Discretization_Options> weak_options,
std::shared_ptr<Dimensional_Moments> dimensional_moments,
std::vector<std::vector<int> > const &neighbors,
std::vector<std::shared_ptr<Meshless_Function> > const &functions,
std::vector<std::shared_ptr<Basis_Function> > const &bases,
std::vector<std::shared_ptr<Weight_Function> > &weights) const;
// Get a spatial discretization with constant radii
std::shared_ptr<Weak_Spatial_Discretization> get_simple_discretization(int num_dimensional_points,
double radius_num_intervals,
bool basis_mls,
bool weight_mls,
std::string basis_type,
std::string weight_type,
std::shared_ptr<Weight_Function_Options> weight_options,
std::shared_ptr<Weak_Spatial_Discretization_Options> weak_options) const;
private:
std::shared_ptr<Solid_Geometry> solid_geometry_;
std::vector<std::shared_ptr<Cartesian_Plane> > boundary_surfaces_;
Meshless_Function_Factory meshless_factory_;
};
#endif
| 45.870968 | 148 | 0.577356 | brbass |
8431347f2fff6c2667f3859dbb7968210e7322df | 1,540 | hpp | C++ | test/analysis/TransactionAssignerTest.hpp | vimofthevine/UnderBudget | 5711be8e5da3cb7a78da007fe43cf1ce1b796493 | [
"Apache-2.0"
] | 2 | 2016-07-17T02:12:44.000Z | 2016-11-22T14:04:55.000Z | test/analysis/TransactionAssignerTest.hpp | vimofthevine/UnderBudget | 5711be8e5da3cb7a78da007fe43cf1ce1b796493 | [
"Apache-2.0"
] | null | null | null | test/analysis/TransactionAssignerTest.hpp | vimofthevine/UnderBudget | 5711be8e5da3cb7a78da007fe43cf1ce1b796493 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2013 Kyle Treubig
*
* 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.
*/
#ifndef TRANSACTIONASSIGNERTEST_HPP
#define TRANSACTIONASSIGNERTEST_HPP
// Qt include(s)
#include <QtTest/QtTest>
namespace ub {
/**
* Unit tests for the TransactionAssigner class.
*/
class TransactionAssignerTest : public QObject
{
Q_OBJECT
private slots:
/**
* Tests the acruing of actual values as a result of
* transaction assignment.
*/
void actualsFromAssignment();
/**
* Test data for testing actual values from assignment.
*/
void actualsFromAssignment_data();
/**
* Tests the estimate associations as a result of
* transaction assignment.
*/
void estimateAssociation();
/**
* Test data for testing estimate association.
*/
void estimateAssociation_data();
/**
* Tests the rule associations as a result of
* transaction assignment.
*/
void ruleAssociation();
/**
* Test data for testing rule association.
*/
void ruleAssociation_data();
};
}
#endif //TRANSACTIONASSIGNERTEST_HPP
| 22 | 75 | 0.725974 | vimofthevine |
8433554f80fb68523c45436132e4fb88c8de246c | 1,148 | hpp | C++ | src/cpp/bron-kerbosch.hpp | adshidtadka/server-allocation | ce533ce31cc2ce12f0c6a01bff97be3875e35b30 | [
"MIT"
] | null | null | null | src/cpp/bron-kerbosch.hpp | adshidtadka/server-allocation | ce533ce31cc2ce12f0c6a01bff97be3875e35b30 | [
"MIT"
] | 1 | 2019-10-01T08:12:20.000Z | 2019-10-01T09:29:36.000Z | src/cpp/bron-kerbosch.hpp | adshidtadka/server-allocation | ce533ce31cc2ce12f0c6a01bff97be3875e35b30 | [
"MIT"
] | null | null | null | #ifndef BRON_KERBOSCH_H
#define BRON_KERBOSCH_H
#include <algorithm>
#include <forward_list>
#include <functional>
#include <unordered_set>
namespace BronKerbosch {
template <typename T>
struct Vertex {
Vertex(const T id) : id{id} {}
bool operator==(const Vertex& other) const { return this->id == other.id; }
T id;
std::unordered_set<T> ns;
};
template <typename T>
using Graph = std::forward_list<Vertex<T> >;
template <typename T>
using Clique = Graph<T>;
template <typename T>
void solve(Graph<T> R, Graph<T> P, Graph<T> X,
std::function<void(Graph<T>, Graph<T>, Graph<T>)> act) {
if (P.empty() && X.empty()) {
act(R, P, X);
return;
}
while (!P.empty()) {
auto Ri = R;
auto Pi = P;
auto Xi = X;
const auto v = P.front();
Ri.push_front(v);
Pi.remove_if([&v](const Vertex<T>& p) { return !v.ns.count(p.id); });
Xi.remove_if([&v](const Vertex<T>& x) { return !v.ns.count(x.id); });
solve<T>(Ri, Pi, Xi, act);
P.remove(v);
X.push_front(v);
}
}
} // namespace BronKerbosch
#endif // BRON_KERBOSCH_H
| 22.96 | 79 | 0.582753 | adshidtadka |
8435427afd0429ea8703140438712324ebf5556d | 463 | cpp | C++ | 914. X of a Kind in a Deck of Cards.cpp | rajeev-ranjan-au6/Leetcode_Cpp | f64cd98ab96ec110f1c21393f418acf7d88473e8 | [
"MIT"
] | 3 | 2020-12-30T00:29:59.000Z | 2021-01-24T22:43:04.000Z | 914. X of a Kind in a Deck of Cards.cpp | rajeevranjancom/Leetcode_Cpp | f64cd98ab96ec110f1c21393f418acf7d88473e8 | [
"MIT"
] | null | null | null | 914. X of a Kind in a Deck of Cards.cpp | rajeevranjancom/Leetcode_Cpp | f64cd98ab96ec110f1c21393f418acf7d88473e8 | [
"MIT"
] | null | null | null | class Solution {
public:
bool hasGroupsSizeX(vector<int>& deck) {
unordered_map<int, int>m;
int n = deck.size();
for (int i = 0; i < n; ++i) {
m[deck[i]]++;
}
int base = 0;
for (auto& p: m) {
base = gcd(p.second, base);
}
return base > 1;
}
int gcd(int a, int b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
};
| 20.130435 | 44 | 0.393089 | rajeev-ranjan-au6 |
8438fcddbae1bc436d46253f1916b26068e009db | 1,922 | cpp | C++ | modules/boost/simd/sdk/unit/memory/utility/aligned_malloc.cpp | psiha/nt2 | 5e829807f6b57b339ca1be918a6b60a2507c54d0 | [
"BSL-1.0"
] | 34 | 2017-05-19T18:10:17.000Z | 2022-01-04T02:18:13.000Z | modules/boost/simd/sdk/unit/memory/utility/aligned_malloc.cpp | psiha/nt2 | 5e829807f6b57b339ca1be918a6b60a2507c54d0 | [
"BSL-1.0"
] | null | null | null | modules/boost/simd/sdk/unit/memory/utility/aligned_malloc.cpp | psiha/nt2 | 5e829807f6b57b339ca1be918a6b60a2507c54d0 | [
"BSL-1.0"
] | 7 | 2017-12-02T12:59:17.000Z | 2021-07-31T12:46:14.000Z | //==============================================================================
// Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2011 LRI UMR 8623 CNRS/Univ Paris Sud XI
// Copyright 2012 - 2013 MetaScale SAS
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//==============================================================================
#include <boost/simd/memory/aligned_malloc.hpp>
#include <boost/simd/memory/aligned_free.hpp>
#include <boost/simd/memory/is_aligned.hpp>
#include <nt2/sdk/unit/module.hpp>
#include <nt2/sdk/unit/tests/basic.hpp>
#include <nt2/sdk/unit/tests/relation.hpp>
static bool had_malloc;
static bool had_free;
static std::size_t malloc_size;
static void* stateful_malloc(std::size_t sz)
{
had_malloc = true;
malloc_size = sz;
return std::malloc(sz);
}
static void stateful_free(void* ptr, std::size_t)
{
had_free = true;
return std::free(ptr);
}
static void reset_status()
{
had_free = false;
had_malloc = false;
malloc_size = 0;
}
//==============================================================================
// Test allocating and deallocating
//==============================================================================
NT2_TEST_CASE(aligned_malloc)
{
using boost::simd::aligned_malloc;
using boost::simd::aligned_free;
using boost::simd::is_aligned;
reset_status();
char* ptr = 0;
NT2_TEST
( is_aligned(ptr = static_cast<char*>(aligned_malloc(5,8, stateful_malloc)),8) );
NT2_TEST( had_malloc );
NT2_TEST_GREATER_EQUAL( malloc_size, 5u );
for(int i=0;i<5;++i) ptr[i] = 10*i;
for(int i=0;i<5;++i) NT2_TEST_EQUAL(ptr[i],10*i);
aligned_free( ptr, stateful_free );
NT2_TEST( had_free );
}
| 28.686567 | 83 | 0.560874 | psiha |
843a543c0d76647d46aafee93ba05a7c902d0f3c | 899 | hpp | C++ | include/tracer/bits/unsafe.hpp | stdml/stdtracer | e7ee9fb5168e31a75b53360b94dfdeaac4d51e4b | [
"MIT"
] | 2 | 2018-09-30T14:51:37.000Z | 2020-01-26T02:28:47.000Z | include/tracer/bits/unsafe.hpp | lgarithm/stdtracer | e7ee9fb5168e31a75b53360b94dfdeaac4d51e4b | [
"MIT"
] | 7 | 2018-09-30T06:11:44.000Z | 2020-02-16T14:18:50.000Z | include/tracer/bits/unsafe.hpp | stdml/stdtracer | e7ee9fb5168e31a75b53360b94dfdeaac4d51e4b | [
"MIT"
] | 1 | 2019-10-08T00:26:41.000Z | 2019-10-08T00:26:41.000Z | #pragma once
#include <iostream>
#include <string>
class unsafe_guard_t
{
std::string file_;
int line_;
std::string hint_;
public:
unsafe_guard_t(std::string file, int line, std::string hint)
: file_(std::move(file)), line_(line), hint_(std::move(hint))
{
}
std::string msg() const
{
return hint_ + " @ " + file_ + ':' + std::to_string(line_);
}
template <typename F>
decltype(auto) operator()(const F &f) const
{
try {
return f();
} catch (const std::invalid_argument &ex) {
std::cerr << ex.what() << std::endl;
throw std::runtime_error(msg());
} catch (const std::runtime_error &ex) {
std::cerr << ex.what() << std::endl;
throw std::runtime_error(msg());
} catch (...) {
throw std::runtime_error(msg());
}
}
};
| 23.657895 | 69 | 0.525028 | stdml |
843d16e23aa4adeca539a65d58c7b64acaf76883 | 362 | hpp | C++ | NWNXLib/API/Mac/API/Plane.hpp | acaos/nwnxee-unified | 0e4c318ede64028c1825319f39c012e168e0482c | [
"MIT"
] | 1 | 2019-06-04T04:30:24.000Z | 2019-06-04T04:30:24.000Z | NWNXLib/API/Mac/API/Plane.hpp | presscad/nwnee | 0f36b281524e0b7e9796bcf30f924792bf9b8a38 | [
"MIT"
] | null | null | null | NWNXLib/API/Mac/API/Plane.hpp | presscad/nwnee | 0f36b281524e0b7e9796bcf30f924792bf9b8a38 | [
"MIT"
] | 1 | 2019-10-20T07:54:45.000Z | 2019-10-20T07:54:45.000Z | #pragma once
#include <cstdint>
#include "Vector.hpp"
namespace NWNXLib {
namespace API {
// Forward class declarations (defined in the source file)
struct Quaternion;
struct Plane
{
Vector normal;
float dist;
void Transform(const Vector&, const Quaternion&);
};
void Plane__Transform(Plane* thisPtr, const Vector&, const Quaternion&);
}
}
| 13.407407 | 72 | 0.71547 | acaos |
84483e18280c2ca3bf9bdf73762514e2853d3b8b | 3,150 | cpp | C++ | Source/MellowsMegaRide/Private/FollowerSpawner.cpp | Reuapmok/MellowsMegaRide | 89f0f0fc834db5b04c790e87108b9393c3c65021 | [
"MIT"
] | null | null | null | Source/MellowsMegaRide/Private/FollowerSpawner.cpp | Reuapmok/MellowsMegaRide | 89f0f0fc834db5b04c790e87108b9393c3c65021 | [
"MIT"
] | null | null | null | Source/MellowsMegaRide/Private/FollowerSpawner.cpp | Reuapmok/MellowsMegaRide | 89f0f0fc834db5b04c790e87108b9393c3c65021 | [
"MIT"
] | null | null | null | // Fill out your copyright notice in the Description page of Project Settings.
#include "FollowerSpawner.h"
#include "UObject/ConstructorHelpers.h"
#include "Components/StaticMeshComponent.h"
#include "FollowingActor.h"
#include "Engine/World.h"
#define COLLISION_PICKUP ECC_GameTraceChannel2
// Sets default values
AFollowerSpawner::AFollowerSpawner()
{
PrimaryActorTick.bCanEverTick = true;
this->SetActorHiddenInGame(true);
this->bReplicates = true;
NetUpdateFrequency = 10.f;
MinNetUpdateFrequency = 5.f;
NetPriority = 5;
struct FConstructorStatics
{
ConstructorHelpers::FObjectFinderOptional<UStaticMesh> Mesh;
FConstructorStatics() : Mesh(TEXT("StaticMesh'/Game/Challenges/DuckChallenge/SM_Editor_SphereSpawner.SM_Editor_SphereSpawner'")) {}
}ConstructorStatics;
EditorSphere = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Editor"));
EditorSphere->SetStaticMesh(ConstructorStatics.Mesh.Get());
EditorSphere->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
EditorSphere->SetCollisionObjectType(COLLISION_PICKUP);
EditorSphere->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);
EditorSphere->SetCollisionResponseToChannel(COLLISION_PICKUP, ECollisionResponse::ECR_Overlap);
RootComponent = EditorSphere;
SetActorTickInterval(1.f);
}
void AFollowerSpawner::SpawnSphere()
{
if (GetNetMode() == ENetMode::NM_DedicatedServer)
{
FActorSpawnParameters SpawnParams = FActorSpawnParameters();
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::DontSpawnIfColliding;
SpawnParams.Owner = this;
AFollowingActor* actor = GetWorld()->SpawnActor<AFollowingActor>(AFollowingActor::StaticClass(), this->GetActorTransform(), SpawnParams);
if (actor)
{
//UE_LOG(LogTemp, Log, TEXT("Spawner with index: %d"), index);
bIsOccupied = true;
actor->Value = this->SphereValue;
actor->OwningSpawner = this;
actor->Multi_SetTickEnabled(true);
ForceNetUpdate();
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Did not spawn Sphere"));
}
}
}
void AFollowerSpawner::BeginPlay()
{
Super::BeginPlay();
}
void AFollowerSpawner::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
TArray<AActor*> OverlappingActors;
if (GetNetMode() == ENetMode::NM_DedicatedServer)
{
if (bIsOccupied)
{
EditorSphere->GetOverlappingActors(OverlappingActors, AFollowingActor::StaticClass());
if (OverlappingActors.Num() == 0)
{
UE_LOG(LogTemp, Error, TEXT("Follower Spawner should be occupied (no overlap) with index: %d"), this->index);
bIsOccupied = false;
}
else
{
bool bHasRightOverlappedActor = false;
for (size_t i = 0; i < OverlappingActors.Num(); i++)
{
AFollowingActor* overlappedFollower = Cast<AFollowingActor>(OverlappingActors[i]);
if (overlappedFollower)
{
if (overlappedFollower->OwningSpawner == this)
{
bHasRightOverlappedActor = true;
}
}
}
if (!bHasRightOverlappedActor)
{
UE_LOG(LogTemp, Error, TEXT("Follower Spawner should be occupied (with overlap) with index: %d"), this->index);
bIsOccupied = false;
}
}
}
}
}
| 26.694915 | 139 | 0.739365 | Reuapmok |
e0fa22cbc37cb6b118da1419f8273ce59c6c882d | 1,703 | hpp | C++ | Engine/Header/Physics/CBoxCollider.hpp | Aredhele/OOM-Engine | e52f706d17f1867f575a85ba5b87b4cc34a7fa97 | [
"MIT"
] | 9 | 2018-07-21T00:30:35.000Z | 2021-09-04T02:54:11.000Z | Engine/Header/Physics/CBoxCollider.hpp | Aredhele/OOM-Engine | e52f706d17f1867f575a85ba5b87b4cc34a7fa97 | [
"MIT"
] | null | null | null | Engine/Header/Physics/CBoxCollider.hpp | Aredhele/OOM-Engine | e52f706d17f1867f575a85ba5b87b4cc34a7fa97 | [
"MIT"
] | 1 | 2021-12-03T14:12:41.000Z | 2021-12-03T14:12:41.000Z | /// \file CBoxCollider.hpp
/// \date 01/08/2018
/// \project OOM-Engine
/// \package Physics
/// \author Vincent STEHLY--CALISTO
#ifndef OOM_ENGINE_C_BOX_COLLIDER_HPP__
#define OOM_ENGINE_C_BOX_COLLIDER_HPP__
#include "Composite/IComponent.hpp"
// Forward declaration
struct q3Box;
namespace Oom
{
class CBoxCollider : public IComponent
{
public:
// Box collider
void SetSensor (const bool sensor);
void SetDensity (const float density);
void SetFriction (const float friction);
void SetRestitution (const float restitution);
void SetExtent (const glm::vec3& extent);
void SetLocalPosition (const glm::vec3& position);
void SetLocalOrientation (const glm::vec3& orientation);
bool IsSensor () const;
float GetDensity () const;
float GetFriction () const;
float GetRestution () const;
const glm::vec3& GetExtent () const;
const glm::vec3& GetLocalPosition () const;
const glm::vec3& GetLocalOrientation () const;
// Component
void OnEnable () final;
void OnDisable () final;
protected:
void _Register () final;
void _Destroy () final;
private:
friend class CRigidBody;
void OnBodyAttached ();
void RemoveBoxHandle ();
void CreateBox ();
void DestroyBox ();
private:
const q3Box* mp_box = nullptr;
bool m_sensor;
float m_density;
float m_friction;
float m_restitution;
glm::vec3 m_extent;
glm::vec3 m_local_position;
glm::vec3 m_local_orientation;
};
}
#endif // !OOM_ENGINE_C_BOX_COLLIDER_HPP__ | 23.985915 | 57 | 0.630065 | Aredhele |
e0fa8eb74bfd60aa2faefadf7777470a933deb45 | 24,466 | cpp | C++ | ext/cache/backend/mongo.cpp | unisys12/phalcon-hhvm | ceeabc4f8d2e51b7cae9d0e100bb4055affe65bf | [
"BSD-2-Clause"
] | 13 | 2015-01-10T23:34:25.000Z | 2017-08-25T15:16:29.000Z | ext/cache/backend/mongo.cpp | unisys12/phalcon-hhvm | ceeabc4f8d2e51b7cae9d0e100bb4055affe65bf | [
"BSD-2-Clause"
] | 1 | 2015-04-14T06:47:20.000Z | 2015-10-02T04:07:34.000Z | ext/cache/backend/mongo.cpp | unisys12/phalcon-hhvm | ceeabc4f8d2e51b7cae9d0e100bb4055affe65bf | [
"BSD-2-Clause"
] | null | null | null |
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2014 Phalcon Team (http://www.phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to license@phalconphp.com so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Andres Gutierrez <andres@phalconphp.com> |
| Eduar Carvajal <eduar@phalconphp.com> |
+------------------------------------------------------------------------+
*/
#include "cache/backend/mongo.h"
#include "cache/backend.h"
#include "cache/backendinterface.h"
#include "cache/exception.h"
#include <ext/standard/php_rand.h>
#include "kernel/main.h"
#include "kernel/memory.h"
#include "kernel/array.h"
#include "kernel/exception.h"
#include "kernel/fcall.h"
#include "kernel/object.h"
#include "kernel/concat.h"
#include "kernel/operators.h"
/**
* Phalcon\Cache\Backend\Mongo
*
* Allows to cache output fragments, PHP data or raw data to a MongoDb backend
*
*<code>
*
* // Cache data for 2 days
* $frontCache = new Phalcon\Cache\Frontend\Base64(array(
* "lifetime" => 172800
* ));
*
* //Create a MongoDB cache
* $cache = new Phalcon\Cache\Backend\Mongo($frontCache, array(
* 'server' => "mongodb://localhost",
* 'db' => 'caches',
* 'collection' => 'images'
* ));
*
* //Cache arbitrary data
* $cache->save('my-data', file_get_contents('some-image.jpg'));
*
* //Get data
* $data = $cache->get('my-data');
*
*</code>
*/
zend_class_entry *phalcon_cache_backend_mongo_ce;
PHP_METHOD(Phalcon_Cache_Backend_Mongo, __construct);
PHP_METHOD(Phalcon_Cache_Backend_Mongo, _getCollection);
PHP_METHOD(Phalcon_Cache_Backend_Mongo, get);
PHP_METHOD(Phalcon_Cache_Backend_Mongo, save);
PHP_METHOD(Phalcon_Cache_Backend_Mongo, delete);
PHP_METHOD(Phalcon_Cache_Backend_Mongo, queryKeys);
PHP_METHOD(Phalcon_Cache_Backend_Mongo, exists);
PHP_METHOD(Phalcon_Cache_Backend_Mongo, gc);
PHP_METHOD(Phalcon_Cache_Backend_Mongo, increment);
PHP_METHOD(Phalcon_Cache_Backend_Mongo, decrement);
PHP_METHOD(Phalcon_Cache_Backend_Mongo, flush);
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_mongo___construct, 0, 0, 1)
ZEND_ARG_INFO(0, frontend)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_mongo_empty, 0, 0, 0)
ZEND_END_ARG_INFO()
static const zend_function_entry phalcon_cache_backend_mongo_method_entry[] = {
PHP_ME(Phalcon_Cache_Backend_Mongo, __construct, arginfo_phalcon_cache_backend_mongo___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME(Phalcon_Cache_Backend_Mongo, _getCollection, NULL, ZEND_ACC_PROTECTED)
PHP_ME(Phalcon_Cache_Backend_Mongo, get, arginfo_phalcon_cache_backendinterface_get, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Backend_Mongo, save, arginfo_phalcon_cache_backendinterface_save, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Backend_Mongo, delete, arginfo_phalcon_cache_backendinterface_delete, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Backend_Mongo, queryKeys, arginfo_phalcon_cache_backendinterface_querykeys, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Backend_Mongo, exists, arginfo_phalcon_cache_backendinterface_exists, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Backend_Mongo, gc, arginfo_phalcon_cache_backend_mongo_empty, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Backend_Mongo, increment, arginfo_phalcon_cache_backendinterface_increment, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Backend_Mongo, decrement, arginfo_phalcon_cache_backendinterface_decrement, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Backend_Mongo, flush, arginfo_phalcon_cache_backend_mongo_empty, ZEND_ACC_PUBLIC)
PHP_FE_END
};
/**
* Phalcon\Cache\Backend\Mongo initializer
*/
PHALCON_INIT_CLASS(Phalcon_Cache_Backend_Mongo){
PHALCON_REGISTER_CLASS_EX(Phalcon\\Cache\\Backend, Mongo, cache_backend_mongo, phalcon_cache_backend_ce, phalcon_cache_backend_mongo_method_entry, 0);
zend_declare_property_null(phalcon_cache_backend_mongo_ce, SL("_collection"), ZEND_ACC_PROTECTED TSRMLS_CC);
zend_class_implements(phalcon_cache_backend_mongo_ce TSRMLS_CC, 1, phalcon_cache_backendinterface_ce);
return SUCCESS;
}
/**
* Phalcon\Cache\Backend\Mongo constructor
*
* @param Phalcon\Cache\FrontendInterface $frontend
* @param array $options
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, __construct){
zval *frontend, *options = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 1, &frontend, &options);
if (!options) {
options = PHALCON_GLOBAL(z_null);
}
if (!phalcon_array_isset_string(options, SS("mongo"))) {
if (!phalcon_array_isset_string(options, SS("server"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The parameter 'server' is required");
return;
}
}
if (!phalcon_array_isset_string(options, SS("db"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The parameter 'db' is required");
return;
}
if (!phalcon_array_isset_string(options, SS("collection"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The parameter 'collection' is required");
return;
}
PHALCON_CALL_PARENT(NULL, phalcon_cache_backend_mongo_ce, this_ptr, "__construct", frontend, options);
PHALCON_MM_RESTORE();
}
/**
* Returns a MongoDb collection based on the backend parameters
*
* @return MongoCollection
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, _getCollection){
zval *mongo_collection, *mongo_database = NULL;
zend_class_entry *ce0;
PHALCON_MM_GROW();
mongo_collection = phalcon_fetch_nproperty_this(this_ptr, SL("_collection"), PH_NOISY TSRMLS_CC);
if (Z_TYPE_P(mongo_collection) != IS_OBJECT) {
zval *options, *mongo;
zval *server = NULL, *database = NULL, *collection = NULL;
options = phalcon_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY TSRMLS_CC);
/**
* If mongo is defined a valid Mongo object must be passed
*/
if (phalcon_array_isset_string_fetch(&mongo, options, SS("mongo"))) {
if (Z_TYPE_P(mongo) != IS_OBJECT) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The 'mongo' parameter must be a valid Mongo instance");
return;
}
} else {
/**
* Server must be defined otherwise
*/
phalcon_array_isset_string_fetch(&server, options, SS("server"));
if (!server || Z_TYPE_P(server) != IS_STRING) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The backend requires a valid MongoDB connection string");
return;
}
ce0 = zend_fetch_class(SL("MongoClient"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
PHALCON_INIT_VAR(mongo);
object_init_ex(mongo, ce0);
assert(phalcon_has_constructor(mongo TSRMLS_CC));
PHALCON_CALL_METHOD(NULL, mongo, "__construct", server);
}
/**
* Check if the database name is a string
*/
phalcon_array_isset_string_fetch(&database, options, SS("db"));
if (!database || Z_TYPE_P(database) != IS_STRING) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The backend requires a valid MongoDB db");
return;
}
/**
* Retrieve the connection name
*/
phalcon_array_isset_string_fetch(&collection, options, SS("collection"));
if (!collection || Z_TYPE_P(collection) != IS_STRING) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The backend requires a valid MongoDB collection");
return;
}
/**
* Make the connection and get the collection
*/
PHALCON_CALL_METHOD(&mongo_database, mongo, "selectdb", database);
PHALCON_RETURN_CALL_METHOD(mongo_database, "selectcollection", collection);
}
else {
RETVAL_ZVAL(mongo_collection, 1, 0);
}
PHALCON_MM_RESTORE();
}
/**
* Returns a cached content
*
* @param int|string $keyName
* @param long $lifetime
* @return mixed
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, get){
zval *key_name, *lifetime = NULL, *frontend, *prefix, *prefixed_key;
zval *collection = NULL, *conditions, *document = NULL, *time_condition;
zval *cached_content;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 1, &key_name, &lifetime);
frontend = phalcon_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY TSRMLS_CC);
prefix = phalcon_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY TSRMLS_CC);
PHALCON_INIT_VAR(prefixed_key);
PHALCON_CONCAT_VV(prefixed_key, prefix, key_name);
phalcon_update_property_this(this_ptr, SL("_lastKey"), prefixed_key TSRMLS_CC);
PHALCON_CALL_METHOD(&collection, this_ptr, "_getcollection");
PHALCON_INIT_VAR(conditions);
array_init_size(conditions, 2);
phalcon_array_update_string(&conditions, SL("key"), prefixed_key, PH_COPY);
MAKE_STD_ZVAL(time_condition);
array_init_size(time_condition, 1);
add_assoc_long_ex(time_condition, SS("$gt"), (long int)time(NULL));
add_assoc_zval_ex(conditions, SS("time"), time_condition);
PHALCON_CALL_METHOD(&document, collection, "findone", conditions);
if (Z_TYPE_P(document) == IS_ARRAY) {
if (likely(phalcon_array_isset_string_fetch(&cached_content, document, SS("data")))) {
if (phalcon_is_numeric(cached_content)) {
RETURN_CCTOR(cached_content);
} else {
PHALCON_RETURN_CALL_METHOD(frontend, "afterretrieve", cached_content);
RETURN_MM();
}
} else {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The cache is corrupt");
return;
}
} else {
RETURN_MM_NULL();
}
}
/**
* Stores cached content into the Mongo backend and stops the frontend
*
* @param int|string $keyName
* @param string $content
* @param long $lifetime
* @param boolean $stopBuffer
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, save){
zval *key_name = NULL, *content = NULL, *lifetime = NULL, *stop_buffer = NULL;
zval *last_key, *frontend, *cached_content = NULL;
zval *prepared_content = NULL, *ttl = NULL, *collection = NULL, *timestamp;
zval *conditions, *document = NULL, *data, *is_buffering = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 0, 4, &key_name, &content, &lifetime, &stop_buffer);
if (!key_name || Z_TYPE_P(key_name) == IS_NULL) {
last_key = phalcon_fetch_nproperty_this(this_ptr, SL("_lastKey"), PH_NOISY TSRMLS_CC);
} else {
zval *prefix = phalcon_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY TSRMLS_CC);
PHALCON_INIT_VAR(last_key);
PHALCON_CONCAT_VV(last_key, prefix, key_name);
}
if (!zend_is_true(last_key)) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The cache must be started first");
return;
}
frontend = phalcon_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY TSRMLS_CC);
if (!content || Z_TYPE_P(content) == IS_NULL) {
PHALCON_CALL_METHOD(&cached_content, frontend, "getcontent");
} else {
cached_content = content;
}
if (!phalcon_is_numeric(cached_content)) {
PHALCON_CALL_METHOD(&prepared_content, frontend, "beforestore", cached_content);
}
if (!lifetime || Z_TYPE_P(lifetime) == IS_NULL) {
zval *tmp = phalcon_fetch_nproperty_this(this_ptr, SL("_lastLifetime"), PH_NOISY TSRMLS_CC);
if (Z_TYPE_P(tmp) == IS_NULL) {
PHALCON_CALL_METHOD(&ttl, frontend, "getlifetime");
}
else {
ttl = tmp;
}
} else {
ttl = lifetime;
}
PHALCON_CALL_METHOD(&collection, this_ptr, "_getcollection");
PHALCON_INIT_VAR(timestamp);
ZVAL_LONG(timestamp, (long) time(NULL) + phalcon_get_intval(ttl));
PHALCON_INIT_VAR(conditions);
array_init_size(conditions, 1);
phalcon_array_update_string(&conditions, SL("key"), last_key, PH_COPY);
PHALCON_CALL_METHOD(&document, collection, "findone", conditions);
if (Z_TYPE_P(document) == IS_ARRAY) {
phalcon_array_update_string(&document, SL("time"), timestamp, PH_COPY);
if (prepared_content) {
phalcon_array_update_string(&document, SL("data"), prepared_content, PH_COPY);
} else {
phalcon_array_update_string(&document, SL("data"), cached_content, PH_COPY);
}
PHALCON_CALL_METHOD(NULL, collection, "save", document);
} else {
PHALCON_INIT_VAR(data);
array_init_size(data, 3);
phalcon_array_update_string(&data, SL("key"), last_key, PH_COPY);
phalcon_array_update_string(&data, SL("time"), timestamp, PH_COPY);
if (prepared_content) {
phalcon_array_update_string(&data, SL("data"), prepared_content, PH_COPY);
} else {
phalcon_array_update_string(&data, SL("data"), cached_content, PH_COPY);
}
PHALCON_CALL_METHOD(NULL, collection, "save", data);
}
PHALCON_CALL_METHOD(&is_buffering, frontend, "isbuffering");
if (!stop_buffer || PHALCON_IS_TRUE(stop_buffer)) {
PHALCON_CALL_METHOD(NULL, frontend, "stop");
}
if (PHALCON_IS_TRUE(is_buffering)) {
zend_print_zval(cached_content, 0);
}
phalcon_update_property_bool(this_ptr, SL("_started"), 0 TSRMLS_CC);
PHALCON_MM_RESTORE();
}
/**
* Deletes a value from the cache by its key
*
* @param int|string $keyName
* @return boolean
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, delete){
zval *key_name, *prefix, *prefixed_key, *collection = NULL;
zval *conditions;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &key_name);
prefix = phalcon_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY TSRMLS_CC);
PHALCON_INIT_VAR(prefixed_key);
PHALCON_CONCAT_VV(prefixed_key, prefix, key_name);
PHALCON_CALL_METHOD(&collection, this_ptr, "_getcollection");
PHALCON_INIT_VAR(conditions);
array_init_size(conditions, 1);
phalcon_array_update_string(&conditions, SL("key"), prefixed_key, PH_COPY);
PHALCON_CALL_METHOD(NULL, collection, "remove", conditions);
if ((php_rand(TSRMLS_C) % 100) == 0) {
PHALCON_CALL_METHOD(NULL, getThis(), "gc");
}
RETURN_MM_TRUE;
}
/**
* Query the existing cached keys
*
* @param string $prefix
* @return array
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, queryKeys){
zval *prefix = NULL, *collection = NULL, *fields = NULL, *pattern, *regex;
zval *conditions, *documents = NULL, *documents_array = NULL, *time_condition;
HashTable *ah0;
HashPosition hp0;
zval **hd;
zend_class_entry *ce0;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 0, 1, &prefix);
PHALCON_CALL_METHOD(&collection, this_ptr, "_getcollection");
PHALCON_INIT_VAR(fields);
array_init_size(fields, 1);
add_next_index_stringl(fields, SL("key"), 1);
PHALCON_INIT_VAR(conditions);
array_init_size(conditions, 2);
if (prefix && zend_is_true(prefix)) {
PHALCON_INIT_VAR(pattern);
PHALCON_CONCAT_SVS(pattern, "/^", prefix, "/");
ce0 = zend_fetch_class(SL("MongoRegex"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
PHALCON_INIT_VAR(regex);
object_init_ex(regex, ce0);
assert(phalcon_has_constructor(regex TSRMLS_CC));
PHALCON_CALL_METHOD(NULL, regex, "__construct", pattern);
phalcon_array_update_string(&conditions, SL("key"), regex, PH_COPY);
}
MAKE_STD_ZVAL(time_condition);
array_init_size(time_condition, 1);
add_assoc_long_ex(time_condition, SS("$gt"), (long int)time(NULL));
phalcon_array_update_string(&conditions, SL("time"), time_condition, 0);
PHALCON_CALL_METHOD(&documents, collection, "find", conditions, fields);
array_init(return_value);
PHALCON_CALL_FUNCTION(&documents_array, "iterator_to_array", documents);
phalcon_is_iterable(documents_array, &ah0, &hp0, 0, 0);
while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
zval *key;
if (likely(phalcon_array_isset_string_fetch(&key, *hd, SS("key")))) {
Z_ADDREF_P(key);
add_next_index_zval(return_value, key);
}
zend_hash_move_forward_ex(ah0, &hp0);
}
PHALCON_MM_RESTORE();
}
/**
* Checks if cache exists and it hasn't expired
*
* @param string $keyName
* @param long $lifetime
* @return boolean
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, exists){
zval *key_name = NULL, *lifetime = NULL, *collection = NULL;
zval *last_key;
zval *conditions, *number = NULL, *time_condition;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 0, 2, &key_name, &lifetime);
if (!key_name || Z_TYPE_P(key_name) == IS_NULL) {
last_key = phalcon_fetch_nproperty_this(this_ptr, SL("_lastKey"), PH_NOISY TSRMLS_CC);
} else {
zval *prefix = phalcon_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY TSRMLS_CC);
PHALCON_INIT_VAR(last_key);
PHALCON_CONCAT_VV(last_key, prefix, key_name);
}
if (zend_is_true(last_key)) {
long int n;
PHALCON_CALL_METHOD(&collection, this_ptr, "_getcollection");
PHALCON_INIT_VAR(conditions);
array_init_size(conditions, 2);
phalcon_array_update_string(&conditions, SL("key"), last_key, PH_COPY);
MAKE_STD_ZVAL(time_condition);
array_init_size(time_condition, 1);
add_assoc_long_ex(time_condition, SS("$gt"), (long int)time(NULL));
phalcon_array_update_string(&conditions, SL("time"), time_condition, 0);
PHALCON_CALL_METHOD(&number, collection, "count", conditions);
n = likely(Z_TYPE_P(number) == IS_LONG) ? Z_RESVAL_P(number) : phalcon_get_intval(number);
RETVAL_BOOL(n > 0);
}
else {
RETVAL_FALSE;
}
PHALCON_MM_RESTORE();
}
PHP_METHOD(Phalcon_Cache_Backend_Mongo, gc) {
zval *conditions, *time_condition, *collection = NULL;
PHALCON_MM_GROW();
MAKE_STD_ZVAL(time_condition);
array_init_size(time_condition, 1);
add_assoc_long_ex(time_condition, SS("$gt"), (long int)time(NULL));
PHALCON_INIT_VAR(conditions);
array_init_size(conditions, 1);
add_assoc_zval_ex(conditions, SS("time"), time_condition);
PHALCON_CALL_METHOD(&collection, this_ptr, "_getcollection");
PHALCON_CALL_METHOD(NULL, collection, "remove", conditions);
PHALCON_MM_RESTORE();
}
/**
* Increment of a given key by $value
*
* @param int|string $keyName
* @param long $value
* @return mixed
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, increment){
zval *key_name, *lifetime = NULL, *frontend, *prefix, *prefixed_key, *value = NULL;
zval *collection = NULL, *conditions, *document = NULL, *timestamp;
zval *ttl = NULL, *modified_time, *difference, *not_expired;
zval *cached_content;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 1, &key_name, &value);
if (!value) {
PHALCON_INIT_VAR(value);
ZVAL_LONG(value, 1);
}
if(Z_TYPE_P(value) == IS_NULL) {
ZVAL_LONG(value, 1);
}
if (Z_TYPE_P(value) != IS_LONG) {
PHALCON_SEPARATE_PARAM(value);
convert_to_long_ex(&value);
}
PHALCON_OBS_VAR(frontend);
phalcon_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY TSRMLS_CC);
PHALCON_OBS_VAR(prefix);
phalcon_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY TSRMLS_CC);
PHALCON_INIT_VAR(prefixed_key);
PHALCON_CONCAT_VV(prefixed_key, prefix, key_name);
phalcon_update_property_this(this_ptr, SL("_lastKey"), prefixed_key TSRMLS_CC);
PHALCON_CALL_METHOD(&collection, this_ptr, "_getcollection");
PHALCON_INIT_VAR(conditions);
array_init_size(conditions, 1);
phalcon_array_update_string(&conditions, SL("key"), prefixed_key, PH_COPY);
PHALCON_CALL_METHOD(&document, collection, "findone", conditions);
PHALCON_INIT_VAR(timestamp);
PHALCON_INIT_VAR(lifetime);
ZVAL_LONG(timestamp, (long) time(NULL));
PHALCON_OBS_NVAR(lifetime);
phalcon_read_property_this(&lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY TSRMLS_CC);
if (Z_TYPE_P(lifetime) == IS_NULL) {
PHALCON_CALL_METHOD(&ttl, frontend, "getlifetime");
} else {
PHALCON_CPY_WRT(ttl, lifetime);
}
/*
* phalcon_add_function(newlifetime, ttl, timestamp TSRMLS_CC);
*/
if (!phalcon_array_isset_string(document, SS("time"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The cache is currupted");
return;
}
PHALCON_OBS_VAR(modified_time);
phalcon_array_fetch_string(&modified_time, document, SL("time"), PH_NOISY);
PHALCON_INIT_VAR(difference);
sub_function(difference, timestamp, ttl TSRMLS_CC);
PHALCON_INIT_VAR(not_expired);
is_smaller_function(not_expired, difference, modified_time TSRMLS_CC);
/**
* The expiration is based on the column 'time'
*/
if (PHALCON_IS_TRUE(not_expired)) {
if (!phalcon_array_isset_string(document, SS("data"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The cache is currupted");
return;
}
PHALCON_OBS_VAR(cached_content);
phalcon_array_fetch_string(&cached_content, document, SL("data"), PH_NOISY);
if(Z_TYPE_P(cached_content) != IS_LONG) {
PHALCON_SEPARATE_PARAM(cached_content);
convert_to_long_ex(&cached_content);
}
if (phalcon_is_numeric(cached_content)) {
add_function(return_value, cached_content, value TSRMLS_CC);
PHALCON_INIT_NVAR(ttl);
phalcon_add_function(ttl, lifetime, timestamp TSRMLS_CC);
PHALCON_CALL_METHOD(NULL, this_ptr, "save", prefixed_key, return_value);
}
RETURN_MM();
}
RETURN_MM_NULL();
}
/**
* Decrement of a given key by $value
*
* @param int|string $keyName
* @param long $value
* @return mixed
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, decrement){
zval *key_name, *lifetime = NULL, *frontend, *prefix, *prefixed_key, *value = NULL;
zval *collection = NULL, *conditions, *document = NULL, *timestamp;
zval *ttl = NULL, *modified_time, *difference, *not_expired;
zval *cached_content;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 1, &key_name, &value);
if (!value) {
PHALCON_INIT_VAR(value);
ZVAL_LONG(value, 1);
}
if(Z_TYPE_P(value) == IS_NULL) {
ZVAL_LONG(value, 1);
}
if (Z_TYPE_P(value) != IS_LONG) {
PHALCON_SEPARATE_PARAM(value);
convert_to_long_ex(&value);
}
PHALCON_OBS_VAR(frontend);
phalcon_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY TSRMLS_CC);
PHALCON_OBS_VAR(prefix);
phalcon_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY TSRMLS_CC);
PHALCON_INIT_VAR(prefixed_key);
PHALCON_CONCAT_VV(prefixed_key, prefix, key_name);
phalcon_update_property_this(this_ptr, SL("_lastKey"), prefixed_key TSRMLS_CC);
PHALCON_CALL_METHOD(&collection, this_ptr, "_getcollection");
PHALCON_INIT_VAR(conditions);
array_init_size(conditions, 1);
phalcon_array_update_string(&conditions, SL("key"), prefixed_key, PH_COPY);
PHALCON_CALL_METHOD(&document, collection, "findone", conditions);
PHALCON_INIT_VAR(timestamp);
PHALCON_INIT_VAR(lifetime);
ZVAL_LONG(timestamp, (long) time(NULL));
PHALCON_OBS_NVAR(lifetime);
phalcon_read_property_this(&lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY TSRMLS_CC);
if (Z_TYPE_P(lifetime) == IS_NULL) {
PHALCON_CALL_METHOD(&ttl, frontend, "getlifetime");
} else {
PHALCON_CPY_WRT(ttl, lifetime);
}
/*
* phalcon_add_function(newlifetime, ttl, timestamp TSRMLS_CC);
*/
if (!phalcon_array_isset_string(document, SS("time"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The cache is currupted");
return;
}
PHALCON_OBS_VAR(modified_time);
phalcon_array_fetch_string(&modified_time, document, SL("time"), PH_NOISY);
PHALCON_INIT_VAR(difference);
sub_function(difference, timestamp, ttl TSRMLS_CC);
PHALCON_INIT_VAR(not_expired);
is_smaller_function(not_expired, difference, modified_time TSRMLS_CC);
/**
* The expiration is based on the column 'time'
*/
if (PHALCON_IS_TRUE(not_expired)) {
if (!phalcon_array_isset_string(document, SS("data"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The cache is currupted");
return;
}
PHALCON_OBS_VAR(cached_content);
phalcon_array_fetch_string(&cached_content, document, SL("data"), PH_NOISY);
if(Z_TYPE_P(cached_content) != IS_LONG) {
PHALCON_SEPARATE_PARAM(cached_content);
convert_to_long_ex(&cached_content);
}
if (phalcon_is_numeric(cached_content)) {
sub_function(return_value, cached_content, value TSRMLS_CC);
PHALCON_INIT_NVAR(ttl);
phalcon_add_function(ttl, lifetime, timestamp TSRMLS_CC);
PHALCON_CALL_METHOD(NULL, this_ptr, "save", prefixed_key, return_value);
}
RETURN_MM();
}
RETURN_MM_NULL();
}
/**
* Immediately invalidates all existing items.
*
* @return bool
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, flush){
zval *collection = NULL;
PHALCON_MM_GROW();
PHALCON_CALL_METHOD(&collection, this_ptr, "_getcollection");
PHALCON_CALL_METHOD(NULL, collection, "remove");
if ((php_rand(TSRMLS_C) % 100) == 0) {
PHALCON_CALL_METHOD(NULL, getThis(), "gc");
}
RETURN_MM_TRUE;
}
| 30.317224 | 151 | 0.733058 | unisys12 |
e0fb17853d8f73af54b7c1eddeb88aab4c58877b | 212 | hh | C++ | Middlewares/ugfx/tools/mcufontencoder/src/freetype_import.hh | YZ-Qiu/Scope_STM32 | c8da92e1222952af3501ca7c8a0353d0c0dd287f | [
"MIT"
] | 1 | 2017-07-18T20:02:40.000Z | 2017-07-18T20:02:40.000Z | Middlewares/ugfx/tools/mcufontencoder/src/freetype_import.hh | YZ-Qiu/Scope_STM32 | c8da92e1222952af3501ca7c8a0353d0c0dd287f | [
"MIT"
] | null | null | null | Middlewares/ugfx/tools/mcufontencoder/src/freetype_import.hh | YZ-Qiu/Scope_STM32 | c8da92e1222952af3501ca7c8a0353d0c0dd287f | [
"MIT"
] | null | null | null | // Function for importing any font supported by libfreetype.
#pragma once
#include "datafile.hh"
namespace mcufont {
std::unique_ptr<DataFile> LoadFreetype(std::istream &file, int size, bool bw);
}
| 19.272727 | 79 | 0.716981 | YZ-Qiu |
e0fe3caf5f2846bd3460ce8c6e3c306ed2197da2 | 1,627 | cpp | C++ | cxx_base/move.cpp | liujinxinggithub/C-11 | 20ad920a6ae799702efcbfea1f803fa27554d518 | [
"Apache-2.0"
] | null | null | null | cxx_base/move.cpp | liujinxinggithub/C-11 | 20ad920a6ae799702efcbfea1f803fa27554d518 | [
"Apache-2.0"
] | null | null | null | cxx_base/move.cpp | liujinxinggithub/C-11 | 20ad920a6ae799702efcbfea1f803fa27554d518 | [
"Apache-2.0"
] | null | null | null | #include <iostream>
#include <memory>
#include <cassert>
#include "easylogging++.h"
using namespace std;
INITIALIZE_EASYLOGGINGPP
// assert(),运行断言,不可以提前到编译器发现错误,在发行版中,assert都会被关掉
// 会对表达式expression进行检测:
// 如果expression的结果为 0(条件不成立),那么断言失败,表明程序出错,assert() 会向标准输出设备(一般是显示器)打印一条错误信息,并调用 abort() 函数终止程序的执行。
// 如果expression的结果为非 0(条件成立),那么断言成功,表明程序正确,assert() 不进行任何操作。
// static_assert,编译断言,可以在编译期间发现更多的错误。
// 性能方面:由于static_assert编译期间断言,不生成目标代码,因此不会造成任何运行期性能损失
// 该static_assert用来确保编译仅在64位的平台上进行,不支持32位的平台
// 该语句可以放在文件的开头处,这样可以尽早检查,以节省失败情况下的编译时间。
static_assert(sizeof(void *) == 8, "32-bit code generation is not supported.");
class A {
public:
explicit A(int size) : size_(size) {
data_ = new int[size];
}
A(){}
A(const A& a) {
size_ = a.size_;
data_ = new int[size_];
LOG(INFO) << "copy ";
}
A(A&& a) {
this->data_ = a.data_;
a.data_ = nullptr;
LOG(INFO) << "move ";
}
~A() {
if (data_ != nullptr) {
delete[] data_;
}
}
//private:
int *data_{};
int size_{};
};
std::unique_ptr<A> foo() {
auto ret = std::make_unique<A>(100);
//...
return ret; // -> return ret;
}
int main() {
A a(10);
A b = a;
A c = std::move(a); // 调用移动构造函数
unique_ptr<int> p = std::make_unique<int>(1);
unique_ptr<int> q = std::move(p);
LOG(INFO) << sizeof(void *);
assert(p == nullptr); // OK: reset to default
p = std::make_unique<int>(2);
assert(*p == 2); // OK: reset to int*(2
std::unique_ptr<A> ret = foo();
LOG(INFO) << ret->size_;
return 0;
}
| 21.986486 | 99 | 0.590043 | liujinxinggithub |
4603cb74afe635c61938acc39566f2f431f9e523 | 2,553 | cpp | C++ | Training-Code/2015 ACMICPC Asia Regional Shanghai Online/C.cpp | PrayStarJirachi/Exercise-Code | 801a5926eccc971ab2182e5e99e3a0746bd6a7f0 | [
"MIT"
] | null | null | null | Training-Code/2015 ACMICPC Asia Regional Shanghai Online/C.cpp | PrayStarJirachi/Exercise-Code | 801a5926eccc971ab2182e5e99e3a0746bd6a7f0 | [
"MIT"
] | null | null | null | Training-Code/2015 ACMICPC Asia Regional Shanghai Online/C.cpp | PrayStarJirachi/Exercise-Code | 801a5926eccc971ab2182e5e99e3a0746bd6a7f0 | [
"MIT"
] | null | null | null | #include <cstdio>
#include <cstring>
#include <algorithm>
#ifdef WIN32
#define LL "%I64d"
#else
#define LL "%lld"
#endif
const int MAXN = 2000001;
const int MAXT = 4000001;
const int MAXS = 4000001;
const long long INF = 1ll << 50;
int T, A, B, last, size, p, c[MAXT][26], l[MAXT], f[MAXT], w[MAXN];
long long dp[MAXN];
char s[MAXN];
struct Segment_Tree{
int M;
long long d[MAXS];
void init(int n) {
for (M = 1; M <= n + 1; M <<= 1);
for (int i = 1; i <= M + n; i++) d[i] = INF;
}
void modify(int x, long long v) {
x += M;
d[x] = std::min(d[x], v);
for (x >>= 1; x; x >>= 1) {
d[x] = std::min(d[x << 1], d[x << 1 ^ 1]);
}
}
long long query(int x, int y) {
long long ret = INF;
if (x > y) return ret;
for (x += M - 1, y += M + 1; x ^ y ^ 1; x >>= 1, y >>= 1) {
if (x & 1 ^ 1) ret = std::min(ret, d[x ^ 1]);
if (y & 1) ret = std::min(ret, d[y ^ 1]);
}
return ret;
}
}tree;
int alloc() {
size++;
for (int i = 0; i < 26; i++) c[size][i] = 0;
l[size] = f[size] = 0;
return size;
}
void add(int x, int &last) {
int lastnode = last, newnode = alloc(); l[newnode] = l[lastnode] + 1;
for (; lastnode && !c[lastnode][x]; lastnode = f[lastnode]) c[lastnode][x] = newnode;
if (!lastnode) f[newnode] = 1;
else{
int nownode = c[lastnode][x];
if (l[nownode] == l[lastnode] + 1) f[newnode] = nownode;
else{
int auxnode = alloc(); l[auxnode] = l[lastnode] + 1;
if (p == nownode) p = auxnode;
for (int i = 0; i < 26; i++) c[auxnode][i] = c[nownode][i];
f[auxnode] = f[nownode]; f[nownode] = f[newnode] = auxnode;
for (; lastnode && c[lastnode][x] == nownode; lastnode = f[lastnode]) c[lastnode][x] = auxnode;
}
}
last = newnode;
}
int main() {
freopen("C.in", "r", stdin);
scanf("%d", &T);
for (int cs = 1; cs <= T; cs++) {
scanf("%s", s + 1);
for (int i = 0; i < 26; i++) scanf("%d", w + i);
scanf("%d%d", &A, &B);
size = 0;
last = alloc();
int n = strlen(s + 1), len = 0;
tree.init(n); p = 1;
for (int i = 1, j = 0; i <= n; i++) {
dp[i] = dp[i - 1] + w[s[i] - 'a'];
while (j < i - 1 && !c[p][s[i] - 'a']) {
add(s[++j] - 'a', last);
if (p != 1 && --len == l[f[p]]) p = f[p];
}
if (c[p][s[i] - 'a']) {
long long tmp = tree.query(j, i - 1);
tmp = tmp + (long long)i * A;
tmp = tmp + 2ll * B;
dp[i] = std::min(dp[i], tmp);
len++;
p = c[p][s[i] - 'a'];
}
else{
add(s[++j] - 'a', last);
p = 1; len = 0;
}
tree.modify(i, dp[i] - (long long)i * A);
}
printf("Case #%d: " LL "\n", cs, dp[n]);
}
return 0;
}
| 24.314286 | 98 | 0.489228 | PrayStarJirachi |
46103a9857950246f0ba3e599490fe633f37b1ee | 144,002 | hpp | C++ | include/Oculus/Avatar/CAPI.hpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | include/Oculus/Avatar/CAPI.hpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | include/Oculus/Avatar/CAPI.hpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | // Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
#include "beatsaber-hook/shared/utils/byref.hpp"
// Including type: System.IntPtr
#include "System/IntPtr.hpp"
// Including type: ovrAvatarPBSMaterialState
#include "GlobalNamespace/ovrAvatarPBSMaterialState.hpp"
// Including type: ovrAvatarTransform
#include "GlobalNamespace/ovrAvatarTransform.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
#include "beatsaber-hook/shared/utils/typedefs-array.hpp"
#include "beatsaber-hook/shared/utils/typedefs-string.hpp"
// Completed includes
// Begin forward declares
// Forward declaring namespace: Oculus::Avatar
namespace Oculus::Avatar {
}
// Forward declaring namespace: System
namespace System {
// Forward declaring type: String
class String;
// Forward declaring type: Version
class Version;
// Skipping declaration: ValueType because it is already included!
}
// Forward declaring namespace: UnityEngine
namespace UnityEngine {
// Forward declaring type: GameObject
class GameObject;
// Skipping declaration: Vector4 because it is already included!
}
// Forward declaring namespace: GlobalNamespace
namespace GlobalNamespace {
// Forward declaring type: ovrAvatarMessageType
struct ovrAvatarMessageType;
// Forward declaring type: ovrAvatarMessage_AvatarSpecification
struct ovrAvatarMessage_AvatarSpecification;
// Forward declaring type: ovrAvatarMessage_AssetLoaded
struct ovrAvatarMessage_AssetLoaded;
// Forward declaring type: ovrAvatarLookAndFeelVersion
struct ovrAvatarLookAndFeelVersion;
// Forward declaring type: ovrAvatarAssetLevelOfDetail
struct ovrAvatarAssetLevelOfDetail;
// Forward declaring type: ovrAvatarCapabilities
struct ovrAvatarCapabilities;
// Forward declaring type: ovrAvatarVisemes
struct ovrAvatarVisemes;
// Forward declaring type: ovrAvatarHandInputState
struct ovrAvatarHandInputState;
// Forward declaring type: ovrAvatarControllerType
struct ovrAvatarControllerType;
// Forward declaring type: ovrAvatarComponent
struct ovrAvatarComponent;
// Forward declaring type: ovrAvatarBaseComponent
struct ovrAvatarBaseComponent;
// Forward declaring type: ovrAvatarBodyComponent
struct ovrAvatarBodyComponent;
// Forward declaring type: ovrAvatarControllerComponent
struct ovrAvatarControllerComponent;
// Forward declaring type: ovrAvatarHandComponent
struct ovrAvatarHandComponent;
// Forward declaring type: ovrAvatarAssetType
struct ovrAvatarAssetType;
// Forward declaring type: ovrAvatarMeshAssetData
struct ovrAvatarMeshAssetData;
// Forward declaring type: ovrAvatarMeshAssetDataV2
struct ovrAvatarMeshAssetDataV2;
// Forward declaring type: ovrAvatarTextureAssetData
struct ovrAvatarTextureAssetData;
// Forward declaring type: ovrAvatarMaterialState
struct ovrAvatarMaterialState;
// Forward declaring type: ovrAvatarRenderPartType
struct ovrAvatarRenderPartType;
// Forward declaring type: ovrAvatarRenderPart_SkinnedMeshRender
struct ovrAvatarRenderPart_SkinnedMeshRender;
// Forward declaring type: ovrAvatarVisibilityFlags
struct ovrAvatarVisibilityFlags;
// Forward declaring type: ovrAvatarHandGesture
struct ovrAvatarHandGesture;
// Forward declaring type: ovrAvatarExpressiveParameters
struct ovrAvatarExpressiveParameters;
// Forward declaring type: ovrAvatarRenderPart_SkinnedMeshRenderPBS
struct ovrAvatarRenderPart_SkinnedMeshRenderPBS;
// Forward declaring type: ovrAvatarRenderPart_SkinnedMeshRenderPBS_V2
struct ovrAvatarRenderPart_SkinnedMeshRenderPBS_V2;
// Forward declaring type: ovrAvatarBlendShapeParams
struct ovrAvatarBlendShapeParams;
// Forward declaring type: ovrAvatarRenderPart_ProjectorRender
struct ovrAvatarRenderPart_ProjectorRender;
// Forward declaring type: ovrAvatarGazeTargets
struct ovrAvatarGazeTargets;
// Forward declaring type: ovrAvatarLights
struct ovrAvatarLights;
// Forward declaring type: ovrAvatarLogLevel
struct ovrAvatarLogLevel;
}
// Completed forward declares
// Type namespace: Oculus.Avatar
namespace Oculus::Avatar {
// Forward declaring type: CAPI
class CAPI;
}
#include "beatsaber-hook/shared/utils/il2cpp-type-check.hpp"
NEED_NO_BOX(::Oculus::Avatar::CAPI);
DEFINE_IL2CPP_ARG_TYPE(::Oculus::Avatar::CAPI*, "Oculus.Avatar", "CAPI");
// Type namespace: Oculus.Avatar
namespace Oculus::Avatar {
// Size: 0x10
#pragma pack(push, 1)
// Autogenerated type: Oculus.Avatar.CAPI
// [TokenAttribute] Offset: FFFFFFFF
class CAPI : public ::Il2CppObject {
public:
// Nested type: ::Oculus::Avatar::CAPI::LoggingDelegate
class LoggingDelegate;
// Nested type: ::Oculus::Avatar::CAPI::Result
struct Result;
// Nested type: ::Oculus::Avatar::CAPI::OVRP_1_30_0
class OVRP_1_30_0;
// static field const value: static private System.String LibFile
static constexpr const char* LibFile = "ovravatarloader";
// Get static field: static private System.String LibFile
static ::StringW _get_LibFile();
// Set static field: static private System.String LibFile
static void _set_LibFile(::StringW value);
// Get static field: static private System.IntPtr nativeVisemeData
static ::System::IntPtr _get_nativeVisemeData();
// Set static field: static private System.IntPtr nativeVisemeData
static void _set_nativeVisemeData(::System::IntPtr value);
// Get static field: static private System.IntPtr nativeGazeTargetsData
static ::System::IntPtr _get_nativeGazeTargetsData();
// Set static field: static private System.IntPtr nativeGazeTargetsData
static void _set_nativeGazeTargetsData(::System::IntPtr value);
// Get static field: static private System.IntPtr nativeAvatarLightsData
static ::System::IntPtr _get_nativeAvatarLightsData();
// Set static field: static private System.IntPtr nativeAvatarLightsData
static void _set_nativeAvatarLightsData(::System::IntPtr value);
// Get static field: static private System.IntPtr DebugLineCountData
static ::System::IntPtr _get_DebugLineCountData();
// Set static field: static private System.IntPtr DebugLineCountData
static void _set_DebugLineCountData(::System::IntPtr value);
// Get static field: static private System.Single[] scratchBufferFloat
static ::ArrayW<float> _get_scratchBufferFloat();
// Set static field: static private System.Single[] scratchBufferFloat
static void _set_scratchBufferFloat(::ArrayW<float> value);
// Get static field: static private UnityEngine.GameObject debugLineGo
static ::UnityEngine::GameObject* _get_debugLineGo();
// Set static field: static private UnityEngine.GameObject debugLineGo
static void _set_debugLineGo(::UnityEngine::GameObject* value);
// Get static field: static private System.String SDKRuntimePrefix
static ::StringW _get_SDKRuntimePrefix();
// Set static field: static private System.String SDKRuntimePrefix
static void _set_SDKRuntimePrefix(::StringW value);
// static field const value: static private System.String ovrPluginDLL
static constexpr const char* ovrPluginDLL = "OVRPlugin";
// Get static field: static private System.String ovrPluginDLL
static ::StringW _get_ovrPluginDLL();
// Set static field: static private System.String ovrPluginDLL
static void _set_ovrPluginDLL(::StringW value);
// Get static field: static private System.Version ovrPluginVersion
static ::System::Version* _get_ovrPluginVersion();
// Set static field: static private System.Version ovrPluginVersion
static void _set_ovrPluginVersion(::System::Version* value);
// static private System.Void .cctor()
// Offset: 0x132F248
static void _cctor();
// static public System.Void ovrAvatar_InitializeAndroidUnity(System.String appID)
// Offset: 0x13274FC
static void ovrAvatar_InitializeAndroidUnity(::StringW appID);
// static public System.Void Initialize()
// Offset: 0x132758C
static void Initialize();
// static public System.Void Shutdown()
// Offset: 0x13277A4
static void Shutdown();
// static public System.Void ovrAvatar_Shutdown()
// Offset: 0x132788C
static void ovrAvatar_Shutdown();
// static public System.IntPtr ovrAvatarMessage_Pop()
// Offset: 0x13278FC
static ::System::IntPtr ovrAvatarMessage_Pop();
// static public ovrAvatarMessageType ovrAvatarMessage_GetType(System.IntPtr msg)
// Offset: 0x1327970
static ::GlobalNamespace::ovrAvatarMessageType ovrAvatarMessage_GetType(::System::IntPtr msg);
// static public ovrAvatarMessage_AvatarSpecification ovrAvatarMessage_GetAvatarSpecification(System.IntPtr msg)
// Offset: 0x13279F0
static ::GlobalNamespace::ovrAvatarMessage_AvatarSpecification ovrAvatarMessage_GetAvatarSpecification(::System::IntPtr msg);
// static private System.IntPtr ovrAvatarMessage_GetAvatarSpecification_Native(System.IntPtr msg)
// Offset: 0x1327B34
static ::System::IntPtr ovrAvatarMessage_GetAvatarSpecification_Native(::System::IntPtr msg);
// static public ovrAvatarMessage_AssetLoaded ovrAvatarMessage_GetAssetLoaded(System.IntPtr msg)
// Offset: 0x1327BB4
static ::GlobalNamespace::ovrAvatarMessage_AssetLoaded ovrAvatarMessage_GetAssetLoaded(::System::IntPtr msg);
// static private System.IntPtr ovrAvatarMessage_GetAssetLoaded_Native(System.IntPtr msg)
// Offset: 0x1327CF8
static ::System::IntPtr ovrAvatarMessage_GetAssetLoaded_Native(::System::IntPtr msg);
// static public System.Void ovrAvatarMessage_Free(System.IntPtr msg)
// Offset: 0x1327D78
static void ovrAvatarMessage_Free(::System::IntPtr msg);
// static public System.IntPtr ovrAvatarSpecificationRequest_Create(System.UInt64 userID)
// Offset: 0x1327DF8
static ::System::IntPtr ovrAvatarSpecificationRequest_Create(uint64_t userID);
// static public System.Void ovrAvatarSpecificationRequest_Destroy(System.IntPtr specificationRequest)
// Offset: 0x1327E78
static void ovrAvatarSpecificationRequest_Destroy(::System::IntPtr specificationRequest);
// static public System.Void ovrAvatarSpecificationRequest_SetCombineMeshes(System.IntPtr specificationRequest, System.Boolean useCombinedMesh)
// Offset: 0x1327EF8
static void ovrAvatarSpecificationRequest_SetCombineMeshes(::System::IntPtr specificationRequest, bool useCombinedMesh);
// static public System.Void ovrAvatarSpecificationRequest_SetLookAndFeelVersion(System.IntPtr specificationRequest, ovrAvatarLookAndFeelVersion version)
// Offset: 0x1327F88
static void ovrAvatarSpecificationRequest_SetLookAndFeelVersion(::System::IntPtr specificationRequest, ::GlobalNamespace::ovrAvatarLookAndFeelVersion version);
// static public System.Void ovrAvatarSpecificationRequest_SetLevelOfDetail(System.IntPtr specificationRequest, ovrAvatarAssetLevelOfDetail lod)
// Offset: 0x1328018
static void ovrAvatarSpecificationRequest_SetLevelOfDetail(::System::IntPtr specificationRequest, ::GlobalNamespace::ovrAvatarAssetLevelOfDetail lod);
// static public System.Void ovrAvatar_RequestAvatarSpecification(System.UInt64 userID)
// Offset: 0x13280A8
static void ovrAvatar_RequestAvatarSpecification(uint64_t userID);
// static public System.Void ovrAvatar_RequestAvatarSpecificationFromSpecRequest(System.IntPtr specificationRequest)
// Offset: 0x1328128
static void ovrAvatar_RequestAvatarSpecificationFromSpecRequest(::System::IntPtr specificationRequest);
// static public System.Void ovrAvatarSpecificationRequest_SetFallbackLookAndFeelVersion(System.IntPtr specificationRequest, ovrAvatarLookAndFeelVersion version)
// Offset: 0x13281A8
static void ovrAvatarSpecificationRequest_SetFallbackLookAndFeelVersion(::System::IntPtr specificationRequest, ::GlobalNamespace::ovrAvatarLookAndFeelVersion version);
// static public System.Void ovrAvatarSpecificationRequest_SetExpressiveFlag(System.IntPtr specificationRequest, System.Boolean enable)
// Offset: 0x1328238
static void ovrAvatarSpecificationRequest_SetExpressiveFlag(::System::IntPtr specificationRequest, bool enable);
// static public System.IntPtr ovrAvatar_Create(System.IntPtr avatarSpecification, ovrAvatarCapabilities capabilities)
// Offset: 0x13282C8
static ::System::IntPtr ovrAvatar_Create(::System::IntPtr avatarSpecification, ::GlobalNamespace::ovrAvatarCapabilities capabilities);
// static public System.Void ovrAvatar_Destroy(System.IntPtr avatar)
// Offset: 0x1328358
static void ovrAvatar_Destroy(::System::IntPtr avatar);
// static public System.Void ovrAvatarPose_UpdateBody(System.IntPtr avatar, ovrAvatarTransform headPose)
// Offset: 0x13283D8
static void ovrAvatarPose_UpdateBody(::System::IntPtr avatar, ::GlobalNamespace::ovrAvatarTransform headPose);
// static public System.Void ovrAvatarPose_UpdateVoiceVisualization(System.IntPtr avatar, System.Single[] pcmData)
// Offset: 0x1328478
static void ovrAvatarPose_UpdateVoiceVisualization(::System::IntPtr avatar, ::ArrayW<float> pcmData);
// static private System.Void ovrAvatarPose_UpdateVoiceVisualization_Native(System.IntPtr avatar, System.UInt32 pcmDataSize, in System.Single[] pcmData)
// Offset: 0x13284F4
static void ovrAvatarPose_UpdateVoiceVisualization_Native(::System::IntPtr avatar, uint pcmDataSize, ByRef<::ArrayW<float>> pcmData);
// static public System.Void ovrAvatarPose_UpdateHands(System.IntPtr avatar, ovrAvatarHandInputState inputStateLeft, ovrAvatarHandInputState inputStateRight)
// Offset: 0x1328594
static void ovrAvatarPose_UpdateHands(::System::IntPtr avatar, ::GlobalNamespace::ovrAvatarHandInputState inputStateLeft, ::GlobalNamespace::ovrAvatarHandInputState inputStateRight);
// static public System.Void ovrAvatarPose_UpdateHandsWithType(System.IntPtr avatar, ovrAvatarHandInputState inputStateLeft, ovrAvatarHandInputState inputStateRight, ovrAvatarControllerType type)
// Offset: 0x1328654
static void ovrAvatarPose_UpdateHandsWithType(::System::IntPtr avatar, ::GlobalNamespace::ovrAvatarHandInputState inputStateLeft, ::GlobalNamespace::ovrAvatarHandInputState inputStateRight, ::GlobalNamespace::ovrAvatarControllerType type);
// static public System.Void ovrAvatarPose_Finalize(System.IntPtr avatar, System.Single elapsedSeconds)
// Offset: 0x1328724
static void ovrAvatarPose_Finalize(::System::IntPtr avatar, float elapsedSeconds);
// static public System.Void ovrAvatar_SetLeftControllerVisibility(System.IntPtr avatar, System.Boolean show)
// Offset: 0x13287B4
static void ovrAvatar_SetLeftControllerVisibility(::System::IntPtr avatar, bool show);
// static public System.Void ovrAvatar_SetRightControllerVisibility(System.IntPtr avatar, System.Boolean show)
// Offset: 0x1328844
static void ovrAvatar_SetRightControllerVisibility(::System::IntPtr avatar, bool show);
// static public System.Void ovrAvatar_SetLeftHandVisibility(System.IntPtr avatar, System.Boolean show)
// Offset: 0x13288D4
static void ovrAvatar_SetLeftHandVisibility(::System::IntPtr avatar, bool show);
// static public System.Void ovrAvatar_SetRightHandVisibility(System.IntPtr avatar, System.Boolean show)
// Offset: 0x1328964
static void ovrAvatar_SetRightHandVisibility(::System::IntPtr avatar, bool show);
// static public System.UInt32 ovrAvatarComponent_Count(System.IntPtr avatar)
// Offset: 0x13289F4
static uint ovrAvatarComponent_Count(::System::IntPtr avatar);
// static public System.Void ovrAvatarComponent_Get(System.IntPtr avatar, System.UInt32 index, System.Boolean includeName, ref ovrAvatarComponent component)
// Offset: 0x1328A74
static void ovrAvatarComponent_Get(::System::IntPtr avatar, uint index, bool includeName, ByRef<::GlobalNamespace::ovrAvatarComponent> component);
// static public System.Void ovrAvatarComponent_Get(System.IntPtr componentPtr, System.Boolean includeName, ref ovrAvatarComponent component)
// Offset: 0x1328B90
static void ovrAvatarComponent_Get(::System::IntPtr componentPtr, bool includeName, ByRef<::GlobalNamespace::ovrAvatarComponent> component);
// static public System.IntPtr ovrAvatarComponent_Get_Native(System.IntPtr avatar, System.UInt32 index)
// Offset: 0x1328B00
static ::System::IntPtr ovrAvatarComponent_Get_Native(::System::IntPtr avatar, uint index);
// static public System.Boolean ovrAvatarPose_GetBaseComponent(System.IntPtr avatar, ref ovrAvatarBaseComponent component)
// Offset: 0x1328DA4
static bool ovrAvatarPose_GetBaseComponent(::System::IntPtr avatar, ByRef<::GlobalNamespace::ovrAvatarBaseComponent> component);
// static private System.IntPtr ovrAvatarPose_GetBaseComponent_Native(System.IntPtr avatar)
// Offset: 0x1328F14
static ::System::IntPtr ovrAvatarPose_GetBaseComponent_Native(::System::IntPtr avatar);
// static public System.IntPtr MarshalRenderComponent(System.IntPtr ptr)
// Offset: 0xFFFFFFFFFFFFFFFF
template<class T>
static ::System::IntPtr MarshalRenderComponent(::System::IntPtr ptr) {
static_assert(std::is_convertible_v<T, ::System::ValueType*>);
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Avatar::CAPI::MarshalRenderComponent");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Oculus.Avatar", "CAPI", "MarshalRenderComponent", std::vector<Il2CppClass*>{::il2cpp_utils::il2cpp_type_check::il2cpp_no_arg_class<T>::get()}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ptr)})));
static auto* ___generic__method = THROW_UNLESS(::il2cpp_utils::MakeGenericMethod(___internal__method, std::vector<Il2CppClass*>{::il2cpp_utils::il2cpp_type_check::il2cpp_no_arg_class<T>::get()}));
return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast<Il2CppObject*>(nullptr), ___generic__method, ptr);
}
// static public System.Boolean ovrAvatarPose_GetBodyComponent(System.IntPtr avatar, ref ovrAvatarBodyComponent component)
// Offset: 0x1328F94
static bool ovrAvatarPose_GetBodyComponent(::System::IntPtr avatar, ByRef<::GlobalNamespace::ovrAvatarBodyComponent> component);
// static private System.IntPtr ovrAvatarPose_GetBodyComponent_Native(System.IntPtr avatar)
// Offset: 0x132923C
static ::System::IntPtr ovrAvatarPose_GetBodyComponent_Native(::System::IntPtr avatar);
// static public System.Boolean ovrAvatarPose_GetLeftControllerComponent(System.IntPtr avatar, ref ovrAvatarControllerComponent component)
// Offset: 0x13292BC
static bool ovrAvatarPose_GetLeftControllerComponent(::System::IntPtr avatar, ByRef<::GlobalNamespace::ovrAvatarControllerComponent> component);
// static private System.IntPtr ovrAvatarPose_GetLeftControllerComponent_Native(System.IntPtr avatar)
// Offset: 0x132942C
static ::System::IntPtr ovrAvatarPose_GetLeftControllerComponent_Native(::System::IntPtr avatar);
// static public System.Boolean ovrAvatarPose_GetRightControllerComponent(System.IntPtr avatar, ref ovrAvatarControllerComponent component)
// Offset: 0x13294AC
static bool ovrAvatarPose_GetRightControllerComponent(::System::IntPtr avatar, ByRef<::GlobalNamespace::ovrAvatarControllerComponent> component);
// static private System.IntPtr ovrAvatarPose_GetRightControllerComponent_Native(System.IntPtr avatar)
// Offset: 0x132961C
static ::System::IntPtr ovrAvatarPose_GetRightControllerComponent_Native(::System::IntPtr avatar);
// static public System.Boolean ovrAvatarPose_GetLeftHandComponent(System.IntPtr avatar, ref ovrAvatarHandComponent component)
// Offset: 0x132969C
static bool ovrAvatarPose_GetLeftHandComponent(::System::IntPtr avatar, ByRef<::GlobalNamespace::ovrAvatarHandComponent> component);
// static private System.IntPtr ovrAvatarPose_GetLeftHandComponent_Native(System.IntPtr avatar)
// Offset: 0x132980C
static ::System::IntPtr ovrAvatarPose_GetLeftHandComponent_Native(::System::IntPtr avatar);
// static public System.Boolean ovrAvatarPose_GetRightHandComponent(System.IntPtr avatar, ref ovrAvatarHandComponent component)
// Offset: 0x132988C
static bool ovrAvatarPose_GetRightHandComponent(::System::IntPtr avatar, ByRef<::GlobalNamespace::ovrAvatarHandComponent> component);
// static private System.IntPtr ovrAvatarPose_GetRightHandComponent_Native(System.IntPtr avatar)
// Offset: 0x13299FC
static ::System::IntPtr ovrAvatarPose_GetRightHandComponent_Native(::System::IntPtr avatar);
// static public System.Void ovrAvatarAsset_BeginLoading(System.UInt64 assetID)
// Offset: 0x1329A7C
static void ovrAvatarAsset_BeginLoading(uint64_t assetID);
// static public System.Boolean ovrAvatarAsset_BeginLoadingLOD(System.UInt64 assetId, ovrAvatarAssetLevelOfDetail lod)
// Offset: 0x1329AFC
static bool ovrAvatarAsset_BeginLoadingLOD(uint64_t assetId, ::GlobalNamespace::ovrAvatarAssetLevelOfDetail lod);
// static public ovrAvatarAssetType ovrAvatarAsset_GetType(System.IntPtr assetHandle)
// Offset: 0x1329B94
static ::GlobalNamespace::ovrAvatarAssetType ovrAvatarAsset_GetType(::System::IntPtr assetHandle);
// static public ovrAvatarMeshAssetData ovrAvatarAsset_GetMeshData(System.IntPtr assetPtr)
// Offset: 0x1329C14
static ::GlobalNamespace::ovrAvatarMeshAssetData ovrAvatarAsset_GetMeshData(::System::IntPtr assetPtr);
// static public ovrAvatarMeshAssetDataV2 ovrAvatarAsset_GetCombinedMeshData(System.IntPtr assetPtr)
// Offset: 0x1329DEC
static ::GlobalNamespace::ovrAvatarMeshAssetDataV2 ovrAvatarAsset_GetCombinedMeshData(::System::IntPtr assetPtr);
// static private System.IntPtr ovrAvatarAsset_GetCombinedMeshData_Native(System.IntPtr assetPtr)
// Offset: 0x1329F44
static ::System::IntPtr ovrAvatarAsset_GetCombinedMeshData_Native(::System::IntPtr assetPtr);
// static private System.IntPtr ovrAvatarAsset_GetMeshData_Native(System.IntPtr assetPtr)
// Offset: 0x1329D6C
static ::System::IntPtr ovrAvatarAsset_GetMeshData_Native(::System::IntPtr assetPtr);
// static public System.UInt32 ovrAvatarAsset_GetMeshBlendShapeCount(System.IntPtr assetPtr)
// Offset: 0x1329FC4
static uint ovrAvatarAsset_GetMeshBlendShapeCount(::System::IntPtr assetPtr);
// static public System.IntPtr ovrAvatarAsset_GetMeshBlendShapeName(System.IntPtr assetPtr, System.UInt32 index)
// Offset: 0x132A044
static ::System::IntPtr ovrAvatarAsset_GetMeshBlendShapeName(::System::IntPtr assetPtr, uint index);
// static public System.UInt32 ovrAvatarAsset_GetSubmeshCount(System.IntPtr assetPtr)
// Offset: 0x132A0D4
static uint ovrAvatarAsset_GetSubmeshCount(::System::IntPtr assetPtr);
// static public System.UInt32 ovrAvatarAsset_GetSubmeshLastIndex(System.IntPtr assetPtr, System.UInt32 index)
// Offset: 0x132A154
static uint ovrAvatarAsset_GetSubmeshLastIndex(::System::IntPtr assetPtr, uint index);
// static public System.IntPtr ovrAvatarAsset_GetMeshBlendShapeVertices(System.IntPtr assetPtr)
// Offset: 0x132A1E4
static ::System::IntPtr ovrAvatarAsset_GetMeshBlendShapeVertices(::System::IntPtr assetPtr);
// static public System.IntPtr ovrAvatarAsset_GetAvatar(System.IntPtr assetHandle)
// Offset: 0x132A264
static ::System::IntPtr ovrAvatarAsset_GetAvatar(::System::IntPtr assetHandle);
// static public System.UInt64[] ovrAvatarAsset_GetCombinedMeshIDs(System.IntPtr assetHandle)
// Offset: 0x132A2E4
static ::ArrayW<uint64_t> ovrAvatarAsset_GetCombinedMeshIDs(::System::IntPtr assetHandle);
// static public System.IntPtr ovrAvatarAsset_GetCombinedMeshIDs_Native(System.IntPtr assetHandle, System.IntPtr count)
// Offset: 0x132A570
static ::System::IntPtr ovrAvatarAsset_GetCombinedMeshIDs_Native(::System::IntPtr assetHandle, ::System::IntPtr count);
// static public System.Void ovrAvatar_GetCombinedMeshAlphaData(System.IntPtr avatar, ref System.UInt64 textureID, ref UnityEngine.Vector4 offset)
// Offset: 0x132A600
static void ovrAvatar_GetCombinedMeshAlphaData(::System::IntPtr avatar, ByRef<uint64_t> textureID, ByRef<::UnityEngine::Vector4> offset);
// static public System.IntPtr ovrAvatar_GetCombinedMeshAlphaData_Native(System.IntPtr avatar, System.IntPtr textureIDPtr, System.IntPtr offsetPtr)
// Offset: 0x132A830
static ::System::IntPtr ovrAvatar_GetCombinedMeshAlphaData_Native(::System::IntPtr avatar, ::System::IntPtr textureIDPtr, ::System::IntPtr offsetPtr);
// static public ovrAvatarTextureAssetData ovrAvatarAsset_GetTextureData(System.IntPtr assetPtr)
// Offset: 0x132A8C8
static ::GlobalNamespace::ovrAvatarTextureAssetData ovrAvatarAsset_GetTextureData(::System::IntPtr assetPtr);
// static private System.IntPtr ovrAvatarAsset_GetTextureData_Native(System.IntPtr assetPtr)
// Offset: 0x132AA18
static ::System::IntPtr ovrAvatarAsset_GetTextureData_Native(::System::IntPtr assetPtr);
// static private System.IntPtr ovrAvatarAsset_GetMaterialData_Native(System.IntPtr assetPtr)
// Offset: 0x132AA98
static ::System::IntPtr ovrAvatarAsset_GetMaterialData_Native(::System::IntPtr assetPtr);
// static public ovrAvatarMaterialState ovrAvatarAsset_GetMaterialState(System.IntPtr assetPtr)
// Offset: 0x132AB18
static ::GlobalNamespace::ovrAvatarMaterialState ovrAvatarAsset_GetMaterialState(::System::IntPtr assetPtr);
// static public ovrAvatarRenderPartType ovrAvatarRenderPart_GetType(System.IntPtr renderPart)
// Offset: 0x132AC6C
static ::GlobalNamespace::ovrAvatarRenderPartType ovrAvatarRenderPart_GetType(::System::IntPtr renderPart);
// static public ovrAvatarRenderPart_SkinnedMeshRender ovrAvatarRenderPart_GetSkinnedMeshRender(System.IntPtr renderPart)
// Offset: 0x132ACEC
static ::GlobalNamespace::ovrAvatarRenderPart_SkinnedMeshRender ovrAvatarRenderPart_GetSkinnedMeshRender(::System::IntPtr renderPart);
// static private System.IntPtr ovrAvatarRenderPart_GetSkinnedMeshRender_Native(System.IntPtr renderPart)
// Offset: 0x132AE40
static ::System::IntPtr ovrAvatarRenderPart_GetSkinnedMeshRender_Native(::System::IntPtr renderPart);
// static public ovrAvatarTransform ovrAvatarSkinnedMeshRender_GetTransform(System.IntPtr renderPart)
// Offset: 0x132AEC0
static ::GlobalNamespace::ovrAvatarTransform ovrAvatarSkinnedMeshRender_GetTransform(::System::IntPtr renderPart);
// static public ovrAvatarTransform ovrAvatarSkinnedMeshRenderPBS_GetTransform(System.IntPtr renderPart)
// Offset: 0x132AF50
static ::GlobalNamespace::ovrAvatarTransform ovrAvatarSkinnedMeshRenderPBS_GetTransform(::System::IntPtr renderPart);
// static public ovrAvatarTransform ovrAvatarSkinnedMeshRenderPBSV2_GetTransform(System.IntPtr renderPart)
// Offset: 0x132AFE0
static ::GlobalNamespace::ovrAvatarTransform ovrAvatarSkinnedMeshRenderPBSV2_GetTransform(::System::IntPtr renderPart);
// static public ovrAvatarVisibilityFlags ovrAvatarSkinnedMeshRender_GetVisibilityMask(System.IntPtr renderPart)
// Offset: 0x132B070
static ::GlobalNamespace::ovrAvatarVisibilityFlags ovrAvatarSkinnedMeshRender_GetVisibilityMask(::System::IntPtr renderPart);
// static public System.Boolean ovrAvatarSkinnedMeshRender_MaterialStateChanged(System.IntPtr renderPart)
// Offset: 0x132B0F0
static bool ovrAvatarSkinnedMeshRender_MaterialStateChanged(::System::IntPtr renderPart);
// static public System.Boolean ovrAvatarSkinnedMeshRenderPBSV2_MaterialStateChanged(System.IntPtr renderPart)
// Offset: 0x132B178
static bool ovrAvatarSkinnedMeshRenderPBSV2_MaterialStateChanged(::System::IntPtr renderPart);
// static public ovrAvatarVisibilityFlags ovrAvatarSkinnedMeshRenderPBS_GetVisibilityMask(System.IntPtr renderPart)
// Offset: 0x132B200
static ::GlobalNamespace::ovrAvatarVisibilityFlags ovrAvatarSkinnedMeshRenderPBS_GetVisibilityMask(::System::IntPtr renderPart);
// static public ovrAvatarVisibilityFlags ovrAvatarSkinnedMeshRenderPBSV2_GetVisibilityMask(System.IntPtr renderPart)
// Offset: 0x132B280
static ::GlobalNamespace::ovrAvatarVisibilityFlags ovrAvatarSkinnedMeshRenderPBSV2_GetVisibilityMask(::System::IntPtr renderPart);
// static public ovrAvatarMaterialState ovrAvatarSkinnedMeshRender_GetMaterialState(System.IntPtr renderPart)
// Offset: 0x132B300
static ::GlobalNamespace::ovrAvatarMaterialState ovrAvatarSkinnedMeshRender_GetMaterialState(::System::IntPtr renderPart);
// static public ovrAvatarPBSMaterialState ovrAvatarSkinnedMeshRenderPBSV2_GetPBSMaterialState(System.IntPtr renderPart)
// Offset: 0x132B3B4
static ::GlobalNamespace::ovrAvatarPBSMaterialState ovrAvatarSkinnedMeshRenderPBSV2_GetPBSMaterialState(::System::IntPtr renderPart);
// static public ovrAvatarExpressiveParameters ovrAvatar_GetExpressiveParameters(System.IntPtr avatar)
// Offset: 0x132B444
static ::GlobalNamespace::ovrAvatarExpressiveParameters ovrAvatar_GetExpressiveParameters(::System::IntPtr avatar);
// static public System.UInt64 ovrAvatarSkinnedMeshRender_GetDirtyJoints(System.IntPtr renderPart)
// Offset: 0x132B4D4
static uint64_t ovrAvatarSkinnedMeshRender_GetDirtyJoints(::System::IntPtr renderPart);
// static public System.UInt64 ovrAvatarSkinnedMeshRenderPBS_GetDirtyJoints(System.IntPtr renderPart)
// Offset: 0x132B554
static uint64_t ovrAvatarSkinnedMeshRenderPBS_GetDirtyJoints(::System::IntPtr renderPart);
// static public System.UInt64 ovrAvatarSkinnedMeshRenderPBSV2_GetDirtyJoints(System.IntPtr renderPart)
// Offset: 0x132B5D4
static uint64_t ovrAvatarSkinnedMeshRenderPBSV2_GetDirtyJoints(::System::IntPtr renderPart);
// static public ovrAvatarTransform ovrAvatarSkinnedMeshRender_GetJointTransform(System.IntPtr renderPart, System.UInt32 jointIndex)
// Offset: 0x132B654
static ::GlobalNamespace::ovrAvatarTransform ovrAvatarSkinnedMeshRender_GetJointTransform(::System::IntPtr renderPart, uint jointIndex);
// static public System.Void ovrAvatar_SetActionUnitOnsetSpeed(System.IntPtr avatar, System.Single onsetSpeed)
// Offset: 0x132B6EC
static void ovrAvatar_SetActionUnitOnsetSpeed(::System::IntPtr avatar, float onsetSpeed);
// static public System.Void ovrAvatar_SetActionUnitFalloffSpeed(System.IntPtr avatar, System.Single falloffSpeed)
// Offset: 0x132B77C
static void ovrAvatar_SetActionUnitFalloffSpeed(::System::IntPtr avatar, float falloffSpeed);
// static public System.Void ovrAvatar_SetVisemeMultiplier(System.IntPtr avatar, System.Single visemeMultiplier)
// Offset: 0x132B80C
static void ovrAvatar_SetVisemeMultiplier(::System::IntPtr avatar, float visemeMultiplier);
// static public ovrAvatarTransform ovrAvatarSkinnedMeshRenderPBS_GetJointTransform(System.IntPtr renderPart, System.UInt32 jointIndex)
// Offset: 0x132B89C
static ::GlobalNamespace::ovrAvatarTransform ovrAvatarSkinnedMeshRenderPBS_GetJointTransform(::System::IntPtr renderPart, uint jointIndex);
// static public ovrAvatarTransform ovrAvatarSkinnedMeshRenderPBSV2_GetJointTransform(System.IntPtr renderPart, System.UInt32 jointIndex)
// Offset: 0x132B934
static ::GlobalNamespace::ovrAvatarTransform ovrAvatarSkinnedMeshRenderPBSV2_GetJointTransform(::System::IntPtr renderPart, uint jointIndex);
// static public System.UInt64 ovrAvatarSkinnedMeshRenderPBS_GetAlbedoTextureAssetID(System.IntPtr renderPart)
// Offset: 0x132B9CC
static uint64_t ovrAvatarSkinnedMeshRenderPBS_GetAlbedoTextureAssetID(::System::IntPtr renderPart);
// static public System.UInt64 ovrAvatarSkinnedMeshRenderPBS_GetSurfaceTextureAssetID(System.IntPtr renderPart)
// Offset: 0x132BA4C
static uint64_t ovrAvatarSkinnedMeshRenderPBS_GetSurfaceTextureAssetID(::System::IntPtr renderPart);
// static public ovrAvatarRenderPart_SkinnedMeshRenderPBS ovrAvatarRenderPart_GetSkinnedMeshRenderPBS(System.IntPtr renderPart)
// Offset: 0x132BACC
static ::GlobalNamespace::ovrAvatarRenderPart_SkinnedMeshRenderPBS ovrAvatarRenderPart_GetSkinnedMeshRenderPBS(::System::IntPtr renderPart);
// static private System.IntPtr ovrAvatarRenderPart_GetSkinnedMeshRenderPBS_Native(System.IntPtr renderPart)
// Offset: 0x132BC20
static ::System::IntPtr ovrAvatarRenderPart_GetSkinnedMeshRenderPBS_Native(::System::IntPtr renderPart);
// static public ovrAvatarRenderPart_SkinnedMeshRenderPBS_V2 ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2(System.IntPtr renderPart)
// Offset: 0x132BCA0
static ::GlobalNamespace::ovrAvatarRenderPart_SkinnedMeshRenderPBS_V2 ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2(::System::IntPtr renderPart);
// static private System.IntPtr ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2_Native(System.IntPtr renderPart)
// Offset: 0x132BDF4
static ::System::IntPtr ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2_Native(::System::IntPtr renderPart);
// static public System.Void ovrAvatarSkinnedMeshRender_GetBlendShapeParams(System.IntPtr renderPart, ref ovrAvatarBlendShapeParams blendParams)
// Offset: 0x132BE74
static void ovrAvatarSkinnedMeshRender_GetBlendShapeParams(::System::IntPtr renderPart, ByRef<::GlobalNamespace::ovrAvatarBlendShapeParams> blendParams);
// static private System.IntPtr ovrAvatarSkinnedMeshRender_GetBlendShapeParams_Native(System.IntPtr renderPart)
// Offset: 0x132BFB0
static ::System::IntPtr ovrAvatarSkinnedMeshRender_GetBlendShapeParams_Native(::System::IntPtr renderPart);
// static public ovrAvatarRenderPart_ProjectorRender ovrAvatarRenderPart_GetProjectorRender(System.IntPtr renderPart)
// Offset: 0x132C030
static ::GlobalNamespace::ovrAvatarRenderPart_ProjectorRender ovrAvatarRenderPart_GetProjectorRender(::System::IntPtr renderPart);
// static public ovrAvatarPBSMaterialState[] ovrAvatar_GetBodyPBSMaterialStates(System.IntPtr renderPart)
// Offset: 0x132C204
static ::ArrayW<::GlobalNamespace::ovrAvatarPBSMaterialState> ovrAvatar_GetBodyPBSMaterialStates(::System::IntPtr renderPart);
// static private System.IntPtr ovrAvatar_GetBodyPBSMaterialStates_Native(System.IntPtr avatar, System.IntPtr count)
// Offset: 0x132C4E4
static ::System::IntPtr ovrAvatar_GetBodyPBSMaterialStates_Native(::System::IntPtr avatar, ::System::IntPtr count);
// static private System.IntPtr ovrAvatarRenderPart_GetProjectorRender_Native(System.IntPtr renderPart)
// Offset: 0x132C184
static ::System::IntPtr ovrAvatarRenderPart_GetProjectorRender_Native(::System::IntPtr renderPart);
// static public System.UInt32 ovrAvatar_GetReferencedAssetCount(System.IntPtr avatar)
// Offset: 0x132C574
static uint ovrAvatar_GetReferencedAssetCount(::System::IntPtr avatar);
// static public System.UInt64 ovrAvatar_GetReferencedAsset(System.IntPtr avatar, System.UInt32 index)
// Offset: 0x132C5F4
static uint64_t ovrAvatar_GetReferencedAsset(::System::IntPtr avatar, uint index);
// static public System.Void ovrAvatar_SetLeftHandGesture(System.IntPtr avatar, ovrAvatarHandGesture gesture)
// Offset: 0x132C684
static void ovrAvatar_SetLeftHandGesture(::System::IntPtr avatar, ::GlobalNamespace::ovrAvatarHandGesture gesture);
// static public System.Void ovrAvatar_SetRightHandGesture(System.IntPtr avatar, ovrAvatarHandGesture gesture)
// Offset: 0x132C714
static void ovrAvatar_SetRightHandGesture(::System::IntPtr avatar, ::GlobalNamespace::ovrAvatarHandGesture gesture);
// static public System.Void ovrAvatar_SetLeftHandCustomGesture(System.IntPtr avatar, System.UInt32 jointCount, in ovrAvatarTransform[] customJointTransforms)
// Offset: 0x132C7A4
static void ovrAvatar_SetLeftHandCustomGesture(::System::IntPtr avatar, uint jointCount, ByRef<::ArrayW<::GlobalNamespace::ovrAvatarTransform>> customJointTransforms);
// static public System.Void ovrAvatar_SetRightHandCustomGesture(System.IntPtr avatar, System.UInt32 jointCount, in ovrAvatarTransform[] customJointTransforms)
// Offset: 0x132C844
static void ovrAvatar_SetRightHandCustomGesture(::System::IntPtr avatar, uint jointCount, ByRef<::ArrayW<::GlobalNamespace::ovrAvatarTransform>> customJointTransforms);
// static public System.Void ovrAvatar_UpdatePoseFromPacket(System.IntPtr avatar, System.IntPtr packet, System.Single secondsFromStart)
// Offset: 0x132C8E4
static void ovrAvatar_UpdatePoseFromPacket(::System::IntPtr avatar, ::System::IntPtr packet, float secondsFromStart);
// static public System.Void ovrAvatarPacket_BeginRecording(System.IntPtr avatar)
// Offset: 0x132C984
static void ovrAvatarPacket_BeginRecording(::System::IntPtr avatar);
// static public System.IntPtr ovrAvatarPacket_EndRecording(System.IntPtr avatar)
// Offset: 0x132CA04
static ::System::IntPtr ovrAvatarPacket_EndRecording(::System::IntPtr avatar);
// static public System.UInt32 ovrAvatarPacket_GetSize(System.IntPtr packet)
// Offset: 0x132CA84
static uint ovrAvatarPacket_GetSize(::System::IntPtr packet);
// static public System.Single ovrAvatarPacket_GetDurationSeconds(System.IntPtr packet)
// Offset: 0x132CB04
static float ovrAvatarPacket_GetDurationSeconds(::System::IntPtr packet);
// static public System.Void ovrAvatarPacket_Free(System.IntPtr packet)
// Offset: 0x132CB84
static void ovrAvatarPacket_Free(::System::IntPtr packet);
// static public System.Boolean ovrAvatarPacket_Write(System.IntPtr packet, System.UInt32 bufferSize, out System.Byte[] buffer)
// Offset: 0x132CC04
static bool ovrAvatarPacket_Write(::System::IntPtr packet, uint bufferSize, ByRef<::ArrayW<uint8_t>> buffer);
// static public System.IntPtr ovrAvatarPacket_Read(System.UInt32 bufferSize, in System.Byte[] buffer)
// Offset: 0x132CD2C
static ::System::IntPtr ovrAvatarPacket_Read(uint bufferSize, ByRef<::ArrayW<uint8_t>> buffer);
// static private System.Void ovrAvatar_SetInternalForceASTCTextures(System.Boolean value)
// Offset: 0x132CDC4
static void ovrAvatar_SetInternalForceASTCTextures(bool value);
// static public System.Void ovrAvatar_SetForceASTCTextures(System.Boolean value)
// Offset: 0x132CE44
static void ovrAvatar_SetForceASTCTextures(bool value);
// static public System.Void ovrAvatar_OverrideExpressiveLogic(System.IntPtr avatar, ovrAvatarBlendShapeParams blendParams)
// Offset: 0x132CEA4
static void ovrAvatar_OverrideExpressiveLogic(::System::IntPtr avatar, ::GlobalNamespace::ovrAvatarBlendShapeParams blendParams);
// static private System.Void ovrAvatar_OverrideExpressiveLogic_Native(System.IntPtr avatar, System.IntPtr state)
// Offset: 0x132CFEC
static void ovrAvatar_OverrideExpressiveLogic_Native(::System::IntPtr avatar, ::System::IntPtr state);
// static public System.Void ovrAvatar_SetVisemes(System.IntPtr avatar, ovrAvatarVisemes visemes)
// Offset: 0x132D07C
static void ovrAvatar_SetVisemes(::System::IntPtr avatar, ::GlobalNamespace::ovrAvatarVisemes visemes);
// static private System.Void ovrAvatar_SetVisemes_Native(System.IntPtr avatar, System.IntPtr visemes)
// Offset: 0x132D1D4
static void ovrAvatar_SetVisemes_Native(::System::IntPtr avatar, ::System::IntPtr visemes);
// static public System.Void ovrAvatar_UpdateWorldTransform(System.IntPtr avatar, ovrAvatarTransform transform)
// Offset: 0x132D264
static void ovrAvatar_UpdateWorldTransform(::System::IntPtr avatar, ::GlobalNamespace::ovrAvatarTransform transform);
// static public System.Void ovrAvatar_UpdateGazeTargets(ovrAvatarGazeTargets targets)
// Offset: 0x132D304
static void ovrAvatar_UpdateGazeTargets(::GlobalNamespace::ovrAvatarGazeTargets targets);
// static private System.Void ovrAvatar_UpdateGazeTargets_Native(System.IntPtr targets)
// Offset: 0x132D6D4
static void ovrAvatar_UpdateGazeTargets_Native(::System::IntPtr targets);
// static public System.Void ovrAvatar_RemoveGazeTargets(System.UInt32 targetCount, System.UInt32[] ids)
// Offset: 0x132D754
static void ovrAvatar_RemoveGazeTargets(uint targetCount, ::ArrayW<uint> ids);
// static public System.Void ovrAvatar_UpdateLights(ovrAvatarLights lights)
// Offset: 0x132D7EC
static void ovrAvatar_UpdateLights(::GlobalNamespace::ovrAvatarLights lights);
// static private System.Void ovrAvatar_UpdateLights_Native(System.IntPtr lights)
// Offset: 0x132E04C
static void ovrAvatar_UpdateLights_Native(::System::IntPtr lights);
// static public System.Void ovrAvatar_RemoveLights(System.UInt32 lightCount, System.UInt32[] ids)
// Offset: 0x132E0CC
static void ovrAvatar_RemoveLights(uint lightCount, ::ArrayW<uint> ids);
// static public System.Void LoggingCallback(System.IntPtr str)
// Offset: 0x1327498
static void LoggingCallback(::System::IntPtr str);
// static public System.Void ovrAvatar_RegisterLoggingCallback(Oculus.Avatar.CAPI/Oculus.Avatar.LoggingDelegate callback)
// Offset: 0x132E164
static void ovrAvatar_RegisterLoggingCallback(::Oculus::Avatar::CAPI::LoggingDelegate* callback);
// static public System.Void ovrAvatar_SetLoggingLevel(ovrAvatarLogLevel level)
// Offset: 0x132E1E8
static void ovrAvatar_SetLoggingLevel(::GlobalNamespace::ovrAvatarLogLevel level);
// static public System.IntPtr ovrAvatar_GetDebugTransforms_Native(System.IntPtr count)
// Offset: 0x132E268
static ::System::IntPtr ovrAvatar_GetDebugTransforms_Native(::System::IntPtr count);
// static public System.IntPtr ovrAvatar_GetDebugLines_Native(System.IntPtr count)
// Offset: 0x132E2E8
static ::System::IntPtr ovrAvatar_GetDebugLines_Native(::System::IntPtr count);
// static public System.Void ovrAvatar_DrawDebugLines()
// Offset: 0x132E368
static void ovrAvatar_DrawDebugLines();
// static public System.Void ovrAvatar_SetDebugDrawContext(System.UInt32 context)
// Offset: 0x132ED2C
static void ovrAvatar_SetDebugDrawContext(uint context);
// static public System.Boolean SendEvent(System.String name, System.String param, System.String source)
// Offset: 0x132EDAC
static bool SendEvent(::StringW name, ::StringW param, ::StringW source);
// static private System.IntPtr _ovrp_GetVersion()
// Offset: 0x132F1CC
static ::System::IntPtr _ovrp_GetVersion();
// static public System.String ovrp_GetVersion()
// Offset: 0x132F134
static ::StringW ovrp_GetVersion();
// public System.Void .ctor()
// Offset: 0x132F240
// Implemented from: System.Object
// Base method: System.Void Object::.ctor()
template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary>
static CAPI* New_ctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Avatar::CAPI::.ctor");
return THROW_UNLESS((::il2cpp_utils::New<CAPI*, creationType>()));
}
}; // Oculus.Avatar.CAPI
#pragma pack(pop)
}
#include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp"
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::_cctor
// Il2CppName: .cctor
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)()>(&Oculus::Avatar::CAPI::_cctor)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), ".cctor", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_InitializeAndroidUnity
// Il2CppName: ovrAvatar_InitializeAndroidUnity
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::StringW)>(&Oculus::Avatar::CAPI::ovrAvatar_InitializeAndroidUnity)> {
static const MethodInfo* get() {
static auto* appID = &::il2cpp_utils::GetClassFromName("System", "String")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_InitializeAndroidUnity", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{appID});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::Initialize
// Il2CppName: Initialize
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)()>(&Oculus::Avatar::CAPI::Initialize)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "Initialize", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::Shutdown
// Il2CppName: Shutdown
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)()>(&Oculus::Avatar::CAPI::Shutdown)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "Shutdown", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_Shutdown
// Il2CppName: ovrAvatar_Shutdown
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)()>(&Oculus::Avatar::CAPI::ovrAvatar_Shutdown)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_Shutdown", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarMessage_Pop
// Il2CppName: ovrAvatarMessage_Pop
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)()>(&Oculus::Avatar::CAPI::ovrAvatarMessage_Pop)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarMessage_Pop", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarMessage_GetType
// Il2CppName: ovrAvatarMessage_GetType
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarMessageType (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarMessage_GetType)> {
static const MethodInfo* get() {
static auto* msg = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarMessage_GetType", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{msg});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarMessage_GetAvatarSpecification
// Il2CppName: ovrAvatarMessage_GetAvatarSpecification
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarMessage_AvatarSpecification (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarMessage_GetAvatarSpecification)> {
static const MethodInfo* get() {
static auto* msg = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarMessage_GetAvatarSpecification", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{msg});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarMessage_GetAvatarSpecification_Native
// Il2CppName: ovrAvatarMessage_GetAvatarSpecification_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarMessage_GetAvatarSpecification_Native)> {
static const MethodInfo* get() {
static auto* msg = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarMessage_GetAvatarSpecification_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{msg});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarMessage_GetAssetLoaded
// Il2CppName: ovrAvatarMessage_GetAssetLoaded
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarMessage_AssetLoaded (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarMessage_GetAssetLoaded)> {
static const MethodInfo* get() {
static auto* msg = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarMessage_GetAssetLoaded", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{msg});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarMessage_GetAssetLoaded_Native
// Il2CppName: ovrAvatarMessage_GetAssetLoaded_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarMessage_GetAssetLoaded_Native)> {
static const MethodInfo* get() {
static auto* msg = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarMessage_GetAssetLoaded_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{msg});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarMessage_Free
// Il2CppName: ovrAvatarMessage_Free
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarMessage_Free)> {
static const MethodInfo* get() {
static auto* msg = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarMessage_Free", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{msg});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_Create
// Il2CppName: ovrAvatarSpecificationRequest_Create
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(uint64_t)>(&Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_Create)> {
static const MethodInfo* get() {
static auto* userID = &::il2cpp_utils::GetClassFromName("System", "UInt64")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSpecificationRequest_Create", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{userID});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_Destroy
// Il2CppName: ovrAvatarSpecificationRequest_Destroy
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_Destroy)> {
static const MethodInfo* get() {
static auto* specificationRequest = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSpecificationRequest_Destroy", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{specificationRequest});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_SetCombineMeshes
// Il2CppName: ovrAvatarSpecificationRequest_SetCombineMeshes
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, bool)>(&Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_SetCombineMeshes)> {
static const MethodInfo* get() {
static auto* specificationRequest = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* useCombinedMesh = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSpecificationRequest_SetCombineMeshes", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{specificationRequest, useCombinedMesh});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_SetLookAndFeelVersion
// Il2CppName: ovrAvatarSpecificationRequest_SetLookAndFeelVersion
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarLookAndFeelVersion)>(&Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_SetLookAndFeelVersion)> {
static const MethodInfo* get() {
static auto* specificationRequest = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* version = &::il2cpp_utils::GetClassFromName("", "ovrAvatarLookAndFeelVersion")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSpecificationRequest_SetLookAndFeelVersion", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{specificationRequest, version});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_SetLevelOfDetail
// Il2CppName: ovrAvatarSpecificationRequest_SetLevelOfDetail
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarAssetLevelOfDetail)>(&Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_SetLevelOfDetail)> {
static const MethodInfo* get() {
static auto* specificationRequest = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* lod = &::il2cpp_utils::GetClassFromName("", "ovrAvatarAssetLevelOfDetail")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSpecificationRequest_SetLevelOfDetail", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{specificationRequest, lod});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_RequestAvatarSpecification
// Il2CppName: ovrAvatar_RequestAvatarSpecification
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(uint64_t)>(&Oculus::Avatar::CAPI::ovrAvatar_RequestAvatarSpecification)> {
static const MethodInfo* get() {
static auto* userID = &::il2cpp_utils::GetClassFromName("System", "UInt64")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_RequestAvatarSpecification", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{userID});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_RequestAvatarSpecificationFromSpecRequest
// Il2CppName: ovrAvatar_RequestAvatarSpecificationFromSpecRequest
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_RequestAvatarSpecificationFromSpecRequest)> {
static const MethodInfo* get() {
static auto* specificationRequest = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_RequestAvatarSpecificationFromSpecRequest", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{specificationRequest});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_SetFallbackLookAndFeelVersion
// Il2CppName: ovrAvatarSpecificationRequest_SetFallbackLookAndFeelVersion
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarLookAndFeelVersion)>(&Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_SetFallbackLookAndFeelVersion)> {
static const MethodInfo* get() {
static auto* specificationRequest = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* version = &::il2cpp_utils::GetClassFromName("", "ovrAvatarLookAndFeelVersion")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSpecificationRequest_SetFallbackLookAndFeelVersion", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{specificationRequest, version});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_SetExpressiveFlag
// Il2CppName: ovrAvatarSpecificationRequest_SetExpressiveFlag
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, bool)>(&Oculus::Avatar::CAPI::ovrAvatarSpecificationRequest_SetExpressiveFlag)> {
static const MethodInfo* get() {
static auto* specificationRequest = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* enable = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSpecificationRequest_SetExpressiveFlag", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{specificationRequest, enable});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_Create
// Il2CppName: ovrAvatar_Create
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarCapabilities)>(&Oculus::Avatar::CAPI::ovrAvatar_Create)> {
static const MethodInfo* get() {
static auto* avatarSpecification = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* capabilities = &::il2cpp_utils::GetClassFromName("", "ovrAvatarCapabilities")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_Create", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatarSpecification, capabilities});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_Destroy
// Il2CppName: ovrAvatar_Destroy
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_Destroy)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_Destroy", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_UpdateBody
// Il2CppName: ovrAvatarPose_UpdateBody
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarTransform)>(&Oculus::Avatar::CAPI::ovrAvatarPose_UpdateBody)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* headPose = &::il2cpp_utils::GetClassFromName("", "ovrAvatarTransform")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_UpdateBody", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, headPose});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_UpdateVoiceVisualization
// Il2CppName: ovrAvatarPose_UpdateVoiceVisualization
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::ArrayW<float>)>(&Oculus::Avatar::CAPI::ovrAvatarPose_UpdateVoiceVisualization)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* pcmData = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "Single"), 1)->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_UpdateVoiceVisualization", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, pcmData});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_UpdateVoiceVisualization_Native
// Il2CppName: ovrAvatarPose_UpdateVoiceVisualization_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, uint, ByRef<::ArrayW<float>>)>(&Oculus::Avatar::CAPI::ovrAvatarPose_UpdateVoiceVisualization_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* pcmDataSize = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
static auto* pcmData = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "Single"), 1)->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_UpdateVoiceVisualization_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, pcmDataSize, pcmData});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_UpdateHands
// Il2CppName: ovrAvatarPose_UpdateHands
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarHandInputState, ::GlobalNamespace::ovrAvatarHandInputState)>(&Oculus::Avatar::CAPI::ovrAvatarPose_UpdateHands)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* inputStateLeft = &::il2cpp_utils::GetClassFromName("", "ovrAvatarHandInputState")->byval_arg;
static auto* inputStateRight = &::il2cpp_utils::GetClassFromName("", "ovrAvatarHandInputState")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_UpdateHands", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, inputStateLeft, inputStateRight});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_UpdateHandsWithType
// Il2CppName: ovrAvatarPose_UpdateHandsWithType
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarHandInputState, ::GlobalNamespace::ovrAvatarHandInputState, ::GlobalNamespace::ovrAvatarControllerType)>(&Oculus::Avatar::CAPI::ovrAvatarPose_UpdateHandsWithType)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* inputStateLeft = &::il2cpp_utils::GetClassFromName("", "ovrAvatarHandInputState")->byval_arg;
static auto* inputStateRight = &::il2cpp_utils::GetClassFromName("", "ovrAvatarHandInputState")->byval_arg;
static auto* type = &::il2cpp_utils::GetClassFromName("", "ovrAvatarControllerType")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_UpdateHandsWithType", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, inputStateLeft, inputStateRight, type});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_Finalize
// Il2CppName: ovrAvatarPose_Finalize
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, float)>(&Oculus::Avatar::CAPI::ovrAvatarPose_Finalize)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* elapsedSeconds = &::il2cpp_utils::GetClassFromName("System", "Single")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_Finalize", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, elapsedSeconds});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetLeftControllerVisibility
// Il2CppName: ovrAvatar_SetLeftControllerVisibility
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, bool)>(&Oculus::Avatar::CAPI::ovrAvatar_SetLeftControllerVisibility)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* show = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetLeftControllerVisibility", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, show});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetRightControllerVisibility
// Il2CppName: ovrAvatar_SetRightControllerVisibility
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, bool)>(&Oculus::Avatar::CAPI::ovrAvatar_SetRightControllerVisibility)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* show = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetRightControllerVisibility", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, show});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetLeftHandVisibility
// Il2CppName: ovrAvatar_SetLeftHandVisibility
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, bool)>(&Oculus::Avatar::CAPI::ovrAvatar_SetLeftHandVisibility)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* show = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetLeftHandVisibility", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, show});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetRightHandVisibility
// Il2CppName: ovrAvatar_SetRightHandVisibility
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, bool)>(&Oculus::Avatar::CAPI::ovrAvatar_SetRightHandVisibility)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* show = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetRightHandVisibility", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, show});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarComponent_Count
// Il2CppName: ovrAvatarComponent_Count
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarComponent_Count)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarComponent_Count", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarComponent_Get
// Il2CppName: ovrAvatarComponent_Get
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, uint, bool, ByRef<::GlobalNamespace::ovrAvatarComponent>)>(&Oculus::Avatar::CAPI::ovrAvatarComponent_Get)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* index = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
static auto* includeName = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
static auto* component = &::il2cpp_utils::GetClassFromName("", "ovrAvatarComponent")->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarComponent_Get", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, index, includeName, component});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarComponent_Get
// Il2CppName: ovrAvatarComponent_Get
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, bool, ByRef<::GlobalNamespace::ovrAvatarComponent>)>(&Oculus::Avatar::CAPI::ovrAvatarComponent_Get)> {
static const MethodInfo* get() {
static auto* componentPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* includeName = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
static auto* component = &::il2cpp_utils::GetClassFromName("", "ovrAvatarComponent")->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarComponent_Get", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{componentPtr, includeName, component});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarComponent_Get_Native
// Il2CppName: ovrAvatarComponent_Get_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr, uint)>(&Oculus::Avatar::CAPI::ovrAvatarComponent_Get_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* index = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarComponent_Get_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, index});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetBaseComponent
// Il2CppName: ovrAvatarPose_GetBaseComponent
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::System::IntPtr, ByRef<::GlobalNamespace::ovrAvatarBaseComponent>)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetBaseComponent)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* component = &::il2cpp_utils::GetClassFromName("", "ovrAvatarBaseComponent")->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetBaseComponent", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, component});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetBaseComponent_Native
// Il2CppName: ovrAvatarPose_GetBaseComponent_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetBaseComponent_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetBaseComponent_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::MarshalRenderComponent
// Il2CppName: MarshalRenderComponent
// Cannot write MetadataGetter for generic methods!
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetBodyComponent
// Il2CppName: ovrAvatarPose_GetBodyComponent
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::System::IntPtr, ByRef<::GlobalNamespace::ovrAvatarBodyComponent>)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetBodyComponent)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* component = &::il2cpp_utils::GetClassFromName("", "ovrAvatarBodyComponent")->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetBodyComponent", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, component});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetBodyComponent_Native
// Il2CppName: ovrAvatarPose_GetBodyComponent_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetBodyComponent_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetBodyComponent_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetLeftControllerComponent
// Il2CppName: ovrAvatarPose_GetLeftControllerComponent
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::System::IntPtr, ByRef<::GlobalNamespace::ovrAvatarControllerComponent>)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetLeftControllerComponent)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* component = &::il2cpp_utils::GetClassFromName("", "ovrAvatarControllerComponent")->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetLeftControllerComponent", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, component});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetLeftControllerComponent_Native
// Il2CppName: ovrAvatarPose_GetLeftControllerComponent_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetLeftControllerComponent_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetLeftControllerComponent_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetRightControllerComponent
// Il2CppName: ovrAvatarPose_GetRightControllerComponent
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::System::IntPtr, ByRef<::GlobalNamespace::ovrAvatarControllerComponent>)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetRightControllerComponent)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* component = &::il2cpp_utils::GetClassFromName("", "ovrAvatarControllerComponent")->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetRightControllerComponent", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, component});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetRightControllerComponent_Native
// Il2CppName: ovrAvatarPose_GetRightControllerComponent_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetRightControllerComponent_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetRightControllerComponent_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetLeftHandComponent
// Il2CppName: ovrAvatarPose_GetLeftHandComponent
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::System::IntPtr, ByRef<::GlobalNamespace::ovrAvatarHandComponent>)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetLeftHandComponent)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* component = &::il2cpp_utils::GetClassFromName("", "ovrAvatarHandComponent")->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetLeftHandComponent", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, component});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetLeftHandComponent_Native
// Il2CppName: ovrAvatarPose_GetLeftHandComponent_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetLeftHandComponent_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetLeftHandComponent_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetRightHandComponent
// Il2CppName: ovrAvatarPose_GetRightHandComponent
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::System::IntPtr, ByRef<::GlobalNamespace::ovrAvatarHandComponent>)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetRightHandComponent)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* component = &::il2cpp_utils::GetClassFromName("", "ovrAvatarHandComponent")->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetRightHandComponent", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, component});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPose_GetRightHandComponent_Native
// Il2CppName: ovrAvatarPose_GetRightHandComponent_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPose_GetRightHandComponent_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPose_GetRightHandComponent_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_BeginLoading
// Il2CppName: ovrAvatarAsset_BeginLoading
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(uint64_t)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_BeginLoading)> {
static const MethodInfo* get() {
static auto* assetID = &::il2cpp_utils::GetClassFromName("System", "UInt64")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_BeginLoading", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetID});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_BeginLoadingLOD
// Il2CppName: ovrAvatarAsset_BeginLoadingLOD
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(uint64_t, ::GlobalNamespace::ovrAvatarAssetLevelOfDetail)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_BeginLoadingLOD)> {
static const MethodInfo* get() {
static auto* assetId = &::il2cpp_utils::GetClassFromName("System", "UInt64")->byval_arg;
static auto* lod = &::il2cpp_utils::GetClassFromName("", "ovrAvatarAssetLevelOfDetail")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_BeginLoadingLOD", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetId, lod});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetType
// Il2CppName: ovrAvatarAsset_GetType
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarAssetType (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetType)> {
static const MethodInfo* get() {
static auto* assetHandle = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetType", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetHandle});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetMeshData
// Il2CppName: ovrAvatarAsset_GetMeshData
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarMeshAssetData (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetMeshData)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetMeshData", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetCombinedMeshData
// Il2CppName: ovrAvatarAsset_GetCombinedMeshData
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarMeshAssetDataV2 (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetCombinedMeshData)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetCombinedMeshData", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetCombinedMeshData_Native
// Il2CppName: ovrAvatarAsset_GetCombinedMeshData_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetCombinedMeshData_Native)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetCombinedMeshData_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetMeshData_Native
// Il2CppName: ovrAvatarAsset_GetMeshData_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetMeshData_Native)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetMeshData_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetMeshBlendShapeCount
// Il2CppName: ovrAvatarAsset_GetMeshBlendShapeCount
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetMeshBlendShapeCount)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetMeshBlendShapeCount", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetMeshBlendShapeName
// Il2CppName: ovrAvatarAsset_GetMeshBlendShapeName
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr, uint)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetMeshBlendShapeName)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* index = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetMeshBlendShapeName", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr, index});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetSubmeshCount
// Il2CppName: ovrAvatarAsset_GetSubmeshCount
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetSubmeshCount)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetSubmeshCount", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetSubmeshLastIndex
// Il2CppName: ovrAvatarAsset_GetSubmeshLastIndex
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint (*)(::System::IntPtr, uint)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetSubmeshLastIndex)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* index = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetSubmeshLastIndex", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr, index});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetMeshBlendShapeVertices
// Il2CppName: ovrAvatarAsset_GetMeshBlendShapeVertices
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetMeshBlendShapeVertices)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetMeshBlendShapeVertices", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetAvatar
// Il2CppName: ovrAvatarAsset_GetAvatar
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetAvatar)> {
static const MethodInfo* get() {
static auto* assetHandle = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetAvatar", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetHandle});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetCombinedMeshIDs
// Il2CppName: ovrAvatarAsset_GetCombinedMeshIDs
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::ArrayW<uint64_t> (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetCombinedMeshIDs)> {
static const MethodInfo* get() {
static auto* assetHandle = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetCombinedMeshIDs", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetHandle});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetCombinedMeshIDs_Native
// Il2CppName: ovrAvatarAsset_GetCombinedMeshIDs_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr, ::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetCombinedMeshIDs_Native)> {
static const MethodInfo* get() {
static auto* assetHandle = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* count = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetCombinedMeshIDs_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetHandle, count});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_GetCombinedMeshAlphaData
// Il2CppName: ovrAvatar_GetCombinedMeshAlphaData
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ByRef<uint64_t>, ByRef<::UnityEngine::Vector4>)>(&Oculus::Avatar::CAPI::ovrAvatar_GetCombinedMeshAlphaData)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* textureID = &::il2cpp_utils::GetClassFromName("System", "UInt64")->this_arg;
static auto* offset = &::il2cpp_utils::GetClassFromName("UnityEngine", "Vector4")->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_GetCombinedMeshAlphaData", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, textureID, offset});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_GetCombinedMeshAlphaData_Native
// Il2CppName: ovrAvatar_GetCombinedMeshAlphaData_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr, ::System::IntPtr, ::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_GetCombinedMeshAlphaData_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* textureIDPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* offsetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_GetCombinedMeshAlphaData_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, textureIDPtr, offsetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetTextureData
// Il2CppName: ovrAvatarAsset_GetTextureData
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarTextureAssetData (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetTextureData)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetTextureData", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetTextureData_Native
// Il2CppName: ovrAvatarAsset_GetTextureData_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetTextureData_Native)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetTextureData_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetMaterialData_Native
// Il2CppName: ovrAvatarAsset_GetMaterialData_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetMaterialData_Native)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetMaterialData_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarAsset_GetMaterialState
// Il2CppName: ovrAvatarAsset_GetMaterialState
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarMaterialState (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarAsset_GetMaterialState)> {
static const MethodInfo* get() {
static auto* assetPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarAsset_GetMaterialState", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{assetPtr});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetType
// Il2CppName: ovrAvatarRenderPart_GetType
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarRenderPartType (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetType)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarRenderPart_GetType", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRender
// Il2CppName: ovrAvatarRenderPart_GetSkinnedMeshRender
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarRenderPart_SkinnedMeshRender (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRender)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarRenderPart_GetSkinnedMeshRender", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRender_Native
// Il2CppName: ovrAvatarRenderPart_GetSkinnedMeshRender_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRender_Native)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarRenderPart_GetSkinnedMeshRender_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetTransform
// Il2CppName: ovrAvatarSkinnedMeshRender_GetTransform
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarTransform (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetTransform)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRender_GetTransform", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetTransform
// Il2CppName: ovrAvatarSkinnedMeshRenderPBS_GetTransform
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarTransform (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetTransform)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBS_GetTransform", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_GetTransform
// Il2CppName: ovrAvatarSkinnedMeshRenderPBSV2_GetTransform
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarTransform (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_GetTransform)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBSV2_GetTransform", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetVisibilityMask
// Il2CppName: ovrAvatarSkinnedMeshRender_GetVisibilityMask
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarVisibilityFlags (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetVisibilityMask)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRender_GetVisibilityMask", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_MaterialStateChanged
// Il2CppName: ovrAvatarSkinnedMeshRender_MaterialStateChanged
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_MaterialStateChanged)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRender_MaterialStateChanged", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_MaterialStateChanged
// Il2CppName: ovrAvatarSkinnedMeshRenderPBSV2_MaterialStateChanged
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_MaterialStateChanged)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBSV2_MaterialStateChanged", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetVisibilityMask
// Il2CppName: ovrAvatarSkinnedMeshRenderPBS_GetVisibilityMask
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarVisibilityFlags (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetVisibilityMask)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBS_GetVisibilityMask", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_GetVisibilityMask
// Il2CppName: ovrAvatarSkinnedMeshRenderPBSV2_GetVisibilityMask
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarVisibilityFlags (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_GetVisibilityMask)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBSV2_GetVisibilityMask", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetMaterialState
// Il2CppName: ovrAvatarSkinnedMeshRender_GetMaterialState
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarMaterialState (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetMaterialState)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRender_GetMaterialState", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_GetPBSMaterialState
// Il2CppName: ovrAvatarSkinnedMeshRenderPBSV2_GetPBSMaterialState
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarPBSMaterialState (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_GetPBSMaterialState)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBSV2_GetPBSMaterialState", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_GetExpressiveParameters
// Il2CppName: ovrAvatar_GetExpressiveParameters
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarExpressiveParameters (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_GetExpressiveParameters)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_GetExpressiveParameters", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetDirtyJoints
// Il2CppName: ovrAvatarSkinnedMeshRender_GetDirtyJoints
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint64_t (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetDirtyJoints)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRender_GetDirtyJoints", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetDirtyJoints
// Il2CppName: ovrAvatarSkinnedMeshRenderPBS_GetDirtyJoints
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint64_t (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetDirtyJoints)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBS_GetDirtyJoints", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_GetDirtyJoints
// Il2CppName: ovrAvatarSkinnedMeshRenderPBSV2_GetDirtyJoints
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint64_t (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_GetDirtyJoints)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBSV2_GetDirtyJoints", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetJointTransform
// Il2CppName: ovrAvatarSkinnedMeshRender_GetJointTransform
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarTransform (*)(::System::IntPtr, uint)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetJointTransform)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* jointIndex = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRender_GetJointTransform", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart, jointIndex});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetActionUnitOnsetSpeed
// Il2CppName: ovrAvatar_SetActionUnitOnsetSpeed
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, float)>(&Oculus::Avatar::CAPI::ovrAvatar_SetActionUnitOnsetSpeed)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* onsetSpeed = &::il2cpp_utils::GetClassFromName("System", "Single")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetActionUnitOnsetSpeed", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, onsetSpeed});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetActionUnitFalloffSpeed
// Il2CppName: ovrAvatar_SetActionUnitFalloffSpeed
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, float)>(&Oculus::Avatar::CAPI::ovrAvatar_SetActionUnitFalloffSpeed)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* falloffSpeed = &::il2cpp_utils::GetClassFromName("System", "Single")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetActionUnitFalloffSpeed", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, falloffSpeed});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetVisemeMultiplier
// Il2CppName: ovrAvatar_SetVisemeMultiplier
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, float)>(&Oculus::Avatar::CAPI::ovrAvatar_SetVisemeMultiplier)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* visemeMultiplier = &::il2cpp_utils::GetClassFromName("System", "Single")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetVisemeMultiplier", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, visemeMultiplier});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetJointTransform
// Il2CppName: ovrAvatarSkinnedMeshRenderPBS_GetJointTransform
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarTransform (*)(::System::IntPtr, uint)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetJointTransform)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* jointIndex = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBS_GetJointTransform", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart, jointIndex});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_GetJointTransform
// Il2CppName: ovrAvatarSkinnedMeshRenderPBSV2_GetJointTransform
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarTransform (*)(::System::IntPtr, uint)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBSV2_GetJointTransform)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* jointIndex = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBSV2_GetJointTransform", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart, jointIndex});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetAlbedoTextureAssetID
// Il2CppName: ovrAvatarSkinnedMeshRenderPBS_GetAlbedoTextureAssetID
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint64_t (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetAlbedoTextureAssetID)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBS_GetAlbedoTextureAssetID", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetSurfaceTextureAssetID
// Il2CppName: ovrAvatarSkinnedMeshRenderPBS_GetSurfaceTextureAssetID
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint64_t (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRenderPBS_GetSurfaceTextureAssetID)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRenderPBS_GetSurfaceTextureAssetID", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRenderPBS
// Il2CppName: ovrAvatarRenderPart_GetSkinnedMeshRenderPBS
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarRenderPart_SkinnedMeshRenderPBS (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRenderPBS)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarRenderPart_GetSkinnedMeshRenderPBS", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRenderPBS_Native
// Il2CppName: ovrAvatarRenderPart_GetSkinnedMeshRenderPBS_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRenderPBS_Native)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarRenderPart_GetSkinnedMeshRenderPBS_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2
// Il2CppName: ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarRenderPart_SkinnedMeshRenderPBS_V2 (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2_Native
// Il2CppName: ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2_Native)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarRenderPart_GetSkinnedMeshRenderPBSV2_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetBlendShapeParams
// Il2CppName: ovrAvatarSkinnedMeshRender_GetBlendShapeParams
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ByRef<::GlobalNamespace::ovrAvatarBlendShapeParams>)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetBlendShapeParams)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* blendParams = &::il2cpp_utils::GetClassFromName("", "ovrAvatarBlendShapeParams")->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRender_GetBlendShapeParams", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart, blendParams});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetBlendShapeParams_Native
// Il2CppName: ovrAvatarSkinnedMeshRender_GetBlendShapeParams_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarSkinnedMeshRender_GetBlendShapeParams_Native)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarSkinnedMeshRender_GetBlendShapeParams_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetProjectorRender
// Il2CppName: ovrAvatarRenderPart_GetProjectorRender
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::GlobalNamespace::ovrAvatarRenderPart_ProjectorRender (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetProjectorRender)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarRenderPart_GetProjectorRender", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_GetBodyPBSMaterialStates
// Il2CppName: ovrAvatar_GetBodyPBSMaterialStates
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::ArrayW<::GlobalNamespace::ovrAvatarPBSMaterialState> (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_GetBodyPBSMaterialStates)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_GetBodyPBSMaterialStates", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_GetBodyPBSMaterialStates_Native
// Il2CppName: ovrAvatar_GetBodyPBSMaterialStates_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr, ::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_GetBodyPBSMaterialStates_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* count = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_GetBodyPBSMaterialStates_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, count});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetProjectorRender_Native
// Il2CppName: ovrAvatarRenderPart_GetProjectorRender_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarRenderPart_GetProjectorRender_Native)> {
static const MethodInfo* get() {
static auto* renderPart = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarRenderPart_GetProjectorRender_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{renderPart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_GetReferencedAssetCount
// Il2CppName: ovrAvatar_GetReferencedAssetCount
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_GetReferencedAssetCount)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_GetReferencedAssetCount", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_GetReferencedAsset
// Il2CppName: ovrAvatar_GetReferencedAsset
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint64_t (*)(::System::IntPtr, uint)>(&Oculus::Avatar::CAPI::ovrAvatar_GetReferencedAsset)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* index = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_GetReferencedAsset", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, index});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetLeftHandGesture
// Il2CppName: ovrAvatar_SetLeftHandGesture
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarHandGesture)>(&Oculus::Avatar::CAPI::ovrAvatar_SetLeftHandGesture)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* gesture = &::il2cpp_utils::GetClassFromName("", "ovrAvatarHandGesture")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetLeftHandGesture", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, gesture});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetRightHandGesture
// Il2CppName: ovrAvatar_SetRightHandGesture
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarHandGesture)>(&Oculus::Avatar::CAPI::ovrAvatar_SetRightHandGesture)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* gesture = &::il2cpp_utils::GetClassFromName("", "ovrAvatarHandGesture")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetRightHandGesture", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, gesture});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetLeftHandCustomGesture
// Il2CppName: ovrAvatar_SetLeftHandCustomGesture
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, uint, ByRef<::ArrayW<::GlobalNamespace::ovrAvatarTransform>>)>(&Oculus::Avatar::CAPI::ovrAvatar_SetLeftHandCustomGesture)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* jointCount = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
static auto* customJointTransforms = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("", "ovrAvatarTransform"), 1)->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetLeftHandCustomGesture", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, jointCount, customJointTransforms});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetRightHandCustomGesture
// Il2CppName: ovrAvatar_SetRightHandCustomGesture
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, uint, ByRef<::ArrayW<::GlobalNamespace::ovrAvatarTransform>>)>(&Oculus::Avatar::CAPI::ovrAvatar_SetRightHandCustomGesture)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* jointCount = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
static auto* customJointTransforms = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("", "ovrAvatarTransform"), 1)->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetRightHandCustomGesture", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, jointCount, customJointTransforms});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_UpdatePoseFromPacket
// Il2CppName: ovrAvatar_UpdatePoseFromPacket
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::System::IntPtr, float)>(&Oculus::Avatar::CAPI::ovrAvatar_UpdatePoseFromPacket)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* packet = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* secondsFromStart = &::il2cpp_utils::GetClassFromName("System", "Single")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_UpdatePoseFromPacket", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, packet, secondsFromStart});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPacket_BeginRecording
// Il2CppName: ovrAvatarPacket_BeginRecording
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPacket_BeginRecording)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPacket_BeginRecording", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPacket_EndRecording
// Il2CppName: ovrAvatarPacket_EndRecording
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPacket_EndRecording)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPacket_EndRecording", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPacket_GetSize
// Il2CppName: ovrAvatarPacket_GetSize
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPacket_GetSize)> {
static const MethodInfo* get() {
static auto* packet = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPacket_GetSize", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{packet});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPacket_GetDurationSeconds
// Il2CppName: ovrAvatarPacket_GetDurationSeconds
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<float (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPacket_GetDurationSeconds)> {
static const MethodInfo* get() {
static auto* packet = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPacket_GetDurationSeconds", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{packet});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPacket_Free
// Il2CppName: ovrAvatarPacket_Free
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatarPacket_Free)> {
static const MethodInfo* get() {
static auto* packet = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPacket_Free", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{packet});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPacket_Write
// Il2CppName: ovrAvatarPacket_Write
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::System::IntPtr, uint, ByRef<::ArrayW<uint8_t>>)>(&Oculus::Avatar::CAPI::ovrAvatarPacket_Write)> {
static const MethodInfo* get() {
static auto* packet = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* bufferSize = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
static auto* buffer = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "Byte"), 1)->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPacket_Write", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{packet, bufferSize, buffer});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatarPacket_Read
// Il2CppName: ovrAvatarPacket_Read
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(uint, ByRef<::ArrayW<uint8_t>>)>(&Oculus::Avatar::CAPI::ovrAvatarPacket_Read)> {
static const MethodInfo* get() {
static auto* bufferSize = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
static auto* buffer = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "Byte"), 1)->this_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatarPacket_Read", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{bufferSize, buffer});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetInternalForceASTCTextures
// Il2CppName: ovrAvatar_SetInternalForceASTCTextures
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(bool)>(&Oculus::Avatar::CAPI::ovrAvatar_SetInternalForceASTCTextures)> {
static const MethodInfo* get() {
static auto* value = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetInternalForceASTCTextures", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{value});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetForceASTCTextures
// Il2CppName: ovrAvatar_SetForceASTCTextures
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(bool)>(&Oculus::Avatar::CAPI::ovrAvatar_SetForceASTCTextures)> {
static const MethodInfo* get() {
static auto* value = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetForceASTCTextures", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{value});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_OverrideExpressiveLogic
// Il2CppName: ovrAvatar_OverrideExpressiveLogic
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarBlendShapeParams)>(&Oculus::Avatar::CAPI::ovrAvatar_OverrideExpressiveLogic)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* blendParams = &::il2cpp_utils::GetClassFromName("", "ovrAvatarBlendShapeParams")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_OverrideExpressiveLogic", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, blendParams});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_OverrideExpressiveLogic_Native
// Il2CppName: ovrAvatar_OverrideExpressiveLogic_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_OverrideExpressiveLogic_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* state = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_OverrideExpressiveLogic_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, state});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetVisemes
// Il2CppName: ovrAvatar_SetVisemes
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarVisemes)>(&Oculus::Avatar::CAPI::ovrAvatar_SetVisemes)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* visemes = &::il2cpp_utils::GetClassFromName("", "ovrAvatarVisemes")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetVisemes", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, visemes});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetVisemes_Native
// Il2CppName: ovrAvatar_SetVisemes_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_SetVisemes_Native)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* visemes = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetVisemes_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, visemes});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_UpdateWorldTransform
// Il2CppName: ovrAvatar_UpdateWorldTransform
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr, ::GlobalNamespace::ovrAvatarTransform)>(&Oculus::Avatar::CAPI::ovrAvatar_UpdateWorldTransform)> {
static const MethodInfo* get() {
static auto* avatar = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
static auto* transform = &::il2cpp_utils::GetClassFromName("", "ovrAvatarTransform")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_UpdateWorldTransform", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{avatar, transform});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_UpdateGazeTargets
// Il2CppName: ovrAvatar_UpdateGazeTargets
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::GlobalNamespace::ovrAvatarGazeTargets)>(&Oculus::Avatar::CAPI::ovrAvatar_UpdateGazeTargets)> {
static const MethodInfo* get() {
static auto* targets = &::il2cpp_utils::GetClassFromName("", "ovrAvatarGazeTargets")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_UpdateGazeTargets", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{targets});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_UpdateGazeTargets_Native
// Il2CppName: ovrAvatar_UpdateGazeTargets_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_UpdateGazeTargets_Native)> {
static const MethodInfo* get() {
static auto* targets = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_UpdateGazeTargets_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{targets});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_RemoveGazeTargets
// Il2CppName: ovrAvatar_RemoveGazeTargets
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(uint, ::ArrayW<uint>)>(&Oculus::Avatar::CAPI::ovrAvatar_RemoveGazeTargets)> {
static const MethodInfo* get() {
static auto* targetCount = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
static auto* ids = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "UInt32"), 1)->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_RemoveGazeTargets", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{targetCount, ids});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_UpdateLights
// Il2CppName: ovrAvatar_UpdateLights
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::GlobalNamespace::ovrAvatarLights)>(&Oculus::Avatar::CAPI::ovrAvatar_UpdateLights)> {
static const MethodInfo* get() {
static auto* lights = &::il2cpp_utils::GetClassFromName("", "ovrAvatarLights")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_UpdateLights", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{lights});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_UpdateLights_Native
// Il2CppName: ovrAvatar_UpdateLights_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_UpdateLights_Native)> {
static const MethodInfo* get() {
static auto* lights = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_UpdateLights_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{lights});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_RemoveLights
// Il2CppName: ovrAvatar_RemoveLights
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(uint, ::ArrayW<uint>)>(&Oculus::Avatar::CAPI::ovrAvatar_RemoveLights)> {
static const MethodInfo* get() {
static auto* lightCount = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
static auto* ids = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "UInt32"), 1)->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_RemoveLights", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{lightCount, ids});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::LoggingCallback
// Il2CppName: LoggingCallback
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::LoggingCallback)> {
static const MethodInfo* get() {
static auto* str = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "LoggingCallback", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{str});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_RegisterLoggingCallback
// Il2CppName: ovrAvatar_RegisterLoggingCallback
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::Oculus::Avatar::CAPI::LoggingDelegate*)>(&Oculus::Avatar::CAPI::ovrAvatar_RegisterLoggingCallback)> {
static const MethodInfo* get() {
static auto* callback = &::il2cpp_utils::GetClassFromName("Oculus.Avatar", "CAPI/LoggingDelegate")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_RegisterLoggingCallback", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{callback});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetLoggingLevel
// Il2CppName: ovrAvatar_SetLoggingLevel
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::GlobalNamespace::ovrAvatarLogLevel)>(&Oculus::Avatar::CAPI::ovrAvatar_SetLoggingLevel)> {
static const MethodInfo* get() {
static auto* level = &::il2cpp_utils::GetClassFromName("", "ovrAvatarLogLevel")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetLoggingLevel", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{level});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_GetDebugTransforms_Native
// Il2CppName: ovrAvatar_GetDebugTransforms_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_GetDebugTransforms_Native)> {
static const MethodInfo* get() {
static auto* count = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_GetDebugTransforms_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{count});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_GetDebugLines_Native
// Il2CppName: ovrAvatar_GetDebugLines_Native
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)(::System::IntPtr)>(&Oculus::Avatar::CAPI::ovrAvatar_GetDebugLines_Native)> {
static const MethodInfo* get() {
static auto* count = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_GetDebugLines_Native", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{count});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_DrawDebugLines
// Il2CppName: ovrAvatar_DrawDebugLines
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)()>(&Oculus::Avatar::CAPI::ovrAvatar_DrawDebugLines)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_DrawDebugLines", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrAvatar_SetDebugDrawContext
// Il2CppName: ovrAvatar_SetDebugDrawContext
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(uint)>(&Oculus::Avatar::CAPI::ovrAvatar_SetDebugDrawContext)> {
static const MethodInfo* get() {
static auto* context = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrAvatar_SetDebugDrawContext", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{context});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::SendEvent
// Il2CppName: SendEvent
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<bool (*)(::StringW, ::StringW, ::StringW)>(&Oculus::Avatar::CAPI::SendEvent)> {
static const MethodInfo* get() {
static auto* name = &::il2cpp_utils::GetClassFromName("System", "String")->byval_arg;
static auto* param = &::il2cpp_utils::GetClassFromName("System", "String")->byval_arg;
static auto* source = &::il2cpp_utils::GetClassFromName("System", "String")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "SendEvent", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{name, param, source});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::_ovrp_GetVersion
// Il2CppName: _ovrp_GetVersion
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::System::IntPtr (*)()>(&Oculus::Avatar::CAPI::_ovrp_GetVersion)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "_ovrp_GetVersion", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::ovrp_GetVersion
// Il2CppName: ovrp_GetVersion
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::StringW (*)()>(&Oculus::Avatar::CAPI::ovrp_GetVersion)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(Oculus::Avatar::CAPI*), "ovrp_GetVersion", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: Oculus::Avatar::CAPI::New_ctor
// Il2CppName: .ctor
// Cannot get method pointer of value based method overload from template for constructor!
// Try using FindMethod instead!
| 73.246185 | 296 | 0.77685 | RedBrumbler |
461abcefa5c732f795c05da3f568e39bd32d3628 | 6,500 | cpp | C++ | src/vcml/protocols/tlm_host.cpp | nbosb/vcml | 5b946a32b024cbba8da6928971ffc2a4f9b712f1 | [
"Apache-2.0"
] | 36 | 2018-01-29T12:20:37.000Z | 2022-03-29T06:14:59.000Z | src/vcml/protocols/tlm_host.cpp | nbosb/vcml | 5b946a32b024cbba8da6928971ffc2a4f9b712f1 | [
"Apache-2.0"
] | 9 | 2018-12-04T10:37:14.000Z | 2021-11-16T16:57:29.000Z | src/vcml/protocols/tlm_host.cpp | nbosb/vcml | 5b946a32b024cbba8da6928971ffc2a4f9b712f1 | [
"Apache-2.0"
] | 18 | 2018-10-14T11:30:43.000Z | 2022-01-08T07:12:56.000Z | /******************************************************************************
* *
* Copyright 2021 Jan Henrik Weinstock *
* *
* 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 "vcml/protocols/tlm_host.h"
#include "vcml/protocols/tlm_sockets.h"
namespace vcml {
void tlm_host::register_socket(tlm_initiator_socket* socket) {
if (stl_contains(m_initiator_sockets, socket))
VCML_ERROR("socket '%s' already registered", socket->name());
m_initiator_sockets.push_back(socket);
}
void tlm_host::register_socket(tlm_target_socket* socket) {
if (stl_contains(m_target_sockets, socket))
VCML_ERROR("socket '%s' already registered", socket->name());
m_target_sockets.push_back(socket);
}
void tlm_host::unregister_socket(tlm_initiator_socket* socket) {
stl_remove_erase(m_initiator_sockets, socket);
}
void tlm_host::unregister_socket(tlm_target_socket* socket) {
stl_remove_erase(m_target_sockets, socket);
}
tlm_initiator_socket*
tlm_host::find_tlm_initiator_socket(const string& name) const {
for (auto socket : m_initiator_sockets)
if (name == socket->name())
return socket;
return nullptr;
}
tlm_target_socket*
tlm_host::find_tlm_target_socket(const string& name) const {
for (auto socket : m_target_sockets)
if (name == socket->name())
return socket;
return nullptr;
}
vector<tlm_target_socket*>
tlm_host::find_tlm_target_sockets(address_space as) const {
vector<tlm_target_socket*> sockets;
for (auto socket : m_target_sockets)
if (as == socket->as)
sockets.push_back(socket);
return sockets;
}
tlm_host::tlm_host(bool allow_dmi):
m_offsets(),
m_initiator_sockets(),
m_target_sockets(),
allow_dmi("allow_dmi", true) {
}
sc_time& tlm_host::local_time(sc_process_b* proc) {
if (proc == nullptr)
proc = current_process();
if (!stl_contains(m_offsets, proc))
m_offsets[proc] = SC_ZERO_TIME;
sc_time& local = m_offsets[proc];
update_local_time(local);
return local;
}
sc_time tlm_host::local_time_stamp(sc_process_b* proc) {
return sc_time_stamp() + local_time(proc);
}
bool tlm_host::needs_sync(sc_process_b* proc) {
if (proc == nullptr)
proc = current_process();
if (!is_thread(proc))
return false;
sc_time quantum = tlm::tlm_global_quantum::instance().get();
return local_time(proc) >= quantum;
}
void tlm_host::sync(sc_process_b* proc) {
if (proc == nullptr)
proc = current_process();
if (proc == nullptr || proc->proc_kind() != sc_core::SC_THREAD_PROC_)
VCML_ERROR("attempt to sync outside of SC_THREAD process");
sc_time& offset = local_time(proc);
sc_core::wait(offset);
offset = SC_ZERO_TIME;
}
void tlm_host::map_dmi(const tlm_dmi& dmi) {
for (auto socket : m_target_sockets)
socket->map_dmi(dmi);
}
void tlm_host::map_dmi(unsigned char* p, u64 start, u64 end, vcml_access a,
const sc_time& read_latency, const sc_time& write_latency) {
tlm_dmi dmi;
dmi.set_dmi_ptr(p);
dmi.set_start_address(start);
dmi.set_end_address(end);
dmi.set_read_latency(read_latency);
dmi.set_write_latency(write_latency);
dmi_set_access(dmi, a);
map_dmi(dmi);
}
void tlm_host::unmap_dmi(u64 start, u64 end) {
for (auto socket : m_target_sockets)
socket->unmap_dmi(start, end);
}
void tlm_host::remap_dmi(const sc_time& rdlat, const sc_time& wrlat) {
for (auto socket : m_target_sockets)
socket->remap_dmi(rdlat, wrlat);
}
void tlm_host::invalidate_dmi(u64 start, u64 end) {
// to be overloaded
}
void tlm_host::update_local_time(sc_time& local_time) {
// to be overloaded
}
void tlm_host::b_transport(tlm_target_socket& socket,
tlm_generic_payload& tx, sc_time& dt) {
sc_process_b* proc = current_thread();
VCML_ERROR_ON(!proc, "b_transport outside SC_THREAD");
m_offsets[proc] = dt;
transport(socket, tx, tx_get_sbi(tx));
dt = m_offsets[proc];
}
unsigned int tlm_host::transport_dbg(tlm_target_socket& socket,
tlm_generic_payload& tx) {
sc_time t1 = sc_time_stamp();
unsigned int bytes = transport(socket, tx, tx_get_sbi(tx) | SBI_DEBUG);
sc_time t2 = sc_time_stamp();
if (thctl_is_sysc_thread() && t1 != t2)
VCML_ERROR("time advance during debug call");
return bytes;
}
bool tlm_host::get_direct_mem_ptr(tlm_target_socket& socket,
const tlm_generic_payload& tx, tlm_dmi& dmi) {
return true;
}
void tlm_host::invalidate_direct_mem_ptr(tlm_initiator_socket& socket,
u64 start, u64 end) {
invalidate_dmi(start, end);
}
unsigned int tlm_host::transport(tlm_target_socket& socket,
tlm_generic_payload& tx, const tlm_sbi& info) {
return 0; // to be overloaded
}
}
| 35.519126 | 80 | 0.564923 | nbosb |
461b3cbd0ccaa43922a9b53040d9999593453275 | 33 | hpp | C++ | src/boost_process_cmd.hpp | miathedev/BoostForArduino | 919621dcd0c157094bed4df752b583ba6ea6409e | [
"BSL-1.0"
] | 10 | 2018-03-17T00:58:42.000Z | 2021-07-06T02:48:49.000Z | src/boost_process_cmd.hpp | miathedev/BoostForArduino | 919621dcd0c157094bed4df752b583ba6ea6409e | [
"BSL-1.0"
] | 2 | 2021-03-26T15:17:35.000Z | 2021-05-20T23:55:08.000Z | src/boost_process_cmd.hpp | miathedev/BoostForArduino | 919621dcd0c157094bed4df752b583ba6ea6409e | [
"BSL-1.0"
] | 4 | 2019-05-28T21:06:37.000Z | 2021-07-06T03:06:52.000Z | #include <boost/process/cmd.hpp>
| 16.5 | 32 | 0.757576 | miathedev |
46201f2bd9fa4e937e4769aa174e216b923429a3 | 437 | cpp | C++ | balls/src/ball.cpp | KorovinVA/4_sem | 332057670b19283b187c993351693f65335da139 | [
"MIT"
] | null | null | null | balls/src/ball.cpp | KorovinVA/4_sem | 332057670b19283b187c993351693f65335da139 | [
"MIT"
] | null | null | null | balls/src/ball.cpp | KorovinVA/4_sem | 332057670b19283b187c993351693f65335da139 | [
"MIT"
] | null | null | null | #include "ball.h"
#include <iostream>
constexpr auto RAD = 4;
ball::ball() :
radius(RAD)
{
orb.setRadius(radius);
orb.setPosition(getStartPosition());
orb.setFillColor(sf::Color::Black);
}
void ball::update(sf::Time dt, int ball_number)
{
collision::update(velocity, ball_number);
orb.move(getVelocity() * dt.asSeconds());
}
sf::CircleShape ball::getBall() const
{
return orb;
}
float ball::getRadius()
{
return radius;
}
| 14.096774 | 47 | 0.693364 | KorovinVA |
46203328f7474e2a20b6bc3d10ff758b98f645f7 | 10,739 | cpp | C++ | TIGLViewer/src/TIGLViewerSelectWingAndFlapStatusDialog.cpp | Mk-arc/tigl | 45ace0b17008e2beab3286babe310a817fcd6578 | [
"Apache-2.0"
] | 171 | 2015-04-13T11:24:34.000Z | 2022-03-26T00:56:38.000Z | TIGLViewer/src/TIGLViewerSelectWingAndFlapStatusDialog.cpp | Mk-arc/tigl | 45ace0b17008e2beab3286babe310a817fcd6578 | [
"Apache-2.0"
] | 620 | 2015-01-20T08:34:36.000Z | 2022-03-30T11:05:33.000Z | TIGLViewer/src/TIGLViewerSelectWingAndFlapStatusDialog.cpp | Mk-arc/tigl | 45ace0b17008e2beab3286babe310a817fcd6578 | [
"Apache-2.0"
] | 56 | 2015-02-09T13:33:56.000Z | 2022-03-19T04:52:51.000Z | /*
* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC)
*
* Created: 2014-01-28 Mark Geiger <Mark.Geiger@dlr.de>
*
* 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 "TIGLViewerSelectWingAndFlapStatusDialog.h"
#include "ui_TIGLViewerSelectWingAndFlapStatusDialog.h"
#include "CCPACSConfigurationManager.h"
#include "CCPACSConfiguration.h"
#include "CCPACSTrailingEdgeDevice.h"
#include "CCPACSWingComponentSegment.h"
#include "CCPACSWing.h"
#include "generated/CPACSControlSurfaceStep.h"
#include "tiglmathfunctions.h"
#include "tiglcommonfunctions.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QSlider>
#include <QToolTip>
#include <QSpacerItem>
#include <QPushButton>
#include <QDoubleSpinBox>
#include <QSpacerItem>
#include <QTableWidget>
#include <QHeaderView>
#include <QtGlobal>
namespace
{
class SignalsBlocker
{
public:
SignalsBlocker(QObject* ptr):
_ptr(ptr)
{
_b = ptr->blockSignals(true);
}
~SignalsBlocker()
{
_ptr->blockSignals(_b);
}
private:
QObject* _ptr;
bool _b;
};
double sliderToControlParameter(const QSlider* slider, const QDoubleSpinBox* spinBox)
{
double minSlider = static_cast<double>(slider->minimum());
double maxSlider = static_cast<double>(slider->maximum());
double valSlider = static_cast<double>(slider->value());
double minControlParam = spinBox->minimum();
double maxControlParam = spinBox->maximum();
return (maxControlParam - minControlParam)/(maxSlider-minSlider) * (valSlider - minSlider) + minControlParam;
}
} // namespace
TIGLViewerSelectWingAndFlapStatusDialog::TIGLViewerSelectWingAndFlapStatusDialog(TIGLViewerDocument* document, QWidget *parent) :
QDialog(parent),
ui(new Ui::TIGLViewerSelectWingAndFlapStatusDialog)
{
ui->setupUi(this);
this->setWindowTitle("Choose ControlSurface Control Parameters");
_document = document;
}
TIGLViewerSelectWingAndFlapStatusDialog::~TIGLViewerSelectWingAndFlapStatusDialog()
{
cleanup();
delete ui;
}
void TIGLViewerSelectWingAndFlapStatusDialog::slider_value_changed(int /* k */)
{
QSlider* slider = dynamic_cast<QSlider*>(QObject::sender());
std::string uid = slider->windowTitle().toStdString();
DeviceWidgets& elms = _guiMap.at(uid);
double controlParm = sliderToControlParameter(elms.slider, elms.controlParamBox);
SignalsBlocker block(elms.controlParamBox);
updateWidgets(uid, controlParm);
_document->updateFlapTransform(uid);
}
void TIGLViewerSelectWingAndFlapStatusDialog::spinBox_value_changed(double controlParam)
{
QDoubleSpinBox* spinBox = dynamic_cast<QDoubleSpinBox*>(QObject::sender());
std::string uid = spinBox->windowTitle().toStdString();
DeviceWidgets& elms = _guiMap.at(uid);
SignalsBlocker block(elms.slider);
updateWidgets(uid, controlParam);
_document->updateFlapTransform(uid);
}
void TIGLViewerSelectWingAndFlapStatusDialog::cleanup()
{
_guiMap.clear();
return;
}
double TIGLViewerSelectWingAndFlapStatusDialog::getTrailingEdgeFlapValue( std::string uid )
{
try {
std::map< std::string, tigl::CCPACSTrailingEdgeDevice*>::iterator it;
it = _deviceMap.find(uid);
if (it == _deviceMap.end()) {
throw tigl::CTiglError("getTrailingEdgeFlapValue: UID not found", TIGL_UID_ERROR);
}
tigl::CCPACSTrailingEdgeDevice* device = it->second;
return device->GetControlParameter();
}
catch(...) {
return 0;
}
}
void TIGLViewerSelectWingAndFlapStatusDialog::buildFlapRow(const tigl::CCPACSTrailingEdgeDevice& controlSurfaceDevice, int rowIdx, QTableWidget* gridLayout)
{
QString uid = controlSurfaceDevice.GetUID().c_str();
QLabel* labelUID = new QLabel(uid, this);
QString transparentBG = "background-color: rgba(0, 0, 0, 0.0); padding-left: 6px; padding-right: 6px;";
labelUID->setStyleSheet(transparentBG);
gridLayout->setCellWidget(rowIdx, 0, labelUID);
QSlider* slider = new QSlider(Qt::Horizontal);
slider->setMaximum(1000);
slider->setStyleSheet(transparentBG);
gridLayout->setCellWidget(rowIdx, 1, slider);
QDoubleSpinBox* spinBox = new QDoubleSpinBox();
spinBox->setDecimals(3);
spinBox->setSingleStep(0.005);
spinBox->setStyleSheet(transparentBG);
gridLayout->setCellWidget(rowIdx, 2, spinBox);
QString rot;
if ( controlSurfaceDevice.GetPath().GetSteps().GetSteps().size() > 0 ) {
const auto& step = controlSurfaceDevice.GetPath().GetSteps().GetSteps().front();
if(step) {
rot.append(QString::number(step->GetHingeLineRotation().value_or(0.)));
}
}
QLabel* labelRotation = new QLabel(rot, this);
labelRotation->setStyleSheet(transparentBG);
gridLayout->setCellWidget(rowIdx, 3, labelRotation);
double savedValue = controlSurfaceDevice.GetControlParameter();
double minControlParam = controlSurfaceDevice.GetMinControlParameter();
double maxControlParam = controlSurfaceDevice.GetMaxControlParameter();
int newSliderValue = static_cast<int>((slider->maximum() - slider->minimum()) / (maxControlParam-minControlParam) * (savedValue - minControlParam))
+ slider->minimum();
slider->setValue(newSliderValue);
spinBox->setMinimum(minControlParam);
spinBox->setValue(savedValue);
spinBox->setMaximum(maxControlParam);
DeviceWidgets elements;
elements.slider = slider;
elements.controlParamBox = spinBox;
elements.rotAngleLabel = labelRotation;
_guiMap[uid.toStdString()] = elements;
slider->setWindowTitle( uid );
spinBox->setWindowTitle( uid );
connect(slider, SIGNAL(valueChanged(int)), this, SLOT(slider_value_changed(int)));
connect(spinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBox_value_changed(double)));
}
void TIGLViewerSelectWingAndFlapStatusDialog::drawGUI()
{
cleanup();
std::string wingUID = m_currentWing;
if (wingUID.empty())
return;
tigl::CCPACSConfiguration& config = _document->GetConfiguration();
tigl::CCPACSWing &wing = config.GetWing(wingUID);
int noDevices = wing.GetComponentSegmentCount();
std::vector<tigl::CCPACSTrailingEdgeDevice*> devices;
for ( int i = 1; i <= wing.GetComponentSegmentCount(); i++ ) {
tigl::CCPACSWingComponentSegment& componentSegment = static_cast<tigl::CCPACSWingComponentSegment&>(wing.GetComponentSegment(i));
const auto& controlSurfaces = componentSegment.GetControlSurfaces();
if (!controlSurfaces || controlSurfaces->ControlSurfaceCount() < 1) {
noDevices--;
if (noDevices < 1) {
continue;
}
}
// @todo: what if no TEDS? fix this
for ( const auto& controlSurfaceDevice : controlSurfaces->GetTrailingEdgeDevices()->GetTrailingEdgeDevices()) {
if (!controlSurfaceDevice) {
continue;
}
if ((!ui->checkTED->isChecked() && controlSurfaceDevice->GetType() == TRAILING_EDGE_DEVICE) ||
(!ui->checkLED->isChecked() && controlSurfaceDevice->GetType() == LEADING_EDGE_DEVICE) ||
(!ui->checkSpoiler->isChecked() && controlSurfaceDevice->GetType() == SPOILER)) {
continue;
}
devices.push_back(controlSurfaceDevice.get());
}
}
auto* tableWidget = new QTableWidget(static_cast<int>(devices.size()), 4);
int rowIdx = 0;
for (auto* device : devices) {
buildFlapRow(*device, rowIdx++, tableWidget);
_deviceMap[device->GetUID()] = device;
updateWidgets(device->GetUID(), device->GetControlParameter() );
}
// set style
tableWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
tableWidget->setAlternatingRowColors(true);
#if QT_VERSION >= 0x050000
tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
#else
tableWidget->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
#endif
tableWidget->setHorizontalHeaderLabels(QStringList({"", "", "Control Parameter", "Rotation"}));
tableWidget->verticalHeader()->hide();
tableWidget->setStyleSheet("QHeaderView::section { border: 0px solid black}");
ui->scrollArea->setWidget(tableWidget);
}
void TIGLViewerSelectWingAndFlapStatusDialog::on_checkTED_stateChanged(int)
{
drawGUI();
}
void TIGLViewerSelectWingAndFlapStatusDialog::on_checkLED_stateChanged(int)
{
drawGUI();
}
void TIGLViewerSelectWingAndFlapStatusDialog::on_checkSpoiler_stateChanged(int)
{
drawGUI();
}
void TIGLViewerSelectWingAndFlapStatusDialog::updateWidgets(std::string controlSurfaceDeviceUID,
double controlParam)
{
DeviceWidgets& elms = _guiMap.at(controlSurfaceDeviceUID);
QString textVal;
std::map< std::string, tigl::CCPACSTrailingEdgeDevice*>::iterator it;
it = _deviceMap.find(controlSurfaceDeviceUID);
if (it == _deviceMap.end()) {
return;
}
tigl::CCPACSTrailingEdgeDevice* device = it->second;
// Get rotation for current control parameter value
std::vector<double> controlParams;
std::vector<double> rotations;
const tigl::CCPACSControlSurfaceSteps& steps = device->GetPath().GetSteps();
for ( const auto &step : steps.GetSteps()) {
if (!step) continue;
controlParams.push_back(step->GetControlParameter());
rotations.push_back(step->GetHingeLineRotation().value_or(0.));
}
double rotation = tigl::Interpolate(controlParams, rotations, controlParam);
QString textRot = QString::number(rotation);
double factor = ( controlParam - device->GetMinControlParameter() ) / ( device->GetMaxControlParameter() - device->GetMinControlParameter() );
textVal.append(QString::number(100 * factor));
textVal.append("% ");
int sliderVal = static_cast<int>(Mix(elms.slider->minimum(), elms.slider->maximum(), factor));
elms.slider->setValue(sliderVal);
elms.controlParamBox->setValue(controlParam);
elms.rotAngleLabel->setText(textRot);
device->SetControlParameter(controlParam);
}
| 32.740854 | 156 | 0.701648 | Mk-arc |
4620941114fa773e16effc37b033bea510b936fc | 2,006 | cpp | C++ | MonoNative.Tests/mscorlib/System/Runtime/InteropServices/mscorlib_System_Runtime_InteropServices_RuntimeEnvironment_Fixture.cpp | brunolauze/MonoNative | 959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66 | [
"BSD-2-Clause"
] | 7 | 2015-03-10T03:36:16.000Z | 2021-11-05T01:16:58.000Z | MonoNative.Tests/mscorlib/System/Runtime/InteropServices/mscorlib_System_Runtime_InteropServices_RuntimeEnvironment_Fixture.cpp | brunolauze/MonoNative | 959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66 | [
"BSD-2-Clause"
] | 1 | 2020-06-23T10:02:33.000Z | 2020-06-24T02:05:47.000Z | MonoNative.Tests/mscorlib/System/Runtime/InteropServices/mscorlib_System_Runtime_InteropServices_RuntimeEnvironment_Fixture.cpp | brunolauze/MonoNative | 959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66 | [
"BSD-2-Clause"
] | null | null | null | // Mono Native Fixture
// Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Namespace: System.Runtime.InteropServices
// Name: RuntimeEnvironment
// C++ Typed Name: mscorlib::System::Runtime::InteropServices::RuntimeEnvironment
#include <gtest/gtest.h>
#include <mscorlib/System/Runtime/InteropServices/mscorlib_System_Runtime_InteropServices_RuntimeEnvironment.h>
#include <mscorlib/System/mscorlib_System_Type.h>
#include <mscorlib/System/mscorlib_System_String.h>
#include <mscorlib/System/Reflection/mscorlib_System_Reflection_Assembly.h>
namespace mscorlib
{
namespace System
{
namespace Runtime
{
namespace InteropServices
{
//Constructors Tests
//RuntimeEnvironment()
TEST(mscorlib_System_Runtime_InteropServices_RuntimeEnvironment_Fixture,DefaultConstructor)
{
mscorlib::System::Runtime::InteropServices::RuntimeEnvironment *value = new mscorlib::System::Runtime::InteropServices::RuntimeEnvironment();
EXPECT_NE(NULL, value->GetNativeObject());
}
//Public Methods Tests
//Public Static Methods Tests
// Method FromGlobalAccessCache
// Signature: mscorlib::System::Reflection::Assembly a
TEST(mscorlib_System_Runtime_InteropServices_RuntimeEnvironment_Fixture,FromGlobalAccessCache_StaticTest)
{
}
// Method GetRuntimeDirectory
// Signature:
TEST(mscorlib_System_Runtime_InteropServices_RuntimeEnvironment_Fixture,GetRuntimeDirectory_StaticTest)
{
}
// Method GetSystemVersion
// Signature:
TEST(mscorlib_System_Runtime_InteropServices_RuntimeEnvironment_Fixture,GetSystemVersion_StaticTest)
{
}
// Property SystemConfigurationFile
// Return Type: mscorlib::System::String
// Property Get Method
TEST(mscorlib_System_Runtime_InteropServices_RuntimeEnvironment_Fixture,get_SystemConfigurationFile_Test)
{
}
}
}
}
}
| 25.392405 | 146 | 0.739282 | brunolauze |
462a7dcbd2e712cb08de4fde4e4c0ee30940372c | 26,613 | hpp | C++ | src/Mesh.hpp | spraetor/amdis2 | 53c45c81a65752a8fafbb54f9ae6724a86639dcd | [
"MIT"
] | 2 | 2018-07-04T16:44:04.000Z | 2021-01-03T07:26:27.000Z | src/Mesh.hpp | spraetor/amdis2 | 53c45c81a65752a8fafbb54f9ae6724a86639dcd | [
"MIT"
] | null | null | null | src/Mesh.hpp | spraetor/amdis2 | 53c45c81a65752a8fafbb54f9ae6724a86639dcd | [
"MIT"
] | null | null | null | /** \defgroup Triangulation Triangulation module
* @{ <img src="triangulation.png"> @}
*
* Example:
*
* @{ <img src="hierarchicalMesh.png"> @}
*
* \brief
* Contains all triangulation classes.
*/
#pragma once
#include <deque>
#include <set>
#include <stdio.h>
#include "AMDiS_fwd.hpp"
#include "BoundaryCondition.hpp"
#include "DOFAdmin.hpp"
#include "ElInfo.hpp"
#include "Element.hpp"
#include "FixVec.hpp"
#include "Line.hpp"
#include "Tetrahedron.hpp"
#include "Triangle.hpp"
namespace AMDiS
{
/** \ingroup Triangulation
* \brief
* A Mesh holds all information about a triangulation.
*/
class Mesh
{
public:
/// Creates a mesh with the given name of dimension dim
Mesh(std::string name, int dim);
/// Destructor
~Mesh();
/// Reads macro triangulation.
void initialize();
/// Assignment operator
Mesh& operator=(Mesh const&);
/** \name getting methods
* \{
*/
/// Returns geometric information about this mesh. With GeoIndex p it is
/// specified which information is requested.
int getGeo(GeoIndex p) const
{
return Global::getGeo(p, dim);
}
/// Returns \ref name of the mesh
std::string getName() const
{
return name;
}
/// Returns \ref dim of the mesh
int getDim() const
{
return dim;
}
/// Returns \ref nDofEl of the mesh
int getNumberOfAllDofs() const
{
return nDofEl;
}
/// Returns \ref nNodeEl of the mesh
int getNumberOfNodes() const
{
return nNodeEl;
}
/// Returns \ref nVertices of the mesh
int getNumberOfVertices() const
{
return nVertices;
}
/// Returns \ref nEdges of the mesh
int getNumberOfEdges() const
{
return nEdges;
}
/// Returns \ref nFaces of the mesh
int getNumberOfFaces() const
{
return nFaces;
}
/// Returns \ref nLeaves of the mesh
int getNumberOfLeaves() const
{
return nLeaves;
}
/// Returns \ref nElements of the mesh
int getNumberOfElements() const
{
return nElements;
}
/// Returns \ref maxEdgeNeigh of the mesh
int getMaxEdgeNeigh() const
{
return maxEdgeNeigh;
}
/// Returns \ref parametric of the mesh
Parametric* getParametric() const
{
return parametric;
}
/// Returns \ref diam of the mesh
WorldVector<double> const& getDiameter() const
{
return diam;
}
/// Returns \ref diam of the mesh
std::pair<WorldVector<double>, WorldVector<double>> const& getBoundingBox() const
{
return boundingBox;
}
/// Returns nDof[i] of the mesh
int getNumberOfDofs(int i) const
{
TEST_EXIT_DBG(i <= dim)("Wrong index: %d %d\n", i, dim);
return nDof[i];
}
/// Returns \ref elementPrototype of the mesh
Element* getElementPrototype()
{
return elementPrototype;
}
/// Returns \ref leafDataPrototype of the mesh
ElementData* getElementDataPrototype()
{
return elementDataPrototype;
}
/// Returns node[i] of the mesh
int getNode(int i) const
{
return node[i];
}
/// Allocates the number of DOFs needed at position and registers the DOFs
/// at the DOFAdmins. The number of needed DOFs is the sum over the needed
/// DOFs of all DOFAdmin objects belonging to this mesh.
/// The return value is a pointer to the first allocated DOF.
DegreeOfFreedom* getDof(GeoIndex position);
/// Returns *(\ref admin[i]) of the mesh
DOFAdmin const& getDofAdmin(int i) const
{
return *(admin[i]);
}
/// Creates a DOFAdmin with name lname. nDof specifies how many DOFs
/// are needed at the different positions (see \ref DOFAdmin::nrDOF).
/// A pointer to the created DOFAdmin is returned.
DOFAdmin const* createDOFAdmin(std::string lname, DimVec<int> nDof);
/// Returns the size of \ref admin which is the number of the DOFAdmins
/// belonging to this mesh
int getNumberOfDOFAdmin() const
{
return int(admin.size());
}
/// Returns the size of \ref macroElements which is the number of
/// of macro elements of this mesh
int getNumberOfMacros() const
{
return int(macroElements.size());
}
/// Returns a DOFAdmin which at least manages vertex DOFs
DOFAdmin const* getVertexAdmin() const;
/// Allocates an array of DOF pointers. The array holds one pointer for
/// each node.
DegreeOfFreedom** createDofPtrs();
/// Returns \ref preserveCoarseDOFs of the mesh
bool queryCoarseDOFs() const
{
return preserveCoarseDOFs;
}
/// Returns an iterator to the begin of \ref macroElements
std::deque<MacroElement*>::iterator firstMacroElement()
{
return macroElements.begin();
}
/// Returns macroElements[i].
MacroElement* getMacroElement(int i)
{
return macroElements[i];
}
/// Returns an iterator to the end of \ref macroElements
std::deque<MacroElement*>::iterator endOfMacroElements()
{
return macroElements.end();
}
/// Returns \ref macroElements, the list of all macro elements in the mesh.
std::deque<MacroElement*>& getMacroElements()
{
return macroElements;
}
/** \} */
/** \name setting methods
* \{
*/
/// Sets \ref name of the mesh
void setName(std::string aName)
{
name = aName;
}
/// Sets \ref nVertices of the mesh
void setNumberOfVertices(int n)
{
nVertices = n;
}
/// Sets \ref nFaces of the mesh
void setNumberOfFaces(int n)
{
nFaces = n;
}
/// Increments \ref nVertices by inc
void incrementNumberOfVertices(int inc)
{
nVertices += inc;
}
/// Sets \ref nEdges of the mesh
void setNumberOfEdges(int n)
{
nEdges = n;
}
/// Increments \ref nEdges by inc
void incrementNumberOfEdges(int inc)
{
nEdges += inc;
}
/// Increments \ref nFaces by inc
void incrementNumberOfFaces(int inc)
{
nFaces += inc;
}
/// Sets \ref nLeaves of the mesh
void setNumberOfLeaves(int n)
{
nLeaves = n;
}
/// Increments \ref nLeaves by inc
void incrementNumberOfLeaves(int inc)
{
nLeaves += inc;
}
/// Sets \ref nElements of the mesh
void setNumberOfElements(int n)
{
nElements = n;
}
/// Increments \ref nElements by inc
void incrementNumberOfElements(int inc)
{
nElements += inc;
}
/// Sets *\ref diam to w
void setDiameter(WorldVector<double> const& w);
/// Sets (*\ref diam)[i] to d
void setDiameter(int i, double d);
void setBoundingBox(WorldVector<double> const& min_corner,
WorldVector<double> const& max_corner);
/// Sets \ref preserveCoarseDOFs = true
void retainCoarseDOFs()
{
preserveCoarseDOFs = true;
}
/// Sets \ref preserveCoarseDOFs = b
void setPreserveCoarseDOFs(bool b)
{
preserveCoarseDOFs = b;
}
/// Sets \ref preserveCoarseDOFs = false
void noCoarseDOFs()
{
preserveCoarseDOFs = false;
}
/// Sets \ref elementPrototype of the mesh
void setElementPrototype(Element* prototype)
{
elementPrototype = prototype;
}
/// Sets \ref elementDataPrototype of the mesh
void setElementDataPrototype(ElementData* prototype)
{
elementDataPrototype = prototype;
}
///
void setParametric(Parametric* param)
{
parametric = param;
}
///
void setMaxEdgeNeigh(int m)
{
maxEdgeNeigh = m;
}
/** \} */
/// Creates a new Element by cloning \ref elementPrototype
Element* createNewElement(Element* parent = NULL);
/// Creates a new ElInfo dependent of \ref dim of the mesh
ElInfo* createNewElInfo();
/// Frees DOFs at the given position pointed by dof
void freeDof(DegreeOfFreedom* dof, GeoIndex position);
/// Frees memory for the given element el
void freeElement(Element* el);
/// Performs DOF compression for all DOFAdmins (see \ref DOFAdmin::compress)
void dofCompress();
/// Adds a DOFAdmin to the mesh
void addDOFAdmin(DOFAdmin* admin);
/// Recalculates the number of leave elements.
void updateNumberOfLeaves();
/// Clears \ref macroElements
void clearMacroElements()
{
macroElements.clear();
}
/// Adds a macro element to the mesh
void addMacroElement(MacroElement* me);
/// Removes a set of macro elements from the mesh. This works only for the
/// case, that there are no global or local refinements, i.e., all macro
/// elements have no children.
void removeMacroElements(std::set<MacroElement*>& macros,
std::vector<FiniteElemSpace const*>& feSpaces);
void removeAllMacroElements();
/// Frees the array of DOF pointers (see \ref createDofPtrs)
void freeDofPtrs(DegreeOfFreedom** ptrs);
/// Used by \ref findElementAtPoint.
bool findElInfoAtPoint(WorldVector<double> const& xy,
ElInfo* el_info,
DimVec<double>& bary,
MacroElement const* start_mel,
WorldVector<double> const* xy0,
double* sp);
/** \brief
* Access to an element at world coordinates xy. Some applications need the
* access to elements at a special location in world coordinates. Examples
* are characteristic methods for convection problems, or the implementation
* of a special right hand side like point evaluations or curve integrals.
* For such purposes, a routine is available which returns an element pointer
* and corresponding barycentric coordinates.
*
* \param xy world coordinates of point
* \param elp return address for a pointer to the element at xy
* \param pary returns barycentric coordinates of xy
* \param start_mel initial guess for the macro element containing xy or NULL
* \param xy0 start point from a characteristic method, see below, or NULL
* \param sp return address for relative distance to domain boundary in a
* characteristic method, see below, or NULL
* \return true is xy is inside the domain , false otherwise
*
* For a characteristic method, where \f$ xy = xy_0 - V\tau \f$, it may be
* convenient to know the point on the domain's boundary which lies on the
* line segment between the old point xy0 and the new point xy, in case that
* xy is outside the domain. Such information is returned when xy0 and a
* pointer sp!=NULL are supplied: *sp is set to the value s such that
* \f$ xy_0 +s (xy -xy_0) \in \partial Domain \f$, and the element and local
* coordinates corresponding to that boundary point will be returned via elp
* and bary.
*
* The implementation of findElementAtPoint() is based on the transformation
* from world to local coordinates, available via the routine worldToCoord(),
* At the moment, findElementAtPoint() works correctly only for domains with
* non-curved boundary. This is due to the fact that the implementation first
* looks for the macro-element containing xy and then finds its path through
* the corresponding element tree based on the macro barycentric coordinates.
* For non-convex domains, it is possible that in some cases a point inside
* the domain is considered as external.
*/
bool findElementAtPoint(WorldVector<double> const& xy,
Element** elp,
DimVec<double>& bary,
MacroElement const* start_mel,
WorldVector<double> const* xy0,
double* sp);
/** \brief
* Returns for a given dof its world coordinates in this mesh. Because we do
* not have any direct connection between dofs and coordinates, this function
* has to search for the element in this mesh, that contains the dof. Than the
* coordinates can be computed. Therefore, this function is very costly and
* should be used for debugging purpose only.
*
* @param[in] dof A pointer to the dof we have to search for.
* @param[in] feSpace The fe space to be used for the search.
* @param[out] coords World vector that stores the coordinates of the dof.
*
* The function returns true, if the dof was found, otherwise false.
*/
bool getDofIndexCoords(DegreeOfFreedom const* dof,
FiniteElemSpace const* feSpace,
WorldVector<double>& coords)
{
return getDofIndexCoords(*dof, feSpace, coords);
}
/// This function is equal to \ref getDofIndexCoords as defined above, but
/// takes a DOF index instead of a DOF pointer.
bool getDofIndexCoords(DegreeOfFreedom dof,
FiniteElemSpace const* feSpace,
WorldVector<double>& coords);
/** \brief
* Traverse the whole mesh and stores to each DOF the coordinates in a given
* DOFVector. Works in the same way as the function \ref getDofIndexCoords
* defined above.
*
* @param[out] coords DOF vector that stores the coordinates to each DOF.
*/
void getDofIndexCoords(DOFVector<WorldVector<double>>& coords);
/** \brief
* Traverse the mesh and get all DOFs in this mesh for a given FE space.
*
* @param[in] feSpace The FE space to be used for collecting DOFs.
* @param[out] allDofs The set which is filled with all DOFs.
*/
void getAllDofs(FiniteElemSpace const* feSpace,
std::set<DegreeOfFreedom const*>& allDofs);
/// Returns FILL_ANY_?D
static Flag const& getFillAnyFlag(int dim)
{
switch (dim)
{
case 1:
return FILL_ANY_1D;
break;
case 2:
return FILL_ANY_2D;
break;
case 3:
return FILL_ANY_3D;
break;
default:
ERROR_EXIT("invalid dim\n");
return FILL_ANY_1D;
}
}
/// Returns \ref elementIndex and increments it by 1.
int getNextElementIndex()
{
return elementIndex++;
}
/// Returns \ref initialized.
bool isInitialized() const
{
return initialized;
}
///
std::map<BoundaryType, VertexVector*>& getPeriodicAssociations()
{
return periodicAssociations;
}
/// Returns the periodic association for a specific boundary type.
VertexVector& getPeriodicAssociations(BoundaryType b)
{
FUNCNAME_DBG("Mesh::getPeriodicAssociations()");
TEST_EXIT_DBG(periodicAssociations.count(b) == 1)
("There are no periodic assoications for boundary type %d!\n", b);
return (*(periodicAssociations[b]));
}
void setPeriodicAssociations(BoundaryType b, VertexVector* vec)
{
periodicAssociations[b] = vec;
}
/// Returns whether the given boundary type is periodic, i.e., if there is
/// a periodic association for this boundary type.
bool isPeriodicAssociation(BoundaryType b) const
{
return (periodicAssociations.count(b) == 1 ? true : false);
}
///
bool associated(DegreeOfFreedom dof1, DegreeOfFreedom dof2);
///
bool indirectlyAssociated(DegreeOfFreedom dof1, DegreeOfFreedom dof2);
/// Returns \macroFileInfo
MacroInfo* getMacroFileInfo()
{
return macroFileInfo;
}
/// Increment the value of mesh change index, see \ref changeIndex.
void incChangeIndex()
{
changeIndex++;
}
/// Returns the mesh change index, see \ref changeIndex.
long getChangeIndex() const
{
return changeIndex;
}
///
void clearMacroFileInfo();
///
int calcMemoryUsage();
///
void deleteMeshStructure();
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
/// In parallel computations the level of all macro elements is equal to the
/// number of global pre refinements, \ref nParallelPreRefinements.
int getMacroElementLevel() const
{
return nParallelPreRefinements;
}
#else
/// In sequentiel computations the level of all macro elements is always 0.
int getMacroElementLevel() const
{
return 0;
}
#endif
/// Creates a map for all elements in mesh that maps from element indices
/// to the corresponding pointers.
void getElementIndexMap(std::map<int, Element*>& elIndexMap);
public:
///
static const Flag FILL_NOTHING;
///
static const Flag FILL_COORDS;
///
static const Flag FILL_BOUND;
///
static const Flag FILL_NEIGH;
///
static const Flag FILL_OPP_COORDS;
///
static const Flag FILL_ORIENTATION;
///
static const Flag FILL_ADD_ALL;
///
static const Flag FILL_ANY_1D;
///
static const Flag FILL_ANY_2D;
///
static const Flag FILL_ANY_3D;
///
static const Flag FILL_DET;
///
static const Flag FILL_GRD_LAMBDA;
//**************************************************************************
// flags for Mesh traversal
//**************************************************************************
///
static const Flag CALL_EVERY_EL_PREORDER;
///
static const Flag CALL_EVERY_EL_INORDER;
///
static const Flag CALL_EVERY_EL_POSTORDER;
///
static const Flag CALL_LEAF_EL;
///
static const Flag CALL_LEAF_EL_LEVEL;
///
static const Flag CALL_EL_LEVEL;
///
static const Flag CALL_MG_LEVEL;
/// If set, left and right children are swapped in traverse.
static const Flag CALL_REVERSE_MODE;
protected:
///
bool findElementAtPointRecursive(ElInfo* elinfo,
DimVec<double> const& lambda,
int outside,
ElInfo* final_el_info);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
/** \brief
* This functions is called in parallel computations by the function \ref
* Mesh::initialize(). It checks that the macro file has enough macro elements
* for the number of used processors and that all macro elements are of type 0.
* If this is not the case, that macro mesh is globally refined in an
* apropriate way and is written to a new macro file.
*
* The function overwrittes the macro and periodic filenames, if a new macro
* fule was created for the current parallel usage.
*
* \param[in/out] macroFilename Name of the macro mesh file.
* \param[in/out] periodicFilename If periodic boundaries are used, name of the
* periodicity file. Otherwise, the string must
* be empty.
* \param[in] check If the mesh should be checked to be a correct
* AMDiS macro mesh, the value must be 1 and 0
* otherwise.
*/
void checkParallelMacroFile(std::string& macroFilename,
std::string& periodicFilename,
int check);
#endif
protected:
/// maximal number of DOFs at one position
static const int MAX_DOF;
/// Name of this Mesh
std::string name;
/// Dimension of this Mesh. Doesn't have to be equal to dimension of world.
int dim;
/// Number of vertices in this Mesh
int nVertices;
/// Number of Edges in this Mesh
int nEdges;
/// Number of leaf elements in this Mesh
int nLeaves;
/// Total number of elements in this Mesh
int nElements;
/// Number of faces in this Mesh
int nFaces;
/// Maximal number of elements that share one edge; used to allocate memory
/// to store pointers to the neighbour at the refinement/coarsening edge
/// (only 3d);
int maxEdgeNeigh;
/// Diameter of the mesh in the DIM_OF_WORLD directions
WorldVector<double> diam;
/// Corner coordinates of the bounding-box of the mesh
std::pair<WorldVector<double>, WorldVector<double>> boundingBox;
/// Is pointer to NULL if mesh contains no parametric elements else pointer
/// to a Parametric object containing coefficients of the parameterization
/// and related information
Parametric* parametric;
/// When an element is refined, not all dofs of the coarse element must be
/// part of the new elements. An example are centered dofs when using higher
/// lagrange basis functions. The midpoint dof of the parents element is not
/// a dof of the both children elements. Therefore, the dof can be deleted.
/// In some situation, e.g., when using multigrid techniques, it can be
/// necessary to store this coarse dofs. Then this variable must be set to
/// true. If false, the not required coarse dofs will be deleted.
bool preserveCoarseDOFs;
/// Number of all DOFs on a single element
int nDofEl;
/** \brief
* Number of DOFs at the different positions VERTEX, EDGE, (FACE,) CENTER on
* an element:
*
* - nDof[VERTEX]: number of DOFs at a vertex (>= 1)
*
* - nDof[EDGE]: number of DOFs at an edge; if no DOFs are associated to
* edges, then this value is 0
*
* - nDof[FACE]: number of DOFs at a face; if no DOFs are associated to
* faces, then this value is 0 (only 3d)
*
* - nDof[CENTER]: number of DOFs at the barycenter; if no DOFs are
* associated to the barycenter, then this value is 0
*/
DimVec<int> nDof;
/// Number of nodes on a single element where DOFs are located. Needed for
/// the (de-) allocation of the DOF-vector on the element (\ref Element::dof).
/// Here "node" is equivalent to the number of basis functions on the element.
int nNodeEl;
/** \brief
* Gives the index of the first node at vertex, edge, face (only 3d), and
* barycenter:
*
* - node[VERTEX]: has always value 0; dof[0],...,dof[N_VERTICES-1] are
* always DOFs at the vertices;
*
* - node[EDGE]: dof[node[EDGE]],..., dof[node[EDGE]+N_EDGES-1] are the DOFs
* at the N_EDGES edges, if DOFs are located at edges;
*
* - node[FACE]: dof[node[FACE]],..., dof[node[FACE]+N_FACES-1] are the DOFs
* at the N_FACES faces, if DOFs are located at faces (only 3d);
*
* - node[CENTER]: dof[node[CENTER]] are the DOFs at the barycenter, if DOFs
* are located at the barycenter;
*/
DimVec<int> node;
/// List of all DOFAdmins
std::vector<DOFAdmin*> admin;
/// List of all MacroElements of this Mesh
std::deque<MacroElement*> macroElements;
/// Used by check functions
static std::vector<DegreeOfFreedom> dof_used;
static std::set<std::string> refinedMeshNames;
/// This map is used for serialization and deserialization of mesh elements.
/// During the serialization process, all elements are visited and their
/// DOF indices are written to the file. If a dof index at a position, i.e.
/// vertex, line or face, was written to file, the combination of dof index
/// and position is inserted to this map. That ensures that the same dof at
/// the same position, but being part of another element, is not written
/// twice to the file. When a state should be deserialized, the information
/// can be used to construct exactly the same dof structure.
static std::map<std::pair<DegreeOfFreedom, int>, DegreeOfFreedom*> serializedDOFs;
/// Used while mesh refinement. To create new elements
/// elementPrototype->clone() is called, which returns a Element of the
/// same type as elementPrototype. So e.g. Elements of the different
/// dimensions can be created in a uniform way.
Element* elementPrototype;
/// Prototype for leaf data. Used for creation of new leaf data while
/// refinement.
ElementData* elementDataPrototype;
/// Used for enumeration of all mesh elements
int elementIndex;
/// True if the mesh is already initialized, false otherwise.
bool initialized;
/// Map of managed periodic vertex associations.
std::map<BoundaryType, VertexVector*> periodicAssociations;
/// If the mesh has been created by reading a macro file, here the information
/// are stored about the content of the file.
MacroInfo* macroFileInfo;
/// This index is incremented every time the mesh is changed, e.g. by the
/// refinement or the coarsening manager. It can be used by other object if
/// the mesh has been changed by first copying this variable elsewhere and
/// comparing its values.
long changeIndex;
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
/// In parallel computations the mesh may be globally prerefined to achieve a
/// fine enought starting mesh for the given number of ranks. The value of the
/// variable will be defined in function \ref checkParallelMacroFile.
int nParallelPreRefinements;
#endif
protected:
/// for findElement-Fcts
DimVec<double> final_lambda;
/// Temporary variables that are used in functions \ref findElInfoAtPoint
/// and \ref findElementAtPointRecursive.
WorldVector<double> const *g_xy0, *g_xy;
/// Temporary variable that is used in functions \ref findElInfoAtPoint and
/// \ref findElementAtPointRecursive.
double* g_sp;
friend class MacroInfo;
friend class io::MacroReader;
friend struct io::MacroWriter;
};
/// Accessor class used as passkey pattern in the setIndex method
/// to provide access to this specific method only.
class MeshAccessor
{
MeshAccessor() = default;
MeshAccessor(MeshAccessor const&) = default;
friend class Mesh;
};
class BoundaryWrapper
{
public:
BoundaryWrapper(BoundaryType nr, Mesh* mesh = NULL)
: nr(nr),
mesh(mesh)
{}
Mesh* getMesh()
{
return mesh;
}
Mesh const* getMesh() const
{
return mesh;
}
BoundaryType getBoundary() const
{
return nr;
}
private:
BoundaryType nr;
Mesh* mesh;
};
// generator function for \ref BoundaryWrapper
inline auto boundary(BoundaryType nr, Mesh* mesh = NULL)
-> BoundaryWrapper
{
return {nr, mesh};
}
} // end namespace AMDiS
| 28.958651 | 87 | 0.632661 | spraetor |
462e67574ba202a816ab4adf33500cc567fffa98 | 279 | cpp | C++ | ieee_sep/token.cpp | Tylores/ieee_sep | 1928bed8076f4bfe702d34e436c6a85f197b0832 | [
"BSD-2-Clause"
] | null | null | null | ieee_sep/token.cpp | Tylores/ieee_sep | 1928bed8076f4bfe702d34e436c6a85f197b0832 | [
"BSD-2-Clause"
] | null | null | null | ieee_sep/token.cpp | Tylores/ieee_sep | 1928bed8076f4bfe702d34e436c6a85f197b0832 | [
"BSD-2-Clause"
] | null | null | null | ///////////////////////////////////////////////////////////
// token.cpp
// Implementation of the Class token
// Created on: 13-Apr-2020 2:51:45 PM
///////////////////////////////////////////////////////////
#include "token.h"
token::token(){
}
token::~token(){
} | 15.5 | 59 | 0.340502 | Tylores |
4632f6ab65f9c407fd00c18576368dc49afbf464 | 768 | hpp | C++ | include/burst/range/cache_one.hpp | izvolov/thrust | 399e12eed54131d731c4c5ef40512b17107bca56 | [
"BSL-1.0"
] | 85 | 2015-11-25T14:05:42.000Z | 2021-11-15T11:47:19.000Z | include/burst/range/cache_one.hpp | izvolov/burst | 399e12eed54131d731c4c5ef40512b17107bca56 | [
"BSL-1.0"
] | 147 | 2015-01-11T08:36:53.000Z | 2021-11-04T09:03:36.000Z | include/burst/range/cache_one.hpp | izvolov/thrust | 399e12eed54131d731c4c5ef40512b17107bca56 | [
"BSL-1.0"
] | 6 | 2016-06-02T17:28:26.000Z | 2020-04-05T11:16:16.000Z | #ifndef BURST__RANGE__CACHE_ONE_HPP
#define BURST__RANGE__CACHE_ONE_HPP
#include <burst/iterator/cache_iterator.hpp>
#include <boost/range/iterator_range.hpp>
#include <iterator>
namespace burst
{
//! Функция для создания диапазона кэширующих итераторов
/*!
Принимает на вход произвольный диапазон.
Возвращает диапазон из кэширующих итераторов.
*/
template <typename Range>
auto cache_one (const Range & range)
{
using std::begin;
using std::end;
return
boost::make_iterator_range
(
make_cache_iterator(begin(range)),
make_cache_iterator(end(range))
);
}
} // namespace burst
#endif // BURST__RANGE__CACHE_ONE_HPP
| 24 | 64 | 0.641927 | izvolov |
463ac5856b1f4d56eac58b33d723b9923e1d3042 | 6,226 | cpp | C++ | src/SubtreeTracker.cpp | ravidavi/OpenFrames | 67cce87f1ccd23df91d6d070d86c06ceb180dadb | [
"Apache-2.0"
] | 26 | 2017-08-16T18:17:50.000Z | 2022-03-11T10:23:52.000Z | src/SubtreeTracker.cpp | ravidavi/OpenFrames | 67cce87f1ccd23df91d6d070d86c06ceb180dadb | [
"Apache-2.0"
] | 4 | 2018-10-18T12:31:19.000Z | 2020-08-12T08:59:25.000Z | src/SubtreeTracker.cpp | ravidavi/OpenFrames | 67cce87f1ccd23df91d6d070d86c06ceb180dadb | [
"Apache-2.0"
] | 11 | 2018-09-10T18:29:07.000Z | 2022-03-09T13:53:52.000Z | /***********************************
Copyright 2020 Ravishankar Mathur
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 SubtreeTracker.cpp
* SubtreeTracker-class function definitions.
*/
#include <OpenFrames/ReferenceFrame.hpp>
#include <OpenFrames/SubtreeTracker.hpp>
#ifdef _OF_VERBOSE_
#include <iostream>
#endif
namespace OpenFrames
{
SubtreeTracker::SubtreeTracker()
{
#ifdef _OF_VERBOSE_
std::cout<< "SubtreeTracker()" << std::endl;
#endif
}
SubtreeTracker::SubtreeTracker( ReferenceFrame* frame )
{
#ifdef _OF_VERBOSE_
std::cout<< "SubtreeTracker(frame)" << std::endl;
#endif
setRoot(frame);
}
SubtreeTracker::~SubtreeTracker()
{
#ifdef _OF_VERBOSE_
std::cout<< "~SubtreeTracker()" << std::endl;
#endif
setRoot(NULL);
}
/* Add a child and its subtree to the frame list. Do not add if we are already tracking a different frame with the same name as the child. */
void SubtreeTracker::childAdded( ReferenceFrame* child,
ReferenceFrame* parent )
{
#ifdef _OF_VERBOSE_
std::cout<< "In SubtreeTracker::childAdded()" << std::endl;
#endif
if( _frames[parent->getName()] != parent ) // Should never happen!!
{
#ifdef _OF_VERBOSE_
std::cout<< "SubtreeTracker::childAdded() error: Parent does not exist in frame list!" << std::endl;
#endif
return;
}
// Get the currently tracked frame with the same name
ReferenceFrame* c = _frames[child->getName()];
// If we are not currently tracking a frame with the same name,
// then add the child to the frame list.
if( c == NULL )
{
_frames[child->getName()] = child; // Add child to frame list
child->addTracker(this); // Register tracker with child
c = child;
}
// If the currently tracked frame is the same as the child, then
// make sure that we are also tracking the child's subtree.
if( c == child )
_addAllChildren(child); // Add child's subtree to frame list
// At this point, if the currently tracked frame is different
// from the child, then the child and its entire subtree
// will be ignored.
#ifdef _OF_VERBOSE_
std::cout<< "Exiting SubtreeTracker::childAdded()" << std::endl;
#endif
}
/* Remove a child and its subtree from the frame list. Do not remove if the child has other parents that we are still tracking */
void SubtreeTracker::childRemoved( ReferenceFrame* child,
ReferenceFrame* parent )
{
#ifdef _OF_VERBOSE_
std::cout<< "In SubtreeTracker::childRemoved()" << std::endl;
#endif
if( _frames[parent->getName()] != parent )
{
#ifdef _OF_VERBOSE_
std::cout<< "SubtreeTracker::childRemoved() error: Parent does not exist in frame list!" << std::endl;
#endif
return;
}
// Child was not being tracked anyway so don't do anything
if( _frames[child->getName()] != child ) return;
/* We should keep tracking the child if it has any other
parents that we are currently tracking */
int num_parents = child->getNumParents();
for( int i = 0; i < num_parents; ++i )
{
ReferenceFrame* p = child->getParent(i);
if( (p != parent) && (p == _frames[p->getName()]) )
return;
}
/* Since the child no longer has parents that are being tracked,
we can remove it and its children from the track list */
_removeAllChildren( child );
child->removeTracker(this);
_frames.erase(child->getName());
#ifdef _OF_VERBOSE_
std::cout<< "Exiting SubtreeTracker::childRemoved()" << std::endl;
#endif
}
/** Choose which frame's subtree should be tracked. */
void SubtreeTracker::setRoot( ReferenceFrame* frame )
{
#ifdef _OF_VERBOSE_
std::cout<< "In SubtreeTracker::setRoot() with frame ";
if(frame) std::cout<< frame->getName() << std::endl;
else std::cout<< "NULL" << std::endl;
#endif
if( _root == frame ) return; // Nothing needs to be done
// Remove all currently tracked frames
if( _root != NULL )
{
FrameMap::iterator i;
for( i = _frames.begin(); i != _frames.end(); ++i )
i->second->removeTracker(this);
_frames.clear();
}
_root = frame; // Set new frame to be tracked
// Scan new tracked frame to discover all of its children
if( _root != NULL )
{
#ifdef _OF_VERBOSE_
std::cout<< " SubtreeTracker::setRoot(): Setting _root to "
<< frame->getName() << std::endl;
#endif
_root->addTracker(this); // Register tracker with the new frame
_frames[_root->getName()] = _root.get(); // Add _root to list
rescan(); // Add children of _root to list
}
#ifdef _OF_VERBOSE_
std::cout<< "Exiting SubtreeTracker::setRoot()" << std::endl;
#endif
}
void SubtreeTracker::rescan()
{
if(_root != NULL) _addAllChildren(_root.get());
}
ReferenceFrame* SubtreeTracker::getFrame( const std::string& name )
{
ReferenceFrame* temp = _frames[name];
if(!temp)
{
#ifdef _OF_VERBOSE_
std::cout<< "SubtreeTracker ERROR: Frame with name '" << name
<< "' could not be found." << std::endl;
#endif
return NULL;
}
return temp;
}
/** Print a list (to std::cout) of all tracked frames */
void SubtreeTracker::printFrameList()
{
#ifdef _OF_VERBOSE_
FrameMap::iterator i;
for( i = _frames.begin(); i != _frames.end(); ++i )
std::cout<< "->" << i->first;
std::cout<< std::endl;
#endif
}
/** Recursively add the subtree of the given frame to the frame list */
void SubtreeTracker::_addAllChildren( ReferenceFrame* frame )
{
int num_children = frame->getNumChildren();
for( int i = 0; i < num_children; ++i )
childAdded( frame->getChild(i), frame );
}
/** Recursively remove the subtree of the given frame from the frame list */
void SubtreeTracker::_removeAllChildren( ReferenceFrame* frame )
{
int num_children = frame->getNumChildren();
for( int i = 0; i < num_children; ++i )
childRemoved( frame->getChild(i), frame );
}
}
| 28.045045 | 143 | 0.681658 | ravidavi |
463d0151eb33cb45fefa7a806bd065497dad38d1 | 6,131 | hpp | C++ | tests/WIP/apps/fom_gold_states.hpp | Pressio/pressio | e07eb1ed71266490217f2f7a3aad5e1acfecfd4a | [
"BSD-3-Clause"
] | 29 | 2019-11-11T13:17:57.000Z | 2022-03-16T01:31:31.000Z | tests/WIP/apps/fom_gold_states.hpp | Pressio/pressio | e07eb1ed71266490217f2f7a3aad5e1acfecfd4a | [
"BSD-3-Clause"
] | 303 | 2019-09-30T10:15:41.000Z | 2022-03-30T08:24:04.000Z | tests/WIP/apps/fom_gold_states.hpp | nittaya1990/pressio | 22fad15ffc00f3e4d880476a5e60b227ac714ef4 | [
"BSD-3-Clause"
] | 4 | 2020-07-07T03:32:36.000Z | 2022-03-10T05:21:42.000Z |
#ifndef PRESSIO_APPS_TEST_STEADY_ADV_DIFF_2D_GOLD_HPP_
#define PRESSIO_APPS_TEST_STEADY_ADV_DIFF_2D_GOLD_HPP_
namespace pressio { namespace apps{ namespace test{
const std::map<int, double> steadyAdvDiff2d_nx11ny21 =
{ { 0, 0.891273974928453},
{ 1, 0.639232629093212},
{ 2, 0.798702684256647},
{ 3, 0.722976315927139},
{ 4, 0.811478952670863},
{ 5, 0.791886451291076},
{ 6, 0.85667135775502},
{ 7, 0.87614150387528},
{ 8, 0.93730525569533},
{ 9, 0.87033039806396},
{ 10, 0.596713046921575},
{ 11, 0.713050698542338},
{ 12, 0.604408953402696},
{ 13, 0.658796115640804},
{ 14, 0.620756153342336},
{ 15, 0.674837429719221},
{ 16, 0.713108452893052},
{ 17, 0.821716618851947},
{ 18, 0.825979112689879},
{ 19, 0.534156664472788},
{ 20, 0.596650439215221},
{ 21, 0.475415136748368},
{ 22, 0.505257736992637},
{ 23, 0.460382468441686},
{ 24, 0.486205657054499},
{ 25, 0.520521095146965},
{ 26, 0.645361539053294},
{ 27, 0.773535952998933},
{ 28, 0.502342512885836},
{ 29, 0.543788664746539},
{ 30, 0.461321947895769},
{ 31, 0.499407331923415},
{ 32, 0.475532009946163},
{ 33, 0.472450977968704},
{ 34, 0.471801023890908},
{ 35, 0.522751058557789},
{ 36, 0.717481800573766},
{ 37, 0.499997191084288},
{ 38, 0.523679271108308},
{ 39, 0.475173062521434},
{ 40, 0.505402843421742},
{ 41, 0.500350129566062},
{ 42, 0.481198013340363},
{ 43, 0.469109077140594},
{ 44, 0.423309945058818},
{ 45, 0.652375115189422},
{ 46, 0.511923162998243},
{ 47, 0.514390747760908},
{ 48, 0.485957795726884},
{ 49, 0.500000000165975},
{ 50, 0.514042204593789},
{ 51, 0.485609252579569},
{ 52, 0.488076837247168},
{ 53, 0.347624884936834},
{ 54, 0.576690055047877},
{ 55, 0.530890923059802},
{ 56, 0.518801986981067},
{ 57, 0.499649870784546},
{ 58, 0.49459715692626},
{ 59, 0.524826937796393},
{ 60, 0.476320729215603},
{ 61, 0.500002809131214},
{ 62, 0.282518199539792},
{ 63, 0.477248941548196},
{ 64, 0.528198976256505},
{ 65, 0.527549022309872},
{ 66, 0.524467990386341},
{ 67, 0.500592668432781},
{ 68, 0.538678052393753},
{ 69, 0.456211335554804},
{ 70, 0.497657487280469},
{ 71, 0.226464047113501},
{ 72, 0.354638461024641},
{ 73, 0.479478904962344},
{ 74, 0.513794343117482},
{ 75, 0.539617531768507},
{ 76, 0.494742263231283},
{ 77, 0.524584863460258},
{ 78, 0.403349560954983},
{ 79, 0.465843335643068},
{ 80, 0.174020887406615},
{ 81, 0.178283381188652},
{ 82, 0.28689154716752},
{ 83, 0.325162570365794},
{ 84, 0.379243846756502},
{ 85, 0.341203884469651},
{ 86, 0.395591046701378},
{ 87, 0.286949301559168},
{ 88, 0.403286953154882},
{ 89, 0.129669602018982},
{ 90, 0.0626947443141765},
{ 91, 0.123858496140036},
{ 92, 0.143328642269684},
{ 93, 0.208113548737864},
{ 94, 0.188521047369285},
{ 95, 0.277023684114191},
{ 96, 0.201297315797615},
{ 97, 0.3607673709536},
{ 98, 0.108726025141856},
{ 99, 0.178283381157988},
{100, 0.286891547127381},
{101, 0.325162570315962},
{102, 0.379243846700177},
{103, 0.341203884409679},
{104, 0.39559104664446},
{105, 0.286949301511664},
{106, 0.403286953121147},
{107, 0.129669602000894},
{108, 0.354638460969165},
{109, 0.479478904904608},
{110, 0.51379434303254},
{111, 0.539617531657116},
{112, 0.494742263110883},
{113, 0.524584863341193},
{114, 0.403349560870974},
{115, 0.465843335584404},
{116, 0.174020887379266},
{117, 0.477248941474023},
{118, 0.528198976191887},
{119, 0.527549022168384},
{120, 0.524467990190486},
{121, 0.50059266820546},
{122, 0.538678052231347},
{123, 0.456211335342035},
{124, 0.497657487189624},
{125, 0.226464047064227},
{126, 0.576690055003184},
{127, 0.530890922977394},
{128, 0.518801986817648},
{129, 0.499649870585383},
{130, 0.494597156727361},
{131, 0.524826937615598},
{132, 0.47632072900938},
{133, 0.500002808974362},
{134, 0.282518199481044},
{135, 0.652375115091034},
{136, 0.511923162857287},
{137, 0.514390747579833},
{138, 0.485957795545573},
{139, 0.499999999980216},
{140, 0.514042204409004},
{141, 0.485609252380187},
{142, 0.488076837090091},
{143, 0.347624884872144},
{144, 0.717481800504738},
{145, 0.499997190985847},
{146, 0.523679270959589},
{147, 0.475173062337246},
{148, 0.5054028432387},
{149, 0.500350129376717},
{150, 0.481198013151375},
{151, 0.469109076996886},
{152, 0.423309944996746},
{153, 0.773535952912293},
{154, 0.502342512778857},
{155, 0.543788664599039},
{156, 0.461321947718254},
{157, 0.499407331760937},
{158, 0.475532009766023},
{159, 0.472450977809185},
{160, 0.471801023774861},
{161, 0.522751058506095},
{162, 0.825979112623533},
{163, 0.534156664400501},
{164, 0.596650439109024},
{165, 0.475415136627253},
{166, 0.505257736865464},
{167, 0.460382468309934},
{168, 0.486205656944743},
{169, 0.520521095067838},
{170, 0.645361539016951},
{171, 0.870330397998021},
{172, 0.596713046869355},
{173, 0.713050698473255},
{174, 0.604408953334604},
{175, 0.658796115573272},
{176, 0.620756153279942},
{177, 0.674837429667821},
{178, 0.713108452856801},
{179, 0.821716618834889},
{180, 0.891273974866919},
{181, 0.639232629053337},
{182, 0.798702684209675},
{183, 0.722976315892574},
{184, 0.81147895263715},
{185, 0.791886451266418},
{186, 0.85667135773522},
{187, 0.876141503863048},
{188, 0.937305255689407}
};
}}}//end namespace pressio::apps::test
#endif
| 30.351485 | 54 | 0.601533 | Pressio |
463f0cd59a5da7b55768e417840def727d9ab8cf | 3,307 | hpp | C++ | include/xlnt/styles/number_format.hpp | AlanIWBFT/xlnt-ue4 | 486da299390a05198a0ba4ebb456f226b87924b3 | [
"MIT",
"Unlicense"
] | 12 | 2015-09-05T04:12:16.000Z | 2021-08-22T23:24:18.000Z | include/xlnt/styles/number_format.hpp | AlanIWBFT/xlnt-ue4 | 486da299390a05198a0ba4ebb456f226b87924b3 | [
"MIT",
"Unlicense"
] | null | null | null | include/xlnt/styles/number_format.hpp | AlanIWBFT/xlnt-ue4 | 486da299390a05198a0ba4ebb456f226b87924b3 | [
"MIT",
"Unlicense"
] | 4 | 2015-09-06T13:00:10.000Z | 2021-07-12T05:15:21.000Z | // Copyright (c) 2014 Thomas Fussell
// Copyright (c) 2010-2014 openpyxl
//
// 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, WRISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE
//
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <string>
#include <unordered_map>
#include <utility>
namespace xlnt {
class number_format
{
public:
enum class format
{
general,
text,
number,
number_00,
number_comma_separated1,
number_comma_separated2,
percentage,
percentage_00,
date_yyyymmdd2,
date_yyyymmdd,
date_ddmmyyyy,
date_dmyslash,
date_dmyminus,
date_dmminus,
date_myminus,
date_xlsx14,
date_xlsx15,
date_xlsx16,
date_xlsx17,
date_xlsx22,
date_datetime,
date_time1,
date_time2,
date_time3,
date_time4,
date_time5,
date_time6,
date_time7,
date_time8,
date_timedelta,
date_yyyymmddslash,
currency_usd_simple,
currency_usd,
currency_eur_simple,
unknown
};
struct format_hash
{
std::size_t operator()(format f) const
{
return std::hash<int>()((int)f);
}
};
static const std::unordered_map<format, std::string, format_hash> &format_strings();
static const std::unordered_map<int, std::string> &builtin_formats();
static const std::unordered_map<std::string, int> &reversed_builtin_formats();
static std::string builtin_format_code(int index);
static format lookup_format(int code);
static bool is_date_format(const std::string &format);
static bool is_builtin(const std::string &format);
number_format() : format_code_(format::general), format_index_(0) {}
number_format(format code) : format_code_(code) {}
format get_format_code() const { return format_code_; }
void set_format_code(format format_code) { format_code_ = format_code; }
void set_format_code(const std::string &format_code) { custom_format_code_ = format_code; }
private:
std::string custom_format_code_ = "";
format format_code_ = format::general;
int format_index_ = 0;
};
} // namespace xlnt
| 31.198113 | 95 | 0.680375 | AlanIWBFT |
464d9ce9c87925954ea5596b16651b0de3639f6d | 1,986 | cpp | C++ | Game/Source/Archetypes/WallArchetype.cpp | JanVijfhuizen/Data-Oriented-Engine | cf0af33249a5b81a28adb8e3502e426d112934ba | [
"MIT"
] | null | null | null | Game/Source/Archetypes/WallArchetype.cpp | JanVijfhuizen/Data-Oriented-Engine | cf0af33249a5b81a28adb8e3502e426d112934ba | [
"MIT"
] | null | null | null | Game/Source/Archetypes/WallArchetype.cpp | JanVijfhuizen/Data-Oriented-Engine | cf0af33249a5b81a28adb8e3502e426d112934ba | [
"MIT"
] | null | null | null | #include "pch.h"
#include "Archetypes/WallArchetype.h"
#include "Systems/CollisionSystem.h"
#include "Graphics/RenderConventions.h"
namespace game
{
SubTexture WallArchetype::GenerateSubTexture(const Texture& texture) const
{
return texture::GenerateSubTexture(texture, renderConventions::ENTITY_SIZE, renderConventions::Player);
}
void WallArchetype::Allocate(const EngineOutData& outData, SystemChain& chain)
{
Archetype<Wall, WallUpdateInfo>::Allocate(outData, chain);
const size_t length = GetLength();
chain.Get<CollisionSystem>()->IncreaseRequestedLength(length, false);
chain.Get<EntityRenderSystem>()->IncreaseRequestedLength(length);
}
void WallArchetype::Awake(const EngineOutData& outData, SystemChain& chain)
{
Archetype<Wall, WallUpdateInfo>::Awake(outData, chain);
const auto& texture = chain.Get<EntityRenderSystem>()->GetTexture();
_subTexture = GenerateSubTexture(texture);
}
void WallArchetype::Start(const EngineOutData& outData, SystemChain& chain)
{
Archetype<Wall, WallUpdateInfo>::Start(outData, chain);
auto collisionSystem = chain.Get<CollisionSystem>();
for (auto& wall : *this)
{
StaticCollisionTask collisionTask{};
collisionTask.transform = wall.transform;
collisionTask.collider = wall.collider;
collisionSystem->AddStatic(collisionTask);
}
}
WallUpdateInfo WallArchetype::OnPreEntityUpdate(const EngineOutData& outData, SystemChain& chain)
{
WallUpdateInfo info{};
info.entityRenderSystem = chain.Get<EntityRenderSystem>();
return info;
}
void WallArchetype::OnEntityUpdate(Wall& entity, WallUpdateInfo& info)
{
auto& transform = entity.transform;
auto& renderer = entity.renderer;
EntityRenderTask renderTask{};
auto& taskTransform = renderTask.transform;
taskTransform = transform;
renderTask.subTexture = renderer.subTexture;
info.entityRenderSystem->Add(renderTask);
}
void WallArchetype::OnAdd(Wall& entity)
{
entity.renderer.subTexture = _subTexture;
}
}
| 28.782609 | 105 | 0.763847 | JanVijfhuizen |
464f92d0288de96943070e3ec64d53333cbfcb10 | 705 | cpp | C++ | 04_graph_algorithms/23_road_construction.cpp | hariharanragothaman/CSES | fa3478a71fbf66f695673e2a644d84084f6a3b90 | [
"MIT"
] | 1 | 2021-06-17T17:14:13.000Z | 2021-06-17T17:14:13.000Z | 04_graph_algorithms/23_road_construction.cpp | hariharanragothaman/CSES | fa3478a71fbf66f695673e2a644d84084f6a3b90 | [
"MIT"
] | null | null | null | 04_graph_algorithms/23_road_construction.cpp | hariharanragothaman/CSES | fa3478a71fbf66f695673e2a644d84084f6a3b90 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
struct DSU {
vector<int> e;
void init (int n) { e = vector<int> (n, -1); }
int get (int x) { return (e[x] < 0 ? x : e[x] = get(e[x])); }
bool sameSet (int x, int y) { return get(x) == get(y); }
int size (int x) { return -e[get(x)]; }
bool unite (int x, int y) {
x = get(x), y = get(y);
if (x == y) return 0;
if (e[x] > e[y]) swap(x, y);
e[x] += e[y];
e[y] = x;
return 1;
}
};
int main () {
int n, m;
cin >> n >> m;
DSU dsu;
dsu.init(n);
int cc = n, large = 1;
while (m--) {
int x, y;
cin >> x >> y;
x--; y--;
if (dsu.unite(x, y)) {
large = max(large, dsu.size(x));
cc--;
}
cout<< cc << ' ' << large << '\n';
}
} | 18.552632 | 62 | 0.468085 | hariharanragothaman |
4650842f2a566bc49d1c2879a8d79e990b32193e | 1,800 | hpp | C++ | include/fontCache.hpp | iaiacthulhu/fontCache | f6204d35916f820b7f96d412e76f451d9c0aaed5 | [
"MIT"
] | null | null | null | include/fontCache.hpp | iaiacthulhu/fontCache | f6204d35916f820b7f96d412e76f451d9c0aaed5 | [
"MIT"
] | null | null | null | include/fontCache.hpp | iaiacthulhu/fontCache | f6204d35916f820b7f96d412e76f451d9c0aaed5 | [
"MIT"
] | null | null | null | #ifndef FONTCACHE_H
#define FONTCACHE_H
#include <iostream>
#include <map>
#include <GL/glew.h>
#include <ft2build.h>
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-register"
#endif
#include FT_FREETYPE_H
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#include "./common/linear_algebra.hpp"
#define IMAGE_SIZE 1024
#define IMAGE_DATA_BUFFER_SIZE IMAGE_SIZE*IMAGE_SIZE
#define SPRITE_PIXEL 64
class fontCache
{
private:
fontCache& operator=(const fontCache& r){return *this;}
fontCache(const fontCache& r){}
fontCache(const char *);
~fontCache();
public:
class fontData_
{
public:
vec2 UVul;
vec2 UVlr;
unsigned int bitmap_left;
unsigned int bitmap_top;
unsigned int width;
unsigned int height;
unsigned int advanceX;
fontData_();
};
private:
static fontCache * pInstance;
std::map<char32_t, fontData_> font;
unsigned int fontCount;
float currentU;
float currentV;
unsigned int currentX;
unsigned int currentY;
unsigned char imageData[IMAGE_DATA_BUFFER_SIZE];
FT_Library ftlib;
FT_Face ftface;
GLuint programID;
GLuint vaoText;
GLuint vboText;
GLuint texture;
static const char vShader[];
static const char fShader[];
unsigned int textLength;
public:
fontData_& operator[](char32_t);
void bufferData(const char32_t *);
void writeImage(void);
void draw(void);
static void set(const char *);
static fontCache * getInstance();
};
#endif
| 22.78481 | 70 | 0.607778 | iaiacthulhu |
4655e50fb40164da11a32e064f6f853d8eae5495 | 7,773 | cpp | C++ | Source/RState.cpp | HaikuArchives/Rez | db5e7e1775a379e1e54bc17012047d92ec782202 | [
"BSD-4-Clause"
] | 1 | 2016-09-12T19:04:30.000Z | 2016-09-12T19:04:30.000Z | Source/RState.cpp | HaikuArchives/Rez | db5e7e1775a379e1e54bc17012047d92ec782202 | [
"BSD-4-Clause"
] | null | null | null | Source/RState.cpp | HaikuArchives/Rez | db5e7e1775a379e1e54bc17012047d92ec782202 | [
"BSD-4-Clause"
] | null | null | null | /* $Id: RState.cpp,v 1.1.1.1 2000/03/05 06:22:40 tpv Exp $
Copyright 1996, 1997, 1998
Hekkelman Programmatuur B.V. 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. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by Hekkelman Programmatuur B.V.
4. The name of Hekkelman Programmatuur B.V. may not be used to endorse or
promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED ``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
AUTHORS 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.
Created: 12/02/98 15:38:02
*/
#include "rez.h"
#include "RState.h"
#include "REval.h"
#include "SymbolTable.h"
#include <typeinfo>
#include <string.h>
#include <support/Debug.h>
#include <ByteOrder.h>
#include <List.h>
bool inited = false;
intmap RState::sfTypeMap ; // = intmap;
intmap gValueMap ; // = intmap;
#pragma mark --- RState ---
RState::RState()
{
fNext = NULL;
} /* RState::RState */
RState::~RState()
{
} /* RState::~RState */
RState* RState::FirstState(int type)
{
gValueMap.erase(gValueMap.begin(), gValueMap.end());
return (RState *)sfTypeMap[type];
} /* RState::FirstState */
void RState::FinishType(int type, RState *state)
{
int sType = htonl(type);
if (sfTypeMap.find(type) != sfTypeMap.end())
rez_warn("warning: redefinition of type '%4.4s'", &sType);
sfTypeMap[type] = (int)state;
} /* RState::FinishType */
void RState::CopyType(int type1, int type2)
{
int sType = htonl(type1);
if (sfTypeMap.find(type1) != sfTypeMap.end())
rez_warn("warning: redefinition of type '%4.4s'", &sType);
sfTypeMap[type1] = sfTypeMap[type2];
} /* RState::CopyType */
RState* RState::Shift(int v, int token, RElem** head)
{
if (!fNext) return NULL;
RSValue *sv = dynamic_cast<RSValue*>(fNext);
if (sv && sv->fHasDefault)
return sv->Shift(sv->fValue, sv->fType, head);
else
return fNext;
} /* RState::Shift */
void RState::SetNext(RState *next)
{
ASSERT(next);
if (!fNext && next != this)
fNext = next;
else if (fNext)
fNext->SetNext(next);
} /* RState::SetNext */
#pragma mark -
#pragma mark --- RSValue and other values ---
RSValue::RSValue(int type)
{
fType = type;
fHasDefault = false;
fValue = 0;
fIdents = NULL;
} /* RSValue::RSValue */
void RSValue::AddIdentifiers(BList *idents)
{
fIdents = idents;
} /* RSValue::AddIdentifier */
bool RSValue::ResolveIdentifier(int& v)
{
if (!fIdents) return false;
for (int i = 0; i < fIdents->CountItems(); i++)
{
RSymbol *s = (RSymbol *)fIdents->ItemAt(i);
if (s->sIdentifier == v)
{
v = s->sValue;
return true;
}
}
return false;
} /* RSValue::ResolveIdentifier */
void RSValue::SetDefaultValue(int v)
{
fHasDefault = true;
fValue = v;
} /* RSValue::SetDefaultValue */
#pragma mark -
RSStringValue::RSStringValue(int kind, int size)
: RSValue(tString)
{
fKind = kind;
fSize = size;
} /* RSWStringValue::RSWStringValue */
RState* RSStringValue::Shift(int v, int token, RElem** head)
{
int t = token;
if (token == tIdent)
{
int id = v;
if (ResolveIdentifier(v))
t = tString;
else
rez_error("Unknown identifier: %s", ST_Ident(id));
}
if (t == tString || t == tRaw)
{
const char *s = (char *)v;
short l;
char *p;
if (fKind == skHex)
l = *(long *)v;
else
l = strlen(s);
p = (char *)calloc(std::max((int)l, fSize) + 2, 1);
if (!p) rez_error("Insufficient memory");
switch (fKind)
{
case skStr:
strcpy(p, s);
RAddElement(head, p, (fSize ? fSize : l), this);
break;
case skPStr:
strcpy(p + 1, s);
p[0] = l;
RAddElement(head, p, (fSize ? fSize : l + 1), this);
break;
case skWStr:
strcpy(p + 2, s);
memcpy(p, &l, 2);
RAddElement(head, p, (fSize ? fSize : l + 2), this);
break;
case skCStr:
strcpy(p, s);
RAddElement(head, p, (fSize ? fSize : l + 1), this);
break;
case skHex:
memcpy(p, s + sizeof(long), l);
RAddElement(head, p, (fSize ? fSize : l), this);
break;
}
free(p);
}
else
rez_error("expected string");
return RState::Shift(v, token, head);
} /* RSWStringValue::Shift */
#pragma mark -
#pragma mark --- RSNrValue ---
RSNrValue::RSNrValue(int size)
: RSValue(tInt)
{
fSize = size;
} /* RSNrValue::RSNrValue */
RState* RSNrValue::Shift(int v, int token, RElem** head)
{
if (token == tIdent)
{
int id = v;
if (ResolveIdentifier(v))
RAddElement(head, RValue(v), fSize, this);
else
rez_error("Unknown identifier: %s", ST_Ident(id));
}
else if (token == tInt)
RAddElement(head, (REval *)v, fSize, this);
else if (fHasDefault)
{
RAddElement(head, (REval *)fValue, fSize, this);
return fNext->Shift(v, token, head);
}
else
rez_error("internal error 3");
return RSValue::Shift(v, token, head);
} /* RSNrValue::Shift */
#pragma mark -
#pragma mark --- RSArray ---
RSArray::RSArray(RState *data, int ident, int fixedCount)
{
fNext = new RSArrayNode(data, ident, fixedCount);
} /* RSArray::RSArray */
RState* RSArray::Shift(int v, int token, RElem **)
{
if (token != tArray)
rez_error("expected an array");
static_cast<RSArrayNode*>(fNext)->ResetCounter();
return fNext;
} /* RSArray::Shift */
RSArrayNode::RSArrayNode(RState *data, int ident, int fixedCount)
{
fHead = data;
fHead->SetNext(this);
fIdent = ident;
fFixedCount = fixedCount;
} /* RSArrayNode::RSArrayNode */
RState* RSArrayNode::Shift(int v, int token, RElem** head)
{
if (token != tArrayEnd)
{
gValueMap[fIdent] = ++fCount;
return fHead->Shift(v, token, head);
}
if (fFixedCount && fCount != fFixedCount)
rez_error("Incorrect nr of array elements");
return RState::Shift(v, token, head);
} /* RSArrayNode::Shift */
void RSArrayNode::ResetCounter()
{
fCount = 0;
} /* RSArrayNode::ResetCounter */
#pragma mark -
#pragma mark --- RSSwitch ---
RSSwitch::RSSwitch(BList *cases)
{
fCases = cases;
} /* RSSwitch::RSSwitch */
void RSSwitch::SetNext(RState *next)
{
ASSERT(next != this);
for (int i = 0; i < fCases->CountItems(); i++)
{
RCase *rcase = (RCase *)fCases->ItemAt(i);
rcase->sStates->SetNext(next);
}
} /* RSSwitch::SetNext */
RState* RSSwitch::Shift(int v, int token, RElem** head)
{
if (token == tCase)
{
for (int i = 0; i < fCases->CountItems(); i++)
{
RCase *rcase = (RCase *)fCases->ItemAt(i);
if (rcase->sIdent == v)
{
RSValue *sv = dynamic_cast<RSValue*>(rcase->sStates);
if (sv && sv->fHasDefault)
return sv->Shift(sv->fValue, sv->fType, head);
else
return rcase->sStates;
}
}
}
else
rez_error("expected case");
return NULL;
} /* RSSwitch::Shift */
| 22.997041 | 77 | 0.660363 | HaikuArchives |
4656360df12f56b3b31a88bc97acd2bbc3e6b852 | 11,162 | cc | C++ | src/device.cc | xaudioproject/xapcppcore-audioio | 615df98bfbc2fbca6b68127f2f9b342d69e7cc8d | [
"BSD-3-Clause"
] | 1 | 2021-07-18T02:22:42.000Z | 2021-07-18T02:22:42.000Z | src/device.cc | xaudioproject/xapcppcore-audioio | 615df98bfbc2fbca6b68127f2f9b342d69e7cc8d | [
"BSD-3-Clause"
] | null | null | null | src/device.cc | xaudioproject/xapcppcore-audioio | 615df98bfbc2fbca6b68127f2f9b342d69e7cc8d | [
"BSD-3-Clause"
] | null | null | null | //
// Copyright 2019 - 2021 The XOrange Studio. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.md file.
//
//
// Imports.
//
#include "error_p.h"
#include <exception>
#include <portaudio.h>
#include <xap/audioio/device.h>
#include <xap/audioio/error.h>
namespace xap {
namespace audioio {
//
// Declare.
//
std::weak_ptr<xap::audioio::DeviceManager>
xap::audioio::DeviceManager::m_instance;
std::mutex xap::audioio::DeviceManager::m_instance_lock;
//
// DeviceManager constructor & destructor.
//
/**
* Construct the object.
*
* @throw XAPAudioIOException
* Raised if portaudio initialization was failed
* (xap::audioio::ERROR_PORTAUDIOCALL).
*
*/
DeviceManager::DeviceManager() {
PaError error = Pa_Initialize();
if (error != paNoError) {
throw xap::audioio::Exception(
Pa_GetErrorText(error),
xap::audioio::ERROR_PORTAUDIOCALL
);
}
}
/**
* Destruct the object.
*/
DeviceManager::~DeviceManager() noexcept {
Pa_Terminate();
}
//
// XAPAudioDeviceManager public methods.
//
/**
* Load shared (single) instance.
*
* @throw xap::audioio::Exception
* Raised in the following situations:
*
* - xap::audioio::ERROR_PORTAUDIOCALL:
* Raised if PortAudio initialization was failed.
*
* - xap::audioio::ERROR_ALLOC:
* Raised if memory allocation was failed.
*
* - xap::audioio::ERROR_SYSTEMCALL:
* Raised if system (lock) call was failed.
*
* @return
* The device manager.
*/
std::shared_ptr<xap::audioio::DeviceManager>
DeviceManager::load_shared_instance() {
try {
//
// Lock.
//
std::lock_guard<std::mutex> lock(
xap::audioio::DeviceManager::m_instance_lock
);
if (auto mgr = xap::audioio::DeviceManager::m_instance.lock()) {
return mgr;
} else {
xap::audioio::DeviceManager *manager =
new xap::audioio::DeviceManager();
std::shared_ptr<xap::audioio::DeviceManager> ptr =
std::shared_ptr<xap::audioio::DeviceManager>(manager);
xap::audioio::DeviceManager::m_instance = ptr;
return ptr;
}
} catch (std::system_error &error) {
throw xap::audioio::Exception(
error.what(),
ERROR_SYSTEMCALL
);
} catch (std::bad_alloc &error) {
throw xap::audioio::Exception(
error.what(),
xap::audioio::ERROR_ALLOC
);
}
}
/**
* Load all valid input devices.
*
* @throw
* Raised in the following situations:
*
* - xap::audioio::ERROR_PORTAUDIOCALL:
* Raised if PortAudio calling was failed.
*
* - xap::audioio::ERROR_ALLOC:
* Raised if memory allocation was failed.
*
* - xap::audioio::ERROR_SYSTEMCALL:
* Raised if system (lock) calling was failed.
*
* @return
* The input devices vector.
*/
const std::vector<const xap::audioio::InputDevice>
DeviceManager::load_all_input_devices() {
try {
//
// Lock.
//
std::lock_guard<std::mutex> lock(this->m_input_device_lock);
std::vector<const xap::audioio::InputDevice> rst;
int devices_count = Pa_GetDeviceCount();
if (devices_count < 0) {
throw xap::audioio::Exception(
Pa_GetErrorText(devices_count),
xap::audioio::ERROR_PORTAUDIOCALL
);
}
int default_device = Pa_GetDefaultInputDevice();
if (default_device < paNoDevice) {
throw xap::audioio::Exception(
Pa_GetErrorText(default_device),
xap::audioio::ERROR_PORTAUDIOCALL
);
}
for (int i = 0; i < devices_count; ++i) {
const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
if (info == nullptr || info->maxInputChannels == 0) {
continue;
}
xap::audioio::InputDevice device;
device.is_default = (i == default_device);
device.device_id = static_cast<int64_t>(i);
device.name = std::string(info->name);
device.default_low_latency = info->defaultLowOutputLatency;
device.defalut_high_latency = info->defaultHighOutputLatency;
rst.push_back(device);
}
return rst;
} catch (std::system_error &error) {
throw xap::audioio::Exception(
error.what(),
xap::audioio::ERROR_SYSTEMCALL
);
} catch (std::bad_alloc &error) {
throw xap::audioio::Exception(
error.what(),
xap::audioio::ERROR_ALLOC
);
}
}
/**
* Load all valid output devices.
*
* @throw
* Raised in the following situations:
*
* - xap::audioio::ERROR_PORTAUDIOCALL:
* Raised if PortAudio calling was failed.
*
* - xap::audioio::ERROR_ALLOC:
* Raised if memory allocation was failed.
*
* - xap::audioio::ERROR_SYSTEMCALL:
* Raised if system (lock) calling was failed.
*
* @return
* The output devices vector.
*/
const std::vector<const xap::audioio::OutputDevice>
DeviceManager::load_all_output_devices() {
try {
//
// Lock.
//
std::lock_guard<std::mutex> lock(this->m_output_device_lock);
std::vector<const xap::audioio::OutputDevice> rst;
int devices_count = Pa_GetDeviceCount();
if (devices_count < 0) {
throw xap::audioio::Exception(
Pa_GetErrorText(devices_count),
xap::audioio::ERROR_PORTAUDIOCALL
);
}
int default_device = Pa_GetDefaultOutputDevice();
if (default_device < paNoDevice) {
throw xap::audioio::Exception(
Pa_GetErrorText(default_device),
xap::audioio::ERROR_PORTAUDIOCALL
);
}
for (int i = 0; i < devices_count; ++i) {
const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
if (info == nullptr || info->maxOutputChannels == 0) {
continue;
}
xap::audioio::OutputDevice device;
device.is_default = (i == default_device);
device.device_id = static_cast<int64_t>(i);
device.name = std::string(info->name);
device.default_low_latency = info->defaultLowOutputLatency;
device.defalut_high_latency = info->defaultHighOutputLatency;
rst.push_back(device);
}
return rst;
} catch (std::system_error &error) {
throw xap::audioio::Exception(
error.what(),
xap::audioio::ERROR_SYSTEMCALL
);
} catch (std::bad_alloc &error) {
throw xap::audioio::Exception(
error.what(),
xap::audioio::ERROR_ALLOC
);
}
}
/**
* Load default input device.
*
* @throw
* Raised in the following situations:
*
* - xap::audioio::ERROR_NODEVICE:
* Raised if cannot get default input device.
*
* - xap::audioio::ERROR_PORTAUDIOCALL:
* Raised if PortAudio calling was failed.
*
* - xap::audioio::ERROR_ALLOC:
* Raised if memory allocation was failed.
*
* - xap::audioio::ERROR_SYSTEMCALL:
* Raised if system (lock) calling was failed.
*
* @return
* The default input device.
*/
const xap::audioio::InputDevice DeviceManager::load_default_input_device() {
try {
//
// Lock.
//
std::lock_guard<std::mutex> lock(this->m_input_device_lock);
int default_device = Pa_GetDefaultInputDevice();
if (default_device == paNoDevice) {
throw xap::audioio::Exception(
"There is no default input device.",
xap::audioio::ERROR_NODEVICE
);
}
const PaDeviceInfo *info = Pa_GetDeviceInfo(default_device);
if (info == nullptr) {
throw xap::audioio::Exception(
"Cannot get default output device info.",
xap::audioio::ERROR_PORTAUDIOCALL
);
}
xap::audioio::InputDevice device;
device.is_default = true;
device.device_id = static_cast<int64_t>(default_device);
device.name = std::string(info->name);
device.default_low_latency = info->defaultLowInputLatency;
device.defalut_high_latency = info->defaultHighInputLatency;
return device;
} catch (std::bad_alloc &error) {
throw xap::audioio::Exception(
error.what(),
xap::audioio::ERROR_ALLOC
);
} catch (std::system_error &error) {
throw xap::audioio::Exception(
error.what(),
xap::audioio::ERROR_SYSTEMCALL
);
}
}
/**
* Load default output device.
*
* @throw
* Raised in the following situations:
*
* - xap::audioio::ERROR_NODEVICE:
* Raised if cannot get default output device.
*
* - xap::audioio::ERROR_PORTAUDIOCALL:
* Raised if PortAudio calling was failed.
*
* - xap::audioio::ERROR_ALLOC:
* Raised if memory allocation was failed.
*
* - xap::audioio::ERROR_SYSTEMCALL:
* Raised if system (lock) calling was failed.
*
* @return
* The default output device.
*/
const xap::audioio::OutputDevice DeviceManager::load_default_output_device() {
try {
//
// Lock.
//
std::lock_guard<std::mutex> lock(this->m_output_device_lock);
int default_device = Pa_GetDefaultOutputDevice();
if (default_device == paNoDevice) {
throw xap::audioio::Exception(
"There is no default output device.",
xap::audioio::ERROR_NODEVICE
);
}
const PaDeviceInfo *info = Pa_GetDeviceInfo(default_device);
if (info == nullptr) {
throw xap::audioio::Exception(
"Cannot get default output device info.",
xap::audioio::ERROR_PORTAUDIOCALL
);
}
xap::audioio::OutputDevice device;
device.is_default = true;
device.device_id = static_cast<int64_t>(default_device);
device.name = std::string(info->name);
device.default_low_latency = info->defaultLowOutputLatency;
device.defalut_high_latency = info->defaultHighOutputLatency;
return device;
} catch (std::bad_alloc &error) {
throw xap::audioio::Exception(
error.what(),
xap::audioio::ERROR_ALLOC
);
} catch (std::system_error &error) {
throw xap::audioio::Exception(
error.what(),
xap::audioio::ERROR_SYSTEMCALL
);
}
}
} // namespace audioio
} // namespace xap
| 28.620513 | 78 | 0.566207 | xaudioproject |
4657ae11d1632533b3a0f9ed7c686f5d5ec45df4 | 31,638 | cpp | C++ | tests/unit_tests.cpp | adeobootpin/light-tensor | dfc2d19495848e773b7367427cf848e4ac30b29d | [
"MIT"
] | null | null | null | tests/unit_tests.cpp | adeobootpin/light-tensor | dfc2d19495848e773b7367427cf848e4ac30b29d | [
"MIT"
] | null | null | null | tests/unit_tests.cpp | adeobootpin/light-tensor | dfc2d19495848e773b7367427cf848e4ac30b29d | [
"MIT"
] | null | null | null | #include <iostream>
#include <chrono>
#include "lten.h"
template<typename Dtype>
int Compare(Dtype* A, Dtype* B, uint64_t len, Dtype error = 0)
{
uint64_t i;
for (i = 0; i < len; i++)
{
if (fabs(A[i] - B[i]) > error)
{
return -1;
}
}
return 0;
}
//--------------------------------------------------
// addition test (tensors with the same dimensions)
//--------------------------------------------------
int add_test_1(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
float x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
float w_vals[] = { 5, 3, 2, 5, 2, 2, 7, 4, 1, 3, 3, 1, 1, 4, 5, 11, 8, 6, 2, 2, 3, 2, 4, 7 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false);
w = lten::TensorFromBuffer({ 2, 2, 2, 3 }, w_vals, false);
x.set_autograd(true);
w.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
w = w.to(lten::GPU);
}
z = x + w;
a = z[1][0][1][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
w = w.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 7, 6, 6, 7, 8, 10, 12, 11, 6, 5, 4, 10, 1, 7, 11, 15, 16, 8, 5, 4, 5, 6, 9, 13 };
float grad_vals[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 };
float val;
val = *((float*)a.get_data_ptr());
if (val != 8)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
if (Compare((float*)w.get_grad_ptr(), grad_vals, w.get_numels()))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//--------------------------------------------------
// addition test (tensors with different dimensions)
//--------------------------------------------------
int add_test_2(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
float x_vals[] = { 2.0, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 1, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
float w_vals[] = { 5.0, 3, 2, 5 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false);
w = lten::TensorFromBuffer({ 2, 1, 2, 1 }, w_vals, false);
x.set_autograd(true);
w.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
w = w.to(lten::GPU);
}
z = w + x;
a = z[0][1][0][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
w = w.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 7, 8, 9, 5, 9, 11, 10, 12, 10, 5, 4, 12, 3, 5, 8, 9, 13, 7, 5, 4, 4, 9, 10, 11 };
float w_grad_vals[] = { 1, 0, 0, 0 };
float x_grad_vals[] = { 0, 0, 0, 0, 0, 0,0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
float val;
val = *((float*)a.get_data_ptr());
if (val != 10)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
if (Compare((float*)w.get_grad_ptr(), w_grad_vals, w.get_numels()))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//----------------------------------------------------
// subtraction test (tensors with the same dimensions)
//----------------------------------------------------
int sub_test_1(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
float x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
float w_vals[] = { 5, 3, 2, 5, 2, 2, 7, 4, 1, 3, 3, 1, 1, 4, 5, 11, 8, 6, 2, 2, 3, 2, 4, 7 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false);
w = lten::TensorFromBuffer({ 2, 2, 2, 3 }, w_vals, false);
x.set_autograd(true);
w.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
w = w.to(lten::GPU);
}
z = x - w;
a = z[0][1][1][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
w = w.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { -3, 0, 2, -3, 4, 6, -2, 3, 4, -1, -2, 8, -1, -1, 1, -7, 0, -4, 1, 0, -1, 2, 1, -1 };
float w_grad_vals[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
float x_grad_vals[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
float val;
val = *((float*)a.get_data_ptr());
if (val != 8)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
if (Compare((float*)w.get_grad_ptr(), w_grad_vals, w.get_numels()))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//-----------------------------------------------------
// subtraction test (tensors with different dimensions)
//-----------------------------------------------------
int sub_test_2(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
float x_vals[] = { 2.0, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 1, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
float w_vals[] = { 5.0, 3, 2, 5 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false);
w = lten::TensorFromBuffer({ 2, 1, 2, 1 }, w_vals, false);
x.set_autograd(true);
w.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
w = w.to(lten::GPU);
}
z = x - w;
a = z[1][1][0][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
w = w.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { -3, -2, -1, -1, 3, 5, 0, 2, 0, -1, -2, 6, -1, 1, 4, -1, 3, -3, 1, 0, 0, -1, 0, 1, };
float w_grad_vals[] = { 0, 0, -1, 0 };
float x_grad_vals[] = { 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 };
float val;
val = *((float*)a.get_data_ptr());
if (val != 0)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
if (Compare((float*)w.get_grad_ptr(), w_grad_vals, w.get_numels()))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//----------------------------------------------------------
// subtraction test (uint8 tensors with the same dimensions)
//----------------------------------------------------------
int sub_test_1_uint8()
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
lten::TensorOps options;
options.data_type = lten::UINT8;
uint8_t x_vals[] = { 12, 13, 24, 32, 46, 58, 56, 27, 95, 12, 31, 19, 50, 63, 86, 24, 48, 72, 38, 29, 200, 46, 59, 86 };
uint8_t w_vals[] = { 5, 3, 2, 5, 2, 2, 7, 4, 1, 3, 3, 1, 1, 4, 5, 11, 8, 6, 2, 2, 3, 2, 4, 7 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false, &options);
w = lten::TensorFromBuffer({ 2, 2, 2, 3 }, w_vals, false, &options);
z = x - w;
a = z[0][1][1][2];
uint8_t z_vals[] = { 7, 10, 22, 27, 44, 56, 49, 23, 94, 9, 28, 18, 49, 59, 81, 13, 40, 66, 36, 27, 197, 44, 55, 79 };
uint8_t val;
val = *((uint8_t*)a.get_data_ptr());
if (val != 18)
{
return -1;
}
if (Compare((uint8_t*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
return 0;
}
//-----------------------------------------------------------
// subtraction test (uint8 tensors with different dimensions)
//-----------------------------------------------------------
int sub_test_2_uint8()
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
lten::TensorOps options;
options.data_type = lten::UINT8;
uint8_t x_vals[] = { 12, 13, 24, 32, 46, 58, 56, 27, 95, 12, 31, 19, 50, 63, 86, 24, 48, 72, 38, 29, 200, 46, 59, 86 };
uint8_t w_vals[] = { 5, 3, 2, 5 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false, &options);
w = lten::TensorFromBuffer({ 2, 1, 2, 1 }, w_vals, false, &options);
z = x - w;
a = z[1][1][0][2];
uint8_t z_vals[] = { 7, 8, 19, 29, 43, 55, 51, 22, 90, 9, 28, 16, 48, 61, 84, 19, 43, 67, 36, 27, 198, 41, 54, 81 };
uint8_t val;
val = *((uint8_t*)a.get_data_ptr());
if (val != 198)
{
return -1;
}
if (Compare((uint8_t*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
return 0;
}
//--------------------------------------------------------------------
// element-wise multiplication test (tensors with the same dimensions)
//--------------------------------------------------------------------
int mul_test_1(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
float x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
float w_vals[] = { 5, 3, 2, 5, 2, 2, 7, 4, 1, 3, 3, 1, 1, 4, 5, 11, 8, 6, 2, 2, 3, 2, 4, 7 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false);
w = lten::TensorFromBuffer({ 2, 2, 2, 3 }, w_vals, false);
x.set_autograd(true);
w.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
w = w.to(lten::GPU);
}
z = x * w;
a = z[1][0][1][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
w = w.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 10, 9, 8, 10, 12, 16, 35, 28, 5, 6, 3, 9, 0, 12, 30, 44, 64, 12, 6, 4, 6, 8, 20, 42 };
float w_grad_vals[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 };
float x_grad_vals[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0 };
float val;
val = *((float*)a.get_data_ptr());
if (val != 12)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
if (Compare((float*)w.get_grad_ptr(), w_grad_vals, w.get_numels()))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//---------------------------------------------------------------------
// element-wise multiplication test (tensors with different dimensions)
//---------------------------------------------------------------------
int mul_test_2(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
float x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 1, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
float w_vals[] = { 5, 3, 2, 5, 2, 2, 7, 4, 1, 3, 3, 1, 1, 4, 5, 11, 8, 6, 2, 2, 3, 2, 4, 7 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false);
w = lten::TensorFromBuffer({ 2, 1, 2, 1 }, w_vals, false);
x.set_autograd(true);
w.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
w = w.to(lten::GPU);
}
z = x * w;
a = z[1][1][0][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
w = w.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 10, 15, 20, 6, 18, 24, 25, 35, 25, 6, 3, 27, 2, 6, 12, 20, 40, 10, 6, 4, 4, 20, 25, 30 };
float w_grad_vals[] = { 0, 0, 2, 0 };
float x_grad_vals[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0 };
float val;
val = *((float*)a.get_data_ptr());
if (val != 4)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
if (Compare((float*)w.get_grad_ptr(), w_grad_vals, w.get_numels()))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//--------------------------------------------------------------------------
// element-wise multiplication test (int32 tensors with the same dimensions)
//-------------------------------------------------------------------------
int mul_test_1_int32()
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
lten::TensorOps options;
options.data_type = lten::INT32;
int x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
int w_vals[] = { 5, 3, 2, 5, 2, 2, 7, 4, 1, 3, 3, 1, 1, 4, 5, 11, 8, 6, 2, 2, 3, 2, 4, 7 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false, &options);
w = lten::TensorFromBuffer({ 2, 2, 2, 3 }, w_vals, false, &options);
z = x * w;
a = z[1][0][1][2];
int z_vals[] = { 10, 9, 8, 10, 12, 16, 35, 28, 5, 6, 3, 9, 0, 12, 30, 44, 64, 12, 6, 4, 6, 8, 20, 42 };
int val;
val = *((int*)a.get_data_ptr());
if (val != 12)
{
return -1;
}
if (Compare((int*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
return 0;
}
//--------------------------------------------------------------
// element-wise division test (tensors with the same dimensions)
//--------------------------------------------------------------
int div_test_1(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
float x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
float w_vals[] = { 5, 3, 2, 5, 2, 2, 7, 4, 1, 3, 3, 1, 1, 4, 5, 11, 8, 6, 2, 2, 3, 2, 4, 7 };
x = lten::TensorFromBuffer({ 2, 1, 4, 3 }, x_vals, false);
w = lten::TensorFromBuffer({ 2, 1, 4, 3 }, w_vals, false);
x.set_autograd(true);
w.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
w = w.to(lten::GPU);
}
z = x.div(w);
a = z[0][0][3][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
w = w.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 0.400000f, 1.000000f, 2.000000f, 0.400000f, 3.000000f, 4.000000f, 0.714285731f, 1.750000f, 5.000000f, 0.666666687f, 0.333333343f, 9.000000f, 0.000000f, 0.750000f, 1.200000f, 0.363636374f, 1.000000f, 0.333333343f, 1.500000f, 1.000000f, 0.666666687f, 2.000000f, 1.250000f, 0.857142866f };
float w_grad_vals[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
float x_grad_vals[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
float val;
val = *((float*)a.get_data_ptr());
if (val != 9)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
if (Compare((float*)w.get_grad_ptr(), w_grad_vals, w.get_numels()))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//---------------------------------------------------------------
// element-wise division test (tensors with different dimensions)
//---------------------------------------------------------------
int div_test_2(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
float error = 0.000001f;
float x_vals[] = { 2.0, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 1, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
float w_vals[] = { 5.0, 3, 2, 5 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false);
w = lten::TensorFromBuffer({ 2, 1, 2, 1 }, w_vals, false);
x.set_autograd(true);
w.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
w = w.to(lten::GPU);
}
z = x.div(w);
a = z[1][1][0][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
w = w.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 0.400000006f, 0.600000024f, 0.800000012f, 0.666666687f, 2.000000000f, 2.666666746f,1.000000000f, 1.399999976f, 1.000000000f, 0.666666687f, 0.333333343f, 3.000000000f,0.500000000f, 1.500000000f, 3.000000000f, 0.800000012f, 1.600000024f, 0.400000006f,1.500000000f, 1.000000000f, 1.000000000f, 0.800000012f, 1.000000000f, 1.200000048f };
float w_grad_vals[] = { 0, 0, -0.5, 0 };
float x_grad_vals[] = { 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0, 0 };
float val;
val = *((float*)a.get_data_ptr());
if (val != 1)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels(), error))
{
return -1;
}
if (Compare((float*)w.get_grad_ptr(), w_grad_vals, w.get_numels(), error))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels(), error))
{
return -1;
}
return 0;
}
//---------------------------
// matrix-multiplication test
//---------------------------
int matmul_test(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
float x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
float w_vals[] = { 5, 3, 2, 5, 2, 2, 7, 4, 1, 3, 3, 1, 1, 4, 5, 11, 8, 6, 2, 2, 3, 2, 4, 7 };
x = lten::TensorFromBuffer({ 2, 1, 4, 3 }, x_vals, false);
w = lten::TensorFromBuffer({ 1, 1, 3, 4 }, w_vals, false);
x.set_autograd(true);
w.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
w = w.to(lten::GPU);
}
z = x.matmul(w);
a = z[1][0][3][1];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
w = w.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 20, 24, 37, 26, 30, 42, 70, 42, 44, 44, 74, 58, 21, 35, 38, 23, 12, 24, 39, 18, 38, 34, 70, 54, 21, 19, 26, 25, 36, 40, 61, 46 };
float w_grad_vals[] = { 0, 4, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0 };
float x_grad_vals[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 3 };
float val;
val = *((float*)a.get_data_ptr());
if (val != 40)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
if (Compare((float*)w.get_grad_ptr(), w_grad_vals, w.get_numels()))
{
return -1;
}
return 0;
}
//---------------------------------
// unit8 matrix-multiplication test
//---------------------------------
int matmul_test_uint8()
{
lten::Tensor x;
lten::Tensor w;
lten::Tensor z;
lten::Tensor a;
lten::TensorOps options;
options.data_type = lten::UINT8;
uint8_t x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
uint8_t w_vals[] = { 5, 3, 2, 5, 2, 2, 7, 4, 1, 3, 3, 1, 1, 4, 5, 11, 8, 6, 2, 2, 3, 2, 4, 7 };
x = lten::TensorFromBuffer({ 2, 1, 4, 3 }, x_vals, false, &options);
w = lten::TensorFromBuffer({ 1, 1, 3, 4 }, w_vals, false, &options);
x.set_autograd(true);
w.set_autograd(true);
z = x.matmul(w);
a = z[1][0][3][1];
uint8_t z_vals[] = { 20, 24, 37, 26, 30, 42, 70, 42, 44, 44, 74, 58, 21, 35, 38, 23, 12, 24, 39, 18, 38, 34, 70, 54, 21, 19, 26, 25, 36, 40, 61, 46 };
uint8_t val;
val = *((uint8_t*)a.get_data_ptr());
if (val != 40)
{
return -1;
}
if (Compare((uint8_t*)z.get_data_ptr(), z_vals, z.get_numels()))
{
return -1;
}
return 0;
}
//---------
// exp test
//---------
int exp_test(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor z;
lten::Tensor a;
float error = 0.001f;
float x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
x = lten::TensorFromBuffer({ 2, 1, 4, 3 }, x_vals, false);
x.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
}
z = x.exp();
a = z[1][0][3][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 7.389056f, 20.085537f, 54.598148f, 7.389056f, 403.428802f, 2980.958008f, 148.413162f, 1096.633179f, 148.413162f,7.389056f, 2.718282f, 8103.083984f,1.000000f, 20.085537f, 403.428802f, 54.598148f, 2980.958008f, 7.389056f, 20.085537f, 7.389056f, 7.389056f,54.598148f, 148.413162f, 403.428802f };
float x_grad_vals[] = { 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 403.428802f };
float val;
val = *((float*)a.get_data_ptr());
if (fabs(val - 403.428802) > error)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels(), error))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels(), error))
{
return -1;
}
return 0;
}
//---------
// log test
//---------
int log_test(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor z;
lten::Tensor a;
float error = 0.000001f;
float x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 1, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
x = lten::TensorFromBuffer({ 2, 1, 4, 3 }, x_vals, false);
x.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
}
z = x.log();
a = z[1][0][3][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 0.693147f, 1.098612f, 1.386294f, 0.693147f, 1.791759f, 2.079442f, 1.609438f, 1.945910f, 1.609438f,0.693147f, 0.000000f, 2.197225f, 0.000000f, 1.098612f, 1.791759f, 1.386294f, 2.079442f, 0.693147f, 1.098612f, 0.693147f, 0.693147f, 1.386294f, 1.609438f, 1.791759f };
float x_grad_vals[] = { 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.166666672f };
float val;
val = *((float*)a.get_data_ptr());
if (fabs(val - 1.79175949) > error)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels(), error))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//-------------
// sigmoid test
//-------------
int sig_test(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor z;
lten::Tensor a;
float error = 0.000001f;
float x_vals[] = { -2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, -3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
x = lten::TensorFromBuffer({ 2, 1, 4, 3 }, x_vals, false);
x.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
}
z = x.sig();
a = z[1][0][3][2];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 0.119203f, 0.952574f, 0.982014f, 0.880797f, 0.997527f, 0.999665f, 0.993307f, 0.999089f, 0.993307f, 0.880797f, 0.731059f, 0.999877f, 0.5f, 0.0474259f, 0.997527f, 0.982014f, 0.999665f, 0.880797f, 0.952574f, 0.880797f, 0.880797f, 0.982014f, 0.993307f, 0.997527f };
float x_grad_vals[] = { 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.00246646581f };
float val;
val = *((float*)a.get_data_ptr());
if (fabs(val - 0.997527421f) > error)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels(), error))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//----------
// tanh test
//----------
int tanh_test(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor z;
lten::Tensor a;
float error = 0.000001f;
float x_vals[] = { -2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, -3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
x = lten::TensorFromBuffer({ 2, 1, 4, 3 }, x_vals, false);
x.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
}
z = x.tanh();
a = z[0][0][0][2];
a.backward();
//std::cout << z << std::endl;
//std::cout << *(x.get_gradients_mdarray<float>()) << "\n";
if (run_on_gpu)
{
x = x.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { -0.964028f, 0.995055f, 0.999329f, 0.964028f, 0.999988f, 1.0f, 0.999909f, 0.999998f, 0.999909f, 0.964028f, 0.761594f, 1.0f, 0.0f, -0.995055f, 0.999988f, 0.999329f, 1.0f, 0.964028f, 0.995055f, 0.964028f, 0.964028f, 0.999329f, 0.999909f, 0.999988f };
float x_grad_vals[] = { 0.000000f, 0.000000f, 0.00134086609f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f };
float val;
val = *((float*)a.get_data_ptr());
if (fabs(val - 0.999329329f) > error)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels(), error))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels(), error))
{
return -1;
}
return 0;
}
//---------------------------
// scalar multiplication test
//---------------------------
int scalar_mul(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor z;
lten::Tensor a;
float error = 0.000001f;
float x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 1, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
x = lten::TensorFromBuffer({ 2, 1, 4, 3 }, x_vals, false);
x.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
}
z = 87 * x;
a = z[1][0][2][1];
a.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 174, 261, 348, 174, 522, 696, 435, 609, 435, 174, 87, 783, 87, 261, 522, 348, 696, 174, 261, 174, 174, 348, 435, 522 };
float x_grad_vals[] = { 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 87.000000, 0.000000, 0.000000, 0.000000, 0.000000 };
float val;
val = *((float*)a.get_data_ptr());
if (fabs(val - 174) > error)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels(), error))
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//---------
// max test
//---------
int max_test(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor z;
float x_vals[] = { 9, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 3 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false);
x.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
}
z = x.max();
z.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
z = z.to(lten::CPU);
}
float x_grad_vals[] = { 0.500000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.500000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000 };
float val;
val = *((float*)z.get_data_ptr());
if (val != 9)
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
return 0;
}
//---------
// sum test
//---------
int sum_test(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor z;
float x_vals[] = { 2.0, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 1, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
x = lten::TensorFromBuffer({ 2, 2, 2, 3 }, x_vals, false);
x.set_autograd(true);
if (run_on_gpu)
{
x = x.to(lten::GPU);
}
z = x.sum();
z.backward();
if (run_on_gpu)
{
x = x.to(lten::CPU);
z = z.to(lten::CPU);
}
float x_grad_vals[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
float val;
val = *((float*)z.get_data_ptr());
if (val != 100)
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels()))
{
return -1;
}
lten::Tensor a;
float z_vals[] = { 11, 17, 26, 12, 18, 16 };
float x_grad_vals_2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0 };
x = lten::TensorFromBuffer({ 2, 1, 4, 3 }, x_vals, false);
x.set_autograd(true);
z = x.sum(2);
a = z[0][1][0][1];
a.backward();
val = *((float*)a.get_data_ptr());
if (val != 18)
{
return -1;
}
if (Compare((float*)x.get_grad_ptr(), x_grad_vals_2, x.get_numels()))
{
return -1;
}
return 0;
}
//--------------------------
// FullyConnected layer test
//--------------------------
int fc_test(bool run_on_gpu)
{
lten::Tensor x;
lten::Tensor z;
lten::Tensor a;
lten::TensorOps ops;
uint64_t len;
uint64_t i;
float val;
float error = 0.001f;
lten::device device = lten::GPU;
float test_wts[] = { 0.0900306f, 0.2447285f, 0.6652409f, 0.0021785f, 0.1189432f, 0.8788782f, 0.1065070f, 0.7869860f, 0.1065070f, 0.0009107f, 0.0003350f, 0.9987543f, 0.0023556f, 0.0473142f, 0.9503303f, 0.0179425f, 0.9796292f, 0.0024283f, 0.5761169f, 0.2119416f, 0.2119416f, 0.0900306f, 0.2447285f, 0.6652409f };
float x_vals[] = { 2, 3, 4, 2, 6, 8, 5, 7, 5, 2, 1, 9, 0, 3, 6, 4, 8, 2, 3, 2, 2, 4, 5, 6 };
x = lten::TensorFromBuffer({ 2, 1, 4, 3 }, x_vals);
x.set_autograd(true);
if (run_on_gpu)
{
x = x.to(device);
}
lten::FullyConnected fc(3, 8);
fc.init();
len = fc.get_weights()->get_numels();
for (i = 0; i < len; i++)
{
((float*)(fc.get_weights()->get_data_ptr()))[i] = test_wts[i];
}
if (run_on_gpu)
{
fc.to(device);
}
z = fc.forward(x);
a = z[1][0][3][4];
a.backward();
if (run_on_gpu)
{
z = z.to(lten::CPU);
a = a.to(lten::CPU);
}
float z_vals[] = { 3.57521f, 3.8767f, 3.0f, 3.99784f, 3.94798f, 2.98449f, 2.63583f, 3.57521f, 6.97036f, 7.74904f, 5.78699f, 7.99387f, 7.89124f, 5.93309f, 4.11942f, 6.97036f, 5.48946f, 5.23789f, 6.57397f, 5.00067f, 5.09463f, 6.95926f, 5.42388f, 5.48946f, 6.41196f, 8.0332f, 1.95856f, 8.99094f, 8.605f, 1.03737f, 3.27165f, 6.41196f, 4.72563f, 5.6301f, 3.0f, 5.99353f, 5.84392f, 2.95346f, 1.90747f, 4.72563f, 3.64843f, 2.71802f, 6.93493f, 2.00383f, 2.2886f, 7.91366f, 4.42388f, 3.64843f, 2.09003f, 2.00218f, 2.10651f, 2.00091f, 2.00236f, 2.01794f, 2.57612f, 2.09003f, 5.57521f, 5.8767f, 5.0f, 5.99784f, 5.94798f, 4.98449f, 4.63583f, 5.57521f, };
float x_grad_vals[] = { 0, 0, 0,0, 0, 0,0, 0, 0,0, 0, 0,0, 0, 0,0, 0, 0,0, 0, 0, 0.0023556f, 0.0473142f, 0.95033f };
float wt_grad_vals[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4.0f, 5.0f, 6.0f, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
val = *((float*)a.get_data_ptr());
if (fabs(val - 5.94797564f) > error)
{
return -1;
}
if (Compare((float*)z.get_data_ptr(), z_vals, z.get_numels(), error))
{
return -1;
}
if (run_on_gpu)
{
float* x_grad = new float[x.get_numels()];
CopyDataFromGPU(x_grad, x.get_grad_ptr(), x.get_numels() * sizeof(float));
if (Compare(x_grad, x_grad_vals, x.get_numels(), error))
{
return -1;
}
float* wt_grad = new float[fc.get_weights()->get_numels()];
CopyDataFromGPU(wt_grad, fc.get_weights()->get_grad_ptr(), fc.get_weights()->get_numels() * sizeof(float));
if (Compare(wt_grad, wt_grad_vals, fc.get_weights()->get_numels(), error))
{
return -1;
}
delete wt_grad;
delete x_grad;
}
else
{
if (Compare((float*)x.get_grad_ptr(), x_grad_vals, x.get_numels(), error))
{
return -1;
}
if (Compare((float*)fc.get_weights()->get_grad_ptr(), wt_grad_vals, fc.get_weights()->get_numels(), error))
{
return -1;
}
}
return 0;
}
| 23.734434 | 644 | 0.514792 | adeobootpin |
465b0e6c5f6183613e7f76f1de5d628cdd63bd0c | 6,011 | cpp | C++ | example/mirror/chai_on_mirror.cpp | jagrut08/mirror | d219fb719212bff81714771846ceecbe505002cb | [
"BSL-1.0"
] | null | null | null | example/mirror/chai_on_mirror.cpp | jagrut08/mirror | d219fb719212bff81714771846ceecbe505002cb | [
"BSL-1.0"
] | null | null | null | example/mirror/chai_on_mirror.cpp | jagrut08/mirror | d219fb719212bff81714771846ceecbe505002cb | [
"BSL-1.0"
] | null | null | null | /// @example mirror/chai_on_mirror.cpp
///
/// Copyright Matus Chochlik.
/// Distributed under the Boost Software License, Version 1.0.
/// See accompanying file LICENSE_1_0.txt or copy at
/// http://www.boost.org/LICENSE_1_0.txt
///
#include <mirror/chaiscript.hpp>
#include <mirror/sequence.hpp>
#include <cassert>
#include <iostream>
#include <string>
#include <string_view>
class person;
class scene {
public:
void person_says(const person& p, std::string_view line);
void person_relocates(person& p, std::string_view how);
void event_happens(std::string_view what);
void pause();
};
class location {
private:
std::string _name;
scene& _scene;
public:
location(std::string name, scene& s) noexcept
: _name{std::move(name)}
, _scene{s} {}
auto name() const noexcept -> std::string_view {
return _name;
}
auto scene() noexcept -> auto& {
return _scene;
}
operator class scene &() noexcept {
return scene();
}
};
class person {
private:
std::string _name;
location* _loc;
public:
person(std::string name) noexcept
: _name{std::move(name)} {}
person()
: person("a person") {}
auto current_location() const noexcept -> auto& {
assert(_loc);
return *_loc;
}
auto enter(location& loc) noexcept {
_loc = &loc;
current_location().scene().person_relocates(*this, "enters");
}
auto is_thrown_to(location& loc) noexcept {
_loc = &loc;
current_location().scene().person_relocates(*this, "is thrown to");
}
auto name() const noexcept -> std::string_view {
return _name;
}
void say(const std::string& line) {
current_location().scene().person_says(*this, line);
}
};
class king : public person {
public:
king(std::string name) noexcept
: person{std::move(name)} {}
king()
: person("the king") {}
};
class mysterious_force {
private:
location& _chasm;
public:
mysterious_force(location& ch) noexcept
: _chasm{ch} {}
void throw_person_into_chasm(person& p) {
p.is_thrown_to(_chasm);
}
};
void scene::person_says(const person& p, std::string_view line) {
std::cout << p.name() << ": " << '"' << line << '"' << std::endl;
}
void scene::person_relocates(person& p, std::string_view how) {
std::cout << "[" << p.name() << " " << how << " "
<< p.current_location().name() << "]" << std::endl;
}
void scene::pause() {
std::cout << std::endl;
}
void scene::event_happens(std::string_view what) {
std::cout << "[" << what << "]" << std::endl;
}
static scene at_the_bridge;
int main() {
chaiscript::ChaiScript chai;
mirror::add_to(
chai,
mirror::make_sequence(
mirror(scene),
mirror(mysterious_force),
mirror(location),
mirror(person),
mirror(king),
mirror(at_the_bridge)));
chai(R"(
var road = location("road leading to the bridge", at_the_bridge);
var bridge = location("bridge of death", at_the_bridge);
var chasm = location("chasm", at_the_bridge);
var the_force = mysterious_force(chasm);
var bridgekeeper = person("the Bridgekeeper");
var king_arthur = king("king Arthur");
var sir_lancelot = person("sir Lancelot");
var sir_robin = person("sir Robin");
var sir_galahad = person("sir Galahad");
var sir_bedevere = person("sir Bedevere");
bridgekeeper.enter(bridge);
king_arthur.enter(road);
sir_lancelot.enter(road);
sir_robin.enter(road);
sir_galahad.enter(road);
sir_bedevere.enter(road);
bridgekeeper.say("Stop. Who would cross the Bridge of Death must answer me these questions three, ere the other side he see.");
sir_lancelot.say("Ask me the questions, bridgekeeper. I am not afraid.");
bridgekeeper.say("What... is your name?");
sir_lancelot.say("My name is Sir Lancelot of Camelot.");
bridgekeeper.say("What... is your quest?");
sir_lancelot.say("To seek the Holy Grail.");
bridgekeeper.say("What... is your favourite colour?");
sir_lancelot.say("Blue.");
bridgekeeper.say("Go on. Off you go.");
sir_lancelot.say("Oh, thank you. Thank you very much.");
sir_lancelot.enter(bridge);
sir_robin.say("That’s easy.");
bridgekeeper.say("Stop. Who would cross the Bridge of Death must answer me these questions three, ere the other side he see.");
sir_robin.say("Ask me the questions, bridgekeeper. I’m not afraid.");
bridgekeeper.say("What... is your name?");
sir_robin.say("My name is Sir Robin of Camelot.");
bridgekeeper.say("What... is your quest?");
sir_robin.say("To seek the Holy Grail.");
bridgekeeper.say("What... is capital of Assyria?");
sir_robin.say("I don’t know that.");
the_force.throw_person_into_chasm(sir_robin);
sir_robin.say("Auuuuuuuugh.");
at_the_bridge.pause();
bridgekeeper.say("Stop. What... is your name?");
sir_galahad.say("Sir Galahad of Camelot.");
bridgekeeper.say("What... is your quest?");
sir_galahad.say("To seek the Holy Grail.");
bridgekeeper.say("What... is your favourite colour?");
sir_galahad.say("Blue. No. Yel...");
the_force.throw_person_into_chasm(sir_robin);
sir_galahad.say("Auuuuuuuugh.");
at_the_bridge.pause();
bridgekeeper.say("Hee hee heh. Stop. What... is your name?");
king_arthur.say("It is ‘Arthur’, King of the Britons.");
bridgekeeper.say("What... is your quest?");
king_arthur.say("To seek the Holy Grail.");
bridgekeeper.say("What... is the air-speed velocity of an unladen swallow?");
king_arthur.say("What do you mean? An African or European swallow?");
bridgekeeper.say("Huh? I... I don’t know that.");
the_force.throw_person_into_chasm(bridgekeeper);
bridgekeeper.say("Auuuuuuuugh.");
at_the_bridge.pause();
sir_bedevere.say("How do know so much about swallows?");
king_arthur.say("Well, you have to know these things when you’re a king, you know.");
king_arthur.enter(bridge);
sir_bedevere.enter(bridge);
)");
return 0;
}
| 28.220657 | 129 | 0.655465 | jagrut08 |
465c65ec5fa942cfb21afa4a132e2aa96d237aa1 | 21,868 | cpp | C++ | src/interactive_mid_protocols/OTOneSidedSimulation.cpp | manel1874/libscapi | 8cf705162af170c04c8e2299213f52888193cabe | [
"MIT"
] | 160 | 2016-05-11T09:45:56.000Z | 2022-03-06T09:32:19.000Z | src/interactive_mid_protocols/OTOneSidedSimulation.cpp | cryptobiu/libscapi | 49eee7aee9eb3544a7facb199d0a6e98097b058a | [
"MIT"
] | 57 | 2016-12-26T07:02:12.000Z | 2022-03-06T16:34:31.000Z | src/interactive_mid_protocols/OTOneSidedSimulation.cpp | manel1874/libscapi | 8cf705162af170c04c8e2299213f52888193cabe | [
"MIT"
] | 67 | 2016-10-10T17:56:22.000Z | 2022-03-15T22:56:39.000Z | #include "../../include/interactive_mid_protocols/OTOneSidedSimulation.hpp"
OTOneSidedSimDDHSenderAbs::OTOneSidedSimDDHSenderAbs(const shared_ptr<CommParty> & channel, const shared_ptr<PrgFromOpenSSLAES> & random, const shared_ptr<DlogGroup> & dlog)
: zkVerifier(channel, make_shared<SigmaDlogVerifierComputation>(dlog, 80, random), make_shared<CmtRTrapdoorCommitPhaseOutput>(), dlog) {
//The underlying dlog group must be DDH secure.
auto ddh = dynamic_pointer_cast<DDH>(dlog);
if (ddh == NULL) {
throw SecurityLevelException("DlogGroup should have DDH security level");
}
//Check that the given dlog is valid.
if (!dlog->validateGroup())
throw InvalidDlogGroupException("The given Dlog Group is not valid");
this->dlog = dlog;
this->random = random;
qMinusOne = dlog->getOrder() - 1;
// This protocol has no pre process stage.
}
/**
* Runs the following line from the protocol:
* "WAIT for message (h0,h1) from R"
* @param channel
* @return the received message.
* @throws IOException if failed to receive a message.
* @throws ClassNotFoundException
*/
OTRGroupElementQuadMsg OTOneSidedSimDDHSenderAbs::waitForMessageFromReceiver(CommParty* channel) {
vector<byte> raw_msg;
channel->readWithSizeIntoVector(raw_msg);
// create an empty OTRGroupElementPairMsg and initialize it with the received data.
OTRGroupElementQuadMsg msg;
msg.initFromByteVector(raw_msg);
return msg;
}
/**
* Runs the following line from the protocol:
* "Run the verifier in ZKPOK_FROM_SIGMA with Sigma protocol SIGMA_DLOG.
* Use common input x.
* If output is REJ, REPORT ERROR (cheat attempt) and HALT".
* @param channel
* @param h common input (x)
* @return the received message.
* @throws CheatAttemptException
* @throws IOException if failed to receive a message.
* @throws ClassNotFoundException
* @throws InvalidDlogGroupException
*/
void OTOneSidedSimDDHSenderAbs::runZKPOK(const shared_ptr<GroupElement> & h) {
//If the output of the Zero Knowledge Proof Of Knowledge is REJ, throw CheatAttempException.
SigmaDlogCommonInput input(h);
auto msgA = make_shared<SigmaGroupElementMsg>(dlog->getGenerator()->generateSendableData());
auto msgZ = make_shared<SigmaBIMsg>();
if (!zkVerifier.verify(&input, msgA, msgZ)) {
throw CheatAttemptException("ZKPOK verifier outputed REJECT");
}
}
/**
* Runs the following lines from the protocol:
* "IF NOT
* * z0 != z1
* * x, y, z0, z1 in the DlogGroup
* REPORT ERROR (cheat attempt)"
* @param z1
* @param z0
* @param y
* @param x
* @return the received message.
* @throws CheatAttemptException
*/
void OTOneSidedSimDDHSenderAbs::checkReceivedTuple(GroupElement* x, GroupElement* y, GroupElement* z0, GroupElement* z1) {
if (!(dlog->isMember(x))) {
throw new CheatAttemptException("x element is not a member in the current DlogGroup");
}
if (!(dlog->isMember(y))) {
throw new CheatAttemptException("y element is not a member in the current DlogGroup");
}
if (!(dlog->isMember(z0))) {
throw new CheatAttemptException("z0 element is not a member in the current DlogGroup");
}
if (!(dlog->isMember(z1))) {
throw new CheatAttemptException("z1 element is not a member in the current DlogGroup");
}
if (*z0 == *z1) {
throw new CheatAttemptException("z0 and z1 are equal");
}
}
/**
* Runs the following lines from the protocol:
* "SEND (w0, c0) and (w1, c1) to R"
* @param channel
* @param message to send to the receiver
* @throws IOException if failed to send the message.
*/
void OTOneSidedSimDDHSenderAbs::sendTupleToReceiver(CommParty* channel, OTSMsg* message) {
//Send the message by the channel.
auto msgStr = message->toString();
channel->writeWithSize(msgStr);
}
/**
* Runs the transfer phase of the protocol. <p>
* This is the part of the protocol where the sender input is necessary.<p>
* "WAIT for message a from R<p>
* DENOTE the tuple a received by (x, y, z0, z1)<p>
* Run the verifier in ZKPOK_FROM_SIGMA with Sigma protocol SIGMA_DLOG. Use common input x.<p>
* If output is REJ, REPORT ERROR (cheat attempt) and HALT<p>
* IF NOT<p>
* * z0 = z1<p>
* * x, y, z0, z1 in G<p>
* REPORT ERROR (cheat attempt)<p>
* SAMPLE random values u0,u1,v0,v1 <- {0, . . . , q-1} <p>
* COMPUTE:<p>
* * w0 = x^u0 * g^v0<p>
* * k0 = (z0)^u0 * y^v0<p>
* * w1 = x^u1 * g^v1<p>
* * k1 = (z1)^u1 * y^v1 <p>
* * c0 = x0 XOR KDF(|x0|,k0)<p>
* * c1 = x1 XOR KDF(|x1|,k1) <p>
* SEND (w0, c0) and (w1, c1) to R<p>
* OUTPUT nothing"
*/
void OTOneSidedSimDDHSenderAbs::transfer(CommParty* channel, OTSInput* input) {
/* Runs the following part of the protocol:
WAIT for message a from R
DENOTE the tuple a received by (x, y, z0, z1)
Run the verifier in ZKPOK_FROM_SIGMA with Sigma protocol SIGMA_DLOG. Use common input x.
If output is REJ, REPORT ERROR (cheat attempt) and HALT
IF NOT
* z0 != z1
* x, y, z0, z1 in G
REPORT ERROR (cheat attempt)
SAMPLE random values u0,u1,v0,v1 <- {0, . . . , q-1}
COMPUTE:
* w0 = x^u0 * g^v0
* k0 = (z0)^u0 * y^v0
* w1 = x^u1 * g^v1
* k1 = (z1)^u1 * y^v1
COMPUTE: in byteArray scenario:
* c0 = x0 XOR KDF(|x0|,k0)
* c1 = x1 XOR KDF(|x1|,k1)
OR in GroupElement scenario:
* c0 = x0 * k0
* c1 = x1 * k1
SEND (w0, c0) and (w1, c1) to R
OUTPUT nothing
*/
//Wait for message a from R
OTRGroupElementQuadMsg message = waitForMessageFromReceiver(channel);
//Reconstruct the group elements from the given message.
auto x = dlog->reconstructElement(false, message.getX().get());
auto y = dlog->reconstructElement(false, message.getY().get());
auto z0 = dlog->reconstructElement(false, message.getZ0().get());
auto z1 = dlog->reconstructElement(false, message.getZ1().get());
//Run the verifier in ZKPOK_FROM_SIGMA with Sigma protocol SIGMA_DLOG.
runZKPOK(x);
//If not z0 = z1 and x, y, z0, z1 in G throw CheatAttemptException.
checkReceivedTuple(x.get(), y.get(), z0.get(), z1.get());
//Sample random values u0,u1,v0,v1 in {0, . . . , q-1}
biginteger u0 = getRandomInRange(0, qMinusOne, random.get());
biginteger u1 = getRandomInRange(0, qMinusOne, random.get());
biginteger v0 = getRandomInRange(0, qMinusOne, random.get());
biginteger v1 = getRandomInRange(0, qMinusOne, random.get());
//Compute values w0, k0, w1, k1
auto g = dlog->getGenerator(); //Get the group generator.
//Calculates w0 = x^u0 � g^v0
auto w0 = dlog->multiplyGroupElements(dlog->exponentiate(x.get(), u0).get(), dlog->exponentiate(g.get(), v0).get());
//Calculates k0 = (z0)^u0 � y^v0
auto k0 = dlog->multiplyGroupElements(dlog->exponentiate(z0.get(), u0).get(), dlog->exponentiate(y.get(), v0).get());
//Calculates w1 = x^u1 � g^v1
auto w1 = dlog->multiplyGroupElements(dlog->exponentiate(x.get(), u1).get(), dlog->exponentiate(g.get(), v1).get());
//Calculates k1 = (z1)^u1 � y^v1
auto k1 = dlog->multiplyGroupElements(dlog->exponentiate(z1.get(), u1).get(), dlog->exponentiate(y.get(), v1).get());
//Compute c0, c1
auto messageToSend = computeTuple(input, w0.get(), w1.get(), k0.get(), k1.get());
sendTupleToReceiver(channel, messageToSend.get());
}
/**
* Runs the following lines from the protocol:
* "COMPUTE:
* c0 = x0 * k0
* c1 = x1 * k1"
* @param input MUST be OTSOnGroupElementInput.
* @param w0
* @param w1
* @param k0
* @param k1
* @return tuple contains (u, v0, v1) to send to the receiver.
*/
shared_ptr<OTSMsg> OTOneSidedSimDDHOnGroupElementSender::computeTuple(OTSInput* input, GroupElement* w0, GroupElement* w1, GroupElement* k0, GroupElement* k1) {
// If input is not instance of OTSOnGroupElementInput, throw Exception.
auto in = dynamic_cast<OTOnGroupElementSInput*>(input);
if (in == nullptr) {
throw invalid_argument("x0 and x1 should be DlogGroup elements");
}
//Set x0, x1.
auto x0 = in->getX0();
auto x1 = in->getX1();
//Calculate c0:
auto c0 = dlog->multiplyGroupElements(x0.get(), k0);
//Calculate c1:
auto c1 = dlog->multiplyGroupElements(x1.get(), k1);
//Create and return sender message.
return make_shared<OTOnGroupElementSMsg>(w0->generateSendableData(),
c0->generateSendableData(), w1->generateSendableData(), c1->generateSendableData());
}
/**
* Runs the following lines from the protocol:
* "COMPUTE:
* c0 = x0 XOR KDF(|x0|,k0)
* c1 = x1 XOR KDF(|x1|,k1)"
* @param iput NUST be an instance of OTSOnByteArrayInput.
* @param w0
* @param w1
* @param k0
* @param k1
* @return tuple contains (u, v0, v1) to send to the receiver.
*/
shared_ptr<OTSMsg> OTOneSidedSimDDHOnByteArraySender::computeTuple(OTSInput* input, GroupElement* w0, GroupElement* w1, GroupElement* k0, GroupElement* k1) {
// If input is not instance of OTSOnGroupElementInput, throw Exception.
auto in = dynamic_cast<OTOnByteArraySInput*>(input);
if (in == nullptr) {
throw invalid_argument("x0 and x1 should be binary strings");
}
//Get x0, x1.
auto x0 = in->getX0();
auto x1 = in->getX1();
//If x0, x1 are not of the same length, throw Exception.
if (x0.size() != x1.size()) {
throw invalid_argument("x0 and x1 should be of the same length.");
}
//Calculate c0:
auto k0Bytes = dlog->mapAnyGroupElementToByteArray(k0);
int len = x0.size();
auto c0 = kdf->deriveKey(k0Bytes, 0, k0Bytes.size(), len).getEncoded();
//Xores the result from the kdf with x0.
for (int i = 0; i<len; i++) {
c0[i] = c0[i] ^ x0[i];
}
//Calculate c1:
auto k1Bytes = dlog->mapAnyGroupElementToByteArray(k1);
auto c1 = kdf->deriveKey(k1Bytes, 0, k1Bytes.size(), len).getEncoded();
//Xores the result from the kdf with x1.
for (int i = 0; i<len; i++) {
c1[i] = c1[i] ^ x1[i];
}
//Create and return sender message.
return make_shared<OTOnByteArraySMsg>(w0->generateSendableData(), c0, w1->generateSendableData(), c1);
}
/**
* Constructor that sets the given dlogGroup and random.
* @param dlog must be DDH secure.
* @param random
* @throws SecurityLevelException if the given dlog is not DDH secure
* @throws InvalidDlogGroupException if the given DlogGroup is not valid.
*/
OTOneSidedSimDDHReceiverAbs::OTOneSidedSimDDHReceiverAbs(const shared_ptr<CommParty> & channel, const shared_ptr<PrgFromOpenSSLAES> & random, const shared_ptr<DlogGroup> & dlog)
: zkProver(channel, make_shared<SigmaDlogProverComputation>(dlog, 80, random), dlog) {
// The underlying dlog group must be DDH secure.
auto ddh = dynamic_pointer_cast<DDH>(dlog);
if (ddh == NULL) {
throw SecurityLevelException("DlogGroup should have DDH security level");
}
//Check that the given dlog is valid.
// In Zp case, the check is done by Crypto++ library.
//In elliptic curves case, by default SCAPI uploads a file with NIST recommended curves,
//and in this case we assume the parameters are always correct and the validateGroup function always return true.
//It is also possible to upload a user-defined configuration file. In this case,
//it is the user's responsibility to check the validity of the parameters by override the implementation of this function.
if (!dlog->validateGroup())
throw InvalidDlogGroupException("");
this->dlog = dlog;
this->random = random;
qMinusOne = dlog->getOrder() - 1;
// This protocol has no pre process stage.
}
/**
* Runs the following lines from the protocol:
* "COMPUTE a as follows:
* 1. If sigma = 0 then a = (g^alpha, g^beta, g^(alpha*beta), g^gamma)
* 2. If sigma = 1 then a = (g^alpha, g^beta, g^gamma, g^(alpha*beta))"
* @param sigma input for the protocol
* @param alpha random value sampled in the protocol
* @param beta random value sampled in the protocol
* @param gAlpha g^alpha
* @return OTRPrivacyOnlyMessage contains the tuple (x, y, z0, z1).
*/
OTRGroupElementQuadMsg OTOneSidedSimDDHReceiverAbs::computeTuple(byte sigma, biginteger & alpha, biginteger & beta, GroupElement* gAlpha) {
//Sample random value gamma in [0, . . . , q-1]
biginteger gamma = getRandomInRange(0, qMinusOne, random.get());
//Calculates g^beta, g^(alpha*beta), g^gamma.
auto g = dlog->getGenerator();
auto gBeta = dlog->exponentiate(g.get(), beta);
auto gGamma = dlog->exponentiate(g.get(), gamma);
auto gAlphaBeta = dlog->exponentiate(g.get(), alpha * beta);
//Create the tuple.
if (sigma == 0) {
return OTRGroupElementQuadMsg(gAlpha->generateSendableData(),
gBeta->generateSendableData(),
gAlphaBeta->generateSendableData(),
gGamma->generateSendableData());
}
else {
return OTRGroupElementQuadMsg(gAlpha->generateSendableData(),
gBeta->generateSendableData(),
gGamma->generateSendableData(),
gAlphaBeta->generateSendableData());
}
}
/**
* Runs the following line from the protocol:
* "SEND a to S"
* @param channel
* @param a the tuple to send to the sender.
* @throws IOException
*/
void OTOneSidedSimDDHReceiverAbs::sendTupleToSender(CommParty* channel, OTRGroupElementQuadMsg a) {
//Send the message by the channel.
auto msgStr = a.toString();
channel->writeWithSize(msgStr);
}
/**
* Runs the transfer phase of the OT protocol.<p>
* This is the part of the protocol where the receiver input is necessary.<p>
* "SAMPLE random values alpha, beta, gamma in {0, . . . , q-1} <p>
* COMPUTE a as follows:<p>
* 1. If sigma = 0 then a = (g^alpha, g^beta, g^(alpha*beta), g^gamma)<p>
* 2. If sigma = 1 then a = (g^alpha, g^beta, g^gamma, g^(alpha*beta))<p>
* SEND a to S<p>
* Run the prover in ZKPOK_FROM_SIGMA with Sigma protocol SIGMA_DLOG. Use common input x and private input alpha.<p>
* WAIT for message pairs (w0, c0) and (w1, c1) from S<p>
* In ByteArray scenario:<p>
* IF NOT <p>
* 1. w0, w1 in the DlogGroup, AND<p>
* 2. c0, c1 are binary strings of the same length<p>
* REPORT ERROR<p>
* COMPUTE kSigma = (wSigma)^beta<p>
* OUTPUT xSigma = cSigma XOR KDF(|cSigma|,kSigma)<p>
* In GroupElement scenario:<p>
* IF NOT <p>
* 1. w0, w1, c0, c1 in the DlogGroup<p>
* REPORT ERROR<p>
* COMPUTE (kSigma)^(-1) = (wSigma)^(-beta)<p>
* OUTPUT xSigma = cSigma * (kSigma)^(-1)"<p>
* @return OTROutput, the output of the protocol.
*/
shared_ptr<OTROutput> OTOneSidedSimDDHReceiverAbs::transfer(CommParty* channel, OTRInput* input) {
//check if the input is valid.
//If input is not instance of OTRBasicInput, throw Exception.
auto in = dynamic_cast<OTRBasicInput*>(input);
if (in == nullptr) {
throw invalid_argument("input should contain sigma.");
}
byte sigma = in->getSigma();
//The given sigma should be 0 or 1.
if ((sigma != 0) && (sigma != 1)) {
throw invalid_argument("Sigma should be 0 or 1");
}
/* Run the following part of the protocol:
SAMPLE random values alpha, beta, gamma in [0, . . . , q-1]
COMPUTE a as follows:
1. If sigma = 0 then a = (g^alpha, g^beta, g^(alpha*beta), g^gamma)
2. If sigma = 1 then a = (g^alpha, g^beta, g^gamma, g^(alpha*beta))
SEND a to S
Run the prover in ZKPOK_FROM_SIGMA with Sigma protocol SIGMA_DLOG. Use gAlpha and private input alpha.
WAIT for message pairs (w0, c0) and (w1, c1) from S
In ByteArray scenario:
IF NOT
1. w0, w1 in the DlogGroup, AND
2. c0, c1 are binary strings of the same length
REPORT ERROR
COMPUTE kSigma = (wSigma)^beta
OUTPUT xSigma = cSigma XOR KDF(|cSigma|,kSigma)
In GroupElement scenario:
IF NOT
1. w0, w1, c0, c1 in the DlogGroup
REPORT ERROR
COMPUTE (kSigma)^(-1) = (wSigma)^(-beta)
OUTPUT xSigma = cSigma * (kSigma)^(-1)
*/
//Sample random values alpha, beta in [0, . . . , q-1]
biginteger alpha = getRandomInRange(0, qMinusOne, random.get());
biginteger beta = getRandomInRange(0, qMinusOne, random.get());
//Compute g^alpha
auto g = dlog->getGenerator();
auto gAlpha = dlog->exponentiate(g.get(), alpha);
//complete calculations for tuple and create tuple for sender.
OTRGroupElementQuadMsg a = computeTuple(sigma, alpha, beta, gAlpha.get());
//Send tuple to sender.
sendTupleToSender(channel, a);
//Run the prover in ZKPOK_FROM_SIGMA with Sigma protocol SIGMA_DLOG.
zkProver.prove(make_shared<SigmaDlogProverInput>(gAlpha, alpha));
//Compute the final calculations to get xSigma.
return getMsgAndComputeXSigma(channel, sigma, beta);
}
/**
* Run the following line from the protocol:
* "IF NOT
* 1. w0, w1, c0, c1 in the DlogGroup
* REPORT ERROR"
* @param c1
* @param c0
* @param w1
* @param w0
* @throws CheatAttemptException if there was a cheat attempt during the execution of the protocol.
*/
void OTOneSidedSimDDHOnGroupElementReceiver::checkReceivedTuple(GroupElement* w0, GroupElement* w1, GroupElement* c0, GroupElement* c1) {
if (!(dlog->isMember(w0))) {
throw new CheatAttemptException("w0 element is not a member in the current DlogGroup");
}
if (!(dlog->isMember(w1))) {
throw new CheatAttemptException("w1 element is not a member in the current DlogGroup");
}
if (!(dlog->isMember(c0))) {
throw new CheatAttemptException("c0 element is not a member in the current DlogGroup");
}
if (!(dlog->isMember(c1))) {
throw new CheatAttemptException("c1 element is not a member in the current DlogGroup");
}
}
/**
* Run the following lines from the protocol:
* "IF NOT
* 1. w0, w1, c0, c1 in the DlogGroup
* REPORT ERROR
* COMPUTE (kSigma)^(-1) = (wSigma)^(-beta)
* OUTPUT xSigma = cSigma * (kSigma)^(-1)"
* @param sigma input of the protocol
* @param beta random value sampled in the protocol
* @param message received from the sender
* @return OTROutput contains xSigma
* @throws CheatAttemptException
*/
shared_ptr<OTROutput> OTOneSidedSimDDHOnGroupElementReceiver::getMsgAndComputeXSigma(CommParty* channel, byte sigma, biginteger & beta) {
vector<byte> raw_msg;
channel->readWithSizeIntoVector(raw_msg);
// create an empty OTRGroupElementPairMsg and initialize it with the received data.
OTOnGroupElementSMsg msg;
msg.initFromByteVector(raw_msg);
//Reconstruct the group elements from the given message.
auto w0 = dlog->reconstructElement(false, msg.getW0().get());
auto w1 = dlog->reconstructElement(false, msg.getW1().get());
auto c0 = dlog->reconstructElement(false, msg.getC0().get());
auto c1 = dlog->reconstructElement(false, msg.getC1().get());
//Compute the validity checks of the given message.
checkReceivedTuple(w0.get(), w1.get(), c0.get(), c1.get());
shared_ptr<GroupElement> kSigma, cSigma;
biginteger minusBeta = dlog->getOrder() - beta;
//If sigma = 0, compute w0^beta and set cSigma to c0.
if (sigma == 0) {
kSigma = dlog->exponentiate(w0.get(), minusBeta);
cSigma = c0;
}
//If sigma = 0, compute w1^beta and set cSigma to c1.
if (sigma == 1) {
kSigma = dlog->exponentiate(w1.get(), minusBeta);
cSigma = c1;
}
auto xSigma = dlog->multiplyGroupElements(cSigma.get(), kSigma.get());
//Create and return the output containing xSigma
return make_shared<OTOnGroupElementROutput>(xSigma);
}
/**
* Run the following line from the protocol:
* "IF NOT
* 1. w0, w1 in the DlogGroup, AND
* 2. c0, c1 are binary strings of the same length
* REPORT ERROR"
* @param w0
* @param w1
* @param c0
* @param c1
* @throws CheatAttemptException if there was a cheat attempt during the execution of the protocol.
*/
void OTOneSidedSimDDHOnByteArrayReceiver::checkReceivedTuple(GroupElement* w0, GroupElement* w1, vector<byte> & c0, vector<byte> & c1) {
if (!(dlog->isMember(w0))) {
throw new CheatAttemptException("w0 element is not a member in the current DlogGroup");
}
if (!(dlog->isMember(w1))) {
throw new CheatAttemptException("w1 element is not a member in the current DlogGroup");
}
if (c0.size() != c1.size()) {
throw CheatAttemptException("c0 and c1 is not in the same length");
}
}
/**
* Run the following lines from the protocol:
* "IF NOT
* 1. w0, w1 in the DlogGroup, AND
* 2. c0, c1 are binary strings of the same length
* REPORT ERROR
* COMPUTE kSigma = (wSigma)^beta
* OUTPUT xSigma = cSigma XOR KDF(|cSigma|,kSigma)"
* @param sigma input of the protocol
* @param beta random value sampled in the protocol
* @param message received from the sender
* @return OTROutput contains xSigma
* @throws CheatAttemptException
*/
shared_ptr<OTROutput> OTOneSidedSimDDHOnByteArrayReceiver::getMsgAndComputeXSigma(CommParty* channel, byte sigma, biginteger & beta) {
vector<byte> raw_msg;
channel->readWithSizeIntoVector(raw_msg);
// create an empty OTRGroupElementPairMsg and initialize it with the received data.
OTOnByteArraySMsg msg;
msg.initFromByteVector(raw_msg);
//Reconstruct the group elements from the given message.
auto w0 = dlog->reconstructElement(false, msg.getW0().get());
auto w1 = dlog->reconstructElement(false, msg.getW1().get());
//Get the byte arrays from the given message.
auto c0 = msg.getC0();
auto c1 = msg.getC1();
//Compute the validity checks of the given message.
checkReceivedTuple(w0.get(), w1.get(), c0, c1);
shared_ptr<GroupElement> kSigma;
vector<byte> cSigma;
//If sigma = 0, compute w0^beta and set cSigma to c0.
if (sigma == 0) {
kSigma = dlog->exponentiate(w0.get(), beta);
cSigma = c0;
}
//If sigma = 1, compute w1^beta and set cSigma to c1.
if (sigma == 1) {
kSigma = dlog->exponentiate(w1.get(), beta);
cSigma = c1;
}
//Compute kdf result:
int len = c0.size(); // c0 and c1 have the same size.
auto kBytes = dlog->mapAnyGroupElementToByteArray(kSigma.get());
auto xSigma = kdf->deriveKey(kBytes, 0, kBytes.size(), len).getEncoded();
//Xores the result from the kdf with vSigma.
for (int i = 0; i<len; i++) {
xSigma[i] = cSigma[i] ^ xSigma[i];
}
//Create and return the output containing xSigma
return make_shared<OTOnByteArrayROutput>(xSigma);
}
| 35.270968 | 178 | 0.687489 | manel1874 |
4664553d0cbcabc17439ef81f391a32783ee0d81 | 2,114 | cpp | C++ | Array/33. Search in Rotated Sorted Array/main.cpp | Minecodecraft/LeetCode-Minecode | 185fd6efe88d8ffcad94e581915c41502a0361a0 | [
"MIT"
] | 1 | 2021-11-19T19:58:33.000Z | 2021-11-19T19:58:33.000Z | Array/33. Search in Rotated Sorted Array/main.cpp | Minecodecraft/LeetCode-Minecode | 185fd6efe88d8ffcad94e581915c41502a0361a0 | [
"MIT"
] | null | null | null | Array/33. Search in Rotated Sorted Array/main.cpp | Minecodecraft/LeetCode-Minecode | 185fd6efe88d8ffcad94e581915c41502a0361a0 | [
"MIT"
] | 2 | 2021-11-26T12:47:27.000Z | 2022-01-13T16:14:46.000Z | //
// main.cpp
// 33. Search in Rotated Sorted Array
//
// Created by 边俊林 on 2018/7/13.
// Copyright © 2018 minecode. All rights reserved.
//
/* ------------------------------------------------------------------------ *\
https://leetcode-cn.com/problems/search-in-rotated-sorted-array/description/
\* ------------------------------------------------------------------------ */
#include <map>
#include <set>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
using namespace std;
/// Solution:
// Dichototmy Algorithm
/// Tips:
// Though the list is ratated, but there's must a section is ascending orider. [l, mid] or [r, mid], mid is the midimum number of the section.
// So we can use dichotomy algorithm to sperate the section. And just which is the ascending ordered secntion.
class Solution {
public:
int search(vector<int>& nums, int target) {
if (nums.size() == 0) return -1;
int mid;
int l = 0, r = (int)nums.size()-1;
while (l <= r) {
mid = (l+r) / 2;
if (nums[mid] == target) {
return mid;
} else if (nums[mid] < nums[r]) {
if (nums[mid]<=target && nums[r]>=target) {
l = mid + 1;
} else {
r = mid - 1;
}
} else {
if (nums[l]<=target && nums[mid]>=target) {
r = mid - 1;
} else {
l = mid + 1;
}
}
}
return -1;
}
};
void printVector(vector<int> v) {
printf("\n[");
for (auto it = v.begin(); it != v.end(); ++it) {
printf("%c%d", it==v.begin() ? '\0' : ' ', *it);
}
printf("]\n");
}
int main() {
Solution sol = Solution();
int arr[] = {1, 3};
size_t size = sizeof(arr) / sizeof(int);
vector<int> v = vector<int>(arr, arr+size);
int target = 3;
int res = sol.search(v, target);
cout << res << endl;
return 0;
}
| 25.780488 | 142 | 0.466887 | Minecodecraft |
466a0cb88c59fb690c68030f7b62edf50d850393 | 3,393 | hpp | C++ | lib/libchen/include/chen/data/ini.hpp | chensoft/libxio | 17345e500cca5085641b5392ce8ef7dc65369d69 | [
"MIT"
] | 6 | 2018-07-28T08:03:24.000Z | 2022-03-31T08:56:57.000Z | include/chen/data/ini.hpp | chensoft/libchen | 03ae1da49a39595cd8afcb6089122b9a5caa7891 | [
"MIT"
] | null | null | null | include/chen/data/ini.hpp | chensoft/libchen | 03ae1da49a39595cd8afcb6089122b9a5caa7891 | [
"MIT"
] | 2 | 2019-05-21T02:26:36.000Z | 2020-04-13T16:46:20.000Z | /**
* A tiny ini parser
* @since 2016.03.24
* @author Jian Chen <admin@chensoft.com>
* @link http://chensoft.com
* @link https://en.wikipedia.org/wiki/INI_file
* -----------------------------------------------------------------------------
* Ini file consists of two parts: section and property
* -) Case sensitive: e.g: key=val, Key=val are two different properties
* -) Duplicate key: will trigger a error, don't allow this
* -) Global key: allowed this, its section name will be empty
* -) Comments: support semicolons ';', comment can appear anywhere
* -) Hierarchy: now allowed
* -) Line break: using '\n' in file
* -) Escape: '\\', '\0', '\a', '\b', '\t', '\r', '\n', '\;', '\#', '\=', '\:', '\x????', '\"'
* -) Quoted values: allow double quotes, will remove it automatically
* -) Whitespace: left and right whitespaces are removed automatically, add double quote if you want preserved
* -----------------------------------------------------------------------------
* Usage:
* >> auto ini = chen::ini::parse("[section]\nk=v");
* >> chen::ini::dump(ini);
*/
#pragma once
#include "chen/base/iterator.hpp"
#include <unordered_map>
#include <exception>
namespace chen
{
class ini
{
public:
typedef chen::input_iterator<const std::uint8_t, const std::uint8_t> iterator; // it's an input iterator
typedef std::unordered_map<std::string, std::string> property_type; // k/v pair
typedef std::pair<std::string, property_type> section_type; // each section
typedef std::unordered_map<std::string, property_type> value_type; // multiple sections
class error : public std::runtime_error
{
public:
static const std::size_t npos = static_cast<std::size_t>(-1);
explicit error(const std::string &what) : std::runtime_error(what) {}
error(const std::string &what, std::size_t position) : std::runtime_error(what), position(position) {}
public:
std::size_t position = npos; // only valid when syntax error occur
};
public:
/**
* Ini parse, accept text, file or even iterators
* accept any iterator that satisfy the requirement of the input iterator
*/
static ini::value_type parse(const std::string &text, bool file = false);
static ini::value_type parse(iterator cur, iterator end);
/**
* Ini stringify
*/
static std::string stringify(const ini::value_type &map);
protected:
/**
* Throw syntax exception
*/
static void exception(const iterator &beg, iterator &cur, iterator &end);
/**
* Advance to the next non-whitespace character
*/
static bool advance(const iterator &beg, iterator &cur, iterator &end);
/**
* Decode specific type
*/
static void decode(ini::value_type &out, const iterator &beg, iterator &cur, iterator &end);
static void decode(ini::section_type &out, const iterator &beg, iterator &cur, iterator &end);
static void decode(ini::property_type &out, const iterator &beg, iterator &cur, iterator &end);
static void decode(std::string &out, const iterator &beg, iterator &cur, iterator &end);
static void comment(const iterator &beg, iterator &cur, iterator &end);
};
} | 39.453488 | 114 | 0.59387 | chensoft |
467125d505247e01a85ebc8748e7c1ee0a879efd | 980 | cpp | C++ | sm_c_vector.cpp | xzrunner/sm | e31351c4fcd4470efa4dbec5bb6ee02c21ae42f8 | [
"MIT"
] | null | null | null | sm_c_vector.cpp | xzrunner/sm | e31351c4fcd4470efa4dbec5bb6ee02c21ae42f8 | [
"MIT"
] | null | null | null | sm_c_vector.cpp | xzrunner/sm | e31351c4fcd4470efa4dbec5bb6ee02c21ae42f8 | [
"MIT"
] | null | null | null | #include "SM_Vector.h"
namespace sm
{
extern "C"
struct sm_vec2* sm_vec2_vector(struct sm_vec2* v, const struct sm_vec2* p1, const struct sm_vec2* p2)
{
*(vec2*)v = (*(const vec2*)p1) - (*(const vec2*)p2);
return v;
}
extern "C"
struct sm_vec2* sm_vec2_add(struct sm_vec2* v, const struct sm_vec2* p1, const struct sm_vec2* p2)
{
*(vec2*)v = (*(const vec2*)p1) + (*(const vec2*)p2);
return v;
}
extern "C"
struct sm_vec2* sm_vec2_normalize(struct sm_vec2* v)
{
((vec2*)v)->Normalize();
return v;
}
extern "C"
struct sm_vec3* sm_vec3_vector(struct sm_vec3* v, const struct sm_vec3* p1, const struct sm_vec3* p2)
{
*(vec3*)v = (*(const vec3*)p1) - (*(const vec3*)p2);
return v;
}
extern "C"
struct sm_vec3* sm_vec3_cross(struct sm_vec3* v, const struct sm_vec3* a, const struct sm_vec3* b)
{
*(vec3*)v = (*(const vec3*)a).Cross(*(const vec3*)b);
return v;
}
extern "C"
struct sm_vec3* sm_vec3_normalize(struct sm_vec3* v)
{
((vec3*)v)->Normalize();
return v;
}
} | 20.416667 | 101 | 0.670408 | xzrunner |
46723a13e6c172c8c1887d7176122c9db5de5319 | 2,827 | cxx | C++ | src/gadget/main_apply_merges.cxx | lejeunel/glia | 24b763a230627951139010cd07b0d0ff2356a365 | [
"MIT"
] | 11 | 2016-08-16T02:26:31.000Z | 2021-08-25T06:51:47.000Z | src/gadget/main_apply_merges.cxx | lejeunel/glia | 24b763a230627951139010cd07b0d0ff2356a365 | [
"MIT"
] | 3 | 2017-05-26T15:33:42.000Z | 2018-04-27T12:12:24.000Z | src/gadget/main_apply_merges.cxx | lejeunel/glia | 24b763a230627951139010cd07b0d0ff2356a365 | [
"MIT"
] | 9 | 2016-07-25T08:28:12.000Z | 2021-03-17T15:02:41.000Z | #include "util/struct_merge.hxx"
#include "util/container.hxx"
#include "util/image_io.hxx"
#include "util/text_io.hxx"
#include "util/text_cmd.hxx"
using namespace glia;
bool comp (TTriple<Label> const& m0, TTriple<Label> const& m1)
{ return m0.x2 < m1.x2; }
bool operation (std::string const& outputImageFile,
std::string const& inputImageFile,
std::string const& maskImageFile,
std::vector<std::string> const& mergeOrderFiles,
bool relabel, bool write16, bool compress)
{
int n = mergeOrderFiles.size();
std::vector<std::vector<TTriple<Label>>> tmerges(n);
for (int i = 0; i < n; ++i)
{ readData(tmerges[i], mergeOrderFiles[i], true); }
std::vector<TTriple<Label>> merges;
merges.reserve(count(merges, [](std::vector<TTriple<Label>> const& m)
-> unsigned int { return m.size(); }));
for (int i = 0; i < n; ++i) { splice(merges, tmerges[i]); }
std::sort(merges.begin(), merges.end(), comp);
std::unordered_map<Label, Label> lmap;
transformKeys(lmap, merges);
auto image = readImage<LabelImage<DIMENSION>>(inputImageFile);
auto mask = maskImageFile.empty()?
LabelImage<DIMENSION>::Pointer(nullptr):
readImage<LabelImage<DIMENSION>>(maskImageFile);
transformImage(image, lmap, mask, false);
if (relabel) { relabelImage(image, 0); }
if (write16) {
castWriteImage<UInt16Image<DIMENSION>>
(outputImageFile, image, compress);
}
else { writeImage(outputImageFile, image, compress); }
return true;
}
int main (int argc, char* argv[])
{
std::string outputImageFile, inputImageFile, maskImageFile;
std::vector<std::string> mergeOrderFiles;
bool relabel = false, write16 = false, compress = false;
bpo::options_description opts("Usage");
opts.add_options()
("help", "Print usage info")
("inputImage,i", bpo::value<std::string>(&inputImageFile)->required(),
"Input image file name")
("mask,m", bpo::value<std::string>(&maskImageFile),
"Mask image file name")
("merge,g",
bpo::value<std::vector<std::string>>(&mergeOrderFiles)->required(),
"Input merge order file name(s)")
("relabel,r", bpo::value<bool>(&relabel),
"Whether to relabel output image [default: false]")
("write16,u", bpo::value<bool>(&write16),
"Whether to write to uint16 image [default: false]")
("compress,z", bpo::value<bool>(&compress),
"Whether to compress output image file(s) [default: false]")
("outputImage,o", bpo::value<std::string>(&outputImageFile)->required(),
"Output image file name");
return
parse(argc, argv, opts) &&
operation(outputImageFile, inputImageFile, maskImageFile,
mergeOrderFiles, relabel, write16, compress)?
EXIT_SUCCESS: EXIT_FAILURE;
}
| 38.726027 | 78 | 0.650513 | lejeunel |
46784251df709ca00dafe33068ef175077f33a02 | 8,018 | cpp | C++ | a3d/src/vulkan/a3dUnorderedAccessView.cpp | ProjectAsura/asura-SDK | e823129856185b023b164415b7aec2de0ba9c338 | [
"MIT"
] | 42 | 2016-11-11T13:27:48.000Z | 2021-07-27T17:53:43.000Z | a3d/src/vulkan/a3dUnorderedAccessView.cpp | ProjectAsura/asura-SDK | e823129856185b023b164415b7aec2de0ba9c338 | [
"MIT"
] | null | null | null | a3d/src/vulkan/a3dUnorderedAccessView.cpp | ProjectAsura/asura-SDK | e823129856185b023b164415b7aec2de0ba9c338 | [
"MIT"
] | 2 | 2017-03-26T08:25:29.000Z | 2018-10-24T06:10:29.000Z | //-------------------------------------------------------------------------------------------------
// File : a3dUnorderedAccessView.cpp
// Desc : Unordered Access View Module.
// Copyright(c) Project Asura. All right reserved.
//-------------------------------------------------------------------------------------------------
namespace a3d {
///////////////////////////////////////////////////////////////////////////////////////////////////
// UnorderedAccessView class
///////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------
// コンストラクタです.
//-------------------------------------------------------------------------------------------------
UnorderedAccessView::UnorderedAccessView()
: m_RefCount (1)
, m_pDevice (nullptr)
, m_pResource (nullptr)
, m_ImageView (null_handle)
, m_Buffer (null_handle)
{ memset(&m_Desc, 0, sizeof(m_Desc)); }
//-------------------------------------------------------------------------------------------------
// デストラクタです.
//-------------------------------------------------------------------------------------------------
UnorderedAccessView::~UnorderedAccessView()
{ Term(); }
//-------------------------------------------------------------------------------------------------
// 初期化処理を行います.
//-------------------------------------------------------------------------------------------------
bool UnorderedAccessView::Init(IDevice* pDevice, IResource* pResource, const UnorderedAccessViewDesc* pDesc)
{
if (pDevice == nullptr || pResource == nullptr || pDesc == nullptr)
{ return false; }
Term();
m_pDevice = static_cast<Device*>(pDevice);
m_pDevice->AddRef();
memcpy(&m_Desc, pDesc, sizeof(m_Desc));
m_pResource = pResource;
m_pResource->AddRef();
auto pNativeDevice = m_pDevice->GetVulkanDevice();
A3D_ASSERT(pNativeDevice != null_handle);
if (pResource->GetKind() == RESOURCE_KIND_BUFFER)
{
auto pWrapBuffer = static_cast<Buffer*>(pResource);
A3D_ASSERT(pWrapBuffer != nullptr);
auto bufferDesc = pWrapBuffer->GetDesc();
if ((bufferDesc.Usage & RESOURCE_USAGE_UNORDERED_ACCESS_VIEW) != RESOURCE_USAGE_UNORDERED_ACCESS_VIEW)
{ return false; }
m_Buffer = pWrapBuffer->GetVulkanBuffer();
}
if (pResource->GetKind() == RESOURCE_KIND_TEXTURE)
{
auto pWrapTexture = static_cast<Texture*>(pResource);
A3D_ASSERT(pWrapTexture != nullptr);
auto textureDesc = pWrapTexture->GetDesc();
if ((textureDesc.Usage & RESOURCE_USAGE_UNORDERED_ACCESS_VIEW) != RESOURCE_USAGE_UNORDERED_ACCESS_VIEW)
{ return false; }
VkImageViewCreateInfo info = {};
info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
info.pNext = nullptr;
info.flags = 0;
info.format = ToNativeFormat(pDesc->Format);
info.image = pWrapTexture->GetVulkanImage();
info.viewType = ToNativeImageViewType(pDesc->Dimension);
info.components.r = VK_COMPONENT_SWIZZLE_R;
info.components.g = VK_COMPONENT_SWIZZLE_G;
info.components.b = VK_COMPONENT_SWIZZLE_B;
info.components.a = VK_COMPONENT_SWIZZLE_A;
info.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
info.subresourceRange.baseMipLevel = pDesc->MipSlice;
info.subresourceRange.levelCount = pDesc->MipLevels;
info.subresourceRange.baseArrayLayer = uint32_t(pDesc->FirstElements);
info.subresourceRange.layerCount = pDesc->ElementCount;
auto ret = vkCreateImageView(pNativeDevice, &info, nullptr, &m_ImageView);
if (ret != VK_SUCCESS)
{ return false; }
}
return true;
}
//-------------------------------------------------------------------------------------------------
// 終了処理を行います.
//-------------------------------------------------------------------------------------------------
void UnorderedAccessView::Term()
{
if (m_pDevice == nullptr)
{ return; }
auto pNativeDevice = m_pDevice->GetVulkanDevice();
A3D_ASSERT( pNativeDevice != null_handle );
if (m_ImageView != null_handle)
{
vkDestroyImageView( pNativeDevice, m_ImageView, nullptr );
m_ImageView = null_handle;
}
SafeRelease( m_pResource );
SafeRelease( m_pDevice );
}
//-------------------------------------------------------------------------------------------------
// 参照カウンタを増やします.
//-------------------------------------------------------------------------------------------------
void UnorderedAccessView::AddRef()
{ m_RefCount++; }
//-------------------------------------------------------------------------------------------------
// 解放処理を行います.
//-------------------------------------------------------------------------------------------------
void UnorderedAccessView::Release()
{
m_RefCount--;
if (m_RefCount == 0)
{ delete this; }
}
//-------------------------------------------------------------------------------------------------
// 参照カウンタを取得します.
//-------------------------------------------------------------------------------------------------
uint32_t UnorderedAccessView::GetCount() const
{ return m_RefCount; }
//-------------------------------------------------------------------------------------------------
// デバイスを取得します.
//-------------------------------------------------------------------------------------------------
void UnorderedAccessView::GetDevice(IDevice** ppDevice)
{
*ppDevice = m_pDevice;
if (m_pDevice != nullptr)
{ m_pDevice->AddRef(); }
}
//-------------------------------------------------------------------------------------------------
// 構成設定を取得します.
//-------------------------------------------------------------------------------------------------
UnorderedAccessViewDesc UnorderedAccessView::GetDesc() const
{ return m_Desc; }
//-------------------------------------------------------------------------------------------------
// リソースを取得します.
//-------------------------------------------------------------------------------------------------
IResource* UnorderedAccessView::GetResource() const
{ return m_pResource; }
//-------------------------------------------------------------------------------------------------
// イメージビューを取得します.
//-------------------------------------------------------------------------------------------------
VkImageView UnorderedAccessView::GetVulkanImageView() const
{ return m_ImageView; }
//-------------------------------------------------------------------------------------------------
// バッファを取得します.
//-------------------------------------------------------------------------------------------------
VkBuffer UnorderedAccessView::GetVulkanBuffer() const
{ return m_Buffer; }
//-------------------------------------------------------------------------------------------------
// 生成処理を行います.
//-------------------------------------------------------------------------------------------------
bool UnorderedAccessView::Create
(
IDevice* pDevice,
IResource* pResource,
const UnorderedAccessViewDesc* pDesc,
IUnorderedAccessView** ppView
)
{
if (pDevice == nullptr || pResource == nullptr || pDesc == nullptr || ppView == nullptr)
{ return false; }
auto instance = new UnorderedAccessView();
if (instance == nullptr)
{ return false; }
if (!instance->Init(pDevice, pResource, pDesc))
{
SafeRelease(instance);
return false;
}
*ppView = instance;
return true;
}
} // namespace a3d
| 39.303922 | 111 | 0.392991 | ProjectAsura |
46847858f82ed42ed05f6c41dda691a2af89e86e | 49 | cpp | C++ | nanodbc_ext/detail/async_folly.cpp | fesily/nanodbc_ext | 1d0d96130183bac6d27bd3dc07d82cc4f6e4b7cb | [
"MIT"
] | null | null | null | nanodbc_ext/detail/async_folly.cpp | fesily/nanodbc_ext | 1d0d96130183bac6d27bd3dc07d82cc4f6e4b7cb | [
"MIT"
] | null | null | null | nanodbc_ext/detail/async_folly.cpp | fesily/nanodbc_ext | 1d0d96130183bac6d27bd3dc07d82cc4f6e4b7cb | [
"MIT"
] | null | null | null |
#include <nanodbc_ext/detail/async_folly-inl.h>
| 16.333333 | 47 | 0.795918 | fesily |
468c343db026ee176b3d31511339458cc18833d7 | 4,109 | cxx | C++ | CandyKing/Animal.cxx | trilog/Tri | 5fedee71b1cedaa3003d68f0228135a471d1f09e | [
"Apache-2.0"
] | null | null | null | CandyKing/Animal.cxx | trilog/Tri | 5fedee71b1cedaa3003d68f0228135a471d1f09e | [
"Apache-2.0"
] | null | null | null | CandyKing/Animal.cxx | trilog/Tri | 5fedee71b1cedaa3003d68f0228135a471d1f09e | [
"Apache-2.0"
] | null | null | null | #include "Animal.h"
// **************** Con/Destructors ***********************
Animal::Animal():
soundManager(NULL),
state(asStanding), currentClip(0), flip(SDL_FLIP_NONE),
hitBoxShown(false), vectorsShown(false),
maxVelocity(10), maxPoints(10),
theta(0), velocity(0)
{
}
// **************** setImage ******************************
void Animal::setImage(DTexture* _texture, int x, int y)
{
texture = _texture;
setPosition(x, y);
}
// **************** getTheta ******************************
float Animal::calcTheta()
{
if (coincident()) return 0;
else return atan2((float) (dest.y - pos.y), (float) (dest.x - pos.x));
}
// **************** render ********************************
void Animal::render()
{
switch (state)
{
case asDead: stateDead(); break;
case asStanding: stateStanding(); break;
case asWalking: stateWalking(); break;
case asDying: stateDying(); break;
case asEating: stateEating(); break;
default: return; break;
}
texture->renderAdvanced(pos.x, pos.y, clips.at(currentClip), theta, flip);
if (hitBoxShown)
{
polygon.set(clips.at(currentClip), pos, flip);
polygon.absoluteAngle(getTheta());
polygon.render(texture->getRenderer());
}
if (vectorsShown)
{
SDL_Color blue = { 0x22, 0x22, 0x99, 0xFF };
journey.p1 = pos;
journey.render(texture->getRenderer(), blue);
}
}
// **************** getDistance ***************************
float Animal::getDistance()
{
float x = (float) (pos.x - dest.x);
float y = (float) (pos.y - dest.y);
return sqrt((x * x) + (y * y));
}
// **************** setDestination ************************
void Animal::setDestination(DPoint& point)
{
if ((state == asDying) || (state == asDead)) return;
journey.p1 = pos;
journey.p2 = point;
for (DPolygon* shape: solidShapes) shape->clip(journey);
dest = journey.p2;
theta = calcTheta();
velocity = maxVelocity;
state = asWalking;
timer.start();
}
// **************** setClip *******************************
void Animal::setClip(string name, int x, int y, int w, int h, int focusX, int focusY)
{
ClipInfo clip;
clip.name = name;
clip.clip = { x, y, w, h };
clip.focus = { focusX, focusY };
clips.push_back(clip);
}
// **************** hit ***********************************
bool Animal::hit(int x, int y)
{
if ((state == asDying) || (state == asDead)) return false;
polygon.set(clips.at(currentClip), pos);
polygon.absoluteAngle(getTheta());
return polygon.hit(x, y);
}
// **************** kill **********************************
int Animal::kill()
{
state = asDying;
velocity = 0;
currentClip = 3;
timer.start();
if (soundManager != NULL) soundManager->playSound("Cat-Whimper");
return maxPoints;
}
// **************** states ********************************
void Animal::stateDead()
{
texture->setAlpha(0);
return;
}
void Animal::stateDying()
{
int alpha = 255 - timer.elapsed()/2;
if (alpha < 0)
{
alpha = 0;
state = asDead;
timer.stop();
}
texture->setAlpha(alpha);
}
void Animal::stateWalking()
{
texture->setAlpha(255);
float currentDistance = getDistance();
theta = calcTheta();
flip = (fabs(theta) > 0.5 * M_PI) ? SDL_FLIP_VERTICAL : SDL_FLIP_NONE;
velocity = maxVelocity;
if (velocity > maxVelocity) velocity = maxVelocity;
if (!timer.isPaused())
{
if (currentDistance > velocity)
{
currentClip = (timer.elapsed()/150) % 2;
pos.x += (int) (velocity * cos(theta));
pos.y += (int) (velocity * sin(theta));
}
else
{
state = asEating;
pos.x = dest.x;
pos.y = dest.y;
velocity = 0;
}
}
}
void Animal::stateEating()
{
texture->setAlpha(255);
currentClip = (timer.elapsed()/150) % 2 + 4;
}
void Animal::stateStanding()
{
texture->setAlpha(255);
currentClip = 0;
}
| 23.614943 | 85 | 0.513264 | trilog |
469cfa95b6f02124d745e11f18eb274375d489e8 | 3,313 | cpp | C++ | Tools/ExternalSrc/LibRaw/LibRawInterface.cpp | ronan-kerviche/glip-lib | 6ae64559db7616abc33e586364940695665795a9 | [
"MIT"
] | 16 | 2016-07-29T07:39:07.000Z | 2022-03-17T04:27:22.000Z | Tools/ExternalSrc/LibRaw/LibRawInterface.cpp | ronan-kerviche/glip-lib | 6ae64559db7616abc33e586364940695665795a9 | [
"MIT"
] | 2 | 2017-02-04T19:34:26.000Z | 2020-05-29T20:13:58.000Z | Tools/ExternalSrc/LibRaw/LibRawInterface.cpp | ronan-kerviche/glip-lib | 6ae64559db7616abc33e586364940695665795a9 | [
"MIT"
] | 4 | 2016-07-07T10:16:11.000Z | 2019-03-24T05:56:16.000Z | /* ************************************************************************************************************* */
/* */
/* LIBRAW INTERFACE */
/* Interface to the LibRaw library for the OpenGL Image Processing LIBrary */
/* */
/* Author : R. Kerviche */
/* LICENSE : MIT License */
/* Website : glip-lib.net */
/* */
/* File : LibRawInterface.cpp */
/* Original Date : August 18th 2014 */
/* */
/* Description : LibRaw interface for image input/output. */
/* */
/* ************************************************************************************************************* */
// Includes :
#include "LibRawInterface.hpp"
#include <libraw/libraw.h>
// Tools :
Glip::Modules::ImageBuffer* libRawLoadImage(const std::string& filename)
{
int returnCode = 0;
LibRaw rawProcessor;
returnCode = rawProcessor.open_file(filename.c_str());
if(returnCode!=LIBRAW_SUCCESS)
throw Glip::Exception("libRawLoadImage - Error while loading the file " + filename + " : " + std::string(libraw_strerror(returnCode)) + ".", __FILE__, __LINE__);
returnCode = rawProcessor.unpack();
if(returnCode!=LIBRAW_SUCCESS)
throw Glip::Exception("libRawLoadImage - Error while unpacking the file " + filename + " : " + std::string(libraw_strerror(returnCode)) + ".", __FILE__, __LINE__);
libraw_decoder_info_t decoderInfo;
rawProcessor.get_decoder_info(&decoderInfo);
if(!(decoderInfo.decoder_flags & LIBRAW_DECODER_FLATFIELD))
throw Glip::Exception("libRawLoadImage - Error while unpacking the file " + filename + " : not a Bayer-pattern RAW file.", __FILE__, __LINE__);
// WARNING, THE FORMAT MUST BE GL_LUMINANCE16 TO ALLOW THE SHADERS TO READ FULL 16 BITS PRECISION.
Glip::CoreGL::HdlTextureFormat format(rawProcessor.imgdata.sizes.raw_width, rawProcessor.imgdata.sizes.raw_height, GL_LUMINANCE16, GL_UNSIGNED_SHORT);
Glip::Modules::ImageBuffer* imageBuffer = new Glip::Modules::ImageBuffer(format);
Glip::Modules::ImageBuffer original(const_cast<void*>(reinterpret_cast<const void*>(rawProcessor.imgdata.rawdata.raw_image)), format, 4);
imageBuffer->blit(original, 0, 0, 0, 0, -1, -1, false, true);
return imageBuffer;
}
| 66.26 | 166 | 0.418956 | ronan-kerviche |
469e570b7ca06b8f51abd8b53a14d908d015a295 | 1,258 | cpp | C++ | algorithms/kruskal.cpp | mvgmb/Marathon | 0dcc428a5e6858e2427fb40cefbd7453d1abcdb5 | [
"Xnet",
"X11"
] | null | null | null | algorithms/kruskal.cpp | mvgmb/Marathon | 0dcc428a5e6858e2427fb40cefbd7453d1abcdb5 | [
"Xnet",
"X11"
] | null | null | null | algorithms/kruskal.cpp | mvgmb/Marathon | 0dcc428a5e6858e2427fb40cefbd7453d1abcdb5 | [
"Xnet",
"X11"
] | null | null | null | #include <vector>
#include <queue>
#include <iostream>
#include <limits>
#include <set>
#include <map>
#include <algorithm>
#define vi vector<int>
#define vii vector<vector<int>>
#define ii pair<int, int>
#define fr(i, n) for (int i = 0; i < n; i++)
#define all(v) v.begin(),v.end()
#define pb push_back
#define tr(c, it) for (auto it = (c).begin(); it != (c).end(); it++)
#define rtr(c, it) for (auto it = (c).rbegin(); it != (c).rend(); it++)
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) ((c).find(all(c), x) != (c).end())
using namespace std;
const int maxN = 200005;
int parent[maxN], size[maxN];
void init(int n) {
fr(i, n) {
parent[i] = i;
size[i] = 1;
}
}
int findSet(int x) {
if (x != parent[x]) parent[x] = findSet(parent[x]);
return parent[x];
}
bool isSameSet(int a, int b) {
return findSet(a) == findSet(b);
}
void uniteSet(int a, int b) {
a = findSet(a);
b = findSet(b);
if(size[a] < size[b]) swap(a,b);
size[a] += size[b];
parent[b] = a;
}
int main() {
int n, m;
int u, v, w;
vector< tuple < int,int,int > > edgeList;
sort(all(edgeList));
int mst_cost = 0;
init(n);
fr(i,n) {
tie(w,u,v) = edgeList[i];
if (!isSameSet(u,v)) {
mst_cost += w;
uniteSet(u, v);
}
}
} | 19.353846 | 71 | 0.573927 | mvgmb |
46a5e78de53b8b0cc8aa2fdb61a416d8cb518488 | 7,119 | cpp | C++ | tests/blocksignificant/arithmetic/division.cpp | FloEdelmann/universal | c5b83f251ad91229399b7f97e4eeefcf718819d4 | [
"MIT"
] | null | null | null | tests/blocksignificant/arithmetic/division.cpp | FloEdelmann/universal | c5b83f251ad91229399b7f97e4eeefcf718819d4 | [
"MIT"
] | null | null | null | tests/blocksignificant/arithmetic/division.cpp | FloEdelmann/universal | c5b83f251ad91229399b7f97e4eeefcf718819d4 | [
"MIT"
] | null | null | null | // division.cpp: functional tests for blocksignificant division
//
// Copyright (C) 2017-2021 Stillwater Supercomputing, Inc.
//
// This file is part of the universal numbers project, which is released under an MIT Open Source license.
#include <universal/utility/directives.hpp>
#include <universal/utility/long_double.hpp>
#include <iostream>
#include <iomanip>
#include <typeinfo>
#include <universal/native/integers.hpp>
#include <universal/internal/blockbinary/blockbinary.hpp>
#include <universal/internal/blocksignificant/blocksignificant.hpp>
#include <universal/verification/test_status.hpp> // ReportTestResult
#include <universal/verification/test_reporters.hpp> // ReportBinaryArithmeticError
// enumerate all division cases for an blocksignificant<nbits,BlockType> configuration
template<typename blocksignificantConfiguration>
int VerifyBlockSignificantDivision(bool reportTestCases) {
constexpr size_t nbits = blocksignificantConfiguration::nbits;
using BlockType = typename blocksignificantConfiguration::BlockType;
constexpr size_t NR_VALUES = (size_t(1) << nbits);
using namespace sw::universal;
// cout << endl;
// cout << "blocksignificant<" << nbits << ',' << typeid(BlockType).name() << '>' << endl;
int nrOfFailedTests = 0;
blocksignificant<nbits, BlockType> a, b, c;
// nbits = 2 * fhbits
constexpr size_t fhbits = (nbits >> 1);
constexpr size_t fbits = fhbits - 1;
a.setradix(2 * fbits);
b.setradix(2 * fbits);
a.setradix(2 * fbits);
blockbinary<nbits, BlockType> aref, bref, cref, refResult;
constexpr size_t nrBlocks = blockbinary<nbits, BlockType>::nrBlocks;
for (size_t i = 0; i < NR_VALUES; i++) {
a.setbits(i);
aref.setbits(i);
for (size_t j = 0; j < NR_VALUES; j++) {
b.setbits(j);
bref.setbits(j);
cref = aref / bref;
c.div(a, b);
for (size_t k = 0; k < nrBlocks; ++k) {
refResult.setblock(k, c.block(k));
}
if (refResult != cref) {
nrOfFailedTests++;
if (reportTestCases) ReportBinaryArithmeticError("FAIL", "+", a, b, c, refResult);
}
else {
// if (reportTestCases) ReportBinaryArithmeticSuccess("PASS", "+", a, b, c, cref);
}
if (nrOfFailedTests > 100) return nrOfFailedTests;
}
// if (i % 1024 == 0) cout << '.'; /// if you enable this, put the endl back
}
// cout << endl;
return nrOfFailedTests;
}
template<size_t nbits, typename BlockType>
void TestMostSignificantBit() {
using namespace sw::universal;
blocksignificant<nbits, BlockType> a;
std::cout << to_binary(a) << ' ' << a.msb() << '\n';
a.setbits(0x01ull);
for (size_t i = 0; i < nbits; ++i) {
std::cout << to_binary(a) << ' ' << a.msb() << '\n';
a <<= 1;
}
}
// Regression testing guards: typically set by the cmake configuration, but MANUAL_TESTING is an override
#define MANUAL_TESTING 1
// REGRESSION_LEVEL_OVERRIDE is set by the cmake file to drive a specific regression intensity
// It is the responsibility of the regression test to organize the tests in a quartile progression.
//#undef REGRESSION_LEVEL_OVERRIDE
#ifndef REGRESSION_LEVEL_OVERRIDE
#undef REGRESSION_LEVEL_1
#undef REGRESSION_LEVEL_2
#undef REGRESSION_LEVEL_3
#undef REGRESSION_LEVEL_4
#define REGRESSION_LEVEL_1 1
#define REGRESSION_LEVEL_2 1
#define REGRESSION_LEVEL_3 1
#define REGRESSION_LEVEL_4 1
#endif
int main()
try {
using namespace sw::universal;
std::string test_suite = "blocksignificant division validation";
std::string test_tag = "blocksignificant division";
bool reportTestCases = false;
int nrOfFailedTestCases = 0;
std::cout << test_suite << '\n';
#if MANUAL_TESTING
{
blocksignificant<4, uint8_t> a, b, c;
c.div(a, b);
}
TestMostSignificantBit<27, uint8_t>();
TestMostSignificantBit<27, uint16_t>();
TestMostSignificantBit<33, uint32_t>();
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<4, uint8_t> >(reportTestCases), "blocksignificant<4>", "division");
// nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<8, uint8_t> >(reportTestCases), "blocksignificant<8>", "division");
ReportTestSuiteResults(test_suite, nrOfFailedTestCases);
return EXIT_SUCCESS; // ignore failures
#else
#if REGRESSION_LEVEL_1
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<4, uint8_t> >(reportTestCases), "blocksignificant<4,uint8_t>", "division");
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<5, uint8_t> >(reportTestCases), "blocksignificant<5,uint8_t>", "division");
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<6, uint8_t> >(reportTestCases), "blocksignificant<6,uint8_t>", "division");
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<7, uint8_t> >(reportTestCases), "blocksignificant<7,uint8_t>", "division");
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<8, uint8_t> >(reportTestCases), "blocksignificant<8,uint8_t>", "division");
#endif
#if REGRESSION_LEVEL_2
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<9, uint8_t> >(reportTestCases), "blocksignificant<9,uint8_t>", "division");
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<10, uint8_t> >(reportTestCases), "blocksignificant<10,uint8_t>", "division");
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<12, uint8_t> >(reportTestCases), "blocksignificant<12,uint8_t>", "division");
#endif
#if REGRESSION_LEVEL_3
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<9, uint16_t> >(reportTestCases), "blocksignificant<9,uint16_t>", "division");
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<11, uint16_t> >(reportTestCases), "blocksignificant<11,uint16_t>", "division");
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<13, uint16_t> >(reportTestCases), "blocksignificant<13,uint16_t>", "division");
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<12, uint32_t> >(reportTestCases), "blocksignificant<12,uint32_t>", "division");
#endif
#if REGRESSION_LEVEL_4
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<16, uint8_t> >(reportTestCases), "blocksignificant<16,uint8_t>", "division");
nrOfFailedTestCases += ReportTestResult(VerifyBlockSignificantDivision< blocksignificant<16, uint16_t> >(reportTestCases), "blocksignificant<16,uint16_t>", "division");
#endif
ReportTestSuiteResults(test_suite, nrOfFailedTestCases);
return (nrOfFailedTestCases > 0 ? EXIT_FAILURE : EXIT_SUCCESS);
#endif // MANUAL_TESTING
}
catch (char const* msg) {
std::cerr << msg << std::endl;
return EXIT_FAILURE;
}
catch (const std::runtime_error& err) {
std::cerr << "Uncaught runtime exception: " << err.what() << std::endl;
return EXIT_FAILURE;
}
catch (...) {
std::cerr << "Caught unknown exception" << std::endl;
return EXIT_FAILURE;
}
| 42.375 | 169 | 0.759095 | FloEdelmann |
9e4dbd4b2bd37e914385fcbee11f3e3664a943ea | 1,045 | cpp | C++ | source/aufgabe_4.cpp | ttobollik/programmiersprachen-aufgabenblatt-3 | 7b64c32f028b931ba5f01d86ea6abd950101cb37 | [
"MIT"
] | null | null | null | source/aufgabe_4.cpp | ttobollik/programmiersprachen-aufgabenblatt-3 | 7b64c32f028b931ba5f01d86ea6abd950101cb37 | [
"MIT"
] | null | null | null | source/aufgabe_4.cpp | ttobollik/programmiersprachen-aufgabenblatt-3 | 7b64c32f028b931ba5f01d86ea6abd950101cb37 | [
"MIT"
] | null | null | null | #include "circle.hpp"
#include <set>
#include <algorithm>
using namespace std;
bool exists(set<Circle>& Circles, string& name){ //Prueft ob der Name schon existiert
bool answer = true;
for (auto& element : Circles) {
if (element.get_name()== name) {
cout << "This name is in use already. Restarting...." << "\n";
answer = false;
}
}
return answer;
}
int main() {
int go_on = 1;
set<Circle> Circles;
while (go_on == 1) { //Schleife um das Programm wiederholt ausfuehren zu lassen
string circle_name;
cout << "Please enter a name for the circle you want to create" << "\n";
cin >> circle_name;
if(exists(Circles, circle_name) == true) {
Circle c1(circle_name);
Circles.insert(c1);
cout << "here is your: " << c1 << " \n";
cout << "Would you like to create another fancy circle? Enter 1 for yes, any other key will quit the programm " << "\n";
cin >> go_on;
} else {
go_on = 1;
}
}
}
| 23.75 | 128 | 0.569378 | ttobollik |
9e4f44654c88895dcda9c1e4b53d6c07f62531b1 | 54,943 | cpp | C++ | src/glib/mine/mc.cpp | mihapapler/qminer | 078bdd249313e984751789532c986309ab9689fd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/glib/mine/mc.cpp | mihapapler/qminer | 078bdd249313e984751789532c986309ab9689fd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/glib/mine/mc.cpp | mihapapler/qminer | 078bdd249313e984751789532c986309ab9689fd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | /**
* Copyright (c) 2015, Jozef Stefan Institute, Quintelligence d.o.o. and contributors
* All rights reserved.
*
* This source code is licensed under the FreeBSD license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "mc.h"
using namespace TMc;
//////////////////////////////////////////////////////
// Distance measures
TFullMatrix TEuclDist::GetDist2(const TFullMatrix& X, const TFullMatrix& Y) {
const TVector OnesX = TVector::Ones(X.GetCols(), true);
const TVector OnesY = TVector::Ones(Y.GetCols(), false);
const TVector NormX2 = X.ColNorm2V().Transpose();
const TVector NormY2 = Y.ColNorm2V();
return (NormX2 * OnesY) - (X*2).MulT(Y) + (OnesX * NormY2);
}
/////////////////////////////////////////////
// MDS
TFullMatrix TEuclMds::Project(const TFullMatrix& X, const int& d) {
// first center the rows of matrix X
TFullMatrix X1 = X.GetCenteredRows();
// Let B = X'X, then we can decompose B into its spectral decomposition
// B = V*L*V' where L is a diagonal matrix of eigenvalues, and A holds the
// corresponding eigenvectors in its columns
// we can now aaproximate B with just the highest 'd' eigenvalues and
// eigenvectors: B_d = V_d * L_d * V_d'
// the coordinates of X can then be recovered by: X_d = V_d*L_d^(.5)
// se can use SVD do find the eigenvectors V_d and eigenvalues L_d
// X = U*S*V', where:
// S is a diagonal matrix where {s_i^2} are the eigenvalues of X'X=B and X*X'
// U holds the eigenvectors of X*X'
// V holds the eigenvectors of X'X
// so X_d = V_d * diag({|s_i|})
TMatVecMatTr Svd = X1.Svd(d);
const TVector& EigValsSqrt = Svd.Val2.Map([&](const TFlt& Val) { return fabs(Val); });
const TFullMatrix& V = Svd.Val3;
TFullMatrix X_d = V*TFullMatrix::Diag(EigValsSqrt);
X_d.Transpose();
return X_d;
}
void TAvgLink::JoinClusts(TFullMatrix& DistMat, const TVector& ItemCountV, const int& MnI, const int& MnJ) {
TVector NewDistV(DistMat.GetRows(), false);
for (int i = 0; i < DistMat.GetRows(); i++) {
NewDistV[i] = (DistMat(MnI, i)*ItemCountV[MnI] + DistMat(MnJ, i)*ItemCountV[MnJ]) / (ItemCountV[MnI] + ItemCountV[MnJ]);
}
DistMat.SetRow(MnI, NewDistV);
DistMat.SetCol(MnI, NewDistV.Transpose());
}
void TCompleteLink::JoinClusts(TFullMatrix& DistMat, const TVector& ItemCountV, const int& MnI, const int& MnJ) {
TVector NewDistV(DistMat.GetRows(), false);
for (int i = 0; i < DistMat.GetRows(); i++) {
NewDistV[i] = TMath::Mx(DistMat(MnI, i), DistMat(MnJ, i));
}
DistMat.SetRow(MnI, NewDistV);
DistMat.SetCol(MnI, NewDistV.Transpose());
}
void TSingleLink::JoinClusts(TFullMatrix& DistMat, const TVector& ItemCountV, const int& MnI, const int& MnJ) {
TVector NewDistV(DistMat.GetRows(), false);
for (int i = 0; i < DistMat.GetRows(); i++) {
NewDistV[i] = TMath::Mn(DistMat(MnI, i), DistMat(MnJ, i));
}
DistMat.SetRow(MnI, NewDistV);
DistMat.SetCol(MnI, NewDistV.Transpose());
}
/////////////////////////////////////////////////////////////////
// Agglomerative clustering
THierarch::THierarch(const bool& _HistCacheSize, const bool& _Verbose):
HierarchV(),
StateHeightV(),
MxHeight(TFlt::Mn),
HistCacheSize(_HistCacheSize),
PastStateIdV(),
StateCoordV(),
NLeafs(0),
Verbose(_Verbose),
Notify(_Verbose ? TNotify::StdNotify : TNotify::NullNotify) {
EAssertR(HistCacheSize >= 1, "Have to hold at least the current state!");
}
THierarch::THierarch(TSIn& SIn):
HierarchV(SIn),
StateHeightV(SIn),
MxHeight(SIn),
HistCacheSize(TInt(SIn)),
PastStateIdV(SIn),
StateCoordV(SIn),
NLeafs(TInt(SIn)),
StateNmV(SIn),
Verbose(TBool(SIn)),
Notify(nullptr) {
Notify = Verbose ? TNotify::StdNotify : TNotify::NullNotify;
}
void THierarch::Save(TSOut& SOut) const {
HierarchV.Save(SOut);
StateHeightV.Save(SOut);
MxHeight.Save(SOut);
TInt(HistCacheSize).Save(SOut);
PastStateIdV.Save(SOut);
StateCoordV.Save(SOut);
TInt(NLeafs).Save(SOut);
StateNmV.Save(SOut);
TBool(Verbose).Save(SOut);
}
PHierarch THierarch::Load(TSIn& SIn) {
return new THierarch(SIn);
}
void THierarch::Init(const TFullMatrix& CentroidMat, const int& CurrLeafId) {
ClrFlds();
NLeafs = CentroidMat.GetCols();
// create a hierarchy
TIntIntFltTrV MergeV; TAlAggClust::MakeDendro(CentroidMat, MergeV, Notify);
Notify->OnNotify(TNotifyType::ntInfo, TStrUtil::GetStr(MergeV, ", "));
const int NMiddleStates = MergeV.Len();
const int NStates = NLeafs + NMiddleStates;
HierarchV.Gen(NStates);
StateHeightV.Gen(NStates);
for (int i = 0; i < HierarchV.Len(); i++) {
HierarchV[i] = -1;
}
for (int i = 0; i < MergeV.Len(); i++) {
const int LeafState1Idx = MergeV[i].Val1;
const int LeafState2Idx = MergeV[i].Val2;
const double Height = MergeV[i].Val3;
// find the states into which state 1 and state 2 were merged
const int State1Idx = GetOldestAncestIdx(LeafState1Idx);
const int State2Idx = GetOldestAncestIdx(LeafState2Idx);
const int MergeStateIdx = NLeafs + i;
HierarchV[State1Idx] = MergeStateIdx;
HierarchV[State2Idx] = MergeStateIdx;
StateHeightV[MergeStateIdx] = Height;
EAssertR(StateHeightV[MergeStateIdx] > StateHeightV[State1Idx] && StateHeightV[MergeStateIdx] > StateHeightV[State2Idx], "Parent should have greater height that any of its children!");
if (Height > MxHeight) { MxHeight = Height; }
}
HierarchV.Last() = HierarchV.Len() - 1;
// compute state coordinates
ComputeStateCoords(CentroidMat, NStates);
// initialize history
TFltV HeightV; GetUniqueHeightV(HeightV);
PastStateIdV.Gen(HeightV.Len(), HeightV.Len());
UpdateHistory(CurrLeafId);
// initialize state names
StateNmV.Gen(HierarchV.Len());
}
void THierarch::UpdateHistory(const int& CurrLeafId) {
TFltV HeightV; GetUniqueHeightV(HeightV);
TIntFltPrV StateIdHeightPrV; GetAncestorV(CurrLeafId, StateIdHeightPrV);
EAssertR(HeightV.Len() == PastStateIdV.Len(), "Number of heights doesn't match the number of heights in the past state cache!");
int CurrHeightIdx = 0;
for (int i = 0; i < StateIdHeightPrV.Len(); i++) {
const int CurrStateId = StateIdHeightPrV[i].Val1;
while (CurrHeightIdx < HeightV.Len() && IsOnHeight(CurrStateId, HeightV[CurrHeightIdx])) {
if (PastStateIdV[CurrHeightIdx].Empty() || PastStateIdV[CurrHeightIdx][0] != CurrStateId) {
PastStateIdV[CurrHeightIdx].Ins(0, CurrStateId);
// cleanup
while (PastStateIdV[CurrHeightIdx].Len() > HistCacheSize) { PastStateIdV[CurrHeightIdx].DelLast(); }
}
CurrHeightIdx++;
}
}
}
void THierarch::GetUniqueHeightV(TFltV& HeightV) const {
const int NStates = GetStates();
TFltSet UsedHeightSet;
for (int i = 0; i < NStates; i++) {
if (!UsedHeightSet.IsKey(StateHeightV[i])) {
HeightV.Add(StateHeightV[i]);
UsedHeightSet.AddKey(StateHeightV[i]);
}
}
HeightV.Sort(true); // sort ascending
}
void THierarch::GetStateIdHeightPrV(TIntFltPrV& StateIdHeightPrV) const {
for (int i = 0; i < HierarchV.Len(); i++) {
StateIdHeightPrV.Add(TIntFltPr(i, GetStateHeight(i)));
}
}
void THierarch::GetStateSetsAtHeight(const double& Height, TIntV& StateIdV, TVec<TIntV>& StateSetV) const {
TIntIntVH StateSubStateH; GetAncSuccH(Height, StateSubStateH);
StateIdV.Gen(StateSubStateH.Len());
StateSetV.Gen(StateSubStateH.Len());
int i = 0;
int KeyId = StateSubStateH.FFirstKeyId();
while (StateSubStateH.FNextKeyId(KeyId)) {
const int StateIdx = StateSubStateH.GetKey(KeyId);
if (StateSubStateH[KeyId].Empty()) {
StateSetV[i].Add(StateIdx);
} else {
StateSetV[i] = StateSubStateH[KeyId];
}
StateIdV[i] = StateIdx;
i++;
}
}
void THierarch::GetStatesAtHeight(const double& Height, TIntSet& StateIdV) const {
const int NStates = GetStates();
for (int StateIdx = 0; StateIdx < NStates; StateIdx++) {
if (IsOnHeight(StateIdx, Height)) {
StateIdV.AddKey(StateIdx);
}
}
}
void THierarch::GetAncestorV(const int& StateId, TIntFltPrV& StateIdHeightPrV) const {
StateIdHeightPrV.Add(TIntFltPr(StateId, GetStateHeight(StateId)));
int AncestorId = StateId;
do {
AncestorId = GetParentId(AncestorId);
StateIdHeightPrV.Add(TIntFltPr(AncestorId, GetStateHeight(AncestorId)));
} while (!IsRoot(AncestorId));
}
int THierarch::GetAncestorAtHeight(const int& StateId, const double& Height) const {
EAssertR(Height <= MxHeight, "Cannot search for states at height larger than MxHeight!");
EAssert(IsOnHeight(StateId, Height) || IsBelowHeight(StateId, Height));
int AncestorId = StateId;
while (!IsOnHeight(AncestorId, Height)) {
AncestorId = GetParentId(AncestorId);
}
return AncestorId;
}
void THierarch::GetLeafDescendantV(const int& TargetStateId, TIntV& DescendantV) const {
if (IsLeaf(TargetStateId)) {
DescendantV.Add(TargetStateId);
return;
}
const int NStates = HierarchV.Len();
TIntV TempHierarchV(HierarchV);
// for each state compute the oldest ancestor until you hit the target state or root
bool Change;
do {
Change = false;
for (int LeafId = 0; LeafId < NStates; LeafId++) {
if (GetParentId(LeafId, TempHierarchV) != TargetStateId && !IsRoot(GetParentId(LeafId, TempHierarchV), TempHierarchV)) {
GetParentId(LeafId, TempHierarchV) = GetGrandparentId(LeafId, TempHierarchV);
Change = true;
}
}
} while (Change);
// take only the leafs with the target ancestor
for (int LeafId = 0; LeafId < NLeafs; LeafId++) {
if (GetParentId(LeafId, TempHierarchV) == TargetStateId) {
DescendantV.Add(LeafId);
}
}
}
void THierarch::GetCurrStateIdHeightPrV(TIntFltPrV& StateIdHeightPrV) const {
TFltV HeightV; GetUniqueHeightV(HeightV);
for (int i = 0; i < PastStateIdV.Len(); i++) {
const TIntV& PastStateIdVOnH = PastStateIdV[i];
EAssertR(!PastStateIdVOnH.Empty(), "Past state cache empty!");
StateIdHeightPrV.Add(TIntFltPr(PastStateIdVOnH[0], HeightV[i]));
}
}
void THierarch::GetHistStateIdV(const double& Height, TIntV& StateIdV) const {
const int NearestHeightIdx = GetNearestHeightIdx(Height);
const TIntV& HistV = PastStateIdV[NearestHeightIdx];
for (int i = 1; i < HistV.Len(); i++) {
StateIdV.Add(HistV[i]);
}
}
bool THierarch::IsStateNm(const int& StateId) const {
return 0 <= StateId && StateId < HierarchV.Len() && !StateNmV[StateId].Empty();
}
void THierarch::SetStateNm(const int& StateId, const TStr& StateNm) {
EAssertR(0 <= StateId && StateId < StateNmV.Len(), "THierarch::SetStateNm: Invalid state ID!");
StateNmV[StateId] = StateNm;
}
const TStr& THierarch::GetStateNm(const int& StateId) const {
EAssertR(0 <= StateId && StateId < StateNmV.Len(), "THierarch::GetStateNm: Invalid state ID!");
return StateNmV[StateId];
}
void THierarch::SetVerbose(const bool& _Verbose) {
if (_Verbose != Verbose) {
Verbose = _Verbose;
Notify = Verbose ? TNotify::StdNotify : TNotify::NullNotify;
}
}
void THierarch::PrintHierarch() const {
TChA ChA = "";
for (int i = 0; i < HierarchV.Len(); i++) {
ChA += "(" + TInt(i).GetStr() + "," + TInt::GetStr(GetParentId(i)) + "," + TFlt::GetStr(GetStateHeight(i), "%.3f") + ")";
if (i < HierarchV.Len()-1) { ChA += ","; }
}
Notify->OnNotifyFmt(TNotifyType::ntInfo, "Hierarchy: %s", ChA.CStr());
}
int THierarch::GetParentId(const int& StateId) const {
return GetParentId(StateId, HierarchV);
}
int THierarch::GetNearestHeightIdx(const double& Height) const {
// TODO optimize:
// 1) Precompute the unique heights
// 2) use binary search to find the nearest height
TFltV HeightV; GetUniqueHeightV(HeightV);
for (int i = 0; i < HeightV.Len() - 1; i++) {
if (HeightV[i] <= Height && HeightV[i+1] > Height) {
return i;
}
}
return HeightV.Len() - 1;
}
bool THierarch::IsRoot(const int& StateId) const {
return IsRoot(StateId, HierarchV);
}
bool THierarch::IsLeaf(const int& StateId) const {
return StateId < NLeafs;
}
bool THierarch::IsOnHeight(const int& StateId, const double& Height) const {
if (IsRoot(StateId) && Height >= MxHeight) { return true; }
return GetStateHeight(StateId) <= Height && GetStateHeight(GetParentId(StateId)) > Height;
}
bool THierarch::IsBelowHeight(const int& StateId, const double& Height) const {
if (IsOnHeight(StateId, Height)) { return false; }
return GetStateHeight(GetParentId(StateId)) <= Height;
}
bool THierarch::IsAboveHeight(const int& StateId, const double& Height) const {
return !IsOnHeight(StateId, Height) && !IsBelowHeight(StateId, Height);
}
void THierarch::GetAncSuccH(const double& Height, TIntIntVH& StateSubStateH) const {
const int NStates = GetStates();
// build a model on this height
// get all the states on this height
TIntSet StateSet; GetStatesAtHeight(Height, StateSet);
int KeyId = StateSet.FFirstKeyId();
while (StateSet.FNextKeyId(KeyId)) {
StateSubStateH.AddDat(StateSet.GetKey(KeyId), TIntV());
}
// get all the substates of the states on this height
TIntV TempHierarchV(HierarchV);
bool Change;
do {
Change = false;
for (int StateIdx = 0; StateIdx < NStates; StateIdx++) {
if (!StateSet.IsKey(TempHierarchV[StateIdx]) &&
TempHierarchV[StateIdx] != TempHierarchV[TempHierarchV[StateIdx]]) {
TempHierarchV[StateIdx] = TempHierarchV[TempHierarchV[StateIdx]];
Change = true;
}
}
} while (Change);
for (int StateIdx = 0; StateIdx < NLeafs; StateIdx++) {
if (StateSet.IsKey(TempHierarchV[StateIdx])) {
StateSubStateH.GetDat(TempHierarchV[StateIdx]).Add(StateIdx);
}
}
}
int THierarch::GetOldestAncestIdx(const int& StateIdx) const {
int AncestIdx = StateIdx;
while (HierarchV[AncestIdx] != -1) {
AncestIdx = HierarchV[AncestIdx];
}
return AncestIdx;
}
void THierarch::GetLeafSuccesorCountV(TIntV& LeafCountV) const {
const int NStates = GetStates();
LeafCountV.Gen(NStates, NStates);
for (int i = 0; i < NLeafs; i++) {
LeafCountV[i] = 1;
}
TIntV TempHierarchV(HierarchV);
bool Change;
do {
Change = false;
for (int LeafId = 0; LeafId < NLeafs; LeafId++) {
const int AncestorId = GetParentId(LeafId, TempHierarchV);
const int LeafWeight = LeafCountV[LeafId];
LeafCountV[AncestorId] += LeafWeight;
}
for (int LeafId = 0; LeafId < NLeafs; LeafId++) {
// check if the parent is root
if (!IsRoot(GetParentId(LeafId, TempHierarchV), TempHierarchV)) {
GetParentId(LeafId, TempHierarchV) = GetGrandparentId(LeafId, TempHierarchV);
Change = true;
}
}
} while (Change);
}
void THierarch::ComputeStateCoords(const TFullMatrix& CentroidMat, const int& NStates) {
StateCoordV.Gen(NStates, NStates);
TFullMatrix CoordMat = TEuclMds::Project(CentroidMat, 2);
for (int ColIdx = 0; ColIdx < CoordMat.GetCols(); ColIdx++) {
StateCoordV[ColIdx].Val1 = CoordMat(0, ColIdx);
StateCoordV[ColIdx].Val2 = CoordMat(1, ColIdx);
}
// first find out how many ancestors each state has, so you can weight
// the childs coordinates appropriately
TIntV SuccesorCountV; GetLeafSuccesorCountV(SuccesorCountV);
TIntV TempHierarchV(HierarchV);
bool Change;
do {
Change = false;
for (int i = 0; i < NLeafs; i++) {
const int AncestorIdx = TempHierarchV[i];
const int AncestorSize = SuccesorCountV[AncestorIdx];
StateCoordV[AncestorIdx].Val1 += StateCoordV[i].Val1 / AncestorSize;
StateCoordV[AncestorIdx].Val2 += StateCoordV[i].Val2 / AncestorSize;
}
for (int i = 0; i < NLeafs; i++) {
if (TempHierarchV[i] != TempHierarchV[TempHierarchV[i]]) {
TempHierarchV[i] = TempHierarchV[TempHierarchV[i]];
Change = true;
}
}
} while (Change);
}
bool THierarch::IsRoot(const int& StateId, const TIntV& HierarchV) {
return GetParentId(StateId, HierarchV) == StateId;
}
void THierarch::ClrFlds() {
HierarchV.Clr();
StateHeightV.Clr();
MxHeight = TFlt::Mn;
HistCacheSize = 1;
PastStateIdV.Clr();
StateCoordV.Clr();
NLeafs = 0;
}
/////////////////////////////////////////////////////////////////
// Abstract Markov Chain
TMChain::TMChain(const bool& _Verbose):
NStates(-1),
CurrStateId(-1),
HasHiddenState(false),
Verbose(_Verbose),
Notify(_Verbose ? TNotify::StdNotify : TNotify::NullNotify) {}
TMChain::TMChain(TSIn& SIn):
NStates(TInt(SIn)),
CurrStateId(TInt(SIn)),
HasHiddenState(TBool(SIn)),
Verbose(TBool(SIn)),
Notify(nullptr) {
Notify = Verbose ? TNotify::StdNotify : TNotify::NullNotify;
}
void TMChain::Save(TSOut& SOut) const {
GetType().Save(SOut);
TInt(NStates).Save(SOut);
TInt(CurrStateId).Save(SOut);
TBool(HasHiddenState).Save(SOut);
TBool(Verbose).Save(SOut);
}
PMChain TMChain::Load(TSIn& SIn) {
const TStr Type(SIn);
if (Type == "discrete") {
return new TDtMChain(SIn);
} else if (Type == "continuous") {
return new TCtMChain(SIn);
} else {
throw TExcept::New("Invalid type of Markov chain: " + Type, "TMChain::Load");
}
}
void TMChain::Init(const int& _NStates, const TIntV& StateAssignV, const TUInt64V& TmV,
const bool _HasHiddenState, const TBoolV& EndBatchV) {
NStates = _NStates;
HasHiddenState = _HasHiddenState;
Notify->OnNotify(TNotifyType::ntInfo, "Initializing Markov chain ...");
// initialize statistics
InitStats(NStates);
// update states
const uint64 NRecs = TmV.Len();
for (uint64 i = 0; i < NRecs; i++) {
if (i % 10000 == 0) {
Notify->OnNotifyFmt(TNotifyType::ntInfo, TUInt64::GetStr(i).CStr());
}
const bool EndsBatch = HasHiddenState ? bool(EndBatchV[i]) : false;
OnAddRec(StateAssignV[i], TmV[i], true, EndsBatch);
}
Notify->OnNotify(TNotifyType::ntInfo, "Done!");
// PrintStats();
}
void TMChain::OnAddRec(const int& StateId, const uint64& RecTm, const bool UpdateStats, const bool EndsBatch) {
EAssertR(HasHiddenState || !EndsBatch, "Cannot be last in sequence if a hidden state does not exist!");
// call child method
AbsOnAddRec(StateId, RecTm, UpdateStats, EndsBatch);
if (HasHiddenState && EndsBatch) {
CurrStateId = GetHiddenStateId();
} else {
CurrStateId = StateId;
}
}
void TMChain::GetFutureProbV(const TVec<TIntV>& StateSetV, const TIntV& StateIdV,
const int& StateId, const double& Tm, TIntFltPrV& StateIdProbV) const {
const int StateIdx = StateIdV.SearchForw(StateId);
EAssertR(StateIdx >= 0, "TMChain::GetFutureProbV: Could not find target state!");
TVector ProbV = GetFutureProbMat(StateSetV, Tm).GetRow(StateIdx);
for (int i = 0; i < StateIdV.Len(); i++) {
StateIdProbV.Add(TIntFltPr(StateIdV[i], ProbV[i]));
}
}
void TMChain::GetPastProbV(const TVec<TIntV>& StateSetV, const TIntV& StateIdV,
const int& StateId, const double& Tm, TIntFltPrV& StateIdProbV) const {
const int StateIdx = StateIdV.SearchForw(StateId);
EAssertR(StateIdx >= 0, "TMChain::GetFutureProbV: Could not find target state!");
TVector ProbV = GetPastProbMat(StateSetV, Tm).GetRow(StateIdx);
for (int i = 0; i < StateIdV.Len(); i++) {
StateIdProbV.Add(TIntFltPr(StateIdV[i], ProbV[i]));
}
}
void TMChain::SetVerbose(const bool& _Verbose) {
if (_Verbose != Verbose) {
Verbose = _Verbose;
Notify = Verbose ? TNotify::StdNotify : TNotify::NullNotify;
}
}
int TMChain::GetHiddenStateId() const {
return HasHiddenState ? GetStates() : -2;
}
void TMChain::InsHiddenState(TVec<TIntV>& StateSetV) const {
EAssertR(HasHiddenState, "TMChain::InsHiddenState: The model does not have a hidden state!");
StateSetV.Add(TIntV(1, 1));
StateSetV.Last()[0] = GetHiddenStateId();
}
void TMChain::InsHiddenState(TIntV& StateIdV) const {
EAssertR(HasHiddenState, "TMChain::InsHiddenState: The model does not have a hidden state!");
StateIdV.Add(GetHiddenStateId());
}
void TMChain::RemoveHiddenStateProb(TIntFltPrV& StateIdProbV) const {
EAssertR(HasHiddenState, "TMChain::RemoveHiddenStateProb: The model does not have a hidden state!");
const int HiddenStateId = GetHiddenStateId();
for (int i = 0; i < StateIdProbV.Len(); i++) {
if (StateIdProbV[i].Val1 == HiddenStateId) {
StateIdProbV.Del(i);
break;
}
}
}
void TMChain::GetFutureProbVOverTm(const TFullMatrix& PMat, const int& StateIdx,
const int& Steps, TVec<TFltV>& ProbVV, const PNotify& Notify, const bool IncludeT0) {
TFullMatrix CurrentMat = TFullMatrix::Identity(PMat.GetRows());
TVector ProbV = CurrentMat.GetRow(StateIdx);
if (IncludeT0) {
ProbVV.Add(ProbV.Vec);
}
for (int i = 0; i < Steps; i++) {
if (i % 100 == 0) {
Notify->OnNotifyFmt(TNotifyType::ntInfo, "steps: %d", i);
}
// increase time
CurrentMat = CurrentMat * PMat;
ProbV = CurrentMat.GetRow(StateIdx);
// normalize to minimize the error
ProbV /= ProbV.Sum();
// add to result
ProbVV.Add(ProbV.Vec);
}
}
/////////////////////////////////////////////////////////////////
// Discrete time Markov Chain
TDtMChain::TDtMChain(const bool& _Verbose):
TMChain(_Verbose),
JumpCountMat() {}
TDtMChain::TDtMChain(TSIn& SIn):
TMChain(SIn),
JumpCountMat() {
JumpCountMat.Load(SIn);
}
void TDtMChain::Save(TSOut& SOut) const {
TMChain::Save(SOut);
JumpCountMat.Save(SOut);
}
void TDtMChain::GetNextStateProbV(const TVec<TIntV>& JoinedStateVV, const TIntV& StateIdV,
const int& StateId, TIntFltPrV& StateIdProbV, const int& NFutStates) const {
const int NFStates = TMath::Mn(NFutStates, JoinedStateVV.Len()-1);
const int StateIdx = StateIdV.SearchForw(StateId);
EAssertR(StateIdx >= 0, "TDtMChain::GetNextStateProbV: Could not find target state!");
TVector ProbVec = GetTransitionMat(JoinedStateVV).GetRow(StateIdx);
// TODO can be optimized
TIntSet TakenIdxSet;
double MxProb;
int MxIdx;
for (int i = 0; i < NFStates; i++) {
MxProb = TFlt::Mn;
MxIdx = -1;
for (int j = 0; j < ProbVec.Len(); j++) {
if (j != StateIdx && !TakenIdxSet.IsKey(j) && ProbVec[j] > MxProb) {
MxProb = ProbVec[j];
MxIdx = j;
}
}
// if we exclude the current state than the probability that j will be the future state
// is sum_{k=0}^{inf} p_{ii}^k*P_{ij} = p_{ij} / (1 - p_{ii})
const double Prob = ProbVec[MxIdx] / (1 - ProbVec[StateIdx]);
if (Prob <= 0) { break; }
TakenIdxSet.AddKey(MxIdx);
StateIdProbV.Add(TIntFltPr(StateIdV[MxIdx], Prob));
}
}
void TDtMChain::GetPrevStateProbV(const TVec<TIntV>& JoinedStateVV, const TIntV& StateIdV,
const int& StateId, TIntFltPrV& StateIdProbV, const int& NPrevStates) const {
throw TExcept::New("TDtMChain::GetNextStateProbV: Not implemented!!!", "TDtMChain::GetNextStateProbV");
}
TFullMatrix TDtMChain::GetTransitionMat(const TVec<TIntV>& JoinedStateVV) const {
TFullMatrix Result(JoinedStateVV.Len(), JoinedStateVV.Len());
const TFullMatrix PMat = GetTransitionMat();
const TVector StatDist = GetStatDist();
for (int JoinState1Idx = 0; JoinState1Idx < JoinedStateVV.Len(); JoinState1Idx++) {
const TIntV& JoinState1 = JoinedStateVV[JoinState1Idx];
for (int JoinState2Idx = 0; JoinState2Idx < JoinedStateVV.Len(); JoinState2Idx++) {
const TIntV& JoinState2 = JoinedStateVV[JoinState2Idx];
// the transition probability from set Ai to Aj can be
// calculated as: p_{A_i,A_j} = \frac {\sum_{k \in A_i} \pi_k * \sum_{l \in A_j} p_{k,l}} {\sum_{k \in A_i} \pi_k}
TFlt Sum = 0, SumP = 0;
for (int k = 0; k < JoinState1.Len(); k++) {
const int StateK = JoinState1[k];
double SumK = 0;
for (int l = 0; l < JoinState2.Len(); l++) {
const int StateL = JoinState2[l];
SumK += PMat(StateK,StateL);
}
Sum += StatDist[JoinState1[k]]*SumK;
SumP += StatDist[JoinState1[k]];
}
Result(JoinState1Idx, JoinState2Idx) = Sum / SumP;
}
}
return Result;
}
bool TDtMChain::IsAnomalousJump(const int& NewStateId, const int& OldStateId) const {
return JumpCountMat(OldStateId, NewStateId) == 0.0;
}
void TDtMChain::InitStats(const int& NStates) {
JumpCountMat = TFullMatrix(NStates, NStates);
}
void TDtMChain::AbsOnAddRec(const int& StateId, const uint64& RecTm, const bool UpdateStats, const bool IsLastInSeq) {
// update jump stats
if (UpdateStats && CurrStateId != -1) {
JumpCountMat(CurrStateId, StateId)++;
}
if (StateId != CurrStateId) {
Notify->OnNotifyFmt(TNotifyType::ntInfo, "Jumped to state %d", StateId);
}
}
TFullMatrix TDtMChain::GetFutureProbMat(const TVec<TIntV>& JoinedStateVV, const double& TimeSteps) const {
const int Steps = (int) TimeSteps;
EAssertR(Steps >= 0, "Probs for past states not implemented!");
return GetTransitionMat(JoinedStateVV)^Steps;
}
TFullMatrix TDtMChain::GetPastProbMat(const TVec<TIntV>& JoinedStateVV, const double& TimeSteps) const {
throw TExcept::New("GetPastProbMat: Not implemented!!!");
}
TFullMatrix TDtMChain::GetTransitionMat() const {
TFullMatrix Result(NStates, NStates);
#pragma omp for
for (int RowIdx = 0; RowIdx < NStates; RowIdx++) {
double Count = JumpCountMat.RowSum(RowIdx);
for (int ColIdx = 0; ColIdx < NStates; ColIdx++) {
Result(RowIdx, ColIdx) = JumpCountMat(RowIdx, ColIdx) / Count;
}
}
return Result;
}
TVector TDtMChain::GetStatDist(const TFullMatrix& PMat) {
if (PMat.Empty()) { return TVector(0); }
TVector EigenVec(PMat.GetRows());
TNumericalStuff::GetEigenVec(PMat.GetT().GetMat(), 1.0, EigenVec.Vec);
return EigenVec /= EigenVec.Sum();
}
/////////////////////////////////////////////////////////////////
// Continous time Markov Chain
const uint64 TCtMChain::TU_SECOND = 1000;
const uint64 TCtMChain::TU_MINUTE = TU_SECOND*60;
const uint64 TCtMChain::TU_HOUR = TU_MINUTE*60;
const uint64 TCtMChain::TU_DAY = TU_HOUR*24;
const uint64 TCtMChain::TU_MONTH = 365.25 * TU_DAY / 12;
const double TCtMChain::MIN_JUMP_TM = 1e-2;
const double TCtMChain::HIDDEN_STATE_INTENSITY = 1 / MIN_JUMP_TM;
TCtMChain::TCtMChain(const uint64& _TimeUnit, const double& _DeltaTm, const bool& _Verbose):
TMChain(_Verbose),
QMatStats(),
DeltaTm(_DeltaTm),
TimeUnit(_TimeUnit),
PrevJumpTm(-1) {}
TCtMChain::TCtMChain(TSIn& SIn):
TMChain(SIn),
QMatStats(),
DeltaTm(0),
TimeUnit(0),
PrevJumpTm(0) {
QMatStats.Load(SIn);
DeltaTm = TFlt(SIn);
TimeUnit = TUInt64(SIn);
PrevJumpTm = TUInt64(SIn);
}
void TCtMChain::Save(TSOut& SOut) const {
TMChain::Save(SOut);
QMatStats.Save(SOut);
TFlt(DeltaTm).Save(SOut);
TUInt64(TimeUnit).Save(SOut);
TUInt64(PrevJumpTm).Save(SOut);
}
void TCtMChain::GetNextStateProbV(const TVec<TIntV>& StateSetV, const TIntV& ExtStateIdV,
const int& StateId, TIntFltPrV& StateIdProbV, const int& NFutStates) const {
TIntV StateIdV(ExtStateIdV);
if (HasHiddenState) {
InsHiddenState(StateIdV);
}
GetNextStateProbV(GetQMatrix(StateSetV), StateIdV, StateId, StateIdProbV, NFutStates, Notify);
if (HasHiddenState) {
RemoveHiddenStateProb(StateIdProbV);
}
}
void TCtMChain::GetPrevStateProbV(const TVec<TIntV>& StateSetV, const TIntV& ExtStateIdV,
const int& StateId, TIntFltPrV& StateIdProbV, const int& NFutStates) const {
TIntV StateIdV(ExtStateIdV);
if (HasHiddenState) {
InsHiddenState(StateIdV);
}
GetNextStateProbV(GetRevQMatrix(StateSetV), StateIdV, StateId, StateIdProbV, NFutStates, Notify);
if (HasHiddenState) {
RemoveHiddenStateProb(StateIdProbV);
}
}
void TCtMChain::GetProbVOverTm(const double& Height, const int& StateId, const double& StartTm, const double EndTm,
const double& DeltaTm, const TVec<TIntV>& StateSetV, const TIntV& StateIdV, TVec<TFltV>& FutProbVV, TVec<TFltV>& PastProbVV) const {
const int StateIdx = StateIdV.SearchForw(StateId);
EAssertR(StateIdx >= 0, "Could not find target state!");
EAssertR(StartTm <= 0 && EndTm >= 0, "The start and end times should include the current time!");
const int FutureSteps = ceil(EndTm / DeltaTm);
const TFullMatrix FutProbMat = GetFutureProbMat(StateSetV, DeltaTm);
GetFutureProbVOverTm(FutProbMat, StateIdx, FutureSteps, FutProbVV, Notify);
if (StartTm < 0) {
const int PastSteps = ceil(-StartTm / DeltaTm);
const TFullMatrix PastProbMat = GetPastProbMat(StateSetV, DeltaTm);
GetFutureProbVOverTm(PastProbMat, StateIdx, PastSteps, PastProbVV, Notify, false);
}
}
TVector TCtMChain::GetStatDist(const TVec<TIntV>& StateSetV) const {
TVector StaticDist = GetStatDist(GetQMatrix(StateSetV), Notify);
if (HasHiddenState) {
StaticDist.DelLast();
StaticDist /= StaticDist.Sum();
}
return StaticDist;
}
TVector TCtMChain::GetStateSizeV(const TVec<TIntV>& JoinedStateVV) const {
// return GetHoldingTimeV(GetQMatrix(JoinedStateVV));
return GetStatDist(JoinedStateVV);
}
TFullMatrix TCtMChain::GetTransitionMat(const TVec<TIntV>& StateSetV) const {
return GetJumpMatrix(StateSetV);
}
TFullMatrix TCtMChain::GetJumpMatrix(const TVec<TIntV>& StateSetV) const {
TFullMatrix JumpMat = GetJumpMatrix(GetQMatrix(StateSetV));
if (HasHiddenState) {
JumpMat = JumpMat(TVector::Range(JumpMat.GetRows()-1), TVector::Range(JumpMat.GetCols()-1));
// JumpMat.NormalizeRowsL1(); TODO
return JumpMat;
} else {
return JumpMat;
}
}
TVector TCtMChain::GetHoldingTimeV(const TVec<TIntV>& StateSetV) const {
TVector HoldingTmV = GetHoldingTimeV(GetQMatrix(StateSetV));
if (HasHiddenState) {
HoldingTmV.DelLast();
}
return HoldingTmV;
}
bool TCtMChain::IsAnomalousJump(const int& NewStateId, const int& OldStateId) const {
return QMatStats[OldStateId][NewStateId].Val1 == 0;
}
void TCtMChain::InitStats(const int& NStates) {
// initialize a matrix holding the number of measurements and the sum
// if we get separate sequences than we need to add a hidden state, which will be the last
// state in the Q matrix. This state will immediately jump to the next state
const int States = HasHiddenState ? NStates + 1 : NStates;
QMatStats.Gen(States, 0);
for (int i = 0; i < States; i++) {
QMatStats.Add(TUInt64FltPrV(States, States));
}
}
void TCtMChain::AbsOnAddRec(const int& StateId, const uint64& RecTm, const bool UpdateStats, const bool EndsBatch) {
EAssertR(HasHiddenState || !EndsBatch, "Cannot process batches with no hidden state!");
// warn if times don't aren't ascending
if (CurrStateId != -1 && RecTm < PrevJumpTm && (!HasHiddenState || CurrStateId != GetHiddenStateId())) { // got past time, do not update the statistics
TNotify::StdNotify->OnNotifyFmt(TNotifyType::ntWarn, "Current time smaller that previous time curr: %ld, prev: %ld", RecTm, PrevJumpTm);
PrevJumpTm = RecTm;
return;
}
// update intensities
if (UpdateStats && CurrStateId != -1 && StateId != CurrStateId /*&&
(!HasHiddenState || CurrStateId != GetHiddenStateId())*/) { // the state has changed
UpdateIntensity(CurrStateId, StateId, RecTm - PrevJumpTm);
}
if (StateId != CurrStateId) { PrevJumpTm = RecTm; }
if (HasHiddenState && EndsBatch) {
UpdateIntensity(StateId, GetHiddenStateId(), RecTm - PrevJumpTm);
}
}
TFullMatrix TCtMChain::GetFutureProbMat(const TVec<TIntV>& StateSetV, const double& Tm) const {
return GetFutureProbMat(GetQMatrix(StateSetV), Tm, DeltaTm, HasHiddenState);
}
TFullMatrix TCtMChain::GetPastProbMat(const TVec<TIntV>& StateSetV, const double& Tm) const {
return GetFutureProbMat(GetRevQMatrix(StateSetV), Tm, DeltaTm, HasHiddenState);
}
void TCtMChain::PrintStats() const {
TChA ChA;
for (int i = 0; i < QMatStats.Len(); i++) {
for (int j = 0; j < QMatStats[i].Len(); j++) {
ChA += TStr::Fmt("(%ld, %.16f)", QMatStats[i][j].Val1.Val, QMatStats[i][j].Val2.Val);
if (j < QMatStats[i].Len()-1) {
ChA += ",";
}
}
ChA += "\n";
}
Notify->OnNotifyFmt(TNotifyType::ntInfo, "QMatrix statistics:\n%s", ChA.CStr());
}
TFullMatrix TCtMChain::GetQMatrix() const {
// compute the intensities
const int NStates = QMatStats.Len();
PrintStats();
printf("\n\nQMatrix statistics:\n");
// Q-matrix: holds jump intensities
TFullMatrix QMatrix(NStates, NStates);
for (int i = 0; i < NStates; i++) {
for (int j = 0; j < NStates; j++) {
printf("(%ld,%.3f)", QMatStats[i][j].Val1.Val, QMatStats[i][j].Val2.Val);
if (j != i) {
const uint64 N = QMatStats[i][j].Val1;
const double Sum = QMatStats[i][j].Val2;
QMatrix(i,j) = N > 0 ? N / Sum : 0;
}
}
printf("\n");
const double Q_ii = -QMatrix.RowSum(i);
EAssertR(Q_ii != 0, "Q_ii has a zero row!");
QMatrix(i,i) = Q_ii;
}
printf("\n");
return QMatrix;
}
TFullMatrix TCtMChain::GetQMatrix(const TVec<TIntV>& InStateSetV) const {
Notify->OnNotifyFmt(TNotifyType::ntInfo, "Computing joined Q matrix for %d states ...", InStateSetV.Len());
TVec<TIntV> StateSetV(InStateSetV);
if (HasHiddenState) {
InsHiddenState(StateSetV);
}
const int NStates = StateSetV.Len();
TFullMatrix JoinedQMat(NStates, NStates);
const TFullMatrix QMat = GetQMatrix();
const TVector StatDist = GetStatDist(QMat, Notify);
printf("Static distribution:\n%s\n", TStrUtil::GetStr(StatDist.Vec, ", ", "%.15f").CStr());
for (int JoinState1Idx = 0; JoinState1Idx < NStates; JoinState1Idx++) {
const TIntV& JoinState1 = StateSetV[JoinState1Idx];
for (int JoinState2Idx = 0; JoinState2Idx < NStates; JoinState2Idx++) {
if (JoinState1Idx == JoinState2Idx) { continue; }
const TIntV& JoinState2 = StateSetV[JoinState2Idx];
// the transition probability from set Ai to Aj can be
// calculated as: q_{A_i,A_j} = \frac {\sum_{k \in A_i} \pi_k * \sum_{l \in A_j} q_{k,l}} {\sum_{k \in A_i} \pi_k}
double Sum = 0, SumP = 0;
for (int k = 0; k < JoinState1.Len(); k++) {
const int StateK = JoinState1[k];
const double PiK = StatDist[JoinState1[k]];
double SumK = 0;
for (int l = 0; l < JoinState2.Len(); l++) {
const int StateL = JoinState2[l];
const double Q_kl = QMat(StateK,StateL);
SumK += Q_kl;
}
Sum += PiK*SumK;
SumP += PiK;
}
JoinedQMat(JoinState1Idx, JoinState2Idx) = Sum / SumP;
}
const double Q_ii = -JoinedQMat.RowSum(JoinState1Idx);
EAssertR(Q_ii != 0, "Joined QMatrix has zero on diagonal!");
JoinedQMat(JoinState1Idx, JoinState1Idx) = Q_ii;
}
printf("Joined Q matrix:\n%s\n", TStrUtil::GetStr(JoinedQMat.GetMat(), ", ", "%.3f").CStr());
return JoinedQMat;
}
TFullMatrix TCtMChain::GetRevQMatrix(const TVec<TIntV>& StateSetV) const {
const int n = StateSetV.Len();
const TFullMatrix QMat = GetQMatrix(StateSetV);
const TVector StatDist = GetStatDist(QMat, Notify);
TFullMatrix QRev(n,n);
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
QRev(j,i) = QMat(i,j) * StatDist[i] / StatDist[j];
}
}
return QRev;
}
TVector TCtMChain::GetHoldingTimeV(const TFullMatrix& QMat) const {
const int Rows = QMat.GetRows();
TVector HoldTmV(Rows);
for (int i = 0; i < Rows; i++) {
HoldTmV[i] = -1 / QMat(i,i);
}
return HoldTmV;
}
void TCtMChain::UpdateIntensity(const int& FromStateId, const int& ToStateId, const double& Tm) {
EAssertR(HasHiddenState || FromStateId != GetHiddenStateId(), "Cannot model hidden state if deactivated!");
if (HasHiddenState && FromStateId == GetHiddenStateId()) {
QMatStats[FromStateId][ToStateId].Val1 = 1;
QMatStats[FromStateId][ToStateId].Val2 = 1 / HIDDEN_STATE_INTENSITY;
Notify->OnNotifyFmt(TNotifyType::ntInfo, "Updated intensity from the hidden state to %d", ToStateId);
} else {
const double CorrTm = TMath::Mx(Tm / TimeUnit, MIN_JUMP_TM);
QMatStats[FromStateId][ToStateId].Val1++;
QMatStats[FromStateId][ToStateId].Val2 += CorrTm;
Notify->OnNotifyFmt(TNotifyType::ntInfo, "Updated intensity: prev state: %d, curr state: %d, time: %.16f", FromStateId, ToStateId, CorrTm);
}
}
void TCtMChain::GetNextStateProbV(const TFullMatrix& QMat, const TIntV& StateIdV,
const int& StateId, TIntFltPrV& StateIdProbV, const int& NFutStates, const PNotify& Notify) {
const int Dim = QMat.GetRows();
const int NFStates = TMath::Mn(NFutStates, Dim-1);
const int StateIdx = StateIdV.SearchForw(StateId);
EAssertR(StateIdx >= 0, "TCtMChain::GetNextStateProbV: Could not find target state!");
Notify->OnNotify(TNotifyType::ntInfo, "Fetching future states ...");
const TFullMatrix JumpMat = GetJumpMatrix(QMat);
const TVector ProbVec = JumpMat.GetRow(StateIdx);
// TODO can be optimized
TIntSet TakenIdxSet;
double MxProb;
int MxIdx;
for (int i = 0; i < NFStates; i++) {
MxProb = TFlt::Mn;
MxIdx = -1;
for (int j = 0; j < ProbVec.Len(); j++) {
if (j != StateIdx && !TakenIdxSet.IsKey(j) && ProbVec[j] > MxProb) {
MxProb = ProbVec[j];
MxIdx = j;
}
}
if (ProbVec[MxIdx] <= 0) { break; }
TakenIdxSet.AddKey(MxIdx);
StateIdProbV.Add(TIntFltPr(StateIdV[MxIdx], MxProb));
}
}
TVector TCtMChain::GetStatDist(const TFullMatrix& QMat, const PNotify& Notify) {
Notify->OnNotifyFmt(TNotifyType::ntInfo, "Computing static distribution of %d states ...", QMat.GetRows());
// THE PROPER WAY
// returns the stationary distribution
// pi*Q = 0
TVector EigenVec(QMat.GetRows(), false);
TNumericalStuff::GetEigenVec(QMat.GetT().GetMat(), 0.0, EigenVec.Vec);
const double EigSum = EigenVec.Sum();
EAssertR(EigSum != 0, "Eigenvector should not be 0, norm is " + TFlt::GetStr(EigenVec.Norm()) + "!");
EAssertR(!TFlt::IsNan(EigSum), "NaNs in eigenvector!");
// // THE INPROPER WAY TODO use the proper way, once linalg is fixed
//
// // Norris: Markov Chains states:
// // Let Q be a Q-matrix with jump matrix Pi and let lambda be a measure,
// // than the following are equivalent
// // 1) lambda is invariant
// // 2) mu*Pi = mu where mu_i = lambda_i / q_i, where q_i = -q_ii
//
//
//
// TFullMatrix JumpMat = GetJumpMatrix(QMat);
//
// // find the eigenvector of the jump matrix with eigen value 1
// TVector EigenVec(QMat.GetRows(), false);
// TNumericalStuff::GetEigenVec(JumpMat.GetT().GetMat(), 1.0, EigenVec.Vec);
//
// // divide the elements by q_i
// for (int i = 0; i < QMat.GetRows(); i++) {
// EigenVec[i] /= -QMat(i,i);
// }
//
// const double EigSum = EigenVec.Sum();
//
// EAssertR(EigSum != 0, "Eigenvector should not be 0, norm is " + TFlt::GetStr(EigenVec.Norm()) + "!");
// EAssertR(!TFlt::IsNan(EigSum), "NaNs in eigenvector!");
//===========================================================
// TODO remove this assertion after you know this works
const double PiQNorm = (EigenVec * QMat).Norm();
EAssertR(PiQNorm < 1e-3, "This is not an eigenvector with eigenvalue 0");
//===========================================================
// normalize to get a distribution
return EigenVec /= EigSum;
}
TFullMatrix TCtMChain::GetFutureProbMat(const TFullMatrix& QMat, const double& Tm,
const double& DeltaTm, const bool HasHiddenState) {
EAssertR(Tm >= 0, "TCtMChain::GetFutureProbMat: does not work for negative time!");
const int Dim = QMat.GetRows();
if (Tm == 0) { return TFullMatrix::Identity(Dim); }
const double QMatNorm = QMat.FromNorm();
const double Dt = TMath::Mn(DeltaTm / QMatNorm, DeltaTm);
const int Steps = (int) ceil(Tm / Dt);
TFullMatrix ProbMat = TFullMatrix::Identity(Dim) + QMat*Dt;
// the probabilities from state i to the hidden state should now go from i to i
if (HasHiddenState) {
const int Dim = ProbMat.GetRows()-1;
TFullMatrix CorrProbMat = ProbMat(TVector::Range(Dim), TVector::Range(Dim));
for (int RowIdx = 0; RowIdx < Dim; RowIdx++) {
const double HiddenProb = ProbMat(RowIdx, Dim);
CorrProbMat(RowIdx, RowIdx) += HiddenProb;
}
ProbMat = CorrProbMat;
}
return ProbMat^Steps;
}
TFullMatrix TCtMChain::GetJumpMatrix(const TFullMatrix& QMat) {
const int Rows = QMat.GetRows();
const int Cols = QMat.GetCols();
TFullMatrix JumpMat(Rows, Cols);
printf("\n\n%s\n", TStrUtil::GetStr(QMat.GetMat()).CStr());
double Q_ij, Q_ii, J_ij;
for (int i = 0; i < Rows; i++) {
if (QMat(i,i) == 0.0) {
JumpMat(i,i) = 1;
} else {
for (int j = 0; j < Cols; j++) {
if (j != i) {
Q_ij = QMat(i,j);
Q_ii = -QMat(i,i);
J_ij = Q_ij / Q_ii;
EAssertR(!TFlt::IsNan(J_ij), "Jump matrix contains nan on indexes " + TInt::GetHexStr(i) +", " + TInt::GetStr(j));
JumpMat(i,j) = J_ij;
}
}
}
}
return JumpMat;
}
////////////////////////////////////////////////
// State assistant
TStateAssist::TStateAssist(const bool _Verbose):
ClassifyV(),
Rnd(1),
Verbose(_Verbose),
Notify(_Verbose ? TNotify::StdNotify : TNotify::NullNotify) {}
TStateAssist::TStateAssist(TSIn& SIn):
ClassifyV(SIn),
Rnd(SIn),
Verbose(TBool(SIn)) {
Notify = Verbose ? TNotify::StdNotify : TNotify::NullNotify;
}
void TStateAssist::Save(TSOut& SOut) const {
ClassifyV.Save(SOut);
Rnd.Save(SOut);
TBool(Verbose).Save(SOut);
}
void TStateAssist::Init(const TFullMatrix& X, const PFullClust& Clust, const PHierarch& Hierarch) {
// get all the heights from the hierarchy
TIntFltPrV StateIdHeightPrV; Hierarch->GetStateIdHeightPrV(StateIdHeightPrV);
TVector AssignV = Clust->Assign(X);
Notify->OnNotifyFmt(TNotifyType::ntInfo, "Computing state assist, total states %d ...", StateIdHeightPrV.Len());
for (int i = 0; i < StateIdHeightPrV.Len(); i++) {
const TIntFltPr& StateIdHeightPr = StateIdHeightPrV[i];
const int StateId = StateIdHeightPr.Val1;
const double Height = StateIdHeightPr.Val2;
ClassifyV.Add(TLogReg(10), true);
Notify->OnNotifyFmt(TNotifyType::ntInfo, "Computing state assist for state %d ...", StateId);
TIntV StateIdV; TVec<TIntV> StateSetV;
Hierarch->GetStateSetsAtHeight(Height, StateIdV, StateSetV);
const int StateIdx = StateIdV.SearchForw(StateId);
EAssertR(StateIdx >= 0, "Could not find the target state!");
const TIntSet TargetStateSet(StateSetV[StateIdx]);
TIntV TargetIdxV; AssignV.Find([&](const TFlt& StateId) { return TargetStateSet.IsKey(TInt(StateId)); }, TargetIdxV);
TIntV NonTargetIdxV; AssignV.Find([&](const TFlt& StateId) { return !TargetStateSet.IsKey(TInt(StateId)); }, NonTargetIdxV);
if (TargetIdxV.Len() == 0 || NonTargetIdxV.Len() == 0) continue;
// make the sets equally sized
if (NonTargetIdxV.Len() > TargetIdxV.Len()) {
NonTargetIdxV.Shuffle(Rnd);
NonTargetIdxV.Trunc(TargetIdxV.Len());
} else if (TargetIdxV.Len() > NonTargetIdxV.Len()) {
TargetIdxV.Shuffle(Rnd);
TargetIdxV.Trunc(NonTargetIdxV.Len());
}
// get the instances
TFullMatrix PosInstMat = X(TVector::Range(X.GetRows()), TargetIdxV);
TFullMatrix NegInstMat = X(TVector::Range(X.GetRows()), NonTargetIdxV);
TFltVV InstanceMat(X.GetRows(), PosInstMat.GetCols() + NegInstMat.GetCols());
TFltV y(PosInstMat.GetCols() + NegInstMat.GetCols(), PosInstMat.GetCols() + NegInstMat.GetCols());
for (int ColIdx = 0; ColIdx < PosInstMat.GetCols(); ColIdx++) {
for (int RowIdx = 0; RowIdx < X.GetRows(); RowIdx++) {
InstanceMat(RowIdx, ColIdx) = PosInstMat(RowIdx, ColIdx);
}
y[ColIdx] = 1;
}
for (int ColIdx = 0; ColIdx < NegInstMat.GetCols(); ColIdx++) {
for (int RowIdx = 0; RowIdx < X.GetRows(); RowIdx++) {
InstanceMat(RowIdx, PosInstMat.GetCols() + ColIdx) = NegInstMat(RowIdx, ColIdx);
}
y[PosInstMat.GetCols() + ColIdx] = 0;
}
// TODO include the intercept
ClassifyV.Last().Fit(InstanceMat, y);
}
}
void TStateAssist::GetSuggestFtrs(const int& StateId, TFltV& WgtV) const {
EAssertR(0 <= StateId && StateId < ClassifyV.Len(), "Invalid state ID!");
const TLogReg& Classify = ClassifyV[StateId];
Classify.GetWgtV(WgtV);
}
/////////////////////////////////////////////////////////////////
// Hierarchical continous time Markov Chain
THierarchCtmc::THierarchCtmc():
Clust(nullptr),
MChain(nullptr),
Hierarch(nullptr),
StateAssist(nullptr),
Verbose(true),
Callback(nullptr),
Notify(nullptr) {}
THierarchCtmc::THierarchCtmc(const PFullClust& _Clust, const PMChain& _MChain,
const PHierarch& _Hierarch, const bool& _Verbose):
Clust(_Clust),
MChain(_MChain),
Hierarch(_Hierarch),
StateAssist(new TStateAssist(_Verbose)),
Verbose(_Verbose),
Callback(nullptr),
Notify(_Verbose ? TNotify::StdNotify : TNotify::NullNotify) {
}
THierarchCtmc::THierarchCtmc(TSIn& SIn):
Clust(TFullClust::Load(SIn)),
MChain(TMChain::Load(SIn)),
Hierarch(THierarch::Load(SIn)),
// StateAssist(new TStateAssist(true)),//StateAssist(StateAssist::Load(SIn)), FIXME
StateAssist(new TStateAssist(SIn)), // TODO
Verbose(TBool(SIn)),
Callback(nullptr),
Notify() {
Notify = Verbose ? TNotify::StdNotify : TNotify::NullNotify;
}
void THierarchCtmc::Save(TSOut& SOut) const {
Notify->OnNotify(TNotifyType::ntInfo, "THierarchCtmc::Save: saving to stream ...");
Clust->Save(SOut);
MChain->Save(SOut);
Hierarch->Save(SOut);
StateAssist->Save(SOut);
TBool(Verbose).Save(SOut);
}
PJsonVal THierarchCtmc::SaveJson() const {
Notify->OnNotify(TNotifyType::ntInfo, "THierarchCtmc::SaveJson: saving JSON ...");
PJsonVal Result = TJsonVal::NewArr();
// we need to build a hierarchy and model state transitions
// on each level of the hierarchy
// variables
TVec<TIntV> StateSetV;
TIntV StateIdV;
TIntFltPrV StateIdProbPrV;
Hierarch->PrintHierarch();
TFltV UniqueHeightV; Hierarch->GetUniqueHeightV(UniqueHeightV);
// go through all the heights except the last one, which is not interesting
// since it is only one state
for (int HeightIdx = 0; HeightIdx < UniqueHeightV.Len()-1; HeightIdx++) {
const double CurrHeight = UniqueHeightV[HeightIdx];
PJsonVal LevelJsonVal = TJsonVal::NewObj();
StateIdV.Clr();
StateSetV.Clr();
StateIdProbPrV.Clr();
// get the states on this level
Hierarch->GetStateSetsAtHeight(CurrHeight, StateIdV, StateSetV);
// ok, now that I have all the states I need their expected staying times
// and transition probabilities
// iterate over all the parent states and get the joint staying times of their
// chindren
TFullMatrix TransitionMat = MChain->GetTransitionMat(StateSetV);
TVector StateSizeV = MChain->GetStateSizeV(StateSetV).Map([&](const TFlt& Val) { return Val*(CurrHeight + .1); });
TVector HoldingTimeV = MChain->GetHoldingTimeV(StateSetV);
// construct state JSON
PJsonVal StateJsonV = TJsonVal::NewArr();
for (int i = 0; i < StateIdV.Len(); i++) {
const int StateId = StateIdV[i];
const TFltPr& StateCoords = Hierarch->GetStateCoords(StateId);
PJsonVal StateJson = TJsonVal::NewObj();
StateJson->AddToObj("id", StateId);
StateJson->AddToObj("x", StateCoords.Val1);
StateJson->AddToObj("y", StateCoords.Val2);
StateJson->AddToObj("size", StateSizeV[i]);
StateJson->AddToObj("holdingTime", HoldingTimeV[i]);
if (Hierarch->IsStateNm(StateId)) {
StateJson->AddToObj("name", Hierarch->GetStateNm(StateId));
}
StateJsonV->AddToArr(StateJson);
}
// construct tansition JSON
PJsonVal JumpMatJson = TJsonVal::NewArr();
for (int RowIdx = 0; RowIdx < TransitionMat.GetRows(); RowIdx++) {
PJsonVal RowJson = TJsonVal::NewArr();
for (int ColIdx = 0; ColIdx < TransitionMat.GetCols(); ColIdx++) {
RowJson->AddToArr(TransitionMat(RowIdx, ColIdx));
}
JumpMatJson->AddToArr(RowJson);
}
LevelJsonVal->AddToObj("height", CurrHeight);
LevelJsonVal->AddToObj("states", StateJsonV);
LevelJsonVal->AddToObj("transitions", JumpMatJson);
Result->AddToArr(LevelJsonVal);
}
return Result;
}
void THierarchCtmc::Init(const TFullMatrix& X, const TUInt64V& RecTmV) {
InitClust(X);
InitMChain(X, RecTmV, false, TBoolV());
InitHierarch();
InitStateAssist(X);
}
void THierarchCtmc::InitBatches(const TFullMatrix& X, const TUInt64V& RecTmV,
const TBoolV& BatchEndV) {
CheckBatches(BatchEndV);
InitClust(X);
InitMChain(X, RecTmV, true, BatchEndV);
InitHierarch();
InitStateAssist(X);
}
void THierarchCtmc::InitClust(const TFullMatrix& X) {
Clust->Init(X);
}
void THierarchCtmc::InitMChain(const TFullMatrix& X, const TUInt64V& RecTmV,
const bool IsBatchData, const TBoolV& EndBatchV) {
TIntV AssignV; Clust->Assign(X, AssignV);
MChain->Init(Clust->GetClusts(), AssignV, RecTmV, IsBatchData, EndBatchV);
}
void THierarchCtmc::InitHierarch() {
Hierarch->Init(Clust->GetCentroidMat(), MChain->GetCurrStateId());
}
void THierarchCtmc::InitHistograms(TFltVV& InstMat) {
Clust->InitHistogram(TFullMatrix(InstMat, true));
}
void THierarchCtmc::InitStateAssist(const TFullMatrix& X) {
StateAssist->Init(X, Clust, Hierarch);
}
void THierarchCtmc::OnAddRec(const uint64 RecTm, const TFltV& Rec) {
TVector FtrVec(Rec); // TODO copying
const int OldStateId = MChain->GetCurrStateId();
const int NewStateId = Clust->Assign(FtrVec);
DetectAnomalies(OldStateId, NewStateId, FtrVec);
if (NewStateId != -1) {
MChain->OnAddRec(NewStateId, RecTm, false, false);
if (NewStateId != OldStateId && Callback != nullptr) {
Hierarch->UpdateHistory(NewStateId);
TIntFltPrV CurrStateV; GetCurrStateAncestry(CurrStateV);
Callback->OnStateChanged(CurrStateV);
}
}
}
void THierarchCtmc::GetFutStateProbV(const double& Height, const int& StateId, const double& Tm,
TIntFltPrV& StateIdProbPrV) const {
EAssertR(Tm >= 0, "Time should be greater than 0!");
try {
TVec<TIntV> JoinedStateVV;
TIntV StateIdV;
Hierarch->GetStateSetsAtHeight(Height, StateIdV, JoinedStateVV);
MChain->GetFutureProbV(JoinedStateVV, StateIdV, StateId, Tm, StateIdProbPrV);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarchCtmc::GetFutStateProbs: Failed to compute future state probabilities: %s", Except->GetMsgStr().CStr());
throw Except;
}
}
void THierarchCtmc::GetPastStateProbV(const double& Height, const int& StateId, const double& Tm,
TIntFltPrV& StateIdProbPrV) const {
try {
TVec<TIntV> StateSetV;
TIntV StateIdV;
Hierarch->GetStateSetsAtHeight(Height, StateIdV, StateSetV);
MChain->GetPastProbV(StateSetV, StateIdV, StateId, Tm, StateIdProbPrV);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarchCtmc::GetPastStateProbV: Failed to compute past state probabilities: %s", Except->GetMsgStr().CStr());
throw Except;
}
}
void THierarchCtmc::GetNextStateProbV(const double& Height, const int& StateId, TIntFltPrV& StateIdProbV) const {
try {
TVec<TIntV> JoinedStateVV;
TIntV StateIdV;
Hierarch->GetStateSetsAtHeight(Height, StateIdV, JoinedStateVV);
MChain->GetNextStateProbV(JoinedStateVV, StateIdV, StateId, StateIdProbV, StateIdV.Len()-1);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarch::GetNextStateProbV: Failed to compute future state probabilities: %s", Except->GetMsgStr().CStr());
throw Except;
}
}
void THierarchCtmc::GetPrevStateProbV(const double& Height, const int& StateId, TIntFltPrV& StateIdProbV) const {
try {
TVec<TIntV> StateSetV;
TIntV StateIdV;
Hierarch->GetStateSetsAtHeight(Height, StateIdV, StateSetV);
MChain->GetPrevStateProbV(StateSetV, StateIdV, StateId, StateIdProbV, StateIdV.Len()-1);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarch::GetPrevStateProbV: Failed to compute future state probabilities: %s", Except->GetMsgStr().CStr());
throw Except;
}
}
void THierarchCtmc::GetProbVOverTm(const double& Height, const int& StateId, const double StartTm, const double EndTm, const double& DeltaTm, TIntV& StateIdV, TVec<TFltV>& FutProbV, TVec<TFltV>& PastProbV) const {
try {
TVec<TIntV> StateSetV;
Hierarch->GetStateSetsAtHeight(Height, StateIdV, StateSetV);
MChain->GetProbVOverTm(Height, StateId, StartTm, EndTm, DeltaTm, StateSetV, StateIdV, FutProbV, PastProbV);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarch::GetPrevStateProbV: Failed to compute future state probabilities: %s", Except->GetMsgStr().CStr());
throw Except;
}
}
void THierarchCtmc::GetHistStateIdV(const double& Height, TIntV& StateIdV) const {
try {
Hierarch->GetHistStateIdV(Height, StateIdV);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarch::GetHistStateIdV: Failed to compute fetch historical states: %s", Except->GetMsgStr().CStr());
throw Except;
}
}
void THierarchCtmc::GetHistogram(const int& StateId, const int& FtrId, TFltV& BinStartV, TFltV& ProbV) const {
try {
TIntV LeafV;
Hierarch->GetLeafDescendantV(StateId, LeafV);
Clust->GetHistogram(FtrId, LeafV, BinStartV, ProbV);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarch::GetHistogram: Failed to fetch histogram: %s", Except->GetMsgStr().CStr());
throw Except;
}
}
void THierarchCtmc::GetStateWgtV(const int& StateId, TFltV& WgtV) const {
try {
StateAssist->GetSuggestFtrs(StateId, WgtV);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarchCtmc::GetStateWgtV: Failed to fetch weight vector for state %d: %s", StateId, Except->GetMsgStr().CStr());
throw Except;
}
}
void THierarchCtmc::GetTransitionModel(const double& Height, TFltVV& Mat) const {
TIntV StateIdV;
TVec<TIntV> StateSetV;
Hierarch->GetStateSetsAtHeight(Height, StateIdV, StateSetV);
Mat = MChain->GetModel(StateSetV).GetMat();
}
void THierarchCtmc::GetStateAncestry(const int& StateId, TIntFltPrV& StateIdHeightPrV) const {
Hierarch->GetAncestorV(StateId, StateIdHeightPrV);
}
void THierarchCtmc::GetCurrStateAncestry(TIntFltPrV& StateIdHeightPrV) const {
return Hierarch->GetCurrStateIdHeightPrV(StateIdHeightPrV);
}
int THierarchCtmc::GetCurrStateId(const double& Height) const {
return Hierarch->GetAncestorAtHeight(MChain->GetCurrStateId(), Height);
}
void THierarchCtmc::GetCentroid(const int& StateId, TFltV& FtrV) const {
TIntV LeafIdV; Hierarch->GetLeafDescendantV(StateId, LeafIdV);
TVector Centroid = Clust->GetJoinedCentroid(LeafIdV);
FtrV = Centroid.Vec;
}
void THierarchCtmc::GetStateIdVAtHeight(const double& Height, TIntV& StateIdV) const {
try {
TVec<TIntV> StateSetV;
Hierarch->GetStateSetsAtHeight(Height, StateIdV, StateSetV);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarchCtmc::THierarchCtmc::GetStateIdVAtHeight: Failed to fetch state IDs for height %.3f: %s", Height, Except->GetMsgStr().CStr());
throw Except;
}
}
void THierarchCtmc::SetStateNm(const int& StateId, const TStr& StateNm) {
try {
Hierarch->SetStateNm(StateId, StateNm);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarchCtmc::SetStateNm: Failed to set name of state %d: %s", StateId, Except->GetMsgStr().CStr());
throw Except;
}
}
const TStr& THierarchCtmc::GetStateNm(const int& StateId) const {
try {
return Hierarch->GetStateNm(StateId);
} catch (const PExcept& Except) {
Notify->OnNotifyFmt(TNotifyType::ntErr, "THierarchCtmc::GetStateNm: Failed to get name of state %d: %s", StateId, Except->GetMsgStr().CStr());
throw Except;
}
}
void THierarchCtmc::SetVerbose(const bool& _Verbose) {
if (_Verbose != Verbose) {
Verbose = _Verbose;
Notify = Verbose ? TNotify::StdNotify : TNotify::NullNotify;
}
Clust->SetVerbose(Verbose);
MChain->SetVerbose(Verbose);
Hierarch->SetVerbose(Verbose);
}
void THierarchCtmc::SetCallback(TMcCallback* _Callback) {
Callback = _Callback;
}
void THierarchCtmc::DetectAnomalies(const int& NewStateId, const int& OldStateId, const TVector& FtrVec) const {
if (NewStateId != OldStateId) {
if (MChain->IsAnomalousJump(NewStateId, OldStateId)) {
Callback->OnAnomaly(TStr::Fmt("Anomalous jump, old state %d, new state %d", OldStateId, NewStateId));
}
if (NewStateId == -1) {
Callback->OnOutlier(FtrVec.Vec);
}
}
}
void THierarchCtmc::CheckBatches(const TBoolV& BatchEndV) {
// check if any batches of length 0 exist
bool JustEnded = false;
for (int i = 0; i < BatchEndV.Len(); i++) {
const bool EndsBatch = BatchEndV[i];
EAssertR(!EndsBatch || !JustEnded, "Found a batch of length 0. Cannot model such data!");
JustEnded = EndsBatch;
}
}
| 30.971251 | 213 | 0.702091 | mihapapler |
9e4fcd830168bc05e983ed384e857bec231c4f1c | 3,432 | cpp | C++ | src/tests/depend_test/MetricSerializerTest.cpp | vinsle/dependency-analysis | 087d218864833fccab20b5693cfcdca728b31218 | [
"BSL-1.0"
] | null | null | null | src/tests/depend_test/MetricSerializerTest.cpp | vinsle/dependency-analysis | 087d218864833fccab20b5693cfcdca728b31218 | [
"BSL-1.0"
] | null | null | null | src/tests/depend_test/MetricSerializerTest.cpp | vinsle/dependency-analysis | 087d218864833fccab20b5693cfcdca728b31218 | [
"BSL-1.0"
] | null | null | null | //
// Copyright Silvin Lubecki 2010
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#include "depend_test_pch.h"
#include "depend/MetricSerializer.h"
#include "MockVisitable.h"
#include "MockFilter.h"
#include <xeumeuleu/xml.hpp>
using namespace depend;
namespace
{
class Fixture
{
public:
Fixture()
: metricsVisitor( 0 )
{
MOCK_EXPECT( metrics.Apply ).once().with( mock::retrieve( metricsVisitor ) );
}
MockVisitable< MetricsVisitor_ABC > metrics;
MetricsVisitor_ABC* metricsVisitor;
MockFilter filter;
};
class SerializeFixture : public Fixture
{
public:
SerializeFixture()
: serializer( metrics )
{
BOOST_REQUIRE( metricsVisitor );
}
MetricSerializer serializer;
};
}
BOOST_FIXTURE_TEST_CASE( serialize_metrics_in_xml, SerializeFixture )
{
metricsVisitor->NotifyMetrics( "module1", 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u );
xml::xostringstream xos;
MOCK_EXPECT( filter.Check ).returns( true );
serializer.Serialize( xos, filter );
const std::string expected =
"<metrics>"
" <metric name='module1'>"
" <afferent>1</afferent>"
" <efferent>2</efferent>"
" <external>3</external>"
" <classes>4</classes>"
" <abstract-classes>5</abstract-classes>"
" <abstractness>6</abstractness>"
" <instability>7</instability>"
" <distance>8</distance>"
" </metric>"
"</metrics>";
BOOST_CHECK_XML_EQUAL( expected, xos.str() );
}
BOOST_FIXTURE_TEST_CASE( serialize_metrics_with_module_filter, SerializeFixture )
{
metricsVisitor->NotifyMetrics( "module1", 11u, 12u, 13u, 14u, 15u, 16u, 17u, 18u );
metricsVisitor->NotifyMetrics( "module2", 21u, 22u, 23u, 24u, 25u, 26u, 27u, 28u );
metricsVisitor->NotifyMetrics( "module3", 31u, 32u, 33u, 34u, 35u, 36u, 37u, 38u );
xml::xostringstream xos;
MOCK_EXPECT( filter.Check ).with( "module1" ).returns( true );
MOCK_EXPECT( filter.Check ).with( "module2" ).returns( true );
MOCK_EXPECT( filter.Check ).returns( false );
serializer.Serialize( xos, filter );
const std::string expected =
"<metrics>"
" <metric name='module1'>"
" <afferent>11</afferent>"
" <efferent>12</efferent>"
" <external>13</external>"
" <classes>14</classes>"
" <abstract-classes>15</abstract-classes>"
" <abstractness>16</abstractness>"
" <instability>17</instability>"
" <distance>18</distance>"
" </metric>"
" <metric name='module2'>"
" <afferent>21</afferent>"
" <efferent>22</efferent>"
" <external>23</external>"
" <classes>24</classes>"
" <abstract-classes>25</abstract-classes>"
" <abstractness>26</abstractness>"
" <instability>27</instability>"
" <distance>28</distance>"
" </metric>"
"</metrics>";
BOOST_CHECK_XML_EQUAL( expected, xos.str() );
}
| 34.32 | 90 | 0.560023 | vinsle |
9e535c8c1a81aa0f0f727ccdb4351a11e2dba8bc | 2,514 | hpp | C++ | src/flat_file_back_translation.hpp | StephenHwang/vg | cf4d516a5e9ee5163c783e4437ddf16b18a4b561 | [
"MIT"
] | null | null | null | src/flat_file_back_translation.hpp | StephenHwang/vg | cf4d516a5e9ee5163c783e4437ddf16b18a4b561 | [
"MIT"
] | null | null | null | src/flat_file_back_translation.hpp | StephenHwang/vg | cf4d516a5e9ee5163c783e4437ddf16b18a4b561 | [
"MIT"
] | null | null | null | /**
* \file flat_file_back_translation.hpp
* Defines a back-translation from graph node ID space to named node space,
* backed by a flat text file.
*/
#ifndef VG_FLAT_FILE_BACK_TRANSLATION_HPP_INCLUDED
#define VG_FLAT_FILE_BACK_TRANSLATION_HPP_INCLUDED
#include "handle.hpp"
#include <unordered_map>
#include <istream>
#include <vector>
namespace vg {
/**
* A NamedNodeBackTranslation loadable from a text file.
*
* The file is a GFA-like tab-separated file with types of lines identified by
* a letter in the first field. It consists of 0 or more T lines, each giving a
* segment name and an assigned number for it. This is followed by 0 or more K
* lines, each giving a segment number, offsets along that segment in forward
* and then reverse orientations, and then the graph node ID that begins at
* that offset.
*
* Note that an empty file is allowed, and that this format can only represent
* translations where nodes are broken up (and not merged) and where
* orientation does not change.
*
* Many applications (such as loading the translation into a GBWTGraph) will
* expect the graph node IDs alogn a segment to be dense, contiguous, and
* increasing.
*/
class FlatFileBackTranslation : public NamedNodeBackTranslation {
public:
/**
* Create a FlatFileBackTranslation by reading it from an open file.
*/
FlatFileBackTranslation(std::istream& stream);
virtual ~FlatFileBackTranslation() = default;
/**
* Translate the given range of bases on the given orientation of the given
* node in the current graph, to zero or more ranges on orientations of
* nodes in some prior graph.
*/
virtual std::vector<oriented_node_range_t> translate_back(const oriented_node_range_t& range) const;
/**
* Get the name of a node in the graph that translate_back() translates
* into, given its number.
*/
virtual std::string get_back_graph_node_name(const nid_t& back_node_id) const;
protected:
/**
* This holds, for each node ID, the segment number and starting offset, if
* it is not offset 0, on each orientation of the segment with the same
* number as the node ID.
*/
std::unordered_map<nid_t, std::tuple<nid_t, size_t, size_t>> node_to_segment_and_offsets;
/**
* This holds, for each segment ID, the segment name, if it is not the
* string version of the segment number.
*/
std::unordered_map<nid_t, std::string> segment_to_name;
};
}
#endif
| 32.230769 | 104 | 0.716786 | StephenHwang |
9e56aa6b69f5606f83732ad8e58f08ebe6b70d99 | 2,403 | cpp | C++ | src/StatusLed.cpp | BlueMasters/arduino-wolves | 5e4522b34bf6abc9c22f25b0ec2e912ca0057a58 | [
"Apache-2.0"
] | null | null | null | src/StatusLed.cpp | BlueMasters/arduino-wolves | 5e4522b34bf6abc9c22f25b0ec2e912ca0057a58 | [
"Apache-2.0"
] | 13 | 2016-05-09T13:42:28.000Z | 2016-05-19T17:18:47.000Z | src/StatusLed.cpp | BlueMasters/arduino-wolves | 5e4522b34bf6abc9c22f25b0ec2e912ca0057a58 | [
"Apache-2.0"
] | null | null | null | /****************************************************************************
* Copyright 2016 BlueMasters
*
* 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 <Arduino.h>
#include "StatusLed.h"
#include "App.h"
#ifdef DEBUG
#include <Stream.h>
#endif
#define HEARTBEAT_COUNTER 64 // about 5 seconds with current setup
#define HEARTBEAT_WIDTH 1
#define COLOR_CHOOSE_CMD 0xFF7400 // orange
#define COLOR_LEARN 0x3029D6 // bright blue
#define COLOR_HEART_BEAT 0x000033 // dark blue
void StatusLed::begin() {
setColor(STATUS_LED_BLACK);
pinMode(_redPin, OUTPUT);
pinMode(_greenPin, OUTPUT);
pinMode(_bluePin, OUTPUT);
_tickCount = 0;
}
void StatusLed::begin(int redPin, int greenPin, int bluePin) {
_redPin = redPin;
_greenPin = greenPin;
_bluePin = bluePin;
begin();
}
void StatusLed::setColor(uint32_t color) {
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = (color >> 0) & 0xFF;
analogWrite(_redPin, 255-r);
analogWrite(_greenPin, 255-g);
analogWrite(_bluePin, 255-b);
}
void StatusLed::off() {
setColor(STATUS_LED_BLACK);
}
int StatusLed::selfCheck() {
setColor(STATUS_LED_RED);
delay(1000);
setColor(STATUS_LED_GREEN);
delay(1000);
setColor(STATUS_LED_BLUE);
delay(1000);
off();
return 0;
}
void StatusLed::tick() {
_tickCount++;
if (_tickCount > HEARTBEAT_COUNTER) {
_tickCount = 0;
}
int heartBeatLed = (_tickCount > (HEARTBEAT_COUNTER - HEARTBEAT_WIDTH));
if (app.globalMode == globmode_LEARN) {
setColor(COLOR_LEARN);
} else if (app.globalMode == globmode_NORMAL) {
if (heartBeatLed) setColor(COLOR_HEART_BEAT); else off();
} else {
if (heartBeatLed) setColor(STATUS_LED_RED); else off();
}
}
| 28.270588 | 79 | 0.633375 | BlueMasters |
9e63359ba05404e474c3ff1b87432d1bbfaf7dc4 | 3,852 | hpp | C++ | include/MpiRoutines.hpp | bonoboris/hpc_project | c5106efa3d51b1572c3dbefc5c136d8f1d2b698a | [
"MIT"
] | null | null | null | include/MpiRoutines.hpp | bonoboris/hpc_project | c5106efa3d51b1572c3dbefc5c136d8f1d2b698a | [
"MIT"
] | null | null | null | include/MpiRoutines.hpp | bonoboris/hpc_project | c5106efa3d51b1572c3dbefc5c136d8f1d2b698a | [
"MIT"
] | null | null | null | // Distributed implementation of common operation on vectors and matrix using MPI
#pragma once
#include "MpiWrapper.hpp"
#include "Matrix.hpp"
#include "linalg.hpp"
#include <string>
// Assuming every process have their part of the input
// Return the scalar product (x.y) for every process
template<typename T>
T mpiDot(const Params& p, const Vec<T>& x_part, const Vec<T>& y_part)
{
auto part = linalg::dot(x_part, y_part);
T dot;
AllReduce(p, part, MPI_SUM, dot);
return dot;
}
// Assuming every process have their part of the input
// Return the L2 norm of the vector for every process
template<typename T>
T mpiL2(const Params& p, const Vec<T>& x_part)
{
return std::sqrt(mpiDot(p, x_part, x_part));
}
// Assuming every process have their part of the input, normalize
// Return ||x|| for every process
// Side effect: z_part contains x_part normalized (by normL2 of x)
template<typename T>
T mpiL2Normalize(const Params& p, const Vec<T>& x_part, Vec<T>& z_part)
{
auto norm = mpiL2(p, x_part);
z_part = linalg::scale(T(1) / norm, x_part);
return norm;
}
// Perform matix vector multiplication z = Ax
// A is scattered on the all grid and x is scattered by rows
// When this function returns z is scattered by columns
template<typename T>
void mpiMatVec(const Params2D& p, const Matrix<T>& A_block, const Vec<T> x_part, Vec<T>& z_part)
{
auto z_p = linalg::matVec(A_block, x_part);
int I = p.rank() / p.numBlocksInRow(); // index of the row each process belong to
int J = p.rank() % p.numBlocksInRow(); // index of the column each process belong to
// reduce partial results by row to the process belonging to the diagonal
Reduce(p.row2D(), z_p, MPI_SUM, z_part, I);
// diagonal processes broadcast their part to their columns;
Bcast(p.col2D(), z_part, J);
}
// Perform block matrix matrix product when each process of a 2d grid already have possession
// of their blocks.
template<typename T>
Params2D mpiMatMat(const Params2D& pA, const Matrix<T>& A_block, const Params2D& pB, const Matrix<T>& B_block, Matrix<T>& C_block)
{
// 2 out of 3 dimensions are fixed
int m = pA.rowsBlock();
int n = pB.colsBlock();
C_block = Matrix<T>(m, n);
// loop over the number of block in a row of A
for (size_t k = 0; k < pA.numBlocksInRow(); k++)
{
// this dimension can vary with value of k
int s = pA.colsBlock(k); // should be equal to pB.rowsBlock()
Matrix<T> A_p(m, s);
Matrix<T> B_p(s, n);
// If k == col rank bcast A_block to row
if (pA.row2D().rank() == k)
A_p = A_block;
Bcast(pA.row2D(), A_p, k);
// If k == row rank send B_block to col
if (pB.col2D().rank() == k)
B_p = B_block;
Bcast(pB.col2D(), B_p, k);
// Compute blocks product and accumulate in C_block
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
for (int k = 0; k < s; k++)
C_block.at(i,j) += A_p.at(i, k) * B_p.at(k, j);
// Return a new params object associated with C
}
return Params2D::multParams(pA, pB);
}
// Transpose matrix: C = transpose(A)
// each process already has their block of A in A_block and finish with their transposed block in C_block
// return the Params asssociated with C
// RQ: only work with square grid of process
template<typename T>
Params2D mpiTranspose(const Params2D& p, const Matrix<T>& A_block, Matrix<T>& C_block)
{
Params2D tp = p.transpose();
std::cout.flush();
C_block = Matrix<T>(tp.rowsBlock(), tp.colsBlock());
// rank of the destination process in the global comm
auto dstRank = p.row2D().rank() * p.numBlocksInRow() + p.col2D().rank();
// Only extra diagonal process need to exchange data
if (dstRank != p.rank())
SendRcv(p, A_block.transpose(), C_block, dstRank);
else
C_block = A_block.transpose();
return tp;
} | 31.57377 | 131 | 0.666667 | bonoboris |
9e6908596f3cb20bb693d761c13d56f0bce21475 | 349 | cpp | C++ | src/test/CanvasTest.cpp | SamuelGauthier/iphito | 83cbcc9037965f5722aa39e7a7c13f0677264ff3 | [
"Unlicense"
] | null | null | null | src/test/CanvasTest.cpp | SamuelGauthier/iphito | 83cbcc9037965f5722aa39e7a7c13f0677264ff3 | [
"Unlicense"
] | null | null | null | src/test/CanvasTest.cpp | SamuelGauthier/iphito | 83cbcc9037965f5722aa39e7a7c13f0677264ff3 | [
"Unlicense"
] | null | null | null | /**
* @file Test_Canvas.cpp
* @brief Canvas tests
* @author Samuel Gauthier
* @version 1.0
* @date 2018-10-01
*/
#include <catch2/catch.hpp>
#include "renderer/Canvas.h"
using namespace iphito::renderer;
TEST_CASE("canvas size", "[Canvas]") {
Canvas c = Canvas(3, 4);
REQUIRE(c.getWidth() == 3);
REQUIRE(c.getHeight() == 4);
}
| 17.45 | 38 | 0.633238 | SamuelGauthier |
9e712b6e64acd223e26aa2dfc3413d35ddc4e1ad | 1,805 | hpp | C++ | include/tudocomp/ds/LCPFromPLCP.hpp | JZentgraf/tudocomp | 3a4522e3089716e4483b935e74aaae56cc547589 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | include/tudocomp/ds/LCPFromPLCP.hpp | JZentgraf/tudocomp | 3a4522e3089716e4483b935e74aaae56cc547589 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | include/tudocomp/ds/LCPFromPLCP.hpp | JZentgraf/tudocomp | 3a4522e3089716e4483b935e74aaae56cc547589 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #pragma once
#include <tudocomp/ds/TextDSFlags.hpp>
#include <tudocomp/ds/CompressMode.hpp>
#include <tudocomp/ds/ArrayDS.hpp>
#include <tudocomp_stat/StatPhase.hpp>
namespace tdc {
/// Constructs the LCP array using the Phi algorithm.
class LCPFromPLCP: public Algorithm, public ArrayDS {
private:
len_t m_max;
public:
inline static Meta meta() {
Meta m("lcp", "from_phi");
return m;
}
inline static ds::InputRestrictions restrictions() {
return ds::InputRestrictions {};
}
template<typename textds_t>
inline LCPFromPLCP(Env&& env, textds_t& t, CompressMode cm)
: Algorithm(std::move(env)) {
// Construct Suffix Array and PLCP Array
auto& sa = t.require_sa(cm);
auto& plcp = t.require_plcp(cm);
const size_t n = t.size();
StatPhase::wrap("Construct LCP Array", [&]{
// Compute LCP array
m_max = plcp.max_lcp();
const size_t w = bits_for(m_max);
set_array(iv_t(n, 0, (cm == CompressMode::compressed) ? w : LEN_BITS));
(*this)[0] = 0;
for(len_t i = 1; i < n; i++) {
const len_t x = plcp[sa[i]];
(*this)[i] = x;
}
StatPhase::log("bit_width", size_t(width()));
StatPhase::log("size", bit_size() / 8);
});
if(cm == CompressMode::delayed) compress();
}
inline len_t max_lcp() const {
return m_max;
}
void compress() {
debug_check_array_is_initialized();
StatPhase::wrap("Compress LCP Array", [this]{
width(bits_for(m_max));
shrink_to_fit();
StatPhase::log("bit_width", size_t(width()));
StatPhase::log("size", bit_size() / 8);
});
}
};
} //ns
| 24.391892 | 83 | 0.559003 | JZentgraf |
9e756972795e8e7a3568820395646115fc53a563 | 1,715 | cpp | C++ | A2/OmarLovesCandies.cpp | MartinAparicioPons/Competitive-Programming | 58151df0ed08a5e4e605abefdd69fef1ecc10fa0 | [
"Apache-2.0"
] | 1 | 2019-09-29T03:58:35.000Z | 2019-09-29T03:58:35.000Z | A2/OmarLovesCandies.cpp | MartinAparicioPons/Competitive-Programming | 58151df0ed08a5e4e605abefdd69fef1ecc10fa0 | [
"Apache-2.0"
] | null | null | null | A2/OmarLovesCandies.cpp | MartinAparicioPons/Competitive-Programming | 58151df0ed08a5e4e605abefdd69fef1ecc10fa0 | [
"Apache-2.0"
] | null | null | null | #include <cstdio>
#include <cctype>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <stack>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <string>
#include <cstring>
#include <sstream>
#include <cstdlib>
#include <locale>
#include <cmath>
#define scd(x) scanf("%d", &x)
#define scc(x) scanf("%c", &x)
#define scd2(x,y) scanf("%d %d", &x, &y)
#define prd(x) printf("%d\n", x)
#define dprd(x) printf("|| %d\n", x)
#define prd2(x,y) printf("%d %d\n", x,y)
#define dprd2(x,y) printf("||%d | %d\n", x,y)
#define prnl() printf("\n")
#define prc(c) printf("%c\n", c)
#define fora(i,a,n) for(i = a; i < n; i++)
#define for0(i,n) for(i = 0; i < n; i++)
#define for1(i,n) for(i = 1; i <= n; i++)
#define _F first
#define _S second
#define _MP make_pair
#define _MT(x, y, z) _MP(x, _MP(y, z))
#define _TL(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
#define _TU(s) transform(s.begin(), s.end(), s.begin(), ::toupper)
#define SQ(x) ((x)*(x))
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, ii> iii;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<string> vs;
typedef vector< vector<int> > vvi;
int n, m, a[1010][1010];
ll b[1010][1010];
int main(){
int t, i, j;
ll k;
scd(t);
while(t--){
scd2(n, m);
for0(i, n){
for0(j, m){
scd(a[i][j]);
b[i][j] = a[i][j];
}
}
k = -2200;
for(i = n-1; i >= 0; i--){
for(j = m-1; j >= 0; j--){
if(j < m-1) b[i][j]+=b[i][j+1];
if(i < n-1) b[i][j]+=b[i+1][j];
if(i < n-1 && j < m-1) b[i][j] -= b[i+1][j+1];
k = max(k, b[i][j]);
}
}
printf("%lld\n", k);
}
}
| 20.416667 | 66 | 0.566181 | MartinAparicioPons |
9e75a140787b5a9cdce94b4e4e9f20304a9a6d56 | 4,635 | hpp | C++ | Map2Cat.hpp | tbs1980/Map2Cat | 3a92fa0314ffb4c072cb0939f74017b78d8db64c | [
"MIT"
] | null | null | null | Map2Cat.hpp | tbs1980/Map2Cat | 3a92fa0314ffb4c072cb0939f74017b78d8db64c | [
"MIT"
] | null | null | null | Map2Cat.hpp | tbs1980/Map2Cat | 3a92fa0314ffb4c072cb0939f74017b78d8db64c | [
"MIT"
] | null | null | null | #ifndef MAP2CAT_HPP
#define MAP2CAT_HPP
#include <fstream>
#include <iostream>
#include <iomanip>
#include <exception>
#include <vector>
#include <cmath>
#include <cassert>
#include <random>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <boost/log/trivial.hpp>
#include <boost/tokenizer.hpp>
#include <healpix_base.h>
#include <healpix_map.h>
#include <pointing.h>
#include <healpix_map_fitsio.h>
#include <datatypes.h>
class Map2Cat
{
public:
typedef boost::property_tree::ptree propertyTreeType;
typedef Healpix_Map<double> mapType;
static const constexpr double deg2rad = M_PI/double(180);
static const constexpr double rotPhi = double(0);
explicit Map2Cat(std::string const& iniFileName)
{
BOOST_LOG_TRIVIAL(info) << std::string("Reading the ini file ") + std::string(iniFileName);
boost::property_tree::ini_parser::read_ini(iniFileName,mPropTree);
std::string inputMapFileName = mPropTree.get<std::string>("input.data_map_file_name");
BOOST_LOG_TRIVIAL(info) << std::string("Reading the maps from ") + inputMapFileName;
read_Healpix_map_from_fits(inputMapFileName,mMapN);
read_Healpix_map_from_fits(inputMapFileName,mMapE1,int(2),int(2));
read_Healpix_map_from_fits(inputMapFileName,mMapE2,int(3),int(2));
}
void generate()
{
std::string zBoundsStr = mPropTree.get<std::string>("input.z_bounds");
BOOST_LOG_TRIVIAL(info) << "z bounds specified as "<< zBoundsStr;
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep(",");
tokenizer tokens(zBoundsStr, sep);
for(tokenizer::iterator tokIter = tokens.begin(); tokIter !=tokens.end(); ++tokIter)
{
mZBounds.push_back(boost::lexical_cast<double>(*tokIter));
}
if(mZBounds.size() != size_t(2))
{
std::string msg("The z-bounds should consist of two values. No more, no less.");
throw std::runtime_error(msg);
}
if(mZBounds[0] >= mZBounds[1])
{
std::string msg("The upper bound should be greater than the lower bound.");
throw std::runtime_error(msg);
}
size_t numPix = (size_t) mMapN.Npix();
size_t randomSeed = mPropTree.get<size_t>("input.rand_seed");
BOOST_LOG_TRIVIAL(info) << "Random seed specified as "<< randomSeed;
std::mt19937 gen(randomSeed);
// to generate z values
std::uniform_real_distribution<double> dist_z(mZBounds[0], mZBounds[1]);
// to generate e1 and e2 values
std::normal_distribution<> dist_e(0,1);
double sigma_e = mPropTree.get<double>("input.sigma_e");
BOOST_LOG_TRIVIAL(info) << "Std-dvn of ellipticities specified as "<< sigma_e;
BOOST_LOG_TRIVIAL(info) << "Number of pixel in the map is "<< numPix;
std::ofstream inputCatFile;
std::string inputCatFileName = mPropTree.get<std::string>("output.catlogue_file_name");
BOOST_LOG_TRIVIAL(info) << "Output catalogue file name is "<< inputCatFileName;
inputCatFile.open( inputCatFileName.c_str(),std::ios::trunc );
//write the header
std::string delimiter = mPropTree.get<std::string>("output.delimiter");
BOOST_LOG_TRIVIAL(info) << "Delimiter for separation is "<< delimiter;
inputCatFile<<"#"<<"ra"<<delimiter<<"dec"<<delimiter<<"z"
<<delimiter<<"e1"<<delimiter<<"e2"<<std::endl;
inputCatFile<<std::setprecision(10);
// go through the number count map and generate n uniform random from zmin and zmax
for(size_t i=0;i<numPix;++i)
{
size_t numGals = (size_t) mMapN[i];
double e1 = mMapE1[i];
double e2 = mMapE2[i];
pointing pntg = mMapN.pix2ang(i);
double theta = pntg.theta;
double phi = pntg.phi;
double dec = -( theta - M_PI*double(0.5) )/deg2rad;
double ra = phi/deg2rad + rotPhi;
for(size_t j=0;j<numGals;++j)
{
double zVal = dist_z(gen);
double e1Val = e1 + dist_e(gen)*sigma_e;
double e2Val = e2 + dist_e(gen)*sigma_e;
inputCatFile<<ra<<delimiter<<dec<<delimiter<<zVal<<delimiter<<e1Val<<delimiter<<e2Val<<std::endl;
}
}
inputCatFile.close();
}
private:
propertyTreeType mPropTree;
mapType mMapN;
mapType mMapE1;
mapType mMapE2;
std::vector<double> mZBounds;
};
#endif //MAP2CAT_HPP
| 32.87234 | 113 | 0.633441 | tbs1980 |
9e7a0b87d8e92a6e863c8d4061cb0a71d8ce6437 | 1,302 | cpp | C++ | LiteCppDB/LiteCppDB.Console/InputCommand.cpp | pnadan/LiteCppDB | cb17db1ea6d82e0c1e669b4d70271dcf9c03d1a2 | [
"MIT"
] | 2 | 2019-07-18T06:30:33.000Z | 2020-01-23T17:40:36.000Z | LiteCppDB/LiteCppDB.Console/InputCommand.cpp | pnadan/LiteCppDB | cb17db1ea6d82e0c1e669b4d70271dcf9c03d1a2 | [
"MIT"
] | null | null | null | LiteCppDB/LiteCppDB.Console/InputCommand.cpp | pnadan/LiteCppDB | cb17db1ea6d82e0c1e669b4d70271dcf9c03d1a2 | [
"MIT"
] | null | null | null | #include "stdafx.h"
#include "InputCommand.h"
#include <iostream>
#include <string>
namespace LiteCppDB_Console
{
InputCommand::InputCommand() noexcept
{
this->mRunning = true;
}
InputCommand::~InputCommand()
{
}
InputCommand::InputCommand(const InputCommand& src) noexcept
{
this->mRunning = src.mRunning;
}
InputCommand& InputCommand::operator=(const InputCommand& rhs) noexcept
{
// TODO: insert return statement here
if (this == &rhs)
{
return *this;
}
this->mRunning = rhs.mRunning;
return *this;
}
InputCommand::InputCommand(const InputCommand&& src) noexcept
{
this->mRunning = src.mRunning;
}
InputCommand& InputCommand::operator=(InputCommand&& rhs) noexcept
{
// TODO: insert return statement here
if (this == &rhs)
{
return *this;
}
this->mRunning = rhs.mRunning;
return *this;
}
bool InputCommand::getRunning() noexcept
{
return this->mRunning;
}
void InputCommand::setRunning(bool running) noexcept
{
this->mRunning = running;
}
std::string InputCommand::ReadCommand()
{
auto cmd = this->ReadLine();
return cmd;
}
// Read a line from queue or user
std::string InputCommand::ReadLine()
{
std::string userCommand("");
std::cout << "> ";
getline(std::cin, userCommand);
return userCommand;
}
} | 16.481013 | 72 | 0.678955 | pnadan |
9e7e4b3387b9755107e8f92fe57920f1512f5321 | 592 | cc | C++ | cxx/general/dataforge.cc | Zelenyy/phd-code | d5b8bfefd2418a915dde89f7da2cb6683f438556 | [
"MIT"
] | null | null | null | cxx/general/dataforge.cc | Zelenyy/phd-code | d5b8bfefd2418a915dde89f7da2cb6683f438556 | [
"MIT"
] | null | null | null | cxx/general/dataforge.cc | Zelenyy/phd-code | d5b8bfefd2418a915dde89f7da2cb6683f438556 | [
"MIT"
] | null | null | null | //
// Created by zelenyy on 24.02.2020.
//
#include "dataforge/include/SimpleEnvelope.hh"
#include "dataforge/include/ArrayBinary.hh"
#include "dataforge/include/TaggedEnvelopeFormat.hh"
#include <iostream>
#include <vector>
int main(){
std::vector<double> data;
data.reserve(100);
for (int i=0; i<100; ++i){
data.push_back(i);
}
ArrayBinary<double> binary(data);
std::cout<<binary.getSize()<<std::endl;
auto envelope = SimpleEnvelope(binary);
//
auto format = new TaggedEnvelopeFormat();
format->writeEnvelope(envelope, std::cout);
return 0;
} | 22.769231 | 52 | 0.677365 | Zelenyy |
9e89c425a28b1b29cd4327619aff6fe2d9c56f25 | 228 | cpp | C++ | test/test_main.cpp | ciniml/umcache | 4b349e8be27b981e55446940db8fe16fab487bab | [
"BSL-1.0"
] | null | null | null | test/test_main.cpp | ciniml/umcache | 4b349e8be27b981e55446940db8fe16fab487bab | [
"BSL-1.0"
] | null | null | null | test/test_main.cpp | ciniml/umcache | 4b349e8be27b981e55446940db8fe16fab487bab | [
"BSL-1.0"
] | null | null | null | /**
* User mode cache using userfaultfd.
* Copyright(C) 2021 Kenta IDA
* SPDX: BSL-1.0
*/
#include <gtest/gtest.h>
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
} | 19 | 43 | 0.649123 | ciniml |
9e920998435b8e5d0e3d98efb5136ece79486649 | 13,535 | hpp | C++ | extern/stm32/rcc.hpp | Better-Idea/Mix-C | 71f34a5fc8c17a516cf99bc397289d046364a82e | [
"Apache-2.0"
] | 41 | 2019-09-24T02:17:34.000Z | 2022-01-18T03:14:46.000Z | extern/stm32/rcc.hpp | Better-Idea/Mix-C | 71f34a5fc8c17a516cf99bc397289d046364a82e | [
"Apache-2.0"
] | 2 | 2019-11-04T09:01:40.000Z | 2020-06-23T03:03:38.000Z | extern/stm32/rcc.hpp | Better-Idea/Mix-C | 71f34a5fc8c17a516cf99bc397289d046364a82e | [
"Apache-2.0"
] | 8 | 2019-09-24T02:17:35.000Z | 2021-09-11T00:21:03.000Z | #ifndef xpack_extern_stm32_rcc
#define xpack_extern_stm32_rcc
#pragma push_macro("xuser")
#undef xuser
#define xuser mixc::extern_stm32_rcc::inc
#include"extern/stm32/define.hpp"
#include"macro/xexport.hpp"
#include"meta/is_same.hpp"
#pragma pop_macro("xuser")
namespace mixc::extern_stm32_rcc{
// read/clear/enable/disable
#define xevent(name,flag,clear,enable) \
union { \
operator bool(){ \
return bool(xget(flag)); \
} \
void operator=(bool value){ \
xset(enable, value); \
} \
void operator=(clear_t){ \
xset(clear, 1); \
} \
} name;
#define xport(name) \
union{ \
xrw(bool, reset, xlink(name, rst)) \
xrw(bool, enable, xlink(name, en)) \
xrw(bool, always_active, xlink(name, lpen)) \
} name;
#define xport_en_lp(name) \
union{ \
xrw(bool, enable, xlink(name, en)) \
xrw(bool, always_active, xlink(name, lpen)) \
} name;
#define xport_rst(name) \
union{ \
xrw(bool, reset, xlink(name, rst)) \
} name;
#define xport_lp(name) \
union{ \
xrw(bool, always_active, xlink(name, lpen)) \
} name;
xmmio(_rcc) {
private:
enum{
xfield(hsion , 1),
xfield(hsirdy , 1),
xrsv(1),
xfield(hsitrim , 5),
xfield(hsical , 8),
xfield(hseon , 1),
xfield(hserdy , 1),
xfield(hsebyp , 1),
xfield(csson , 1),
xrsv(4),
xfield(pllon , 1),
xfield(pllrdy , 1),
xfield(plli2son , 1),
xfield(plli2srdy , 1),
xfield(pllsaion , 1),
xfield(pllsairdy , 1),
xrsv(2),
xfield(pllm , 6),
xfield(plln , 9),
xrsv(1),
xfield(pllp , 2),
xrsv(4),
xfield(pllsrc , 1),
xrsv(1),
xfield(pllq , 4),
xrsv(4),
xfield(sw , 2),
xfield(sws , 2),
xfield(hpre , 4),
xrsv(2),
xfield(ppre1 , 3),
xfield(ppre2 , 3),
xfield(rtcpre , 5),
xfield(mcoa , 2),
xfield(i2ssrc , 1),
xfield(mcoapre , 3),
xfield(mcobpre , 3),
xfield(mcob , 2),
xfield(lsirdyf , 1),
xfield(lserdyf , 1),
xfield(hsirdyf , 1),
xfield(hserdyf , 1),
xfield(pllrdyf , 1),
xfield(plli2srdyf , 1),
xfield(pllsairdyf , 1),
xfield(cssf , 1),
xfield(lsirdyie , 1),
xfield(lserdyie , 1),
xfield(hsirdyie , 1),
xfield(hserdyie , 1),
xfield(pllrdyie , 1),
xfield(plli2srdyie , 1),
xfield(pllsairdyie , 1),
xrsv(1),
xfield(lsirdyc , 1),
xfield(lserdyc , 1),
xfield(hsirdyc , 1),
xfield(hserdyc , 1),
xfield(pllrdyc , 1),
xfield(plli2srdyc , 1),
xfield(pllsairdyc , 1),
xfield(cssc , 1),
xrsv(8),
#define xarg 0
#include"extern/stm32/private/gen_rcc.hpp"
#define xarg 1
#include"extern/stm32/private/gen_rcc.hpp"
#define xarg 2
#include"extern/stm32/private/gen_rcc.hpp"
xfield(lseon , 1),
xfield(lserdy , 1),
xfield(lsebyp , 1),
xfield(lsedrv , 2),
xrsv(3),
xfield(rtcsel , 2),
xrsv(5),
xfield(rtcen , 1),
xfield(bdrst , 1),
xrsv(15),
xfield(lsion , 1),
xfield(lsirdy , 1),
xrsv(14 + 8),
xfield(rmvf , 1),
xfield(borrstf , 1),
xfield(pinrstf , 1),
xfield(porrstf , 1),
xfield(sftrstf , 1),
xfield(iwdgrstf , 1),
xfield(wwdgrstf , 1),
xfield(lpwrrstf , 1),
xrsv(32),
xrsv(32),
xfield(modper , 13),
xfield(incstep , 15),
xrsv(2),
xfield(spreadsel , 1),
xfield(sscgen , 1),
// to be continue...
field_bits,
};
public:
xinner(_rcc)
xrw(bool, reset_backup_domain, bdrst)
// TODO:comment
union{
xrw(u32, period, modper)
xrw(u32, step, incstep)
xrw(rcc_spread_mode, mode, spreadsel)
xrw(bool, enable, sscgen)
} spread_spectrum;
union{
xro(bool, bor_reset, borrstf)
xro(bool, pin_reset, pinrstf)
xro(bool, por_reset, porrstf)
xro(bool, software_reset, sftrstf)
xro(bool, iwdg_reset, iwdgrstf)
xro(bool, wwdg_reset, wwdgrstf)
xro(bool, lpwr_reset, lpwrrstf)
void clear_all(){
xset(rmvf, true);
}
} flag;
union{
xrw(bool, enable, lseon)
xro(bool, ready, lserdy)
xrw(bool, bypass, lsebyp)
xrw(rcc_drive_capability, drive_capability, lsedrv)
} lse;
union{
xrw(bool, enable, lsion)
xro(bool, ready, lsirdy)
} lsi;
union{
xrw(bool, enable, hsion)
xro(bool, ready, hsirdy)
xrw(u32 , triming, hsitrim)
xro(u32 , calibration, hsical)
} hsi;
union{
xrw(bool, enable, hseon)
xro(bool, ready, hserdy)
xrw(bool, bypass, hsebyp)
xrw(bool, use_safe_clock, csson)
// divsion from hse
// rtc clock need equals to 1MHz
xrw(rcc_for_rtc, for_rtc, rtcpre)
} hse;
union{
xrw(bool, enable, plli2son)
xro(bool, ready, plli2srdy)
xrw(rcc_source_for_i2s, source, i2ssrc)
} i2s;
union{
xrw(bool, enable, pllsaion)
xro(bool, ready, pllsairdy)
} sai;
union{
xrw(bool, enable, pllon)
xro(bool, ready, pllrdy)
// f(vco) = f(pll input) * (mul / div)
// f(pll normal) = f(vco) / for_sclk
// f(usb otg fs/sdio/random) = f(vco) / for_otg_sdio_random
union{
// division for vco input frequency
// notice:
// div must in range [2, 63]
xrw(u32, div, pllm)
// multiplier for vco output frequency
// notice:
// vco input freq * mul must in range [192, 432] MHz
xrw(u32, mul, plln)
// division for main system clock(sclk) when pll as the sclk
// notice:
// make sure sclk freqence no more than 180MHz
// only 2, 4, 6, 8 is legal
xrw(rcc_for_sclk, for_sclk, pllp)
// division for usb otg fs/sdio/random
// notice:
// usb otg fs need 48MHz frequence
// sdio/random need less equal than 48MHz
// for_otg_sdio_random must in range [2, 15]
xrw(rcc_for_otg_sdio_random, for_otg_sdio_random, pllq)
} freq;
xrw(rcc_source_for_pll, source, pllsrc)
} pll;
union{
xrw(rcc_source_for_sclk, source, sw)
xro(rcc_source_for_sclk, current_source, sws)
} sclk;
union{
// division from sclk
// ahb clock not less than 25MHz
xrw(rcc_source_for_ahb, source, hpre)
} ahb;
union{
// division from ahb
// apb clock no more than 54MHz
xrw(rcc_source_for_apb, source, ppre1)
} apb1;
union{
// division from ahb
// apb clock no more than 108MHz
xrw(rcc_source_for_apb, source, ppre2)
} apb2;
union{
xrw(bool, enable, rtcen)
xrw(rcc_source_for_rtc, source, rtcsel)
} rtc;
union{
xrw(rcc_source_for_mco1, source, mcoa)
xrw(rcc_for_mco, freq, mcoapre)
} mco1;
union{
xrw(rcc_source_for_mco2, source, mcob)
xrw(rcc_for_mco, freq, mcobpre)
} mco2;
// those property can be set clear/enable/disable
// and read for check whether the event is occur.
union{
xevent(lsi_ready , lsirdyf , lsirdyc , lsirdyie)
xevent(lse_ready , lserdyf , lserdyc , lserdyie)
xevent(hsi_ready , hsirdyf , hsirdyc , hsirdyie)
xevent(hse_ready , hserdyf , hserdyc , hserdyie)
xevent(pll_ready , pllrdyf , pllrdyc , pllrdyie)
xevent(plli2s_ready, plli2srdyf, plli2srdyc, plli2srdyie)
xevent(pllsai_ready, pllsairdyf, pllsairdyc, pllsairdyie)
xevent(hse_broken , cssf , cssc , csson)
auto & clear_all(){
lsi_ready = clear;
lse_ready = clear;
hsi_ready = clear;
hse_ready = clear;
pll_ready = clear;
plli2s_ready = clear;
pllsai_ready = clear;
hse_broken = clear;
return this[0];
}
} event;
xport(gpioa)
xport(gpiob)
xport(gpioc)
xport(gpiod)
xport(gpioe)
xport(gpiof)
xport(gpiog)
xport(gpioh)
xport(gpioi)
xport(gpioj)
xport(gpiok)
xport(crc)
xport_lp(axi)
xport_lp(flash)
xport_lp(sram1)
xport_lp(sram2)
xport_en_lp(backup_sram)
xport_en_lp(tdcm_ram)
xport(dma1)
xport(dma2)
xport(dma2d)
xport(eth)
xport_en_lp(eth_tx)
xport_en_lp(eth_rx)
xport_en_lp(eth_ptp)
xport(otghs)
xport_en_lp(otghs_ulpi)
xport(dcmi)
xport(crypto)
xport(hash)
xport(random)
xport(otgfs)
xport(fmc)
xport(qspi)
xport(tim2)
xport(tim3)
xport(tim4)
xport(tim5)
xport(tim6)
xport(tim7)
xport(tim12)
xport(tim13)
xport(tim14)
xport(lptim1)
xport(wwdg)
xport(spi2)
xport(spi3)
xport(spdif_rx)
xport(uart2)
xport(uart3)
xport(uart4)
xport(uart5)
xport(i2c1)
xport(i2c2)
xport(i2c3)
xport(i2c4)
xport(can1)
xport(can2)
xport(cec)
xport(pwr)
xport(dac)
xport(uart7)
xport(uart8)
xport(tim1)
xport(tim8)
xport(usart1)
xport(usart6)
xport_rst(adc)
xport_en_lp(adc1)
xport_en_lp(adc2)
xport_en_lp(adc3)
xport(sdmmc1)
xport(spi1)
xport(spi4)
xport(syscfg)
xport(tim9)
xport(tim10)
xport(tim11)
xport(spi5)
xport(spi6)
xport(sai1)
xport(sai2)
xport(ltdc)
};
#undef xevent
#undef xport
#undef xport_lp
#undef xport_rst
#undef xport_en_lp
}
namespace mixc::extern_stm32_rcc::origin{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
inline static _rcc<0x40023800> rcc;
#pragma GCC diagnostic pop
}
#endif
xexport_space(mixc::extern_stm32_rcc::origin)
| 30.97254 | 85 | 0.419209 | Better-Idea |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.