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
bdca10dd283e3e72c5305613605227c50d78bb0f
1,062
cpp
C++
proj4/PongGame.cpp
bakerjm24450/EE142
71ac007fe6850ced5b57336edfd9ddbae37f28c3
[ "MIT" ]
null
null
null
proj4/PongGame.cpp
bakerjm24450/EE142
71ac007fe6850ced5b57336edfd9ddbae37f28c3
[ "MIT" ]
null
null
null
proj4/PongGame.cpp
bakerjm24450/EE142
71ac007fe6850ced5b57336edfd9ddbae37f28c3
[ "MIT" ]
null
null
null
// Our Pong Game #include <Game.hpp> #include <Vector2d.hpp> #include <Keyboard.hpp> #include <Color.hpp> #include "PongGame.h" #include "Ball.h" #include "Wall.h" using namespace vmi; // Create the game window PongGame::PongGame() : Game("Pong-ish", 640, 480), done(false) { // create the ball ball = new Ball(); // create the walls topWall = new Wall(Vector2d(0, 0), Vector2d(639, 1), Vector2d(0, 1)); bottomWall = new Wall(Vector2d(0, 478), Vector2d(639, 479), Vector2d(0, -1)); leftWall = new Wall(Vector2d(0, 1), Vector2d(1, 478), Vector2d(1, 0)); rightWall = new Wall(Vector2d(638, 1), Vector2d(639, 478), Vector2d(-1, 0)); // serve the ball ball->serve(Vector2d(100, 240), Vector2d(1, 0)); } PongGame::~PongGame() { delete ball; delete topWall; delete bottomWall; delete leftWall; delete rightWall; } // Per-frame update for game play void PongGame::update(double dt) { // intentionally blank } // Whether or not the game is over bool PongGame::isOver() const { return done; }
20.423077
79
0.645951
bakerjm24450
bdcc523c3973e8d9b3dd26d7cda0166aebdf59de
417
cpp
C++
sesion1/ejercicio_voltaje.cpp
dmateos-ugr/FP
6d3ec8eeccbb72582367c8cf97aecb2227cc7b9e
[ "MIT" ]
1
2018-12-11T09:32:59.000Z
2018-12-11T09:32:59.000Z
sesion1/ejercicio_voltaje.cpp
dmateos-ugr/FP
6d3ec8eeccbb72582367c8cf97aecb2227cc7b9e
[ "MIT" ]
null
null
null
sesion1/ejercicio_voltaje.cpp
dmateos-ugr/FP
6d3ec8eeccbb72582367c8cf97aecb2227cc7b9e
[ "MIT" ]
2
2018-11-13T12:32:35.000Z
2018-11-27T14:43:30.000Z
#include <iostream> using namespace std; int main(){ double intensidad; double resistencia; double voltaje; cout << "Introduzca el valor de la intensidad: "; cin >> intensidad; cout << "Introduzca el valor de la resistencia: "; cin >> resistencia; voltaje = resistencia*intensidad; cout << "El valor del voltaje resultante es " << voltaje << endl; return 0; }
20.85
69
0.628297
dmateos-ugr
bdd2332404ec0f7842784cdfe9c22d1b54510d48
8,558
hpp
C++
MadgwickFilter/Quaternion/Quaternion.hpp
calm0815/robotrack
c3aedfa1d76173fe2729972d5a94ebb3bd84e3a1
[ "MIT" ]
3
2018-11-03T15:58:49.000Z
2019-04-11T22:46:32.000Z
MadgwickFilter/Quaternion/Quaternion.hpp
calm0815/robotrack
c3aedfa1d76173fe2729972d5a94ebb3bd84e3a1
[ "MIT" ]
null
null
null
MadgwickFilter/Quaternion/Quaternion.hpp
calm0815/robotrack
c3aedfa1d76173fe2729972d5a94ebb3bd84e3a1
[ "MIT" ]
null
null
null
#ifndef _QUATERNION_HPP_ #define _QUATERNION_HPP_ #include "Vector3/Vector3.hpp" /** * クォータニオンの足し,引き,掛け算などを簡単にできるようになります. * @author Gaku MATSUMOTO * @bref クォータニオンを使えるクラスです. */ class Quaternion{ public: /** @bref Quaternionインスタンスを生成します */ Quaternion(){ w = 1.0f; x = 0.0f; y = 0.0f; z = 0.0f; }; /** * @bref Vector3クラスからクォータニオンを作ります */ Quaternion(Vector3 vector){ Set(vector); } /** * @bref クォータニオンを回転軸と回転角度によって初期化します。 * @param vec 回転軸となる3次元ベクトル * @param angle 回転角 [rad] */ Quaternion(Vector3 vec, float angle){ Set(vec, angle); } /** @bref 要素を代入しながら,インスタンスを生成します. @param[in] _w 実部wの初期値 @param[in] _x 虚部iの初期値 @param[in] _y 虚部jの初期値 @param[in] _z 虚部kの初期値 */ Quaternion(float _w, float _x, float _y, float _z){ w = _w; x = _x; y = _y; z = _z; }; public: float w; float x; float y; float z; public: /** @bref クォータニオンの要素をコピーします. @note 通常の数のように代入できます */ Quaternion operator=(Quaternion r){ w = r.w; x = r.x; y = r.y; z = r.z; return *this; }; /** @bref クォータニオンを足して代入します. @note 通常の数のように代入できます */ Quaternion operator+=(Quaternion r){ w += r.w; x += r.x; y += r.y; z += r.z; return *this; }; /** @bref クォータニオンを引いて代入します. @note 通常の数のように代入できます */ Quaternion operator-=(Quaternion r){ w -= r.w; x -= r.x; y -= r.y; z -= r.z; return *this; }; /** * @bref クォータニオンの掛け算をします. * @note この際も順序は重要です. */ Quaternion operator*=(Quaternion r){ static Quaternion QQ; QQ.w = w*r.w - x*r.x - y*r.y - z*r.z; QQ.x = x*r.w + w*r.x - z*r.y + y*r.z; QQ.y = y*r.w + z*r.x + w*r.y - x*r.z; QQ.z = z*r.w - y*r.x + x*r.y + w*r.z; w = QQ.w; x = QQ.x; y = QQ.y; z = QQ.z; return *this; }; /** @bref クォータニオンの複素共役を返します. @note 本当はアスタリスクが良かったのですが,ポインタと紛らわしいのでマイナスにしました. */ Quaternion operator-(){ Quaternion Q; Q.w = w; Q.x = -x; Q.y = -y; Q.z = -z; return Q; }; /** @bref クォータニオンを正規化して,単位クォータニオンにします. @note 掛け算などを行うたびに実行することをお勧めします. @note ただ、クォータニオンの時間微分は正規化してはいけません */ void Normalize(){ float norm = sqrt(w*w + x*x + y*y + z*z); if (norm != 0.0f){ w /= norm; x /= norm; y /= norm; z /= norm; return; } else{ return; } }; /** * @bref クォータニオンを初期化します */ template <typename T> void Set(T _w, T _x, T _y, T _z); /** * @bref クォータニオンをVector3クラスで初期化します。 */ void Set(Vector3 vec); /** * @bref クォータニオンを回転軸と回転角度によって初期化します。 * param vec 回転軸となる3次元ベクトル * param angle 回転角 [rad] */ void Set(Vector3 vec, float angle){ vec.Normalize(); float halfAngle = 0.5f * angle ; w = cosf(halfAngle); x = vec.x * sinf(halfAngle); y = vec.y * sinf(halfAngle); z = vec.z * sinf(halfAngle); } /** * @bref クォータニオンの各要素に配列のようにアクセスします */ float q(int i){ float ans = 0.0; switch (i){ case 1: ans = w; break; case 2: ans = x; break; case 3: ans = y; break; case 4: ans = z; break; } return ans; } /** * @bref クォータニオンのノルムを計算します */ float Norm(){ return fabsf(w*w + x*x + y*y + z*z); } /** クォータニオンとクォータニオンを比較して等しければtrue 等しくなければfalse*/ bool operator==(Quaternion Q){ if (w == Q.w && x == Q.x && y == Q.y && z == Q.z){ return true; } return false; } /** クォータニオンとクォータニオンを比較して等しくなければtrue 等しければfalse*/ bool operator!=(Quaternion Q){ if (w == Q.w && x == Q.x && y == Q.y && z == Q.z){ return false; } return true; } /** * @bref 2つの3次元ベクトルを一致させるクォータニオンを計算 * @param from 始点となるベクトルのインスタンス * @param to 終点となるベクトルのインスタンス */ void FromToRotation(Vector3 from, Vector3 to); /** @bref オイラー角で姿勢を取得します. @param val ロール,ピッチ,ヨーの順に配列に格納します.3つ以上の要素の配列を入れてください. @note 値は[rad]です.[degree]に変換が必要な場合は別途計算して下さい. */ void GetEulerAngle(float *val){ float q0q0 = w * w, q1q1q2q2 = x * x - y * y, q3q3 = z * z; val[0] = (atan2f(2.0f * (w * x + y * z), q0q0 - q1q1q2q2 + q3q3)); val[1] = (-asinf(2.0f * (x * z - w * y))); val[2] = (atan2f(2.0f * (x * y + w * z), q0q0 + q1q1q2q2 - q3q3)); } /** @bref オイラー角で姿勢を取得します. @param val ロール,ピッチ,ヨーの順に配列に格納します.3つ以上の要素の配列を入れてください. @note 値は[rad]です.[degree]に変換が必要な場合は別途計算して下さい. */ void GetEulerAngle(Vector3 *v) { float q0q0 = w * w, q1q1q2q2 = x * x - y * y, q3q3 = z * z; v->x = (atan2f(2.0f * (w * x + y * z), q0q0 - q1q1q2q2 + q3q3)); v->y = (-asinf(2.0f * (x * z - w * y))); v->z = (atan2f(2.0f * (x * y + w * z), q0q0 + q1q1q2q2 - q3q3)); } /** * @bref クォータニオンをVector3クラスに変換します * @note クォータニオンのx,y,z成分を持ったベクトルを作ります */ Vector3 ToVector3(){ Vector3 vec3(x, y, z); return vec3; } /** * @bref 3次元ベクトルを回転します * @param v 回転させたい3次元ベクトルのポインタ * @note 余計なオブジェクトを作りません */ void Rotation(Vector3* v) { if (v == NULL) return; static float ww = 0.0f; static float xx = 0.0f; static float yy = 0.0f; static float zz = 0.0f; static float vx = 0.0f, vy = 0.0f, vz = 0.0f; static float _wx, _wy, _wz, _xy, _zx, _yz; ww = w * w; xx = x * x; yy = y * y; zz = z * z; _wx = w * x; _wy = w * y; _wz = w * z; _xy = x * y; _zx = z * x; _yz = y * z; vx = (ww + xx - yy - zz) * v->x + 2.0f*(_xy - _wz)*v->y + 2.0f*(_zx + _wy) * v->z; vy = 2.0f * (_xy + _wz) * v->x + (ww - xx + yy - zz) * v->y + 2.0f*(_yz - _wx)*v->z; vz = 2.0f * (_zx - _wy) * v->x + 2.0f * (_wx + _yz)*v->y + (ww - xx - yy + zz)*v->z; v->x = vx; v->y = vy; v->z = vz; } /** * @bref 3次元ベクトルを回転します.ただし逆回転です * @param v 回転させたい3次元ベクトルのポインタ * @note 余計なオブジェクトを作りません */ void InvRotation(Vector3* v) { if (v == NULL) return; static float ww = 0.0f; static float xx = 0.0f; static float yy = 0.0f; static float zz = 0.0f; static float vx = 0.0f, vy = 0.0f, vz = 0.0f; static float _wx, _wy, _wz, _xy, _xz, _yz; ww = w * w; xx = x * x; yy = y * y; zz = z * z; _wx = w * x; _wy = w * y; _wz = w * z; _xy = x * y; _xz = x * z; _yz = y * z; vx = (ww + xx - yy - zz) * v->x + 2.0f*(_xy + _wz)*v->y + 2.0f*(_xz - _wy) * v->z; vy = 2.0f * (_xy - _wz) * v->x + (ww - xx + yy - zz) * v->y + 2.0f*(_yz + _wx)*v->z; vz = 2.0f * (_xz + _wy) * v->x + 2.0f * (-_wx + _yz)*v->y + (ww - xx - yy + zz)*v->z; v->x = vx; v->y = vy; v->z = vz; } }; void Quaternion::FromToRotation(Vector3 from, Vector3 to){ float halfTheta = 0.5f * from.Angle(to);//回転角度 0からpi/2 Vector3 axis = from * to; axis.Normalize(); w = cos(halfTheta); x = axis.x * sin(halfTheta); y = axis.y * sin(halfTheta); z = axis.z * sin(halfTheta); } template<typename T>void Quaternion::Set(T _w, T _x, T _y, T _z){ w = _w; x = _x; y = _y; z = _z; return; } void Quaternion::Set(Vector3 vec){ w = 0.0; x = vec.x; y = vec.y; z = vec.z; return; } /** * @fn Quaternion operator*(Quaternion l, Quaternion r) * @bref クォータニオンの掛け算をします.この際,順序が重要です. */ Quaternion operator*(Quaternion l, Quaternion r){ static Quaternion Q; Q.w = l.w*r.w - l.x*r.x - l.y*r.y - l.z*r.z; Q.x = l.x*r.w + l.w*r.x - l.z*r.y + l.y*r.z; Q.y = l.y*r.w + l.z*r.x + l.w*r.y - l.x*r.z; Q.z = l.z*r.w - l.y*r.x + l.x*r.y + l.w*r.z; return Q; }; /** * @fn Quaternion operator*(double s, Quaternion q) * @bref クォータニオンをスカラー倍します. */ Quaternion operator*(float s, Quaternion q){ static Quaternion Q; Q.w = q.w * s; Q.x = q.x * s; Q.y = q.y * s; Q.z = q.z * s; return Q; }; /** * @fn Quaternion operator*(Quaternion q, double s) * @bref クォータニオンをスカラー倍します. */ Quaternion operator*(Quaternion q, float s){ static Quaternion Q; Q.w = q.w * s; Q.x = q.x * s; Q.y = q.y * s; Q.z = q.z * s; return Q; }; /** */ Vector3 operator*(Quaternion q, Vector3 v) { static Vector3 ans; static float ww = 0.0f; static float xx = 0.0f; static float yy = 0.0f; static float zz = 0.0f; //static float vx = 0.0f, vy = 0.0f, vz = 0.0f; static float _wx, _wy, _wz, _xy, _zx, _yz; ww = q.w * q.w; xx = q.x * q.x; yy = q.y * q.y; zz = q.z * q.z; _wx = q.w * q.x; _wy = q.w * q.y; _wz = q.w * q.z; _xy = q.x * q.y; _zx = q.z * q.x; _yz = q.y * q.z; ans.x = (ww + xx - yy - zz) * v.x + 2.0f*(_xy - _wz)*v.y + 2.0f*(_zx + _wy) * v.z; ans.y = 2.0f * (_xy + _wz) * v.x + (ww - xx + yy - zz) * v.y + 2.0f*(_yz - _wx)*v.z; ans.z = 2.0f * (_zx - _wy) * v.x + 2.0f * (_wx + _yz)*v.y + (ww - xx - yy + zz)*v.z; return ans; } /** @bref クォータニオンの足し算をします. */ Quaternion operator+(Quaternion l, Quaternion r){ static Quaternion Q; Q.w = l.w + r.w; Q.x = l.x + r.x; Q.y = l.y + r.y; Q.z = l.z + r.z; return Q; } /** @bref クォータニオンの引き算をします. */ Quaternion operator-(Quaternion l, Quaternion r){ static Quaternion Q; Q.w = l.w - r.w; Q.x = l.x - r.x; Q.y = l.y - r.y; Q.z = l.z - r.z; return Q; } #endif
19.102679
87
0.550946
calm0815
bdd4533dbcf1e985c9bdb2b026299460f56eaf0f
1,545
cpp
C++
week2/Searching and Sorting/Search in a Rotated Array.cpp
rishabhrathore055/gfg-11-weeks-workshop-on-DSA
052039bfbe3ae261740fc73d50f32528ddd49e6a
[ "MIT" ]
9
2021-08-01T16:17:04.000Z
2022-01-22T19:51:18.000Z
week2/Searching and Sorting/Search in a Rotated Array.cpp
rishabhrathore055/gfg-11-weeks-workshop-on-DSA
052039bfbe3ae261740fc73d50f32528ddd49e6a
[ "MIT" ]
null
null
null
week2/Searching and Sorting/Search in a Rotated Array.cpp
rishabhrathore055/gfg-11-weeks-workshop-on-DSA
052039bfbe3ae261740fc73d50f32528ddd49e6a
[ "MIT" ]
1
2021-08-30T12:26:11.000Z
2021-08-30T12:26:11.000Z
#include<bits/stdc++.h> using namespace std; int Search(vector<int> , int); int main() { int t; cin>>t; while(t--) { int n; cin>>n; vector<int> v(n); for(int i=0;i<n;i++) cin>>v[i]; int target; cin>>target; cout<<Search(v,target)<<endl; } } int binary_search(vector<int>arr,int l , int h , int k) { if (h < l) return -1; int mid=(l+h)/2; if (k == arr[mid]) return mid; else if (k > arr[mid]) return binary_search(arr, (mid + 1), h, k); else return binary_search(arr, l, (mid - 1), k); } int findpivot(vector<int>arr, int low, int high) { if (high < low) return -1; if (high == low) return low; int mid = (low + high) / 2; if (mid < high && arr[mid] > arr[mid + 1]) return mid; else if (mid > low && arr[mid] < arr[mid - 1]) return (mid - 1); else if (arr[low] >= arr[mid]) return findpivot(arr, low, mid - 1); else return findpivot(arr, mid + 1, high); } int Search(vector<int>A, int target) { int n = A.size(); int pivot=findpivot(A,0,n-1); if(pivot==-1) { return binary_search(A,0,n-1,target); } if(A[pivot]==target) return pivot; else if(A[0]<=target) return binary_search(A,0,pivot-1,target); else return binary_search(A,pivot+1,n-1,target); }
22.071429
55
0.471845
rishabhrathore055
752a2a1c33f360e89df42e5b02fece2122c6b95c
26,965
cpp
C++
src/state_manager.cpp
cognicept-admin/rosrect_listener_Agent
d1fdc435e28d413379f6e7dd98fca4e72cf853f1
[ "BSD-3-Clause" ]
6
2020-05-07T14:26:23.000Z
2021-05-03T01:02:35.000Z
src/state_manager.cpp
cognicept-admin/error_resolution_diagnoser
6666b0597904a005ef90d0d82463544c88e6068c
[ "BSD-3-Clause" ]
1
2020-05-18T04:41:00.000Z
2020-06-04T07:03:17.000Z
src/state_manager.cpp
cognicept-admin/error_resolution_diagnoser
6666b0597904a005ef90d0d82463544c88e6068c
[ "BSD-3-Clause" ]
3
2020-09-23T03:54:39.000Z
2021-09-29T12:10:07.000Z
#include <error_resolution_diagnoser/state_manager.h> using namespace web::json; // JSON features using namespace web; // Common features like URIs. StateManager::StateManager() { // Boolean flag to decide whether to suppress a message or not this->suppress_flag = false; // Timeout parameter in minutes for alert timeout this->alert_timeout_limit = 5.0; } std::vector<std::string> StateManager::does_exist(std::string robot_code, std::string msg_text) { // Find if msg is already recorded for the given robot code std::vector<std::vector<std::string>>::const_iterator row; for (row = this->msg_data.begin(); row != this->msg_data.end(); row++) { if ((find(row->begin(), row->end(), msg_text) != row->end()) && (find(row->begin(), row->end(), robot_code) != row->end())) return *(row); } std::vector<std::string> emptyString; emptyString.push_back(""); return emptyString; } void StateManager::check_message(std::string agent_type, std::string robot_code, const rosgraph_msgs::Log::ConstPtr &data, json::value telemetry) { if (agent_type == "ECS") { // std::cout << "Checking with ECS..." << std::endl; this->check_message_ecs(robot_code, data, telemetry); } else if ((agent_type == "ERT") || (agent_type == "DB")) { // std::cout << "Checking with ERT..." << std::endl; this->check_message_ert(robot_code, data, telemetry); } else { // std::cout << "Checking with ROS..." << std::endl; this->check_message_ros(robot_code, data, telemetry); } } void StateManager::check_message_ecs(std::string robot_code, const rosgraph_msgs::Log::ConstPtr &data, json::value telemetry) { // Parse message to query-able format std::string msg_text = data->msg; // std::replace(msg_text.begin(), msg_text.end(), '/', ' '); // std::cout << "Querying: " << msg_text << std::endl; // Check error classification, ECS json::value msg_info = this->api_instance.check_error_classification(msg_text); bool ecs_hit = !(msg_info.is_null()); // std::cout << "ECS Hit: " << ecs_hit << std::endl; if (ecs_hit) { // ECS has a hit, follow the message cycle // std::cout << "JSON parsed"; // msg_info = msg_info[0]; int error_level = (msg_info.at(utility::conversions::to_string_t("severity"))).as_integer(); // std::cout << "Level: " << error_level << std::endl; std::string error_msg = (msg_info.at(utility::conversions::to_string_t("error_text"))).as_string(); // std::cout << "Text: " << error_msg << std::endl; if ((error_level == 8) || (error_level == 16)) { // std::cout << "Error... " << data->msg << std::endl; // Check for suppression this->check_error(robot_code, error_msg); } else if (error_level == 4) { // std::cout << "Warning... " << data->msg << std::endl; // Check for suppression this->check_warning(robot_code, error_msg); } else { // std::cout << "Info... " << data->msg << std::endl; // Check for suppression this->check_info(robot_code, error_msg); } // Process result of event if (this->suppress_flag) { // If suppressed, do nothing // std::cout << "Suppressed!" << std::endl; } else { // std::cout << "Not suppressed!" << std::endl; // If not suppressed, send it to event to update this->event_instance.update_log(data, msg_info, telemetry, "ECS"); // Push to stream this->api_instance.push_event_log(this->event_instance.get_log()); // Get compounding flag bool cflag = (msg_info.at(utility::conversions::to_string_t("compounding_flag"))).as_bool(); if (cflag == true) { // Nothing to do here unless it is a compounding error if ((error_level == 8) || (error_level == 16)) { // Push on ALL errors / One named Info msg // Clear only event log since this is compounding this->event_instance.clear_log(); } else { // Nothing to do } } else { // This is a compounding log, Clear everything this->clear(); } } } else { // ECS does not have a hit, normal operation resumes } } void StateManager::check_message_ert(std::string robot_code, const rosgraph_msgs::Log::ConstPtr &data, json::value telemetry) { // Parse message to query-able format std::string msg_text = data->msg; // std::replace(msg_text.begin(), msg_text.end(), '/', ' '); // std::cout << "Querying: " << msg_text << std::endl; // Check error classification, ECS json::value msg_info = this->api_instance.check_error_classification(msg_text); bool ecs_hit = !(msg_info.is_null()); // std::cout << "ECS Hit: " << ecs_hit << std::endl; if (ecs_hit) { // ECS has a hit, follow the message cycle // std::cout << "JSON parsed"; // msg_info = msg_info[0]; int error_level = (msg_info.at(utility::conversions::to_string_t("error_level"))).as_integer(); // std::cout << "Level: " << error_level << std::endl; std::string error_msg = (msg_info.at(utility::conversions::to_string_t("error_text"))).as_string(); // std::cout << "Text: " << error_msg << std::endl; if (error_level == 8) { // std::cout << "Error... " << data->msg << std::endl; // Check for suppression this->check_error(robot_code, error_msg); } else if (error_level == 4) { // std::cout << "Warning... " << data->msg << std::endl; // Check for suppression this->check_warning(robot_code, error_msg); } else { // std::cout << "Info... " << data->msg << std::endl; // Check for suppression this->check_info(robot_code, error_msg); } // Process result of event if (this->suppress_flag) { // If suppressed, do nothing // std::cout << "Suppressed!" << std::endl; } else { // std::cout << "Not suppressed!" << std::endl; // If not suppressed, send it to event to update this->event_instance.update_log(data, msg_info, telemetry, "ERT"); // Push to stream this->api_instance.push_event_log(this->event_instance.get_log()); // Get compounding flag bool cflag = (msg_info.at(utility::conversions::to_string_t("compounding_flag"))).as_bool(); if (cflag == true) { // Nothing to do here unless it is a compounding error if (error_level == 8) { // Push on ALL errors / One named Info msg // Clear only event log since this is compounding this->event_instance.clear_log(); } else { // Nothing to do } } else { // This is a compounding log, Clear everything this->clear(); } } } else { // ECS does not have a hit, normal operation resumes } } void StateManager::check_message_ros(std::string robot_code, const rosgraph_msgs::Log::ConstPtr &data, json::value telemetry) { if (data->level == 8) { // std::cout << "Error... " << data->msg << std::endl; // Check for suppression this->check_error(robot_code, data->msg); } else if (data->level == 4) { // std::cout << "Warning... " << data->msg << std::endl; // Check for suppression this->check_warning(robot_code, data->msg); } else { // std::cout << "Info... " << data->msg << std::endl; // Check for suppression this->check_info(robot_code, data->msg); } // Process result of event if (this->suppress_flag) { // If suppressed, do nothing // std::cout << "Suppressed!" << std::endl; } else { // std::cout << "Not suppressed!" << std::endl; // If not suppressed, send it to event to update this->event_instance.update_log(data, json::value::null(), telemetry, "ROS"); // Push log this->api_instance.push_event_log(this->event_instance.get_log()); if ((data->level == 8) || (data->msg == "Goal reached")) { // Clear everything, end of event this->clear(); } else { // Clear only log this->event_instance.clear_log(); } } } void StateManager::check_error(std::string robot_code, std::string msg_text) { std::vector<std::string> found = this->does_exist(robot_code, msg_text); bool exist; if (found[0] == "") { exist = false; } else { exist = true; } if (exist) { // Found, suppress this->suppress_flag = true; } else { // Not found, add to data std::vector<std::string> msg_details; // Get current time time_t now; time(&now); char buf[sizeof "2011-10-08T07:07:09Z"]; strftime(buf, sizeof buf, "%FT%TZ", gmtime(&now)); std::string time_str = std::string(buf); // Push details to data msg_details.push_back(robot_code); msg_details.push_back(msg_text); msg_details.push_back(time_str); this->msg_data.push_back(msg_details); // Do not suppress this->suppress_flag = false; } } void StateManager::check_warning(std::string robot_code, std::string msg_text) { std::vector<std::string> found = this->does_exist(robot_code, msg_text); bool exist; if (found[0] == "") { exist = false; } else { exist = true; } if (exist) { // Found, check timeout limit - not implemented yet this->suppress_flag = true; } else { // Not found, add to data std::vector<std::string> msg_details; // Get current time time_t now; time(&now); char buf[sizeof "2011-10-08T07:07:09Z"]; strftime(buf, sizeof buf, "%FT%TZ", gmtime(&now)); std::string time_str = std::string(buf); // Push details to data msg_details.push_back(robot_code); msg_details.push_back(msg_text); msg_details.push_back(time_str); this->msg_data.push_back(msg_details); // Do not suppress this->suppress_flag = false; } } void StateManager::check_info(std::string robot_code, std::string msg_text) { std::vector<std::string> found = this->does_exist(robot_code, msg_text); bool exist; if (found[0] == "") { exist = false; // std::cout << "Msg found status: False" << std::endl; } else { exist = true; // std::cout << "Msg found status: True" << std::endl; } if (exist) { // Found, suppress this->suppress_flag = true; } else { // Not found, add to data std::vector<std::string> msg_details; // Get current time time_t now; time(&now); char buf[sizeof "2011-10-08T07:07:09Z"]; strftime(buf, sizeof buf, "%FT%TZ", gmtime(&now)); std::string time_str = std::string(buf); // Push details to data msg_details.push_back(robot_code); msg_details.push_back(msg_text); msg_details.push_back(time_str); this->msg_data.push_back(msg_details); // Do not suppress this->suppress_flag = false; } } void StateManager::check_heartbeat(bool status, json::value telemetry) { // Pass data to backend to push appropriate status this->api_instance.push_status(status, telemetry); } void StateManager::check_diagnostic(std::string agent_type, std::string robot_code, std::vector<diagnostic_msgs::DiagnosticStatus> current_diag, json::value telemetry) { // this->check_diagnostic_ros(robot_code, current_diag, telemetry); if (agent_type == "ECS") { // std::cout << "Checking with ECS..." << std::endl; this->check_diagnostic_ecs(robot_code, current_diag, telemetry); } else if ((agent_type == "ERT") || (agent_type == "DB")) { // std::cout << "Checking with ERT..." << std::endl; this->check_diagnostic_ert(robot_code, current_diag, telemetry); } else { // std::cout << "Checking with ROS..." << std::endl; this->check_diagnostic_ros(robot_code, current_diag, telemetry); } } void StateManager::check_diagnostic_ros(std::string robot_code, std::vector<diagnostic_msgs::DiagnosticStatus> current_diag, json::value telemetry) { // Check diagnostic data and if not suppressed, push it to the event // Variables to store diagnostic info for state management std::string diag_str; int diag_level; std::string diag_ident; for (unsigned int idx = 0; idx < current_diag.size(); idx++) { // Store diagnostics name+hardware_id in a single string for quick search diag_str = current_diag[idx].name + "_" + current_diag[idx].hardware_id; // Diagnostics level. Main determination for state suppression diag_level = static_cast<int>(current_diag[idx].level); // std::cout << "Checking: " << diag_level << " " << diag_str << std::endl; // Check if diagnostic needs to be suppressed. All diagnostics with the same str // and no change in level are suppressed. We process only when there is change in levels. this->check_diag_data(robot_code, diag_str, std::to_string(diag_level)); if (this->suppress_flag) { // If suppressed, do nothing // std::cout << "Suppressed!" << std::endl; } else { std::string diag_name = current_diag[idx].name; std::string diag_hwid = current_diag[idx].hardware_id; if (!diag_name.empty()) { diag_ident = diag_name; } else if (!diag_hwid.empty()) { diag_ident = diag_hwid; } // If not suppressed, send it to event to update // Construct ROS log equivalent of diag rosgraph_msgs::Log rosmsg; rosmsg.name = diag_str; if (!diag_ident.empty()) { rosmsg.msg = diag_ident + "-->" + current_diag[idx].message; } else { rosmsg.msg = current_diag[idx].message; } if (diag_level == 2) { rosmsg.level = rosmsg.ERROR; rosmsg.msg = "[ERROR] " + rosmsg.msg; } else if ((diag_level == 1) || (diag_level == 3)) { rosmsg.level = rosmsg.WARN; rosmsg.msg = "[WARN] " + rosmsg.msg; } else { rosmsg.level = rosmsg.INFO; rosmsg.msg = "[INFO] " + rosmsg.msg; } std::cout << "Diagnostic Message State Change: " << rosmsg.msg << std::endl; rosgraph_msgs::Log::ConstPtr data(new rosgraph_msgs::Log(rosmsg)); this->event_instance.update_log(data, json::value::null(), telemetry, "ROS"); // Push log this->api_instance.push_event_log(this->event_instance.get_log()); // if (data->level == 8) // { // // Clear everything, end of event // this->clear(); // } // else // { // // Clear only log // this->event_instance.clear_log(); // } } } } void StateManager::check_diagnostic_ert(std::string robot_code, std::vector<diagnostic_msgs::DiagnosticStatus> current_diag, json::value telemetry) { // Check diagnostic data and if not suppressed, push it to the event // Variables to store diagnostic info for state management std::string diag_str; int diag_level; std::string diag_ident; for (unsigned int idx = 0; idx < current_diag.size(); idx++) { // Store diagnostics name+hardware_id in a single string for quick search diag_str = current_diag[idx].name + "_" + current_diag[idx].hardware_id; // Diagnostics level. Main determination for state suppression diag_level = static_cast<int>(current_diag[idx].level); // Check if diagnostic needs to be suppressed. All diagnostics with the same str // and no change in level are suppressed. We process only when there is change in levels. this->check_diag_data(robot_code, diag_str, std::to_string(diag_level)); if (this->suppress_flag) { // If suppressed, do nothing // std::cout << "Suppressed!" << std::endl; } else { std::string diag_name = current_diag[idx].name; std::string diag_hwid = current_diag[idx].hardware_id; if (!diag_name.empty()) { diag_ident = diag_name; } else if (!diag_hwid.empty()) { diag_ident = diag_hwid; } // If not suppressed, send it to event to update // Parse message to query-able format std::string msg_text; if (!diag_ident.empty()) { msg_text = diag_ident + "-->" + current_diag[idx].message; } else { msg_text = current_diag[idx].message; } if (diag_level == 2) { msg_text = "[ERROR] " + msg_text; } else if ((diag_level == 1) || (diag_level == 3)) { msg_text = "[WARN] " + msg_text; } else { msg_text = "[INFO] " + msg_text; } std::cout << "Diagnostic Message State Change: " << msg_text << std::endl; // Check error classification, ECS json::value msg_info = this->api_instance.check_error_classification(msg_text); bool ecs_hit = !(msg_info.is_null()); // std::cout << "ECS Hit: " << ecs_hit << std::endl; if (ecs_hit) { // Construct ROS log equivalent of diag rosgraph_msgs::Log rosmsg; rosmsg.name = diag_str; rosmsg.msg = msg_text; if (diag_level == 2) { rosmsg.level = rosmsg.ERROR; } else if ((diag_level == 1) || (diag_level == 3)) { rosmsg.level = rosmsg.WARN; } else { rosmsg.level = rosmsg.INFO; } rosgraph_msgs::Log::ConstPtr data(new rosgraph_msgs::Log(rosmsg)); this->event_instance.update_log(data, msg_info, telemetry, "ERT"); // Push log this->api_instance.push_event_log(this->event_instance.get_log()); } else { // ECS does not have a hit, normal operation resumes } // if (data->level == 8) // { // // Clear everything, end of event // this->clear(); // } // else // { // // Clear only log // this->event_instance.clear_log(); // } } } } void StateManager::check_diagnostic_ecs(std::string robot_code, std::vector<diagnostic_msgs::DiagnosticStatus> current_diag, json::value telemetry) { // Check diagnostic data and if not suppressed, push it to the event // Variables to store diagnostic info for state management std::string diag_str; int diag_level; std::string diag_ident; for (unsigned int idx = 0; idx < current_diag.size(); idx++) { // Store diagnostics name+hardware_id in a single string for quick search diag_str = current_diag[idx].name + "_" + current_diag[idx].hardware_id; // Diagnostics level. Main determination for state suppression diag_level = static_cast<int>(current_diag[idx].level); // Check if diagnostic needs to be suppressed. All diagnostics with the same str // and no change in level are suppressed. We process only when there is change in levels. this->check_diag_data(robot_code, diag_str, std::to_string(diag_level)); if (this->suppress_flag) { // If suppressed, do nothing // std::cout << "Suppressed!" << std::endl; } else { std::string diag_name = current_diag[idx].name; std::string diag_hwid = current_diag[idx].hardware_id; if (!diag_name.empty()) { diag_ident = diag_name; } else if (!diag_hwid.empty()) { diag_ident = diag_hwid; } // If not suppressed, send it to event to update // Parse message to query-able format std::string msg_text; if (!diag_ident.empty()) { msg_text = diag_ident + "-->" + current_diag[idx].message; } else { msg_text = current_diag[idx].message; } if (diag_level == 2) { msg_text = "[ERROR] " + msg_text; } else if ((diag_level == 1) || (diag_level == 3)) { msg_text = "[WARN] " + msg_text; } else { msg_text = "[INFO] " + msg_text; } std::cout << "Diagnostic Message State Change: " << msg_text << std::endl; // Check error classification, ECS json::value msg_info = this->api_instance.check_error_classification(msg_text); bool ecs_hit = !(msg_info.is_null()); // std::cout << "ECS Hit: " << ecs_hit << std::endl; if (ecs_hit) { // Construct ROS log equivalent of diag rosgraph_msgs::Log rosmsg; rosmsg.name = diag_str; rosmsg.msg = msg_text; if (diag_level == 2) { rosmsg.level = rosmsg.ERROR; } else if ((diag_level == 1) || (diag_level == 3)) { rosmsg.level = rosmsg.WARN; } else { rosmsg.level = rosmsg.INFO; } rosgraph_msgs::Log::ConstPtr data(new rosgraph_msgs::Log(rosmsg)); this->event_instance.update_log(data, msg_info, telemetry, "ECS"); // Push log this->api_instance.push_event_log(this->event_instance.get_log()); } else { // ECS does not have a hit, normal operation resumes } // if (data->level == 8) // { // // Clear everything, end of event // this->clear(); // } // else // { // // Clear only log // this->event_instance.clear_log(); // } } } } void StateManager::check_diag_data(std::string robot_code, std::string diag_str, std::string level) { // Check if diagnostic already reported std::vector<std::string> found = this->does_diag_exist(robot_code, diag_str, level); bool exist; if (found[0] == "") { exist = false; } else { exist = true; } if (exist) { // Found, suppress this->suppress_flag = true; } else { // Not found, add to data std::vector<std::string> diag_details; // Get current time time_t now; time(&now); char buf[sizeof "2011-10-08T07:07:09Z"]; strftime(buf, sizeof buf, "%FT%TZ", gmtime(&now)); std::string time_str = std::string(buf); // Push details to data diag_details.push_back(robot_code); diag_details.push_back(diag_str); diag_details.push_back(level); diag_details.push_back(time_str); this->diag_data.push_back(diag_details); // Do not suppress this->suppress_flag = false; } } std::vector<std::string> StateManager::does_diag_exist(std::string robot_code, std::string diag_str, std::string level) { // Find if diagnostic is already recorded for the given robot code at the given level std::vector<std::vector<std::string>>::const_iterator row; std::vector<std::vector<std::vector<std::string>>::const_iterator> erase_list; for (row = this->diag_data.begin(); row != this->diag_data.end(); row++) { auto found_name = find(row->begin(), row->end(), diag_str); if (found_name != row->end()) { // Found name, check for other parameters if ((find(row->begin(), row->end(), level) != row->end()) && (find(row->begin(), row->end(), robot_code) != row->end())) { // Found level as well, just return the row since it is already reported return *(row); } else { // Level not found but name is. This means state has changed. // Add row to erase list. // Will add a new row with this name downstream. erase_list.push_back(row); } } } // Erase elements for (auto element : erase_list) { this->diag_data.erase(element); } // Return empty string if no match std::vector<std::string> emptyString; emptyString.push_back(""); return emptyString; } void StateManager::clear() { // Clears the state manager data for a new session this->suppress_flag = false; this->msg_data.clear(); this->event_instance.clear(); }
31.318235
167
0.531096
cognicept-admin
752db47227df30cc728e232d1b1026633ca70523
1,234
cpp
C++
bitbots_splines_extension/src/handle/position_handle.cpp
5reichar/bitbots_kick_engine
0817f4f0a206de6f0f01a0cedfe201f62e677a11
[ "BSD-3-Clause" ]
null
null
null
bitbots_splines_extension/src/handle/position_handle.cpp
5reichar/bitbots_kick_engine
0817f4f0a206de6f0f01a0cedfe201f62e677a11
[ "BSD-3-Clause" ]
null
null
null
bitbots_splines_extension/src/handle/position_handle.cpp
5reichar/bitbots_kick_engine
0817f4f0a206de6f0f01a0cedfe201f62e677a11
[ "BSD-3-Clause" ]
null
null
null
#include "handle/position_handle.h" namespace bitbots_splines { PositionHandle::PositionHandle(std::shared_ptr<Curve> x, std::shared_ptr<Curve> y, std::shared_ptr<Curve> z) : x_(std::move(x)), y_(std::move(y)), z_(std::move(z)) { } geometry_msgs::Point PositionHandle::get_geometry_msg_position(double time) { geometry_msgs::Point msg; tf2::Vector3 tf_vec = get_position(time); msg.x = tf_vec.x(); msg.y = tf_vec.y(); msg.z = tf_vec.z(); return msg; } tf2::Vector3 PositionHandle::get_position(double time) { tf2::Vector3 pos; pos[0] = x_->position(time); pos[1] = y_->position(time); pos[2] = z_->position(time); return pos; } tf2::Vector3 PositionHandle::get_velocity(double time) { tf2::Vector3 vel; vel[0] = x_->velocity(time); vel[1] = y_->velocity(time); vel[2] = z_->velocity(time); return vel; } tf2::Vector3 PositionHandle::get_acceleration(double time) { tf2::Vector3 acc; acc[0] = x_->acceleration(time); acc[1] = y_->acceleration(time); acc[2] = z_->acceleration(time); return acc; } std::shared_ptr<Curve> PositionHandle::x() { return x_; } std::shared_ptr<Curve> PositionHandle::y() { return y_; } std::shared_ptr<Curve> PositionHandle::z() { return z_; } }
22.851852
109
0.676661
5reichar
753acc92fb7bcfa2bc75b5a5260671e628e0ce24
8,866
cpp
C++
x86/vm/ops/store.cpp
zero-rp/ZVM
66319025a4dfff813e580f68a0183841de9a72cd
[ "MIT" ]
9
2019-03-08T07:56:12.000Z
2021-03-06T01:57:43.000Z
x86/vm/ops/store.cpp
zero-rp/ZVM
66319025a4dfff813e580f68a0183841de9a72cd
[ "MIT" ]
null
null
null
x86/vm/ops/store.cpp
zero-rp/ZVM
66319025a4dfff813e580f68a0183841de9a72cd
[ "MIT" ]
2
2019-03-16T12:47:05.000Z
2019-09-15T15:03:50.000Z
/** Copyright (c) 2007 - 2010 Jordan "Earlz/hckr83" Earls <http://www.Earlz.biz.tm> 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. The name of the author 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 THE AUTHOR 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. This file is part of the x86Lib project. **/ #include <x86lib.h> namespace x86Lib { using namespace std; void x86CPU::op_mov_r8_imm8() { //0xB0+r SetReg8(opbyte - 0xB0, ReadCode8(1)); eip++; } void x86CPU::op_mov_rW_immW() { //0xB8+r SetReg(opbyte - 0xB8, ReadCodeW(1)); eip += OperandSize(); } void x86CPU::op_mov_sr_rm16() { //0x8E ModRM rm(this); //need ModRM for parsing, but otherwise it's a no-op } void x86CPU::op_mov_rm16_sr() { //0x8C ModRM rm(this); rm.WriteWord(0); } void x86CPU::op_mov_rW_rmW() { ModRM rm(this); SetReg(rm.GetExtra(), rm.ReadW()); } void x86CPU::op_mov_rmW_rW() { ModRM rm(this); rm.WriteW(Reg(rm.GetExtra())); } void x86CPU::op_mov_al_m8() { SetReg8(AL, ReadByteA(DS, ImmA())); } void x86CPU::op_mov_axW_mW() { SetReg(AX, ReadWA(DS, ImmA())); } void x86CPU::op_mov_rm8_r8() { ModRM rm(this); rm.WriteByte(Reg8(rm.GetExtra())); } void x86CPU::op_mov_r8_rm8() { ModRM rm(this); SetReg8(rm.GetExtra(), rm.ReadByte()); } void x86CPU::op_mov_m8_al() { WriteByte(DS, ImmA(), Reg8(AL)); } void x86CPU::op_mov_mW_axW() { WriteWA(DS, ImmA(), Reg(AX)); } void x86CPU::op_mov_rm8_imm8() { ModRM rm(this); //eventually fix this so that if r is used, then invalid opcode... rm.WriteByte(ReadByte(cCS, eip + rm.GetLength())); eip++; } void x86CPU::op_mov_rmW_immW() { ModRM rm(this); rm.WriteW(ReadW(cCS, eip + rm.GetLength())); eip += OperandSize(); } void x86CPU::op_lds() { throw new CpuInt_excp(GPF_IEXCP); } void x86CPU::op_les() { throw new CpuInt_excp(GPF_IEXCP); } void x86CPU::op_lea() { ModRM rm(this); SetReg(rm.GetExtra(), rm.ReadOffset()); } void x86CPU::op_push_imm8() { Push(ReadCode8(1)); eip++; } void x86CPU::op_push_rmW(ModRM &rm) { Push(rm.ReadW()); } void x86CPU::op_push_immW() { //0x68 Push(ImmW()); } void x86CPU::op_push_rW() { //0x50+reg Push(Reg(opbyte - 0x50)); } void x86CPU::op_push_es() { Push(0); } void x86CPU::op_push_cs() { Push(0); } void x86CPU::op_push_ds() { Push(0); } void x86CPU::op_push_ss() { Push(0); } void x86CPU::op_push_fs() { Push(0); } void x86CPU::op_push_gs() { Push(0); } void x86CPU::op_pop_rmW(ModRM &rm) { rm.WriteW(Pop()); } void x86CPU::op_pop_rW() { //0x58+reg SetReg(opbyte - 0x58, Pop()); } void x86CPU::op_pop_es() { Pop(); } void x86CPU::op_pop_ss() { Pop(); } void x86CPU::op_pop_ds() { Pop(); } void x86CPU::op_pop_fs() { Pop(); } void x86CPU::op_pop_gs() { Pop(); } void x86CPU::op_out_imm8_al() { uint8_t tmp = Reg8(AL); Ports->Write(ReadCode8(1), 1, &tmp); eip++; } void x86CPU::op_out_imm8_axW() { uint32_t tmp = Reg(AX); if (OperandSize16) { Ports->Write(ReadCode8(1), 2, (void*)&tmp); } else { Ports->Write(ReadCode8(1), 4, (void*)&tmp); } eip++; } void x86CPU::op_out_dx_al() { uint8_t tmp = Reg8(AL); Ports->Write(Reg16(DX), 1, (void*)&tmp); } void x86CPU::op_out_dx_axW() { uint32_t tmp = Reg(AX); if (OperandSize16) { Ports->Write(Reg16(DX), 2, (void*)&tmp); } else { Ports->Write(Reg16(DX), 4, (void*)&tmp); } } void x86CPU::op_in_al_imm8() { uint8_t tmp; Ports->Read(ReadCode8(1), 1, (void*)&tmp); SetReg8(AL, tmp); eip++; } void x86CPU::op_in_axW_imm8() { uint32_t tmp; if (OperandSize16) { Ports->Read(ReadCode8(1), 2, (void*)&tmp); } else { Ports->Read(ReadCode8(1), 4, (void*)&tmp); } SetReg(AX, tmp); eip++; } void x86CPU::op_in_al_dx() { uint8_t tmp; Ports->Read(Reg16(DX), 1, (void*)&tmp); SetReg8(AL, tmp); } void x86CPU::op_in_axW_dx() { uint32_t tmp; if (OperandSize16) { Ports->Read(Reg16(DX), 2, (void*)&tmp); } else { Ports->Read(Reg16(DX), 4, (void*)&tmp); } SetReg(AX, tmp); } void x86CPU::op_xchg_rm8_r8() { #ifndef X86_MULTITHREADING if (IsLocked() == 1) { eip--; return; } #endif Lock(); ModRM rm(this); uint8_t tmp = Reg8(rm.GetExtra()); SetReg8(rm.GetExtra(), rm.ReadByte()); rm.WriteByte(tmp); Unlock(); } void x86CPU::op_xchg_rmW_rW() { #ifndef X86_MULTITHREADING if (IsLocked() == 1) { eip--; return; } #endif Lock(); ModRM rm(this); uint32_t tmp = Reg(rm.GetExtra()); SetReg(rm.GetExtra(), rm.ReadW()); rm.WriteW(tmp); Unlock(); } void x86CPU::op_xchg_axW_rW() { //0x90+r uint32_t tmp = Reg(AX); SetReg(AX, Reg(opbyte - 0x90)); SetReg(opbyte - 0x90, tmp); } void x86CPU::op_xlatb() { SetReg8(AL, ReadByteA(DS, RegA(BX) + (Reg8(AL)))); } void x86CPU::op_movzx_rW_rm8() { ModRM rm(this); SetReg(rm.GetExtra(), rm.ReadByte()); } void x86CPU::op_movzx_r32_rmW() { ModRM rm(this); regs32[rm.GetExtra()] = rm.ReadWord(); } void x86CPU::op_pushaW() { uint32_t tmp; tmp = Reg(SP); Push(Reg(AX)); Push(Reg(CX)); Push(Reg(DX)); Push(Reg(BX)); Push(tmp); Push(Reg(BP)); Push(Reg(SI)); Push(Reg(DI)); } void x86CPU::op_popaW() { uint32_t ofs = 0; if (OperandSize16) { ofs = 2; } else { ofs = 4; } SetReg(DI, Pop()); SetReg(SI, Pop()); SetReg(BP, Pop()); SetReg(SP, Reg(SP) + ofs); SetReg(BX, Pop()); SetReg(DX, Pop()); SetReg(CX, Pop()); SetReg(AX, Pop()); } void x86CPU::op_enter() { uint16_t size = ReadCode16(1); eip += 2; uint8_t nestingLevel = ReadCode8(1) % 32; eip += 1; Push(Reg(EBP)); uint32_t frameTemp = Reg(ESP); for (int i = 1; i < nestingLevel; ++i) { if (OperandSize16) { SetReg(EBP, Reg(EBP) - 2); } else { SetReg(EBP, Reg(EBP) - 4); } Push(Reg(EBP)); } if (nestingLevel > 0) { Push(frameTemp); } SetReg(EBP, frameTemp); SetReg(ESP, Reg(EBP) - size); } void x86CPU::op_leave() { SetReg(ESP, Reg(EBP)); SetReg(EBP, Pop()); } void x86CPU::op_movsx_rW_rm8() { ModRM rm(this); SetReg(rm.GetExtra(), SignExtend8to32(rm.ReadByte())); } void x86CPU::op_pushf() { Push(freg.data); } void x86CPU::op_popf() { freg.data = Pop(); } };
22.733333
80
0.533724
zero-rp
753bebc066f0f4bc0f6d4b49bfbc299d14e4cafe
8,167
cpp
C++
src/engine/map2d/map2disoobjectslayer.cpp
dream-overflow/o3d
087ab870cc0fd9091974bb826e25c23903a1dde0
[ "FSFAP" ]
2
2019-06-22T23:29:44.000Z
2019-07-07T18:34:04.000Z
src/engine/map2d/map2disoobjectslayer.cpp
dream-overflow/o3d
087ab870cc0fd9091974bb826e25c23903a1dde0
[ "FSFAP" ]
null
null
null
src/engine/map2d/map2disoobjectslayer.cpp
dream-overflow/o3d
087ab870cc0fd9091974bb826e25c23903a1dde0
[ "FSFAP" ]
null
null
null
/** * @file map2disoobjectslayer.cpp * @brief * @author Frederic SCHERMA (frederic.scherma@dreamoverflow.org) * @date 2001-12-25 * @copyright Copyright (c) 2001-2017 Dream Overflow. All rights reserved. * @details */ #include "o3d/engine/map2d/map2disoobjectslayer.h" #include "o3d/engine/map2d/map2dvisibility.h" #include "o3d/engine/scene/scene.h" #include "o3d/engine/object/camera.h" #include "o3d/engine/context.h" #include <algorithm> using namespace o3d; O3D_IMPLEMENT_DYNAMIC_CLASS1(Map2dIsoObjectsLayer, ENGINE_MAP_2D_OBJECT_LAYER, Map2dLayer) Map2dIsoObjectsLayer::Map2dIsoObjectsLayer( BaseObject *parent, const Box2i &area, UInt32 maxDepth, UInt32 maxObjectsPerCell) : Map2dLayer(parent), m_sort(True), m_box(area), m_visibility(nullptr) { m_visibility = new Map2dVisibility( area.pos(), nextPow2(max(area.width(), area.height())), max((UInt32)1, maxDepth), maxObjectsPerCell); } Map2dIsoObjectsLayer::~Map2dIsoObjectsLayer() { m_visibility->clear(); IT_Map2dObjectList it = m_objects.begin(); while (it != m_objects.end()) { deletePtr(*it); ++it; } deletePtr(m_visibility); } Bool Map2dIsoObjectsLayer::deleteChild(BaseObject *child) { if (child) { if (child->getParent() != this) O3D_ERROR(E_InvalidParameter("The parent child differ from this")); else { // object should be type of Map2dObject Map2dObject *object = dynamicCast<Map2dObject*>(child); if (object) { IT_Map2dObjectList it = m_objects.begin(); for (; it != m_objects.end(); ++it) { if ((*it) == object) break; } // remove the object of the son list if (it != m_objects.end()) { // remove it from the quadtree if (m_visibility != nullptr) m_visibility->removeObject(object); m_sort = True; m_objects.erase(it); object->setNode(nullptr); } deletePtr(object); } else { // otherwise simply delete it deletePtr(child); } return True; } } return False; } UInt32 Map2dIsoObjectsLayer::getNumElt() const { return m_objects.size(); } const Transform *Map2dIsoObjectsLayer::getTransform() const { return nullptr; } Transform *Map2dIsoObjectsLayer::getTransform() { return nullptr; } void Map2dIsoObjectsLayer::update() { if (!getActivity()) return; clearUpdated(); Bool dirty = False; if (getNode() && getNode()->hasUpdated()) { // the parent has change so the child need to be updated dirty = True; } if (dirty) { setUpdated(); } // check if a sort is necessary at the next draw m_sort |= m_visibility->hasUpdated(); m_visibility->clearUpdated(); /* // update each son (recursively if necessary) TODO optimize that for (IT_Map2dObjectList it = m_objects.begin(); it != m_objects.end(); ++it) { Map2dObject *object = (*it); if (object->getActivity()) { // compute object absolute matrix object->update(); if (object->hasUpdated()) { // only for drawable and dynamic objects if (object->hasDrawable()) { m_visibility->updateObject(object); m_sort = True; } } } }*/ } void Map2dIsoObjectsLayer::draw(const DrawInfo &drawInfo) { if (!m_capacities.getBit(STATE_ACTIVITY) || !m_capacities.getBit(STATE_VISIBILITY)) return; setUpModelView(); if (getScene()->getDrawObject(Scene::DRAW_MAP_2D_LAYER)) { // TODO Symbolics a quad in red } Camera *camera = getScene()->getActiveCamera(); // process to a sort on the visible area if necessary if (m_sort || camera->isCameraChanged()) { Vector3 camPos = camera->getAbsoluteMatrix().getTranslation(); Box2i viewport( camPos.x() - (-camera->getLeft() + camera->getRight()) / 2, camPos.y() - (camera->getBottom() - camera->getTop()) / 2, -camera->getLeft() + camera->getRight(), camera->getBottom() - camera->getTop()); m_drawList.clear(); /*UInt32 rejected = */m_visibility->checkVisibleObject(viewport); T_Map2dObjectList &drawList = m_visibility->getDrawList(); m_drawList.reserve(drawList.size()); // inject for sort for (Map2dObject *object : drawList) { m_drawList.push_back(object); } std::sort(m_drawList.begin(), m_drawList.end(), &Map2dObject::compare); m_sort = False; //System::print(String::print("rejected object=%u", rejected), ""); //System::print(m_visibility->getTreeView(), ""); } for (Map2dObject *object : m_drawList) { object->draw(drawInfo); } } UInt32 Map2dIsoObjectsLayer::getNumSon() const { return m_objects.size(); } Bool Map2dIsoObjectsLayer::hasSon(SceneObject *object) const { CIT_Map2dObjectList cit = m_objects.begin(); for (; cit != m_objects.cend(); ++cit) { if ((*cit) == object) return True; } return False; } SceneObject* Map2dIsoObjectsLayer::findSon(const String &name) { if (getName() == name) return this; for (IT_Map2dObjectList it = m_objects.begin(); it != m_objects.end(); ++it) { SceneObject *object = (*it); if (object->isNodeObject()) { SceneObject *result = ((BaseNode*)object)->findSon(name); if (result) return result; } else if (object->getName() == name) return object; } return nullptr; } const SceneObject* Map2dIsoObjectsLayer::findSon(const String &name) const { if (getName() == name) return this; for (CIT_Map2dObjectList it = m_objects.begin(); it != m_objects.end(); ++it) { const SceneObject *object = (*it); if (object->isNodeObject()) { const SceneObject *result = ((BaseNode*)object)->findSon(name); if (result) return result; } else if (object->getName() == name) return object; } return nullptr; } Bool Map2dIsoObjectsLayer::findSon(SceneObject *object) const { if (this == object) return True; for (CIT_Map2dObjectList it = m_objects.begin(); it != m_objects.end(); ++it) { const SceneObject *search = (*it); if (search->isNodeObject()) { Bool result = ((BaseNode*)search)->findSon(object); if (result) return True; } else if (search == object) return True; } return False; } const T_Map2dObjectList &Map2dIsoObjectsLayer::getObjects() { return m_objects; } const T_Map2dObjectList& Map2dIsoObjectsLayer::getVisiblesObjects() { return m_visibility->getDrawList(); } Bool Map2dIsoObjectsLayer::isObjectIntersect(const Box2i &box) const { return m_visibility->isObjectIntersect(box); } Bool Map2dIsoObjectsLayer::isObjectBaseIntersect(const Map2dObject *from) const { return m_visibility->isObjectBaseIntersect(from); } Map2dObject* Map2dIsoObjectsLayer::addObject( const String &name, const Vector2i &pos, const Rect2i &baseRect, Map2dTileSet *tileSet, UInt32 tileId) { Map2dObject *object = new Map2dObject(this); object->setName(name); object->setNode(this); object->setTile(tileSet, tileId); object->setBaseRect(baseRect); object->setPos(pos); m_objects.push_back(object); m_sort = True; m_visibility->addObject(object); return object; } // remove a specified son void Map2dIsoObjectsLayer::removeObject(Map2dObject *object) { IT_Map2dObjectList it = m_objects.begin(); for (; it != m_objects.end(); ++it) { if ((*it) == object) break; } if (it == m_objects.end()) { O3D_ERROR(E_InvalidParameter("Object not found")); } else { m_visibility->removeObject(object); // remove the object of the son list m_objects.erase(it); // no node object->setParent(getScene()); object->setNode(nullptr); object->setPersistant(False); m_sort = True; } } void Map2dIsoObjectsLayer::updateObject(Map2dObject *object) { } //void Map2dIsoObjectsLayer::moveObject(Map2dObject *object, const Vector2i &pos) //{ // if (object != nullptr) // { // object->setPos(pos); // m_visibility->updateObject(object); // } //} // Remove all sons (delete objects if no longer used) void Map2dIsoObjectsLayer::deleteAllObjects() { IT_Map2dObjectList it = m_objects.begin(); while (it != m_objects.end()) { deletePtr(*it); ++it; } m_objects.clear(); m_visibility->clear(); m_sort = True; }
20.623737
90
0.668177
dream-overflow
753f1e0eb88b1ed2be6875a7cfba33cf116bbc4d
14,916
cpp
C++
addons/ofxCvGui/src/ofxCvGui/Controller.cpp
syeminpark/openFrame
2d117bf86ae58dbc2d5d0ddc6727f14e5627e6e6
[ "MIT" ]
null
null
null
addons/ofxCvGui/src/ofxCvGui/Controller.cpp
syeminpark/openFrame
2d117bf86ae58dbc2d5d0ddc6727f14e5627e6e6
[ "MIT" ]
null
null
null
addons/ofxCvGui/src/ofxCvGui/Controller.cpp
syeminpark/openFrame
2d117bf86ae58dbc2d5d0ddc6727f14e5627e6e6
[ "MIT" ]
null
null
null
#include "pch_ofxCvGui.h" //---------- OFXSINGLETON_DEFINE(ofxCvGui::Controller); namespace ofxCvGui { //---------- Controller::Controller() { this->maximised = false; this->chromeVisible = true; this->mouseOwner = nullptr; this->lastClickOwner = nullptr; this->lastMouseClick = pair<long long, ofMouseEventArgs>(std::numeric_limits<long long>::min(), ofMouseEventArgs()); this->cachedWidth = 0.0f; this->cachedHeight = 0.0f; } //---------- void Controller::init(shared_ptr<Panels::Groups::Base> rootGroup) { ofBackground(30); ofAddListener(ofEvents().update, this, &Controller::update); ofAddListener(ofEvents().draw, this, &Controller::draw); ofAddListener(ofEvents().mouseMoved, this, &Controller::mouseMoved); ofAddListener(ofEvents().mousePressed, this, &Controller::mousePressed); ofAddListener(ofEvents().mouseReleased, this, &Controller::mouseReleased); ofAddListener(ofEvents().mouseDragged, this, &Controller::mouseDragged); ofAddListener(ofEvents().mouseScrolled, this, &Controller::mouseScrolled); ofAddListener(ofEvents().keyPressed, this, &Controller::keyPressed); ofAddListener(ofEvents().keyReleased, this, &Controller::keyReleased); ofAddListener(ofEvents().fileDragEvent, this, &Controller::filesDragged); ofAddListener(ofEvents().windowResized, this, &Controller::windowResized); ofAddListener(ofEvents().exit, this, &Controller::exit, 0); ofxAssets::Register::X().addAddon("ofxCvGui"); rootGroup->setBounds(ofGetCurrentViewport()); this->rootGroup = rootGroup; this->currentPanel = PanelPtr(); this->currentPanelBounds = ofGetCurrentViewport(); //cache fonts ofxAssets::font("ofxCvGui::swisop3", 12); ofxAssets::font("ofxCvGui::swisop3", 14); ofxAssets::font("ofxCvGui::swisop3", 18); ofxAssets::font("ofxCvGui::swisop3", 24); } //---------- void Controller::add(PanelPtr panel) { if (!this->rootGroup) return; this->rootGroup->add(panel); } //---------- void Controller::remove(PanelPtr panel) { if (!this->rootGroup) return; this->rootGroup->remove(panel); } //---------- void Controller::clear() { if (!this->rootGroup) return; this->rootGroup->clear(); } //---------- void Controller::toggleFullscreen() { ofToggleFullscreen(); } //---------- void Controller::toggleMaximised() { if (!this->maximised) { //maximise current panel auto currentPanel = this->currentPanel.lock(); if (currentPanel) { this->setMaximised(currentPanel); currentPanel->setBounds(ofGetCurrentViewport()); } } else { //clear maximise this->clearMaximised(); } } //---------- void Controller::setMaximised(PanelPtr panel) { this->maximised = true; this->currentPanel = panel; this->currentPanelBounds = ofGetCurrentViewport(); panel->setBounds(ofRectangle(0, 0, ofGetScreenWidth(), ofGetScreenHeight())); } //---------- void Controller::clearMaximised() { this->maximised = false; rootGroup->setBounds(ofGetCurrentViewport()); this->updateCurrentPanel(); } //---------- void Controller::showChrome() { this->chromeVisible = true; } //---------- void Controller::hideChrome() { this->chromeVisible = false; } //---------- void Controller::setActiveDialog(PanelPtr panel) { if (panel) { auto bounds = ofGetCurrentViewport(); //first get a cached draw for the background this->activeDialogBackground.grabScreen(0, 0, ofGetWindowWidth(), ofGetWindowHeight()); //setup the active Dialog this->activeDialog = panel; //setup the size of the Dialog ofResizeEventArgs resizeArgs = { ofGetViewportWidth(), ofGetViewportHeight() }; this->windowResized(resizeArgs); } else { this->closeActiveDialog(); } } //---------- void Controller::closeActiveDialog() { if (this->activeDialog) { this->onDialogClose.notifyListeners(this->activeDialog); this->activeDialog.reset(); //setup the size of the root group ofResizeEventArgs resizeArgs = { ofGetViewportWidth(), ofGetViewportHeight() }; this->windowResized(resizeArgs); } } //---------- bool Controller::isDialogOpen() { return (this->activeDialog.get()); } //---------- void Controller::update(ofEventArgs& args) { if (!this->rootGroup) { return; } InspectController::X().update(); if (this->activeDialog) { this->activeDialog->update(); } else if (this->maximised) { this->currentPanel.lock()->update(); } else { rootGroup->update(); } } //---------- void Controller::draw(ofEventArgs& args) { if (!this->rootGroup) { return; } DrawArguments rootDrawArguments; rootDrawArguments.chromeEnabled = this->chromeVisible; rootDrawArguments.naturalBounds = ofGetCurrentViewport(); rootDrawArguments.globalTransform = glm::mat4(); rootDrawArguments.globalScale = 1.0f; rootDrawArguments.localBounds = ofRectangle(0, 0, rootDrawArguments.naturalBounds.getWidth(), rootDrawArguments.naturalBounds.getHeight()); rootDrawArguments.globalBounds = rootDrawArguments.naturalBounds; auto currentPanel = this->currentPanel.lock(); if (this->activeDialog) { this->activeDialogBackground.draw(rootDrawArguments.naturalBounds); ofPushStyle(); { //draw light box background ofEnableAlphaBlending(); ofSetColor(0, 200); ofDrawRectangle(rootDrawArguments.naturalBounds); //shadow for dialog ofFill(); ofSetColor(0, 100); ofPushMatrix(); { ofTranslate(5, 5); ofDrawRectangle(this->activeDialog->getBounds()); } ofPopMatrix(); //background for dialog ofSetColor(80); ofDrawRectangle(this->activeDialog->getBounds()); } ofPopStyle(); this->activeDialog->draw(rootDrawArguments); } else { if (this->maximised) { currentPanel->draw(rootDrawArguments); } else { //highlight panel if (currentPanel) { ofPushStyle(); ofEnableAlphaBlending(); ofSetColor(40, 40, 40, 100); ofDrawRectangle(this->currentPanelBounds); ofPopStyle(); } this->rootGroup->draw(rootDrawArguments); } } for (const auto & delayedDrawCommand : this->delayedDrawCommands) { delayedDrawCommand(); } this->delayedDrawCommands.clear(); } //---------- void Controller::exit(ofEventArgs & args) { this->rootGroup.reset(); ofRemoveListener(ofEvents().update, this, &Controller::update); ofRemoveListener(ofEvents().draw, this, &Controller::draw); ofRemoveListener(ofEvents().mouseMoved, this, &Controller::mouseMoved); ofRemoveListener(ofEvents().mousePressed, this, &Controller::mousePressed); ofRemoveListener(ofEvents().mouseReleased, this, &Controller::mouseReleased); ofRemoveListener(ofEvents().mouseDragged, this, &Controller::mouseDragged); ofRemoveListener(ofEvents().keyPressed, this, &Controller::keyPressed); ofRemoveListener(ofEvents().keyReleased, this, &Controller::keyReleased); ofRemoveListener(ofEvents().fileDragEvent, this, &Controller::filesDragged); ofRemoveListener(ofEvents().windowResized, this, &Controller::windowResized); } //---------- PanelGroupPtr Controller::getRootGroup() const { return this->rootGroup; } //---------- void Controller::setRootGroup(PanelGroupPtr rootGroup) { this->rootGroup = rootGroup; this->rootGroup->arrange(); } //---------- PanelPtr Controller::getPanelUnderCursor(const glm::vec2 & position) { if (this->maximised) { return currentPanel.lock(); } else { ofRectangle panelBounds = this->rootGroup->getBounds(); return this->findPanelUnderCursor(panelBounds, position); } } //---------- void Controller::drawDelayed(function<void()> && drawFunction) { this->delayedDrawCommands.emplace_back(drawFunction); } //---------- void Controller::mouseMoved(ofMouseEventArgs & args) { if (!this->rootGroup) { return; } auto currentPanel = this->currentPanel.lock(); MouseArguments action(MouseArguments(args, MouseArguments::Moved, rootGroup->getBounds(), currentPanel, this->mouseOwner)); this->mouseAction(action); this->updateCurrentPanel(); } //---------- void Controller::mousePressed(ofMouseEventArgs & args) { if (!this->rootGroup) { return; } auto thisMouseClick = pair<long long, ofMouseEventArgs>(ofGetElapsedTimeMillis(), args); bool isDoubleClick = (thisMouseClick.first - this->lastMouseClick.first) < OFXCVGUI_DOUBLECLICK_TIME_THRESHOLD_MS; auto distanceSinceLastClick = glm::distance( (glm::vec2) thisMouseClick.second, (glm::vec2) this->lastMouseClick.second ); isDoubleClick &= distanceSinceLastClick < OFXCVGUI_DOUBLECLICK_SPACE_THRESHOLD_PX; if (isDoubleClick) { this->mouseOwner = this->lastClickOwner; } auto currentPanel = this->currentPanel.lock(); auto action = MouseArguments(args, isDoubleClick ? MouseArguments::Action::DoubleClick : MouseArguments::Action::Pressed, rootGroup->getBounds(), currentPanel, this->mouseOwner); if (this->activeDialog && !this->activeDialog->getBounds().inside(action.local)) { this->closeActiveDialog(); } else { this->mouseAction(action); } this->mouseCached = action.global; this->mouseOwner = action.getOwner(); this->lastMouseClick = thisMouseClick; } //---------- void Controller::mouseReleased(ofMouseEventArgs & args) { if (!this->rootGroup) { return; } auto currentPanel = this->currentPanel.lock(); MouseArguments action(args, MouseArguments::Released, rootGroup->getBounds(), currentPanel, this->mouseOwner); this->mouseAction(action); this->lastClickOwner = this->mouseOwner; this->mouseOwner = nullptr; } //---------- void Controller::mouseDragged(ofMouseEventArgs & args) { if (!this->rootGroup) { return; } auto currentPanel = this->currentPanel.lock(); MouseArguments action(args, MouseArguments::Dragged, rootGroup->getBounds(), currentPanel, this->mouseOwner, mouseCached); this->mouseAction(action); this->mouseCached = action.global; } //---------- void Controller::mouseScrolled(ofMouseEventArgs& args) { if (!this->rootGroup) { return; } auto panelUnderCursor = this->getPanelUnderCursor(args); if (panelUnderCursor) { MouseArguments action(args, MouseArguments::Scrolled, rootGroup->getBounds(), panelUnderCursor, this->mouseOwner, mouseCached); this->mouseAction(action); } } //---------- void Controller::mouseAction(MouseArguments & action) { if (this->activeDialog) { this->activeDialog->mouseAction(action); } else { auto currentPanel = this->currentPanel.lock(); if (this->maximised) { currentPanel->mouseAction(action); } else { rootGroup->mouseAction(action); } } } //---------- void Controller::keyReleased(ofKeyEventArgs & args) { if (!this->rootGroup) { return; } auto currentPanel = this->currentPanel.lock(); KeyboardArguments action(args, KeyboardArguments::Released, currentPanel); if (this->activeDialog) { this->activeDialog->keyboardAction(action); } else { if (this->maximised) { //if something is maximised, only it get the key press currentPanel->keyboardAction(action); } else { //otherwise everything visible gets the key press rootGroup->keyboardAction(action); } } } void Controller::keyPressed(ofKeyEventArgs & args) { if (!this->rootGroup) { return; } if (args.key == 0) { // This sometimes happens with mouse button 4 return; } if (!this->activeDialog) { if (args.key == 'f') this->toggleFullscreen(); if (args.key == 'm') this->toggleMaximised(); } auto currentPanel = this->currentPanel.lock(); KeyboardArguments action(args, KeyboardArguments::Pressed, currentPanel); if (this->activeDialog) { if (args.key == OF_KEY_ESC) { this->closeActiveDialog(); } else { this->activeDialog->keyboardAction(action); } } else { if (this->maximised) { //if something is maximised, only it get the key press currentPanel->keyboardAction(action); } else { //otherwise everything visible gets the key press rootGroup->keyboardAction(action); } } } //---------- void Controller::filesDragged(ofDragInfo & args) { if (!this->rootGroup) { return; } auto rootBounds = this->rootGroup->getBounds(); auto panel = this->findPanelUnderCursor(rootBounds); if (panel != PanelPtr()) { auto panelBounds = panel->getBounds(); auto panelTopLeft = panelBounds.getTopLeft(); auto newArgs = FilesDraggedArguments((glm::vec2) args.position - panelTopLeft, (glm::vec2) args.position, args.files); panel->onFilesDragged(newArgs); } } //---------- void Controller::windowResized(ofResizeEventArgs & args) { if (!this->rootGroup) { return; } const auto viewportBounds = ofRectangle(0, 0, args.width, args.height); if (this->activeDialog) { const auto padding = 80.0f; ofRectangle bounds = viewportBounds; bounds.x += padding; bounds.y += padding; bounds.width -= padding * 2.0f; bounds.height -= padding * 2.0f; //if bounds are too small, use all of it if (bounds.width < 200 || bounds.height < 200) { bounds = viewportBounds; } this->activeDialog->setBounds(bounds); } else { auto currentPanel = this->currentPanel.lock(); if (this->maximised) { currentPanel->setBounds(viewportBounds); } else { this->rootGroup->setBounds(viewportBounds); } } } //---------- bool Controller::checkInitialised() { if (this->rootGroup) return true; else { ofLogError("ofxCvGui") << "cannot perform this action as gui is not initialised"; return false; } } //---------- PanelPtr Controller::findPanelUnderCursor(ofRectangle & panelBounds, const glm::vec2 & position) { if (!this->rootGroup) { return PanelPtr(); } if (this->activeDialog) { return activeDialog; } else if (this->maximised) { return this->currentPanel.lock(); } else { return rootGroup->findScreen(position, panelBounds); } } //---------- void Controller::updateCurrentPanel() { if (!this->maximised) { auto currentPanelBounds = this->rootGroup->getBounds(); this->currentPanel = this->findPanelUnderCursor(currentPanelBounds); this->currentPanelBounds = currentPanelBounds; } } //---------- ofxCvGui::PanelPtr Controller::getActiveDialog() { return this->activeDialog; } //---------- void openDialog(PanelPtr panel) { Controller::X().setActiveDialog(panel); } //---------- void closeDialog(Panels::Base * panel) { if (Controller::X().getActiveDialog().get() == panel) { Controller::X().closeActiveDialog(); } } //---------- void closeDialog() { Controller::X().closeActiveDialog(); } //---------- bool isDialogOpen() { return Controller::X().isDialogOpen(); } }
26.635714
180
0.669482
syeminpark
7541639e7eebe2db9694f668a355f034bb9fab99
370
cpp
C++
acmicpc.net/9461.cpp
kbu1564/SimpleAlgorithm
7e5b0d2fe19461417d88de0addd2235da55787d3
[ "MIT" ]
4
2016-04-15T07:54:39.000Z
2021-01-11T09:02:16.000Z
acmicpc.net/9461.cpp
kbu1564/SimpleAlgorithm
7e5b0d2fe19461417d88de0addd2235da55787d3
[ "MIT" ]
null
null
null
acmicpc.net/9461.cpp
kbu1564/SimpleAlgorithm
7e5b0d2fe19461417d88de0addd2235da55787d3
[ "MIT" ]
null
null
null
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> using namespace std; int t,n; long long int A[101] = { 1, 1, 1, 0 }; int main() { scanf("%d", &t); for (int i = 0; i < t; i++) { scanf("%d", &n); for (int j = 3; j < n; j++) { A[j] = A[j-3] + A[j-2]; } printf("%lld\n", A[n-1]); } return 0; }
17.619048
38
0.486486
kbu1564
75464bec70a43a9e4d4ef45a6b757513d15e8a95
446
cpp
C++
src/test/main_victim_test.cpp
davitkalantaryan/wlac-sources
0878d97df0900b16f72c63f187be44ae9bef8949
[ "MIT" ]
null
null
null
src/test/main_victim_test.cpp
davitkalantaryan/wlac-sources
0878d97df0900b16f72c63f187be44ae9bef8949
[ "MIT" ]
4
2021-10-05T05:28:22.000Z
2021-12-28T22:48:21.000Z
src/test/main_victim_test.cpp
davitkalantaryan/wlac-sources
0878d97df0900b16f72c63f187be44ae9bef8949
[ "MIT" ]
null
null
null
// // file: main_victim_test.cpp // created on: 2018 Dec 18 // #ifndef CINTERFACE #define CINTERFACE #endif // !CINTERFACE #include <WinSock2.h> #include <WS2tcpip.h> #include <Windows.h> #include <stdio.h> static volatile int s_nRun = 1; int main() { int nPid = GetCurrentProcessId(); printf("pid=%d, lodaLibraryAddress=%p\n", nPid,&LoadLibraryA); s_nRun = 1; while(s_nRun){ SleepEx(INFINITE, TRUE); } }
15.928571
64
0.64574
davitkalantaryan
754b36c3ba2e2753bd7467e45a79c0e7acad2213
723
cpp
C++
emerald/util/tests/test_vector_util.cpp
blackencino/emerald
3c4823dbdeff7c63007ff359d262608227f5433f
[ "Apache-2.0" ]
3
2020-08-16T17:56:25.000Z
2021-02-25T21:55:39.000Z
emerald/util/tests/test_vector_util.cpp
blackencino/emerald
3c4823dbdeff7c63007ff359d262608227f5433f
[ "Apache-2.0" ]
null
null
null
emerald/util/tests/test_vector_util.cpp
blackencino/emerald
3c4823dbdeff7c63007ff359d262608227f5433f
[ "Apache-2.0" ]
null
null
null
#include <emerald/util/format.h> #include <emerald/util/foundation.h> #include <emerald/util/random.h> #include <emerald/util/vector_util.h> #include <fmt/format.h> #include <gtest/gtest.h> #include <cstdio> #include <cstdlib> #include <vector> namespace emerald::util { TEST(Test_vector_util, Print_hash_key) { V3d g; set_zero(g); UniformRand rand; std::vector<float> v; for (int i = 0; i < 100; ++i) { v.push_back(static_cast<float>(rand())); } auto const* const vdata = v.data(); for (int i = 0; i < 100; ++i) { fmt::print("{}\n", vdata[i]); } auto const vkey = ComputeVectorHashKey(v); fmt::print("Vector hash key: {}\n", FormatHashKey(vkey)); } } // namespace emerald::util
24.1
78
0.648686
blackencino
754c73ea5c5b7b8b0f39c1ccc23a51d1287a1455
2,878
hh
C++
include/introvirt/windows/kernel/nt/types/PEB.hh
IntroVirt/IntroVirt
917f735f3430d0855d8b59c814bea7669251901c
[ "Apache-2.0" ]
23
2021-02-17T16:58:52.000Z
2022-02-12T17:01:06.000Z
include/introvirt/windows/kernel/nt/types/PEB.hh
IntroVirt/IntroVirt
917f735f3430d0855d8b59c814bea7669251901c
[ "Apache-2.0" ]
1
2021-04-01T22:41:32.000Z
2021-09-24T14:14:17.000Z
include/introvirt/windows/kernel/nt/types/PEB.hh
IntroVirt/IntroVirt
917f735f3430d0855d8b59c814bea7669251901c
[ "Apache-2.0" ]
4
2021-02-17T16:53:18.000Z
2021-04-13T16:51:10.000Z
/* * Copyright 2021 Assured Information Security, Inc. * * 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 <introvirt/core/memory/guest_ptr.hh> #include <introvirt/windows/kernel/nt/fwd.hh> #include <cstdint> #include <memory> namespace introvirt { namespace windows { namespace nt { /** * Parser for the Windows Process Environment Block (PEB) */ class PEB { public: /** * @returns The base address of the executable image */ virtual guest_ptr<void> ImageBaseAddress() const = 0; /** * @returns The PEB_LDR_DATA, containing information about loaded libraries and the exe itself */ virtual const PEB_LDR_DATA* Ldr() const = 0; virtual PEB_LDR_DATA* Ldr() = 0; /** * @return Information about the process environment */ virtual const RTL_USER_PROCESS_PARAMETERS* ProcessParameters() const = 0; virtual RTL_USER_PROCESS_PARAMETERS* ProcessParameters() = 0; /** * @returns The major version of the OS */ virtual uint32_t OSMajorVersion() const = 0; /** * @returns The minor version of the OS */ virtual uint32_t OSMinorVersion() const = 0; /** * @returns The build number of the OS */ virtual uint16_t OSBuildNumber() const = 0; /** * @returns The CSD version of the OS, containing service pack information */ virtual uint16_t OSCSDVersion() const = 0; /** * @returns The platform ID of the OS */ virtual uint32_t OSPlatformId() const = 0; /** * @returns The service pack number of the OS */ virtual uint16_t ServicePackNumber() const = 0; /** * @returns The minor service pack number of the OS */ virtual uint16_t MinorServicePackNumber() const = 0; /** * @returns The number of physical processors */ virtual uint32_t NumberOfProcessors() const = 0; /** * @returns The virtual address of the PEB in-guest */ virtual guest_ptr<void> ptr() const = 0; /** * @returns The value of the BeingDebugged field */ virtual bool BeingDebugged() const = 0; /** * @returns The value of the BeingDebugged field */ virtual void BeingDebugged(bool BeingDebugged) = 0; virtual ~PEB() = default; }; } /* namespace nt */ } /* namespace windows */ } /* namespace introvirt */
25.927928
98
0.658443
IntroVirt
75504f62dadac215cd69a00917affe0e57447838
376
cpp
C++
game/server/entities/triggers/CTriggerTeleport.cpp
xalalau/HLEnhanced
f108222ab7d303c9ed5a8e81269f9e949508e78e
[ "Unlicense" ]
83
2016-06-10T20:49:23.000Z
2022-02-13T18:05:11.000Z
game/server/entities/triggers/CTriggerTeleport.cpp
xalalau/HLEnhanced
f108222ab7d303c9ed5a8e81269f9e949508e78e
[ "Unlicense" ]
26
2016-06-16T22:27:24.000Z
2019-04-30T19:25:51.000Z
game/server/entities/triggers/CTriggerTeleport.cpp
xalalau/HLEnhanced
f108222ab7d303c9ed5a8e81269f9e949508e78e
[ "Unlicense" ]
58
2016-06-10T23:52:33.000Z
2021-12-30T02:30:50.000Z
#include "extdll.h" #include "util.h" #include "cbase.h" #include "CTriggerTeleport.h" LINK_ENTITY_TO_CLASS( trigger_teleport, CTriggerTeleport ); //TODO: Consider making this its own class - Solokiller LINK_ENTITY_TO_CLASS( info_teleport_destination, CPointEntity ); void CTriggerTeleport::Spawn( void ) { InitTrigger(); SetTouch( &CTriggerTeleport::TeleportTouch ); }
22.117647
64
0.776596
xalalau
755199317f3fade2b7ce3139ef6dba5776bbf8f3
14,130
cpp
C++
embeddedCNN/src/utils/check.cpp
yuehniu/embeddedCNN
1067867830300cc55b4573d633c9fa1226c64868
[ "MIT" ]
21
2018-07-10T07:47:51.000Z
2021-12-03T05:47:30.000Z
embeddedCNN/src/utils/check.cpp
honorpeter/embeddedCNN
1067867830300cc55b4573d633c9fa1226c64868
[ "MIT" ]
3
2018-09-05T03:09:40.000Z
2019-04-15T10:01:40.000Z
embeddedCNN/src/utils/check.cpp
honorpeter/embeddedCNN
1067867830300cc55b4573d633c9fa1226c64868
[ "MIT" ]
8
2018-06-10T02:04:09.000Z
2021-12-03T05:47:31.000Z
/* Desc: Result check function set. * Accurate data check (Dataflow). * Approximate data check (Compute result). Date: 06/05/2018 Author: Yue Niu */ #include <iostream> #include <fstream> #include <stdlib.h> #include "../../include/utils/check.h" extern const int SHAPE[]; extern const int CHNEL[]; bool dataflow_check(Dtype * Ref, Dtype * Res, int Cnt) { std::cout << "[INFO] " << __FUNCTION__ << ", " << __LINE__ << ": Check dataflow between DDR and FPGA" << std::endl; bool all_same = true; std::ofstream log("check_df.log"); for (int i = 0; i < Cnt; i++){ if (*(Res + i) != *(Ref + i)) { all_same = false; log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << i << "th data check fail" << std::endl; log << "[LOG] " << "Ref data: " << *(Ref + i) << ", Result data: " << *(Res + i) << std::endl; } else { log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << i << "th data check pass" << std::endl; log << "[LOG] " << "Ref data: " << *(Ref + i) << ", Result data: " << *(Res + i) << std::endl; } } log.close(); return all_same; } /* Check in_buf */ void conv_inbuf_check( Dtype *Ref, Dtype InBuf[ITILE][I_BUF_DEPTH], int Lyr, int RowsPre, int RowsRead, int RowsValid ) { static int til; if (1 == RowsPre) til = 0; else til += 1; std::ofstream log("check_InBuf.log", std::ios::app); int chnl_til_num = Lyr == 0 ? 3 : ITILE; int chnl_num = Lyr == 0 ? 3 : CHNEL[Lyr - 1]; int col_num = SHAPE[Lyr] + 2; Dtype *ref_ptr = Ref; log << "[INFO] " << __FUNCTION__ << ", " << __LINE__ << ": Check " << til << "th tile." << std::endl; for (int ch = 0; ch < chnl_til_num; ch++){ for (int row = 0; row < RowsPre+RowsValid; row++){ for (int col = 0; col < col_num; col++){ Dtype ref = 0.0; if ((0 == col) || (col_num-1 == col)) ref = 0.0; else { if (0 == row){ if (1 == RowsPre) ref = 0.0; else ref = *(ref_ptr - 2 * chnl_num * (col_num-2) + ch * (col_num-2) + col - 1); } else if (1 == row){ if (1 == RowsPre) ref = *(ref_ptr + ch * (col_num-2) + col - 1); else ref = *(ref_ptr - chnl_num * (col_num-2) + ch * (col_num-2) + col - 1); } else { ref = *(ref_ptr + (row - RowsPre) * chnl_num * (col_num-2) + ch * (col_num-2) + col - 1); } } Dtype inbuf = InBuf[ch][row * col_num + col]; if (ref == inbuf) log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << ch << "th channel, " << row << "th row, " << col << "th col data check pass." << std::endl; else log << "[ERR] " << __FUNCTION__ << ", " << __LINE__ << ": " << ch << "th channel, " << row << "th row, " << col << "th col data check fail." << std::endl; log << "[LOG] " << "Ref data: " << ref << ", InBuf: " << inbuf << std::endl; } } } log.close(); return; } /* Check w_buf */ void conv_wbuf_check( Dtype *Param, Dtype WBuf[OTILE * ITILE][W_BUF_DEPTH], int IChnlTil, int OChnlTil, int Kern, int Sec ) { std::ofstream log("check_WBuf.log", std::ios::app); log << "[INFO] " << __FUNCTION__ << ", " << __LINE__ << ": Check " << Sec << "th sector." << std::endl; for(int och = 0; och < OChnlTil; och++){ for(int ich = 0; ich < ITILE; ich++) { for(int k = 0; k < Kern * Kern; k++){ if (ich < IChnlTil){ Dtype ref = *(Param + och * IChnlTil * Kern * Kern + ich * Kern * Kern + k); Dtype wbuf = WBuf[och * ITILE + ich][Sec * Kern * Kern + k]; if (ref == wbuf){ log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << Sec << "th sector, " << och << "th ochannel, " << ich << "th ichannel, " << k << "th weight check pass." << std::endl; } else{ log << "[ERR] " << __FUNCTION__ << ", " << __LINE__ << ": " << Sec << "th sector, " << och << "th ochannel, " << ich << "th ichannel, " << k << "th weight check fail." << std::endl; } log << "[LOG] " << "Ref weight: " << ref << ", WBuf: " << wbuf << std::endl; } } } } log.close(); return; } /* Check b_buf */ void conv_bias_check(Dtype *Param, Dtype BBuf[B_BUF_DEPTH], int OChnl) { std::ofstream log("check_BBuf.log", std::ios::app); for (int och = 0; och < OChnl; och++){ Dtype ref = *(Param + och); Dtype bbuf = BBuf[och]; if (ref == bbuf){ log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << och << "th ochannel bias check pass." << std::endl; } else { log << "[ERR] " << __FUNCTION__ << ", " << __LINE__ << ": " << och << "th ochannel bias check fail." << std::endl; } log << "[LOG] " << "Ref bias: " << ref << ", BBuf: " << bbuf << std::endl; } log.close(); return; } /* Check b_buf */ void onchip_check(Dtype *Ref, Dtype *Chip, int OChnl) { std::ofstream log("check_Onchip.log", std::ios::app); for (int och = 0; och < OChnl; och++){ Dtype ref = *(Ref + och); Dtype bbuf = *(Chip + och); if (ref == bbuf){ log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << och << "th ochannel bias check pass." << std::endl; } else { log << "[ERR] " << __FUNCTION__ << ", " << __LINE__ << ": " << och << "th ochannel bias check fail." << std::endl; } log << "[LOG] " << "Ref bias: " << ref << ", BBuf: " << bbuf << std::endl; } log.close(); return; } /* Check computing result */ void conv_check(Dtype *Out, int Lyr, bool Pooling) { std::ofstream log("check_conv_result.log", std::ios::app); std::ifstream feature; if (0 == Lyr) feature.open("./data/conv1_1fp16.bin", std::ios::binary); else if (1 == Lyr){ if (Pooling) feature.open("./data/pool1fp16.bin", std::ios::binary); else feature.open("./data/conv1_2fp16.bin", std::ios::binary); } else if (2 == Lyr) feature.open("./data/conv2_1fp16.bin", std::ios::binary); else if (3 == Lyr){ if (Pooling) feature.open("./data/pool2fp16.bin", std::ios::binary); else feature.open("./data/conv2_2.bin", std::ios::binary); } else if (4 == Lyr) feature.open("./data/conv3_1fp16.bin", std::ios::binary); else if (5 == Lyr) feature.open("./data/conv3_2fp16.bin", std::ios::binary); else if (6 == Lyr){ if (Pooling) feature.open("./data/pool3fp16.bin", std::ios::binary); else feature.open("./data/conv3_3.bin", std::ios::binary); } else if (7 == Lyr) feature.open("./data/conv4_1fp16.bin", std::ios::binary); else if (8 == Lyr) feature.open("./data/conv4_2fp16.bin", std::ios::binary); else if (9 == Lyr){ if (Pooling) feature.open("./data/pool4fp16.bin", std::ios::binary); else feature.open("./data/conv4_3.bin", std::ios::binary); } else if (10 == Lyr) feature.open("./data/conv5_1fp16.bin", std::ios::binary); else if (11 == Lyr) feature.open("./data/conv5_2fp16.bin", std::ios::binary); else if (12 == Lyr){ if (Pooling) feature.open("./data/pool5fp16.bin", std::ios::binary); else feature.open("./data/conv5_3fp16.bin", std::ios::binary); } int r_size = 0; if (Pooling) r_size = CHNEL[Lyr] * SHAPE[Lyr] * SHAPE[Lyr] >> 2; else r_size = CHNEL[Lyr] * SHAPE[Lyr] * SHAPE[Lyr]; Dtype *ref_feat = (Dtype *) malloc(r_size * sizeof(Dtype)); char *ref_char = reinterpret_cast<char *>(ref_feat); feature.read(ref_char, r_size * sizeof(Dtype)); int row_num = Pooling ? SHAPE[Lyr] / 2 : SHAPE[Lyr]; int col_num = Pooling ? SHAPE[Lyr] / 2 : SHAPE[Lyr]; for (int row = 0; row < row_num; row++) { for (int och = 0; och < CHNEL[Lyr]; och++) { for (int col = 0; col < col_num; col++) { int pos = row * CHNEL[Lyr] * row_num + och * col_num + col; Dtype ref = *(ref_feat + pos); Dtype out = *(Out + pos); if (ref < 10.0){ float abs_err = ref - out; if (-ABS_ERR <= abs_err && abs_err <= ABS_ERR) log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << row << "th row, " << och << "th channel, " << col << "th col data check pass." << std::endl; else log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << row << "th row, " << och << "th channel, " << col << "th col data check fail." << std::endl; } else{ float rel_err = (ref - out) / ref; if (-REL_ERR <= rel_err && rel_err <= REL_ERR) log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << row << "th row, " << och << "th channel, " << col << "th col data check pass." << std::endl; else log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << row << "th row, " << och << "th channel, " << col << "th col data check fail." << std::endl; } log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": Ref data, " << ref << "; Compute data, " << out << std::endl; } } } free(ref_feat); feature.close(); return; } /* Check output from FC */ void fc_check(Dtype *Out, int Lyr) { std::ofstream log("check_fc_result.log", std::ios::app); std::ifstream fc_out; if(0 == Lyr) fc_out.open("./data/fc6_1fp16.bin", std::ios::binary); else if(1 == Lyr) fc_out.open("./data/fc6_2fp16.bin", std::ios::binary); else if(2 == Lyr) fc_out.open("./data/fc7_1fp16.bin", std::ios::binary); else if(3 == Lyr) fc_out.open("./data/fc7_2fp16.bin", std::ios::binary); else if(4 == Lyr) fc_out.open("./data/fc8fp16.bin", std::ios::binary); int out_len = CHNEL[13 + Lyr]; Dtype *ref_out = (Dtype *)malloc(out_len * sizeof(Dtype)); char *ref_out_char = reinterpret_cast<char *>(ref_out); fc_out.read(ref_out_char, out_len * sizeof(Dtype)); log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": Check " << Lyr << "th layer." << std::endl; for (int m = 0; m < out_len; m++){ Dtype ref = ref_out[m]; Dtype out = Out[m]; float rel_err = (ref - out)/ ref; if (-REL_ERR <= rel_err && rel_err <= REL_ERR) log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << m << "th data check pass." << std::endl; else log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << m << "th data check fail." << std::endl; log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": Ref data, " << ref << "; Compute data, " << out << std::endl; } free(ref_out); fc_out.close(); return; } /* Check bias in FC layer */ void fc_bias_check(Dtype *Param, Dtype *BBuf, int Len) { std::ofstream log("check_fc_bias.log", std::ios::app); for (int n = 0; n < Len; n++){ Dtype ref = Param[n]; Dtype bias = BBuf[n]; if (ref == bias){ log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << n << "th bias check pass." << std::endl; } else{ log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << n << "th bias check pass." << std::endl; } log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": Ref, " << ref << "; On-chip, " << bias << std::endl; } return; } /* Check input in FC layer */ void fc_inbuf_check(Dtype *In, Dtype BufferA[BUFA_DEPTH], int Len) { std::ofstream log("check_fc_inbuf.log", std::ios::app); for (int n = 0; n < Len; n++){ Dtype ref = In[n]; Dtype data = BufferA[n]; if (ref == data){ log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << n << "th data check pass." << std::endl; } else{ log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << n << "th data check pass." << std::endl; } log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": Ref data, " << ref << "; On-chip data, " << data << std::endl; } return; } /* Check weight in FC layer */ void fc_weight_check(Dtype *Param, Dtype WBuf[128][1024], int ONum) { std::ofstream log("check_fc_weight.log", std::ios::app); for (int m = 0; m < ONum; m++){ for (int n = 0; n < 128; n++){ Dtype ref = *Param++; Dtype weight = WBuf[n][m]; if (ref == weight){ log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << m << "th inchnl, " << n << "th ochnl weight check pass." << std::endl; } else{ log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": " << m << "th inchnl, " << n << "th ochnl weight check pass." << std::endl; } log << "[LOG] " << __FUNCTION__ << ", " << __LINE__ << ": Ref, " << ref << "; On-chip, " << weight << std::endl; } } return; }
31.752809
105
0.456688
yuehniu
7552f7572a0397d169d54e2bfa7693a0e087a7f6
9,359
cpp
C++
Productivity-Companion/InputTodo.cpp
Despicable-Us/Productivity-Companion
2a18e9cc8c01c88012030ed599805298239da497
[ "CC0-1.0" ]
12
2021-11-22T11:49:26.000Z
2022-03-04T03:31:17.000Z
Productivity-Companion/InputTodo.cpp
Despicable-Us/Productivity-Companion
2a18e9cc8c01c88012030ed599805298239da497
[ "CC0-1.0" ]
null
null
null
Productivity-Companion/InputTodo.cpp
Despicable-Us/Productivity-Companion
2a18e9cc8c01c88012030ed599805298239da497
[ "CC0-1.0" ]
null
null
null
#include "InputTodo.h" #include "Database.h" //default constructor extern std::vector<udh::inputField> textList; extern std::vector<udh::inputField> completed; extern udh::inputField sampletext; udh::inputField::inputField() { this->font.loadFromFile("Fonts/Roboto-Medium.ttf"); this->textdata.setFont(font); this->textdata.setFillColor(sf::Color(0,0,0)); this->textdata.setString(""); this->textdata.setCharacterSize(16); // Icon loading and setting this->loadIconTexture(); //assigning day when task was created std::time_t current; std::time (&current); struct tm* timecreated; timecreated = std::localtime(&current); this->creationDay = timecreated->tm_year * 365 + timecreated->tm_mon * 30 + timecreated->tm_mday; } void udh::inputField::loadIconTexture() { if (!del_tex.loadFromFile("Texture/dust-bin1.png")) throw "Error in loading the 'dust_bin.png'"; if (!edit_tex.loadFromFile("Texture/pencil.png")) throw "Error in loading the 'pencil.png'"; del_icon = Icon(del_tex); edit_icon = Icon(edit_tex); } void udh::inputField::setdata(std::string str) { text = str; textdata.setString(text); } void udh::inputField::drawtext(sf::RenderWindow* window) { window->draw(textdata); } std::string udh::inputField::getdata() { return this->text; } sf::Text udh::inputField::gettext() { return textdata; } void udh::inputField::setposition(sf::Vector2f position) { textdata.setPosition(position); } sf::Font udh::inputField::getfont() { return font; } void udh::inputField::setdone() { this->completed = true; } bool udh::inputField::getstatus() { return this->completed; } int udh::inputField::getDay() { return this->creationDay; } void udh::inputField::setday(int a) { this->creationDay = a; } void udh::inputField::setCreationTime() { time_t current; time(&current); struct tm* timecreated = localtime(&current); char timebuffer[40]; strftime(timebuffer, 40, "%a %b %d %Y\n",timecreated); } std::string udh::inputField::SanitizedData() { size_t pos = 0; std::string data=this->getdata(); while ((pos = data.find('\'', pos)) != std::string::npos) { data.replace(pos, 1, "''"); pos += 2; } return data; } void udh::drawlist(std::vector<udh::inputField>& textlist, std::vector<udh::inputField>& completed, sf::RenderWindow* window) { float i = 0; if (!textlist.empty()) { for (std::vector<udh::inputField>::iterator itr = textlist.begin(); itr < textlist.end(); itr++) { sf::CircleShape cL(15.f), cR(15.f); sf::RectangleShape Rect; Rect.setSize({700.f, 30.f}); Rect.setPosition({ 20.f,i }); cL.setPosition(5.f, i); cR.setPosition(705.f, i); Rect.setFillColor(sf::Color(200, 200, 200)); cL.setFillColor(sf::Color(200, 200, 200)); cR.setFillColor(sf::Color(200, 200, 200)); itr->setposition(sf::Vector2f(50.f, i+5)); //setting up mark done button itr->done.setBtnPosition(sf::Vector2f(20.f, i + 9)); itr->done.setBtnSize(sf::Vector2f(12.f, 12.f)); itr->done.setbtnRect(sf::FloatRect(20.f, i + 5, 18.f, 18.f)); itr->done.setoutline(sf::Color(150, 150, 150), 2); itr->del_icon.Set_Icon_Pos({630.f, i+15}); window->draw(Rect); window->draw(cL); window->draw(cR); itr->done.drawTo(*window); itr->del_icon.Draw_To(*window); itr->edit_icon.Set_Icon_Pos({ 680.f, i + 15 }); itr->edit_icon.Draw_To(*window); itr->drawtext(window); itr->done.setbtncolor(sf::Color(235, 235, 235)); itr->textdata.setFillColor(sf::Color::Black); i += 40; } } if (!completed.empty()) { sf::CircleShape cL(15.f), cR(15.f); sf::RectangleShape Rect; Rect.setSize({ 105.f, 30.f }); Rect.setPosition({ 20.f, i }); cL.setPosition(5.f, i); cR.setPosition(110.f, i); Rect.setFillColor(sf::Color(COMPLETED_C)); cL.setFillColor(sf::Color(COMPLETED_C)); cR.setFillColor(sf::Color(COMPLETED_C)); sf::Font roboto_font; roboto_font.loadFromFile("Fonts/Roboto-Medium.ttf"); sf::Text completed_text("Completed", roboto_font, 16); completed_text.setPosition({ 30.f, i + 5.f }); completed_text.setFillColor(sf::Color::White); window->draw(Rect); window->draw(cL); window->draw(cR); window->draw(completed_text); i += 40; for (std::vector<udh::inputField>::iterator itr = completed.begin(); itr < completed.end(); itr++) { sf::CircleShape cL(15.f), cR(15.f); sf::RectangleShape Rect; Rect.setSize({ 700.f, 30.f }); Rect.setPosition({ 20.f,i }); cL.setPosition(5.f, i); cR.setPosition(705.f, i); Rect.setFillColor(sf::Color(200, 200, 200)); cL.setFillColor(sf::Color(200, 200, 200)); cR.setFillColor(sf::Color(200, 200, 200)); itr->setposition(sf::Vector2f(50.f, i + 5)); //setting up mark done button itr->done.setBtnPosition(sf::Vector2f(20.f, i + 9)); itr->done.setBtnSize(sf::Vector2f(12.f, 12.f)); itr->done.setbtnRect(sf::FloatRect(20.f, i + 5, 18.f, 18.f)); itr->done.setoutline(sf::Color(150, 150, 150), 2); itr->del_icon.Set_Icon_Pos({ 630.f, i + 15 }); window->draw(Rect); window->draw(cL); window->draw(cR); itr->done.drawTo(*window); itr->del_icon.Draw_To(*window); itr->drawtext(window); itr->done.setbtncolor(sf::Color(40, 40, 40)); itr->crossline.setPosition(sf::Vector2f(50, i + 14)); itr->crossline.setFillColor(sf::Color(40, 40, 40)); itr->crossline.setSize({ itr->gettext().getGlobalBounds().width + 1, 3 }); itr->textdata.setFillColor(sf::Color(100, 100, 100)); window->draw(itr->crossline); i += 40; } } } void udh::checkAction(sf::Event event,std::vector<udh::inputField>&list, sf::RenderWindow* window, std::vector<udh::inputField>::iterator& itredit, udh::inputField& sample, udh::Button& textarea, bool &selected) { for (std::vector<udh::inputField>::iterator itr = list.begin(); itr < list.end(); itr++) { if (itr->done.ispressed(event, *window)) { if (!itr->completed) { itr->completed = true; std::string sql = "UPDATE TASKS SET Status = " + std::to_string(itr->getstatus()) + " WHERE Task = '" + itr->SanitizedData() + "';"; completed.push_back(*itr); list.erase(itr); udh::UpdateStatus(sql); selected = false; } else if(itr->completed) { itr->completed = false; std::string sql = "UPDATE TASKS SET Status = " + std::to_string(itr->getstatus()) + " WHERE Task = '" + itr->SanitizedData() + "';"; textList.push_back(*itr); list.erase(itr); udh::UpdateStatus(sql); selected = false; } break; } else if (itr->del_icon.Run_Outside_Event(*window, event)) { udh::DeleteTask(itr); list.erase(itr); break; } else if (itr->edit_icon.Run_Outside_Event(*window, event) && !itr->completed) { itredit = itr; itr->edit.setbtncolor(sf::Color(150, 140, 220)); sample.setdata(itr->getdata()); textarea.setEditing(); textarea.setbtntext(""); textarea.setpressed(); break; } } } void udh::editTask(udh::inputField& sampletext, std::string& a, sf::Event event, std::vector<udh::inputField>::iterator& edititr, udh::Button& textarea) { unsigned char b; a = sampletext.getdata(); a.pop_back(); a.push_back('_'); sampletext.setdata(a); if (event.type == sf::Event::TextEntered) { //take unicode and store into unsigned char b = event.text.unicode; if (event.type == sf::Event::TextEntered) { //take unicode and store into unsigned char b = event.text.unicode; if (b == 8) { if (!a.empty()) { a.pop_back(); if (!a.empty()) a.pop_back(); a.push_back('_'); sampletext.setdata(a); } } else if (b == 13) { if (a.length() > 1) { a.pop_back(); a.push_back('\n'); sampletext.setdata(a); udh::updateTask(edititr); edititr->setdata(a); edititr->edit.setbtncolor(sf::Color(235, 235, 235)); sampletext.setdata(""); a.erase(); textarea.unsetEditing(); textarea.releasePressed(); edititr->edit_icon.Set_Unheld(); } } else if (sampletext.gettext().getGlobalBounds().width <= 560) { a.pop_back(); a.push_back(b); a.push_back('_'); sampletext.setdata(a); } } } } void udh::addTask(udh::inputField& sampletext, std::string& a, sf::Event event, std::vector<udh::inputField>& textlist, udh::Button textarea, bool is_planner_list) { unsigned char b; if (sampletext.getdata().empty() && textarea.getstate()) { if (a.empty()) a.push_back('_'); sampletext.setdata(a); } if (event.type == sf::Event::TextEntered) { //take unicode and store into unsigned char b = event.text.unicode; if (event.type == sf::Event::TextEntered) { //take unicode and store into unsigned char b = event.text.unicode; if (b == 8) { if (!a.empty()) { a.pop_back(); if (!a.empty()) a.pop_back(); a.push_back('_'); sampletext.setdata(a); } } else if (b == 13) { if (a.length() > 1) { a.pop_back(); a.push_back('\n'); sampletext.setdata(a); sampletext.setCreationTime(); textlist.push_back(sampletext); if (!is_planner_list) { udh::AddTask(sampletext); } sampletext.setdata(""); a = ""; } } else if (sampletext.gettext().getGlobalBounds().width <= 560 && !a.empty()) { a.pop_back(); a.push_back(b); a.push_back('_'); sampletext.setdata(a); } } } }
24.628947
163
0.635752
Despicable-Us
7559227d53fb15d1087d9057fe94c213920a541c
4,404
cpp
C++
ProjectEuler+/euler-0278.cpp
sarvekash/HackerRank_Solutions
8f48e5b1a6e792a85a10d8c328cd1f5341fb16a8
[ "Apache-2.0" ]
null
null
null
ProjectEuler+/euler-0278.cpp
sarvekash/HackerRank_Solutions
8f48e5b1a6e792a85a10d8c328cd1f5341fb16a8
[ "Apache-2.0" ]
null
null
null
ProjectEuler+/euler-0278.cpp
sarvekash/HackerRank_Solutions
8f48e5b1a6e792a85a10d8c328cd1f5341fb16a8
[ "Apache-2.0" ]
1
2021-05-28T11:14:34.000Z
2021-05-28T11:14:34.000Z
// //////////////////////////////////////////////////////// // # Title // Linear Combinations of Semiprimes // // # URL // https://projecteuler.net/problem=278 // http://euler.stephan-brumme.com/278/ // // # Problem // Given the values of integers `1 < a_1 < a_2 < ... < a_n`, consider the linear combination // `q_1 a_1 + q_2 a_2 + ... + q_n a_n = b`, using only integer values `q_k >= 0`. // // Note that for a given set of `a_k`, it may be that not all values of `b` are possible. // For instance, if `a_1 = 5` and `a_2 = 7`, there are no `q_1 >= 0` and `q_2 >= 0` such that `b` could be // 1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18 or 23. // In fact, 23 is the largest impossible value of `b` for `a_1 = 5` and `a_2 = 7`. // We therefore call `f(5, 7) = 23`. // Similarly, it can be shown that `f(6, 10, 15) = 29` and `f(14, 22, 77) = 195`. // // Find `sum{f(pq,pr,qr)}`, where `p`, `q` and `r` are prime numbers and `p < q < r < 5000`. // // # Solved by // Stephan Brumme // July 2017 // // # Algorithm // Assume I have two numbers `x` and `y` where `gcd(x,y)=1`. // The value `m = xy - x - y` can't be represented with some coefficients `m = px + qy` because: // `xy - x - y = px + qy` // `xy = px + qy + x + y` // `xy = (p+1)x + (q+1)y` // // `xy` is a multiple of `x` and `(p+1)x` is a multiple of `x`, hence `(q+1)y` should be a multiple of `x`, too. // `xy` is a multiple of `y` and `(q+1)y` is a multiple of `y`, hence `(p+1)x` should be a multiple of `y`, too. // But `gcd(x,y)=1` so `y` can't be a multiple of `x` and therefore `q+1` should be a multiple of `x`. // And for the same reason `x` can't be a multiple of `y` and therefore `p+1` should be a multiple of `y`. // Possible values for `q+1` would be `x`, `2x`, `3x`, ... (and for `p+1`: `y`, `2y`, `3y`, ...) // If I assume the lowest value `p+1=y` and `q+1=x` then the equation becomes // `xy = y * x + x * y` // `xy = 2xy` ==> contradition ! // // Therefore `m = xy - x - y` actually can't be represented with some coefficients `m = px + qy`. // // With three numbers `x`,`y`,`z` and `gcd(x,y,z)=1` the idea is very similar: // if there would be some coefficients `p`, `q` and `r` such that `m = pxy + qxz + ryz` represents `m = 2xyz - xy - xz - yz` then // `(2xyz - xy - xz - yz) mod x = -yz` // `pxy + qxz + ryz = 2xyz - xy - xz - yz` // `2xyz = pxy + qxz + ryz + xy + xz + yz` // `2xyz = (py+qz+y+z)x + (rz + z)y` // Hence `rz + z = (r+1)z` must be a multiple of `x`. `z` can't be such a multiple (because of `gcd(x,y,z) = 1`). // The same idea for `y` and `z` gives that `p+1` must be a multiple of `z` and `q+1` a multiple of `y`. // As before - if I choose the smallest possible `p+1=z`, `q+1=y` and `r+1=x`: // `2xyz = zxy + yxz + xyz + xy + xz + yz` // `2xyz = 3xyz + xy + xz + yz` ==> contradiction // // I didn't come up with the full solution, I just know how to use search engines :-; // I found the problem in the 24th International Mathemtical Olympiad held 1983 in Paris, France // somewhat cryptic solution: http://www.cs.cornell.edu/~asdas/imo/imo/isoln/isoln833.html // I stumbled across it while reading the German Wikipedia https://de.wikipedia.org/wiki/M%C3%BCnzproblem // unfortunately, the English page misses that special case https://en.wikipedia.org/wiki/Coin_problem // but it can be derived from their `n=2` explanations (pretty much what I have done above) #include <iostream> #include <vector> int main() { unsigned int limit = 5000; std::cin >> limit; // simple prime sieve from my toolbox std::vector<unsigned long long> primes = { 2 }; for (unsigned int i = 3; i <= limit; i += 2) { bool isPrime = true; // test against all prime numbers we have so far (in ascending order) for (auto x : primes) { // prime is too large to be a divisor if (x*x > i) break; // divisible => not prime if (i % x == 0) { isPrime = false; break; } } // yes, we have a prime if (isPrime) primes.push_back(i); } // all combinations of primes unsigned long long sum = 0; for (size_t i = 0; i < primes.size(); i++) for (size_t j = i + 1; j < primes.size(); j++) for (size_t k = j + 1; k < primes.size(); k++) { auto p = primes[i]; auto q = primes[j]; auto r = primes[k]; sum += 2*p*q*r - p*q - p*r - q*r; } std::cout << sum << std::endl; return 0; }
39.321429
129
0.576067
sarvekash
75594f0eca0759b6efde094fb69d845c8d7336ae
2,501
cpp
C++
DecodeString.cpp
GolferChen/LeetCode
b502a57ff1ebe8daf670e7b068dd98cec0b9bf38
[ "MIT" ]
null
null
null
DecodeString.cpp
GolferChen/LeetCode
b502a57ff1ebe8daf670e7b068dd98cec0b9bf38
[ "MIT" ]
null
null
null
DecodeString.cpp
GolferChen/LeetCode
b502a57ff1ebe8daf670e7b068dd98cec0b9bf38
[ "MIT" ]
null
null
null
// // Created by Golfer on 2020/7/28. // #include <string> #include <stack> using namespace std; #include <cstdio> #include <iostream> // Version 1, Stack //class Solution { //public: // string decodeString(string s) { // stack<string> stack_string; // stack<int> stack_num; // int number = 0; // string result= ""; // for (char &c : s) { //// if ('0' <= c <= '9') { // wrong !!! //// number = number * 10 + c - '0'; //// } // if ('0' <= c && c <= '9') { // number = number * 10 + c - '0'; // } // else if (c == '[') { // stack_num.push(number); // number = 0; // stack_string.push(result); // result = ""; // } // else if (c == ']') { // int num = stack_num.top(); // stack_num.pop(); // string last_string = stack_string.top(); // stack_string.pop(); // string result_tmp = result; // for (int i = 0; i < num - 1; i++) { // result += result_tmp; // } // result = last_string + result; //// result = last_string + result // } // else { // result += c; // } // } // return result; // } //}; // Version 2, recrusive class Solution { public: string decodeString(string s) { return dfs(s, 0).second; } pair<int, string> dfs(string s, int i) { int number = 0; string result = ""; while (i < s.size()) { char c = s[i]; if (c >= '0' && c <= '9') { number = number * 10 + c - '0'; } else if (c == '[') { pair<int, string> dfs_call = dfs(s, i + 1); i = dfs_call.first; string tmp = dfs_call.second; for (int j = 0; j < number; j++) result += tmp; number = 0; } else if (c == ']') { return make_pair(i, result); } else { result += c; } ++i; } return make_pair(-1, result); } }; int main() { string s = "3[a]2[bc]"; Solution solution = Solution(); string decode_s = solution.decodeString(s); cout << decode_s << endl; return 0; }
26.606383
59
0.387845
GolferChen
7559e00fbea33a8739a688ccab89f9bb06122363
2,753
cpp
C++
MySpaceShooter/src/Gameplay/SpaceShip.cpp
TygoB-B5/OSCSpaceShooter
9a94fbbe4392c9283e47696d06a2866a7a8f1213
[ "Apache-2.0" ]
null
null
null
MySpaceShooter/src/Gameplay/SpaceShip.cpp
TygoB-B5/OSCSpaceShooter
9a94fbbe4392c9283e47696d06a2866a7a8f1213
[ "Apache-2.0" ]
null
null
null
MySpaceShooter/src/Gameplay/SpaceShip.cpp
TygoB-B5/OSCSpaceShooter
9a94fbbe4392c9283e47696d06a2866a7a8f1213
[ "Apache-2.0" ]
null
null
null
#include "SpaceShip.h" namespace Game { void SpaceShip::Update() { UpdateSpaceShipPosition(); UpdateSpaceShipRotation(); UpdateCameraPose(); UpdateSpaceshipGun(); } glm::vec3 SpaceShip::GetControllerIRotationnput() { // Calculate controller input with deadzone auto& cont = m_Controller; glm::vec3 rotation = glm::length(glm::vec3(cont->GetOrientation().z, -cont->GetOrientation().x, 0)) > DEADZONE ? glm::vec3(cont->GetOrientation().z, -cont->GetOrientation().x, 0) : glm::vec3(0, 0, 0); return rotation; } bool SpaceShip::GetControllerButtonInput() { std::cout << m_Controller->IsProximity() << "\n"; return m_Controller->IsProximity(); } void SpaceShip::UpdateSpaceShipRotation() { // Get rotation from spaceship glm::vec3 rot = m_Object->GetRotation(); // Corrent Angles if (m_Object->GetRotation().x > 180 || m_Object->GetRotation().x < -180) rot.x = -rot.x; if (m_Object->GetRotation().y > 180 || m_Object->GetRotation().y < -180) rot.y = -rot.y; if (m_Object->GetRotation().z > 180 || m_Object->GetRotation().z < -180) rot.z = -rot.z; m_Object->SetRotation(rot); // Correct controller input when upside down glm::vec3 input = GetControllerIRotationnput(); if (m_Object->GetRotation().x > 90 || m_Object->GetRotation().x < -90) input.y = -input.y; // Rotate spaceship m_Object->Rotate(input * Core::Time::GetDeltaTime()); } void SpaceShip::UpdateSpaceShipPosition() { // Move spaceship forward m_Object->Translate(m_Object->GetForward() * Core::Time::GetDeltaTime() * SPACESHIP_SPEED); // Move spaceship back if it goes out of bounds glm::vec3 pos = m_Object->GetPosition(); if (m_Object->GetPosition().x > PLAYFIELD_SIZE || m_Object->GetPosition().x < -PLAYFIELD_SIZE) pos.x = -pos.x; if (m_Object->GetPosition().y > PLAYFIELD_SIZE || m_Object->GetPosition().y < -PLAYFIELD_SIZE) pos.y = -pos.y; if (m_Object->GetPosition().z > PLAYFIELD_SIZE || m_Object->GetPosition().z < -PLAYFIELD_SIZE) pos.z = -pos.z; m_Object->SetPosition(pos); } void SpaceShip::UpdateCameraPose() { // Correct reverse rotation glm::vec3 rot = m_Object->GetRotation(); rot.y += 180; rot.x = -rot.x; rot.z = -rot.z; // Set camera rotation and position m_Camera->SetRotation(rot); m_Camera->SetPosition(m_Object->GetPosition() + m_Object->GetForward() * 800 + m_Object->GetUp() * 10); } void SpaceShip::UpdateSpaceshipGun() { // If button is held shoot at BULLET SHOOT SPEED rate if (GetControllerButtonInput() && m_ShootTime > BULLET_SHOOT_SPEED) { m_ShootTime = 0; m_BulletPool.SpawnBullet(m_Object->GetPosition(), m_Object->GetRotation()); } m_ShootTime += Core::Time::GetDeltaTime(); m_BulletPool.Update(); } }
28.091837
105
0.680349
TygoB-B5
755aaab5f9350ef704e1545ecd661418f70e1e57
389
hpp
C++
Hurrican/src/stdafx.hpp
s1eve-mcdichae1/Hurrican
3ed6ff9ee94d2ea2b79e451466d28f06d58acf19
[ "MIT" ]
21
2018-04-13T10:45:45.000Z
2022-03-29T14:53:43.000Z
Hurrican/src/stdafx.hpp
s1eve-mcdichae1/Hurrican
3ed6ff9ee94d2ea2b79e451466d28f06d58acf19
[ "MIT" ]
10
2021-06-30T14:29:36.000Z
2022-01-06T17:03:48.000Z
Hurrican/src/stdafx.hpp
s1eve-mcdichae1/Hurrican
3ed6ff9ee94d2ea2b79e451466d28f06d58acf19
[ "MIT" ]
3
2021-10-08T12:35:05.000Z
2022-03-03T06:03:49.000Z
#ifndef _STDAFX_HPP_ #define _STDAFX_HPP_ #include "Console.hpp" #include "DX8Font.hpp" #include "DX8Sound.hpp" #include "GUISystem.hpp" #include "Gameplay.hpp" #include "Globals.hpp" #include "HUD.hpp" #include "Logdatei.hpp" #include "Mathematics.hpp" #include "Partikelsystem.hpp" #include "Player.hpp" #include "Projectiles.hpp" #include "Tileengine.hpp" #include "Timer.hpp" #endif
19.45
29
0.758355
s1eve-mcdichae1
755f0257792b6d75a9c44b69ae9cf39ae2f5185b
4,172
cpp
C++
src/lib/lgui/widgets/wrapwidget.cpp
jacmoe/lgui
92f7e655832487b9ac29ef6043a79745329c90f6
[ "BSD-3-Clause" ]
4
2020-12-31T00:01:32.000Z
2021-11-20T15:39:46.000Z
src/lib/lgui/widgets/wrapwidget.cpp
jacmoe/lgui
92f7e655832487b9ac29ef6043a79745329c90f6
[ "BSD-3-Clause" ]
null
null
null
src/lib/lgui/widgets/wrapwidget.cpp
jacmoe/lgui
92f7e655832487b9ac29ef6043a79745329c90f6
[ "BSD-3-Clause" ]
1
2021-11-10T16:55:09.000Z
2021-11-10T16:55:09.000Z
/* _ _ * | | (_) * | | __ _ _ _ _ * | | / _` || | | || | * | || (_| || |_| || | * |_| \__, | \__,_||_| * __/ | * |___/ * * Copyright (c) 2015-20 frank256 * * License (BSD): * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #include "wrapwidget.h" #include "lgui/platform/graphics.h" #include "lgui/drawevent.h" namespace lgui { WrapWidget::WrapWidget(Widget* widget) : mcontent(widget) { if (widget) set_content(widget); } void WrapWidget::draw(const DrawEvent& de) const { if (mcontent) { // FIXME: draw backgr. when mcontent == nullptr? draw_background(de); de.gfx().push_draw_area(children_area(), false); mcontent->draw(DrawEvent(de.gfx(), de.draw_disabled() || mcontent->is_disabled(), de.opacity() * mcontent->effective_opacity())); de.gfx().pop_draw_area(); } } Rect WrapWidget::children_area() const { if (mcontent) return lgui::Rect(mpadding.left_top_offs(), mpadding.sub(size())); else return size_rect(); } Widget* WrapWidget::get_child_at(PointF) { // FIXME: check contains? return mcontent; } void WrapWidget::set_content(lgui::Widget* widget) { mcontent = widget; if (widget) { widget->set_pos(0, 0); configure_new_child(*widget); if (!widget->has_strong_style() && &widget->style() != &style()) widget->set_style(&style()); request_layout(); } } void WrapWidget::style_changed() { if (mcontent && !mcontent->has_strong_style()) mcontent->set_style(&style()); } void WrapWidget::resized(const Size& old_size) { (void) old_size; if (mcontent) { mcontent->layout(Rect({0, 0}, mpadding.sub(size()))); } } void WrapWidget::set_padding(const Padding& padding) { mpadding = padding; set_size(Size(width(), height())); // will set size of content } MeasureResults WrapWidget::measure(SizeConstraint wc, SizeConstraint hc) { if (!mcontent) return force_size_constraints(Size(mpadding.horz(), mpadding.vert()), wc, hc); else { MeasureResults r = mcontent->measure(wc.sub(mpadding.horz()), hc.sub(mpadding.vert())); return force_size_constraints(mpadding.add(r), wc, hc); } } Size WrapWidget::min_size_hint() { Size s; if (mcontent) s = mcontent->min_size_hint(); return mpadding.add(s); } void WrapWidget::visit_down(const std::function<void(Widget&)>& f) { f(*this); if (mcontent) mcontent->visit_down(f); } void WrapWidget::child_about_to_die(Widget& child) { if (&child == mcontent) set_content(nullptr); } }
31.368421
95
0.659156
jacmoe
7561738404c4724e9c0ea390ee747020e653f54a
654
cpp
C++
codechef/febLongChallenge20/ony.cpp
xenowits/cp
963b3c7df65b5328d5ce5ef894a46691afefb98c
[ "MIT" ]
null
null
null
codechef/febLongChallenge20/ony.cpp
xenowits/cp
963b3c7df65b5328d5ce5ef894a46691afefb98c
[ "MIT" ]
null
null
null
codechef/febLongChallenge20/ony.cpp
xenowits/cp
963b3c7df65b5328d5ce5ef894a46691afefb98c
[ "MIT" ]
null
null
null
// vovuh.pb(temp);vovuh.pb(temp1);vovuh.pb(temp2);vovuh.pb(temp3); for(int tat = 0; tat <= 3; tat++) { auto x = adj[tat]; int sz = x.size(); if (sz > 0) { sort(x.begin(),x.end(),greater<int>()); if (x[0] > 0) vovuh.pb(x[0]); } } sort(vovuh.begin(), vovuh.end(),greater<int>()); // ll cnt = 0; cout << temp4 << " is the new ans" << endl; for (auto ss : vovuh) { cout << ss << " "; } ll lauda = 1, vovuhKaSize = vovuh.size(); temp4 -= 100*(4-vovuhKaSize); for (int i = 0; i < vovuhKaSize; i++) { temp4 +=(100-25*(lauda-1))*vovuh[i]; lauda++; } // ans = max(ans, temp4); if (temp4 > ans) { ans = temp4; cout << endl; }
21.8
66
0.529052
xenowits
756286d348fbeee56dd518ef8d73d72403bdc748
476
cpp
C++
Project2/main.cpp
cpurev/CS311
c86bb0dc917ff98edf698adedb4c3f0f9745ce9f
[ "MIT" ]
null
null
null
Project2/main.cpp
cpurev/CS311
c86bb0dc917ff98edf698adedb4c3f0f9745ce9f
[ "MIT" ]
null
null
null
Project2/main.cpp
cpurev/CS311
c86bb0dc917ff98edf698adedb4c3f0f9745ce9f
[ "MIT" ]
1
2021-11-16T05:01:57.000Z
2021-11-16T05:01:57.000Z
#include "ssarray.h" #include <iostream> #include <utility> #include <string> class Count{ public: Count(){ ++_ctorCount; } ~Count(){ --_ctorCount; ++_DctorCount; } static size_t _ctorCount; static size_t _DctorCount; }; size_t Count::_ctorCount = size_t(0); size_t Count::_DctorCount = size_t(0); int main(){ SSArray<std::string> ss1; SSArray<int> ss2; std::cout << ((ss1 == ss2) ? "yes" : "no") << std::endl; return 1; }
15.354839
58
0.602941
cpurev
75681b4297eca4f3ba317ff88d40fde6acf4530a
272
cpp
C++
src/world/light.cpp
fiddleplum/ve
1e45de0488d593069032714ebe67725f468054f8
[ "MIT" ]
null
null
null
src/world/light.cpp
fiddleplum/ve
1e45de0488d593069032714ebe67725f468054f8
[ "MIT" ]
16
2016-12-27T16:57:09.000Z
2017-04-30T23:34:58.000Z
src/world/light.cpp
fiddleplum/ve
1e45de0488d593069032714ebe67725f468054f8
[ "MIT" ]
null
null
null
#include "world/light.hpp" namespace ve { namespace world { Light::Light() { color = {1, 1, 1}; } Light::~Light() { } Vector3f Light::getColor() const { return color; } void Light::setColor(Vector3f color_) { color = color_; } } }
9.714286
39
0.558824
fiddleplum
756ba6c9e52a7081be16b9be4f2173e1c55f0da0
1,270
cpp
C++
Source/Archiver/FileSerializer.cpp
frobro98/Musa
6e7dcd5d828ca123ce8f43d531948a6486428a3d
[ "MIT" ]
null
null
null
Source/Archiver/FileSerializer.cpp
frobro98/Musa
6e7dcd5d828ca123ce8f43d531948a6486428a3d
[ "MIT" ]
null
null
null
Source/Archiver/FileSerializer.cpp
frobro98/Musa
6e7dcd5d828ca123ce8f43d531948a6486428a3d
[ "MIT" ]
null
null
null
// Copyright 2020, Nathan Blane #include "FileSerializer.hpp" #include "Logging/CoreLogChannels.hpp" #include "Logging/LogFunctions.hpp" FileSerializer::FileSerializer(const Path& filePath) : pathToFile(filePath) { bool result = FileSystem::OpenFile(handle, pathToFile.GetString(), FileMode::Write); if (!result) { // TODO - GetLastError MUSA_ERR(SerializationLog, "Failed to open file {}", *pathToFile.GetFileName()); } } FileSerializer::~FileSerializer() { Flush(); auto result = FileSystem::CloseFile(handle); if (!result) { // TODO - GetLastError MUSA_ERR(SerializationLog, "Failed to close file {}", *pathToFile.GetFileName()); } } void FileSerializer::SerializeData(const void* data, size_t dataSize) { serializedData.Add(data, dataSize); } void FileSerializer::Flush() { // TODO - Using the low level file writing interface. Should consider not doing this sort of thing because of the limitations for loading large files auto result = FileSystem::WriteFile(handle, serializedData.Offset(bufferWriteIndex), (u32)serializedData.Size() - bufferWriteIndex); if (!result) { // TODO - GetLastError MUSA_ERR(SerializationLog, "Failed to write to file {}", *pathToFile.GetFileName()); } bufferWriteIndex = (u32)serializedData.Size(); }
27.608696
150
0.740157
frobro98
756e3e110e56ec813d1c8c29b1be78995bbef5f2
1,737
hh
C++
dune/xt/common/numeric.hh
dune-community/dune-xt
da921524c6fff8d60c715cb4849a0bdd5f020d2b
[ "BSD-2-Clause" ]
2
2020-02-08T04:08:52.000Z
2020-08-01T18:54:14.000Z
dune/xt/common/numeric.hh
dune-community/dune-xt
da921524c6fff8d60c715cb4849a0bdd5f020d2b
[ "BSD-2-Clause" ]
35
2019-08-19T12:06:35.000Z
2020-03-27T08:20:39.000Z
dune/xt/common/numeric.hh
dune-community/dune-xt
da921524c6fff8d60c715cb4849a0bdd5f020d2b
[ "BSD-2-Clause" ]
1
2020-02-08T04:09:34.000Z
2020-02-08T04:09:34.000Z
// This file is part of the dune-xt project: // https://zivgitlab.uni-muenster.de/ag-ohlberger/dune-community/dune-xt // Copyright 2009-2021 dune-xt developers and contributors. All rights reserved. // License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) // or GPL-2.0+ (http://opensource.org/licenses/gpl-license) // with "runtime exception" (http://www.dune-project.org/license.html) // Authors: // René Fritze (2020) // Tobias Leibner (2019 - 2020) #ifndef DUNE_XT_COMMON_NUMERIC_HH #define DUNE_XT_COMMON_NUMERIC_HH #include <numeric> #if defined(__cpp_lib_parallel_algorithm) && __cpp_lib_parallel_algorithm >= 201603 # define CPP17_PARALLELISM_TS_SUPPORTED 1 #else # define CPP17_PARALLELISM_TS_SUPPORTED 0 #endif namespace Dune::XT::Common { // Uses std::reduce if available, and falls back to std::accumulate on older compilers. // The std::reduce versions with an execution policy as first argument are not supported. template <class... Args> decltype(auto) reduce(Args&&... args) { #if CPP17_PARALLELISM_TS_SUPPORTED return std::reduce(std::forward<Args>(args)...); #else return std::accumulate(std::forward<Args>(args)...); #endif } // Uses std::transform_reduce if available, and falls back to std::inner_product on older compilers. // The std::transform_reduce versions with an execution policy as first argument are not supported. template <class... Args> decltype(auto) transform_reduce(Args&&... args) { #if CPP17_PARALLELISM_TS_SUPPORTED return std::transform_reduce(std::forward<Args>(args)...); #else return std::inner_product(std::forward<Args>(args)...); #endif } } // namespace Dune::XT::Common #endif // DUNE_XT_COMMON_NUMERIC_HH
32.773585
100
0.745538
dune-community
757109a8c12f857a049986a1b25b17804c53d25f
12,809
cpp
C++
src/c/HarmoniaInterface.cpp
Hiiragi/Harmonia
e47e811364e15a9bc7b2322c10d1e35fca041e2a
[ "MIT" ]
null
null
null
src/c/HarmoniaInterface.cpp
Hiiragi/Harmonia
e47e811364e15a9bc7b2322c10d1e35fca041e2a
[ "MIT" ]
null
null
null
src/c/HarmoniaInterface.cpp
Hiiragi/Harmonia
e47e811364e15a9bc7b2322c10d1e35fca041e2a
[ "MIT" ]
null
null
null
/** * Harmonia * * Copyright (c) 2018 Hiiragi * * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php */ #include "HarmoniaInterface.h" #include "Harmonia.h" #include "ogg/ogg.h" #include <algorithm> #include <string> #include <sstream> // General #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_initialize(unsigned int bufferSize) { Harmonia::initialize(bufferSize); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_finalize() { Harmonia::finalize(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_register_sound(const char* id, unsigned char* binaryData, int size, unsigned int loopStartPoint, unsigned int loopLength) { Harmonia::register_sound(id, binaryData, size, loopStartPoint, loopLength); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_register_sounds(const char** idList, unsigned char** binaryDataList, int* sizeList, unsigned int* loopStartPointList, unsigned int* loopLengthList, unsigned int numRegister) { Harmonia::register_sounds(idList, binaryDataList, sizeList, loopStartPointList, loopLengthList, numRegister); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_unregister_sound(const char* id) { Harmonia::unregister_sound(id); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_pause_all() { Harmonia::pause(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_resume_all() { Harmonia::resume(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_stop_all() { Harmonia::stop(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif float harmonia_get_master_volume() { SoundGroup* masterGroup = Harmonia::get_group(Harmonia::MASTER_GROUP_NAME.c_str()); return masterGroup->get_volume(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_set_master_volume(float volume) { SoundGroup* masterGroup = Harmonia::get_group(Harmonia::MASTER_GROUP_NAME.c_str()); return masterGroup->set_volume(volume); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_mute_all() { Harmonia::mute(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_unmute_all() { Harmonia::unmute(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_start_capture_errors() { Harmonia::start_capture_errors(); } int _harmonia_capture_data_size; #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif char* harmonia_get_capture_errors() { std::list<HarmoniaErrorData*>* list = Harmonia::get_capture_errors(); if (list != NULL && list->size() > 0) { std::string jsonStr = "{\"errors\":["; std::for_each(list->begin(), list->end(), [&jsonStr](HarmoniaErrorData* data) { int type = static_cast<int>(data->get_error_type()); std::string typeStr; #if ANDROID || _ANDROID_ std::stringstream stream; stream << "" << type; typeStr = stream.str(); #else typeStr = std::to_string(type); #endif jsonStr += "{\"type\":" + typeStr + "},"; }); jsonStr = jsonStr.substr(0, jsonStr.size() - 1); jsonStr += "]}"; const char* str = jsonStr.c_str(); size_t length = strlen(str) + 1; char* returnChar = (char*)malloc(length); #if _WIN32 strcpy_s(returnChar, length, str); #else strcpy(returnChar, str); #endif _harmonia_capture_data_size = (int)length; return returnChar; } return NULL; } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif char* harmonia_get_capture_errors_with_size(int* size) { char* result = harmonia_get_capture_errors(); if (result == NULL) { *size = 0; } else { *size = _harmonia_capture_data_size; } return result; } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_stop_capture_errors() { Harmonia::stop_capture_errors(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_start_capture_events() { Harmonia::start_capture_events(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif char* harmonia_get_capture_events() { std::list<SoundEventData*>* list = Harmonia::get_captured_events(); if (list != NULL && list->size() > 0) { std::string jsonStr = "{\"events\":["; std::for_each(list->begin(), list->end(), [&jsonStr](SoundEventData* data) { jsonStr += "{\"rid\":\"" + std::string(data->get_rid()) + "\",\"sid\":\"" + std::string(data->get_sid()) + "\","; int type = static_cast<int>(data->get_type()); std::string typeStr; #if ANDROID || _ANDROID_ std::stringstream stream; stream << "" << type; typeStr = stream.str(); #else typeStr = std::to_string(type); #endif jsonStr += "\"type\":" + typeStr; jsonStr += "},"; delete data; }); jsonStr = jsonStr.substr(0, jsonStr.size() - 1); jsonStr += "]}"; delete list; const char* str = jsonStr.c_str(); size_t length = strlen(str) + 1; char* returnChar = (char*)malloc(length); #if _WIN32 strcpy_s(returnChar, length, str); #else strcpy(returnChar, str); #endif _harmonia_capture_data_size = (int)length; return returnChar; } return NULL; } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif char* harmonia_get_capture_events_with_size(int* size) { char* result = harmonia_get_capture_events(); if (result == NULL) { *size = 0; } else { *size = _harmonia_capture_data_size; } return result; } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_stop_capture_events() { Harmonia::stop_capture_events(); } // Sound #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_sound_play(const char* registeredId, const char* soundId, const char* targetGroupId) { Harmonia::play(registeredId, soundId, targetGroupId); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_sound_pause(const char* playingDataId) { PlayingData* data = Harmonia::get_playing_data(playingDataId); data->pause(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_sound_resume(const char* playingDataId) { PlayingData* data = Harmonia::get_playing_data(playingDataId); data->resume(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_sound_stop(const char* playingDataId) { PlayingData* data = Harmonia::get_playing_data(playingDataId); data->stop(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_sound_mute(const char* playingDataId) { PlayingData* data = Harmonia::get_playing_data(playingDataId); data->mute(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_sound_unmute(const char* playingDataId) { PlayingData* data = Harmonia::get_playing_data(playingDataId); data->unmute(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif float harmonia_get_sound_volume(const char* playingDataId) { PlayingData* data = Harmonia::get_playing_data(playingDataId); return data->get_volume(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_set_sound_volume(const char* playingDataId, float volume) { PlayingData* data = Harmonia::get_playing_data(playingDataId); data->set_volume(volume); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif unsigned int harmonia_get_sound_status(const char* playingDataId) { PlayingData* data = Harmonia::get_playing_data(playingDataId); return data->get_status(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif unsigned int harmonia_get_sound_current_position(const char* playingDataId) { PlayingData* data = Harmonia::get_playing_data(playingDataId); return (unsigned int)data->get_current_position(); } // Group #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_create_group(const char* groupId, const char* parentGroupId, int maxPolyphony) { Harmonia::create_group(groupId, parentGroupId, maxPolyphony); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_delete_group(const char* groupId) { Harmonia::delete_group(groupId); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_group_pause(const char* groupId) { SoundGroup* group = Harmonia::get_group(groupId); group->pause(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_group_resume(const char* groupId) { SoundGroup* group = Harmonia::get_group(groupId); group->resume(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_group_stop(const char* groupId) { SoundGroup* group = Harmonia::get_group(groupId); group->stop(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_group_mute(const char* groupId) { SoundGroup* group = Harmonia::get_group(groupId); group->mute(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_group_unmute(const char* groupId) { SoundGroup* group = Harmonia::get_group(groupId); group->unmute(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif float harmonia_get_group_volume(const char* groupId) { SoundGroup* group = Harmonia::get_group(groupId); return group->get_volume(); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_set_group_volume(const char* groupId, float volume) { SoundGroup* group = Harmonia::get_group(groupId); group->set_volume(volume); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif void harmonia_set_ducker(const char* triggerGroupId, const char* targetGroupId, float ratio, float attackTimeByMS, float releaseTimeByMS) { SoundGroup* triggerGroup = Harmonia::get_group(triggerGroupId); SoundGroup* targetGroup = Harmonia::get_group(targetGroupId); targetGroup->set_ducker(triggerGroup, ratio, attackTimeByMS, releaseTimeByMS); } #if _WIN32 extern "C" _declspec(dllexport) #else extern "C" #endif unsigned int harmonia_get_group_status(const char* groupId) { SoundGroup* group = Harmonia::get_group(groupId); return group->get_status(); } /* #if _WIN32 extern "C" _declspec(dllexport) void initialize() { Harmonia::initialize(); } extern "C" _declspec(dllexport) unsigned int registerSound(unsigned char* binaryPointer, unsigned long size) { return Harmonia::registerSound(binaryPointer, size); } extern "C" _declspec(dllexport) int play(unsigned int registeredId) { return Harmonia::play(registeredId); } extern "C" _declspec(dllexport) ogg_int64_t getCurrentTimeInPlayer(unsigned int playerId) { return Harmonia::getCurrentTimeInPlayer(playerId); } extern "C" _declspec(dllexport) void finalize() { Harmonia::finalize(); } #elif (__ANDROID__ || ANDROID) extern "C" { void initialize() { Harmonia::initialize(); } void initializeForAndroid(int sampleRate, int bufferSize) { Harmonia::initializeForAndroid(sampleRate, bufferSize); } unsigned int registerSound(unsigned char* binaryPointer, unsigned int size) { return Harmonia::registerSound(binaryPointer, size); } int play(unsigned int registeredId) { return Harmonia::play(registeredId); } ogg_int64_t getCurrentTimeInPlayer(unsigned int playerId) { return Harmonia::getCurrentTimeInPlayer(playerId); } void harmonia_pause() { Harmonia::pause(); } void harmonia_resume() { Harmonia::resume(); } void finalize() { Harmonia::finalize(); } } #elif __APPLE__ #include "TargetConditionals.h" #if TARGET_OS_IPHONE || TARGET_OS_MAC #include <string.h> #include <stdlib.h> extern "C" { void initialize() { Harmonia::initialize(); } unsigned int registerSound(unsigned char* binaryPointer, unsigned int size) { return Harmonia::registerSound(binaryPointer, size); } int play(unsigned int registeredId) { return Harmonia::play(registeredId); } ogg_int64_t getCurrentTimeInPlayer(unsigned int playerId) { return Harmonia::getCurrentTimeInPlayer(playerId); } void finalize() { Harmonia::finalize(); } const char* aaaaa() { const char *str = "{\"e\":[{\"t\":1,\"v\":2},{\"t\":3,\"v\":4}]}"; char* retStr = (char*)malloc(strlen(str) + 1); strcpy(retStr, str); return retStr; } } #endif #endif */
18.672012
187
0.708408
Hiiragi
75737379a402b92d7209b5a3668b3bd1f84577d8
53
hpp
C++
src/boost_numeric_odeint_util_unit_helper.hpp
miathedev/BoostForArduino
919621dcd0c157094bed4df752b583ba6ea6409e
[ "BSL-1.0" ]
10
2018-03-17T00:58:42.000Z
2021-07-06T02:48:49.000Z
src/boost_numeric_odeint_util_unit_helper.hpp
miathedev/BoostForArduino
919621dcd0c157094bed4df752b583ba6ea6409e
[ "BSL-1.0" ]
2
2021-03-26T15:17:35.000Z
2021-05-20T23:55:08.000Z
src/boost_numeric_odeint_util_unit_helper.hpp
miathedev/BoostForArduino
919621dcd0c157094bed4df752b583ba6ea6409e
[ "BSL-1.0" ]
4
2019-05-28T21:06:37.000Z
2021-07-06T03:06:52.000Z
#include <boost/numeric/odeint/util/unit_helper.hpp>
26.5
52
0.811321
miathedev
75791efa4e695d9d48d0a8e9d3206221e16d6efc
1,157
cpp
C++
src/scheduler/FunctionCallClient.cpp
dgoltzsche/faabric
b1edd26d2b07102255491d7fbb661586d58970f5
[ "Apache-2.0" ]
null
null
null
src/scheduler/FunctionCallClient.cpp
dgoltzsche/faabric
b1edd26d2b07102255491d7fbb661586d58970f5
[ "Apache-2.0" ]
null
null
null
src/scheduler/FunctionCallClient.cpp
dgoltzsche/faabric
b1edd26d2b07102255491d7fbb661586d58970f5
[ "Apache-2.0" ]
null
null
null
#include <faabric/scheduler/FunctionCallClient.h> #include <grpcpp/create_channel.h> #include <grpcpp/security/credentials.h> #include <faabric/proto/macros.h> namespace faabric::scheduler { FunctionCallClient::FunctionCallClient(const std::string& hostIn) : host(hostIn) , channel(grpc::CreateChannel(host + ":" + std::to_string(FUNCTION_CALL_PORT), grpc::InsecureChannelCredentials())) , stub(faabric::FunctionRPCService::NewStub(channel)) {} void FunctionCallClient::shareFunctionCall(const faabric::Message& call) { ClientContext context; faabric::FunctionStatusResponse response; CHECK_RPC("function_share", stub->ShareFunction(&context, call, &response)); } void FunctionCallClient::sendFlush() { ClientContext context; faabric::Message call; faabric::FunctionStatusResponse response; CHECK_RPC("function_flush", stub->Flush(&context, call, &response)); } void FunctionCallClient::sendMPIMessage(const faabric::MPIMessage& msg) { ClientContext context; faabric::FunctionStatusResponse response; CHECK_RPC("mpi_message", stub->MPICall(&context, msg, &response)); } }
29.666667
80
0.737252
dgoltzsche
757af3258b0bd1de500a8bd36dfbb26c6060a56b
1,322
cpp
C++
src/pkg_exe/pkg_exe_service.cpp
naughtybikergames/pkg
9a78380c6cf82c95dec3968a7ed69000b349113d
[ "MIT" ]
null
null
null
src/pkg_exe/pkg_exe_service.cpp
naughtybikergames/pkg
9a78380c6cf82c95dec3968a7ed69000b349113d
[ "MIT" ]
null
null
null
src/pkg_exe/pkg_exe_service.cpp
naughtybikergames/pkg
9a78380c6cf82c95dec3968a7ed69000b349113d
[ "MIT" ]
null
null
null
#include <pkg/exe/pkg_exe_service.hpp> #include <pkg/exe/iscc.hpp> #include <pkg/exe/help.hpp> #include <pkg/exe/temp.hpp> #include <pkg/utils.hpp> #include <boost/algorithm/string/replace.hpp> #include <map> #include <iostream> using namespace std; using namespace pkg::exe; pkg_exe_service::pkg_exe_service(const PkgExeArgs &args) { if (args.needs_help()) { cout << help() << endl; return; } bf::path file_path(args.file()); string win_path = boost::replace_all_copy("Z:" + args.path(), "/", "\\"); map<string, string> overrides = { {"appName", args.name()}, {"appVersion", args.version()}, {"outputDir", win_path} }; bf::current_path(file_path.parent_path()); _overriden_file = override_file(file_path, Temp::uuid_str(), overrides); _win_overriden_file = boost::replace_all_copy("Z:" + _overriden_file.string(), "/", "\\"); _out = args.out(); bf::create_directories(Temp::path()); created = true; } pkg_exe_service::~pkg_exe_service() { bf::remove_all(Temp::path()); bf::remove(_overriden_file); } void pkg_exe_service::execute() { if (!created) return; cout << "Started exe packaging ..." << endl; iscc(_win_overriden_file, _out).execute(); cout << "done. out -> " << _out << endl; }
24.036364
94
0.630106
naughtybikergames
757ba4b1ba66acf6abd3e09aae9f73d82e55103d
637
cpp
C++
Sniper.cpp
snir1551/Ex8_C-
f226d73c18ef8011b90ee46048494a82c05f198a
[ "MIT" ]
1
2021-05-31T13:11:02.000Z
2021-05-31T13:11:02.000Z
Sniper.cpp
snir1551/Ex8_C-
f226d73c18ef8011b90ee46048494a82c05f198a
[ "MIT" ]
null
null
null
Sniper.cpp
snir1551/Ex8_C-
f226d73c18ef8011b90ee46048494a82c05f198a
[ "MIT" ]
null
null
null
#include "Sniper.hpp" #include "Board.hpp" namespace WarGame { Sniper::Sniper(int numPlayer): Soldier(numPlayer,100,50) { } Sniper::Sniper(int numPlayer, int health, int damage): Soldier(numPlayer,health,damage) { } int Sniper::maxHealth() const { return 100; } const char* Sniper::letter() const { return "SN"; } void Sniper::attack(Board& board) const { Soldier* target = board.mostCurrentHealth(this); if (target) { target->setHealth(target->getHealth() - this->getDamage()); board.removeDeadSoldiers(); } } }
19.30303
91
0.583987
snir1551
757bdb569ae20630278ce6e737d4c38ec50d5560
9,906
cc
C++
examples/fontscan.cc
michaeljclark/glyb
5b302ded6061eea2098bc8e963adb09e5f1dab4e
[ "MIT" ]
7
2021-07-28T19:03:08.000Z
2022-02-02T23:17:11.000Z
examples/fontscan.cc
michaeljclark/glyb
5b302ded6061eea2098bc8e963adb09e5f1dab4e
[ "MIT" ]
2
2021-06-15T22:34:44.000Z
2021-11-10T04:27:21.000Z
examples/fontscan.cc
michaeljclark/glyb
5b302ded6061eea2098bc8e963adb09e5f1dab4e
[ "MIT" ]
null
null
null
#include <cstdio> #include <cstdint> #include <cstdlib> #include <cstring> #include <climits> #include <cstdlib> #include <climits> #include <cctype> #include <map> #include <vector> #include <memory> #include <string> #include <algorithm> #include <atomic> #include <mutex> #include <ft2build.h> #include FT_FREETYPE_H #include FT_MODULE_H #include FT_GLYPH_H #include FT_OUTLINE_H #include "binpack.h" #include "image.h" #include "draw.h" #include "font.h" #include "glyph.h" #include "file.h" static font_manager_ft manager; static const char* font_dir = "fonts"; static bool print_font_list = false; static bool print_block_stats = false; static bool help_text = false; static float cover_min = 0.05; static int family_width = 80; void print_help(int argc, char **argv) { fprintf(stderr, "Usage: %s [options]\n" "\n" "Options:\n" " -d, --font-dir <name> font dir\n" " -l, --list list fonts\n" " -l, --stats show font stats (block)\n" " -h, --help command line help\n", argv[0]); } bool check_param(bool cond, const char *param) { if (cond) { printf("error: %s requires parameter\n", param); } return (help_text = cond); } bool match_opt(const char *arg, const char *opt, const char *longopt) { return strcmp(arg, opt) == 0 || strcmp(arg, longopt) == 0; } void parse_options(int argc, char **argv) { int i = 1; while (i < argc) { if (match_opt(argv[i], "-d", "--font-dir")) { if (check_param(++i == argc, "--font-dir")) break; font_dir = argv[i++]; } else if (match_opt(argv[i], "-c", "--cover-min")) { if (check_param(++i == argc, "--cover-min")) break; cover_min = atof(argv[i++]); } else if (match_opt(argv[i], "-w", "--family-width")) { if (check_param(++i == argc, "--family-width")) break; family_width = atoi(argv[i++]); } else if (match_opt(argv[i], "-b", "--block-stats")) { print_block_stats = true; i++; } else if (match_opt(argv[i], "-l", "--list")) { print_font_list = true; i++; } else if (match_opt(argv[i], "-h", "--help")) { help_text = true; i++; } else { fprintf(stderr, "error: unknown option: %s\n", argv[i]); help_text = true; break; } } if (help_text) { print_help(argc, argv); exit(1); } } static bool endsWith(std::string str, std::string ext) { size_t i = str.find(ext); return (i == str.size() - ext.size()); } void scanFontDir(std::string dir) { std::vector<std::string> dirs; std::vector<std::string> fontfiles; size_t i = 0; dirs.push_back(dir); while(i < dirs.size()) { std::string current_dir = dirs[i++]; for (auto &name : file::list(current_dir)) { if (file::dirExists(name)) { dirs.push_back(name); } else if (endsWith(name, ".ttf")) { fontfiles.push_back(name); } } } for (auto &name : fontfiles) { manager.scanFontPath(name); } } static std::vector<uint> allCodepoints(FT_Face ftface) { std::vector<uint> l; unsigned glyph, codepoint = FT_Get_First_Char(ftface, &glyph); do { l.push_back(codepoint); codepoint = FT_Get_Next_Char(ftface, codepoint, &glyph); } while (glyph); return l; } void do_print_font_list() { for (auto &font : manager.getFontList()) { printf("font[%d] -> %s\n", font->font_id, font->getFontData().toString().c_str()); } } static std::string ltrim(std::string s) { s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) { return !std::isspace(ch); })); return s; } static std::string rtrim(std::string s) { s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) { return !std::isspace(ch); }).base(), s.end()); return s; } struct block { uint start; uint end; std::string name; }; std::vector<block> read_blocks() { // # @missing: 0000..10FFFF; No_Block // 0000..007F; Basic Latin std::vector<block> blocks; FILE *f; char buf[128]; const char* p; if ((f = fopen("data/unicode/Blocks.txt", "r")) == nullptr) { fprintf(stderr, "fopen: %s\n", strerror(errno)); exit(1); } while((p = fgets(buf, sizeof(buf), f)) != nullptr) { auto l = ltrim(rtrim(std::string(p))); if (l.size() == 0) continue; if (l.find("#") != std::string::npos) continue; size_t d = l.find(".."); size_t s = l.find(";"); blocks.push_back({ (uint)strtoul(l.substr(0,d).c_str(),nullptr, 16), (uint)strtoul(l.substr(d+2,s-d-2).c_str(),nullptr, 16), l.substr(s+2) }); } fclose(f); return blocks; } uint find_block(std::vector<block> &blocks, uint32_t cp) { uint i = 0; for (auto &b: blocks) { if (cp >= b.start && cp <= b.end) return i; i++; } return blocks.size()-1; } template <typename K, typename V> void hist_add(std::map<K,V> &hist, K key, V val) { auto hci = hist.find(key); if (hci == hist.end()) { hist.insert(hist.end(),std::pair<K,V>(key,val)); } else { hci->second += val; } } template <typename K> struct id_map { uint id; std::map<K,uint> map; std::map<uint,K> rmap; id_map() : id(0), map() {} uint get_id(K key) { auto i = map.find(key); if (i == map.end()) { i = map.insert(map.end(), std::pair<K,uint>(key, id++)); rmap[i->second] = key; } return i->second; } K get_key(uint i) { return rmap[i]; } }; template <typename T, typename K, typename V> auto find_or_insert(T &map, K key, V def) { auto i = map.find(key); if (i == map.end()) { i = map.insert(map.end(), std::pair<K,V>(key, def)); } return i; } std::string truncate(std::string str, size_t sz) { if (str.length() < sz) return str; else return str.substr(0, sz) + "..."; } struct block_family_data { std::map<font_face*,uint> codes; }; struct block_data { std::map<uint,block_family_data> families; }; struct family_data { std::string family_name; std::string font_names; uint family_count; uint glyph_count; }; template <typename K, typename V, typename F> std::string to_string(std::map<K,V> &list, F fn, std::string sep = ", ") { std::string str; auto i = list.begin(); if (i == list.end()) goto out; str.append(fn(i)); if (++i == list.end()) goto out; for (; i != list.end(); i++) { str.append(sep); str.append(fn(i)); } out: return str; } std::string remove_prefix(std::string &str, std::string sep) { auto i = str.find(sep); return (i != std::string::npos) ? str.substr(i+1) : str; } void do_print_block_stats() { id_map<std::string> font_name_map; id_map<std::string> font_family_map; std::vector<block> blocks; std::map<uint,block_data> block_stats; blocks = read_blocks(); blocks.push_back({0,0xfffff,"Unknown"}); for (auto &font : manager.getFontList()) { FT_Face ftface = static_cast<font_face_ft*>(font.get())->ftface; uint font_name_id = font_name_map.get_id(font->path); uint font_family_id = font_family_map.get_id(font->fontData.familyName); FT_Select_Charmap(ftface, FT_ENCODING_UNICODE); auto cplist = allCodepoints(ftface); for (auto cp : cplist) { uint bc = find_block(blocks,cp); auto bsi = find_or_insert(block_stats, bc, block_data()); auto fsi = find_or_insert(bsi->second.families, font_family_id, block_family_data()); auto gsi = find_or_insert(fsi->second.codes, font.get(), 0); gsi->second++; } } for (size_t i = 0; i < blocks.size(); i++) { auto &b = blocks[i]; auto bsi = block_stats.find(i); if (bsi->second.families.size() == 0) continue; printf("%06x..%06x; %-80s\n", b.start, b.end, b.name.c_str()); std::vector<family_data> fam_data; for (auto &ent : bsi->second.families) { uint font_family_id = ent.first; block_family_data &block_family_data = ent.second; std::string family_name = font_family_map.get_key(font_family_id); std::string font_names = to_string(block_family_data.codes, [](auto i) { return remove_prefix(i->first->name, "-"); }); uint glyph_count = 0; for (auto ent : block_family_data.codes) glyph_count += ent.second; uint family_count = (uint)block_family_data.codes.size(); fam_data.push_back(family_data{family_name, font_names, family_count, glyph_count}); } std::sort(fam_data.begin(), fam_data.end(), [](auto a, auto b) { return a.glyph_count/a.family_count > b.glyph_count/b.family_count; }); for (auto &ent: fam_data) { uint glyph_avg = ent.glyph_count/ent.family_count; uint block_glyphs = (b.end - b.start); float cover = (float)glyph_avg/(float)block_glyphs; if (cover < cover_min) continue; printf("\t%5.2f %10u,%-10u %-20s %s\n", cover, ent.family_count, ent.glyph_count/ent.family_count, ent.family_name.c_str(), truncate(ent.font_names, family_width).c_str()); } } } int main(int argc, char **argv) { parse_options(argc, argv); scanFontDir(font_dir); if (print_font_list) do_print_font_list(); if (print_block_stats) do_print_block_stats(); }
27.289256
97
0.564304
michaeljclark
757d05b94d787a75b21658024e4689120f2500d8
713
hpp
C++
source/rectangle.hpp
SVincent/programmiersprachen-aufgabenblatt-3.
4eeeec3973999e0bf57c81e7ae681930e259aa6b
[ "MIT" ]
null
null
null
source/rectangle.hpp
SVincent/programmiersprachen-aufgabenblatt-3.
4eeeec3973999e0bf57c81e7ae681930e259aa6b
[ "MIT" ]
null
null
null
source/rectangle.hpp
SVincent/programmiersprachen-aufgabenblatt-3.
4eeeec3973999e0bf57c81e7ae681930e259aa6b
[ "MIT" ]
null
null
null
#ifndef RECTANGLE_HPP #define RECTANGLE_HPP #include "vec2.hpp" #include "color.hpp" #include "window.hpp" class Rectangle { public: Rectangle(); Rectangle(Vec2 const& vec1, Vec2 const& vec2); Rectangle(Vec2 const& vec1, Vec2 const& vec2, Color const& col); // getter Vec2 getMax() const; Vec2 getMin() const; Color getColor() const; // setter void setMax(Vec2 const& vecmax); void setMin(Vec2 const& vecmin); void setColor(Color const& col); // methods float circumference() const; void draw(Window const& window); void draw(Window const& window, Color const& color); bool is_inside(Vec2 const& vec); private: Vec2 max_; Vec2 min_; Color colour_; }; #endif
19.805556
68
0.687237
SVincent
757de7f894579fe556a75aca8069431c8e9df4f6
855
hpp
C++
50_su2mesh/inc/SU2meshparser.hpp
nishiys/CFDbasics
638372956e31f8392f20b0d2027762cc4f9ef10b
[ "MIT" ]
1
2020-06-19T10:17:17.000Z
2020-06-19T10:17:17.000Z
50_su2mesh/inc/SU2meshparser.hpp
nishiys/CFDbasics
638372956e31f8392f20b0d2027762cc4f9ef10b
[ "MIT" ]
null
null
null
50_su2mesh/inc/SU2meshparser.hpp
nishiys/CFDbasics
638372956e31f8392f20b0d2027762cc4f9ef10b
[ "MIT" ]
1
2020-06-19T10:22:36.000Z
2020-06-19T10:22:36.000Z
#pragma once #include <string> #include <vector> #include "CellQuad4.hpp" #include "Face2d.hpp" #include "Node2d.hpp" namespace su2mesh { class SU2meshparser { public: SU2meshparser(std::string meshfilename); ~SU2meshparser(); void LoadData(); void WriteVtkFile(std::string vtkfilename); private: std::string meshfilename_; void ReadFile(); void CreateQuadArray(); std::vector<CellQuad4> cellarray_; // std::vector<Face2d> facearray_; std::vector<Node2d> nodearray_; unsigned int DIM_; unsigned int NElement_; unsigned int NPoint_; unsigned int NMarker_; const unsigned int LINE = 3; const unsigned int QUAD4 = 9; std::vector<std::vector<unsigned int>> element_table_; std::vector<std::vector<std::string>> marker_table_; void PrintDebug(); }; } // namespace su2mesh
19.431818
58
0.687719
nishiys
757fdcd03e7aa69d58068e1e383dcbaf0140708b
4,549
cpp
C++
init/init_xt897.cpp
chakaponden/android_device_motorola_xt897-lineage
d85dca38801ea4a4309411d1f17434124403169e
[ "FTL" ]
null
null
null
init/init_xt897.cpp
chakaponden/android_device_motorola_xt897-lineage
d85dca38801ea4a4309411d1f17434124403169e
[ "FTL" ]
null
null
null
init/init_xt897.cpp
chakaponden/android_device_motorola_xt897-lineage
d85dca38801ea4a4309411d1f17434124403169e
[ "FTL" ]
null
null
null
/* Copyright (c) 2013, The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name of The Linux Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <stdlib.h> #include <stdio.h> #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ #include <sys/_system_properties.h> #include <android-base/properties.h> #include <android-base/logging.h> #include "vendor_init.h" #include "property_service.h" #include "log.h" #include "util.h" void property_override(char const prop[], char const value[]) { prop_info *pi; pi = (prop_info*) __system_property_find(prop); if (pi) __system_property_update(pi, value, strlen(value)); else __system_property_add(prop, strlen(prop), value, strlen(value)); } void vendor_load_properties() { std::string carrier, device, modelno, platform; char hardware_variant[92]; FILE *fp; platform = android::base::GetProperty("ro.board.platform", ""); if (platform != ANDROID_TARGET) return; modelno = android::base::GetProperty("ro.boot.modelno", ""); carrier = android::base::GetProperty("ro.boot.carrier", ""); fp = popen("/system/xbin/sed -n '/Hardware/,/Revision/p' /proc/cpuinfo | /system/xbin/cut -d ':' -f2 | /system/xbin/head -1", "r"); fgets(hardware_variant, sizeof(hardware_variant), fp); pclose(fp); property_override("ro.product.device", "asanti_c"); property_override("ro.product.model", "PHOTON Q"); if (modelno == "XT897") { /* xt897 CSpire */ property_override("ro.build.description", "asanti_c_cspire-user 4.1.2 9.8.2Q-122_XT897_FFW-7 8 release-keys"); property_override("ro.build.fingerprint", "motorola/XT897_us_csp/asanti_c:4.1.2/9.8.2Q-122_XT897_FFW-7/8:user/release-keys"); android::init::property_set("ro.cdma.home.operator.alpha", "Cspire"); android::init::property_set("ro.cdma.home.operator.numeric", "311230"); } else if (carrier == "sprint") { /* xt897 Sprint */ property_override("ro.build.description", "XT897_us_spr-user 4.1.2 9.8.2Q-122_XT897_FFW-5 6 release-keys"); property_override("ro.build.fingerprint", "motorola/XT897_us_spr/asanti_c:4.1.2/9.8.2Q-122_XT897_FFW-5/6:user/release-keys"); android::init::property_set("ro.cdma.international.eri", "2,74,124,125,126,157,158,159,193,194,195,196,197,198,228,229,230,231,232,233,234,235"); android::init::property_set("ro.cdma.home.operator.alpha", "Sprint"); android::init::property_set("ro.cdma.home.operator.numeric", "310120"); android::init::property_set("ro.com.google.clientidbase.ms", "android-sprint-us"); android::init::property_set("ro.com.google.clientidbase.am", "android-sprint-us"); android::init::property_set("ro.com.google.clientidbase.yt", "android-sprint-us"); } device = android::base::GetProperty("ro.product.device", ""); LOG(INFO) << "Found carrier id: " << carrier.c_str() << " " << "hardware: " << hardware_variant << " " << "model no: " << modelno.c_str() << " " << "Setting build properties for " << device.c_str() << " device"; }
47.884211
153
0.697516
chakaponden
7582140c15c0c274c42fdd5cf142baf443e87a21
11,685
cpp
C++
openreil/libasmir/src/stmt.cpp
aeveris/openreil-sys
47a89248dfdfba88c4040cff77fc3efcde6f80e9
[ "MIT" ]
3
2017-06-27T22:33:16.000Z
2017-06-28T23:11:44.000Z
openreil/libasmir/src/stmt.cpp
aeveris/openreil-sys
47a89248dfdfba88c4040cff77fc3efcde6f80e9
[ "MIT" ]
null
null
null
openreil/libasmir/src/stmt.cpp
aeveris/openreil-sys
47a89248dfdfba88c4040cff77fc3efcde6f80e9
[ "MIT" ]
null
null
null
#include <string> #include <iostream> #include <fstream> #include <stdlib.h> #include <string.h> #include <assert.h> using namespace std; #include "stmt.h" Stmt *Stmt::clone(Stmt *s) { return s->clone(); } void Stmt::destroy(Stmt *s) { Move *move = NULL; Jmp *jmp = NULL; CJmp *cjmp = NULL; ExpStmt *expstmt = NULL; Call *call = NULL; Return *ret = NULL; Func *fun = NULL; switch (s->stmt_type) { case MOVE: move = (Move *)s; Exp::destroy(move->lhs); Exp::destroy(move->rhs); break; case JMP: jmp = (Jmp *)s; Exp::destroy(jmp->target); break; case CJMP: cjmp = (CJmp *)s; Exp::destroy(cjmp->cond); Exp::destroy(cjmp->t_target); Exp::destroy(cjmp->f_target); break; case EXPSTMT: expstmt = (ExpStmt *)s; Exp::destroy(expstmt->exp); break; case CALL: call = (Call *)s; if (call->lval_opt != NULL) { Exp::destroy(call->lval_opt); } for (vector<Exp *>::iterator i = call->params.begin(); i != call->params.end(); i++) { Exp::destroy(*i); } break; case RETURN: ret = (Return *)s; if (ret->exp_opt != NULL) { Exp::destroy(ret->exp_opt); } break; case FUNCTION: fun = (Func *)s; for (vector<VarDecl *>::iterator i = fun->params.begin(); i != fun->params.end(); i++) { Stmt::destroy(*i); } for (vector<Stmt *>::iterator i = fun->body.begin(); i != fun->body.end(); i++) { Stmt::destroy(*i); } break; case COMMENT: case SPECIAL: case LABEL: case VARDECL: case ASSERT: break; } delete s; } VarDecl::VarDecl(string n, reg_t t, address_t asm_ad, address_t ir_ad) : Stmt(VARDECL, asm_ad, ir_ad), name(n), typ(t) { } VarDecl::VarDecl(const VarDecl &other) : Stmt(VARDECL, other.asm_address, other.ir_address), name(other.name), typ(other.typ) { } VarDecl::VarDecl(Temp *t) : Stmt(VARDECL, 0x0, 0x0), name(t->name), typ(t->typ) { } string VarDecl::tostring() { string ret = "var " + name + ":" + Exp::string_type(this->typ) + ";"; return ret; } VarDecl *VarDecl::clone() const { return new VarDecl(*this); } string Move::tostring() { return lhs->tostring() + " = " + rhs->tostring() + ";"; } Move::Move(const Move &other) : Stmt(MOVE, other.asm_address, other.ir_address) { this->lhs = other.lhs->clone(); this->rhs = other.rhs->clone(); } Move::Move(Exp *l, Exp *r, address_t asm_addr, address_t ir_addr) : Stmt(MOVE, asm_addr, ir_addr), lhs(l), rhs(r) { } Move *Move::clone() const { return new Move(*this); } Label::Label(const Label &other) : Stmt(LABEL, other.asm_address, other.ir_address) { this->label = string(other.label); } Label::Label(string l, address_t asm_addr, address_t ir_addr) : Stmt(LABEL, asm_addr, ir_addr) { label = l; } Label *Label::clone() const { return new Label(*this); } string Label::tostring() { return "label " + label + ":"; } Jmp::Jmp(Exp *e, address_t asm_addr, address_t ir_addr) : Stmt(JMP, asm_addr, ir_addr), target(e) { } Jmp::Jmp(const Jmp &other) : Stmt(JMP, other.asm_address, other.ir_address) { target = other.target->clone(); } Jmp *Jmp::clone() const { return new Jmp(*this); } string Jmp::tostring() { string ret = "jmp(" + target->tostring() + ");"; return ret; } CJmp::CJmp(Exp *c, Exp *t, Exp *f, address_t asm_addr, address_t ir_addr) : Stmt(CJMP, asm_addr, ir_addr), cond(c), t_target(t), f_target(f) { } CJmp::CJmp(const CJmp &other) : Stmt(CJMP, other.asm_address, other.ir_address) { cond = other.cond->clone(); f_target = other.f_target->clone(); t_target = other.t_target->clone(); } CJmp *CJmp::clone() const { return new CJmp(*this); } string CJmp::tostring() { string ret = "cjmp(" + cond->tostring() + "," + t_target->tostring() + "," + f_target->tostring() + ");"; return ret; } Special::Special(string s, address_t asm_addr, address_t ir_addr) : Stmt(SPECIAL, asm_addr, ir_addr), special(s) { } Special::Special(const Special &other) : Stmt(SPECIAL, other.asm_address, other.ir_address) { special = other.special; } Special *Special::clone() const { return new Special(*this); } string Special::tostring() { string ret = "special(\"" + special + "\");"; return ret; } Comment::Comment(string s, address_t asm_addr, address_t ir_addr) : Stmt(COMMENT, asm_addr, ir_addr) { comment = s; } Comment::Comment(const Comment &other) : Stmt(COMMENT, other.asm_address, other.ir_address) { comment = other.comment; } Comment *Comment::clone() const { return new Comment(*this); } string Comment::tostring() { string s = "// " + string(comment); return s; } ExpStmt::ExpStmt(Exp *e, address_t asm_addr, address_t ir_addr) : Stmt(EXPSTMT, asm_addr, ir_addr) { exp = e; } ExpStmt::ExpStmt(const ExpStmt &other) : Stmt(EXPSTMT, other.asm_address, other.ir_address) { exp = other.exp->clone(); } ExpStmt *ExpStmt::clone() const { return new ExpStmt(*this); } string ExpStmt::tostring() { string s = exp->tostring() + ";"; return s; } Call::Call(Exp *lval_opt, string fnname, vector<Exp *> params, address_t asm_ad, address_t ir_ad) : Stmt(CALL, asm_ad, ir_ad) { this->lval_opt = lval_opt; this->callee = new Name(fnname); this->params = params; } Call::Call(Exp *lval_opt, Exp *callee, vector<Exp *> params, address_t asm_ad, address_t ir_ad) : Stmt(CALL, asm_ad, ir_ad) { this->lval_opt = lval_opt; this->callee = callee; this->params = params; } Call::Call(const Call &other) : Stmt(CALL, other.asm_address, other.ir_address) { this->lval_opt = (other.lval_opt == NULL) ? NULL : other.lval_opt->clone(); assert(other.callee); this->callee = other.callee->clone(); this->params.clear(); for (vector<Exp *>::const_iterator i = other.params.begin(); i != other.params.end(); i++) { this->params.push_back((*i)->clone()); } } string Call::tostring() { ostringstream ostr; Name *name; if (this->lval_opt != NULL) { ostr << this->lval_opt->tostring() << " = "; } if (this->callee->exp_type == NAME) { name = (Name *) this->callee; ostr << name->name; } else { ostr << "call " << this->callee->tostring(); } ostr << "("; for (vector<Exp *>::iterator i = this->params.begin(); i != this->params.end(); i++) { ostr << (*i)->tostring(); if ((i + 1) != this->params.end()) { ostr << ", "; } } ostr << ");"; string str = ostr.str(); return str; } Call *Call::clone() const { return new Call(*this); } Return::Return(Exp *exp_opt, address_t asm_ad, address_t ir_ad) : Stmt(RETURN, asm_ad, ir_ad) { this->exp_opt = exp_opt; } Return::Return(const Return &other) : Stmt(RETURN, other.asm_address, other.ir_address) { this->exp_opt = (other.exp_opt == NULL) ? NULL : other.exp_opt->clone(); } string Return::tostring() { ostringstream ostr; ostr << "return"; if (this->exp_opt != NULL) { ostr << " " << this->exp_opt->tostring(); } ostr << ";"; return ostr.str(); } Return *Return::clone() const { return new Return(*this); } Func::Func(string fnname, bool has_rv, reg_t rt, vector<VarDecl *> params, bool external, vector<Stmt *> body, address_t asm_ad, address_t ir_ad) : Stmt(FUNCTION, asm_ad, ir_ad) { this->fnname = fnname; this->has_rv = has_rv; this->rt = rt; this->params = params; this->external = external; this->body = body; } Func::Func(const Func &other) : Stmt(FUNCTION, other.asm_address, other.ir_address) { this->fnname = other.fnname; this->has_rv = other.has_rv; this->rt = other.rt; this->params.clear(); for (vector<VarDecl *>::const_iterator i = other.params.begin(); i != other.params.end(); i++) { this->params.push_back((*i)->clone()); } this->external = other.external; this->body.clear(); for (vector<Stmt *>::const_iterator i = other.body.begin(); i != other.body.end(); i++) { this->body.push_back((*i)->clone()); } } string Func::tostring() { ostringstream ostr; if (external) { ostr << "extern "; } if (has_rv) { ostr << Exp::string_type(rt) << " "; } else { ostr << "void "; } ostr << this->fnname << "("; for (vector<VarDecl *>::iterator i = this->params.begin(); i != this->params.end(); i++) { ostr << (*i)->tostring(); if ((i + 1) != this->params.end()) { ostr << ", "; } } ostr << ")"; if (this->body.empty()) { ostr << ";"; } else { ostr << "\n"; ostr << "{\n"; for (vector<Stmt *>::iterator i = this->body.begin(); i != this->body.end(); i++) { ostr << "\t" << (*i)->tostring() << endl; } ostr << "}"; } return ostr.str(); } Func *Func::clone() const { return new Func(*this); } Assert::Assert(Exp *cond, address_t asm_ad, address_t ir_ad) : Stmt(ASSERT, asm_ad, ir_ad), cond(cond) { } Assert::Assert(const Assert &other) : Stmt(ASSERT, other.asm_address, other.ir_address) { cond = other.cond->clone(); } string Assert::tostring() { return "assert(" + cond->tostring() + ");"; } Internal::Internal(int type, int size, address_t asm_addr, address_t ir_addr) : Stmt(INTERNAL, asm_addr, ir_addr) { this->type = type; this->size = size; if (size > 0) { this->data = malloc(size); assert(this->data); memset(this->data, 0, size); } else { this->data = NULL; } } Internal::Internal(const Internal &other) : Stmt(INTERNAL, other.asm_address, other.ir_address) { this->type = other.type; this->size = other.size; if (other.data) { this->data = malloc(other.size); assert(this->data); memcpy(this->data, other.data, other.size); } else { this->data = NULL; } } Internal::~Internal() { if (this->data) { free(this->data); } } Internal *Internal::clone() const { return new Internal(*this); } string Internal::tostring() { string s = ""; return s; } //---------------------------------------------------------------------- // Convert int to std::string in decimal form //---------------------------------------------------------------------- string int_to_str(int i) { ostringstream stream; stream << i << flush; return (stream.str()); } //---------------------------------------------------------------------- // Convert int to std::string in hex form //---------------------------------------------------------------------- string int_to_hex(int i) { ostringstream stream; stream << hex << i << flush; return (stream.str()); } //---------------------------------------------------------------------- // Generate a unique label, this is done using a static counter // internal to the function. //---------------------------------------------------------------------- Label *mk_label() { static int label_counter = 0; return new Label("L_" + int_to_str(label_counter++)); }
19.638655
113
0.543004
aeveris
7582297e43ee942e00e602f4e8cb642d4a4bdcf6
407
cpp
C++
Wonderland/Wonderland/Old Files/Source/Engine/Common/Containers/List/TLinkedList.cpp
RodrigoHolztrattner/Wonderland
ffb71d47c1725e7cd537e2d1380962b5dfdc3d75
[ "MIT" ]
3
2018-04-09T13:01:07.000Z
2021-03-18T12:28:48.000Z
Wonderland/Wonderland/Old Files/Source/Engine/Common/Containers/List/TLinkedList.cpp
RodrigoHolztrattner/Wonderland
ffb71d47c1725e7cd537e2d1380962b5dfdc3d75
[ "MIT" ]
null
null
null
Wonderland/Wonderland/Old Files/Source/Engine/Common/Containers/List/TLinkedList.cpp
RodrigoHolztrattner/Wonderland
ffb71d47c1725e7cd537e2d1380962b5dfdc3d75
[ "MIT" ]
1
2021-03-18T12:28:50.000Z
2021-03-18T12:28:50.000Z
/////////////////////////////////////////////////////////////////////////////// // Filename: TLinkedList.cpp /////////////////////////////////////////////////////////////////////////////// #include "TLinkedList.h" /* TLinkedList::TLinkedList() { } TLinkedList::TLinkedList(const TLinkedList& other) { } TLinkedList::~TLinkedList() { } bool TLinkedList::Initialize() { bool result; return true; } */
15.074074
79
0.425061
RodrigoHolztrattner
7586ba4cb3cf416d70a14bae06b2dc545a587962
491
cpp
C++
src/Arduino/ADXL345/example_basics.cpp
smurilogs/EmbeddedSystems-ATmega328P-ArduinoPlatform-InterfacingLibraries
30795f46112ab5b56a8244b198f0193afb8755ba
[ "MIT" ]
null
null
null
src/Arduino/ADXL345/example_basics.cpp
smurilogs/EmbeddedSystems-ATmega328P-ArduinoPlatform-InterfacingLibraries
30795f46112ab5b56a8244b198f0193afb8755ba
[ "MIT" ]
null
null
null
src/Arduino/ADXL345/example_basics.cpp
smurilogs/EmbeddedSystems-ATmega328P-ArduinoPlatform-InterfacingLibraries
30795f46112ab5b56a8244b198f0193afb8755ba
[ "MIT" ]
null
null
null
#include <Arduino.h> #include <stdint.h> #include <Math.h> #include "ADXL345.h" ADXL345 accel; void setup() { Serial.begin(9600); Wire.begin(); accel.begin(); delay(1500); } void loop() { float x = (int16_t) accel.getXAccel()* 0.00390625; Serial.println(x); float y = (int16_t) accel.getYAccel()* 0.00390625; Serial.println(y); float z = (int16_t) accel.getZAccel()* 0.00390625; Serial.println(z); Serial.println(); delay(500); }
15.83871
54
0.608961
smurilogs
7595c473c83949b920e976fe7882de7871505b6a
7,715
cpp
C++
test/cpp/exceptions.cpp
fujiehuang/ecto
fea744337aa1fad1397c9a3ba5baa143993cb5eb
[ "BSD-3-Clause" ]
77
2015-01-30T15:45:43.000Z
2022-03-03T02:29:37.000Z
test/cpp/exceptions.cpp
fujiehuang/ecto
fea744337aa1fad1397c9a3ba5baa143993cb5eb
[ "BSD-3-Clause" ]
37
2015-01-18T21:04:36.000Z
2021-07-09T08:24:54.000Z
test/cpp/exceptions.cpp
fujiehuang/ecto
fea744337aa1fad1397c9a3ba5baa143993cb5eb
[ "BSD-3-Clause" ]
29
2015-02-17T14:37:18.000Z
2021-11-16T07:46:26.000Z
// // Copyright (c) 2011, Willow Garage, Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * 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. // * Neither the name of the Willow Garage, Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // #include <Python.h> #include <gtest/gtest.h> #include <boost/exception/diagnostic_information.hpp> #include <ecto/ecto.hpp> #include <ecto/except.hpp> #include <ecto/plasm.hpp> #include <ecto/scheduler.hpp> #define STRINGDIDLY(A) std::string(#A) using namespace ecto; struct InConstructorExcept { InConstructorExcept() { throw std::logic_error("no.... I do not want to live."); } }; struct ExceptionalModule1 { static void declare_params(tendrils& p) { p.declare<double> ("d"); p.declare<float> ("f").set_default_val(p.get<float> ("d")); } }; struct ExceptionUnknownException { static void declare_params(tendrils& p) { p.declare<double> ("d"); } static void declare_io(const tendrils& p, tendrils& in, tendrils& out) { in.declare<double> ("d"); throw "A string"; } }; struct NotExist { static void declare_params(tendrils& p) { p.declare<int> ("a"); } static void declare_io(const tendrils& p, tendrils& in, tendrils& out) { in.declare<double> ("d"); in.declare<ExceptionalModule1> ("c"); in.declare<std::string> ("e"); out.declare<std::string> ("a"); } int process(const tendrils& in, const tendrils& out) { in.get<double> ("a"); return 0; } }; struct WrongType { static void declare_io(const tendrils& p, tendrils& in, tendrils& out) { in.declare<double> ("d"); } int process(const tendrils& in, const tendrils& out) { in.get<int> ("d"); return 0; } }; struct ParameterCBExcept { static void declare_params(tendrils& p) { p.declare<double> ("x"); } void xcb(double x) { std::cout << "*** about to throw std::runtime_error ***" << std::endl; throw std::runtime_error("I'm a bad callback, and I like it that way."); } void configure(const tendrils& p,const tendrils& in, const tendrils& out) { std::cout << "configurated ***" << std::endl; spore<double> x = p["x"]; x.set_callback(boost::bind(&ParameterCBExcept::xcb,this,_1)); } }; struct ProcessException { int process(const tendrils& in, const tendrils& out) { throw std::logic_error("A standard exception"); return ecto::OK; } }; TEST(Exceptions, ExceptionalModules) { try { cell* p = new cell_<ExceptionalModule1>; p->declare_params(); } catch (except::EctoException& e) { std::cout << "Good, threw an exception:\n" << e.what() << std::endl; } } TEST(Exceptions, ExceptionUnknownException) { try { cell* c = new cell_<ExceptionUnknownException>; c->declare_params(); c->declare_io(); } catch (except::EctoException& e) { std::cout << "Good, threw an exception:\n" << e.what() << std::endl; } } #define MEH(x, y) x TEST(Exceptions, ProcessException) { std::string stre("Original Exception: std::logic_error\n" " What : A standard exception\n" " Module : ProcessException\n" " Function: process"); cell::ptr m(new cell_<ProcessException>); EXPECT_THROW( try { m->process(); } catch (except::EctoException& e) { std::cout << "Good, threw an exception:\n" << e.what() << std::endl; std::cout << diagnostic_information(e) << "\n"; /* if(stre != e.msg_) { throw std::runtime_error("Got :" + e.msg_ +"\nExpected :" +stre); } */ throw; } , ecto::except::EctoException); } TEST(Exceptions, NotExist) { std::string stre( "'a' does not exist in this tendrils object. Possible keys are: 'c':type(ExceptionalModule1) 'd':type(double) 'e':type(std::string)\n" " Hint : 'a' does exist in parameters (type == int) outputs (type == std::string)\n" " Module : NotExist\n" " Function: process"); cell::ptr m(new cell_<NotExist>); try { m->process(); } catch (except::NonExistant& e) { std::cout << "Good, threw an exception:\n" << e.what() << std::endl; //EXPECT_EQ(stre, e.msg_); } } TEST(Exceptions, WrongType) { std::string stre("double is not a int\n" " Hint : 'd' is of type double\n" " Module : WrongType\n" " Function: process"); cell::ptr m(new cell_<WrongType>); m->declare_params(); m->declare_io(); bool threw = false; try { m->process(); } catch (except::TypeMismatch& e) { std::cout << "Good, threw an exception:\n" << e.what() << std::endl; // EXPECT_EQ(stre, e.msg_); threw = true; } EXPECT_TRUE(threw); } TEST(Exceptions, WrongType_sched) { for (unsigned j=0; j<100; ++j) { cell::ptr m(new cell_<WrongType>); m->declare_params(); m->declare_io(); plasm::ptr p(new plasm); p->insert(m); scheduler sched(p); bool threw = false; try { sched.execute(8); FAIL(); } catch (except::TypeMismatch& e) { std::cout << "Good, threw an exception:\n" << e.what() << std::endl; threw = true; } EXPECT_TRUE(threw); } } TEST(Exceptions, ParameterCBExcept_sched) { cell::ptr m(new cell_<ParameterCBExcept>); m->declare_params(); m->declare_io(); m->parameters["x"] << 5.1; m->parameters["x"]->dirty(true); plasm::ptr p(new plasm); p->insert(m); scheduler sched(p); try { sched.execute(8); FAIL(); } catch (except::EctoException& e) { std::cout << "Good, threw an exception:\n" << ecto::except::diagnostic_string(e) << std::endl; } } TEST(Exceptions, ConstructorExcept) { cell::ptr m(new cell_<InConstructorExcept>); m->declare_params(); m->declare_io(); plasm::ptr p(new plasm); p->insert(m); scheduler sched(p); try { sched.execute(8); FAIL(); } catch (except::EctoException& e) { std::cout << "Good, threw an exception:\n" << ecto::except::diagnostic_string(e) << std::endl; const std::string* what = boost::get_error_info<ecto::except::what>(e); EXPECT_TRUE(what); EXPECT_EQ(*what, std::string("no.... I do not want to live.")); } }
24.967638
146
0.623331
fujiehuang
759700e8171ec4a0b2c3899cc3ccdea6d83aa383
462
cpp
C++
18-STL/03-Using_STL.cpp
PronomitaDey/Cpp_Tutorial
a64a10a27d018bf9edf5280505201a1fbfd359ed
[ "MIT" ]
null
null
null
18-STL/03-Using_STL.cpp
PronomitaDey/Cpp_Tutorial
a64a10a27d018bf9edf5280505201a1fbfd359ed
[ "MIT" ]
1
2021-10-01T13:35:44.000Z
2021-10-02T03:54:29.000Z
18-STL/03-Using_STL.cpp
PronomitaDey/Cpp_Tutorial
a64a10a27d018bf9edf5280505201a1fbfd359ed
[ "MIT" ]
3
2021-10-01T14:07:09.000Z
2021-10-01T18:24:31.000Z
#include <vector> #include <list> #include <iostream> using namespace std; int main() { // Creating a Vector vector<int> v = {10, 20, 40}; v.push_back(25); v.push_back(55); v.pop_back(); // To create an iterator vector<int>::iterator itr = v.begin(); for (itr = v.begin(); itr != v.end(); itr++) { cout << ++*itr << endl; } // for (int x : v) // { // cout << x << " "; // } return 0; }
16.5
48
0.484848
PronomitaDey
759e21d1f0182578dd7f01be8e13627a7295980b
100
cpp
C++
src/Plugins/U4_AdminCommands/Source/U4_AdminCommands/Private/U4_AdminCommand_Sunset.cpp
CyberAndrii/unturned4-mod-example
05595a0e5411b18ac6b8b06bbf8e2797f95defaa
[ "MIT" ]
6
2022-03-20T01:34:32.000Z
2022-03-28T19:32:53.000Z
src/Plugins/U4_AdminCommands/Source/U4_AdminCommands/Private/U4_AdminCommand_Sunset.cpp
CyberAndrii/unturned4-mod-example
05595a0e5411b18ac6b8b06bbf8e2797f95defaa
[ "MIT" ]
null
null
null
src/Plugins/U4_AdminCommands/Source/U4_AdminCommands/Private/U4_AdminCommand_Sunset.cpp
CyberAndrii/unturned4-mod-example
05595a0e5411b18ac6b8b06bbf8e2797f95defaa
[ "MIT" ]
null
null
null
// Copyright Smartly Dressed Games Ltd. All Rights Reserved. #include "U4_AdminCommand_Sunset.h"
16.666667
60
0.78
CyberAndrii
b5a4f06b8dc249bcc64b0fe586600ccf5c8393c0
2,609
cpp
C++
samples/std-remove-if/std-remove-if.cpp
Studiofreya/code-samples
4057c5204d7d37c29ded306861ef6eaded7527e5
[ "MIT" ]
17
2015-08-13T05:30:48.000Z
2022-03-16T16:03:28.000Z
samples/std-remove-if/std-remove-if.cpp
Studiofreya/code-samples
4057c5204d7d37c29ded306861ef6eaded7527e5
[ "MIT" ]
null
null
null
samples/std-remove-if/std-remove-if.cpp
Studiofreya/code-samples
4057c5204d7d37c29ded306861ef6eaded7527e5
[ "MIT" ]
18
2015-02-22T16:36:54.000Z
2022-02-07T00:04:39.000Z
#include <vector> #include <list> #include <string> #include <algorithm> #include <iterator> #include <iostream> template<typename T> void printVector(const T & v) { std::copy(v.cbegin(), v.cend(), std::ostream_iterator<int>(std::cout, " ")); std::cout << "\n"; } int main() { { // Vector with numbers, initialized with an initializer list std::vector<int> numbers{ 1,1,2,3,4,5,6 }; // Lambda for removing numbers less than 3 auto removeNumbers = [&](int number) -> bool { return number < 3; }; // Print contents of vector printVector(numbers); // Call std::remove_if and obtain iterator auto iterator = std::remove_if(numbers.begin(), numbers.end(), removeNumbers); // Print vector again printVector(numbers); // Remove from vector numbers.erase(iterator, numbers.end());; // Final print of vectors printVector(numbers); } { std::list<int> numbers{ 1,1,2,3,4,5,6 }; // Lambda for removing numbers less than 3 auto removeNumbers = [](int number) -> bool { return number < 3; }; printVector(numbers); numbers.remove_if(removeNumbers); printVector(numbers); } { std::vector<int> numbers{ 1,1,2,3,4,5,6 }; std::vector<int> removed(numbers.size()); // Lambda for removing numbers less than 3 auto removeNumbers = [&](int number) -> bool { return number < 3; }; printVector(numbers); std::remove_copy_if(numbers.begin(), numbers.end(), removed.begin(), removeNumbers); printVector(numbers); int baba = 0; } { struct Widget { std::string name; // Widget name bool deleted; // Should be deleted }; auto printWidgets = [&](const std::vector<Widget> & widgets) { for (const auto & w : widgets) { std::cout << std::boolalpha << "'" << w.name << "'=" << w.deleted << " "; } std::cout << "\n"; }; // Store them in a container std::vector<Widget> widgets; widgets.emplace_back(Widget{ "W1", true }); widgets.emplace_back(Widget{ "W2", true }); widgets.emplace_back(Widget{ "W3", false }); widgets.emplace_back(Widget{ "W4", true }); widgets.emplace_back(Widget{ "W5", false }); widgets.emplace_back(Widget{ "W6", true }); widgets.emplace_back(Widget{ "W7", true }); widgets.emplace_back(Widget{ "W8", false }); auto removeDeletedWidgets = [&](const Widget & widget) -> bool { return widget.deleted; }; printWidgets(widgets); auto iterator = std::remove_if(widgets.begin(), widgets.end(), removeDeletedWidgets); printWidgets(widgets); widgets.erase(iterator, widgets.end()); printWidgets(widgets); int baba = 0; } return 0; }
20.382813
87
0.643542
Studiofreya
b5a6756ac95c7f7af30a235d76eef0fe9278fc0c
3,129
cpp
C++
LargeCarCO.cpp
IRLSCU/QtController
597d6153f641073c367724fcccc9fe5e68cb2c18
[ "Apache-2.0" ]
null
null
null
LargeCarCO.cpp
IRLSCU/QtController
597d6153f641073c367724fcccc9fe5e68cb2c18
[ "Apache-2.0" ]
null
null
null
LargeCarCO.cpp
IRLSCU/QtController
597d6153f641073c367724fcccc9fe5e68cb2c18
[ "Apache-2.0" ]
null
null
null
#include "LargeCarCO.h" LargeCarCO::LargeCarCO() {} LargeCarCO::~LargeCarCO(){} LargeCarCO& LargeCarCO::setTurnRange(qint16 turnRange) {//0~15位,第0、1个字节 // if (turnRange > LARGECARCO_MAX_TURN_RANGE) { // turnRange = LARGECARCO_MAX_TURN_RANGE; // } // else if (turnRange < LARGECARCO_MIN_TURN_RANGE) { // turnRange = LARGECARCO_MIN_TURN_RANGE; // } this->turnRange = turnRange; return *this; } LargeCarCO& LargeCarCO::setSpeed(quint8 speed) {//16~23位,第2个字节.0表示最大加速度,127表示最小加速度 // if (speed < LARGECARCO_MAX_SPEED) { // speed = LARGECARCO_MAX_SPEED; // } // else if (speed > LARGECARCO_MIN_SPEED) { speed = LARGECARCO_MIN_SPEED; } this->speed = speed; return *this; } LargeCarCO& LargeCarCO::setBrake(quint8 brake) {//16~23位,第2个字节,128最小减速度,255最大减速度 // if (brake > LARGECARCO_MAX_BRAKE) { // brake = LARGECARCO_MAX_BRAKE; // } // else if (brake < LARGECARCO_MIN_BRAKE) { brake = LARGECARCO_MIN_BRAKE; } this->speed = brake; return *this; } /* 三种挡位0空挡,1表示前进挡,2表示后退挡 */ LargeCarCO& LargeCarCO::setGear(quint8 gear) {//24~31,第3个字节 if (gear == LARGECARCO_GEAR_ZERO || gear == LARGECARCO_GEAR_FORWARD || gear == LARGECARCO_GEAR_BACKWARD) { this->gear = gear; }else{ qDebug("geal=%d,setting error",gear); } return *this; } /* 灯光 0不亮 1右转向灯亮 2左转向灯亮 3应急灯亮 */ LargeCarCO& LargeCarCO::setSignal(quint8 signal) {//32-39,第4个字节 if (signal==LARGECARCO_LIGHT_ALL_OFF||signal==LARGECARCO_LIGHT_LEFT_ON||signal==LARGECARCO_LIGHT_RIGHT_ON) { this->signal = signal; }else{ qDebug("signal=%d,setting error",signal); } return *this; } /* (1)代表鸣笛;(0)代表静音 */ LargeCarCO& LargeCarCO::setHorn(quint8 horn) {//40-47,第5个字节 if (horn == LARGECARCO_HORN_OFF || horn == LARGECARCO_HORN_ON) { this->horn = horn; }else{ qDebug("horn=%d,setting error",horn); } return *this; } void LargeCarCO::emergencyBraking() { init(); setBrake(LARGECARCO_MAX_BRAKE); qDebug()<<QStringLiteral("紧急刹车"); } void LargeCarCO::init() { for (int i = 0; i < 8; i++) { this->charOrder[i] = 0; } setTurnRange(0); setSpeed(LARGECARCO_MIN_SPEED); setSignal(0); setHorn(0); setGear(0); } quint8* LargeCarCO::getCharOrder() { //转向 quint8 low = (turnRange & 0x00FF); quint8 high = (turnRange >>8) & 0x00FF; this->charOrder[0] = low; this->charOrder[1] = high; //速度 this->charOrder[2] = speed; //挡位 this->charOrder[3] =gear; //转向灯 this->charOrder[4] = signal; //鸣笛 this->charOrder[5] = horn; return charOrder; } void LargeCarCO::printInfo(){ qDebug("Large Car Control Order: speed:%d,turnRange:%d,gear:%d%s,lightSignal:%d%s,hore:%d%s", speed,turnRange, gear,gear==0?QStringLiteral("空挡"):gear==1?QStringLiteral("前进挡"):QStringLiteral("后退档"), signal,signal==0?QStringLiteral("所有灯光关闭"):signal==1?QStringLiteral("右转向灯亮"):QStringLiteral("左转向灯亮"), horn,horn==0?QStringLiteral("静音"):QStringLiteral("鸣笛") ); }
27.447368
113
0.628316
IRLSCU
b5a6eeec7f14c117b98107898c5773542a18e012
1,602
cpp
C++
src/autoCL.cpp
jeschwarz0/JobHelper
6e86270717e053e7798b06726b0a076d20894c62
[ "MIT" ]
null
null
null
src/autoCL.cpp
jeschwarz0/JobHelper
6e86270717e053e7798b06726b0a076d20894c62
[ "MIT" ]
null
null
null
src/autoCL.cpp
jeschwarz0/JobHelper
6e86270717e053e7798b06726b0a076d20894c62
[ "MIT" ]
null
null
null
/* * File: autoCL.cpp * Author: Jesse Schwarz * * Created on January 15, 2018, 7:22 PM */ #include <stdio.h> #include <iostream> #include <string> #include <stdlib.h> #include "autoCL.h" using namespace std; namespace autoCL { cltype manualGetType(cltype rec) { cout << "What type would you like:\n" << none << "='EXIT'\n" << (rec == 1 ? "(R)" : "") << Default << "=Default\n"; char c; cin >> c; cin.clear(); cin.ignore(); return (c == 'r' || c == 'R') ? rec : (cltype) atoi(&c); } //TODO: Fix this string getString(const char* IDENTIFIER, const string& REC) { const bool USEREC = REC != "NA" && REC != "NYI"; cout << "Please enter the " << IDENTIFIER << (USEREC ? ",[r]" : "") << (USEREC ? REC : "") << ": "; string rv; getline(cin, rv); return !rv.empty()&&(rv.at(0) == 'r' || rv.at(0) == 'R') && REC != "NA" ? REC : rv; } void strReplace(string& haystack, const string find, const string replace) { for (size_t offset = haystack.find(find); offset != string::npos; offset = haystack.find(find)) { haystack.erase(offset, find.size()); haystack.insert(offset, replace); } } std::string getCoverLetter(cltype t, const string POSITION, const string COMPANY) { string rawrval = "!!!Not Implemented!!!";//TODO: Implement from file system strReplace(rawrval, "<position>", POSITION); strReplace(rawrval, "<employer>", COMPANY); return rawrval; } }
31.411765
105
0.535581
jeschwarz0
b5a9b5fe2ec358ffd88a72c58e05529f9c85ee6e
3,706
cpp
C++
PostView2/AreaCoverageTool.cpp
febiosoftware/PostView
45c60aec1ae8832d0e6f6410e774aeaded2037c0
[ "MIT" ]
9
2020-03-22T08:27:03.000Z
2021-09-24T10:02:37.000Z
PostView2/AreaCoverageTool.cpp
febiosoftware/PostView
45c60aec1ae8832d0e6f6410e774aeaded2037c0
[ "MIT" ]
1
2021-03-02T06:45:59.000Z
2021-03-02T06:45:59.000Z
PostView2/AreaCoverageTool.cpp
febiosoftware/PostView
45c60aec1ae8832d0e6f6410e774aeaded2037c0
[ "MIT" ]
2
2020-06-27T13:59:49.000Z
2021-09-08T16:39:39.000Z
/*This file is part of the PostView source code and is licensed under the MIT license listed below. See Copyright-PostView.txt for details. Copyright (c) 2020 University of Utah, The Trustees of Columbia University in the City of New York, and others. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ #include "stdafx.h" #include "AreaCoverageTool.h" #include <QBoxLayout> #include <QPushButton> #include <QLineEdit> #include <QLabel> #include <vector> #include "Document.h" #include <PostLib/FEAreaCoverage.h> using namespace std; using namespace Post; class CAreaCoverageToolUI : public QWidget { public: QPushButton* p1; QPushButton* p2; QLineEdit* name; FEAreaCoverage m_tool; public: CAreaCoverageToolUI(CAreaCoverageTool* tool) : m_tool(nullptr) { name = new QLineEdit; name->setPlaceholderText("Enter name here"); p1 = new QPushButton("Assign to surface 1"); p2 = new QPushButton("Assign to surface 2"); QPushButton* apply = new QPushButton("Apply"); QHBoxLayout* h = new QHBoxLayout; h->addWidget(new QLabel("Name:")); h->addWidget(name); QVBoxLayout* pv = new QVBoxLayout; pv->addLayout(h); pv->addWidget(p1); pv->addWidget(p2); pv->addWidget(apply); pv->addStretch(); setLayout(pv); QObject::connect(p1, SIGNAL(clicked(bool)), tool, SLOT(OnAssign1())); QObject::connect(p2, SIGNAL(clicked(bool)), tool, SLOT(OnAssign2())); QObject::connect(apply, SIGNAL(clicked(bool)), tool, SLOT(OnApply())); } }; //============================================================================= CAreaCoverageTool::CAreaCoverageTool(CMainWindow* wnd) : CAbstractTool("Area Coverage", wnd) { ui = 0; } QWidget* CAreaCoverageTool::createUi() { return ui = new CAreaCoverageToolUI(this); } void CAreaCoverageTool::OnAssign1() { CDocument* doc = GetActiveDocument(); if (doc && doc->IsValid()) { vector<int> sel; doc->GetGLModel()->GetSelectionList(sel, SELECT_FACES); ui->m_tool.SetSelection1(sel); int n = (int)sel.size(); ui->p1->setText(QString("Assign to surface 1 (%1 faces)").arg(n)); } } void CAreaCoverageTool::OnAssign2() { CDocument* doc = GetActiveDocument(); if (doc && doc->IsValid()) { vector<int> sel; doc->GetGLModel()->GetSelectionList(sel, SELECT_FACES); ui->m_tool.SetSelection2(sel); int n = (int)sel.size(); ui->p2->setText(QString("Assign to surface 2 (%1 faces)").arg(n)); } } void CAreaCoverageTool::OnApply() { CDocument* doc = GetActiveDocument(); if (doc && doc->IsValid()) { /* FEAreaCoverage& tool = ui->m_tool; tool.SetDataFieldName(""); QString name = ui->name->text(); if (name.isEmpty() == false) { tool.SetDataFieldName(name.toStdString()); } tool.Apply(doc->GetFEModel()); updateUi(); */ } }
28.075758
92
0.712628
febiosoftware
b5ab6f6812fe48806537cf6080b72c65ca2dcf1c
2,304
cpp
C++
src/vec3.cpp
francisrstokes/WaveStrider
854095c6fec04dfcafabc8bcbf65745fa62f4880
[ "MIT" ]
1
2021-05-30T16:21:11.000Z
2021-05-30T16:21:11.000Z
src/vec3.cpp
francisrstokes/cpp-raymarcher
854095c6fec04dfcafabc8bcbf65745fa62f4880
[ "MIT" ]
null
null
null
src/vec3.cpp
francisrstokes/cpp-raymarcher
854095c6fec04dfcafabc8bcbf65745fa62f4880
[ "MIT" ]
null
null
null
#include "vec3.hpp" #include <math.h> namespace WaveStrider { vec3::vec3(double X, double Y, double Z) : x{ X }, y{ Y }, z{ Z } {}; vec3::vec3(double n) : x{ n }, y{ n }, z{ n } {}; vec3::vec3() : x{ 0 }, y{ 0 }, z{ 0 } {}; vec3::vec3(const vec3 &v) : x{ v.x }, y{ v.y }, z{ v.z } {}; double vec3::length() { return sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)); }; vec3 vec3::clamp(double minVal, double maxVal) { return vec3( x < minVal ? minVal : x > maxVal ? maxVal : x, y < minVal ? minVal : y > maxVal ? maxVal : y, z < minVal ? minVal : z > maxVal ? maxVal : z); }; double vec3::dot(vec3 const &b) { return x * b.x + y * b.y + z * b.z; }; vec3 vec3::normalize() { double l = length(); if (l == 0) return vec3(x, y, z); return vec3( x / l, y / l, z / l); }; vec3 vec3::max(double n) { return vec3( x > n ? x : n, y > n ? y : n, z > n ? z : n); }; vec3 vec3::min(double n) { return vec3( x < n ? x : n, y < n ? y : n, z < n ? z : n); }; vec3 vec3::operator+(const vec3 &b) { return vec3(this->x + b.x, this->y + b.y, this->z + b.z); }; vec3 vec3::operator-(const vec3 &b) { return vec3(this->x - b.x, this->y - b.y, this->z - b.z); }; vec3 vec3::operator*(const vec3 &b) { return vec3(this->x * b.x, this->y * b.y, this->z * b.z); }; vec3 vec3::operator*(double n) { return vec3(this->x * n, this->y * n, this->z * n); }; vec3 vec3::operator*=(double n) { this->x *= n; this->y *= n; this->z *= n; return *this; }; vec3 vec3::operator/(const vec3 &b) { return vec3(this->x / b.x, this->y / b.y, this->z / b.z); }; vec3 vec3::operator/(double n) { return vec3(this->x / n, this->y / n, this->z / n); }; vec3 vec3::operator/=(double n) { this->x /= n; this->y /= n; this->z /= n; return *this; }; vec3 vec3::operator+=(vec3 const &b) { this->x += b.x; this->y += b.y; this->z += b.z; return *this; }; vec3 vec3::operator-=(vec3 const &b) { this->x -= b.x; this->y -= b.y; this->z -= b.z; return *this; }; std::ostream &operator<<(std::ostream &out, const vec3 &v) { out << "vec3(" << v.x << "," << v.y << "," << v.z << ")"; return out; } }// namespace WaveStrider
18.141732
69
0.486979
francisrstokes
b5abbb93815cdfa4e547b0261b130fec9c308955
1,747
hpp
C++
include/kiview_app.hpp
magicmoremagic/bengine-kiview
c96092c1f90d729069676b31d2b1c079fddb7053
[ "MIT" ]
null
null
null
include/kiview_app.hpp
magicmoremagic/bengine-kiview
c96092c1f90d729069676b31d2b1c079fddb7053
[ "MIT" ]
null
null
null
include/kiview_app.hpp
magicmoremagic/bengine-kiview
c96092c1f90d729069676b31d2b1c079fddb7053
[ "MIT" ]
null
null
null
#pragma once #ifndef KIVIEW_APP_HPP_ #define KIVIEW_APP_HPP_ #include "node.hpp" #include <be/core/lifecycle.hpp> #include <be/core/extents.hpp> #include <be/util/string_interner.hpp> #include <be/platform/lifecycle.hpp> #include <be/platform/glfw_window.hpp> #include <glm/vec2.hpp> #include <functional> #include <random> #include <set> /////////////////////////////////////////////////////////////////////////////// class KiViewApp final { public: KiViewApp(int argc, char** argv); int operator()(); private: void run_(); void load_(be::SV filename); void autoscale_(); void select_at_(glm::vec2 pos); void select_all_like_(const Node& mod); void process_command_(be::SV cmd); void set_segment_density_(be::SV params, void(*fp)(be::U32), be::SV label); void render_(); be::CoreInitLifecycle init_; be::CoreLifecycle core_; be::platform::PlatformLifecycle platform_; be::I8 status_ = 0; be::S filename_; be::util::StringInterner si_; Node root_; be::rect board_bounds_; be::U32 ground_net_ = 0; GLFWwindow* wnd_; glm::ivec2 viewport_ = glm::ivec2(640, 480); glm::vec2 center_; be::F32 scale_ = 1; bool enable_autoscale_ = true; bool enable_autocenter_ = true; glm::vec2 relative_cursor_; glm::vec2 cursor_; bool dragging_ = false; be::S info_; bool input_enabled_ = false; bool select_only_modules_ = false; bool select_only_nets_ = false; bool flipped_ = false; bool wireframe_ = false; bool see_thru_ = false; bool skip_copper_ = false; bool skip_silk_ = false; bool skip_zones_ = false; std::set<be::U32> skip_nets_; std::set<be::U32> highlight_nets_; std::set<const Node*> highlight_modules_; }; #endif
22.986842
79
0.660561
magicmoremagic
b5af7516fe8f690e3e7b97c37ffedbd6badf574e
5,470
hpp
C++
framework/areg/base/private/BufferPosition.hpp
Ali-Nasrolahi/areg-sdk
4fbc2f2644220196004a31672a697a864755f0b6
[ "Apache-2.0" ]
70
2021-07-20T11:26:16.000Z
2022-03-27T11:17:43.000Z
framework/areg/base/private/BufferPosition.hpp
Ali-Nasrolahi/areg-sdk
4fbc2f2644220196004a31672a697a864755f0b6
[ "Apache-2.0" ]
32
2021-07-31T05:20:44.000Z
2022-03-20T10:11:52.000Z
framework/areg/base/private/BufferPosition.hpp
Ali-Nasrolahi/areg-sdk
4fbc2f2644220196004a31672a697a864755f0b6
[ "Apache-2.0" ]
40
2021-11-02T09:45:38.000Z
2022-03-27T11:17:46.000Z
#pragma once /************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 * License) and Commercial (with various pricing models) licenses, depending * on the nature of the project (commercial, research, academic or free). * You should have received a copy of the AREG SDK license description in LICENSE.txt. * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2021 Aregtech UG. All rights reserved. * \file areg/base/private/BufferPosition.hpp * \ingroup AREG SDK, Asynchronous Event Generator Software Development Kit * \author Artak Avetyan * \brief AREG Platform, buffer cursor position interface. * ************************************************************************/ /************************************************************************ * Includes ************************************************************************/ #include "areg/base/GEGlobal.h" #include "areg/base/IECursorPosition.hpp" /************************************************************************ * Dependencies ************************************************************************/ class IEByteBuffer; ////////////////////////////////////////////////////////////////////////// // BufferPosition class declaration ////////////////////////////////////////////////////////////////////////// /** * \brief This class is defining Buffer cursor position and contains * implementation of simple cursor move functionalities. * The object is used in buffer classes. **/ class AREG_API BufferPosition : public IECursorPosition { ////////////////////////////////////////////////////////////////////////// // Constructor / Destructor ////////////////////////////////////////////////////////////////////////// public: /** * \brief Sets the instance of byte buffer object * \param buffer Instance of Byte Buffer object **/ BufferPosition( IEByteBuffer & buffer ); /** * \brief Destructor **/ virtual ~BufferPosition( void ) = default; ////////////////////////////////////////////////////////////////////////// // Operations ////////////////////////////////////////////////////////////////////////// public: /** * \brief Invalidates current position, i.e. sets current position to IECursorPosition::INVALID_CURSOR_POSITION **/ inline void invalidate( void ); ////////////////////////////////////////////////////////////////////////// // Overrides ////////////////////////////////////////////////////////////////////////// public: /************************************************************************/ // IECursorPosition interface overrides /************************************************************************/ /** * \brief Returns the current position of pointer relative to begin in streaming data. * The valid position should not be equal to INVALID_CURSOR_POSITION. * Check current position validation before accessing data in streaming object. * \return Returns the current position of pointer relative to begin in streaming data. **/ virtual unsigned int getPosition( void ) const override; /** * \brief Sets the pointer position and returns current position in streaming data * The positive value of offset means move pointer forward. * The negative value of offset means move pointer back. * * \param offset The offset in bytes to move. Positive value means moving forward. Negative value means moving back. * \param startAt Specifies the starting position of pointer and should have one of values: * IECursorPosition::eCursorPosition::PositionBegin -- position from the beginning of data * IECursorPosition::eCursorPosition::PositionCurrent -- position from current pointer position * IECursorPosition::eCursorPosition::PositionEnd -- position from the end of file * * \return If succeeds, returns the current position of pointer in bytes or value IECursorPosition::INVALID_CURSOR_POSITION if fails. **/ virtual unsigned int setPosition( int offset, IECursorPosition::eCursorPosition startAt ) const override; ////////////////////////////////////////////////////////////////////////// // Member variables ////////////////////////////////////////////////////////////////////////// private: /** * \brief Reference to the Byte Buffer object **/ IEByteBuffer & mBuffer; /** * \brief Current position of Byte Buffer cursor. * Value IECursorPosition::INVALID_CURSOR_POSITION means invalid position. **/ mutable unsigned int mPosition; ////////////////////////////////////////////////////////////////////////// // Hidden / Disabled methods ////////////////////////////////////////////////////////////////////////// private: BufferPosition( void ) = delete; DECLARE_NOCOPY_NOMOVE( BufferPosition ); }; ////////////////////////////////////////////////////////////////////////// // BufferPosition class inline function implementation ////////////////////////////////////////////////////////////////////////// inline void BufferPosition::invalidate( void ) { mPosition = IECursorPosition::INVALID_CURSOR_POSITION; }
43.76
137
0.488665
Ali-Nasrolahi
b5b71b190a4cef5b7f56354f9ea9add05abe2643
813
cpp
C++
acmicpcnet/1168.cpp
irresi/algostudy
489739d641d6e36bbedf86be6391d1db27456585
[ "MIT" ]
null
null
null
acmicpcnet/1168.cpp
irresi/algostudy
489739d641d6e36bbedf86be6391d1db27456585
[ "MIT" ]
null
null
null
acmicpcnet/1168.cpp
irresi/algostudy
489739d641d6e36bbedf86be6391d1db27456585
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define nm (ns+ne)/2 using ll = long long; using pii = pair<int, int>; typedef tree<int, null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; const int inf=1e9+3; #define all(x) (x).begin(),(x).end() #define sync() {ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);} //do not use int n,k; int t[400003]; ordered_set s; int main() { int tc,i,j,x,nx; //sync() cin>>n>>k; for(i=1;i<=n;i++)s.insert(i); x=n-1; cout<<'<'; for(;n>=1;n--){ nx=(x+k)%n; ordered_set::iterator t = s.find_by_order(nx); cout<<*t; if(n-1)cout<<", "; s.erase(t); x=(nx-1+n)%n; if(nx<x) x--; } cout<<'>'; return 0; }
23.228571
97
0.589176
irresi
b5b9ffe328fa54177619eeac4e282d054e4f7b20
362
hpp
C++
CookieEngine/include/Core/Window.hpp
qbleuse/Cookie-Engine
705d19d9e4c79e935e32244759ab63523dfbe6c4
[ "CC-BY-4.0" ]
null
null
null
CookieEngine/include/Core/Window.hpp
qbleuse/Cookie-Engine
705d19d9e4c79e935e32244759ab63523dfbe6c4
[ "CC-BY-4.0" ]
null
null
null
CookieEngine/include/Core/Window.hpp
qbleuse/Cookie-Engine
705d19d9e4c79e935e32244759ab63523dfbe6c4
[ "CC-BY-4.0" ]
null
null
null
#ifndef __WINDOW_HPP__ #define __WINDOW_HPP__ #include <GLFW/glfw3.h> namespace Cookie { namespace Core { class Window { public: GLFWwindow* window = nullptr; int width = 0; int height = 0; private: void SetIcon(); public: /* CONSTRUCTORS/DESTRUCTORS */ Window(); ~Window(); }; } } #endif /*__WINDOW_HPP__*/
11.677419
34
0.61326
qbleuse
b5c093af0b258796fb64c0c453a9611ed8458061
11,622
cpp
C++
Tools/PL3dsMaxSceneExport_2008/src/PLSceneLight.cpp
ktotheoz/pixellight
43a661e762034054b47766d7e38d94baf22d2038
[ "MIT" ]
83
2015-01-08T15:06:14.000Z
2021-07-20T17:07:00.000Z
Tools/PL3dsMaxSceneExport_2008/src/PLSceneLight.cpp
PixelLightFoundation/pixellight
43a661e762034054b47766d7e38d94baf22d2038
[ "MIT" ]
27
2019-06-18T06:46:07.000Z
2020-02-02T11:11:28.000Z
Tools/PL3dsMaxSceneExport_2008/src/PLSceneLight.cpp
naetherm/PixelLight
d7666f5b49020334cbb5debbee11030f34cced56
[ "MIT" ]
40
2015-02-25T18:24:34.000Z
2021-03-06T09:01:48.000Z
/*********************************************************\ * File: PLSceneLight.cpp * * * Copyright (C) 2002-2013 The PixelLight Team (http://www.pixellight.org/) * * This file is part of PixelLight. * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \*********************************************************/ //[-------------------------------------------------------] //[ Includes ] //[-------------------------------------------------------] #include <PLCore/Xml/Xml.h> #include <IGame/IGame.h> #include "PL3dsMaxSceneExport/PLLog.h" #include "PL3dsMaxSceneExport/PLScene.h" #include "PL3dsMaxSceneExport/PLSceneTexture.h" #include "PL3dsMaxSceneExport/PLSceneLight.h" //[-------------------------------------------------------] //[ Namespace ] //[-------------------------------------------------------] using namespace PLCore; //[-------------------------------------------------------] //[ Private functions ] //[-------------------------------------------------------] /** * @brief * Constructor */ PLSceneLight::PLSceneLight(PLSceneContainer &cContainer, IGameNode &cIGameNode, const String &sName) : PLSceneNode(&cContainer, &cIGameNode, sName, TypeLight, "") { } /** * @brief * Destructor */ PLSceneLight::~PLSceneLight() { } //[-------------------------------------------------------] //[ Private virtual PLSceneNode functions ] //[-------------------------------------------------------] void PLSceneLight::WriteToFile(XmlElement &cSceneElement, const String &sApplicationDrive, const String &sApplicationDir) { bool bError = true; // Error by default // Get the IGame light object of the given IGame node IGameObject *pIGameObject = GetIGameNode()->GetIGameObject(); if (pIGameObject) { // One thing... if the light is for example a 'VRay'-light 'GetLightType()' will crash! // So we have to do this quite complicated... Object *pMaxObject = pIGameObject->GetMaxObject(); if (pMaxObject && pMaxObject->SuperClassID() == LIGHT_CLASS_ID && (pMaxObject->CanConvertToType(Class_ID(OMNI_LIGHT_CLASS_ID, 0)) || pMaxObject->CanConvertToType(Class_ID(SPOT_LIGHT_CLASS_ID, 0)) || pMaxObject->CanConvertToType(Class_ID(DIR_LIGHT_CLASS_ID, 0)) || pMaxObject->CanConvertToType(Class_ID(FSPOT_LIGHT_CLASS_ID, 0)) || pMaxObject->CanConvertToType(Class_ID(TDIR_LIGHT_CLASS_ID, 0)))) { // Check the type of the IGame object IGameLight &cIGameLight = *static_cast<IGameLight*>(pIGameObject); if (pIGameObject->GetIGameType() == IGameObject::IGAME_LIGHT && cIGameLight.GetLightType() != IGameLight::IGAME_UNKNOWN) { // Initialize the data of the IGame object - because of the 'clever' default implementation // that returns 'false' if nothing was to do, we can't call this function and have to be // 'inconsistent'... // if (cIGameLight.InitializeData()) { // Is the light not hidden and is rendered but should still not be used? if (!GetIGameNode()->IsNodeHidden() && GetIGameNode()->GetMaxNode()->Renderable() && !cIGameLight.IsLightOn()) AddFlag("Invisible"); // Get a GenLight from the node GenLight &cMaxLight = *static_cast<GenLight*>(pMaxObject); // Cast shadows? if (cIGameLight.CastShadows()) { // Shadow active? (jap, another state we have to check :) if (cMaxLight.GetShadow()) { // We only accept shadow mapping if (cMaxLight.GetShadowMethod() == LIGHTSHADOW_MAPPED && !cMaxLight.GetShadowType()) AddFlag("CastShadow|ReceiveShadow"); else g_pLog->LogFLine(PLLog::Hint, "Light node '%s' shadow casting is deactivated because only shadow mapping is supported.", GetIGameNode()->GetName()); } } // Get the projector map... I found no way to do this using IGame... BitmapTex *pBitmapTex = nullptr; Texmap *pMap = cMaxLight.GetProjector() ? cMaxLight.GetProjMap() : nullptr; if (pMap && pMap->ClassID() == Class_ID(BMTEX_CLASS_ID, 0x00)) pBitmapTex = static_cast<BitmapTex*>(pMap); // Add scene node XmlElement *pNodeElement = new XmlElement("Node"); // Spot light String sClassName; bool bDirectionalLight = false; bool bSpotLight = (cIGameLight.GetLightType() == IGameLight::IGAME_TSPOT || cIGameLight.GetLightType() == IGameLight::IGAME_FSPOT); if (bSpotLight) { // Is this a projective spot light? if (pBitmapTex) { sClassName = "PLScene::SNProjectiveSpotLight"; // Light shape if (cIGameLight.GetSpotLightShape() != RECT_LIGHT) { // [HACK] Just a 'dummy'-flag because if no flags are set the default setting // is used which is 'NoCone'... AddFlag("Cone"); } } else { sClassName = "PLScene::SNSpotLight"; // Light shape if (cIGameLight.GetSpotLightShape() == RECT_LIGHT) AddFlag("NoCone"); } // Directional light } else if (cIGameLight.GetLightType() == IGameLight::IGAME_DIR || cIGameLight.GetLightType() == IGameLight::IGAME_TDIR) { sClassName = "PLScene::SNDirectionalLight"; bDirectionalLight = true; // Omni directional light } else { sClassName = pBitmapTex ? "PLScene::SNProjectivePointLight" : "PLScene::SNPointLight"; } // Class name if (GetClassName().GetLength()) sClassName = GetClassName(); // Overwrite the default PixelLight class name pNodeElement->SetAttribute("Class", sClassName); // Name pNodeElement->SetAttribute("Name", GetName()); // Write position, rotation, scale, bounding box and flags WriteToFilePosRotScaleBoxFlags(*pNodeElement); // Color IGameProperty *pIGameProperty = cIGameLight.GetLightColor(); if (pIGameProperty) { // Get the light multiplier data float fMultiplier = 1.0f; IGameProperty *pIGameMultiplierProperty = cIGameLight.GetLightMultiplier(); if (pIGameMultiplierProperty) pIGameMultiplierProperty->GetPropertyValue(fMultiplier); // Get light color Point3 vColor; if (pIGameProperty->GetPropertyValue(vColor)) { vColor *= fMultiplier; if (vColor.x != 1.0f || vColor.y != 1.0f || vColor.z != 1.0f) pNodeElement->SetAttribute("Color", String::Format("%f %f %f", vColor.x, vColor.y, vColor.z)); } } // Directional light? if (bDirectionalLight) { // No special parameters } else { // Range ('far attenuation - end') pIGameProperty = cIGameLight.GetLightAttenEnd(); if (pIGameProperty) { float fRange; if (pIGameProperty->GetPropertyValue(fRange)) PLTools::XmlElementSetAttributeWithDefault(*pNodeElement, "Range", fRange, 1.0f); } // Special spot light settings if (bSpotLight) { // OuterAngle pIGameProperty = cIGameLight.GetLightFallOff(); if (pIGameProperty) { float fFallOff; if (pIGameProperty->GetPropertyValue(fFallOff)) PLTools::XmlElementSetAttributeWithDefault(*pNodeElement, "OuterAngle", fFallOff, 45.0f); } // InnerAngle pIGameProperty = cIGameLight.GetLightHotSpot(); if (pIGameProperty) { float fHotSpot; if (pIGameProperty->GetPropertyValue(fHotSpot)) PLTools::XmlElementSetAttributeWithDefault(*pNodeElement, "InnerAngle", fHotSpot, 35.0f); } // ZNear ('near attenuation - start') pIGameProperty = cIGameLight.GetLightAttenStart(); if (pIGameProperty) { float fAttenStart; if (pIGameProperty->GetPropertyValue(fAttenStart) && fAttenStart != 0.1f) { PLTools::XmlElementSetAttributeWithDefault(*pNodeElement, "ZNear", fAttenStart, 0.1f); // 'Normally' the near plane should never ever be <=0! (crazy z-fighting!) if (fAttenStart <= 1.0000000e-006 && GetIGameNode()) g_pLog->LogFLine(PLLog::Warning, "Light (3ds Max node '%s') 'near attenuation' (= near plane) '%f' (really small number) but recommended is '>1.0000000e-006'!", GetIGameNode()->GetName(), fAttenStart); } } // Aspect (only used for rectangle light shape!) if (cIGameLight.GetSpotLightShape() == RECT_LIGHT) { pIGameProperty = cIGameLight.GetLightAspectRatio(); if (pIGameProperty) { float fAspectRatio; if (pIGameProperty->GetPropertyValue(fAspectRatio)) PLTools::XmlElementSetAttributeWithDefault(*pNodeElement, "Aspect", fAspectRatio, 1.0f); } } } } // Projected material if (pBitmapTex) { // Copy the texture PLSceneTexture *pTexture = GetScene().CopyTexture(pBitmapTex->GetMapName()); if (pTexture) { // Add as light variable pNodeElement->SetAttribute("ProjectedMaterial", pTexture->GetName()); } } // Write flexible variables WriteVariables(*pNodeElement); // Write modifiers WriteModifiers(*pNodeElement, sApplicationDrive, sApplicationDir); // Link node element cSceneElement.LinkEndChild(*pNodeElement); // No error occurred bError = false; // } } else { g_pLog->LogFLine(PLLog::Error, "%s: IGame object is no known light object!", GetIGameNode()->GetName()); } } else { g_pLog->LogFLine(PLLog::Error, "%s: IGame object is no known light object!", GetIGameNode()->GetName()); } // Release the IGame object GetIGameNode()->ReleaseIGameObject(); } else { g_pLog->LogFLine(PLLog::Error, "%s: IGame node has no IGame object!", GetIGameNode()->GetName()); } // Was there an error? If yes we replace this light node through an 'unknown' node. if (bError) { // Update the statistics GetContainer()->m_sStatistics.nNumOfLights--; GetContainer()->m_sStatistics.nNumOfUnknown++; GetScene().m_sSceneStatistics.nNumOfLights--; GetScene().m_sSceneStatistics.nNumOfUnknown++; // Add scene node XmlElement *pNodeElement = new XmlElement("Node"); pNodeElement->SetAttribute("Class", GetClassName().GetLength() ? GetClassName() : "PLScene::SNUnknown"); pNodeElement->SetAttribute("Name", GetName()); // Write position, rotation, scale, bounding box and flags WriteToFilePosRotScaleBoxFlags(*pNodeElement); // Write flexible variables WriteVariables(*pNodeElement); // Write modifiers WriteModifiers(*pNodeElement, sApplicationDrive, sApplicationDir); // Link node element cSceneElement.LinkEndChild(*pNodeElement); } }
39.263514
211
0.635519
ktotheoz
b5c3c6eb98df16a20889b79a7145a4eb120bac3c
1,739
cpp
C++
Greedy/number-of-orders-in-the-backlog.cpp
PrakharPipersania/LeetCode-Solutions
ea74534bbdcf1ca3ea4d88a1081582e0e15f50c7
[ "MIT" ]
2
2021-03-05T22:32:23.000Z
2021-03-05T22:32:29.000Z
Questions Level-Wise/Medium/number-of-orders-in-the-backlog.cpp
PrakharPipersania/LeetCode-Solutions
ea74534bbdcf1ca3ea4d88a1081582e0e15f50c7
[ "MIT" ]
null
null
null
Questions Level-Wise/Medium/number-of-orders-in-the-backlog.cpp
PrakharPipersania/LeetCode-Solutions
ea74534bbdcf1ca3ea4d88a1081582e0e15f50c7
[ "MIT" ]
null
null
null
class Solution { public: int getNumberOfBacklogOrders(vector<vector<int>>& orders) { int count=0; map<int,int,greater<int>> buy; map<int,int> sell; for(int i=0;i<orders.size();i++) { if(orders[i][2]) //sell { while(orders[i][1]>0&&buy.size()>0&&begin(buy)->first>=orders[i][0]) { if(orders[i][1]>=begin(buy)->second) { orders[i][1]-=begin(buy)->second; buy.erase(begin(buy)->first); } else { buy[begin(buy)->first]-=orders[i][1]; orders[i][1]=0; } } if(orders[i][1]>0) sell[orders[i][0]]+=orders[i][1]; } else //buy { while(orders[i][1]>0&&sell.size()>0&&begin(sell)->first<=orders[i][0]) { if(orders[i][1]>=begin(sell)->second) { orders[i][1]-=begin(sell)->second; sell.erase(begin(sell)->first); } else { sell[begin(sell)->first]-=orders[i][1]; orders[i][1]=0; } } if(orders[i][1]>0) buy[orders[i][0]]+=orders[i][1]; } } for(auto e: buy) count=(count+e.second)%1000000007; for(auto e: sell) count=(count+e.second)%1000000007; return count; } };
32.811321
86
0.346751
PrakharPipersania
b5c92843a0d72d7cdca11975ef2eae41d2837779
392
cpp
C++
_site/Competitive Programming/Codeforces/1073B.cpp
anujkyadav07/anuj-k-yadav.github.io
ac5cccc8cdada000ba559538cd84921437b3c5e6
[ "MIT" ]
1
2019-06-10T04:39:49.000Z
2019-06-10T04:39:49.000Z
_site/Competitive Programming/Codeforces/1073B.cpp
anujkyadav07/anuj-k-yadav.github.io
ac5cccc8cdada000ba559538cd84921437b3c5e6
[ "MIT" ]
2
2021-09-27T23:34:07.000Z
2022-02-26T05:54:27.000Z
_site/Competitive Programming/Codeforces/1073B.cpp
anujkyadav07/anuj-k-yadav.github.io
ac5cccc8cdada000ba559538cd84921437b3c5e6
[ "MIT" ]
3
2019-06-23T14:15:08.000Z
2019-07-09T20:40:58.000Z
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(0); ll n; cin>>n; ll a, b; map<ll,ll> idx; for (ll i = 0; i < n; ++i) { cin>>a; idx[a] = i; } ll cur = 0; for (ll i = 0; i < n; ++i) { cin>>b; if(idx[b] < cur){ cout<<0<<" "; }else{ cout<<idx[b]-cur+1<<" "; cur = idx[b]+1; } } cout<<"\n"; }
13.517241
27
0.47449
anujkyadav07
b5ce9d05e3d53360728dd4f430615c09187a37c0
6,293
cc
C++
common/dstage/client_response_handler.cc
PeterVondras/DAS
72dd5223280ec121f998b4932cc6bf7e83187d46
[ "MIT" ]
null
null
null
common/dstage/client_response_handler.cc
PeterVondras/DAS
72dd5223280ec121f998b4932cc6bf7e83187d46
[ "MIT" ]
null
null
null
common/dstage/client_response_handler.cc
PeterVondras/DAS
72dd5223280ec121f998b4932cc6bf7e83187d46
[ "MIT" ]
null
null
null
#include <sys/socket.h> #include <sys/types.h> #include <memory> #include <string> #include "common/dstage/client_response_handler.h" #include "glog/logging.h" namespace { using CallBack2 = dans::CommunicationHandlerInterface::CallBack2; using ReadyFor = dans::CommunicationHandlerInterface::ReadyFor; const int kMBytesToBytes = 1024 * 1024; } // namespace namespace dans { ResponseScheduler::ResponseScheduler( std::vector<unsigned> threads_per_prio, bool set_thread_priority, CommunicationHandlerInterface* comm_interface, BaseDStage<ResponseData>* response_handler) : Scheduler<ResponseData>(threads_per_prio, set_thread_priority), _comm_interface(comm_interface), _response_handler(response_handler), _destructing(false), _origin_dstage(nullptr) { VLOG(4) << __PRETTY_FUNCTION__; } ResponseScheduler::~ResponseScheduler() { VLOG(4) << __PRETTY_FUNCTION__; { std::unique_lock<std::shared_timed_mutex> lock(_destructing_lock); _destructing = true; } // Releasing threads from blocking MultiQueue call. if (_running) { _multi_q_p->ReleaseQueues(); } } void ResponseScheduler::RegisterOriginDStage( BaseDStage<ConnectData>* origin_dstage) { _origin_dstage = origin_dstage; } void ResponseScheduler::StartScheduling(Priority prio) { VLOG(4) << __PRETTY_FUNCTION__ << " prio=" << prio; Protocol response_protocol; int bytes_read; bool closed; while (true) { { std::shared_lock<std::shared_timed_mutex> lock(_destructing_lock); if (_destructing) return; } SharedJobPtr<ResponseData> job = _multi_q_p->Dequeue(prio); if (job == nullptr) continue; VLOG(1) << "Response Handler Scheduler got job_id=" << job->job_id << ", socket=" << job->job_data.connection->Socket(); // Check if job has been purged if (job->job_data.purge_state->IsPurged()) { VLOG(2) << "Purged job_id=" << job->job_id << ", Priority=" << job->priority; continue; } if (job->job_data.object == nullptr) { bytes_read = read(job->job_data.connection->Socket(), &response_protocol, sizeof(Protocol)); CHECK_EQ(bytes_read, sizeof(Protocol)); job->job_data.object = std::make_unique<std::vector<char>>(response_protocol.size_bytes); job->job_data.index = response_protocol.start_idx; CHECK_NE(response_protocol.size_bytes, 0) << "File must be of non-zero index."; if (response_protocol.type == REQUEST_ACCEPT) { VLOG(1) << "Server sent Accept for file=" << response_protocol.object_id; } else { VLOG(1) << "Server sent Reject for file=" << response_protocol.object_id; } } closed = false; while (true) { bytes_read = read(job->job_data.connection->Socket(), job->job_data.object->data() + job->job_data.index, job->job_data.object->size() - job->job_data.index); if (bytes_read == -1) { if (errno != EAGAIN && errno != EWOULDBLOCK) { PLOG(WARNING) << "Error reading socket. job_id=" << job->job_id << ", file=" << job->job_data.object_id; closed = true; } break; } else if (bytes_read == 0) { VLOG(3) << "Server closed socket for job_id=" << job->job_id; closed = true; break; } job->job_data.index += bytes_read; VLOG(3) << "Read " << job->job_data.index << " of " << job->job_data.object->size() << " bytes for file=" << job->job_data.object_id << ", priority=" << job->priority; } if (job->job_data.index == job->job_data.object->size()) { if (job->job_data.purge_state->SetPurged()) { VLOG(2) << "Completed job_id=" << job->job_id << ", priority=" << job->priority; (*job->job_data.done)(job->priority, job->job_data.object_id, std::move(job->job_data.object)); CHECK_NOTNULL(_origin_dstage); _origin_dstage->Purge(job->job_id); } continue; } if (closed) continue; VLOG(2) << "Monitoring for read on job_id=" << job->job_id << ", priority=" << job->priority << ", file=" << job->job_data.object_id << ", size=" << job->job_data.object->size() << ", index=" << job->job_data.index; CallBack2 response(std::bind(&dans::ResponseScheduler::ResponseCallback, this, job, std::placeholders::_1, std::placeholders::_2)); _comm_interface->Monitor(job->job_data.connection->Socket(), ReadyFor{/*in=*/true, /*out=*/false}, response); } } void ResponseScheduler::ResponseCallback(SharedJobPtr<ResponseData> old_job, int soc, ReadyFor ready_for) { VLOG(4) << __PRETTY_FUNCTION__ << " soc=" << old_job->job_data.connection->Socket(); if (ready_for.err != 0) { PLOG(WARNING) << "Removing jobid=" << old_job->job_id << " prio=" << old_job->priority << " socket=" << soc; return; } CHECK(ready_for.in); // Pass on job if it is not complete. if (!old_job->job_data.purge_state->IsPurged() && soc >= 0) { ResponseData response_data = {std::move(old_job->job_data.connection), old_job->job_data.object_id, old_job->job_data.index, std::move(old_job->job_data.object), old_job->job_data.done, old_job->job_data.purge_state}; auto response_job = std::make_unique<Job<ResponseData>>( std::move(response_data), old_job->job_id, old_job->priority, old_job->duplication); _response_handler->Dispatch(std::move(response_job), /*requested_dulpication=*/0); } else if (soc < 0) { errno = -soc; PLOG(WARNING) << "Dropped socket for job_id=" << old_job->job_id; } else { VLOG(2) << "Purged job_id=" << old_job->job_id << ", Priority=" << old_job->priority; } } } // namespace dans
35.755682
79
0.589385
PeterVondras
b5d104afaa493b0e8ee8fdfd81701b70431f0ffd
475
hpp
C++
include/resources/Tools.hpp
yinyangcoding/chess
50acfda16e65a1ab2427caa5e083a698c67375ef
[ "MIT" ]
1
2020-07-11T06:28:58.000Z
2020-07-11T06:28:58.000Z
include/resources/Tools.hpp
yinyangcoding/chess
50acfda16e65a1ab2427caa5e083a698c67375ef
[ "MIT" ]
8
2020-06-28T19:41:07.000Z
2020-07-13T17:06:50.000Z
include/resources/Tools.hpp
yinyangcoding/chess
50acfda16e65a1ab2427caa5e083a698c67375ef
[ "MIT" ]
null
null
null
#ifndef TOOLS_GUARD #define TOOLS_GUARD #include <iostream> #include <vector> #include "BlandTools.hpp" #include "../objects/Piece.hpp" #include "../objects/Coordinate.hpp" // Contains tools that are needed universally throughout code namespace Tools { // Checks if a Piece vector contains a piece static bool contains(vector<Piece>& v, Piece& p); // Grabs the index of a piece from a piece vector static int index(vector<Piece>& v, Piece& p); }; #endif
22.619048
61
0.715789
yinyangcoding
b5d10b45f66473a5800fa5ef08b154861d46dd76
24,761
cc
C++
src/cxx/libsparse/libtools/MatrixOper.cc
jstarck/cosmostat
f686efe4c00073272487417da15e207a529f07e7
[ "MIT" ]
null
null
null
src/cxx/libsparse/libtools/MatrixOper.cc
jstarck/cosmostat
f686efe4c00073272487417da15e207a529f07e7
[ "MIT" ]
null
null
null
src/cxx/libsparse/libtools/MatrixOper.cc
jstarck/cosmostat
f686efe4c00073272487417da15e207a529f07e7
[ "MIT" ]
null
null
null
/****************************************************************************** ** Copyright (C) 1999 by CEA ******************************************************************************* ** ** UNIT ** ** Version: 1.0 ** ** Author: J.L. Starck ** ** Date: 18/02/99 ** ** File: MatOper.cc ** ******************************************************************************* ** ** DESCRIPTION Matrix Operation ** ----------- ** ** ** PARAMETRES ** ---------- ** ** ******************************************************************************/ #include<cmath> #include "Array.h" #include "MatrixOper.h" #include "NR.h" /*********************************************************************/ void MatOper::mat_print (dblarray &CorrelMat, const char *Mes) { int i,j; // print intercorrelation matrix // cout << endl << Mes << " :" << CorrelMat.ny() << " " << CorrelMat.nx() << endl; // for (i=0; i< CorrelMat.ny(); i++) // { // for (j=0; j < CorrelMat.nx(); j++) // { // cout.width(8); // see p343 c++ stroustrup // cout.fill(' '); // cout.setf(ios::right,ios::adjustfield); // //cout.setf(ios::fixed,ios::floatfield); // cout.setf(ios::scientific,ios::floatfield); // cout.precision(4); // cout << CorrelMat(j,i) << " " ; // } // cout << endl; // } cout << endl << Mes << " :" << CorrelMat.ny() << " " << CorrelMat.nx() << endl; if (CorrelMat.ny() != 0) { for (i=0; i< CorrelMat.ny(); i++) { for (j=0; j < CorrelMat.nx(); j++) { printf("%5.3f ", CorrelMat(j,i)); } cout << endl; }} else for (j=0; j < CorrelMat.nx(); j++) { printf("%5.3f ", CorrelMat(j)); } cout << endl; } void MatOper::mat_print (fltarray &CorrelMat, const char *Mes) { int i,j; // print intercorrelation matrix cout << endl << Mes << " :" << CorrelMat.ny() << " " << CorrelMat.nx() << endl; for (i=0; i< CorrelMat.ny(); i++) { for (j=0; j < CorrelMat.nx(); j++) { printf("%5.3f ", CorrelMat(j,i)); } cout << endl; } } /*********************************************************************/ void MatOper::dblarray2fltarray (dblarray &Ud, fltarray &Uf) { int i,j; int Nx = Ud.nx(); int Ny = Ud.ny(); Uf.alloc(Nx,Ny); for (i=0; i < Nx; i++) for (j=0; j < Ny; j++) Uf(i,j) = (float) Ud(i,j); } void MatOper::fltarray2dblarray (fltarray &Uf, dblarray &Ud) { int i,j; int Nx = Uf.nx(); int Ny = Uf.ny(); Ud.alloc(Nx,Ny); for (i=0; i < Nx; i++) for (j=0; j < Ny; j++) Ud(i,j) = (double) Uf(i,j); } /*********************************************************************/ void MatOper::transpose (dblarray &U, dblarray &Ut) { int i,j; int Nx = U.nx(); int Ny = U.ny(); Ut.alloc(Ny,Nx); for (i=0; i < Nx; i++) for (j=0; j < Ny; j++) Ut(j,i) = U(i,j); } void MatOper::transpose (fltarray &U, fltarray &Ut) { int i,j; int Nx = U.nx(); int Ny = U.ny(); Ut.alloc(Ny,Nx); for (i=0; i < Nx; i++) for (j=0; j < Ny; j++) Ut(j,i) = U(i,j); } /*********************************************************************/ void MatOper::mat_mult(dblarray &U, dblarray &V, dblarray &R) // // MATRIX multiplication // R = U # V { int Q = U.nx(); int P = U.ny(); int Q1 = V.nx(); int P1 = V.ny(); int i,j,k; double Val; if (Q != P1) { cerr << "Error: cannot multiply the matrix ... " << endl; exit(-1); } if ((R.naxis() != 2) || (R.nx() != Q1) || (R.ny() != P)) R.alloc(Q1, P); for (i = 0; i < Q1; i++) for (j = 0; j < P; j++) { Val = 0.;; for (k = 0; k < Q; k++) Val += (double) U(k,j) * (double) V(i,k); R(i,j) = Val; } } void MatOper::mat_mult(fltarray &U, fltarray &V, fltarray &R) // // MATRIX multiplication // R = U # V { int Q = U.nx(); int P = U.ny(); int Q1 = V.nx(); int P1 = V.ny(); int i,j,k; float Val; if (Q != P1) { cerr << "Error: cannot multiply the matrix ... " << endl; exit(-1); } if ((R.naxis() != 2) || (R.nx() != Q1) || (R.ny() != P)) R.alloc(Q1, P); for (i = 0; i < Q1; i++) for (j = 0; j < P; j++) { Val = 0.;; for (k = 0; k < Q; k++) Val += U(k,j) * V(i,k); R(i,j) = Val; } } /*********************************************************************/ void MatOper::apply_mat(dblarray &B, dblarray &Data, dblarray &Result) { int i,j,k; dblarray V,R; int Nx = Data.axis(1); int Ny = Data.axis(2); int Nz = Data.axis(3); int Nc = B.axis(2); if (B.axis(1) != Data.axis(3)) { cerr << "Error: matrix have bad dimensions. Ny(first matrix) = " << B.axis(2) << endl; cerr << " Second dimension must be equal to " << Nc << endl; exit(-1); } V.alloc(1,Nz); R.alloc(1,Nc); if ((Result.n_elem() == 0) || (Result.naxis() != 3)) Result.alloc(Nx,Ny,Nc); else if (Result.axis(1) != Nx) Result.alloc(Nx,Ny,Nc); else if (Result.axis(2) != Ny) Result.alloc(Nx,Ny,Nc); else if (Result.axis(3) != Nc) Result.alloc(Nx,Ny,Nc); for (i=0; i < Nx; i++) for (j=0; j < Ny; j++) { for (k=0; k < Nz; k++) V(0,k) = Data(i,j,k); mat_mult(B,V,R); for (k=0; k < Nc; k++) Result(i,j,k) = R(0,k); } } void MatOper::apply_mat(fltarray &B, fltarray &Data, fltarray &Result) { int i,j,k; fltarray V,R; int Nx = Data.axis(1); int Ny = Data.axis(2); int Nz = Data.axis(3); int Nc = B.axis(2); if (B.axis(1) != Data.axis(3)) { cerr << "Error: matrix have bad dimensions. Ny(first matrix) = " << B.axis(2) << endl; cerr << " Second dimension must be equal to " << Nc << endl; exit(-1); } V.alloc(1,Nz); R.alloc(1,Nc); if ((Result.n_elem() == 0) || (Result.naxis() != 3)) Result.alloc(Nx,Ny,Nc); else if (Result.axis(1) != Nx) Result.alloc(Nx,Ny,Nc); else if (Result.axis(2) != Ny) Result.alloc(Nx,Ny,Nc); else if (Result.axis(3) != Nc) Result.alloc(Nx,Ny,Nc); for (i=0; i < Nx; i++) for (j=0; j < Ny; j++) { for (k=0; k < Nz; k++) V(0,k) = Data(i,j,k); mat_mult(B,V,R); for (k=0; k < Nc; k++) Result(i,j,k) = R(0,k); } } /*********************************************************************/ void MatOper::svd(dblarray &Mat, dblarray &U, dblarray& S, dblarray& Vt){ //FCS ADDED to have SVD decomposition and not only inversion. // Note a thin SVD is calculated, efficient if number of columns <=number of lines // Mat: IN = matrix with P = Mat.ny and Q = Mat.nx (P >= Q) // void dsvdcmp(double **a, int m, int n, double w[], double **v); int i,j; dblarray M1,tMat; int P = Mat.ny(); // number of lines int Q = Mat.nx(); // number of columns U.alloc(Q,P,0); Vt.alloc(Q,Q,0); S.alloc(Q,0,0); double **a; // matrix P lines, Q columns double **v; // eigenvectors matrix double *w; // eigenvalues vector EV.alloc(Q); a=dmatrix((long) 1, P, (long)1, Q); v=dmatrix(1, Q, 1, Q); w=dvector(1, Q); for(i=1; i <= P; i++) for(j=1; j <= Q; j++) a[i][j]= Mat(j-1,i-1); dsvdcmp(a,P,Q,w,v); for(i=0; i < Q; i++) EV(i) = w[i+1]; for(i=0; i < Q; i++) S(i) = EV(i); if (Verbose == True) { double CondNumb = condition_nbr(); cout << "Matrix Condition number = " << CondNumb << endl; if (1. / CondNumb < 1e-12) cout << "WARNING: Singular matrix" << endl; } if (Verbose == True){ cout << "Eigen values: "; for(i=0; i < Q; i++) cout << EV(i) << " "; cout << endl; } for(i=0; i < P; i++) for(j=0; j < Q; j++) U(j,i) = a[i+1][j+1]; for(i=0; i < Q; i++) for(j=0; j < Q; j++) Vt(i,j) = v[i+1][j+1]; free_dmatrix(a, 1, P, 1, Q); free_dmatrix(v, 1, Q, 1, Q); free_dvector(w, 1, Q); } /*********************************************************************/ void MatOper::inv_mat_svd(dblarray &Mat, dblarray &InvMat) // MATRIX inversion: number of lines >= number of columns // InvMat = Mat^-1 // Mat: IN = matrix with P = Mat.ny and Q = Mat.nx (P >= Q) // { void dsvdcmp(double **a, int m, int n, double w[], double **v); int i,j; dblarray M1,tMat; int P = Mat.ny(); // number of lines int Q = Mat.nx(); // number of columns dblarray U(Q,P); // composed of eigen value of B B^t dblarray V(Q,Q); // composed of eigen vector of B^t B dblarray Ut(P,Q); // composed of eigen value of B B^t dblarray Vt(Q,Q); // composed of eigen vector of B^t B dblarray Diag(Q,Q); Diag.init(); double **a; // matrix P lines, Q columns double **v; // eigenvectors matrix double *w; // eigenvalues vector EV.alloc(Q); a=dmatrix((long) 1, P, (long)1, Q); v=dmatrix(1, Q, 1, Q); w=dvector(1, Q); for(i=1; i <= P; i++) for(j=1; j <= Q; j++) a[i][j]= Mat(j-1,i-1); dsvdcmp(a,P,Q,w,v); for(i=0; i < Q; i++) EV(i) = w[i+1]; for(i=0; i < Q; i++) Diag(i,i) = EV(i); // double wmax= EV.max(); // double minT= wmax*EpsEigen; // for(i=0; i < Q; i++) if (EV(i) < minT) EV(i) = 0.; if (Verbose == True) { double CondNumb = condition_nbr(); cout << "Matrix Condition number = " << CondNumb << endl; if (1. / CondNumb < 1e-12) cout << "WARNING: Singular matrix" << endl; } if (Verbose == True) { cout << "Eigen values: "; for(i=0; i < Q; i++) cout << Diag(i,i) << " "; cout << endl; } for(i=0; i < P; i++) for(j=0; j < Q; j++) U(j,i) = a[i+1][j+1]; for(i=0; i < Q; i++) for(j=0; j < Q; j++) V(j,i) = v[i+1][j+1]; free_dmatrix(a, 1, P, 1, Q); free_dmatrix(v, 1, Q, 1, Q); free_dvector(w, 1, Q); transpose(U,Ut); transpose(V,Vt); for(i=0; i < Q; i++) if (Diag(i,i) != 0) Diag(i,i) = 1. / Diag(i,i); mat_mult(Diag, Ut, M1); mat_mult(V, M1, InvMat); if (Verbose == True) { mat_mult(InvMat, Mat, M1); mat_print(M1, "B^-1 # B"); } } void MatOper::inv_mat_svd(dblarray &Mat, dblarray &InvMat, double minT) // MATRIX inversion: number of lines >= number of columns // InvMat = Mat^-1 // Mat: IN = matrix with P = Mat.ny and Q = Mat.nx (P >= Q) // This is an updated version of the previous function, modified to // handle the thresholding of small eigenvalues. // If wmax is the largest eigenvalue, all eigenvalue below minT * wmax will be set to 0 { void dsvdcmp(double **a, int m, int n, double w[], double **v); int i,j; dblarray M1,tMat; int P = Mat.ny(); // number of lines int Q = Mat.nx(); // number of columns dblarray U(Q,P); // composed of eigen value of B B^t dblarray V(Q,Q); // composed of eigen vector of B^t B dblarray Ut(P,Q); // composed of eigen value of B B^t dblarray Vt(Q,Q); // composed of eigen vector of B^t B dblarray Diag(Q,Q); Diag.init(); double **a; // matrix P lines, Q columns double **v; // eigenvectors matrix double *w; // eigenvalues vector EV.alloc(Q); a=dmatrix((long) 1, P, (long)1, Q); v=dmatrix(1, Q, 1, Q); w=dvector(1, Q); for(i=1; i <= P; i++) for(j=1; j <= Q; j++) a[i][j]= Mat(j-1,i-1); dsvdcmp(a,P,Q,w,v); for(i=0; i < Q; i++) { EV(i) = w[i+1]; } for(i=0; i < Q; i++) Diag(i,i) = EV(i); double wmax= EV.max(); double EVT= wmax*minT; for(i=0; i < Q; i++) if (EV(i) < EVT) { Diag(i,i) = 0.; } if (Verbose == True) { double CondNumb = condition_nbr(); cout << "Matrix Condition number = " << CondNumb << endl; if (1. / CondNumb < 1e-12) cout << "WARNING: Singular matrix" << endl; } if (Verbose == True) { cout << "Eigen values: "; for(i=0; i < Q; i++) cout << Diag(i,i) << " "; cout << endl; } for(i=0; i < P; i++) for(j=0; j < Q; j++) U(j,i) = a[i+1][j+1]; for(i=0; i < Q; i++) for(j=0; j < Q; j++) V(j,i) = v[i+1][j+1]; free_dmatrix(a, 1, P, 1, Q); free_dmatrix(v, 1, Q, 1, Q); free_dvector(w, 1, Q); transpose(U,Ut); transpose(V,Vt); for(i=0; i < Q; i++) if (Diag(i,i) != 0) Diag(i,i) = 1. / Diag(i,i); mat_mult(Diag, Ut, M1); mat_mult(V, M1, InvMat); if (Verbose == True) { mat_mult(InvMat, Mat, M1); mat_print(M1, "B^-1 # B"); } } void MatOper::inv_mat_svd(fltarray &Mat, fltarray &InvMat) { dblarray Matd; dblarray InvMatd; fltarray2dblarray( Mat, Matd); inv_mat_svd( Matd, InvMatd); dblarray2fltarray( InvMatd, InvMat); } /*********************************************************************/ void MatOper::lin_eq_svd(dblarray & Mat, dblarray & MAT_B, dblarray & MAT_X) { void dsvdcmp(double **a, int m, int n, double w[], double **v); void dsvbksb(double **u, double w[], double **v, int m, int n, double b[], double x[]); int i,j; dblarray M1,tMat; int P = Mat.ny(); // number of lines (m) int Q = Mat.nx(); // number of columns (n) double **a; // matrix P lines, Q columns double **v; // eigenvectors matrix double *w,*b,*x; // eigenvalues vector a=dmatrix((long) 1, P, (long)1, Q); v=dmatrix(1, Q, 1, Q); w=dvector(1, Q); b=dvector(1, P); x=dvector(1, Q); for(i=1; i <= P; i++) for(j=1; j <= Q; j++) a[i][j]= Mat(j-1,i-1); for(i=1; i <= P; i++) b[i] = MAT_B(i-1); dsvdcmp(a,P,Q,w,v); double wmax=0.; for(i=1; i <= Q; i++) if (wmax < w[i]) wmax = w[i]; EV.alloc(Q); for(i=0; i < Q; i++) EV(i) = w[i+1]; double minT= wmax*EpsEigen; for(i=1; i <= Q; i++) if (w[i] < minT) w[i] = 0.; dsvbksb(a,w,v,P,Q,b,x); for(i=1; i <= Q; i++) MAT_X(i-1) = x[i]; free_dmatrix(a, 1, P, 1, Q); free_dmatrix(v, 1, Q, 1, Q); free_dvector(w, 1, Q); free_dvector(b, 1, P); free_dvector(x, 1, Q); } void MatOper::lin_eq_svd(fltarray & Mat, fltarray & MAT_B, fltarray & MAT_X) { dblarray Matd; dblarray MAT_Bd; dblarray MAT_Xd; fltarray2dblarray( Mat, Matd); fltarray2dblarray( MAT_B, MAT_Bd); fltarray2dblarray( MAT_X, MAT_Xd); lin_eq_svd(Matd, MAT_Bd, MAT_Xd); dblarray2fltarray( Matd, Mat); dblarray2fltarray( MAT_Bd, MAT_B); dblarray2fltarray( MAT_Xd, MAT_X); } /*********************************************************************/ void MatOper::inv_mat_iter(dblarray &Mat, dblarray &InvMat, int NIter, Bool Verbose) // MATRIX inversion // InvMat = Mat^-1 { int i,j,k; dblarray M1, M2; // iterative improvment // Start the iterative inversion from the matrix transposition double Eps=0.; transpose(Mat,InvMat); for (k=0; k < InvMat.n_elem(); k++) Eps += InvMat(k)*InvMat(k); Eps = 1. / Eps; if (Verbose == True) cout << "Eps = " << Eps << endl; for (k=0; k < InvMat.n_elem(); k++) InvMat(k) *= Eps; for (k=0; k < NIter; k++) { mat_mult(InvMat, Mat, M1); mat_mult(M1, InvMat, M2); for(i=0; i < InvMat.nx(); i++) for(j=0; j < InvMat.ny(); j++) InvMat(i,j) += InvMat(i,j) - M2(i,j); } if (Verbose == True) { mat_mult(InvMat, Mat, M1); mat_print( InvMat, "Inverse matrix"); mat_print(M1, "B^-1 # B: after iterating"); } } void MatOper::inv_mat_iter(fltarray &Mat, fltarray &InvMat, int NIter, Bool Verbose) { dblarray Matd; dblarray InvMatd; fltarray2dblarray( Mat, Matd); inv_mat_iter(Matd, InvMatd, NIter, Verbose); dblarray2fltarray( InvMatd, InvMat); } /*********************************************************************/ /***************************************************************************/ void AR_PREDICTION::mse_predict(fltarray & Signal, int Np, dblarray &ArModel, dblarray &TabErr, int Step, int ScaleNumber) { int MaxNbrAR = ArModel.nx(); int FirstPix = (MaxNbrAR+1)*Step; // POW2(ScaleNumber); int NPixUsed = Np - FirstPix; int a,i,t; double Pred, ErrPred; double Nr = (double) NPixUsed; TabErr.alloc(MaxNbrAR+1); // cout << " ScaleNumber = " << ScaleNumber << " MaxNbrAR = " << MaxNbrAR << endl; // cout << " FirstPix = " << FirstPix << " Np = " << Np << endl; // cout << " Signal = " << Signal.nx() << " Np = " << Np << endl; ErrPred = 0.; for (i = FirstPix; i < Np; i++) ErrPred += Signal(i) * Signal(i); TabErr(0) = ErrPred / Nr; for (a=0; a < MaxNbrAR; a++) { ErrPred = 0.; for (i = FirstPix; i < Np; i++) { Pred = 0.; for (t=0; t <= a; t++) { // int Pos = i-(t+1)*Step; int Pos = i-1-(Step*t); // Pred += ARModel(i-1) * Signal(Pos-1-(Step*(i-1))); if ((Pos < 0) || (Pos >= Signal.nx())) { cout << "Error: Pos = " << Pos << " t = " << t << " a = " << a << " Step = " << Step << endl; exit(-1); } Pred += ArModel(t,a) * Signal(Pos); } ErrPred += (Signal(i)-Pred) * (Signal(i)-Pred); } TabErr(a+1) = ErrPred / Nr; } } /*********************************************************************/ void AR_PREDICTION::get_best_ar_model(fltarray & Signal, int Np, int &BestNbrAR, fltarray &BestARModel, int Step, int ScaleNumber) { int i,a; int MaxNbr_of_AR = MaxNbrAR; double Yamma0=0.; int FirstPix = MaxNbr_of_AR*Step; int NPixUsed = Np - FirstPix; if (NPixUsed < 2) { MaxNbr_of_AR = Np / (2*Step); FirstPix = MaxNbr_of_AR*Step; NPixUsed = Np - FirstPix; } if (NPixUsed < 2) { cout << "Error: not enough point for AR estimation ..." << endl; cout << " MaxNbr_of_AR = " << MaxNbr_of_AR << " Step = " << Step << endl; cout << " Np = " << Np << " FirstPix = " << FirstPix << endl; exit(-1); } dblarray ArModel(MaxNbr_of_AR,MaxNbr_of_AR); dblarray ErrModel(MaxNbr_of_AR); dblarray Yamma(MaxNbr_of_AR+1); dblarray TabErr(MaxNbr_of_AR+1); dblarray TabFunc(MaxNbr_of_AR+1); dblarray PenalFunc(MaxNbr_of_AR+1); // Initialization for AR(1) for (i = FirstPix; i < Np; i++) { Yamma(0) += Signal(i)*Signal(i-1); Yamma0 += Signal(i)*Signal(i); } if (Yamma0 > 0) ArModel(0,0) = Yamma(0) / Yamma0; ErrModel(0) = Yamma0 *(1- ArModel(0,0)*ArModel(0,0)); // from AR(2) to AR(MaxNbr_of_AR) for (a=1; a < MaxNbr_of_AR; a++) { double PhiYamma=0.; // Yamma(a) calculation for (i = FirstPix; i < Np; i++) Yamma(a) += Signal(i)*Signal(i-1-(a)*Step); // Phi_a,a calculation for (i = 0; i < a; i++) PhiYamma += ArModel(i,a-1)*Yamma(a-i-1); if (ABS(ErrModel(a-1)) > 0) ArModel(a,a) = (Yamma(a) - PhiYamma) / ErrModel(a-1); // Phi_i,a calculation for (i = 0; i < a; i++) ArModel(i,a) = ArModel(i,a-1) - ArModel(a,a)*ArModel(a-i-1,a-1); // Error calculation ErrModel(a) = ErrModel(a-1) * (1- ArModel(a,a)*ArModel(a,a)); // cout << " MODELE AR(" << a+1 << ")" << endl; // cout << " AR = "; // for (i = 0; i <= a; i++) cout << ArModel(i,a) << " "; // cout << endl << " Err = " << ErrModel(a) << endl; } mse_predict(Signal, Np, ArModel, TabErr, Step, ScaleNumber); double Min=0.; int NumAr=0; // double Sig = Signal.sigma(); double AIC, BIC, AICC; for (a=0; a <= MaxNbr_of_AR; a++) { // double Nr = (double) Np / (double ) Step; double Nr = (double) Np / (double ) POW2(ScaleNumber+1); switch (AR_Order_Detect) { case AR_ORDER_AIC: AIC = 2.*a / Nr; PenalFunc(a) = AIC; break; case AR_ORDER_AICC: AICC = (float)(a+Nr) / (float)(Nr - a - 2.); PenalFunc(a) = AICC ; break; case AR_ORDER_BIC: BIC = a *log(Nr) / Nr; PenalFunc(a) = BIC; break; default: cout << "Error: unknown criterion ... " << endl; exit(-1); } TabFunc(a) = log(TabErr(a)) + PenalFunc(a); // cout << a << ": Err = " << TabErr(a) << " Log = " << log(TabErr(a)) << " Pen = " << 2*(a+1) << endl; // cout << " Sig = " << Sig << " AIC = " << AIC << " BIC = " << BIC << " AICC = " << AICC << endl; // cout << a << ": H = " << AIC << " AIC = " << TabFunc(a) << endl; if (a == 0) Min = TabFunc(a); else if (Min > TabFunc(a)) { Min = TabFunc(a); NumAr = a; } } BestNbrAR = NumAr; if ( BestARModel.nx() != BestNbrAR) BestARModel.alloc(BestNbrAR); get_ar_model(Signal, Np, BestNbrAR, 0, BestARModel, Step); // for (a=0; a < BestNbrAR; a++) BestARModel(a) = (float) ArModel(a, BestNbrAR-1); // for (a=0; a < MaxNbr_of_AR; a++) // { // cout << " MODELE AR(" << a << ")" << endl; // cout << " AR = "; // if (a > 0) for (i = 0; i < a; i++) cout << ArModel(i,a-1) << " "; // cout << endl << " ErrPred = " << TabErr(a) << " Penal = " << PenalFunc(a) << endl; // cout << " NPixUsed = " << NPixUsed << " Func = " << TabFunc(a) << endl; // } // a = BestNbrAR; // cout << " MODELE AR(" << a << ")" << endl; // cout << " AR = "; // cout << " Estimated AR order = " << NumAr << endl; // if (a > 0) for (i = 0; i < a; i++) cout << ArModel(i,a-1) << " "; // cout << endl; } /*********************************************************************/ void AR_PREDICTION::get_ar_model(fltarray & Signal, int Np, int NbrAR, int MaxNbrTraining, fltarray & ARModel, int Step) { int i,j,IndData; int t0 = Np-1-PredDistance; // int N = Signal.nx(); int NbrTraining; NbrTraining = t0 - NbrAR*Step; if ((MaxNbrTraining > 0) && (NbrTraining > MaxNbrTraining)) NbrTraining = MaxNbrTraining; if (NbrTraining < 0) { NbrAR = t0 / Step; NbrTraining = t0 - NbrAR*Step; if (NbrTraining < 0) { cout << "Error: Number of scales is to high ... " << endl; exit(-1); } } // cout << "NbrTraining = " << NbrTraining << endl; // cout << " Step = " << Step << "t0 = " << t0 << " NbrAR = " << NbrAR << " NbrTraining = " << NbrTraining << endl; // Learning values: A X = B dblarray MAT_X(1,NbrAR); dblarray MAT_A(NbrAR, NbrTraining); dblarray InvMAT_A; dblarray MAT_B(1,NbrTraining); ARModel.alloc(NbrAR); MAT_X.init(); for (i=0; i < NbrTraining; i++) { for (j=0; j < NbrAR; j++) { IndData = t0 - i - 1 - j *Step; if (IndData < 0) { cout << endl; cout << "ERROR: IndData = " << IndData << endl; exit(-1); } MAT_A (j,i) = Signal(IndData); } IndData = t0 - i + PredDistance; MAT_B(i) = Signal(IndData); } MatOper CO; CO.lin_eq_svd(MAT_A, MAT_B, MAT_X); for (j=0; j < NbrAR; j++) ARModel(j) = (float) MAT_X(j); } /***************************************************************************/ void fit1d_pol_deg2(fltarray &Data, dblarray & MAT_X, dblarray &Weight, int N, int NL) { int i,Np = N; int NLast = NL; if (N == 0) Np = Data.nx(); if (NLast == 0) NLast = Np; dblarray MAT_A(3,NLast); dblarray MAT_B(1,NLast); for (i=0; i < NLast; i++) { MAT_A(0,i) = i*i*Weight(i); MAT_A(1,i) = i*Weight(i); MAT_A(2,i) = 1*Weight(i); MAT_B(i) = Data(Np-NLast+i)*Weight(i); } // Learning values: A X = B MAT_X.init(); MatOper CO; CO.lin_eq_svd(MAT_A, MAT_B, MAT_X); } /***************************************************************************/ void fit1d_pol_deg2(fltarray &Data, dblarray & MAT_X, int N, int NL) // Calcule the polynome of degree 2 fitting the Nlast points // of the data // Data(i) = a x^2 + b x + 1 // and i = [Np-NLast,Np-1] // Np: IN = Number of pixels in Data // Data: IN = input data // Nlast: IN = number of points in Data to be used // DistPred: IN = Calculate the prediction at a distance DistPred+1 from // the last pixel (DistPred=0) for the next pixel prediction) // and return this value { int i,Np = N; int NLast = NL; if (N == 0) Np = Data.nx(); if (NLast == 0) NLast = Np; dblarray MAT_A(3,NLast); dblarray MAT_B(1,NLast); for (i=0; i < NLast; i++) { MAT_A(0,i) = i*i; MAT_A(1,i) = i; MAT_A(2,i) = 1; MAT_B(i) = Data(Np-NLast+i); } // Learning values: A X = B MAT_X.init(); MatOper CO; CO.lin_eq_svd(MAT_A, MAT_B, MAT_X); } /***************************************************************************/ void fit1d_pol_deg1(fltarray &Data, dblarray & MAT_X, int N, int NL) { int i,Np = N; int NLast = NL; if (N == 0) Np = Data.nx(); if (NLast == 0) NLast = Np; dblarray MAT_A(2,NLast); dblarray MAT_B(1,NLast); for (i=0; i < NLast; i++) { MAT_A(0,i) = i; MAT_A(1,i) = 1; MAT_B(i) = Data(Np-NLast+i); } // Learning values: A X = B MAT_X.init(); MatOper CO; CO.lin_eq_svd(MAT_A, MAT_B, MAT_X); } /***************************************************************************/ void tendancy_est(fltarray & Data, fltarray & Tend, int WindowSize, int N) { int i,k; int Np = N; if (N == 0) Np = Data.nx(); dblarray MAT_X(1,3); if (Tend.nx() != Np) Tend.alloc(Np); for (i=0; i<Np; i++) { dblarray W; int Nx = WindowSize; int Pmin = MAX(0,i-WindowSize/2); int Pmax = MIN(Np-1,i+WindowSize/2); Nx = Pmax-Pmin+1; W.alloc(Nx); for (k=0; k<Nx; k++) { double D = MAX(Pmax-i,i-Pmin); double x = (Pmin + k - i) / D; W(k) = sqrt(1. - x*x); } fit1d_pol_deg2(Data, MAT_X, W, Pmax+1, Nx); double P, x = i-Pmin; P = MAT_X(0)*x*x+ MAT_X(1)*x +MAT_X(2); Tend(i) = (float) P; } } /*********************************************************************/ void autocor1d(fltarray & Data, fltarray &TabAuto, int NBShift, int N) { int i,s; double XY,X2,Y2; int Np = N; if (N == 0) Np = Data.nx(); if (TabAuto.nx() != NBShift) TabAuto.alloc(NBShift); TabAuto(0) = 1; for (s=1; s < NBShift; s++) { XY = X2 = Y2 = 0.; for (i=s; i < Np; i++) { XY += Data(i) * Data(i-s); X2 += Data(i) * Data(i); Y2 += Data(i-s)*Data(i-s); } TabAuto(s) = (float) ( XY / (sqrt(X2)*sqrt(Y2))); } } /*********************************************************************/
25.659067
118
0.509592
jstarck
b5d4f3154ae656d16ccc5c21a3bb5fcb86f888bc
295
hpp
C++
Source/Exporter.hpp
Myles-Trevino/Frustum
b5faea151d68996378eb485dc6a5bbd788b0fd22
[ "Apache-2.0" ]
2
2020-08-10T23:26:24.000Z
2020-08-20T02:10:47.000Z
Source/Exporter.hpp
Myles-Trevino/Frustum
b5faea151d68996378eb485dc6a5bbd788b0fd22
[ "Apache-2.0" ]
1
2021-03-10T15:39:44.000Z
2021-03-11T15:44:43.000Z
Source/Exporter.hpp
Myles-Trevino/Frustum
b5faea151d68996378eb485dc6a5bbd788b0fd22
[ "Apache-2.0" ]
null
null
null
/* Copyright Myles Trevino Licensed under the Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 */ #pragma once #include <string> namespace LV::Exporter { void export_frustum(const std::string& name, const std::string& format, const std::string& orientation); }
16.388889
72
0.732203
Myles-Trevino
b5d87d60c14c8d9f2619f30439678c8b8a216505
5,594
hpp
C++
include/NUnit/Framework/Constraints/MessageWriter.hpp
darknight1050/BeatSaber-Quest-Codegen
a6eeecc3f0e8f6079630f9a9a72b3121ac7b2032
[ "Unlicense" ]
null
null
null
include/NUnit/Framework/Constraints/MessageWriter.hpp
darknight1050/BeatSaber-Quest-Codegen
a6eeecc3f0e8f6079630f9a9a72b3121ac7b2032
[ "Unlicense" ]
null
null
null
include/NUnit/Framework/Constraints/MessageWriter.hpp
darknight1050/BeatSaber-Quest-Codegen
a6eeecc3f0e8f6079630f9a9a72b3121ac7b2032
[ "Unlicense" ]
null
null
null
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "extern/beatsaber-hook/shared/utils/typedefs.h" #include <initializer_list> // Including type: System.IO.StringWriter #include "System/IO/StringWriter.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp" #include "extern/beatsaber-hook/shared/utils/utils.h" // Completed includes // Begin forward declares // Forward declaring namespace: NUnit::Framework::Constraints namespace NUnit::Framework::Constraints { // Forward declaring type: ConstraintResult class ConstraintResult; // Forward declaring type: Tolerance class Tolerance; } // Forward declaring namespace: System::Collections namespace System::Collections { // Forward declaring type: IEnumerable class IEnumerable; } // Completed forward declares // Type namespace: NUnit.Framework.Constraints namespace NUnit::Framework::Constraints { // Size: 0x31 #pragma pack(push, 1) // Autogenerated type: NUnit.Framework.Constraints.MessageWriter class MessageWriter : public System::IO::StringWriter { public: // Creating value type constructor for type: MessageWriter MessageWriter() noexcept {} // public System.Int32 get_MaxLineLength() // Offset: 0xFFFFFFFF int get_MaxLineLength(); // public System.Void WriteMessageLine(System.String message, params System.Object[] args) // Offset: 0x170DF68 void WriteMessageLine(::Il2CppString* message, ::Array<::Il2CppObject*>* args); // Creating initializer_list -> params proxy for: System.Void WriteMessageLine(System.String message, params System.Object[] args) void WriteMessageLine(::Il2CppString* message, std::initializer_list<::Il2CppObject*> args); // Creating TArgs -> initializer_list proxy for: System.Void WriteMessageLine(System.String message, params System.Object[] args) template<class ...TParams> void WriteMessageLine(::Il2CppString* message, TParams&&... args) { WriteMessageLine(message, {args...}); } // public System.Void WriteMessageLine(System.Int32 level, System.String message, params System.Object[] args) // Offset: 0xFFFFFFFF void WriteMessageLine(int level, ::Il2CppString* message, ::Array<::Il2CppObject*>* args); // Creating initializer_list -> params proxy for: System.Void WriteMessageLine(System.Int32 level, System.String message, params System.Object[] args) void WriteMessageLine(int level, ::Il2CppString* message, std::initializer_list<::Il2CppObject*> args); // Creating TArgs -> initializer_list proxy for: System.Void WriteMessageLine(System.Int32 level, System.String message, params System.Object[] args) template<class ...TParams> void WriteMessageLine(int level, ::Il2CppString* message, TParams&&... args) { WriteMessageLine(level, message, {args...}); } // public System.Void DisplayDifferences(NUnit.Framework.Constraints.ConstraintResult result) // Offset: 0xFFFFFFFF void DisplayDifferences(NUnit::Framework::Constraints::ConstraintResult* result); // public System.Void DisplayDifferences(System.Object expected, System.Object actual) // Offset: 0xFFFFFFFF void DisplayDifferences(::Il2CppObject* expected, ::Il2CppObject* actual); // public System.Void DisplayDifferences(System.Object expected, System.Object actual, NUnit.Framework.Constraints.Tolerance tolerance) // Offset: 0xFFFFFFFF void DisplayDifferences(::Il2CppObject* expected, ::Il2CppObject* actual, NUnit::Framework::Constraints::Tolerance* tolerance); // public System.Void DisplayStringDifferences(System.String expected, System.String actual, System.Int32 mismatch, System.Boolean ignoreCase, System.Boolean clipping) // Offset: 0xFFFFFFFF void DisplayStringDifferences(::Il2CppString* expected, ::Il2CppString* actual, int mismatch, bool ignoreCase, bool clipping); // public System.Void WriteActualValue(System.Object actual) // Offset: 0xFFFFFFFF void WriteActualValue(::Il2CppObject* actual); // public System.Void WriteValue(System.Object val) // Offset: 0xFFFFFFFF void WriteValue(::Il2CppObject* val); // public System.Void WriteCollectionElements(System.Collections.IEnumerable collection, System.Int64 start, System.Int32 max) // Offset: 0xFFFFFFFF void WriteCollectionElements(System::Collections::IEnumerable* collection, int64_t start, int max); // protected System.Void .ctor() // Offset: 0x170F0B0 // Implemented from: System.IO.StringWriter // Base method: System.Void StringWriter::.ctor() // Base method: System.Void TextWriter::.ctor() // Base method: System.Void MarshalByRefObject::.ctor() // Base method: System.Void Object::.ctor() template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary> static MessageWriter* New_ctor() { static auto ___internal__logger = ::Logger::get().WithContext("NUnit::Framework::Constraints::MessageWriter::.ctor"); return THROW_UNLESS((::il2cpp_utils::New<MessageWriter*, creationType>())); } }; // NUnit.Framework.Constraints.MessageWriter #pragma pack(pop) } DEFINE_IL2CPP_ARG_TYPE(NUnit::Framework::Constraints::MessageWriter*, "NUnit.Framework.Constraints", "MessageWriter");
57.081633
172
0.728459
darknight1050
b5db09b4d94ff65af99aa56d9fce77be3f2d5f8d
4,859
cpp
C++
hetero/simulations_random.cpp
tehora/phd-sourcecodes
b8c9be03b6de012b886e3d3f43c9d179ec2d701b
[ "MIT" ]
null
null
null
hetero/simulations_random.cpp
tehora/phd-sourcecodes
b8c9be03b6de012b886e3d3f43c9d179ec2d701b
[ "MIT" ]
null
null
null
hetero/simulations_random.cpp
tehora/phd-sourcecodes
b8c9be03b6de012b886e3d3f43c9d179ec2d701b
[ "MIT" ]
null
null
null
#include <ghutils.h> #include <set> #include <vector> #include <unordered_map> #include <algorithm> #include <iomanip> #include <math.h> int number = 100; set <pair <int, int>> edges; set <pair <int, int>> random_net; unordered_map <string, int> nodes; //for simulations related to kohonen map <int, int> neuron_classify; int koh[10][100]; int A[520][520]; void insert_graph(const char* file) { csvparser in0(file, ';'); int id = 1; while (in0.next()) { if (in0[4] == "opened" && (in0[1] != in0[3])) { if (nodes.count(in0[3])==0) { nodes[in0[3]] = id; id++; } if (nodes.count(in0[1])==0) { nodes[in0[1]] = id; id++; } edges.insert(make_pair(nodes[in0[1]], nodes[in0[3]])); } } } void create_random_net(set<pair<int, int>>& orig) { random_net = orig; vector <pair<int, int>> v; for (auto e:random_net) v.push_back(e); int wrong = 0; int i = 0; while (i < random_net.size()*5) { i++; int first = rand() % random_net.size(); int second = rand() % random_net.size(); if (v[first].first == v[second].second || v[first].second == v[second].first || random_net.count(make_pair(v[first].first,v[second].second))!=0 || random_net.count(make_pair(v[second].first,v[first].second))!=0) { wrong++; continue; } else { random_net.erase(v[first]); random_net.erase(v[second]); pair <int, int> a = make_pair(v[first].first,v[second].second); pair <int, int> b = make_pair(v[second].first,v[first].second); random_net.insert(a); random_net.insert(b); v[first] = a; v[second] = b; } } cout <<"incorrect: " <<wrong <<"\n"; } void counting_distances(string file, int sim_num) { csvparser in(file.c_str(), ';'); while (in.next()) { neuron_classify[nodes[in[0]]] = tonum(in[1]); } for (auto& edge: random_net) { if (neuron_classify.count(edge.first) > 0 && neuron_classify.count(edge.second) > 0 ) { koh[A[neuron_classify[edge.first]][neuron_classify[edge.second]]][sim_num]++; } } } void leave_one_out(ofstream& out) { double means[10]; double lower_means[10]; double upper_means[10]; double std_devs[10]; double ith_avg[number]; for (int i = 0; i<10; i++) { double sum = 0; double sum_means = 0; //sum of all values for (int j = 0; j<number; j++) { sum+=koh[i][j]; } //ith average for (int z=0;z<number; z++) { ith_avg[z] = 0; } for (int j = 0; j<number; j++) { ith_avg[j] = (sum-koh[i][j])/(number-1); sum_means+= ith_avg[j]; } means[i] = sum_means/number; lower_means[i] = ith_avg[5]; upper_means[i] = ith_avg[95]; double sum_avgs = 0; for (int j = 0; j <number; j++) { sum_avgs += (double(ith_avg[j] - sum_means/number)*double(ith_avg[j] - sum_means/number)); } std_devs[i] = sqrt(sum_avgs*(number-1)/number); } out << fixed <<setprecision(3); for (int i; i < 10; i++) { out << means[i] <<";"; } for (int i; i < 10; i++) { out << lower_means[i] <<";"; } for (int i; i < 10; i++) { out << upper_means[i] <<";"; } for (int i; i < 9; i++) { out << std_devs[i] <<";"; } out <<std_devs[9] <<"\n"; out.flush(); } int main(int argc, char **argv) { srand( time( NULL ) ); insert_graph(argv[1]); //neuron distances are always the same (the same tesselation) { csvparser in("../../src/kohonen/neuron-distances.csv", ';'); int i=0; while (in.next()) { for (int j = 0; j<520; j++) { A[i][j]=tonum(in[j]); } i++; } } ofstream out(argv[3], ofstream::app); for (int num=0; num <10; num++) { cout <<"creating random_net graph\n"; create_random_net(edges); //cleaning for (int x = 0; x<10; x++) { for (int y = 0; y <number; y++) { koh[x][y]=0; } } // simulation // we iterate over the set of files containing results of som { csvparser in(argv[2], ';'); int sim = 0; while (in.next() && sim < number) { counting_distances(in[0],sim); sim++; } } // leave one out leave_one_out(out); } }
26.551913
221
0.477053
tehora
b5dc152a3bf08c09438463cd636a53e706a17dd3
454,489
cpp
C++
WRK-V1.2/clr/src/vm/class.cpp
intj-t/openvmsft
0d17fbce8607ab2b880be976c2e86d8cfc3e83bb
[ "Intel" ]
null
null
null
WRK-V1.2/clr/src/vm/class.cpp
intj-t/openvmsft
0d17fbce8607ab2b880be976c2e86d8cfc3e83bb
[ "Intel" ]
null
null
null
WRK-V1.2/clr/src/vm/class.cpp
intj-t/openvmsft
0d17fbce8607ab2b880be976c2e86d8cfc3e83bb
[ "Intel" ]
null
null
null
// ==++== // // // Copyright (c) 2006 Microsoft Corporation. All rights reserved. // // The use and distribution terms for this software are contained in the file // named license.txt, which can be found in the root of this distribution. // By using this software in any fashion, you are agreeing to be bound by the // terms of this license. // // You must not remove this notice, or any other, from this software. // // // ==--== // =========================================================================== // File: CLASS.CPP // #include "common.h" #include "clsload.hpp" #include "method.hpp" #include "class.h" #include "class.inl" #include "object.h" #include "field.h" #include "util.hpp" #include "excep.h" #include "siginfo.hpp" #include "threads.h" #include "stublink.h" #include "ecall.h" #include "dllimport.h" #include "gcdesc.h" #include "verifier.hpp" #include "jitinterface.h" #include "eeconfig.h" #include "log.h" #include "fieldmarshaler.h" #include "cgensys.h" #include "gc.h" #include "security.h" #include "comstringbuffer.h" #include "dbginterface.h" #include "comdelegate.h" #include "sigformat.h" #include "remoting.h" #include "eeprofinterfaces.h" #include "dllimportcallback.h" #include "listlock.h" #include "methodimpl.h" #include "guidfromname.h" #include "stackprobe.h" #include "encee.h" #include "encee.h" #include "comsynchronizable.h" #include "customattribute.h" #include "virtualcallstub.h" #include "eeconfig.h" #include "contractimpl.h" #include "prettyprintsig.h" #include "objectclone.h" #include "mdaassistantsptr.h" #include "listlock.inl" #include "generics.h" #include "genericdict.h" #include "instmethhash.h" #include "typeparse.h" #include "typestring.h" #include "typedesc.h" #include "ecmakey.h" #include "constrainedexecutionregion.h" #include "security.inl" #ifndef DACCESS_COMPILE //******************************************************************************* // Helper functions to sort GCdescs by offset (decending order) int __cdecl compareCGCDescSeries(const void *arg1, const void *arg2) { STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_GC_NOTRIGGER; STATIC_CONTRACT_FORBID_FAULT; CGCDescSeries* gcInfo1 = (CGCDescSeries*) arg1; CGCDescSeries* gcInfo2 = (CGCDescSeries*) arg2; return (int)(gcInfo2->GetSeriesOffset() - gcInfo1->GetSeriesOffset()); } #define RVA_FIELD_VALIDATION_ENABLED #define UNPLACED_NONVTABLE_SLOT_NUMBER ((WORD) -2) #include "assembly.hpp" char* FormatSig(MethodDesc* pMD, BaseDomain *pDomain, AllocMemTracker *pamTracker); // // The MethodNameHash is a temporary loader structure which may be allocated if there are a large number of // methods in a class, to quickly get from a method name to a MethodDesc (potentially a chain of MethodDescs). // //******************************************************************************* // Returns TRUE for success, FALSE for failure void MethodNameHash::Init(DWORD dwMaxEntries, StackingAllocator *pAllocator) { CONTRACTL { THROWS; GC_NOTRIGGER; PRECONDITION(CheckPointer(this)); } CONTRACTL_END; // Given dwMaxEntries, determine a good value for the number of hash buckets m_dwNumBuckets = (dwMaxEntries / 10); if (m_dwNumBuckets < 5) m_dwNumBuckets = 5; unsigned cbMemory = 0; unsigned cbEntries = 0; if (!ClrSafeInt<unsigned>::multiply(m_dwNumBuckets, sizeof(MethodHashEntry*), cbMemory) || !ClrSafeInt<unsigned>::multiply(dwMaxEntries, sizeof(MethodHashEntry), cbEntries) || !ClrSafeInt<unsigned>::addition(cbMemory, cbEntries, cbMemory)) ThrowHR(E_INVALIDARG); if (pAllocator) { m_pMemoryStart = (BYTE*)pAllocator->Alloc(cbMemory); } else { // We're given the number of hash table entries we're going to insert, so we can allocate the appropriate size m_pMemoryStart = new BYTE[cbMemory]; } INDEBUG(m_pDebugEndMemory = m_pMemoryStart + cbMemory;) // Current alloc ptr m_pMemory = m_pMemoryStart; // Allocate the buckets out of the alloc ptr m_pBuckets = (MethodHashEntry**) m_pMemory; m_pMemory += sizeof(MethodHashEntry*)*m_dwNumBuckets; // Buckets all point to empty lists to begin with memset(m_pBuckets, 0, sizeof(MethodHashEntry*)*m_dwNumBuckets); } //******************************************************************************* // Insert new entry at head of list void MethodNameHash::Insert(LPCUTF8 pszName, MethodDesc *pDesc) { LEAF_CONTRACT; DWORD dwHash = HashStringA(pszName); DWORD dwBucket = dwHash % m_dwNumBuckets; MethodHashEntry*pNewEntry; pNewEntry = (MethodHashEntry *) m_pMemory; m_pMemory += sizeof(MethodHashEntry); _ASSERTE(m_pMemory <= m_pDebugEndMemory); // Insert at head of bucket chain pNewEntry->m_pNext = m_pBuckets[dwBucket]; pNewEntry->m_pDesc = pDesc; pNewEntry->m_dwHashValue = dwHash; pNewEntry->m_pKey = pszName; m_pBuckets[dwBucket] = pNewEntry; } //******************************************************************************* // Return the first MethodHashEntry with this name, or NULL if there is no such entry MethodHashEntry *MethodNameHash::Lookup(LPCUTF8 pszName, DWORD dwHash) { STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_GC_NOTRIGGER; STATIC_CONTRACT_FORBID_FAULT; if (!dwHash) dwHash = HashStringA(pszName); DWORD dwBucket = dwHash % m_dwNumBuckets; MethodHashEntry*pSearch; for (pSearch = m_pBuckets[dwBucket]; pSearch; pSearch = pSearch->m_pNext) { if (pSearch->m_dwHashValue == dwHash && !strcmp(pSearch->m_pKey, pszName)) return pSearch; } return NULL; } #define MAX(a,b) (((a)>(b))?(a):(b)) #ifdef _DEBUG unsigned g_dupMethods = 0; unsigned g_numMethods = 0; #endif // _DEBUG // Define this to cause all vtable and field information to be dumped to the screen //#define FULL_DEBUG //******************************************************************************* EEClass::EEClass(Module *pModule, DWORD genericsFlags) { LEAF_CONTRACT; m_VMFlags = 0; m_pModule = pModule; _ASSERTE(pModule != NULL); m_pMethodTable = NULL; // Set the generics flags early so we can always determine whether this is an EEClass for an // instantiated type, e.g. List<int> or List<object>. This helps // us sanity check things during class creation. // m_VMFlags |= genericsFlags; // Set the interface ID to -1 to indicate it hasn't been set yet. m_cbModuleDynamicID = (DWORD) -1; #ifdef _DEBUG m_szDebugClassName = NULL; m_fDebuggingClass = FALSE; #endif // _DEBUG #if CHECK_APP_DOMAIN_LEAKS m_wAuxFlags = 0; #endif } //******************************************************************************* void *EEClass::operator new(size_t size, size_t extraSize, LoaderHeap *pHeap, Module *pModule, size_t *dwSizeRequestedForAlloc, AllocMemTracker *pamTracker) { CONTRACTL { THROWS; GC_NOTRIGGER; INJECT_FAULT(COMPlusThrowOM()); } CONTRACTL_END if(extraSize!=0) { if (size+extraSize<size) ThrowHR(COR_E_OVERFLOW); size+=extraSize; } #ifdef _DEBUG pModule->GetClassLoader()->m_dwEEClassData += size; #endif // Make sure that the EEClass is ptr size aligned. // This ensures that the buckets that follow are also aligned. _ASSERTE(size == ALIGN_UP(size, sizeof(UINT_PTR))); size = ALIGN_UP(size, sizeof(UINT_PTR)); void *pTmp; *dwSizeRequestedForAlloc = size; // Must give caller our alloc size so he can call BackoutMem pTmp = pamTracker->Track(pHeap->AllocMem_NoThrow(size)); if (!pTmp) { COMPlusThrowOM(); } // No need to memset since this memory came from VirtualAlloc'ed memory // memset (pTmp, 0, size); return pTmp; } //******************************************************************************* void EEClass::Destruct() { CONTRACTL { NOTHROW; GC_TRIGGERS; FORBID_FAULT; } CONTRACTL_END // If we haven't been restored, we can ignore the class if (GetMethodTable() && !GetMethodTable()->IsRestored()) return; SetDestroyed(); #ifdef PROFILING_SUPPORTED // If profiling, then notify the class is getting unloaded. TypeID clsId = NULL; if (CORProfilerTrackClasses() && !IsArrayClass() && GetMethodTable()) { // // FAULT_NOT_FATAL(); EX_TRY { PROFILER_CALL; g_profControlBlock.pProfInterface->ClassUnloadStarted( (ThreadID) GetThread(), clsId = (TypeID) TypeHandle(this->GetMethodTable()).AsPtr()); } EX_CATCH { // The exception here came from the profiler itself. We'll just // swallow the exception, since we don't want the profiler to bring // down the runtime. } EX_END_CATCH(RethrowTerminalExceptions); } #endif // PROFILING_SUPPORTED if (IsAnyDelegateClass()) { DelegateEEClass* pDelegateEEClass = (DelegateEEClass*)this; if (pDelegateEEClass->m_pSecurityStub) { Stub* pSecurityStub = pDelegateEEClass->m_pSecurityStub; pSecurityStub->DecRef(); Stub* pInterceptedStub = *(((InterceptStub*)pSecurityStub)->GetInterceptedStub()); if (pInterceptedStub == pDelegateEEClass->m_pUMCallStub) { pDelegateEEClass->m_pUMCallStub = NULL; } else if (pInterceptedStub == pDelegateEEClass->m_pMLStub) { pDelegateEEClass->m_pMLStub = NULL; } } if (pDelegateEEClass->m_pStaticCallStub) { BOOL fStubDeleted = pDelegateEEClass->m_pStaticCallStub->DecRef(); if (fStubDeleted) { DelegateInvokeStubManager::g_pManager->RemoveStub(pDelegateEEClass->m_pStaticCallStub); } } if (pDelegateEEClass->m_pUMCallStub) { pDelegateEEClass->m_pUMCallStub->DecRef(); } if (pDelegateEEClass->m_pInstRetBuffCallStub) { pDelegateEEClass->m_pInstRetBuffCallStub->DecRef(); } if (pDelegateEEClass->m_pMLStub) { pDelegateEEClass->m_pMLStub->DecRef(); } // While m_pMultiCastInvokeStub is also a member, // it is owned by the m_pMulticastStubCache, not by the class // - it is shared across classes. So we don't decrement // its ref count here delete pDelegateEEClass->m_pUMThunkMarshInfo; } if (GetMethodTable() && GetMethodTable()->IsThunking()) { GetMethodTable()->MarkAsNotThunking(); } // Destruct the method descs by walking the chunks. DWORD i, n; MethodDescChunk *pChunk = GetChunks(); // If we haven't created a methodtable yet, we better not have created any chunks! _ASSERTE(GetMethodTable() || !pChunk); while (pChunk != NULL) { n = pChunk->GetCount(); for (i = 0; i < n; i++) { MethodDesc *pMD = pChunk->GetMethodDescAt(i); pMD->Destruct(); } pChunk = pChunk->GetNextChunk(); } #ifdef PROFILING_SUPPORTED // If profiling, then notify the class is getting unloaded. if (CORProfilerTrackClasses() && !IsArrayClass() && // If there was an exception while the type was being loaded, // clsId may not be set. No need to do the callback in that case. clsId) { // See comments in the call to ClassUnloadStarted for details on this // FAULT_NOT_FATAL marker and exception swallowing. FAULT_NOT_FATAL(); EX_TRY { PROFILER_CALL; g_profControlBlock.pProfInterface->ClassUnloadFinished((ThreadID) GetThread(), clsId, S_OK); } EX_CATCH { } EX_END_CATCH(RethrowTerminalExceptions); } #endif // PROFILING_SUPPORTED } //******************************************************************************* EEClassLayoutInfo *EEClass::GetLayoutInfo() { STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_GC_NOTRIGGER; STATIC_CONTRACT_FORBID_FAULT; STATIC_CONTRACT_SO_TOLERANT; _ASSERTE(HasLayout()); g_IBCLogger.LogEEClassAndMethodTableAccess(this); return &((LayoutEEClass *) this)->m_LayoutInfo; } void MethodTableBuilder::CreateMinimalClass(LoaderHeap *pHeap, Module* pModule, AllocMemTracker *pamTracker, SIZE_T cbExtra, EEClass** ppEEClass) { CONTRACTL { THROWS; GC_NOTRIGGER; PRECONDITION(ppEEClass!=NULL); } CONTRACTL_END; size_t cbSize; *ppEEClass = new (cbExtra,pHeap, pModule, &cbSize, pamTracker) EEClass(pModule, 0); } //========================================================================== // This function is very specific about how it constructs a EEClass. It first // determines the necessary size of the vtable and the number of statics that // this class requires. The necessary memory is then allocated for a EEClass // and its vtable and statics. The class members are then initialized and // the memory is then returned to the caller // // LPEEClass CreateClass() // // Parameters : // [in] scope - scope of the current class not the one requested to be opened // [in] cl - class token of the class to be created. // [out] ppEEClass - pointer to pointer to hold the address of the EEClass // allocated in this function. // Return : returns an HRESULT indicating the success of this function. // // This parameter has been removed but might need to be reinstated if the // global for the metadata loader is removed. // [in] pIMLoad - MetaDataLoader class/object for the current scope. //========================================================================== /*static*/ void MethodTableBuilder::CreateClass(BaseDomain * pDomain, Module *pModule, mdTypeDef cl, BOOL fHasLayout, BOOL fDelegate, BOOL fIsEnum, const MethodTableBuilder::bmtGenericsInfo *bmtGenericsInfo, EEClass **ppEEClass, size_t *pdwAllocRequestSize, AllocMemTracker *pamTracker) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(!(fHasLayout && fDelegate)); PRECONDITION(!(fHasLayout && fIsEnum)); PRECONDITION(ppEEClass!=NULL); PRECONDITION(pdwAllocRequestSize!=NULL); PRECONDITION(CheckPointer(bmtGenericsInfo)); } CONTRACTL_END; EEClass *pEEClass = NULL; IMDInternalImport *pInternalImport; HRESULT hrToThrow; pEEClass = NULL; if (fHasLayout) { pEEClass = new (0,pDomain->GetLowFrequencyHeap(), pModule, pdwAllocRequestSize, pamTracker) LayoutEEClass(pModule, bmtGenericsInfo->genericsKind); } else if (fDelegate) { pEEClass = new (0,pDomain->GetLowFrequencyHeap(), pModule, pdwAllocRequestSize, pamTracker) DelegateEEClass(pModule, bmtGenericsInfo->genericsKind); } else if (fIsEnum) { pEEClass = new (0,pDomain->GetLowFrequencyHeap(), pModule, pdwAllocRequestSize, pamTracker) EnumEEClass(pModule, bmtGenericsInfo->genericsKind); } else { pEEClass = new (0,pDomain->GetLowFrequencyHeap(), pModule, pdwAllocRequestSize, pamTracker) EEClass(pModule, bmtGenericsInfo->genericsKind); } if (!pEEClass) { COMPlusThrowOM(); } // Caller will clean up if we throw below here. *ppEEClass = pEEClass; DWORD dwAttrClass = 0; mdToken tkExtends = mdTokenNil; pEEClass->m_cl = cl; // Set up variance info if (bmtGenericsInfo->pVarianceInfo) { pEEClass->m_pVarianceInfo = (BYTE*) pamTracker->Track(pDomain->GetHighFrequencyHeap()->AllocMem(bmtGenericsInfo->GetNumGenericArgs())); memcpy(pEEClass->m_pVarianceInfo, bmtGenericsInfo->pVarianceInfo, bmtGenericsInfo->GetNumGenericArgs()); } else pEEClass->m_pVarianceInfo = NULL; pInternalImport = pModule->GetMDImport(); if (pInternalImport == NULL) COMPlusThrowHR(COR_E_TYPELOAD); pInternalImport->GetTypeDefProps( cl, &dwAttrClass, &tkExtends ); pEEClass->m_dwAttrClass = dwAttrClass; // MDVal check: can't be both tdSequentialLayout and tdExplicitLayout if((dwAttrClass & tdLayoutMask) == tdLayoutMask) COMPlusThrowHR(COR_E_TYPELOAD); if (IsTdInterface(dwAttrClass)) { // MDVal check: must have nil tkExtends and must be tdAbstract if((tkExtends & 0x00FFFFFF)||(!IsTdAbstract(dwAttrClass))) COMPlusThrowHR(COR_E_TYPELOAD); } // // Initialize SecurityProperties structure // if (Security::IsSecurityOn() && IsTdHasSecurity(dwAttrClass)) { DWORD dwSecFlags; DWORD dwNullDeclFlags; hrToThrow = Security::GetDeclarationFlags(pInternalImport, cl, &dwSecFlags, &dwNullDeclFlags); if (FAILED(hrToThrow)) COMPlusThrowHR(hrToThrow); pEEClass->m_SecProps.SetFlags(dwSecFlags, dwNullDeclFlags); } // Cache class level reliability contract info. pEEClass->SetReliabilityContract(::GetReliabilityContract(pInternalImport, cl)); if (fHasLayout) pEEClass->SetHasLayout(); #ifdef _DEBUG pModule->GetClassLoader()->m_dwDebugClasses++; #endif } //******************************************************************************* // // Create a hash of all methods in this class. The hash is from method name to MethodDesc. // MethodNameHash *MethodTableBuilder::CreateMethodChainHash(MethodTable *pMT) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END; Thread *pThread = GetThread(); PVOID pvMem = pThread->m_MarshalAlloc.Alloc(sizeof(MethodNameHash)); MethodNameHash *pHash = new (pvMem) MethodNameHash(); pHash->Init(pMT->GetNumVirtuals(), &(pThread->m_MarshalAlloc)); MethodTable::MethodIterator it(pMT); for (;it.IsValid(); it.Next()) { if (it.IsVirtual()) { MethodDesc *pImplDesc = it.GetMethodDesc(); CONSISTENCY_CHECK(CheckPointer(pImplDesc)); MethodDesc *pDeclDesc = it.GetDeclMethodDesc(); CONSISTENCY_CHECK(CheckPointer(pDeclDesc)); CONSISTENCY_CHECK(pMT->IsInterface() || !pDeclDesc->IsInterface()); pHash->Insert(pDeclDesc->GetNameOnNonArrayClass(), pDeclDesc); } } // Success return pHash; } //******************************************************************************* //----------------------------------------------------------------------------------- // Note: this only loads the type to CLASS_DEPENDENCIES_LOADED as this can be called // indirectly from DoFullyLoad() as part of accessibility checking. //----------------------------------------------------------------------------------- MethodTable *MethodTable::LoadEnclosingMethodTable() { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); MODE_ANY; } CONTRACTL_END if (! GetClass()->IsNested()) return NULL; mdTypeDef tdEnclosing = mdTypeDefNil; HRESULT hr; hr = GetMDImport()->GetNestedClassProps(GetCl(), &tdEnclosing); if (FAILED(hr)) ThrowHR(hr, BFA_UNABLE_TO_GET_NESTED_PROPS); return ClassLoader::LoadTypeDefThrowing(GetModule(), tdEnclosing, ClassLoader::ThrowIfNotFound, ClassLoader::PermitUninstDefOrRef, tdNoTypes, CLASS_DEPENDENCIES_LOADED ).GetMethodTable(); } //******************************************************************************* // // Find a method in this class hierarchy - used ONLY by the loader during layout. Do not use at runtime. // // *ppMemberSignature must be NULL on entry - it and *pcMemberSignature may or may not be filled out // // ppMethodDesc will be filled out with NULL if no matching method in the hierarchy is found. // // Returns FALSE if there was an error of some kind. // // pMethodConstraintsMatch receives the result of comparing the method constraints. HRESULT MethodTableBuilder::LoaderFindMethodInClass( LPCUTF8 pszMemberName, Module* pModule, mdMethodDef mdToken, MethodDesc ** ppMethodDesc, PCCOR_SIGNATURE * ppMemberSignature, DWORD * pcMemberSignature, DWORD dwHashName, BOOL * pMethodConstraintsMatch ) { CONTRACTL { THROWS; GC_TRIGGERS; PRECONDITION(CheckPointer(this)); PRECONDITION(CheckPointer(bmtParent)); PRECONDITION(CheckPointer(pModule)); PRECONDITION(CheckPointer(ppMethodDesc)); PRECONDITION(CheckPointer(ppMemberSignature)); PRECONDITION(CheckPointer(pcMemberSignature)); } CONTRACTL_END; MethodHashEntry *pEntry; DWORD dwNameHashValue; _ASSERTE(pModule); _ASSERTE(*ppMemberSignature == NULL); // No method found yet *ppMethodDesc = NULL; // Have we created a hash of all the methods in the class chain? if (bmtParent->pParentMethodHash == NULL) { // There may be such a method, so we will now create a hash table to reduce the pain for // further lookups bmtParent->pParentMethodHash = CreateMethodChainHash(bmtParent->pParentMethodTable); } // We have a hash table, so use it pEntry = bmtParent->pParentMethodHash->Lookup(pszMemberName, dwHashName); if (pEntry == NULL) return S_OK; // No method by this name exists in the hierarchy // Get signature of the method we're searching for - we will need this to verify an exact name-signature match *ppMemberSignature = pModule->GetMDImport()->GetSigOfMethodDef( mdToken, pcMemberSignature ); // Hash value we are looking for in the chain dwNameHashValue = pEntry->m_dwHashValue; // We've found a method with the same name, but the signature may be different // Traverse the chain of all methods with this name while (1) { PCCOR_SIGNATURE pHashMethodSig; DWORD cHashMethodSig; Substitution* pSubst = NULL; MethodTable *entryMT = pEntry->m_pDesc->GetMethodTable(); EEClass *entryEEClass = entryMT->GetClass(); if (entryEEClass->GetNumGenericArgs() > 0) { EEClass *here = GetHalfBakedClass(); _ASSERTE(here->GetModule()); MethodTable *pParent = bmtParent->pParentMethodTable; do { Substitution *newSubst = new Substitution; *newSubst = here->GetSubstitutionForParent(pSubst); pSubst = newSubst; here = pParent->GetClass(); _ASSERT(here != NULL); pParent = pParent->GetParentMethodTable(); } while (entryEEClass != here); } // Get sig of entry in hash chain pEntry->m_pDesc->GetSig(&pHashMethodSig, &cHashMethodSig); // Note instantiation info { HRESULT hr = MetaSig::CompareMethodSigsNT(*ppMemberSignature, *pcMemberSignature, pModule, NULL, pHashMethodSig, cHashMethodSig, pEntry->m_pDesc->GetModule(), pSubst); if (FAILED(hr)) { if(pSubst) pSubst->DeleteChain(); return hr; } if (hr == S_OK) { // Found a match *ppMethodDesc = pEntry->m_pDesc; // Check the constraints are consistent, // and return the result to the caller. // We do this here to avoid recalculating pSubst. *pMethodConstraintsMatch = MetaSig::CompareMethodConstraints(pModule, mdToken, pSubst, pEntry->m_pDesc->GetModule(), pEntry->m_pDesc->GetMemberDef()); if(pSubst) pSubst->DeleteChain(); return S_OK; } } if(pSubst) pSubst->DeleteChain(); // Advance to next item in the hash chain which has the same name do { pEntry = pEntry->m_pNext; // Next entry in the hash chain if (pEntry == NULL) return S_OK; // End of hash chain, no match found } while ((pEntry->m_dwHashValue != dwNameHashValue) || (strcmp(pEntry->m_pKey, pszMemberName) != 0)); } return S_OK; } //******************************************************************************* // Enumerator to traverse the interface declarations of a type, automatically building // a substitution chain on the stack. class InterfaceImplEnum { Module* m_pModule; HENUMInternalHolder hEnumInterfaceImpl; const Substitution *m_pSubstChain; Substitution m_CurrSubst; mdTypeDef m_CurrTok; public: InterfaceImplEnum(Module *pModule, mdTypeDef cl, const Substitution *pSubstChain) : hEnumInterfaceImpl(pModule->GetMDImport()) { WRAPPER_CONTRACT; m_pModule = pModule; hEnumInterfaceImpl.EnumInit(mdtInterfaceImpl, cl); m_pSubstChain = pSubstChain; } BOOL Next() { WRAPPER_CONTRACT; mdInterfaceImpl ii; if (!m_pModule->GetMDImport()->EnumNext(&hEnumInterfaceImpl, &ii)) return FALSE; m_CurrTok = m_pModule->GetMDImport()->GetTypeOfInterfaceImpl(ii); m_CurrSubst = Substitution(m_CurrTok, m_pModule, m_pSubstChain); return TRUE; } const Substitution *CurrentSubst() const { LEAF_CONTRACT; return &m_CurrSubst; } mdTypeDef CurrentToken() const { LEAF_CONTRACT; return m_CurrTok; } }; //******************************************************************************* // // Given an interface map to fill out, expand pNewInterface (and its sub-interfaces) into it, increasing // pdwInterfaceListSize as appropriate, and avoiding duplicates. // /* static */ void MethodTableBuilder::ExpandApproxInterface(bmtInterfaceInfo *bmtInterface, const Substitution *pNewInterfaceSubstChain, MethodTable *pNewInterface, WORD flags) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END // We expand the tree of inherited interfaces into a set by adding the // current node BEFORE expanding the parents of the current node. // ****** This must be consistent with ExpandExactInterface ******* // ****** This must be consistent with BuildInteropVTable_ExpandApproxInterface ******* // The interface list contains the fully expanded set of interfaces from the parent then // we start adding all the interfaces we declare. We need to know which interfaces // we declare but do not need duplicates of the ones we declare. This means we can // duplicate our parent entries. // Is it already present in the list? for (DWORD i = 0; i < bmtInterface->dwInterfaceMapSize; i++) { if (MetaSig::CompareTypeDefsUnderSubstitutions(bmtInterface->pInterfaceMap[i].m_pMethodTable, pNewInterface, bmtInterface->ppInterfaceSubstitutionChains[i], pNewInterfaceSubstChain)) { bmtInterface->pInterfaceMap[i].m_wFlags |= flags; return; // found it, don't add it again } } if (pNewInterface->GetNumVirtuals() > bmtInterface->dwLargestInterfaceSize) bmtInterface->dwLargestInterfaceSize = pNewInterface->GetNumVirtuals(); DWORD n = bmtInterface->dwInterfaceMapSize; // Add it and each sub-interface // Save a copy of ths substitution chain for use later in loading and for subsequent comparisons bmtInterface->pInterfaceMap[n].m_pMethodTable = pNewInterface; bmtInterface->pInterfaceMap[n].SetInteropStartSlot(MethodTable::NO_SLOT); bmtInterface->pInterfaceMap[n].m_wFlags = flags; bmtInterface->ppInterfaceSubstitutionChains[n] = (Substitution *) GetThread()->m_MarshalAlloc.Alloc(sizeof(Substitution) * pNewInterfaceSubstChain->GetLength()); pNewInterfaceSubstChain->CopyToArray(bmtInterface->ppInterfaceSubstitutionChains[n]); bmtInterface->dwInterfaceMapSize++; ExpandApproxDeclaredInterfaces(bmtInterface, pNewInterface->GetModule(), pNewInterface->GetCl(), pNewInterfaceSubstChain, flags & ~InterfaceInfo_t::interface_declared_on_class); } //******************************************************************************* /* static */ void MethodTableBuilder::ExpandApproxDeclaredInterfaces(bmtInterfaceInfo *bmtInterface, Module *pModule, mdToken typeDef, const Substitution *pSubstChain, WORD flags) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END InterfaceImplEnum ie(pModule, typeDef, pSubstChain); while (ie.Next()) { MethodTable *pGenericIntf = ClassLoader::LoadApproxTypeThrowing(pModule, ie.CurrentToken(), NULL, NULL).GetMethodTable(); CONSISTENCY_CHECK(pGenericIntf->IsInterface()); ExpandApproxInterface(bmtInterface, ie.CurrentSubst(), pGenericIntf, flags); } } //******************************************************************************* /* static */ void MethodTableBuilder::ExpandApproxInherited(bmtInterfaceInfo *bmtInterface, MethodTable *pApproxMT, const Substitution *pSubstChain) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END // Expand interfaces in superclasses first. Interfaces inherited from parents // must have identical indexes as in the parent. MethodTable *pParentOfParent = pApproxMT->GetParentMethodTable(); if (pParentOfParent) { Substitution parentSubst = pApproxMT->GetClass()->GetSubstitutionForParent(pSubstChain); ExpandApproxInherited(bmtInterface,pParentOfParent,&parentSubst); } ExpandApproxDeclaredInterfaces(bmtInterface, pApproxMT->GetModule(),pApproxMT->GetCl(), pSubstChain,InterfaceInfo_t::interface_implemented_on_parent); } //******************************************************************************* // // Fill out a fully expanded interface map, such that if we are declared to implement I3, and I3 extends I1,I2, // then I1,I2 are added to our list if they are not already present. // void MethodTableBuilder::LoadApproxInterfaceMap(BuildingInterfaceInfo_t *pBuildingInterfaceList, MethodTable *pApproxParentMT) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END bmtInterface->dwInterfaceMapSize = 0; // First inherit all the parent's interfaces. This is important, because our interface map must // list the interfaces in identical order to our parent. // // <NICE> we should document the reasons why. One reason is that DispatchMapTypeIDs can be indexes // into the list </NICE> if (pApproxParentMT) { Substitution parentSubst = GetHalfBakedClass()->GetSubstitutionForParent(NULL); MethodTableBuilder::ExpandApproxInherited(bmtInterface, pApproxParentMT, &parentSubst); } // Now add in any freshly declared interfaces, possibly augmenting the flags MethodTableBuilder::ExpandApproxDeclaredInterfaces(bmtInterface, GetModule(), GetCl(), NULL, InterfaceInfo_t::interface_declared_on_class); } //******************************************************************************* DispatchMapTypeID MethodTableBuilder::ComputeDispatchMapTypeID(MethodTable *pDeclInftMT, const Substitution *pDeclIntfSubst) { WRAPPER_CONTRACT; if (!pDeclInftMT->IsInterface()) { return DispatchMapTypeID::ThisClassID(); } else { for (DWORD idx = 0; idx < bmtInterface->dwInterfaceMapSize; idx++) { if (MetaSig::CompareTypeDefsUnderSubstitutions(bmtInterface->pInterfaceMap[idx].m_pMethodTable, pDeclInftMT, bmtInterface->ppInterfaceSubstitutionChains[idx], pDeclIntfSubst)) { return DispatchMapTypeID::InterfaceClassID(idx); } } return DispatchMapTypeID::InterfaceNotImplementedID(); } } //******************************************************************************* DispatchMapTypeID MethodTable::ComputeDispatchMapTypeID(MethodTable *pExactIntfMT, MethodTable *pExactImplMT) { CONTRACTL { THROWS; GC_TRIGGERS; PRECONDITION(CheckPointer(pExactIntfMT)); PRECONDITION(CheckPointer(pExactImplMT)); } CONTRACTL_END; if (!pExactIntfMT->IsInterface()) { return DispatchMapTypeID::ThisClassID(); } else { InterfaceMapIterator it = pExactImplMT->IterateInterfaceMap(); while (it.Next()) { if (g_pConfig->ExactInterfaceCalls()) { if (it.InterfaceEquals(pExactIntfMT)) { return DispatchMapTypeID::InterfaceClassID(it.GetIndex()); } } else { if (it.GetInterface()->GetCanonicalMethodTable() == pExactIntfMT->GetCanonicalMethodTable()) { return DispatchMapTypeID::InterfaceClassID(it.GetIndex()); } } } return DispatchMapTypeID::InterfaceNotImplementedID(); } } //******************************************************************************* /*static*/ VOID DECLSPEC_NORETURN MethodTableBuilder::BuildMethodTableThrowException(HRESULT hr, const bmtErrorInfo & bmtError) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END LPCUTF8 pszClassName, pszNameSpace; bmtError.pModule->GetMDImport()->GetNameOfTypeDef(bmtError.cl, &pszClassName, &pszNameSpace); if ((! bmtError.dMethodDefInError || bmtError.dMethodDefInError == mdMethodDefNil) && bmtError.szMethodNameForError == NULL) { if (hr == E_OUTOFMEMORY) COMPlusThrowOM(); else bmtError.pModule->GetAssembly()->ThrowTypeLoadException(pszNameSpace, pszClassName, bmtError.resIDWhy); } else { LPCUTF8 szMethodName; if(bmtError.szMethodNameForError == NULL) szMethodName = (bmtError.pModule->GetMDImport())->GetNameOfMethodDef(bmtError.dMethodDefInError); else szMethodName = bmtError.szMethodNameForError; bmtError.pModule->GetAssembly()->ThrowTypeLoadException(pszNameSpace, pszClassName, szMethodName, bmtError.resIDWhy); } } //******************************************************************************* void MethodTableBuilder::SetBMTData( BaseDomain *bmtDomain, bmtErrorInfo *bmtError, bmtProperties *bmtProp, bmtVtable *bmtVT, bmtParentInfo *bmtParent, bmtInterfaceInfo *bmtInterface, bmtMetaDataInfo *bmtMetaData, bmtMethAndFieldDescs *bmtMFDescs, bmtFieldPlacement *bmtFP, bmtInternalInfo *bmtInternal, bmtGCSeriesInfo *bmtGCSeries, bmtMethodImplInfo *bmtMethodImpl, const bmtGenericsInfo *bmtGenerics, bmtEnumMethAndFields *bmtEnumMF, bmtThreadContextStaticInfo *bmtTCSInfo) { LEAF_CONTRACT; this->bmtDomain = bmtDomain; this->bmtError = bmtError; this->bmtProp = bmtProp; this->bmtVT = bmtVT; this->bmtParent = bmtParent; this->bmtInterface = bmtInterface; this->bmtMetaData = bmtMetaData; this->bmtMFDescs = bmtMFDescs; this->bmtFP = bmtFP; this->bmtInternal = bmtInternal; this->bmtGCSeries = bmtGCSeries; this->bmtMethodImpl = bmtMethodImpl; this->bmtGenerics = bmtGenerics; this->bmtEnumMF = bmtEnumMF; this->bmtTCSInfo = bmtTCSInfo; } //******************************************************************************* void MethodTableBuilder::NullBMTData() { LEAF_CONTRACT; this->bmtDomain = NULL; this->bmtError = NULL; this->bmtProp = NULL; this->bmtVT = NULL; this->bmtParent = NULL; this->bmtInterface = NULL; this->bmtMetaData = NULL; this->bmtMFDescs = NULL; this->bmtFP = NULL; this->bmtInternal = NULL; this->bmtGCSeries = NULL; this->bmtMethodImpl = NULL; this->bmtGenerics = NULL; this->bmtEnumMF = NULL; this->bmtTCSInfo = NULL; } //******************************************************************************* // // Builds the method table, allocates MethodDesc, handles overloaded members, attempts to compress // interface storage. All dependent classes must already be resolved! // VOID MethodTableBuilder::BuildMethodTableThrowing(BaseDomain *bmtDomain, Module *pLoaderModule, Module *pModule, mdToken cl, BuildingInterfaceInfo_t *pBuildingInterfaceList, const LayoutRawFieldInfo *pLayoutRawFieldInfos, MethodTable *pParentMethodTable, const bmtGenericsInfo *bmtGenericsInfo, PCCOR_SIGNATURE parentInst, WORD wNumInterfaces, AllocMemTracker *pamTracker) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(GetHalfBakedClass())); PRECONDITION(CheckPointer(bmtGenericsInfo)); } CONTRACTL_END; // pThread is only used in certain scenarios. Avoid Rotor unused var error Thread *pThread = GetThread(); pModule->EnsureLibraryLoaded(); // The following structs, defined as private members of MethodTableBuilder, contain the necessary local // parameters needed for BuildMethodTable // Look at the struct definitions for a detailed list of all parameters available // to BuildMethodTable. bmtErrorInfo bmtError; bmtProperties bmtProp; bmtVtable bmtVT; bmtParentInfo bmtParent; bmtInterfaceInfo bmtInterface; bmtMetaDataInfo bmtMetaData; bmtMethAndFieldDescs bmtMFDescs; bmtFieldPlacement bmtFP; bmtInternalInfo bmtInternal; bmtGCSeriesInfo bmtGCSeries; bmtMethodImplInfo bmtMethodImpl; bmtThreadContextStaticInfo bmtTCSInfo; this->bmtGenerics = bmtGenericsInfo; //Initialize structs bmtProp.fMarshaledByRef = false; bmtError.resIDWhy = IDS_CLASSLOAD_GENERAL; // Set the reason and the offending method def. If the method information bmtError.pThrowable = NULL; bmtError.pModule = pModule; bmtError.cl = GetCl(); bmtInterface.dwInterfaceMapSize = wNumInterfaces; bmtInternal.pInternalImport = pModule->GetMDImport(); bmtInternal.pModule = pModule; bmtInternal.cl = GetCl(); bmtEnumMethAndFields bmtEnumMF(bmtInternal.pInternalImport); bmtParent.parentSubst = Substitution(pModule,parentInst,NULL); DWORD dwAttrClass; bmtInternal.pInternalImport->GetTypeDefProps( bmtInternal.cl, &dwAttrClass, &(bmtParent.token) ); SetBMTData( bmtDomain, &bmtError, &bmtProp, &bmtVT, &bmtParent, &bmtInterface, &bmtMetaData, &bmtMFDescs, &bmtFP, &bmtInternal, &bmtGCSeries, &bmtMethodImpl, bmtGenericsInfo, &bmtEnumMF, &bmtTCSInfo); // put the interior stack probe after all the stack-allocted goop above. We check compare our this pointer to the SP on // the dtor to determine if we are being called on an EH path or not. INTERIOR_STACK_PROBE_FOR(pThread, 8); // If not NULL, it means there are some by-value fields, and this contains an entry for each instance or static field, // which is NULL if not a by value field, and points to the EEClass of the field if a by value field. Instance fields // come first, statics come second. NewArrayHolder<EEClass*>pByValueClassCache(NULL); // If not NULL, it means there are some by-value fields, and this contains an entry for each inst #ifdef _DEBUG LPCUTF8 className; LPCUTF8 nameSpace; bmtInternal.pInternalImport->GetNameOfTypeDef(bmtInternal.cl, &className, &nameSpace); unsigned fileNameSize = 0; LPCWSTR fileName = NULL; // Personal choice: I do not want to see the full filename in every class name // (i.e. System.IO.TextWriter[E:\WINDOWS\Microsoft.NET\Framework\v1.2.AMD64dbg\mscorlib.dll] ) if (pModule->IsPEFile()) { fileName = pModule->GetFile()->GetDebugName(); if (fileName != 0) fileNameSize = (unsigned int) wcslen(fileName) + 2; } { size_t len = sizeof(char)*(strlen(className) + strlen(nameSpace) + fileNameSize + 2); char *name = (char*) pamTracker->Track(bmtDomain->GetHighFrequencyHeap()->AllocMem(len)); strcpy_s(name, len, nameSpace); if (strlen(nameSpace) > 0) { name[strlen(nameSpace)] = '.'; name[strlen(nameSpace) + 1] = '\0'; } strcat_s(name, len, className); if (fileNameSize != 0 && g_pConfig->ShouldAppendFileNameToTypeName()) { char* ptr = name + strlen(name); *ptr++ = '['; while(*fileName != 0) *ptr++ = char(*fileName++); *ptr++ = ']'; *ptr++ = 0; } GetHalfBakedClass()->SetDebugClassName(name); } if (g_pConfig->ShouldBreakOnClassBuild(className)) { _ASSERTE(!"BreakOnClassBuild"); GetHalfBakedClass()->m_fDebuggingClass = TRUE; } #endif // _DEBUG DWORD i; #ifdef _DEBUG LPCUTF8 pszDebugName,pszDebugNamespace; pModule->GetMDImport()->GetNameOfTypeDef(bmtInternal.cl, &pszDebugName, &pszDebugNamespace); #endif // _DEBUG #ifdef _DEBUG if (bmtGenerics->HasInstantiation()) { StackSString debugName(SString::Utf8, GetDebugClassName()); TypeString::AppendInst(debugName, bmtGenerics->GetNumGenericArgs(), bmtGenerics->GetInstantiation(), TypeString::FormatBasic); StackScratchBuffer buff; const char* pDebugNameUTF8 = debugName.GetUTF8(buff); size_t len = strlen(pDebugNameUTF8)+1; char *name = (char*) pamTracker->Track(bmtDomain->GetLowFrequencyHeap()->AllocMem(len)); strcpy_s(name, len, pDebugNameUTF8); GetHalfBakedClass()->SetDebugClassName(name); } #endif // _DEBUG // If this is mscorlib, then don't perform some sanity checks on the layout bmtProp.fNoSanityChecks = ((g_pObjectClass != NULL) && pModule == g_pObjectClass->GetModule()); #ifdef _DEBUG StackSString debugName(SString::Utf8, pszDebugName); if (bmtGenerics->HasInstantiation()) { TypeString::AppendInst(debugName, bmtGenerics->GetNumGenericArgs(), bmtGenerics->GetInstantiation(), TypeString::FormatBasic); } LOG((LF_CLASSLOADER, LL_INFO1000, "Loading class \"%s%s%S\" from module \"%ws\" in domain 0x%x %s\n", *pszDebugNamespace ? pszDebugNamespace : "", *pszDebugNamespace ? NAMESPACE_SEPARATOR_STR : "", debugName.GetUnicode(), pModule->GetDebugName(), pModule->GetDomain(), (pModule->IsSystem()) ? "System Domain" : "" )); #endif // _DEBUG // Interfaces have a parent class of Object, but we don't really want to inherit all of // Object's virtual methods, so pretend we don't have a parent class - at the bottom of this // function we reset the parent class if (IsInterface()) { pParentMethodTable = NULL; } unsigned totalDeclaredFieldSize=0; bmtParent.pParentMethodTable = pParentMethodTable; // Check to see if the class is an valuetype if(pParentMethodTable != NULL && ((g_pEnumClass != NULL && pParentMethodTable == g_pValueTypeClass) || pParentMethodTable == g_pEnumClass)) { SetValueClass(); HRESULT hr = bmtInternal.pInternalImport->GetCustomAttributeByName(bmtInternal.cl, g_CompilerServicesUnsafeValueTypeAttribute, NULL, NULL); IfFailThrow(hr); if (hr == S_OK) { SetUnsafeValueClass(); } } // Check to see if the class is an enumeration if(pParentMethodTable != NULL && pParentMethodTable == g_pEnumClass) { SetEnum(); // Ensure we don't have generic enums, or at least enums that have a // different number of type parameters from their enclosing class. // The goal is to ensure that the enum's values can't depend on the // type parameters in any way. And we don't see any need for an // enum to have additional type parameters. if (bmtGenerics->GetNumGenericArgs() != 0) { // Nested enums can have generic type parameters from their enclosing class. // CLS rules require type parameters to be propogated to nested types. // Note that class G<T> { enum E { } } will produce "G`1+E<T>". // We want to disallow class G<T> { enum E<T, U> { } } // Perhaps the IL equivalent of class G<T> { enum E { } } should be legal. if (!IsNested()) BuildMethodTableThrowException(IDS_CLASSLOAD_ENUM_EXTRA_GENERIC_TYPE_PARAM); bool fWrongNumberOfTypeParams = false; mdTypeDef tdEnclosing = mdTypeDefNil; HRESULT hr = bmtInternal.pInternalImport->GetNestedClassProps(GetCl(), &tdEnclosing); if (FAILED(hr)) ThrowHR(hr, BFA_UNABLE_TO_GET_NESTED_PROPS); HENUMInternal hEnumGenericPars; if (FAILED(bmtInternal.pInternalImport->EnumInit(mdtGenericParam, tdEnclosing, &hEnumGenericPars))) GetAssembly()->ThrowTypeLoadException(bmtInternal.pInternalImport, tdEnclosing, IDS_CLASSLOAD_BADFORMAT); // Iterate past end of generic type params for (unsigned j = 0; j < bmtGenerics->GetNumGenericArgs() + 1; j++) { mdGenericParam tkTyPar = mdGenericParamNil; bmtInternal.pInternalImport->EnumNext(&hEnumGenericPars, &tkTyPar); // Check if we got back null? if (IsNilToken(tkTyPar)) { fWrongNumberOfTypeParams = (j < bmtGenerics->GetNumGenericArgs()); break; } /* else if (j == bmtGenerics->GetNumGenericArgs()) { fWrongNumberOfTypeParams = true; } */ } bmtInternal.pInternalImport->EnumClose(&hEnumGenericPars); if (fWrongNumberOfTypeParams) BuildMethodTableThrowException(IDS_CLASSLOAD_ENUM_EXTRA_GENERIC_TYPE_PARAM); } } bmtParent.pParentMethodTable = pParentMethodTable; if (bmtParent.pParentMethodTable) { } else if (! (IsInterface() ) ) { if(g_pObjectClass != NULL) { if(g_pObjectClass->GetAssembly()->GetManifestFile()->Equals(GetAssembly()->GetManifestFile()) && !IsGlobalClass()) { BuildMethodTableThrowException(IDS_CLASSLOAD_PARENTNULL); } } } // Set the contextful or marshalbyref flag if necessary SetContextfulOrByRef(); // NOTE: This appears to be the earliest point during class loading that other classes MUST be loaded // resolve unresolved interfaces, determine an upper bound on the size of the interface map, // and determine the size of the largest interface (in # slots) ResolveInterfaces(pBuildingInterfaceList); // Compute parent class and interface module dependencies ComputeModuleDependencies(); // Enumerate this class's members EnumerateMethodImpls(); // Enumerate this class's members EnumerateClassMembers(); // This will allocate the working versions of the VTable and NonVTable in bmtVT AllocateWorkingSlotTables(); // Allocate a MethodDesc* for each method (needed later when doing interfaces), and a FieldDesc* for each field AllocateMethodFieldDescs(pamTracker); // Go thru all fields and initialize their FieldDescs. InitializeFieldDescs(bmtDomain, GetApproxFieldDescListRaw(), pLayoutRawFieldInfos, &bmtInternal, bmtGenerics, &bmtMetaData, &bmtEnumMF, &bmtError, &pByValueClassCache, &bmtMFDescs, &bmtFP, &bmtTCSInfo, &totalDeclaredFieldSize, &bmtParent); void *pv = pThread->m_MarshalAlloc.Alloc(sizeof(DispatchMapBuilder)); bmtVT.pDispatchMapBuilder = new (pv) DispatchMapBuilder(&pThread->m_MarshalAlloc); // Determine vtable placement for each member in this class PlaceMembers((DWORD) wNumInterfaces, pBuildingInterfaceList, pamTracker); // // If we are a class, then there may be some unplaced vtable methods (which are by definition // interface methods, otherwise they'd already have been placed). Place as many unplaced methods // as possible, in the order preferred by interfaces. However, do not allow any duplicates - once // a method has been placed, it cannot be placed again - if we are unable to neatly place an interface, // create duplicate slots for it starting at dwCurrentDuplicateVtableSlot. Fill out the interface // map for all interfaces as they are placed. // // If we are an interface, then all methods are already placed. Fill out the interface map for // interfaces as they are placed. // if (!IsInterface()) { PlaceVtableMethods((DWORD) wNumInterfaces, pBuildingInterfaceList); PlaceMethodImpls(pamTracker); // Now that interface method implementation have been fully resolved, // we need to make sure that type constraints are also met. ValidateInterfaceMethodConstraints(); } // If we're a value class, we want to create duplicate slots // and MethodDescs for all methods in the vtable // section (i.e. not non-virtual instance methods or statics). // // This does not do non-virtual instance methods, which means // we have no BoxedEntryPointStubs available for these in the methodtable. // These are stored in the AssociatedMethodHash (see FindOrCreateAssociatedMethod). // // if (!bmtProp.fContainsGenericVariables) ChangeValueClassVirtualsToBoxedEntryPointsAndCreateUnboxedEntryPoints(pamTracker); // Verify that we have not overflowed the number of slots. if (!FitsInU2((UINT64)bmtVT.dwCurrentVtableSlot + (UINT64)bmtVT.dwCurrentNonVtableSlot)) { BuildMethodTableThrowException(IDS_CLASSLOAD_TOO_MANY_METHODS); } // Place all non vtable methods for (i = 0; i < bmtVT.dwCurrentNonVtableSlot; i++) { MethodDesc *pMD = bmtVT.pNonVtableMD[i]; _ASSERTE(pMD->GetSlot() == i); pMD->SetSlot(pMD->GetSlot() + (WORD) bmtVT.dwCurrentVtableSlot); bmtVT.SetMethodDescForSlot(pMD->GetSlot(), pMD); } if (bmtVT.wDefaultCtorSlot != MethodTable::NO_SLOT) bmtVT.wDefaultCtorSlot += (WORD) bmtVT.dwCurrentVtableSlot; if (bmtVT.wCCtorSlot != MethodTable::NO_SLOT) bmtVT.wCCtorSlot += (WORD) bmtVT.dwCurrentVtableSlot; bmtVT.dwCurrentNonVtableSlot += bmtVT.dwCurrentVtableSlot; // ensure we didn't overflow the temporary vtable _ASSERTE(bmtVT.dwCurrentNonVtableSlot <= bmtVT.dwMaxVtableSize); // Allocate dictionary layout used by all compatible instantiations GetHalfBakedClass()->m_pDictLayout = NULL; if (IsSharedByGenericInstantiations() && !bmtGenerics->fContainsGenericVariables) { // We use the number of methods as a heuristic for the number of slots in the dictionary // attached to shared class method tables. // If there are no declared methods then we have no slots, and we will never do any token lookups // // Heuristics // - Classes with a small number of methods (2-3) tend to be more likely to use new slots, // i.e. further methods tend to reuse slots from previous methods. // = treat all classes with only 2-3 methods as if they have an extra method. // - Classes with more generic parameters tend to use more slots. // = multiply by 1.5 for 2 params or more DWORD numMethodsAdjusted = (bmtEnumMF.dwNumDeclaredNonAbstractMethods == 0) ? 0 : (bmtEnumMF.dwNumDeclaredNonAbstractMethods < 3) ? 3 : bmtEnumMF.dwNumDeclaredNonAbstractMethods; _ASSERTE(bmtGenerics->GetNumGenericArgs() != 0); DWORD nTypeFactorBy2 = (bmtGenerics->GetNumGenericArgs() == 1) ? 2 : 3; DWORD estNumTypeSlots = (numMethodsAdjusted * nTypeFactorBy2 + 2) / 3; DWORD numTypeSlots = estNumTypeSlots; if (numTypeSlots > 0) GetHalfBakedClass()->m_pDictLayout = DictionaryLayout::Allocate(numTypeSlots, bmtDomain); } // We decide here if we need a dynamic entry for our statics. We need it here because // the offsets of our fields will depend on this. For the dynamic case (which requires // an extra indirection (indirect depending of methodtable) we'll allocate the slot // in setupmethodtable if (((pModule->IsReflection() || bmtGenerics->HasInstantiation()) && (bmtVT.wCCtorSlot != MethodTable::NO_SLOT || bmtEnumMF.dwNumStaticFields !=0)) ) { // We will need a dynamic id bmtProp.fDynamicStatics = TRUE; if (bmtGenerics->HasInstantiation()) { bmtProp.fGenericsStatics = TRUE; } } else { SetModuleDynamicID(MODULE_NON_DYNAMIC_STATICS); } // Place static fields PlaceStaticFields(); #if _DEBUG if (GetNumStaticFields() > 0) { LOG((LF_CODESHARING, LL_INFO10000, "Placing %d %sshared statics (%d handles) for class %s.\n", GetNumStaticFields(), pModule->IsCompiledDomainNeutral() ? "" : "un", GetNumHandleStatics(), pszDebugName)); } #endif // _DEBUG //#define NumStaticFieldsOfSize $$$$$ //#define StaticFieldStart $$$$$ if (IsBlittable()) { SetNumGCPointerSeries(0); bmtFP.NumInstanceGCPointerFields = 0; _ASSERTE(HasLayout()); SetNumInstanceFieldBytes(((LayoutEEClass*)GetHalfBakedClass())->GetLayoutInfo()->m_cbNativeSize); } else if (IsManagedSequential()) { SetNumGCPointerSeries(0); bmtFP.NumInstanceGCPointerFields = 0; _ASSERTE(HasLayout()); SetNumInstanceFieldBytes(((LayoutEEClass*)GetHalfBakedClass())->GetLayoutInfo()->m_cbManagedSize); } else { _ASSERTE(!IsBlittable()); // HandleExplicitLayout fails for the GenericTypeDefinition when // it will succeed for some particular instantiations. // Thus we only do explicit layout for real instantiations, e.g. C<int>, not // the open types such as the GenericTypeDefinition C<!0> or any // of the "fake" types involving generic type variables which are // used for reflection and verification, e.g. C<List<!0>>. if (!bmtGenerics->fContainsGenericVariables && HasExplicitFieldOffsetLayout()) { HandleExplicitLayout(pByValueClassCache); } else { // Place instance fields PlaceInstanceFields(pByValueClassCache); } } // We enforce that all value classes have non-zero size if (IsValueClass() && GetNumInstanceFieldBytes() == 0) { BuildMethodTableThrowException(IDS_CLASSLOAD_ZEROSIZE); } // If the class is serializable we scan it for VTS (Version Tolerant // Serialization) event methods or NotSerialized or OptionalField // fields. Any such info found will be attached to the method as // optional data later. if (IsTdSerializable(GetAttrClass())) ScanTypeForVtsInfo(); // Now setup the method table SetupMethodTable2(pamTracker, pLoaderModule); MethodTable *pMT = GetHalfBakedMethodTable(); if (bmtGenerics->pVarianceInfo != NULL) { pMT->SetHasVariance(); } if (bmtFP.fHasFixedAddressValueTypes) { // To make things simpler, if the class has any field with this requirement, we'll set // all the statics to have this property. This allows us to only need to persist one bit // for the ngen case. pMT->SetFixedAddressStaticVTs(); } if (IsValueClass() && (GetNumInstanceFieldBytes() != totalDeclaredFieldSize || HasOverLayedField())) { pMT->SetNotTightlyPacked(); } #ifdef _DEBUG pMT->SetDebugClassName(GetDebugClassName()); #endif // _DEBUG if (HasExplicitFieldOffsetLayout()) // Perform relevant GC calculations for tdexplicit HandleGCForExplicitLayout(); else // Perform relevant GC calculations for value classes HandleGCForValueClasses(pByValueClassCache); if (pMT->ContainsPointers()) { CGCDesc* gcDesc = CGCDesc::GetCGCDescFromMT(pMT); qsort(gcDesc->GetLowestSeries(), (int)gcDesc->GetNumSeries(), sizeof(CGCDescSeries), compareCGCDescSeries); } if (MethodTable::ComputeIsPreInit(bmtGenerics->fContainsGenericVariables, pMT->HasClassConstructor(), (bmtFP.NumStaticGCBoxedFields > 0), bmtProp.fDynamicStatics)) { // Mark the class as needing no static initialization, i.e. we've done all necessary // initialization at load time. pMT->SetClassPreInited(); } pMT->MaybeSetHasFinalizer(); #if CHECK_APP_DOMAIN_LEAKS // Figure out if we're domain agile.. // Note that this checks a bunch of field directly on the class & method table, // so it needs to come late in the game. SetAppDomainAgileAttribute(); #endif // CHECK_APP_DOMAIN_LEAKS // Allocate dynamic slot if necessary if (bmtProp.fDynamicStatics) { if (bmtProp.fGenericsStatics) { FieldDesc* pStaticFieldDescs = NULL; if (GetNumStaticFields() != 0) { pStaticFieldDescs = pMT->GetApproxFieldDescListRaw() + pMT->GetNumIntroducedInstanceFields(); } pMT->SetupGenericsStaticsInfo(pStaticFieldDescs); } else { // Get an id for the dynamic class. We store it in the class because // no class that is persisted in ngen should have it (ie, if the class is ngened SetModuleDynamicID(GetModule()->AllocateDynamicEntry(pMT)); } } // // if there are context or thread static set the info in the method table optional members // if (bmtTCSInfo.dwThreadStaticsSize != 0 || bmtTCSInfo.dwContextStaticsSize != 0) { if ((bmtTCSInfo.dwThreadStaticsSize != (WORD)bmtTCSInfo.dwThreadStaticsSize) || (bmtTCSInfo.dwContextStaticsSize != (WORD)bmtTCSInfo.dwContextStaticsSize)) { BuildMethodTableThrowException(IDS_EE_TOOMANYFIELDS); } // this is responsible for setting the flag and allocation in the loader heap pMT->SetupThreadOrContextStatics(pamTracker, (WORD)bmtTCSInfo.dwThreadStaticsSize, (WORD)bmtTCSInfo.dwContextStaticsSize); } // If we have a non-interface class, then do inheritance security // checks on it. The check starts by checking for inheritance // permission demands on the current class. If these first checks // succeeded, then the cached declared method list is scanned for // methods that have inheritance permission demands. VerifyInheritanceSecurity(); // Check for the RemotingProxy Attribute if (IsContextful()) { _ASSERTE(g_pObjectClass); // Skip mscorlib marshal-by-ref classes since they all // are assumed to have the default proxy attribute if (!(pModule == g_pObjectClass->GetModule())) { CheckForRemotingProxyAttrib(); } } if (IsContextful() || HasRemotingProxyAttribute()) { // Contextful and classes that have a remoting proxy attribute // (whether they are MarshalByRef or ContextFul) always take the slow // path of managed activation pMT->SetRequiresManagedActivation(); } // structs with GC poitners MUST be pointer sized aligned because the GC assumes it if (IsValueClass() && pMT->ContainsPointers() && GetNumInstanceFieldBytes() % sizeof(void*) != 0) { BuildMethodTableThrowException(IDS_CLASSLOAD_BADFORMAT); } if (IsInterface()) { // Reset parent class pMT->SetParentMethodTable (g_pObjectClass); } #ifdef _DEBUG // Reset the debug method names for BoxedEntryPointStubs // so they reflect the very best debug information for the methods { DeclaredMethodIterator methIt(*this); while (methIt.Next()) { if (methIt.GetUnboxedMethodDesc() != NULL) { { MethodDesc *pMD = methIt.GetUnboxedMethodDesc(); StackSString name(SString::Utf8); TypeString::AppendMethodDebug(name, pMD); StackScratchBuffer buff; const char* pDebugNameUTF8 = name.GetUTF8(buff); size_t len = strlen(pDebugNameUTF8)+1; pMD->m_pszDebugMethodName = (char*) pamTracker->Track(GetDomain()->GetLowFrequencyHeap()->AllocMem(len)); _ASSERTE(pMD->m_pszDebugMethodName); strcpy_s((char *) pMD->m_pszDebugMethodName, len, pDebugNameUTF8); } { MethodDesc *pMD = methIt.GetMethodDesc(); StackSString name(SString::Utf8); TypeString::AppendMethodDebug(name, pMD); StackScratchBuffer buff; const char* pDebugNameUTF8 = name.GetUTF8(buff); size_t len = strlen(pDebugNameUTF8)+1; pMD->m_pszDebugMethodName = (char*) pamTracker->Track(GetDomain()->GetLowFrequencyHeap()->AllocMem(len)); _ASSERTE(pMD->m_pszDebugMethodName); strcpy_s((char *) pMD->m_pszDebugMethodName, len, pDebugNameUTF8); } } } } #endif // _DEBUG // Make sure the object cloner won't attempt to blit types that aren't serializable. if (!IsTdSerializable(GetAttrClass()) && !IsEnum()) SetCannotBeBlittedByObjectCloner(); //If this is a value type, then propagate the UnsafeValueTypeAttribute from //its instance members to this type. if (IsValueClass() && !IsUnsafeValueClass()) { ApproxFieldDescIterator fields(GetHalfBakedMethodTable(), ApproxFieldDescIterator::INSTANCE_FIELDS, FALSE); FieldDesc * current; while (NULL != (current = fields.Next())) { CONSISTENCY_CHECK(!current->IsStatic()); if (current->GetFieldType() == ELEMENT_TYPE_VALUETYPE) { TypeHandle th = current->LookupApproxFieldTypeHandle(); CONSISTENCY_CHECK(!th.IsNull()); if (th.AsMethodTable()->GetClass()->IsUnsafeValueClass()) { SetUnsafeValueClass(); break; } } } } // Grow the typedef ridmap in advance as we can't afford to // fail once we set the resolve bit pModule->EnsureTypeDefCanBeStored(bmtInternal.cl); // Grow the tables in advance so that RID map filling cannot fail // once we're past the commit point. EnsureRIDMapsCanBeFilled(); { // NOTE. NOTE!! the EEclass can now be accessed by other threads. // Do NOT place any initialization after this point. // You may NOT fail the call after this point. FAULT_FORBID(); CANNOTTHROWCOMPLUSEXCEPTION(); /* pamTracker->SuppressRelease(); */ } #ifdef _DEBUG if (g_pConfig->ShouldDumpOnClassLoad(pszDebugName)) { LOG((LF_CLASSLOADER, LL_ALWAYS, "Method table summary for '%s':\n", pszDebugName)); LOG((LF_CLASSLOADER, LL_ALWAYS, "Number of static fields: %d\n", bmtEnumMF.dwNumStaticFields)); LOG((LF_CLASSLOADER, LL_ALWAYS, "Number of instance fields: %d\n", bmtEnumMF.dwNumInstanceFields)); LOG((LF_CLASSLOADER, LL_ALWAYS, "Number of static obj ref fields: %d\n", bmtEnumMF.dwNumStaticObjRefFields)); LOG((LF_CLASSLOADER, LL_ALWAYS, "Number of static boxed fields: %d\n", bmtEnumMF.dwNumStaticBoxedFields)); LOG((LF_CLASSLOADER, LL_ALWAYS, "Number of declared fields: %d\n", NumDeclaredFields())); LOG((LF_CLASSLOADER, LL_ALWAYS, "Number of declared methods: %d\n", NumDeclaredMethods())); LOG((LF_CLASSLOADER, LL_ALWAYS, "Number of declared non-abstract methods: %d\n", bmtEnumMF.dwNumDeclaredNonAbstractMethods)); pMT->DebugDumpVtable(pszDebugName, false); GetHalfBakedClass()->DebugDumpFieldLayout(pszDebugName, false); GetHalfBakedClass()->DebugDumpGCDesc(pszDebugName, false); } #endif // _DEBUG STRESS_LOG3(LF_CLASSLOADER, LL_INFO1000, "MethodTableBuilder: finished method table for module %p token %x = %pT \n", pModule, GetCl(), GetHalfBakedMethodTable()); // Make sure that nobody access what were stack-allocated structures in this method. NullBMTData(); END_INTERIOR_STACK_PROBE; } //******************************************************************************* // Resolve unresolved interfaces, determine an upper bound on the size of the interface map, // and determine the size of the largest interface (in # slots) // VOID MethodTableBuilder::ResolveInterfaces(BuildingInterfaceInfo_t *pBuildingInterfaceList) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM()); PRECONDITION(CheckPointer(this)); PRECONDITION(CheckPointer(bmtDomain)); PRECONDITION(CheckPointer(bmtInterface)); PRECONDITION(CheckPointer(bmtVT)); PRECONDITION(CheckPointer(bmtParent)); } CONTRACTL_END; DWORD i; Thread *pThread = GetThread(); // resolve unresolved interfaces, determine an upper bound on the size of the interface map, // and determine the size of the largest interface (in # slots) bmtInterface->dwMaxExpandedInterfaces = 0; // upper bound on max # interfaces implemented by this class // First look through the interfaces explicitly declared by this class for (i = 0; i < bmtInterface->dwInterfaceMapSize; i++) { MethodTable *pInterface = pBuildingInterfaceList[i].m_pMethodTable; if (IsSerializerRelatedInterface(pInterface)) SetCannotBeBlittedByObjectCloner(); bmtInterface->dwMaxExpandedInterfaces += (1+ pInterface->GetNumInterfaces()); } // Now look at interfaces inherited from the parent if (bmtParent->pParentMethodTable != NULL) { //@GENERICS: for our purposes here we use the generic parent because all its interfaces will be preloaded MethodTable::InterfaceMapIterator it = bmtParent->pParentMethodTable->IterateInterfaceMap(); while (it.Next()) { MethodTable *pMT = it.GetInterface(); bmtInterface->dwMaxExpandedInterfaces += (1+pMT->GetNumInterfaces()); } } bmtInterface->ppInterfaceSubstitutionChains = (Substitution**) pThread->m_MarshalAlloc.Alloc(sizeof(Substitution *) * bmtInterface->dwMaxExpandedInterfaces); // Create a fully expanded map of all interfaces we implement bmtInterface->pInterfaceMap = (InterfaceInfo_t *) pThread->m_MarshalAlloc.Alloc(sizeof(InterfaceInfo_t) * bmtInterface->dwMaxExpandedInterfaces); // # slots of largest interface bmtInterface->dwLargestInterfaceSize = 0; LoadApproxInterfaceMap(pBuildingInterfaceList, bmtParent->pParentMethodTable); _ASSERTE(bmtInterface->dwInterfaceMapSize <= bmtInterface->dwMaxExpandedInterfaces); if (bmtInterface->dwLargestInterfaceSize > 0) { // This is needed later - for each interface, we get the MethodDesc pointer for each // method. We need to be able to persist at most one interface at a time, so we // need enough memory for the largest interface. bmtInterface->ppInterfaceMethodDescList = (MethodDesc**) pThread->m_MarshalAlloc.Alloc(bmtInterface->dwLargestInterfaceSize * sizeof(MethodDesc*)); bmtInterface->ppInterfaceDeclMethodDescList = (MethodDesc**) pThread->m_MarshalAlloc.Alloc(bmtInterface->dwLargestInterfaceSize * sizeof(MethodDesc*)); } MethodTable *pParentClass = (IsInterface() || bmtParent->pParentMethodTable == NULL) ? NULL : bmtParent->pParentMethodTable; // For all the new interfaces we bring in, sum the methods bmtInterface->dwTotalNewInterfaceMethods = 0; if (pParentClass != NULL) { for (i = bmtParent->pParentMethodTable->GetNumInterfaces(); i < (bmtInterface->dwInterfaceMapSize); i++) bmtInterface->dwTotalNewInterfaceMethods += bmtInterface->pInterfaceMap[i].m_pMethodTable->GetNumVirtuals(); } // Inherit parental slot counts if (pParentClass != NULL) { bmtVT->dwCurrentVtableSlot = bmtParent->pParentMethodTable->GetNumVirtuals(); bmtParent->dwNumParentInterfaces = bmtParent->pParentMethodTable->GetNumInterfaces(); bmtParent->NumParentPointerSeries = pParentClass->GetClass()->m_wNumGCPointerSeries; if (pParentClass->HasFieldsWhichMustBeInited()) SetHasFieldsWhichMustBeInited(); if (pParentClass->CannotBeBlittedByObjectCloner()) SetCannotBeBlittedByObjectCloner(); } else { bmtVT->dwCurrentVtableSlot = 0; bmtParent->dwNumParentInterfaces = 0; bmtParent->NumParentPointerSeries = 0; } bmtVT->dwCurrentNonVtableSlot = 0; bmtInterface->pppInterfaceImplementingMD = (MethodDesc ***) pThread->m_MarshalAlloc.Alloc(sizeof(MethodDesc *) * bmtInterface->dwMaxExpandedInterfaces); memset(bmtInterface->pppInterfaceImplementingMD, 0, sizeof(MethodDesc *) * bmtInterface->dwMaxExpandedInterfaces); bmtInterface->pppInterfaceDeclaringMD = (MethodDesc ***) pThread->m_MarshalAlloc.Alloc(sizeof(MethodDesc *) * bmtInterface->dwMaxExpandedInterfaces); memset(bmtInterface->pppInterfaceDeclaringMD, 0, sizeof(MethodDesc *) * bmtInterface->dwMaxExpandedInterfaces); } //******************************************************************************* VOID MethodTableBuilder::ComputeModuleDependencies() { // Add dependencies for parents up the chain MethodTable *pParent = bmtParent->pParentMethodTable; while (pParent != NULL) { Module *pParentModule = pParent->GetModule(); if (pParentModule != bmtInternal->pModule) bmtInternal->pModule->AddClassDependency(pParentModule, &GetHalfBakedClass()->m_classDependencies); pParent = pParent->GetParentMethodTable(); } } //******************************************************************************* /* static */ int __cdecl MethodTableBuilder::bmtMetaDataInfo::MethodImplTokenPair::Compare( const void *elem1, const void *elem2) { STATIC_CONTRACT_LEAF; MethodImplTokenPair *e1 = (MethodImplTokenPair *)elem1; MethodImplTokenPair *e2 = (MethodImplTokenPair *)elem2; if (e1->methodBody < e2->methodBody) return -1; else if (e1->methodBody > e2->methodBody) return 1; else if (e1->methodDecl < e2->methodDecl) return -1; else if (e1->methodDecl > e2->methodDecl) return 1; else return 0; } //******************************************************************************* /* static */ BOOL MethodTableBuilder::bmtMetaDataInfo::MethodImplTokenPair::Equal( const MethodImplTokenPair *elem1, const MethodImplTokenPair *elem2) { STATIC_CONTRACT_LEAF; return ((elem1->methodBody == elem2->methodBody) && (elem1->methodDecl == elem2->methodDecl)); } //******************************************************************************* VOID MethodTableBuilder::EnumerateMethodImpls() { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); MODE_ANY; } CONTRACTL_END HRESULT hr = S_OK; IMDInternalImport *pMDInternalImport = bmtInternal->pInternalImport; DWORD rid, maxRidMD, maxRidMR; hr = pMDInternalImport->EnumMethodImplInit(GetCl(), &(bmtEnumMF->hEnumBody), &(bmtEnumMF->hEnumDecl)); if (FAILED(hr)) { BuildMethodTableThrowException(hr, *bmtError); } // We have successfully opened the enum, make sure to close when we're done. bmtEnumMF->fNeedToCloseEnumMethodImpl = true; // This gets the count out of the metadata interface. bmtEnumMF->dwNumberMethodImpls = pMDInternalImport->EnumMethodImplGetCount(&(bmtEnumMF->hEnumBody), &(bmtEnumMF->hEnumDecl)); // This is the first pass. In this we will simply enumerate the token pairs and fill in // the data structures. In addition, we'll sort the list and eliminate duplicates. if (bmtEnumMF->dwNumberMethodImpls > 0) { // // Allocate the structures to keep track of the token pairs // DWORD cbAllocSize = 0; if (!ClrSafeInt<DWORD>::multiply(bmtEnumMF->dwNumberMethodImpls, sizeof(bmtMetaDataInfo::MethodImplTokenPair), cbAllocSize)) ThrowHR(COR_E_OVERFLOW); bmtMetaData->rgMethodImplTokens = (bmtMetaDataInfo::MethodImplTokenPair *) GetThread()->m_MarshalAlloc.Alloc(cbAllocSize); // Iterate through each MethodImpl declared on this class for (DWORD i = 0; i < bmtEnumMF->dwNumberMethodImpls; i++) { // Grab the next set of body/decl tokens if(!pMDInternalImport->EnumMethodImplNext(&(bmtEnumMF->hEnumBody), &(bmtEnumMF->hEnumDecl), &bmtMetaData->rgMethodImplTokens[i].methodBody, &bmtMetaData->rgMethodImplTokens[i].methodDecl)) { // In the odd case that the enumerator fails before we've reached the total reported // entries, let's reset the count and just break out. (Should we throw?) bmtEnumMF->dwNumberMethodImpls = i; break; } } // No need to do any sorting or duplicate elimination if there's not two or more methodImpls if (bmtEnumMF->dwNumberMethodImpls > 1) { // Now sort qsort(bmtMetaData->rgMethodImplTokens, bmtEnumMF->dwNumberMethodImpls, sizeof(bmtMetaDataInfo::MethodImplTokenPair), &bmtMetaDataInfo::MethodImplTokenPair::Compare); // Now eliminate duplicates for (DWORD i = 0; i < bmtEnumMF->dwNumberMethodImpls - 1; i++) { CONSISTENCY_CHECK((i + 1) < bmtEnumMF->dwNumberMethodImpls); bmtMetaDataInfo::MethodImplTokenPair *e1 = &bmtMetaData->rgMethodImplTokens[i]; bmtMetaDataInfo::MethodImplTokenPair *e2 = &bmtMetaData->rgMethodImplTokens[i + 1]; // If the pair are equal, eliminate the first one, and reduce the total count by one. if (bmtMetaDataInfo::MethodImplTokenPair::Equal(e1, e2)) { DWORD dwCopyNum = bmtEnumMF->dwNumberMethodImpls - (i + 1); memcpy(e1, e2, dwCopyNum * sizeof(bmtMetaDataInfo::MethodImplTokenPair)); bmtEnumMF->dwNumberMethodImpls--; CONSISTENCY_CHECK(bmtEnumMF->dwNumberMethodImpls > 0); } } } } if(bmtEnumMF->dwNumberMethodImpls) { // // Allocate the structures to keep track of the impl matches // bmtMetaData->pMethodDeclSubsts = (Substitution*) GetThread()->m_MarshalAlloc.Alloc( bmtEnumMF->dwNumberMethodImpls * sizeof(Substitution)); bmtMethodImpl->rgEntries = (bmtMethodImplInfo::Entry *) GetThread()->m_MarshalAlloc.Alloc( bmtEnumMF->dwNumberMethodImpls * sizeof(bmtMethodImplInfo::Entry)); // These are used for verification maxRidMD = pMDInternalImport->GetCountWithTokenKind(mdtMethodDef); maxRidMR = pMDInternalImport->GetCountWithTokenKind(mdtMemberRef); // Iterate through each MethodImpl declared on this class for (DWORD i = 0; i < bmtEnumMF->dwNumberMethodImpls; i++) { PCCOR_SIGNATURE pSigDecl=NULL,pSigBody = NULL; ULONG cbSigDecl, cbSigBody; mdToken tkParent; mdToken theBody, theDecl; Substitution theDeclSubst(bmtInternal->pModule, NULL, NULL); // this can get updated later below. theBody = bmtMetaData->rgMethodImplTokens[i].methodBody; theDecl = bmtMetaData->rgMethodImplTokens[i].methodDecl; // IMPLEMENTATION LIMITATION: currently, we require that the body of a methodImpl // belong to the current type. This is because we need to allocate a different // type of MethodDesc for bodies that are part of methodImpls. if (TypeFromToken(theBody) != mdtMethodDef) { Module* pModule; mdToken theNewBody; hr = FindMethodDeclarationForMethodImpl(theBody, &theNewBody, TRUE, &pModule); if (FAILED(hr)) { BuildMethodTableThrowException(hr, IDS_CLASSLOAD_MI_ILLEGAL_BODY, mdMethodDefNil); } _ASSERTE(pModule == bmtInternal->pModule); theBody = theNewBody; // Make sure to update the stored token with the resolved token. bmtMetaData->rgMethodImplTokens[i].methodBody = theBody; } if (TypeFromToken(theBody) != mdtMethodDef) { BuildMethodTableThrowException(BFA_METHODDECL_NOT_A_METHODDEF); } CONSISTENCY_CHECK(theBody == bmtMetaData->rgMethodImplTokens[i].methodBody); // // Now that the tokens of Decl and Body are obtained, do the MD validation // rid = RidFromToken(theDecl); // Perform initial rudimentary validation of the token. Full token verification // will be done in TestMethodImpl when placing the methodImpls. if (TypeFromToken(theDecl) == mdtMethodDef) { // Decl must be valid token if ((rid == 0)||(rid > maxRidMD)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_ILLEGAL_TOKEN_DECL); } // Get signature and length pSigDecl = pMDInternalImport->GetSigOfMethodDef(theDecl,&cbSigDecl); } // The token is not a MethodDef (likely a MemberRef) else { // Decl must be valid token if ((TypeFromToken(theDecl) != mdtMemberRef) || (rid == 0) || (rid > maxRidMR)) { bmtError->resIDWhy = IDS_CLASSLOAD_MI_ILLEGAL_TOKEN_DECL; BuildMethodTableThrowException(IDS_CLASSLOAD_MI_ILLEGAL_TOKEN_DECL); } // Get signature and length LPCSTR szDeclName; szDeclName = pMDInternalImport->GetNameAndSigOfMemberRef(theDecl,&pSigDecl,&cbSigDecl); // Get parent hr = pMDInternalImport->GetParentToken(theDecl,&tkParent); if (FAILED(hr)) BuildMethodTableThrowException(hr, *bmtError); theDeclSubst = Substitution(tkParent, bmtInternal->pModule, NULL); } // Perform initial rudimentary validation of the token. Full token verification // will be done in TestMethodImpl when placing the methodImpls. { // Body must be valid token rid = RidFromToken(theBody); if ((rid == 0)||(rid > maxRidMD)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_ILLEGAL_TOKEN_BODY); } // Body's parent must be this class hr = pMDInternalImport->GetParentToken(theBody,&tkParent); if (FAILED(hr)) BuildMethodTableThrowException(hr, *bmtError); if(tkParent != GetCl()) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_ILLEGAL_BODY); } } // Decl's and Body's signatures must match if(pSigDecl && cbSigDecl) { if((pSigBody = pMDInternalImport->GetSigOfMethodDef(theBody,&cbSigBody)) != NULL && cbSigBody) { // Can't use memcmp because there may be two AssemblyRefs // in this scope, pointing to the same assembly, etc.). if (!MetaSig::CompareMethodSigs(pSigDecl, cbSigDecl, bmtInternal->pModule, &theDeclSubst, pSigBody, cbSigBody, bmtInternal->pModule, NULL)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_BODY_DECL_MISMATCH); } } else { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_MISSING_SIG_BODY); } } else { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_MISSING_SIG_DECL); } bmtMetaData->pMethodDeclSubsts[i] = theDeclSubst; } } } //******************************************************************************* // Retrieve or add the TokenRange node for a particular token and nodelist. /*static*/ MethodTableBuilder::bmtTokenRangeNode *MethodTableBuilder::GetTokenRange(mdToken tok, bmtTokenRangeNode **ppHead) { CONTRACT (MethodTableBuilder::bmtTokenRangeNode *) { THROWS; GC_NOTRIGGER; INJECT_FAULT(COMPlusThrowOM();); POSTCONDITION(CheckPointer(RETVAL)); } CONTRACT_END; BYTE tokrange = ::GetTokenRange(tok); bmtTokenRangeNode *pWalk = *ppHead; while (pWalk) { if (pWalk->tokenHiByte == tokrange) { RETURN pWalk; } pWalk = pWalk->pNext; } // If we got here, this is the first time we've seen this token range. bmtTokenRangeNode *pNewNode = (bmtTokenRangeNode*)(GetThread()->m_MarshalAlloc.Alloc(sizeof(bmtTokenRangeNode))); pNewNode->tokenHiByte = tokrange; pNewNode->cMethods = 0; pNewNode->dwCurrentChunk = 0; pNewNode->dwCurrentIndex = 0; pNewNode->pNext = *ppHead; *ppHead = pNewNode; RETURN pNewNode; } //******************************************************************************* // // Find a method declaration that must reside in the scope passed in. This method cannot be called if // the reference travels to another scope. // // Protect against finding a declaration that lives within // us (the type being created) // HRESULT MethodTableBuilder::FindMethodDeclarationForMethodImpl( mdToken pToken, // Token that is being located (MemberRef or MemberDef) mdToken* pDeclaration, // Method definition for Member BOOL fSameClass, // Does the declaration need to be in this class Module** pModule) // Module that the Method Definitions is part of { CONTRACTL { THROWS; GC_TRIGGERS; } CONTRACTL_END; HRESULT hr = S_OK; IMDInternalImport *pMDInternalImport = bmtInternal->pInternalImport; // // We are currently assumming that most MethodImpls will be used // // to define implementation for methods defined on an interface // // or base type. Therefore, we try to load entry first. If that // // indicates the member is on our type then we check meta data. // MethodDesc* pMethod = NULL; // hr = GetDescFromMemberRef(bmtInternal->pModule, // pToken, // GetCl(), // (void**) (&pMethod), // bmtError->pThrowable); // if(FAILED(hr) && !pThrowableAvailable(bmtError->pThrowable)) { // it was us we were find *pModule = bmtInternal->pModule; PCCOR_SIGNATURE pSig; // Signature of Member DWORD cSig; LPCUTF8 szMember = NULL; // The token should be a member ref or def. If it is a ref then we need to travel // back to us hopefully. if(TypeFromToken(pToken) == mdtMemberRef) { // Get the parent mdToken typeref = pMDInternalImport->GetParentOfMemberRef(pToken); GOTPARENT: // If parent is a method def then this is a varags method if (TypeFromToken(typeref) == mdtMethodDef) { mdTypeDef typeDef; hr = pMDInternalImport->GetParentToken(typeref, &typeDef); // Make sure it is a typedef if (TypeFromToken(typeDef) != mdtTypeDef) { BAD_FORMAT_NOTHROW_ASSERT(!"MethodDef without TypeDef as Parent"); IfFailRet(COR_E_TYPELOAD); } BAD_FORMAT_NOTHROW_ASSERT(typeDef == GetCl()); // This is the real method we are overriding *pDeclaration = mdtMethodDef; } else if (TypeFromToken(typeref) == mdtTypeSpec) { // Added so that method impls can refer to instantiated interfaces or classes pSig = pMDInternalImport->GetSigFromToken(typeref, &cSig); CorElementType elemType = (CorElementType) *pSig++; // If this is a generic inst, we expect that the next elem is ELEMENT_TYPE_CLASS, // which is handled in the case below. if (elemType == ELEMENT_TYPE_GENERICINST) { elemType = (CorElementType) *pSig++; BAD_FORMAT_NOTHROW_ASSERT(elemType == ELEMENT_TYPE_CLASS); } // This covers E_T_GENERICINST and E_T_CLASS typespec formats. We don't expect // any other kinds to come through here. if (elemType == ELEMENT_TYPE_CLASS) { CorSigUncompressToken(pSig, &typeref); } else { // This is an unrecognized signature format. BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_MI_BAD_SIG, mdMethodDefNil); } goto GOTPARENT; } else { // Verify that the ref points back to us mdToken tkDef = mdTokenNil; // We only get here when we know the token does not reference a type // in a different scope. if(TypeFromToken(typeref) == mdtTypeRef) { LPCUTF8 pszNameSpace; LPCUTF8 pszClassName; pMDInternalImport->GetNameOfTypeRef(typeref, &pszNameSpace, &pszClassName); mdToken tkRes = pMDInternalImport->GetResolutionScopeOfTypeRef(typeref); hr = pMDInternalImport->FindTypeDef(pszNameSpace, pszClassName, (TypeFromToken(tkRes) == mdtTypeRef) ? tkRes : mdTokenNil, &tkDef); if(FAILED(hr)) { IfFailRet(COR_E_TYPELOAD); } } // We get a typedef when the parent of the token is a typespec to the type. else if (TypeFromToken(typeref) == mdtTypeDef) { tkDef = typeref; } else { CONSISTENCY_CHECK_MSGF(FALSE, ("Invalid methodimpl signature in class %s.", GetDebugClassName())); BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_MI_BAD_SIG, mdMethodDefNil); } // If we required that the typedef be the same type as the current class, // and it doesn't match, we need to return a failure result. if(fSameClass && tkDef != GetCl()) { IfFailRet(COR_E_TYPELOAD); } szMember = pMDInternalImport->GetNameAndSigOfMemberRef(pToken, &pSig, &cSig); if(isCallConv(MetaSig::GetCallingConventionInfo(*pModule, pSig), IMAGE_CEE_CS_CALLCONV_FIELD)) { return VLDTR_E_MR_BADCALLINGCONV; } hr = pMDInternalImport->FindMethodDef(tkDef, szMember, pSig, cSig, pDeclaration); IfFailRet(hr); } } else if(TypeFromToken(pToken) == mdtMethodDef) { mdTypeDef typeDef; // Verify that we are the parent hr = pMDInternalImport->GetParentToken(pToken, &typeDef); IfFailRet(hr); if(typeDef != GetCl()) { IfFailRet(COR_E_TYPELOAD); } *pDeclaration = pToken; } else { IfFailRet(COR_E_TYPELOAD); } return hr; } //******************************************************************************* // // Used by BuildMethodTable // // Enumerate this class's members // VOID MethodTableBuilder::EnumerateClassMembers() { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(bmtInternal)); PRECONDITION(CheckPointer(bmtEnumMF)); PRECONDITION(CheckPointer(bmtMFDescs)); PRECONDITION(CheckPointer(bmtProp)); PRECONDITION(CheckPointer(bmtMetaData)); PRECONDITION(CheckPointer(bmtVT)); PRECONDITION(CheckPointer(bmtError)); } CONTRACTL_END; HRESULT hr = S_OK; DWORD i; Thread *pThread = GetThread(); IMDInternalImport *pMDInternalImport = bmtInternal->pInternalImport; mdToken tok; DWORD dwMemberAttrs; BOOL fIsClassEnum = IsEnum(); BOOL fIsClassInterface = IsInterface(); BOOL fIsClassValueType = IsValueClass(); BOOL fIsClassNotAbstract = (IsTdAbstract(GetAttrClass()) == 0); PCCOR_SIGNATURE pMemberSignature; ULONG cMemberSignature; // // Run through the method list and calculate the following: // # methods. // # "other" methods (i.e. static or private) // # non-other methods // bmtVT->dwMaxVtableSize = 0; // we'll fix this later to be the real upper bound on vtable size bmtMetaData->cMethods = 0; hr = pMDInternalImport->EnumInit(mdtMethodDef, GetCl(), &(bmtEnumMF->hEnumMethod)); if (FAILED(hr)) { _ASSERTE(!"Cannot count memberdefs"); if (FAILED(hr)) { BuildMethodTableThrowException(hr, *bmtError); } } bmtEnumMF->fNeedToCloseEnumMethod = true; DWORD cbAllocSize = 0; // Allocate an array to contain the method tokens as well as information about the methods. bmtMetaData->cMethAndGaps = pMDInternalImport->EnumGetCount(&(bmtEnumMF->hEnumMethod)); if (!ClrSafeInt<DWORD>::multiply(bmtMetaData->cMethAndGaps, sizeof(mdToken), cbAllocSize)) BuildMethodTableThrowException(COR_E_OVERFLOW); bmtMetaData->pMethods = (mdToken*)pThread->m_MarshalAlloc.Alloc(cbAllocSize); if (!ClrSafeInt<DWORD>::multiply(bmtMetaData->cMethAndGaps, sizeof(ULONG), cbAllocSize)) BuildMethodTableThrowException(COR_E_OVERFLOW); bmtMetaData->pMethodRVA = (ULONG*)pThread->m_MarshalAlloc.Alloc(cbAllocSize); if (!ClrSafeInt<DWORD>::multiply(bmtMetaData->cMethAndGaps, sizeof(DWORD), cbAllocSize)) BuildMethodTableThrowException(COR_E_OVERFLOW); bmtMetaData->pMethodAttrs = (DWORD*)pThread->m_MarshalAlloc.Alloc(cbAllocSize); bmtMetaData->pMethodImplFlags = (DWORD*)pThread->m_MarshalAlloc.Alloc(cbAllocSize); bmtMetaData->pMethodClassifications = (DWORD*)pThread->m_MarshalAlloc.Alloc(cbAllocSize); if (!ClrSafeInt<DWORD>::multiply(bmtMetaData->cMethAndGaps, sizeof(LPSTR), cbAllocSize)) BuildMethodTableThrowException(COR_E_OVERFLOW); bmtMetaData->pstrMethodName = (LPCSTR*)pThread->m_MarshalAlloc.Alloc(cbAllocSize); if (!ClrSafeInt<DWORD>::multiply(bmtMetaData->cMethAndGaps, sizeof(BYTE), cbAllocSize)) BuildMethodTableThrowException(COR_E_OVERFLOW); bmtMetaData->pMethodImpl = (BYTE*)pThread->m_MarshalAlloc.Alloc(cbAllocSize); bmtMetaData->pMethodType = (BYTE*)pThread->m_MarshalAlloc.Alloc(cbAllocSize); enum { SeenCtor = 1, SeenInvoke = 2, SeenBeginInvoke = 4, SeenEndInvoke = 8}; unsigned delegateMethodsSeen = 0; for (i = 0; i < bmtMetaData->cMethAndGaps; i++) { ULONG dwMethodRVA; DWORD dwImplFlags; DWORD Classification; LPSTR strMethodName; // // Go to the next method and retrieve its attributes. // pMDInternalImport->EnumNext(&(bmtEnumMF->hEnumMethod), &tok); DWORD rid = RidFromToken(tok); if ((rid == 0)||(rid > pMDInternalImport->GetCountWithTokenKind(mdtMethodDef))) { BuildMethodTableThrowException(BFA_METHOD_TOKEN_OUT_OF_RANGE); } dwMemberAttrs = pMDInternalImport->GetMethodDefProps(tok); if (IsMdRTSpecialName(dwMemberAttrs) || IsMdVirtual(dwMemberAttrs) || IsAnyDelegateClass()) { strMethodName = (LPSTR)pMDInternalImport->GetNameOfMethodDef(tok); if(IsStrLongerThan(strMethodName,MAX_CLASS_NAME)) { BuildMethodTableThrowException(BFA_METHOD_NAME_TOO_LONG); } } else strMethodName = NULL; HENUMInternal hEnumTyPars; hr = pMDInternalImport->EnumInit(mdtGenericParam, tok, &hEnumTyPars); if (FAILED(hr)) { BuildMethodTableThrowException(hr, *bmtError); } WORD numGenericMethodArgs = (WORD) pMDInternalImport->EnumGetCount(&hEnumTyPars); // We do not want to support context-bound objects with generic methods. if (IsContextful() && numGenericMethodArgs > 0) { BuildMethodTableThrowException(IDS_CLASSLOAD_CONTEXT_BOUND_GENERIC_METHOD); } if (numGenericMethodArgs != 0) { HENUMInternalHolder hEnumGenericPars(pMDInternalImport); hEnumGenericPars.EnumInit(mdtGenericParam, tok); for (unsigned methIdx = 0; methIdx < numGenericMethodArgs; methIdx++) { mdGenericParam tkTyPar; pMDInternalImport->EnumNext(&hEnumGenericPars, &tkTyPar); DWORD flags; pMDInternalImport->GetGenericParamProps(tkTyPar, NULL, &flags, NULL, NULL, NULL); if (0 != (flags & ~(gpVarianceMask | gpSpecialConstraintMask))) { BuildMethodTableThrowException(IDS_CLASSLOAD_BADFORMAT); } switch (flags & gpVarianceMask) { case gpNonVariant: break; case gpCovariant: // intentional fallthru case gpContravariant: BuildMethodTableThrowException(VLDTR_E_GP_ILLEGAL_VARIANT_MVAR); break; default: BuildMethodTableThrowException(IDS_CLASSLOAD_BADFORMAT); } } pMDInternalImport->EnumClose(&hEnumGenericPars); } // // We need to check if there are any gaps in the vtable. These are // represented by methods with the mdSpecial flag and a name of the form // _VTblGap_nnn (to represent nnn empty slots) or _VTblGap (to represent a // single empty slot). // if (IsMdRTSpecialName(dwMemberAttrs)) { // The slot is special, but it might not be a vtable spacer. To // determine that we must look at the name. if (strncmp(strMethodName, "_VtblGap", 8) == 0) { LPCSTR pos = strMethodName + 8; // Skip optional number. while (IS_DIGIT(*pos)) pos++; WORD n = 0; // Check for presence of count. if (*pos == '\0') n = 1; else { if (*pos != '_') { BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BADSPECIALMETHOD, mdMethodDefNil); } // Skip '_'. pos++; // Read count. while (IS_DIGIT(*pos)) { _ASSERTE(n < 6552); n *= 10; n += DIGIT_TO_INT(*pos); pos++; } // Check for end of name. if (*pos != '\0') { BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, BFA_METHOD_NAME_NOT_TERMINATED, mdMethodDefNil); } } continue; } } // // This is a real method so add it to the enumeration of methods. We now need to retrieve // information on the method and store it for later use. // pMDInternalImport->GetMethodImplProps(tok, &dwMethodRVA, &dwImplFlags); // // But first - minimal flags validity checks // // No methods in Enums! if(fIsClassEnum) { BuildMethodTableThrowException(BFA_METHOD_IN_A_ENUM); } // RVA : 0 if(dwMethodRVA != 0) { if(IsMdAbstract(dwMemberAttrs)) { BuildMethodTableThrowException(BFA_ABSTRACT_METHOD_WITH_RVA); } if(IsMiRuntime(dwImplFlags)) { BuildMethodTableThrowException(BFA_RUNTIME_METHOD_WITH_RVA); } if(IsMiInternalCall(dwImplFlags)) { BuildMethodTableThrowException(BFA_INTERNAL_METHOD_WITH_RVA); } } // Abstract / not abstract if(IsMdAbstract(dwMemberAttrs)) { if(fIsClassNotAbstract) { BuildMethodTableThrowException(BFA_AB_METHOD_IN_AB_CLASS); } if(!IsMdVirtual(dwMemberAttrs)) { BuildMethodTableThrowException(BFA_NONVIRT_AB_METHOD); } } else if(fIsClassInterface && strMethodName && (strcmp(strMethodName, COR_CCTOR_METHOD_NAME))) { BuildMethodTableThrowException(BFA_NONAB_NONCCTOR_METHOD_ON_INT); } // Virtual / not virtual if(IsMdVirtual(dwMemberAttrs)) { if(IsMdPinvokeImpl(dwMemberAttrs)) { BuildMethodTableThrowException(BFA_VIRTUAL_PINVOKE_METHOD); } if(IsMdStatic(dwMemberAttrs)) { BuildMethodTableThrowException(BFA_VIRTUAL_STATIC_METHOD); } if(strMethodName && (0==strcmp(strMethodName, COR_CTOR_METHOD_NAME))) { BuildMethodTableThrowException(BFA_VIRTUAL_INSTANCE_CTOR); } } // Some interface checks. if (IsInterface()) { if (IsMdVirtual(dwMemberAttrs)) { if (!IsMdAbstract(dwMemberAttrs)) { BuildMethodTableThrowException(BFA_VIRTUAL_NONAB_INT_METHOD); } } else { // Instance field/method if (!IsMdStatic(dwMemberAttrs)) { BuildMethodTableThrowException(BFA_NONVIRT_INST_INT_METHOD); } } } // No synchronized methods in ValueTypes if(fIsClassValueType && IsMiSynchronized(dwImplFlags)) { BuildMethodTableThrowException(BFA_SYNC_METHOD_IN_VT); } // Global methods: if(IsGlobalClass()) { if(!IsMdStatic(dwMemberAttrs)) { BuildMethodTableThrowException(BFA_NONSTATIC_GLOBAL_METHOD); } if (strMethodName) { if(0==strcmp(strMethodName, COR_CTOR_METHOD_NAME)) { BuildMethodTableThrowException(BFA_GLOBAL_INST_CTOR); } } } //@GENERICS: // Generic methods or methods in generic classes // may not be part of a COM Import class, PInvoke, internal call. if ((bmtGenerics->GetNumGenericArgs() != 0 || numGenericMethodArgs != 0) && ( IsMdPinvokeImpl(dwMemberAttrs) || IsMiInternalCall(dwImplFlags))) { BuildMethodTableThrowException(BFA_BAD_PLACE_FOR_GENERIC_METHOD); } // Generic methods may not be marked "runtime". However note that // methods in generic delegate classes are, hence we don't apply this to // methods in generic classes in general. if (numGenericMethodArgs != 0 && IsMiRuntime(dwImplFlags)) { BuildMethodTableThrowException(BFA_GENERIC_METHOD_RUNTIME_IMPL); } // Signature validation pMemberSignature = pMDInternalImport->GetSigOfMethodDef(tok,&cMemberSignature); hr = validateTokenSig(tok,pMemberSignature,cMemberSignature,dwMemberAttrs,pMDInternalImport); if (FAILED(hr)) { BuildMethodTableThrowException(hr, BFA_BAD_SIGNATURE, mdMethodDefNil); } // Check the appearance of covariant and contravariant in the method signature // Note that variance is only supported for interfaces if (bmtGenerics->pVarianceInfo != NULL) { SigPointer sp(pMemberSignature); ULONG callConv; IfFailThrow(sp.GetCallingConvInfo(&callConv)); if (callConv & IMAGE_CEE_CS_CALLCONV_GENERIC) IfFailThrow(sp.GetData(NULL)); DWORD numArgs; IfFailThrow(sp.GetData(&numArgs)); // Return type behaves covariantly if (!GetHalfBakedClass()->CheckVarianceInSig(bmtGenerics->GetNumGenericArgs(), bmtGenerics->pVarianceInfo, sp, gpCovariant)) { BuildMethodTableThrowException(IDS_CLASSLOAD_VARIANCE_IN_METHOD_RESULT, tok); } sp.SkipExactlyOne(); for (DWORD j = 0; j < numArgs; j++) { // Argument types behave contravariantly if (!GetHalfBakedClass()->CheckVarianceInSig(bmtGenerics->GetNumGenericArgs(), bmtGenerics->pVarianceInfo, sp, gpContravariant)) { BuildMethodTableThrowException(IDS_CLASSLOAD_VARIANCE_IN_METHOD_ARG, tok); } sp.SkipExactlyOne(); } } // // Determine the method's classification. // if (IsReallyMdPinvokeImpl(dwMemberAttrs) || IsMiInternalCall(dwImplFlags)) { hr = NDirect::HasNAT_LAttribute(pMDInternalImport, tok); if (FAILED(hr)) { BuildMethodTableThrowException(hr, IDS_CLASSLOAD_BADPINVOKE, tok); } if (hr == S_FALSE) { if (dwMethodRVA == 0) Classification = mcFCall; else Classification = mcNDirect; } else Classification = mcNDirect; } else if (IsMiRuntime(dwImplFlags)) { // currently the only runtime implemented functions are delegate instance methods if (!IsAnyDelegateClass() || IsMdStatic(dwMemberAttrs) || IsMdAbstract(dwMemberAttrs)) { BuildMethodTableThrowException(BFA_BAD_RUNTIME_IMPL); } unsigned newDelegateMethodSeen = 0; if (IsMdRTSpecialName(dwMemberAttrs)) // .ctor { if (strcmp(strMethodName, COR_CTOR_METHOD_NAME) != 0 || IsMdVirtual(dwMemberAttrs)) { BuildMethodTableThrowException(BFA_BAD_FLAGS_ON_DELEGATE); } newDelegateMethodSeen = SeenCtor; Classification = mcFCall; } else { if (strcmp(strMethodName, "Invoke") == 0) newDelegateMethodSeen = SeenInvoke; else if (strcmp(strMethodName, "BeginInvoke") == 0) newDelegateMethodSeen = SeenBeginInvoke; else if (strcmp(strMethodName, "EndInvoke") == 0) newDelegateMethodSeen = SeenEndInvoke; else { BuildMethodTableThrowException(BFA_UNKNOWN_DELEGATE_METHOD); } Classification = mcEEImpl; } // If we get here we have either set newDelegateMethodSeen or we have thrown a BMT exception _ASSERTE(newDelegateMethodSeen != 0); if ((delegateMethodsSeen & newDelegateMethodSeen) != 0) { BuildMethodTableThrowException(BFA_DUPLICATE_DELEGATE_METHOD); } delegateMethodsSeen |= newDelegateMethodSeen; } else if (numGenericMethodArgs != 0) { //We use an instantiated method desc to represent a generic method Classification = mcInstantiated; } else if (fIsClassInterface) { // This codepath is used by remoting Classification = mcIL; } else { Classification = mcIL; } #ifdef _DEBUG // We don't allow stack based declarative security on ecalls, fcalls and // other special purpose methods implemented by the EE (the interceptor // we use doesn't play well with non-jitted stubs). if ((Classification == mcFCall || Classification == mcEEImpl) && (IsMdHasSecurity(dwMemberAttrs) || IsTdHasSecurity(GetAttrClass()))) { DWORD dwSecFlags; DWORD dwNullDeclFlags; if (IsTdHasSecurity(GetAttrClass()) && SUCCEEDED(Security::GetDeclarationFlags(pMDInternalImport, GetCl(), &dwSecFlags, &dwNullDeclFlags))) { CONSISTENCY_CHECK_MSG(!(dwSecFlags & ~dwNullDeclFlags & DECLSEC_RUNTIME_ACTIONS), "Cannot add stack based declarative security to a class containing an ecall/fcall/special method."); } if (IsMdHasSecurity(dwMemberAttrs) && SUCCEEDED(Security::GetDeclarationFlags(pMDInternalImport, tok, &dwSecFlags, &dwNullDeclFlags))) { CONSISTENCY_CHECK_MSG(!(dwSecFlags & ~dwNullDeclFlags & DECLSEC_RUNTIME_ACTIONS), "Cannot add stack based declarative security to an ecall/fcall/special method."); } } #endif // _DEBUG // Generic methods should always be mcInstantiated if (!((numGenericMethodArgs == 0) || ((Classification & mdcClassification) == mcInstantiated))) { BuildMethodTableThrowException(BFA_GENERIC_METHODS_INST); } // count how many overrides this method does All methods bodies are defined // on this type so we can just compare the tok with the body token found // from the overrides. for(DWORD impls = 0; impls < bmtEnumMF->dwNumberMethodImpls; impls++) { if(bmtMetaData->rgMethodImplTokens[impls].methodBody == tok) { Classification |= mdcMethodImpl; break; } } // For delegates we don't allow any non-runtime implemented bodies // for any of the four special methods if (IsAnyDelegateClass() && !IsMiRuntime(dwImplFlags)) { if ((strcmp(strMethodName, COR_CTOR_METHOD_NAME) == 0) || (strcmp(strMethodName, "Invoke") == 0) || (strcmp(strMethodName, "BeginInvoke") == 0) || (strcmp(strMethodName, "EndInvoke") == 0) ) { BuildMethodTableThrowException(BFA_ILLEGAL_DELEGATE_METHOD); } } // // Compute the type & other info // // Set the index into the storage locations BYTE impl; if (Classification & mdcMethodImpl) impl = METHOD_IMPL; else impl = METHOD_IMPL_NOT; BYTE type; if ((Classification & mdcClassification) == mcNDirect) { type = METHOD_TYPE_NDIRECT; } else if ((Classification & mdcClassification) == mcFCall) { type = METHOD_TYPE_FCALL; } else if ((Classification & mdcClassification) == mcEEImpl) { type = METHOD_TYPE_EEIMPL; } else if ((Classification & mdcClassification) == mcInstantiated) { type = METHOD_TYPE_INSTANTIATED; } else { type = METHOD_TYPE_NORMAL; } // // Store the method and the information we have gathered on it in the metadata info structure. // bmtMetaData->SetMethodData(NumDeclaredMethods(), tok, dwMemberAttrs, dwMethodRVA, dwImplFlags, Classification, strMethodName, impl, type); IncNumDeclaredMethods(); // // Update the count of the various types of methods. // bmtVT->dwMaxVtableSize++; // Increment the number of non-abstract declared methods if (!IsMdAbstract(dwMemberAttrs)) { bmtEnumMF->dwNumDeclaredNonAbstractMethods++; } // Increment the number of IL instance methods if (type == METHOD_TYPE_NORMAL && !IsMdStatic(dwMemberAttrs)) { bmtEnumMF->dwNumILInstanceMethods++; } // Increment the number of MethodDescs for this type of method bmtMFDescs->sets[type][impl].dwNumMethodDescs++; // If the method requires an unboxing method, record this fact BOOL hasUnboxing = (IsValueClass() && !IsMdStatic(dwMemberAttrs) && type != METHOD_TYPE_INSTANTIATED && IsMdVirtual(dwMemberAttrs) && !IsMdRTSpecialName(dwMemberAttrs)); if (hasUnboxing) { bmtEnumMF->dwNumUnboxingMethods++; bmtMFDescs->sets[type][impl].dwNumBoxedEntryPointMDs++; } // Update the token ranges for this type of method to be used for MethodDescChunk allocation GetTokenRange(tok, &(bmtMetaData->ranges[type][impl]))->cMethods += (hasUnboxing ? 2 : 1); } // Check to see that we have all of the required delegate methods (ECMA 13.6 Delegates) if (IsAnyDelegateClass()) { // Do we have all four special delegate methods // or just the two special delegate methods if ((delegateMethodsSeen != (SeenCtor | SeenInvoke | SeenBeginInvoke | SeenEndInvoke)) && (delegateMethodsSeen != (SeenCtor | SeenInvoke)) ) { BuildMethodTableThrowException(BFA_MISSING_DELEGATE_METHOD); } } if (i != bmtMetaData->cMethAndGaps) { BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_METHOD_COUNT, mdTokenNil); } pMDInternalImport->EnumReset(&(bmtEnumMF->hEnumMethod)); // // Run through the field list and calculate the following: // # static fields // # static fields that contain object refs. // # instance fields // bmtEnumMF->dwNumStaticFields = 0; bmtEnumMF->dwNumStaticObjRefFields = 0; bmtEnumMF->dwNumStaticBoxedFields = 0; bmtEnumMF->dwNumInstanceFields = 0; hr = pMDInternalImport->EnumInit(mdtFieldDef, GetCl(), &(bmtEnumMF->hEnumField)); if (FAILED(hr)) { BuildMethodTableThrowException(hr, *bmtError); } bmtMetaData->cFields = pMDInternalImport->EnumGetCount(&(bmtEnumMF->hEnumField)); bmtEnumMF->fNeedToCloseEnumField = true; // Retrieve the fields and store them in a temp array. bmtMetaData->pFields = (mdToken*)pThread->m_MarshalAlloc.Alloc(bmtMetaData->cFields * sizeof(mdToken)); bmtMetaData->pFieldAttrs = (DWORD*)pThread->m_MarshalAlloc.Alloc(bmtMetaData->cFields * sizeof(DWORD)); DWORD dwFieldLiteralInitOnly = fdLiteral | fdInitOnly; for (i = 0; pMDInternalImport->EnumNext(&(bmtEnumMF->hEnumField), &tok); i++) { // // Retrieve the attributes of the field. // DWORD rid = tok & 0x00FFFFFF; if ((rid == 0)||(rid > pMDInternalImport->GetCountWithTokenKind(mdtFieldDef))) { BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, BFA_BAD_FIELD_TOKEN, mdTokenNil); } dwMemberAttrs = pMDInternalImport->GetFieldDefProps(tok); // // Store the field and its attributes in the bmtMetaData structure for later use. // bmtMetaData->pFields[i] = tok; bmtMetaData->pFieldAttrs[i] = dwMemberAttrs; if((dwMemberAttrs & fdFieldAccessMask)==fdFieldAccessMask) { BuildMethodTableThrowException(BFA_INVALID_FIELD_ACC_FLAGS); } if((dwMemberAttrs & dwFieldLiteralInitOnly)==dwFieldLiteralInitOnly) { BuildMethodTableThrowException(BFA_FIELD_LITERAL_AND_INIT); } // can only have static global fields if(IsGlobalClass()) { if(!IsMdStatic(dwMemberAttrs)) { BuildMethodTableThrowException(BFA_NONSTATIC_GLOBAL_FIELD); } } // // Update the count of the various types of fields. // if (IsFdStatic(dwMemberAttrs)) { if (!IsFdLiteral(dwMemberAttrs)) { bmtEnumMF->dwNumStaticFields++; } } else { bmtEnumMF->dwNumInstanceFields++; if(fIsClassInterface) { BuildMethodTableThrowException(BFA_INSTANCE_FIELD_IN_INT); } } } if (i != bmtMetaData->cFields) { BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD_COUNT, mdTokenNil); } if(fIsClassEnum && (bmtEnumMF->dwNumInstanceFields==0)) { BuildMethodTableThrowException(BFA_INSTANCE_FIELD_IN_ENUM); } bmtEnumMF->dwNumDeclaredFields = bmtEnumMF->dwNumStaticFields + bmtEnumMF->dwNumInstanceFields; } //******************************************************************************* // // Used by AllocateMethodFieldDescs // Thus used by BuildMethodTable // // Allocates the chunks used to contain the method descs. // MethodDescChunk ** MethodTableBuilder::AllocateMDChunks( bmtTokenRangeNode *pTokenRanges, DWORD type, DWORD impl, DWORD *pNumChunks, AllocMemTracker *pamTracker) { CONTRACTL { THROWS; GC_NOTRIGGER; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(this)); PRECONDITION(CheckPointer(pTokenRanges)); } CONTRACTL_END; static const DWORD classifications[METHOD_TYPE_COUNT][METHOD_IMPL_COUNT] = { { mcIL, mcIL | mdcMethodImpl }, { mcFCall, mcFCall | mdcMethodImpl }, { mcEEImpl, mcEEImpl | mdcMethodImpl }, { mcNDirect, mcNDirect | mdcMethodImpl } , { mcInstantiated, mcInstantiated | mdcMethodImpl } }; DWORD Classification = classifications[type][impl]; bmtTokenRangeNode *pTR = pTokenRanges; *pNumChunks = 0; while (pTR) { // Note: Since dwCurrentChunk isn't being used at this stage, we'll steal it to store // away the chunk count. // After this function, we'll set it to its intended value. pTR->dwCurrentChunk = MethodDescChunk::GetChunkCount(pTR->cMethods, Classification); (*pNumChunks) += pTR->dwCurrentChunk; pTR = pTR->pNext; } MethodDescChunk **pItfMDChunkList = (MethodDescChunk**)GetThread()->m_MarshalAlloc.Alloc((*pNumChunks) * sizeof(MethodDescChunk*)); // Allocate the chunks for the method descs. pTR = pTokenRanges; DWORD chunkIdx = 0; while (pTR) { DWORD NumChunks = pTR->dwCurrentChunk; DWORD dwMDAllocs = pTR->cMethods; pTR->dwCurrentChunk = chunkIdx; for (DWORD i = 0; i < NumChunks; i++) { DWORD dwElems = min(dwMDAllocs, MethodDescChunk::GetMaxMethodDescs(Classification)); MethodDescChunk *pChunk = MethodDescChunk::CreateChunk(bmtDomain->GetHighFrequencyHeap(), dwElems, Classification, pTR->tokenHiByte, NULL, pamTracker); pItfMDChunkList[chunkIdx++] = pChunk; dwMDAllocs -= dwElems; } pTR = pTR->pNext; } return pItfMDChunkList; } //******************************************************************************* // // Used by BuildMethodTable // // Determines the maximum size of the vtable and allocates the temporary storage arrays // Also copies the parent's vtable into the working vtable. // VOID MethodTableBuilder::AllocateWorkingSlotTables() { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(this)); PRECONDITION(CheckPointer(bmtDomain)); PRECONDITION(CheckPointer(bmtMFDescs)); PRECONDITION(CheckPointer(bmtMetaData)); PRECONDITION(CheckPointer(bmtVT)); PRECONDITION(CheckPointer(bmtEnumMF)); PRECONDITION(CheckPointer(bmtInterface)); PRECONDITION(CheckPointer(bmtFP)); PRECONDITION(CheckPointer(bmtParent)); } CONTRACTL_END; DWORD i; Thread *pThread = GetThread(); // Allocate a MethodDesc* for each method (needed later when doing interfaces), and a FieldDesc* for each field bmtMFDescs->ppMethodDescList = (MethodDesc **) pThread->m_MarshalAlloc.Alloc(NumDeclaredMethods() * sizeof(MethodDesc *)); ZeroMemory(bmtMFDescs->ppMethodDescList, NumDeclaredMethods() * sizeof(MethodDesc *)); bmtMFDescs->ppFieldDescList = (FieldDesc **) pThread->m_MarshalAlloc.Alloc(bmtMetaData->cFields * sizeof(FieldDesc *)); ZeroMemory(bmtMFDescs->ppFieldDescList, bmtMetaData->cFields * sizeof(FieldDesc *)); // Create a temporary function table (we don't know how large the vtable will be until the very end, // since duplicated interfaces are stored at the end of it). Calculate an upper bound. // // Upper bound is: The parent's class vtable size, plus every method declared in // this class, plus the size of every interface we implement // // In the case of value classes, we add # InstanceMethods again, since we have boxed and unboxed versions // of every vtable method. // if (IsValueClass()) { bmtVT->dwMaxVtableSize += NumDeclaredMethods(); bmtMFDescs->ppUnboxMethodDescList = (MethodDesc **) pThread->m_MarshalAlloc.Alloc(NumDeclaredMethods() * sizeof(MethodDesc*)); ZeroMemory(bmtMFDescs->ppUnboxMethodDescList, NumDeclaredMethods() * sizeof(MethodDesc*)); } // sanity check _ASSERTE(bmtParent->pParentMethodTable == NULL || (bmtInterface->dwInterfaceMapSize - bmtParent->pParentMethodTable->GetNumInterfaces()) >= 0); // add parent vtable size bmtVT->dwMaxVtableSize += bmtVT->dwCurrentVtableSlot; for (i = 0; i < bmtInterface->dwInterfaceMapSize; i++) { // We double the interface size because we may end up duplicating the Interface for MethodImpls bmtVT->dwMaxVtableSize += (bmtInterface->pInterfaceMap[i].m_pMethodTable->GetNumVirtuals() * 2); } // Allocate the temporary vtable bmtVT->pVtable = (SLOT *) pThread->m_MarshalAlloc.Alloc(bmtVT->dwMaxVtableSize * sizeof(SLOT)); ZeroMemory(bmtVT->pVtable, bmtVT->dwMaxVtableSize * sizeof(SLOT)); bmtVT->pVtableMD = (MethodDesc**) pThread->m_MarshalAlloc.Alloc(bmtVT->dwMaxVtableSize * sizeof(SLOT)); ZeroMemory(bmtVT->pVtableMD, bmtVT->dwMaxVtableSize * sizeof(MethodDesc*)); // Allocate the temporary non-vtable bmtVT->pNonVtableMD = (MethodDesc**) pThread->m_MarshalAlloc.Alloc(sizeof(MethodDesc*) * NumDeclaredMethods()); ZeroMemory(bmtVT->pNonVtableMD, sizeof(MethodDesc*) * NumDeclaredMethods()); if (bmtParent->pParentMethodTable != NULL) { if (bmtParent->pParentMethodTable->IsZapped()) { for (unsigned j=0; j<bmtParent->pParentMethodTable->GetNumVirtuals(); j++) { bmtParent->pParentMethodTable->GetRestoredSlot(j); } } // Copy parent's vtable into our "temp" vtable { MethodTable::MethodIterator it(bmtParent->pParentMethodTable); for (;it.IsValid() && it.IsVirtual(); it.Next()) { DWORD slot = it.GetSlotNumber(); bmtVT->pVtable[slot] = (SLOT) it.GetTarget().GetTarget(); bmtVT->pVtableMD[slot] = NULL; // MethodDescs are resolved lazily } bmtVT->pParentMethodTable = bmtParent->pParentMethodTable; } } if (NumDeclaredMethods() > 0) { bmtParent->ppParentMethodDescBuf = (MethodDesc **) pThread->m_MarshalAlloc.Alloc(2 * NumDeclaredMethods() * sizeof(MethodDesc*)); bmtParent->ppParentMethodDescBufPtr = bmtParent->ppParentMethodDescBuf; } } //******************************************************************************* // // Used by BuildMethodTable // // Allocate a MethodDesc* for each method (needed later when doing interfaces), and a FieldDesc* for each field // VOID MethodTableBuilder::AllocateMethodFieldDescs(AllocMemTracker *pamTracker) { CONTRACTL { THROWS; GC_TRIGGERS; PRECONDITION(CheckPointer(this)); PRECONDITION(CheckPointer(bmtDomain)); PRECONDITION(CheckPointer(bmtMFDescs)); PRECONDITION(CheckPointer(bmtMetaData)); PRECONDITION(CheckPointer(bmtVT)); PRECONDITION(CheckPointer(bmtEnumMF)); PRECONDITION(CheckPointer(bmtFP)); PRECONDITION(CheckPointer(bmtParent)); } CONTRACTL_END; DWORD i; // We'll be counting the # fields of each size as we go along for (i = 0; i <= MAX_LOG2_PRIMITIVE_FIELD_SIZE; i++) { bmtFP->NumStaticFieldsOfSize[i] = 0; bmtFP->NumInstanceFieldsOfSize[i] = 0; } // // Allocate blocks of MethodDescs and FieldDescs for all declared methods and fields // // In order to avoid allocating a field pointing back to the method // table in every single method desc, we allocate memory in the // following manner: // o Field descs get a single contiguous block. // o Method descs of different sizes (normal vs NDirect) are // allocated in different MethodDescChunks. // o Each method desc chunk starts with a header, and has // at most MAX_ method descs (if there are more // method descs of a given size, multiple chunks are allocated). // This way method descs can use an 8-bit offset field to locate the // pointer to their method table. // // Allocate fields first. if (NumDeclaredFields() > 0) { GetHalfBakedClass()->m_pFieldDescList = (FieldDesc *)pamTracker->Track( bmtDomain->GetHighFrequencyHeap()->AllocMem(NumDeclaredFields() * sizeof(FieldDesc))); INDEBUG(GetClassLoader()->m_dwDebugFieldDescs += NumDeclaredFields();) INDEBUG(GetClassLoader()->m_dwFieldDescData += (NumDeclaredFields() * sizeof(FieldDesc));) } else { // No fields or methods GetHalfBakedClass()->m_pFieldDescList = NULL; } if (NumDeclaredMethods() > 0) { for (DWORD impl=0; impl<METHOD_IMPL_COUNT; impl++) { for (DWORD type=0; type<METHOD_TYPE_COUNT; type++) { bmtMethodDescSet *set = &bmtMFDescs->sets[type][impl]; DWORD dwAllocs = set->dwNumMethodDescs + set->dwNumBoxedEntryPointMDs; if (dwAllocs > 0) { set->pChunkList = AllocateMDChunks( bmtMetaData->ranges[type][impl], type, impl, &set->dwChunks, pamTracker); } #ifdef _DEBUG GetClassLoader()->m_dwDebugMethods += dwAllocs; for (UINT j=0; j<set->dwChunks; j++) GetClassLoader()->m_dwMethodDescData += set->pChunkList[j]->Sizeof(); #endif // _DEBUG } } } } //******************************************************************************* // // Heuristic to determine if we should have instances of this class 8 byte aligned // BOOL MethodTableBuilder::ShouldAlign8(DWORD dwR8Fields, DWORD dwTotalFields) { LEAF_CONTRACT; return dwR8Fields*2>dwTotalFields && dwR8Fields>=2; } //******************************************************************************* BOOL MethodTableBuilder::IsSelfReferencingStaticValueTypeField(mdToken dwByValueClassToken, bmtInternalInfo* bmtInternal, const bmtGenericsInfo *bmtGenerics, PCCOR_SIGNATURE pMemberSignature, DWORD cMemberSignature) { CONTRACTL { THROWS; // see note below as to why this is NOTHROW WRAPPER(GC_TRIGGERS); INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END; if (dwByValueClassToken != this->GetCl()) { return FALSE; } if (!bmtGenerics->HasInstantiation()) { return TRUE; } // <NOTE>See notes in InitializeFieldDescs as to why we bail out here </NOTE> if (bmtInternal->pModule->IsEditAndContinueEnabled() && GetThread() == NULL) { return FALSE; } // The value class is generic. Check that the signature of the field // is _exactly_ equivalent to VC<!0, !1, !2, ...>. Do this by consing up a fake // signature. DWORD nGenericArgs = bmtGenerics->GetNumGenericArgs(); CONSISTENCY_CHECK(nGenericArgs != 0); unsigned int nFakeSig = 1 + 1 + 4 + 4 + (1+4) * nGenericArgs; BYTE *pFakeSigMem = (BYTE *) _alloca(nFakeSig); BYTE *pFakeSigMemMax = pFakeSigMem + nFakeSig; PCCOR_SIGNATURE pFieldSig = pMemberSignature + 1; // skip the CALLCONV_FIELD PCCOR_SIGNATURE pFakeSig = (PCCOR_SIGNATURE) pFakeSigMem; PCCOR_SIGNATURE pFakeSigMax = (PCCOR_SIGNATURE) pFakeSigMemMax; /* 1 */ pFakeSigMem += CorSigCompressElementTypeSafe(ELEMENT_TYPE_GENERICINST,pFakeSigMem, pFakeSigMemMax); /* 1 */ pFakeSigMem += CorSigCompressElementTypeSafe(ELEMENT_TYPE_VALUETYPE,pFakeSigMem, pFakeSigMemMax); /* 4 */ pFakeSigMem += CorSigCompressTokenSafe(dwByValueClassToken,pFakeSigMem, pFakeSigMemMax); /* max 4 */ pFakeSigMem += CorSigCompressDataSafe(nGenericArgs, pFakeSigMem, pFakeSigMemMax); for (unsigned int typearg = 0; typearg < nGenericArgs; typearg++) { /* 1 */ pFakeSigMem += CorSigCompressElementTypeSafe(ELEMENT_TYPE_VAR,pFakeSigMem, pFakeSigMemMax); /* max 4 */ pFakeSigMem += CorSigCompressDataSafe(typearg, pFakeSigMem, pFakeSigMemMax); } return MetaSig::CompareElementType(pFakeSig, pFieldSig, pFakeSigMax, pMemberSignature + cMemberSignature, bmtInternal->pModule, bmtInternal->pModule, NULL, NULL, NULL, NULL); } //******************************************************************************* // // Used by BuildMethodTable // // Go thru all fields and initialize their FieldDescs. // VOID MethodTableBuilder::InitializeFieldDescs(BaseDomain *bmtDomain, FieldDesc *pFieldDescList, const LayoutRawFieldInfo* pLayoutRawFieldInfos, bmtInternalInfo* bmtInternal, const bmtGenericsInfo* bmtGenerics, bmtMetaDataInfo* bmtMetaData, bmtEnumMethAndFields* bmtEnumMF, bmtErrorInfo* bmtError, EEClass*** pByValueClassCache, bmtMethAndFieldDescs* bmtMFDescs, bmtFieldPlacement* bmtFP, bmtThreadContextStaticInfo* pbmtTCSInfo, unsigned* totalDeclaredSize, bmtParentInfo* bmtParent) { CONTRACTL { // InitializeFieldDescs/IsSelfReferencingStaticValueTypeField // should by rights be THROWS because // (a) they call the loader and // (b) IsSelfReferencingStaticValueTypeField calls signature comparison functions which in // turn call the loader. // We could simply propagate the exceptions // if it weren't for the fact that InitializeFieldDescs is used by EnC to initialize // freshly added field descriptors, and thus it is called from the debugger thread // which cannot handle these exceptions. // // So further below we explicitly catch exceptions at the calls to the loader // functions (actually we call the non-throwing entry points to the loader), // and also avoid calling the loader at all when executing the EnC paths. THROWS; WRAPPER(GC_TRIGGERS); INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(this)); PRECONDITION(CheckPointer(bmtInternal)); PRECONDITION(CheckPointer(bmtGenerics)); PRECONDITION(CheckPointer(bmtMetaData)); PRECONDITION(CheckPointer(bmtEnumMF)); PRECONDITION(CheckPointer(bmtError)); PRECONDITION(CheckPointer(pByValueClassCache)); PRECONDITION(CheckPointer(bmtMFDescs)); PRECONDITION(CheckPointer(bmtFP)); PRECONDITION(CheckPointer(totalDeclaredSize)); PRECONDITION(CheckPointer(bmtParent, NULL_OK)); } CONTRACTL_END; DWORD i; IMDInternalImport *pInternalImport = bmtInternal->pInternalImport; // to avoid multiple dereferencings FieldMarshaler *pNextFieldMarshaler = NULL; if (HasLayout()) { pNextFieldMarshaler = (FieldMarshaler*)(GetLayoutInfo()->GetFieldMarshalers()); } //======================================================================== // BEGIN: // Go thru all fields and initialize their FieldDescs. //======================================================================== DWORD dwCurrentDeclaredField = 0; DWORD dwCurrentStaticField = 0; DWORD dwThreadStaticsOffset = 0; DWORD dwContextStaticsOffset = 0; DWORD dwR8Fields = 0; // Number of R8's the class has #ifdef RVA_FIELD_VALIDATION_ENABLED Module* pMod = bmtInternal->pModule; #endif for (i = 0; i < bmtMetaData->cFields; i++) { PCCOR_SIGNATURE pMemberSignature; DWORD cMemberSignature; DWORD dwMemberAttrs; dwMemberAttrs = bmtMetaData->pFieldAttrs[i]; // We don't store static final primitive fields in the class layout if (IsFdLiteral(dwMemberAttrs)) continue; if(!IsFdPublic(dwMemberAttrs)) SetHasNonPublicFields(); if (IsFdNotSerialized(dwMemberAttrs)) SetCannotBeBlittedByObjectCloner(); pMemberSignature = pInternalImport->GetSigOfFieldDef(bmtMetaData->pFields[i], &cMemberSignature); // Signature validation IfFailThrow(validateTokenSig(bmtMetaData->pFields[i],pMemberSignature,cMemberSignature,dwMemberAttrs,pInternalImport)); FieldDesc * pFD; DWORD dwLog2FieldSize = 0; BOOL bCurrentFieldIsGCPointer = FALSE; mdToken dwByValueClassToken = 0; EEClass * pByValueClass = NULL; BOOL fIsByValue = FALSE; BOOL fIsThreadStatic = FALSE; BOOL fIsContextStatic = FALSE; BOOL fHasRVA = FALSE; MetaSig fsig(pMemberSignature, cMemberSignature, bmtInternal->pModule, &bmtGenerics->typeContext, FALSE, MetaSig::sigField); CorElementType ElementType = fsig.NextArg(); // Get type if (!isCallConv(fsig.GetCallingConvention(), IMAGE_CEE_CS_CALLCONV_FIELD)) { IfFailThrow(COR_E_TYPELOAD); } // Determine if a static field is special i.e. RVA based, local to // a thread or a context if(IsFdStatic(dwMemberAttrs)) { if(IsFdHasFieldRVA(dwMemberAttrs)) { fHasRVA = TRUE; } HRESULT hr; hr = pInternalImport->GetCustomAttributeByName(bmtMetaData->pFields[i], g_ThreadStaticAttributeClassName, NULL, NULL); IfFailThrow(hr); if (hr == S_OK) { fIsThreadStatic = TRUE; } hr = pInternalImport->GetCustomAttributeByName(bmtMetaData->pFields[i], g_ContextStaticAttributeClassName, NULL, NULL); IfFailThrow(hr); if (hr == S_OK) { fIsContextStatic = TRUE; } if(ElementType == ELEMENT_TYPE_VALUETYPE) { hr = pInternalImport->GetCustomAttributeByName(bmtMetaData->pFields[i], g_CompilerServicesFixedAddressValueTypeAttribute, NULL, NULL); IfFailThrow(hr); if (hr == S_OK) { bmtFP->fHasFixedAddressValueTypes = true; } } // Do some sanity checks that we are not mixing context and thread // relative statics. if (fIsThreadStatic && fIsContextStatic) { IfFailThrow(COR_E_TYPELOAD); } if (fHasRVA && (fIsThreadStatic || fIsContextStatic)) { IfFailThrow(COR_E_TYPELOAD); } } GOT_ELEMENT_TYPE: // Type to store in FieldDesc - we don't want to have extra case statements for // ELEMENT_TYPE_STRING, SDARRAY etc., so we convert all object types to CLASS. // Also, BOOLEAN, CHAR are converted to U1, I2. CorElementType FieldDescElementType = ElementType; switch (ElementType) { case ELEMENT_TYPE_I1: case ELEMENT_TYPE_U1: { dwLog2FieldSize = 0; break; } case ELEMENT_TYPE_I2: case ELEMENT_TYPE_U2: { dwLog2FieldSize = 1; break; } case ELEMENT_TYPE_I4: case ELEMENT_TYPE_U4: IN_WIN32(case ELEMENT_TYPE_I:) IN_WIN32(case ELEMENT_TYPE_U:) case ELEMENT_TYPE_R4: { dwLog2FieldSize = 2; break; } case ELEMENT_TYPE_BOOLEAN: { // FieldDescElementType = ELEMENT_TYPE_U1; dwLog2FieldSize = 0; break; } case ELEMENT_TYPE_CHAR: { // FieldDescElementType = ELEMENT_TYPE_U2; dwLog2FieldSize = 1; break; } case ELEMENT_TYPE_R8: dwR8Fields++; // Fall through case ELEMENT_TYPE_I8: case ELEMENT_TYPE_U8: IN_WIN64(case ELEMENT_TYPE_I:) IN_WIN64(case ELEMENT_TYPE_U:) { dwLog2FieldSize = 3; break; } case ELEMENT_TYPE_FNPTR: case ELEMENT_TYPE_PTR: // ptrs are unmanaged scalars, for layout { dwLog2FieldSize = LOG2_PTRSIZE; break; } // Class type variable (method type variables aren't allowed in fields) // These only occur in open types used for verification/reflection. case ELEMENT_TYPE_VAR: case ELEMENT_TYPE_MVAR: // deliberate drop through - do fake field layout case ELEMENT_TYPE_STRING: case ELEMENT_TYPE_SZARRAY: // single dim, zero case ELEMENT_TYPE_ARRAY: // all other arrays case ELEMENT_TYPE_CLASS: // objectrefs case ELEMENT_TYPE_OBJECT: { dwLog2FieldSize = LOG2_PTRSIZE; bCurrentFieldIsGCPointer = TRUE; FieldDescElementType = ELEMENT_TYPE_CLASS; if (IsFdStatic(dwMemberAttrs) == 0) { SetHasFieldsWhichMustBeInited(); if (ElementType != ELEMENT_TYPE_STRING) SetCannotBeBlittedByObjectCloner(); } else { // Increment the number of static fields that contain object references. bmtEnumMF->dwNumStaticObjRefFields++; } break; } case ELEMENT_TYPE_VALUETYPE: // a byvalue class field { dwByValueClassToken = fsig.GetArgProps().PeekValueTypeTokenClosed(&bmtGenerics->typeContext); fIsByValue = TRUE; // By-value class BAD_FORMAT_NOTHROW_ASSERT(dwByValueClassToken != 0); #ifndef RVA_FIELD_VALIDATION_ENABLED if (fHasRVA) break; #endif // !RVA_FIELD_VALIDATION_ENABLED if (this->IsValueClass()) { BOOL selfref = IsSelfReferencingStaticValueTypeField(dwByValueClassToken, bmtInternal, bmtGenerics, pMemberSignature, cMemberSignature); if (selfref) { // immediately self-referential machines must be static. if (!IsFdStatic(dwMemberAttrs)) { bmtError->resIDWhy = IDS_CLASSLOAD_VALUEINSTANCEFIELD; COMPlusThrowHR(COR_E_TYPELOAD); } pByValueClass = GetHalfBakedClass(); } else { // We also check the TypeRef case, though this is in theory invalid IL (using a typeRef // to refer to something defined in the same module) and no compilers should be producing it. // <NICE> Get rid of this </NICE> if (IsFdStatic(dwMemberAttrs) && (TypeFromToken(dwByValueClassToken) == mdtTypeRef)) { // It's a typeref - check if it's a class that has a static field of itself mdTypeDef ValueCL; LPCUTF8 pszNameSpace; LPCUTF8 pszClassName; pInternalImport->GetNameOfTypeRef(dwByValueClassToken, &pszNameSpace, &pszClassName); if(IsStrLongerThan((char*)pszClassName,MAX_CLASS_NAME) || IsStrLongerThan((char*)pszNameSpace,MAX_CLASS_NAME) || (strlen(pszClassName)+strlen(pszNameSpace)+1 >= MAX_CLASS_NAME)) { COMPlusThrowHR(COR_E_TYPELOAD, BFA_TYPEREG_NAME_TOO_LONG); } mdToken tkRes = pInternalImport->GetResolutionScopeOfTypeRef(dwByValueClassToken); if(TypeFromToken(tkRes) == mdtTypeRef) { DWORD rid = RidFromToken(tkRes); if((rid==0)||(rid > pInternalImport->GetCountWithTokenKind(mdtTypeRef))) { COMPlusThrowHR(COR_E_TYPELOAD, BFA_BAD_TYPEREF_TOKEN); } } else tkRes = mdTokenNil; if (SUCCEEDED(pInternalImport->FindTypeDef(pszNameSpace, pszClassName, tkRes, &ValueCL))) { if (ValueCL == GetCl()) pByValueClass = GetHalfBakedClass(); } } // If field is static typeref } // If field is self-referencing } // If 'this' is a value class // It's not self-referential so try to load it if (pByValueClass == NULL) { // <NOTE>See notes above on why this function is NOTHROW. // We avoid the call to the loader here because EnC calls InitializeFieldDescs // from the debugger thread, which is an unmanaged thread (GetThread() returns NULL). // We can't typically invoke the loader from unmanaged threads.</NOTE> if (bmtInternal->pModule->IsEditAndContinueEnabled() && GetThread() == NULL) { COMPlusThrowHR(E_FAIL); } // We load the approximate type of the field to avoid recursion problems. // MethodTable::DoFullyLoad() will later load it fully pByValueClass = fsig.GetArgProps().GetTypeHandleThrowing(bmtInternal->pModule, &bmtGenerics->typeContext, ClassLoader::LoadTypes, CLASS_LOAD_APPROXPARENTS, TRUE ).GetClass(); } // IF it is an enum, strip it down to its underlying type if (pByValueClass->IsEnum()) { BAD_FORMAT_NOTHROW_ASSERT((pByValueClass == GetHalfBakedClass() && bmtEnumMF->dwNumInstanceFields == 1) || pByValueClass->GetNumInstanceFields() == 1); // enums must have exactly one field FieldDesc* enumField = pByValueClass->m_pFieldDescList; BAD_FORMAT_NOTHROW_ASSERT(!enumField->IsStatic()); // no real static fields on enums ElementType = enumField->GetFieldType(); BAD_FORMAT_NOTHROW_ASSERT(ElementType != ELEMENT_TYPE_VALUETYPE); fIsByValue = FALSE; // we're going to treat it as the underlying type now goto GOT_ELEMENT_TYPE; } else if ( (pByValueClass->IsValueClass() == FALSE) && (pByValueClass != g_pEnumClass->GetClass()) ) { BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_MUST_BE_BYVAL, mdTokenNil); } // If it is an illegal type, say so if (pByValueClass->ContainsStackPtr()) { BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil); } // If a class has a field of type ValueType with non-public fields in it, // the class must "inherit" this characteristic if (pByValueClass->HasNonPublicFields()) { SetHasNonPublicFields(); } #ifdef RVA_FIELD_VALIDATION_ENABLED if (fHasRVA) { dwLog2FieldSize = IsFdStatic(dwMemberAttrs) ? LOG2_PTRSIZE : 0; break; } #endif // RVA_FIELD_VALIDATION_ENABLED if (IsFdStatic(dwMemberAttrs) == 0) { if (pByValueClass->HasFieldsWhichMustBeInited()) SetHasFieldsWhichMustBeInited(); if (pByValueClass->CannotBeBlittedByObjectCloner()) SetCannotBeBlittedByObjectCloner(); } else { // Increment the number of static fields that contain object references. if (!IsFdHasFieldRVA(dwMemberAttrs)) bmtEnumMF->dwNumStaticBoxedFields++; } // Need to create by value class cache. For E&C, this pointer will get // cached indefinately and not cleaned up as the parent descriptors are // in the low frequency heap. Use new with the intent of leaking // this pointer and avoiding the assert . if (*pByValueClassCache == NULL) { *pByValueClassCache = new EEClass * [bmtEnumMF->dwNumInstanceFields + bmtEnumMF->dwNumStaticFields]; memset (*pByValueClassCache, 0, (bmtEnumMF->dwNumInstanceFields + bmtEnumMF->dwNumStaticFields) * sizeof(EEClass **)); } // Static fields come after instance fields in this list if (IsFdStatic(dwMemberAttrs)) { if (!pByValueClass->HasInstantiation()) { (*pByValueClassCache)[bmtEnumMF->dwNumInstanceFields + dwCurrentStaticField] = pByValueClass; } // make sure to record the correct size for static field // layout dwLog2FieldSize = LOG2_PTRSIZE; // handle } else { (*pByValueClassCache)[dwCurrentDeclaredField] = pByValueClass; dwLog2FieldSize = 0; // unused } break; } default: { BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil); } } // Static fields are not packed if (IsFdStatic(dwMemberAttrs) && (dwLog2FieldSize < 2)) dwLog2FieldSize = 2; if (!IsFdStatic(dwMemberAttrs)) { pFD = &pFieldDescList[dwCurrentDeclaredField]; *totalDeclaredSize += (1 << dwLog2FieldSize); } else /* (dwMemberAttrs & mdStatic) */ { pFD = &pFieldDescList[bmtEnumMF->dwNumInstanceFields + dwCurrentStaticField]; } bmtMFDescs->ppFieldDescList[i] = pFD; const LayoutRawFieldInfo *pLayoutFieldInfo; pLayoutFieldInfo = NULL; if (HasLayout()) { const LayoutRawFieldInfo *pwalk = pLayoutRawFieldInfos; while (pwalk->m_MD != mdFieldDefNil) { if (pwalk->m_MD == bmtMetaData->pFields[i]) { pLayoutFieldInfo = pwalk; CopyMemory(pNextFieldMarshaler, &(pwalk->m_FieldMarshaler), MAXFIELDMARSHALERSIZE); pNextFieldMarshaler->SetFieldDesc(pFD); pNextFieldMarshaler->SetExternalOffset(pwalk->m_offset); ((BYTE*&)pNextFieldMarshaler) += MAXFIELDMARSHALERSIZE; break; } pwalk++; } } LPCSTR pszFieldName = NULL; #ifdef _DEBUG pszFieldName = pInternalImport->GetNameOfFieldDef(bmtMetaData->pFields[i]); #endif // Initialize contents pFD->Init( bmtMetaData->pFields[i], FieldDescElementType, dwMemberAttrs, IsFdStatic(dwMemberAttrs), fHasRVA, fIsThreadStatic, fIsContextStatic, pszFieldName ); // Check if the ValueType field containing non-publics is overlapped if(HasExplicitFieldOffsetLayout() && pLayoutFieldInfo && pLayoutFieldInfo->m_fIsOverlapped && pByValueClass && pByValueClass->HasNonPublicFields()) { if (!Security::CanSkipVerification(GetAssembly()->GetDomainAssembly())) { BuildMethodTableThrowException(IDS_CLASSLOAD_BADOVERLAP); } //SetHasNonVerifiablyOverLayedFields(); } if (fIsByValue) { if (!IsFdStatic(dwMemberAttrs) && (IsBlittable() || HasExplicitFieldOffsetLayout())) { pFD->m_pMTOfEnclosingClass = (MethodTable *)(DWORD_PTR)(*pByValueClassCache)[dwCurrentDeclaredField]->GetNumInstanceFieldBytes(); if (pLayoutFieldInfo) IfFailThrow(pFD->SetOffset(pLayoutFieldInfo->m_offset)); else pFD->SetOffset(FIELD_OFFSET_VALUE_CLASS); } else if (!IsFdStatic(dwMemberAttrs) && IsManagedSequential()) { pFD->m_pMTOfEnclosingClass = (MethodTable *)(DWORD_PTR)(*pByValueClassCache)[dwCurrentDeclaredField]->GetNumInstanceFieldBytes(); IfFailThrow(pFD->SetOffset(pLayoutFieldInfo->m_managedOffset)); } else { // static value class fields hold a handle, which is ptr sized // (instance field layout ignores this value) pFD->m_pMTOfEnclosingClass = (MethodTable *) LOG2_PTRSIZE; pFD->SetOffset(FIELD_OFFSET_VALUE_CLASS); } } else { // Use the field's MethodTable to temporarily store the field's size pFD->m_pMTOfEnclosingClass = (MethodTable *)(size_t)dwLog2FieldSize; // -1 means that this field has not yet been placed // -2 means that this is a GC Pointer field not yet places if ((IsBlittable() || HasExplicitFieldOffsetLayout()) && !(IsFdStatic(dwMemberAttrs))) IfFailThrow(pFD->SetOffset(pLayoutFieldInfo->m_offset)); else if (IsManagedSequential() && !(IsFdStatic(dwMemberAttrs))) IfFailThrow(pFD->SetOffset(pLayoutFieldInfo->m_managedOffset)); else if (bCurrentFieldIsGCPointer) pFD->SetOffset(FIELD_OFFSET_UNPLACED_GC_PTR); else pFD->SetOffset(FIELD_OFFSET_UNPLACED); } if (!IsFdStatic(dwMemberAttrs)) { if (!fIsByValue) { if (++bmtFP->NumInstanceFieldsOfSize[dwLog2FieldSize] == 1) bmtFP->FirstInstanceFieldOfSize[dwLog2FieldSize] = dwCurrentDeclaredField; } dwCurrentDeclaredField++; if (bCurrentFieldIsGCPointer) bmtFP->NumInstanceGCPointerFields++; } else /* static fields */ { // Static fields are stored in the vtable after the vtable and interface slots. We don't // know how large the vtable will be, so we will have to fixup the slot number by // <vtable + interface size> later. dwCurrentStaticField++; if(fHasRVA) { #ifdef RVA_FIELD_VALIDATION_ENABLED // Check if we place ObjectRefs into RVA field if((FieldDescElementType==ELEMENT_TYPE_CLASS) ||((FieldDescElementType==ELEMENT_TYPE_VALUETYPE) &&pByValueClass->HasFieldsWhichMustBeInited())) { BAD_FORMAT_NOTHROW_ASSERT(!"ObjectRef in an RVA field"); BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil); } // Check if we place ValueType with non-public fields into RVA field if((FieldDescElementType==ELEMENT_TYPE_VALUETYPE) &&pByValueClass->HasNonPublicFields()) { GCX_COOP(); if (!Security::CanHaveRVA(pFD, GetAssembly())) { BAD_FORMAT_NOTHROW_ASSERT(!"ValueType with non-public fields as a type of an RVA field"); BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil); } } #endif // RVA_FIELD_VALIDATION_ENABLED // Set the field offset DWORD rva; IfFailThrow(pInternalImport->GetFieldRVA(pFD->GetMemberDef(), &rva)); #ifdef RVA_FIELD_VALIDATION_ENABLED // Ensure that the IL image is loaded. Note that this assembly may // have an ngen image, but this type may have failed to load during ngen. pMod->GetFile()->LoadLibrary(FALSE); DWORD fldSize = (FieldDescElementType == ELEMENT_TYPE_VALUETYPE) ? pByValueClass->GetNumInstanceFieldBytes() : GetSizeForCorElementType(FieldDescElementType); if (!pMod->CheckRvaField(rva, fldSize)) { GCX_COOP(); if (!Security::CanHaveRVA(pFD, GetAssembly())) { BAD_FORMAT_NOTHROW_ASSERT(!"Illegal RVA of a mapped field"); BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil); } } #endif // RVA_FIELD_VALIDATION_ENABLED IfFailThrow(pFD->SetOffsetRVA(rva)); #ifdef RVA_FIELD_OVERLAPPING_VALIDATION_ENABLED // Check if the field overlaps with known RVA fields BYTE* pbModuleBase = pMod->GetILBase(); DWORD dwSizeOfThisField = FieldDescElementType==ELEMENT_TYPE_VALUETYPE ? pByValueClass->GetNumInstanceFieldBytes() : GetSizeForCorElementType(FieldDescElementType); BYTE* FDfrom = pbModuleBase + pFD->GetOffset_NoLogging(); BYTE* FDto = FDfrom + dwSizeOfThisField; ULONG j; if(g_drRVAField) { for(j=1; j < g_ulNumRVAFields; j++) { if((*g_drRVAField)[j].pbStart >= FDto) continue; if((*g_drRVAField)[j].pbEnd <= FDfrom) continue; } } else { g_drRVAField = new (nothrow) DynamicArray<RVAFSE>; if (g_drRVAField == NULL) return (E_OUTOFMEMORY); } (*g_drRVAField)[g_ulNumRVAFields].pbStart = FDfrom; (*g_drRVAField)[g_ulNumRVAFields].pbEnd = FDto; g_ulNumRVAFields++; #endif // RVA_FIELD_OVERLAPPING_VALIDATION_ENABLED ; } else if (fIsThreadStatic) { DWORD size = 1 << dwLog2FieldSize; #if defined(ALIGN_ACCESS) dwThreadStaticsOffset = (DWORD)ALIGN_UP(dwThreadStaticsOffset, size); #endif IfFailThrow(pFD->SetOffset(dwThreadStaticsOffset)); // offset is the bucket index dwThreadStaticsOffset += size; } else if (fIsContextStatic) { DWORD size = 1 << dwLog2FieldSize; #if defined(ALIGN_ACCESS) dwContextStaticsOffset = (DWORD)ALIGN_UP(dwContextStaticsOffset, size); #endif IfFailThrow(pFD->SetOffset(dwContextStaticsOffset)); // offset is the bucket index dwContextStaticsOffset += size; } else { bmtFP->NumStaticFieldsOfSize[dwLog2FieldSize]++; if (bCurrentFieldIsGCPointer) bmtFP->NumStaticGCPointerFields++; if (fIsByValue) bmtFP->NumStaticGCBoxedFields++; } } } EEClass *pParent = NULL; if (bmtParent) pParent = (bmtParent->pParentMethodTable) ? bmtParent->pParentMethodTable->GetClass() : NULL; else { pParent = GetParentClass(); } DWORD dwNumInstanceFields = dwCurrentDeclaredField + (pParent ? pParent->m_wNumInstanceFields : 0); DWORD dwNumStaticFields = bmtEnumMF->dwNumStaticFields; if (dwNumInstanceFields != (WORD)dwNumInstanceFields || dwNumStaticFields != (WORD)dwNumStaticFields) { BuildMethodTableThrowException(IDS_EE_TOOMANYFIELDS); } GetHalfBakedClass()->SetNumInstanceFields((WORD)dwNumInstanceFields); GetHalfBakedClass()->SetNumStaticFields((WORD)dwNumStaticFields); if (ShouldAlign8(dwR8Fields, dwNumInstanceFields)) { SetAlign8Candidate(); } if (pbmtTCSInfo) { pbmtTCSInfo->dwThreadStaticsSize = dwThreadStaticsOffset; pbmtTCSInfo->dwContextStaticsSize = dwContextStaticsOffset; } //======================================================================== // END: // Go thru all fields and initialize their FieldDescs. //======================================================================== return; } //******************************************************************************* BOOL MethodTableBuilder::TestOverrideForAccessibility(Assembly *pParentAssembly, Assembly *pChildAssembly, DWORD dwParentAttrs) { CONTRACTL { THROWS; GC_TRIGGERS; } CONTRACTL_END; BOOL isSameAssembly = (pChildAssembly == pParentAssembly); // AKA "strict bit". This means that overridability is tightly bound to accessibility. if (IsMdCheckAccessOnOverride(dwParentAttrs)) { // Same Assembly if (isSameAssembly || pParentAssembly->GrantsFriendAccessTo(pChildAssembly)) { // We are not allowed to override private members if ((dwParentAttrs & mdMemberAccessMask) <= mdPrivate) { return FALSE; } } // Cross-Assembly else { // If the method marks itself as check visibility the the method must be // public, FamORAssem, or family if((dwParentAttrs & mdMemberAccessMask) <= mdAssem) { return FALSE; } } } return TRUE; } //******************************************************************************* VOID MethodTableBuilder::TestOverRide(DWORD dwParentAttrs, DWORD dwMemberAttrs, Module *pModule, Module *pParentModule, mdToken method) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM()); PRECONDITION(IsMdVirtual(dwParentAttrs)); PRECONDITION(IsMdVirtual(dwMemberAttrs)); } CONTRACTL_END; Assembly *pAssembly = pModule->GetAssembly(); Assembly *pParentAssembly = pParentModule->GetAssembly(); BOOL isSameModule = (pModule == pParentModule); BOOL isSameAssembly = (pAssembly == pParentAssembly); // Virtual methods cannot be static if (IsMdStatic(dwMemberAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_STATICVIRTUAL, method); } if (!TestOverrideForAccessibility(pParentAssembly, pAssembly, dwParentAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_ACCESS_FAILURE, method); } // // Refer to Partition II, 9.3.3 for more information on what is permitted. // enum WIDENING_STATUS { e_NO, // NO e_YES, // YES e_SA, // YES, but only when same assembly e_NSA, // YES, but only when NOT same assembly e_SM, // YES, but only when same module }; C_ASSERT(mdPrivateScope == 0x00); C_ASSERT(mdPrivate == 0x01); C_ASSERT(mdFamANDAssem == 0x02); C_ASSERT(mdAssem == 0x03); C_ASSERT(mdFamily == 0x04); C_ASSERT(mdFamORAssem == 0x05); C_ASSERT(mdPublic == 0x06); static const DWORD dwCount = mdPublic - mdPrivateScope + 1; static const WIDENING_STATUS rgWideningTable[dwCount][dwCount] = // | Base type // Subtype | mdPrivateScope mdPrivate mdFamANDAssem mdAssem mdFamily mdFamORAssem mdPublic // --------------+------------------------------------------------------------------------------------------------------- /*mdPrivateScope | */ { { e_SM, e_NO, e_NO, e_NO, e_NO, e_NO, e_NO }, /*mdPrivate | */ { e_SM, e_YES, e_NO, e_NO, e_NO, e_NO, e_NO }, /*mdFamANDAssem | */ { e_SM, e_YES, e_SA, e_NO, e_NO, e_NO, e_NO }, /*mdAssem | */ { e_SM, e_YES, e_SA, e_SA, e_NO, e_NO, e_NO }, /*mdFamily | */ { e_SM, e_YES, e_YES, e_NO, e_YES, e_NSA, e_NO }, /*mdFamORAssem | */ { e_SM, e_YES, e_YES, e_SA, e_YES, e_YES, e_NO }, /*mdPublic | */ { e_SM, e_YES, e_YES, e_YES, e_YES, e_YES, e_YES } }; DWORD idxParent = (dwParentAttrs & mdMemberAccessMask) - mdPrivateScope; DWORD idxMember = (dwMemberAttrs & mdMemberAccessMask) - mdPrivateScope; CONSISTENCY_CHECK(idxParent < dwCount); CONSISTENCY_CHECK(idxMember < dwCount); WIDENING_STATUS entry = rgWideningTable[idxMember][idxParent]; if (entry == e_NO || (entry == e_SA && !isSameAssembly && !pParentAssembly->GrantsFriendAccessTo(pAssembly)) || (entry == e_NSA && isSameAssembly) || (entry == e_SM && !isSameModule) ) { BuildMethodTableThrowException(IDS_CLASSLOAD_REDUCEACCESS, method); } return; } //******************************************************************************* VOID MethodTableBuilder::TestMethodImpl(Module *pDeclModule, Module *pImplModule, mdToken tokDecl, mdToken tokImpl) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM()); PRECONDITION(TypeFromToken(tokDecl) == mdtMethodDef); PRECONDITION(TypeFromToken(tokImpl) == mdtMethodDef); PRECONDITION(CheckPointer(pDeclModule)); PRECONDITION(CheckPointer(pImplModule)); } CONTRACTL_END BOOL isSameModule = pDeclModule->Equals(pImplModule); Assembly *pDeclAssembly = pDeclModule->GetAssembly(); Assembly *pImplAssembly = pImplModule->GetAssembly(); IMDInternalImport *pIMDDecl = pDeclModule->GetMDImport(); IMDInternalImport *pIMDImpl = pImplModule->GetMDImport(); DWORD dwDeclAttrs = pIMDDecl->GetMethodDefProps(tokDecl); DWORD dwImplAttrs = pIMDImpl->GetMethodDefProps(tokImpl); HRESULT hr = COR_E_TYPELOAD; if (!IsMdVirtual(dwDeclAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_NONVIRTUAL_DECL); } if (!IsMdVirtual(dwImplAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_MUSTBEVIRTUAL); } // Virtual methods cannot be static if (IsMdStatic(dwDeclAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_STATICVIRTUAL); } if (IsMdStatic(dwImplAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_STATICVIRTUAL); } if (IsMdFinal(dwDeclAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_FINAL_DECL); } // Since MethodImpl's do not affect the visibility of the Decl method, there's // no need to check. // If Decl's parent is other than this class, Decl must not be private mdTypeDef tkImplParent = mdTypeDefNil; mdTypeDef tkDeclParent = mdTypeDefNil; if (FAILED(hr = pIMDDecl->GetParentToken(tokDecl, &tkDeclParent))) { BuildMethodTableThrowException(hr, *bmtError); } if (FAILED(hr = pIMDImpl->GetParentToken(tokImpl, &tkImplParent))) { BuildMethodTableThrowException(hr, *bmtError); } // Make sure that we test for accessibility restrictions only if the decl is // not within our own type, as we are allowed to methodImpl a private with the // strict bit set if it is in our own type. if (!isSameModule || tkDeclParent != tkImplParent) { if (!TestOverrideForAccessibility(pDeclAssembly, pImplAssembly, dwDeclAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_ACCESS_FAILURE, tokImpl); } // Decl's parent must not be tdSealed mdToken tkGrandParentDummyVar; DWORD dwDeclTypeAttrs; pIMDDecl->GetTypeDefProps(tkDeclParent, &dwDeclTypeAttrs, &tkGrandParentDummyVar); if (IsTdSealed(dwDeclTypeAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_SEALED_DECL); } } return; } #if defined(_DEBUG) && !defined(STUB_DISPATCH_ALL) //******************************************************************************* // // If a derived class is being created, and it does not override a virtual method // from the parent class, it will use the same MethodDesc prestub as the parent. // This functions tracks such inherited methods. // // Note that the tracking does not completely reflect the class hierarchy - if the // method has already been jitted, the deriving class will use the jitted code directly // instead of using the prestub // void MethodTableBuilder::MarkInheritedVirtualMethods(MethodTable *childMT, MethodTable * parentMT) { CONTRACTL { NOTHROW; GC_NOTRIGGER; FORBID_FAULT; PRECONDITION(CheckPointer(parentMT)); } CONTRACTL_END CONSISTENCY_CHECK(CheckPointer(parentMT)); unsigned parentVirtMethods = parentMT->GetNumVirtuals(); // Walk all the methods in the parent's vtable for (unsigned i = 0; i < parentVirtMethods; i++) { // Does the childVtable use the same if (childMT->GetSlot(i) == parentMT->GetSlot(i)) { MethodDesc* pMD = childMT->GetUnknownMethodDescForSlot(i); // The permitted prestub calls count is persisted in the ngen image. // We have to simulate the increments as if the method got jitted. // This is necesary since we are running code during ngen. pMD->IncPermittedPrestubCalls(); if (!DoesSlotCallPrestub((BYTE *)childMT->GetSlot(i))) pMD->IncPrestubCalls(); } } } #endif // defined(_DEBUG) && !defined(STUB_DISPATCH_ALL) //******************************************************************************* void MethodTableBuilder::SetSecurityFlagsOnMethod(MethodDesc* pParentMethodDesc, MethodDesc* pNewMD, mdToken tokMethod, DWORD dwMemberAttrs, bmtInternalInfo* bmtInternal, bmtMetaDataInfo* bmtMetaData) { if (!Security::IsSecurityOn()) return; DWORD dwMethDeclFlags = 0; DWORD dwMethNullDeclFlags = 0; DWORD dwClassDeclFlags = 0xffffffff; DWORD dwClassNullDeclFlags = 0xffffffff; if ( IsMdHasSecurity(dwMemberAttrs) || IsTdHasSecurity(GetAttrClass()) || pNewMD->IsNDirect() ) { // Disable inlining for any function which does runtime declarative // security actions. DWORD dwRuntimeSecurityFlags = (pNewMD->GetSecurityFlagsDuringClassLoad(bmtInternal->pInternalImport, tokMethod, GetCl(), &dwClassDeclFlags, &dwClassNullDeclFlags, &dwMethDeclFlags, &dwMethNullDeclFlags) & DECLSEC_RUNTIME_ACTIONS); if (dwRuntimeSecurityFlags) { // If we get here it means // - We have some "runtime" actions on this method. We dont care about "linktime" demands // - If this is a pinvoke method, then the unmanaged code access demand has not been suppressed pNewMD->SetNotInline(true); pNewMD->SetInterceptedForDeclSecurity(true); pNewMD->SetInterceptedForDeclSecurityCASDemandsOnly( MethodSecurityDescriptor::IsDeclSecurityCASDemandsOnly(dwRuntimeSecurityFlags, tokMethod, bmtInternal->pInternalImport )); } } if ( IsMdHasSecurity(dwMemberAttrs) ) { // We only care about checks that are not empty... dwMethDeclFlags &= ~dwMethNullDeclFlags; if ( dwMethDeclFlags & (DECLSEC_LINK_CHECKS|DECLSEC_NONCAS_LINK_DEMANDS) ) { pNewMD->SetRequiresLinktimeCheck(); } if ( dwMethDeclFlags & (DECLSEC_INHERIT_CHECKS|DECLSEC_NONCAS_INHERITANCE) ) { pNewMD->SetRequiresInheritanceCheck(); if (IsInterface()) { GetHalfBakedClass()->SetSomeMethodsRequireInheritanceCheck(); } } } // Linktime checks on a method override those on a class. // If the method has an empty set of linktime checks, // then don't require linktime checking for this method. if ( RequiresLinktimeCheck() && !(dwMethNullDeclFlags & DECLSEC_LINK_CHECKS) ) { pNewMD->SetRequiresLinktimeCheck(); } if ( pParentMethodDesc != NULL && (pParentMethodDesc->RequiresInheritanceCheck() || pParentMethodDesc->ParentRequiresInheritanceCheck()) ) { pNewMD->SetParentRequiresInheritanceCheck(); } // Methods on an interface that includes an UnmanagedCode check // suppression attribute are assumed to be interop methods. We ask // for linktime checks on these. // Also place linktime checks on all P/Invoke calls. if ((IsInterface() && (bmtInternal->pInternalImport->GetCustomAttributeByName(GetCl(), COR_SUPPRESS_UNMANAGED_CODE_CHECK_ATTRIBUTE_ANSI, NULL, NULL) == S_OK || bmtInternal->pInternalImport->GetCustomAttributeByName(pNewMD->GetMemberDef(), COR_SUPPRESS_UNMANAGED_CODE_CHECK_ATTRIBUTE_ANSI, NULL, NULL) == S_OK) ) || pNewMD->IsNDirect() || (pNewMD->IsComPlusCall() && !IsInterface())) { pNewMD->SetRequiresLinktimeCheck(); } // All public methods on public types will do a link demand of // full trust, unless AllowUntrustedCaller attribute is set if ( #ifdef _DEBUG g_pConfig->Do_AllowUntrustedCaller_Checks() && #endif !pNewMD->RequiresLinktimeCheck()) { // If the method is public (visible outside it's assembly), // and the type is public and the assembly // is not marked with AllowUntrustedCaller attribute, do // a link demand for full trust on all callers note that // this won't be effective on virtual overrides. The caller // can allways do a virtual call on the base type / interface if (Security::MethodIsVisibleOutsideItsAssembly( dwMemberAttrs, GetAttrClass())) { _ASSERTE(GetClassLoader()); _ASSERTE(GetAssembly()); // See if the Assembly has AllowUntrustedCallerChecks CA // Pull this page in last if (!GetAssembly()->AllowUntrustedCaller()) pNewMD->SetRequiresLinktimeCheck(); } } // If it's a delegate BeginInvoke, we need to do a HostProtection check for synchronization if(IsAnyDelegateClass()) { DelegateEEClass* pDelegateClass = (DelegateEEClass*)GetHalfBakedClass(); if(pNewMD == pDelegateClass->m_pBeginInvokeMethod) pNewMD->SetRequiresLinktimeCheck(); } } //******************************************************************************* // // Used by BuildMethodTable // // Determine vtable placement for each member in this class // VOID MethodTableBuilder::PlaceMembers(DWORD numDeclaredInterfaces, BuildingInterfaceInfo_t *pBuildingInterfaceList, AllocMemTracker *pamTracker) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(this)); PRECONDITION(CheckPointer(bmtInternal)); PRECONDITION(CheckPointer(bmtMetaData)); PRECONDITION(CheckPointer(bmtError)); PRECONDITION(CheckPointer(bmtProp)); PRECONDITION(CheckPointer(bmtInterface)); PRECONDITION(CheckPointer(bmtParent)); PRECONDITION(CheckPointer(bmtMFDescs)); PRECONDITION(CheckPointer(bmtEnumMF)); PRECONDITION(CheckPointer(bmtMethodImpl)); PRECONDITION(CheckPointer(bmtVT)); } CONTRACTL_END; #ifdef _DEBUG LPCUTF8 pszDebugName,pszDebugNamespace; bmtInternal->pModule->GetMDImport()->GetNameOfTypeDef(GetCl(), &pszDebugName, &pszDebugNamespace); #endif // _DEBUG HRESULT hr = S_OK; bmtVT->wCCtorSlot = MethodTable::NO_SLOT; bmtVT->wDefaultCtorSlot = MethodTable::NO_SLOT; DeclaredMethodIterator it(*this); while (it.Next()) { PCCOR_SIGNATURE pMemberSignature = NULL; DWORD cMemberSignature = 0; DWORD dwParentAttrs; // for IL code that is implemented here must have a valid code RVA // this came up due to a linker bug where the ImplFlags/DescrOffset were // being set to null and we weren't coping with it if (it.RVA() == 0) { if((it.ImplFlags() == 0 || IsMiIL(it.ImplFlags()) || IsMiOPTIL(it.ImplFlags())) && !IsMiRuntime(it.ImplFlags()) && !IsMdAbstract(it.Attrs()) && !IsReallyMdPinvokeImpl(it.Attrs()) && !IsMiInternalCall(it.ImplFlags()) && !(bmtInternal->pModule)->IsReflection() && !(IsInterface() && !IsMdStatic(it.Attrs())) && bmtDomain->IsExecutable()) { BuildMethodTableThrowException(IDS_CLASSLOAD_MISSINGMETHODRVA, it.Token()); } } else { if (!GetModule()->CheckIL(it.RVA())) { BuildMethodTableThrowException(IDS_CLASSLOAD_MISSINGMETHODRVA, it.Token()); } } // If this member is a method which overrides a parent method, it will be set to non-NULL MethodDesc *pParentMethodDesc = NULL; BOOL fIsInitMethod = FALSE; BOOL fIsCCtor = FALSE; BOOL fIsDefaultCtor = FALSE; #ifdef _DEBUG if(GetHalfBakedClass()->m_fDebuggingClass && g_pConfig->ShouldBreakOnMethod(it.Name())) _ASSERTE(!"BreakOnMethodName"); #endif // _DEBUG // constructors and class initialisers are special if (IsMdRTSpecialName(it.Attrs())) { if (IsMdStatic(it.Attrs())) { // The only rtSpecialName static method allowed is the .cctor if(strcmp(it.Name(), COR_CCTOR_METHOD_NAME) != 0) { BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); } else { // Validate that we have the correct signature for the .cctor pMemberSignature = it.GetSig(&cMemberSignature); PCCOR_SIGNATURE pbBinarySig; ULONG cbBinarySig; // .cctor must return void, have default call conv, and have no args unsigned cconv,nargs; pbBinarySig = pMemberSignature; cconv = CorSigUncompressData(pbBinarySig); nargs = CorSigUncompressData(pbBinarySig); if((*pbBinarySig != ELEMENT_TYPE_VOID)||(nargs!=0)||(cconv != IMAGE_CEE_CS_CALLCONV_DEFAULT)) { BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); } else { gsig_SM_RetVoid.GetBinarySig(&pbBinarySig, &cbBinarySig); // No substitutions for type parameters as the method is static if (MetaSig::CompareMethodSigs(pbBinarySig, cbBinarySig, SystemDomain::SystemModule(), NULL, pMemberSignature, cMemberSignature, bmtInternal->pModule, NULL)) { fIsCCtor = TRUE; } else { BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); } } } } else { // Verify the name for a constructor. if(strcmp(it.Name(), COR_CTOR_METHOD_NAME) != 0) { BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); } else { // See if this is a default constructor. If so, remember it for later. pMemberSignature = it.GetSig(&cMemberSignature); PCCOR_SIGNATURE pbBinarySig; ULONG cbBinarySig; // .ctor must return void pbBinarySig = pMemberSignature; CorSigUncompressData(pbBinarySig); // get call conv out of the way CorSigUncompressData(pbBinarySig); // get num args out of the way if(*pbBinarySig != ELEMENT_TYPE_VOID) { BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); } else { gsig_IM_RetVoid.GetBinarySig(&pbBinarySig, &cbBinarySig); if (MetaSig::CompareMethodSigs(pbBinarySig, cbBinarySig, SystemDomain::SystemModule(), NULL, pMemberSignature, cMemberSignature, bmtInternal->pModule, NULL)) fIsDefaultCtor = TRUE; } fIsInitMethod = TRUE; } } } // The method does not have the special marking else { if (IsMdVirtual(it.Attrs())) { // Hash that a method with this name exists in this class // Note that ctors and static ctors are not added to the table DWORD dwHashName = HashStringA(it.Name()); BOOL fMethodConstraintsMatch = FALSE; // If the member is marked with a new slot we do not need to find it // in the parent if (!IsMdNewSlot(it.Attrs())) { // If we're not doing sanity checks, then assume that any method declared static // does not attempt to override some virtual parent. if (!IsMdStatic(it.Attrs()) && bmtParent->pParentMethodTable != NULL) { // Attempt to find the method with this name and signature in the parent class. // This method may or may not create pParentMethodHash (if it does not already exist). // It also may or may not fill in pMemberSignature/cMemberSignature. // An error is only returned when we can not create the hash. // NOTE: This operation touches metadata { HRESULT hrTmp; hrTmp = LoaderFindMethodInClass( it.Name(), bmtInternal->pModule, it.Token(), &pParentMethodDesc, &pMemberSignature, &cMemberSignature, dwHashName, &fMethodConstraintsMatch); if (FAILED(hrTmp)) { BuildMethodTableThrowException(hrTmp, *bmtError); } } if (pParentMethodDesc != NULL) { dwParentAttrs = pParentMethodDesc->GetAttrs(); if (!IsMdVirtual(dwParentAttrs)) { BuildMethodTableThrowException(BFA_NONVIRT_NO_SEARCH, it.Token()); } CONSISTENCY_CHECK(!fIsInitMethod); // if we end up pointing at a slot that is final we are not allowed to override it. if(IsMdFinal(dwParentAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_FINAL_DECL, it.Token()); } else if(!bmtProp->fNoSanityChecks) { TestOverRide(dwParentAttrs, it.Attrs(), GetModule(), pParentMethodDesc->GetModule(), it.Token()); } if (!fMethodConstraintsMatch) { BuildMethodTableThrowException( IDS_CLASSLOAD_CONSTRAINT_MISMATCH_ON_IMPLICIT_OVERRIDE, it.Token()); } if (g_pConfig->ShouldRejectSafeHandleFinalizers() && bmtParent->pParentMethodTable->HasCriticalFinalizer() && 0 == strcmp("Finalize", it.Name())) { bool isSafeHandle = false; // Is this a subclass of SafeHandle? MethodTable * currMT = bmtParent->pParentMethodTable; while(currMT != NULL) { if (currMT == g_Mscorlib.FetchClass(CLASS__SAFE_HANDLE)) { isSafeHandle = true; break; } currMT = currMT->GetParentMethodTable(); } if (isSafeHandle) { BuildMethodTableThrowException(IDS_CLASSLOAD_SH_SUBCLASS_FINALIZER, it.Token()); } } } } } } } // Now we know the classification we can allocate the correct type of // method desc and perform any classification specific initialization. bmtTokenRangeNode *pTR = GetTokenRange(it.Token(), &(bmtMetaData->ranges[it.MethodType()][it.MethodImpl()])); // throws CONSISTENCY_CHECK(pTR->cMethods != 0); bmtMethodDescSet *set = &bmtMFDescs->sets[it.MethodType()][it.MethodImpl()]; CONSISTENCY_CHECK(CheckPointer(set)); MethodDescChunk *pChunk = set->pChunkList[pTR->dwCurrentChunk]; // The MethodDesc we allocate for this method MethodDesc *pNewMD = pChunk->GetMethodDescAt(pTR->dwCurrentIndex); LPCSTR pName = it.Name(); if (pName == NULL) pName = bmtInternal->pInternalImport->GetNameOfMethodDef(it.Token()); // Update counters to prepare for next method desc allocation. pTR->dwCurrentIndex++; if (pTR->dwCurrentIndex == MethodDescChunk::GetMaxMethodDescs(it.Classification())) { pTR->dwCurrentChunk++; pTR->dwCurrentIndex = 0; } #ifdef _DEBUG LPCUTF8 pszDebugMethodName = bmtInternal->pInternalImport->GetNameOfMethodDef(it.Token()); size_t len = strlen(pszDebugMethodName) + 1; LPCUTF8 pszDebugMethodNameCopy = (char*) pamTracker->Track(bmtDomain->GetLowFrequencyHeap()->AllocMem(len)); strcpy_s((char *) pszDebugMethodNameCopy, len, pszDebugMethodName); #endif // _DEBUG // Do the init specific to each classification of MethodDesc & assign some common fields InitMethodDesc(bmtDomain, pNewMD, it.Classification(), it.Token(), it.ImplFlags(), it.Attrs(), FALSE, it.RVA(), bmtInternal->pInternalImport, pName, #ifdef _DEBUG pszDebugMethodNameCopy, GetDebugClassName(), "", // FIX this happens on global methods, give better info #endif // _DEBUG pamTracker ); CONSISTENCY_CHECK(CheckPointer(bmtParent->ppParentMethodDescBufPtr)); CONSISTENCY_CHECK(((bmtParent->ppParentMethodDescBufPtr - bmtParent->ppParentMethodDescBuf) / sizeof(MethodDesc*)) < NumDeclaredMethods()); *(bmtParent->ppParentMethodDescBufPtr++) = pParentMethodDesc; *(bmtParent->ppParentMethodDescBufPtr++) = pNewMD; // Declarative Security SetSecurityFlagsOnMethod(pParentMethodDesc, pNewMD, it.Token(), it.Attrs(), bmtInternal, bmtMetaData); it.SetMethodDesc(pNewMD); it.SetParentMethodDesc(pParentMethodDesc); // Make sure that fcalls have a 0 rva. This is assumed by the prejit fixup logic if ((it.Classification() & ~mdcMethodImpl) == mcFCall && it.RVA() != 0) { BuildMethodTableThrowException(BFA_ECALLS_MUST_HAVE_ZERO_RVA, it.Token()); } if (!IsMdVirtual(it.Attrs())) { // non-vtable method CONSISTENCY_CHECK(bmtVT->pNonVtableMD[bmtVT->dwCurrentNonVtableSlot] == NULL); bmtVT->pNonVtableMD[bmtVT->dwCurrentNonVtableSlot] = pNewMD; // Not prestub addr pNewMD->SetSlot((WORD) bmtVT->dwCurrentNonVtableSlot); if (fIsDefaultCtor) bmtVT->wDefaultCtorSlot = (WORD) bmtVT->dwCurrentNonVtableSlot; else if (fIsCCtor) bmtVT->wCCtorSlot = (WORD) bmtVT->dwCurrentNonVtableSlot; bmtVT->dwCurrentNonVtableSlot++; } else { pNewMD->SetSlot(MethodTable::NO_SLOT); // mark it initially as unplaced // vtable method if (IsInterface()) { CONSISTENCY_CHECK(pParentMethodDesc == NULL); // if we're an interface, our slot number is fixed CONSISTENCY_CHECK(bmtVT->GetMethodDescForSlot(bmtVT->dwCurrentVtableSlot) == NULL); bmtVT->SetMethodDescForSlot(bmtVT->dwCurrentVtableSlot, pNewMD); pNewMD->SetSlot((WORD) bmtVT->dwCurrentVtableSlot); bmtVT->dwCurrentVtableSlot++; } else if (pParentMethodDesc != NULL) { WORD slotNumber = pParentMethodDesc->GetSlot(); // No need for placeholder MDs with stub dispatch. CONSISTENCY_CHECK(!pParentMethodDesc->IsInterface()); // we are overriding a parent method, so place this method now bmtVT->SetMethodDescForSlot(slotNumber, pNewMD); pNewMD->SetSlot(slotNumber); CONSISTENCY_CHECK(!bmtVT->pDispatchMapBuilder->Contains( DispatchMapTypeID::ThisClassID(), pParentMethodDesc->GetSlot())); CONSISTENCY_CHECK(bmtParent->pParentMethodTable == NULL || slotNumber < bmtParent->pParentMethodTable->GetNumVirtuals()); // We add the override entry to the mapping. bmtVT->pDispatchMapBuilder->InsertMDMapping( DispatchMapTypeID::ThisClassID(), pParentMethodDesc->GetSlot(), pNewMD, FALSE); } else { bmtVT->SetMethodDescForSlot(bmtVT->dwCurrentVtableSlot, pNewMD); pNewMD->SetSlot((WORD) bmtVT->dwCurrentVtableSlot); bmtVT->dwCurrentVtableSlot++; } } // If this method serves as the BODY of a MethodImpl specification, then // we should iterate all the MethodImpl's for this class and see just how many // of them this method participates in as the BODY. if(it.Classification() & mdcMethodImpl) { for(DWORD m = 0; m < bmtEnumMF->dwNumberMethodImpls; m++) { if(it.Token() == bmtMetaData->rgMethodImplTokens[m].methodBody) { MethodDesc* pDeclMD = NULL; BOOL fIsMethod; mdToken mdDecl = bmtMetaData->rgMethodImplTokens[m].methodDecl; DWORD dwDeclAttrs; Substitution *pDeclSubst = &bmtMetaData->pMethodDeclSubsts[m]; // Get the parent mdToken tkParent = mdTypeDefNil; if (TypeFromToken(mdDecl) == mdtMethodDef || TypeFromToken(mdDecl) == mdtMemberRef) { if (FAILED(hr = bmtInternal->pInternalImport->GetParentToken(mdDecl,&tkParent))) { BuildMethodTableThrowException(hr, *bmtError); } } // The DECL has been declared within the class // that we're currently building. if (GetCl() == tkParent) { hr = S_OK; if(pThrowableAvailable(bmtError->pThrowable)) *(bmtError->pThrowable) = NULL; if(TypeFromToken(mdDecl) != mdtMethodDef) { Module* pModule; if (FAILED(hr = FindMethodDeclarationForMethodImpl( mdDecl, &mdDecl, FALSE, &pModule))) { BuildMethodTableThrowException(hr, *bmtError); } // Remember, the decl is in the same type as the impl. CONSISTENCY_CHECK(pModule == bmtInternal->pModule); } dwDeclAttrs = bmtInternal->pInternalImport->GetMethodDefProps(mdDecl); } else { pDeclMD = (MethodDesc*) MemberLoader::GetDescFromMemberDefOrRefThrowing( bmtInternal->pModule, mdDecl, &fIsMethod, &bmtGenerics->typeContext, // type context FALSE, // don't demand generic method args 0, NULL, FALSE /*allowInstParam*/, CLASS_LOAD_APPROXPARENTS); _ASSERTE(pDeclMD != NULL); // We found a non-method, so throw. if (!fIsMethod) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_DECLARATIONNOTFOUND, it.Token()); } mdDecl = mdTokenNil; dwDeclAttrs = pDeclMD->GetAttrs(); } // Make sure the impl and decl are virtaul if (!IsMdVirtual(dwDeclAttrs)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_MUSTBEVIRTUAL, it.Token()); } if (!IsMdVirtual(it.Attrs())) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_VIRTUALMISMATCH, it.Token()); } bmtMethodImpl->AddMethod(pNewMD, pDeclMD, mdDecl, pDeclSubst); } } } // check for proper use of the Managed and native flags if (IsMiManaged(it.ImplFlags())) { if (IsMiIL(it.ImplFlags()) || IsMiRuntime(it.ImplFlags())) // IsMiOPTIL(it.ImplFlags()) no longer supported { // No need to set code address, pre stub used automatically. } else { if (IsMiNative(it.ImplFlags())) { // For now simply disallow managed native code if you turn this on you have to at least // insure that we have SkipVerificationPermission or equivalent BuildMethodTableThrowException(BFA_MANAGED_NATIVE_NYI, it.Token()); } else { BuildMethodTableThrowException(BFA_BAD_IMPL_FLAGS, it.Token()); } } } else { if (IsMiNative(it.ImplFlags()) && IsGlobalClass()) { // global function unmanaged entrypoint via IJW thunk was handled // above. } else { BuildMethodTableThrowException(IDS_CLASSLOAD_BAD_UNMANAGED_RVA, it.Token()); } if (it.Classification() != mcNDirect) { BuildMethodTableThrowException(BFA_BAD_UNMANAGED_ENTRY_POINT); } } // Turn off inlining for any calls // that are marked in the metadata as not being inlineable. if(IsMiNoInlining(it.ImplFlags())) { pNewMD->SetNotInline(true); } // Vararg methods are not allowed inside generic classes // and nor can they be generic methods. if (bmtGenerics->GetNumGenericArgs() > 0 || ((it.Classification() & mdcClassification) == mcInstantiated) ) { // We've been trying to avoid asking for the signature - now we need it if (pMemberSignature == NULL) { pMemberSignature = it.GetSig(&cMemberSignature); } if (MetaSig::IsVarArg(GetModule(), pMemberSignature)) { BuildMethodTableThrowException(BFA_GENCODE_NOT_BE_VARARG); } } } /* end ... for each member */ } //******************************************************************************* // InitMethodDesc takes a pointer to space that's already allocated for the // particular type of MethodDesc, and initializes based on the other info. // This factors logic between PlaceMembers (the regular code path) & AddMethod // (Edit & Continue (EnC) code path) so we don't have to maintain separate copies. VOID MethodTableBuilder::InitMethodDesc(BaseDomain *bmtDomain, MethodDesc *pNewMD, // This is should actually be of the correct // sub-type, based on Classification DWORD Classification, mdToken tok, DWORD dwImplFlags, DWORD dwMemberAttrs, BOOL fEnC, DWORD RVA, // Only needed for NDirect case IMDInternalImport *pIMDII, // Needed for NDirect, EEImpl(Delegate) cases LPCSTR pMethodName, // Only needed for mcEEImpl (Delegate) case #ifdef _DEBUG LPCUTF8 pszDebugMethodName, LPCUTF8 pszDebugClassName, LPUTF8 pszDebugMethodSignature, #endif // _DEBUG AllocMemTracker *pamTracker ) { CONTRACTL { THROWS; WRAPPER(GC_TRIGGERS); INJECT_FAULT(COMPlusThrowOM()); } CONTRACTL_END LOG((LF_CORDB, LL_EVERYTHING, "EEC::IMD: pNewMD:0x%x for tok:0x%x (%s::%s)\n", pNewMD, tok, pszDebugClassName, pszDebugMethodName)); // Now we know the classification we can perform any classification specific initialization. // The method desc is zero inited by the caller. switch (Classification & mdcClassification) { case mcNDirect: { // NDirect specific initialization. NDirectMethodDesc *pNewNMD = (NDirectMethodDesc*)pNewMD; // Allocate writeable data pNewNMD->ndirect.m_pWriteableData = (NDirectWriteableData*) pamTracker->Track(bmtDomain->GetHighFrequencyHeap()->AllocMem(sizeof(NDirectWriteableData))); #ifdef HAS_NDIRECT_IMPORT_PRECODE pNewNMD->ndirect.m_pImportThunkGlue = Precode::Allocate(PRECODE_NDIRECT_IMPORT, pNewMD, FALSE, bmtDomain, pamTracker)->AsNDirectImportPrecode(); #else pNewNMD->GetNDirectImportThunkGlue()->Init(pNewNMD, bmtDomain); #endif pNewNMD->GetWriteableData()->m_pNDirectTarget = pNewNMD->GetNDirectImportThunkGlue()->GetEntrypoint(); } break; case mcFCall: break; case mcEEImpl: // For the Invoke method we will set a standard invoke method. BAD_FORMAT_NOTHROW_ASSERT(IsAnyDelegateClass()); // For the asserts, either the pointer is NULL (since the class hasn't // been constructed yet), or we're in EnC mode, meaning that the class // does exist, but we may be re-assigning the field to point to an // updated MethodDesc // It is not allowed for EnC to replace one of the runtime builtin methods if (strcmp(pMethodName, "Invoke") == 0) { BAD_FORMAT_NOTHROW_ASSERT(NULL == ((DelegateEEClass*)GetHalfBakedClass())->m_pInvokeMethod); ((DelegateEEClass*)GetHalfBakedClass())->m_pInvokeMethod = pNewMD; } else if (strcmp(pMethodName, "BeginInvoke") == 0) { BAD_FORMAT_NOTHROW_ASSERT(NULL == ((DelegateEEClass*)GetHalfBakedClass())->m_pBeginInvokeMethod); ((DelegateEEClass*)GetHalfBakedClass())->m_pBeginInvokeMethod = pNewMD; } else if (strcmp(pMethodName, "EndInvoke") == 0) { BAD_FORMAT_NOTHROW_ASSERT(NULL == ((DelegateEEClass*)GetHalfBakedClass())->m_pEndInvokeMethod); ((DelegateEEClass*)GetHalfBakedClass())->m_pEndInvokeMethod = pNewMD; } else { BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); } // StoredSig specific intialization { StoredSigMethodDesc *pNewSMD = (StoredSigMethodDesc*) pNewMD;; DWORD cSig; PCCOR_SIGNATURE pSig = pIMDII->GetSigOfMethodDef(tok, &cSig); pNewSMD->SetStoredMethodSig(pSig, cSig); } break; case mcIL: break; case mcInstantiated: { // Initialize the typical instantiation. InstantiatedMethodDesc* pNewIMD = (InstantiatedMethodDesc*) pNewMD; pNewIMD->SetupGenericMethodDefinition(pIMDII,bmtDomain,GetModule(), tok,IsTypicalTypeDefinition()); } break; default: BAD_FORMAT_NOTHROW_ASSERT(!"Failed to set a method desc classification"); } // Check the method desc's classification. _ASSERTE(pNewMD->GetClassification() == (Classification & mdcClassification)); _ASSERTE(!pNewMD->IsMethodImpl() == !(Classification & mdcMethodImpl)); pNewMD->SetMemberDef(tok); if (IsMdStatic(dwMemberAttrs)) pNewMD->SetStatic(); // Set suppress unmanaged code access permission attribute pNewMD->ComputeSuppressUnmanagedCodeAccessAttr(pIMDII); #ifdef _DEBUG // Mark as many methods as synchronized as possible. // // Note that this can easily cause programs to deadlock, and that // should not be treated as a bug in the program. static ConfigDWORD stressSynchronized; DWORD stressSynchronizedVal = stressSynchronized.val(L"stressSynchronized", 0); bool isStressSynchronized = stressSynchronizedVal && pNewMD->IsIL() && ((g_pValueTypeClass != NULL && g_pEnumClass != NULL && !IsValueClass()) || // Can not synchronize on byref "this" IsMdStatic(dwMemberAttrs)) && // IsStatic() blows up in _DEBUG as pNewMD is not fully inited g_pObjectClass != NULL; // Ignore Object:* since "this" could be a boxed object // stressSynchronized=1 turns off the stress in the system domain to reduce // the chances of spurious deadlocks. Deadlocks in user code can still occur. // stressSynchronized=2 will probably cause more deadlocks, and is not recommended if (stressSynchronizedVal == 1 && GetAssembly()->IsSystem()) isStressSynchronized = false; if (IsMiSynchronized(dwImplFlags) || isStressSynchronized) #else // !_DEBUG if (IsMiSynchronized(dwImplFlags)) #endif // !_DEBUG pNewMD->SetSynchronized(); #ifdef _DEBUG pNewMD->m_pszDebugMethodName = (LPUTF8)pszDebugMethodName; pNewMD->m_pszDebugClassName = (LPUTF8)pszDebugClassName; pNewMD->m_pDebugMethodTable = GetHalfBakedMethodTable(); if (pszDebugMethodSignature == NULL) pNewMD->m_pszDebugMethodSignature = FormatSig(pNewMD, bmtDomain, pamTracker); else pNewMD->m_pszDebugMethodSignature = pszDebugMethodSignature; pNewMD->InitPrestubCallChecking(); #endif // _DEBUG } //******************************************************************************* // // Used by BuildMethodTable // VOID MethodTableBuilder::AddMethodImplDispatchMapping( DispatchMapTypeID typeID, UINT32 slotNumber, MethodDesc* pMDImpl, BOOL fIsVirtual) { CONTRACTL { THROWS; GC_TRIGGERS; } CONTRACTL_END; // Look for an existing entry in the map. DispatchMapBuilder::Iterator it(bmtVT->pDispatchMapBuilder); if (bmtVT->pDispatchMapBuilder->Find(typeID, slotNumber, it)) { // Throw if this entry has already previously been MethodImpl'd. if (it.IsMethodImpl()) { // NOTE: This is where we check for duplicate overrides. This is the easiest place to check // because duplicate overrides could in fact have separate MemberRefs to the same // member and so just comparing tokens at the very start would not be enough. if (it.GetTargetMD() != pMDImpl) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_MULTIPLEOVERRIDES, pMDImpl->GetMemberDef()); } } // This is the first MethodImpl. That's ok. else { it.SetTarget(pMDImpl); it.SetIsMethodImpl(TRUE); } } // A mapping for this interface method does not exist, so insert it. else { bmtVT->pDispatchMapBuilder->InsertMDMapping( typeID, slotNumber, pMDImpl, fIsVirtual, TRUE); } // Save the entry into the vtable as well, if it isn't an interface methodImpl if (typeID == DispatchMapTypeID::ThisClassID()) { bmtVT->SetMethodDescForSlot(slotNumber, pMDImpl); } } //******************************************************************************* VOID MethodTableBuilder::MethodImplCompareSignatures( mdMethodDef mdDecl, IMDInternalImport* pImportDecl, Module* pModuleDecl, const Substitution* pSubstDecl, mdMethodDef mdImpl, IMDInternalImport* pImportImpl, Module* pModuleImpl, const Substitution* pSubstImpl, PCCOR_SIGNATURE* ppImplSignature, DWORD* pcImplSignature, DWORD dwConstraintErrorCode) { CONTRACTL { THROWS; GC_TRIGGERS; PRECONDITION(TypeFromToken(mdDecl) == mdtMethodDef); PRECONDITION(TypeFromToken(mdImpl) == mdtMethodDef); } CONTRACTL_END; // Get the signature for the IMPL, if unavailable if(*ppImplSignature == NULL) { *ppImplSignature = pImportImpl->GetSigOfMethodDef(mdImpl, pcImplSignature); } // Get the signature for the DECL PCCOR_SIGNATURE pDeclSignature = NULL; DWORD cDeclSignature = 0; pDeclSignature = pImportDecl->GetSigOfMethodDef(mdDecl, &cDeclSignature); // Compare the signatures HRESULT hr = MetaSig::CompareMethodSigsNT( pDeclSignature, cDeclSignature, pModuleDecl, pSubstDecl, *ppImplSignature, *pcImplSignature, pModuleImpl, pSubstImpl); // S_FALSE means the comparison was successful, but the signatures do not match if (hr == S_FALSE) { hr = COR_E_TYPELOAD; } // Throw if the signatures do not match if(FAILED(hr)) { LOG((LF_CLASSLOADER, LL_INFO1000, "BADSIG placing MethodImpl: %x\n", mdDecl)); BuildMethodTableThrowException(hr, IDS_CLASSLOAD_MI_BADSIGNATURE, mdDecl); } //now compare the method constraints if (!MetaSig::CompareMethodConstraints(pModuleImpl,mdImpl, pSubstDecl,pModuleDecl,mdDecl)) { BuildMethodTableThrowException(dwConstraintErrorCode, mdImpl); } } //******************************************************************************* // We should have collected all the method impls. Cycle through them creating the method impl // structure that holds the information about which slots are overridden. VOID MethodTableBuilder::PlaceMethodImpls(AllocMemTracker *pamTracker) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END HRESULT hr = S_OK; if(bmtMethodImpl->pIndex == 0) return; DWORD pIndex = 0; MethodDesc* next = bmtMethodImpl->GetBodyMethodDesc(pIndex); // Allocate some temporary storage. The number of overrides for a single method impl // cannot be greater then the number of vtable slots. DWORD* slots = (DWORD*) GetThread()->m_MarshalAlloc.Alloc((bmtVT->dwCurrentVtableSlot) * sizeof(DWORD)); MethodDesc **replaced = (MethodDesc**) GetThread()->m_MarshalAlloc.Alloc((bmtVT->dwCurrentVtableSlot) * sizeof(MethodDesc*)); while(next != NULL) { DWORD slotIndex = 0; MethodDesc* body; // The signature for the body of the method impl. We cache the signature until all // the method impl's using the same body are done. PCCOR_SIGNATURE pBodySignature = NULL; DWORD cBodySignature = 0; // Get the MethodImpl storage CONSISTENCY_CHECK(next->IsMethodImpl()); MethodImpl* pImpl = next->GetMethodImpl(); // The impls are sorted according to the method descs for the body of the method impl. // Loop through the impls until the next body is found. When a single body // has been done move the slots implemented and method descs replaced into the storage // found on the body method desc. do { // collect information until we reach the next body body = next; // Get the declaration part of the method impl. It will either be a token // (declaration is on this type) or a method desc. MethodDesc* pDecl = bmtMethodImpl->GetDeclarationMethodDesc(pIndex); if(pDecl == NULL) { // The declaration is on this type to get the token. mdMethodDef mdef = bmtMethodImpl->GetDeclarationToken(pIndex); if (bmtMethodImpl->IsBody(mdef)) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_MULTIPLEOVERRIDES, mdef); } // Throws hr = PlaceLocalDeclaration(mdef, body, slots, // Adds override to the slot and replaced arrays. replaced, &slotIndex, // Increments count &pBodySignature, // Fills in the signature &cBodySignature); } else { // Do not use pDecl->IsInterface here as that asks the method table and the MT may not yet be set up. if(pDecl->IsInterface()) { // Throws hr = PlaceInterfaceDeclaration(pDecl, body, bmtMethodImpl->GetDeclarationSubst(pIndex), slots, replaced, &slotIndex, // Increments count &pBodySignature, // Fills in the signature &cBodySignature); } else { // Throws hr = PlaceParentDeclaration(pDecl, body, bmtMethodImpl->GetDeclarationSubst(pIndex), slots, replaced, &slotIndex, // Increments count &pBodySignature, // Fills in the signature &cBodySignature); } } pIndex++; // we hit the end of the list so leave if(pIndex == bmtMethodImpl->pIndex) next = NULL; else next = bmtMethodImpl->GetBodyMethodDesc(pIndex); } while(next == body) ; // Use the number of overrides to // push information on to the method desc. We store the slots that // are overridden and the method desc that is replaced. That way // when derived classes need to determine if the method is to be // overridden then it can check the name against the replaced // method desc not the bodies name. if(slotIndex == 0) { /* BuildMethodTableThrowException(IDS_CLASSLOAD_MI_DECLARATIONNOTFOUND, body->GetMemberDef()); */ body->ResetMethodImpl(); } else { hr = S_OK; pImpl->SetSize(bmtDomain->GetHighFrequencyHeap(), pamTracker, slotIndex); // Gasp we do a bubble sort. Should change this to a qsort.. for (DWORD i = 0; i < slotIndex; i++) { for (DWORD j = i+1; j < slotIndex; j++) { if (slots[j] < slots[i]) { MethodDesc* mTmp = replaced[i]; replaced[i] = replaced[j]; replaced[j] = mTmp; DWORD sTmp = slots[i]; slots[i] = slots[j]; slots[j] = sTmp; } } } // Go and set the method impl pImpl->SetData(slots, replaced); } } // while(next != NULL) } //******************************************************************************* HRESULT MethodTableBuilder::PlaceLocalDeclaration(mdMethodDef mdef, MethodDesc* pMDBody, DWORD* slots, MethodDesc** replaced, DWORD* pSlotIndex, PCCOR_SIGNATURE* ppBodySignature, DWORD* pcBodySignature) { CONTRACTL { THROWS; GC_TRIGGERS; PRECONDITION(CheckPointer(bmtVT->pDispatchMapBuilder)); INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END //////////////////////////////////////////////////////////////////////////////// // First, find the method matching the token. Need to search for the MethodDesc // that corresponds to this token since we need to know what slot the token has // been assigned to for updating the vtable. MethodDesc *pMDDecl = NULL; { DeclaredMethodIterator methIt(*this); while (methIt.Next()) { MethodDesc *pMD = methIt.GetMethodDesc(); PREFIX_ASSUME(pMD != NULL); if ((pMD->GetMemberDef() == mdef)) { pMDDecl = pMD; break; } } } PREFIX_ASSUME(pMDDecl != NULL); /////////////////////////////// // Verify the signatures match MethodImplCompareSignatures( pMDDecl->GetMemberDef(), bmtInternal->pInternalImport, bmtInternal->pModule, NULL, pMDBody->GetMemberDef(), bmtInternal->pInternalImport, bmtInternal->pModule, NULL, ppBodySignature, pcBodySignature, IDS_CLASSLOAD_CONSTRAINT_MISMATCH_ON_LOCAL_METHOD_IMPL); /////////////////////////////// // Validate the method impl. TestMethodImpl( bmtInternal->pModule, bmtInternal->pModule, pMDDecl->GetMemberDef(), pMDDecl->GetMemberDef()); // Don't allow overrides for any of the four special runtime implemented delegate methods if (IsAnyDelegateClass()) { IMDInternalImport *pMDInternalImport = bmtInternal->pInternalImport; _ASSERTE(mdef == pMDDecl->GetMemberDef()); LPSTR strMethodName = (LPSTR)pMDInternalImport->GetNameOfMethodDef( mdef ); if ((strcmp(strMethodName, COR_CTOR_METHOD_NAME) == 0) || (strcmp(strMethodName, "Invoke") == 0) || (strcmp(strMethodName, "BeginInvoke") == 0) || (strcmp(strMethodName, "EndInvoke") == 0) ) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_CANNOT_OVERRIDE, mdef); } } /////////////////// // Add the mapping // Call helper to add it. Will throw if decl is already MethodImpl'd AddMethodImplDispatchMapping(DispatchMapTypeID::ThisClassID(), pMDDecl->GetSlot(), pMDBody, TRUE); // We implement this slot, record it slots[*pSlotIndex] = pMDDecl->GetSlot(); replaced[*pSlotIndex] = pMDDecl; // increment the counter (*pSlotIndex)++; //////////// // Success! return S_OK; } //******************************************************************************* HRESULT MethodTableBuilder::PlaceInterfaceDeclaration(MethodDesc* pDeclMD, MethodDesc* pImplMD, const Substitution *pDeclSubst, DWORD* slots, MethodDesc** replaced, DWORD* pSlotIndex, PCCOR_SIGNATURE* ppBodySignature, DWORD* pcBodySignature) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(return E_OUTOFMEMORY;); PRECONDITION(CheckPointer(pDeclMD)); PRECONDITION(pDeclMD->IsInterface()); PRECONDITION(CheckPointer(bmtVT->pDispatchMapBuilder)); } CONTRACTL_END; MethodTable *pDeclMT = pDeclMD->GetMethodTable(); ////////////////////////////////////////////////////////////// // First make sure the interface is implemented by this class { // Iterate all the interfaces in the map to find a match BOOL fInterfaceFound = FALSE; for (UINT32 i = 0; i < bmtInterface->dwInterfaceMapSize && !fInterfaceFound; i++) { MethodTable *pInterface = bmtInterface->pInterfaceMap[i].m_pMethodTable; if (MetaSig::CompareTypeDefsUnderSubstitutions(pInterface, pDeclMT, bmtInterface->ppInterfaceSubstitutionChains[i], pDeclSubst)) { fInterfaceFound = TRUE; break; } } // Throw if this class does not implement the interface of pDecl. if (!fInterfaceFound) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_NOTIMPLEMENTED, pDeclMD->GetName()); } } /////////////////////////////// // Verify the signatures match MethodImplCompareSignatures( pDeclMD->GetMemberDef(), pDeclMD->GetModule()->GetMDImport(), pDeclMD->GetModule(), pDeclSubst, pImplMD->GetMemberDef(), bmtInternal->pModule->GetMDImport(), bmtInternal->pModule, NULL, ppBodySignature, pcBodySignature, IDS_CLASSLOAD_CONSTRAINT_MISMATCH_ON_INTERFACE_METHOD_IMPL); /////////////////////////////// // Validate the method impl. TestMethodImpl( pDeclMD->GetModule(), bmtInternal->pModule, pDeclMD->GetMemberDef(), pImplMD->GetMemberDef()); /////////////////// // Add the mapping DispatchMapTypeID dispatchMapTypeID = ComputeDispatchMapTypeID(pDeclMT, pDeclSubst); CONSISTENCY_CHECK(dispatchMapTypeID.IsImplementedInterface()); // Call helper to add it. Will throw if decl is already MethodImpl'd AddMethodImplDispatchMapping(dispatchMapTypeID, pDeclMD->GetSlot(), pImplMD, TRUE); //////////// // Success! return S_OK; } //******************************************************************************* HRESULT MethodTableBuilder::PlaceParentDeclaration( MethodDesc* pMDDecl, MethodDesc* pMDImpl, const Substitution *pDeclSubst, DWORD* slots, MethodDesc** replaced, DWORD* pSlotIndex, PCCOR_SIGNATURE* ppImplSignature, DWORD* pcImplSignature) { CONTRACTL { THROWS; GC_TRIGGERS; PRECONDITION(CheckPointer(bmtVT->pDispatchMapBuilder)); INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END; MethodTable *pMTDecl = pMDDecl->GetMethodTable(); // We're given a pMDDecl, but that could be for some parent way up which was overridden later on, // so we translate to the most current decl for this slot so we make sure to take into consideration // all the current attributes of the slot. MethodDesc *pMDParentImpl = bmtParent->pParentMethodTable->GetUnknownMethodDescForSlot(pMDDecl->GetSlot()); pMDDecl = pMDParentImpl->GetDeclMethodDesc(pMDDecl->GetSlot()); //////////////////////////////////////////////////////////////// // Verify that the class of the declaration is in our heirarchy { MethodTable* pParent = bmtParent->pParentMethodTable; Substitution* pParentSubst = &bmtParent->parentSubst; Substitution* newSubst = NULL; while(pParent != NULL) { _ASSERT(pParent != NULL); if (MetaSig::CompareTypeDefsUnderSubstitutions(pParent, pMTDecl, pParentSubst, pDeclSubst)) { break; } // Move on to the next parent... newSubst = new Substitution; *newSubst = pParent->GetClass()->GetSubstitutionForParent(pParentSubst); pParentSubst = newSubst; pParent = pParent->GetParentMethodTable(); } if(newSubst != NULL) // there was at least 1 allocation { for(newSubst = pParentSubst;newSubst->GetNext()!=&bmtParent->parentSubst; newSubst=(Substitution*)(newSubst->GetNext())); memset(newSubst,0,sizeof(Substitution)); // destroy link to bmtParent->parentSubst pParentSubst->DeleteChain(); // delete all chain up to and including newSubst } if(pParent == NULL) { BuildMethodTableThrowException(IDS_CLASSLOAD_MI_NOTIMPLEMENTED, pMDDecl->GetName()); } } ///////////////////////////////////////// // Verify that the signatures match MethodImplCompareSignatures( pMDDecl->GetMemberDef(), pMDDecl->GetModule()->GetMDImport(), pMDDecl->GetModule(), pDeclSubst, pMDImpl->GetMemberDef(), bmtInternal->pInternalImport, bmtInternal->pModule, NULL, ppImplSignature, pcImplSignature, IDS_CLASSLOAD_CONSTRAINT_MISMATCH_ON_PARENT_METHOD_IMPL); //////////////////////////////// // Verify rules of method impls TestMethodImpl( pMDDecl->GetModule(), bmtInternal->pModule, pMDDecl->GetMemberDef(), pMDImpl->GetMemberDef()); /////////////////// // Add the mapping // Call helper to add it. Will throw if DECL is already MethodImpl'd AddMethodImplDispatchMapping(DispatchMapTypeID::ThisClassID(), pMDDecl->GetSlot(), pMDImpl, TRUE); // We implement this slot, record it slots[*pSlotIndex] = pMDDecl->GetSlot(); replaced[*pSlotIndex] = pMDDecl; // increment the counter (*pSlotIndex)++; //////////// // Success! return S_OK; } //******************************************************************************* // This will validate that all interface methods that were matched during // layout also validate against type constraints. VOID MethodTableBuilder::ValidateInterfaceMethodConstraints() { CONTRACTL { THROWS; GC_TRIGGERS; } CONTRACTL_END; DispatchMapBuilder::Iterator it(bmtVT->pDispatchMapBuilder); while (it.IsValid()) { if (it.GetTypeID() != DispatchMapTypeID::ThisClassID()) { InterfaceInfo_t *pItfInfo = &bmtInterface->pInterfaceMap[it.GetTypeID().GetInterfaceNum()]; // Grab the substitution for this interface Substitution *pSubst = bmtInterface->ppInterfaceSubstitutionChains[it.GetTypeID().GetInterfaceNum()]; // Grab the method token MethodTable *pMTItf = pItfInfo->m_pMethodTable; CONSISTENCY_CHECK(CheckPointer(pMTItf->GetMethodDescForSlot(it.GetSlotNumber()))); mdMethodDef mdTok = pItfInfo->m_pMethodTable->GetMethodDescForSlot(it.GetSlotNumber())->GetMemberDef(); // Default to the current module. The code immediately below determines if this // assumption is incorrect. Module * pTargetModule = bmtInternal->pModule; // Get the module of the target method. Get it through the chunk to // avoid triggering the assert that MethodTable is non-NULL. It may // be null since it may belong to the type we're building right now. MethodDesc * pTargetMD = it.GetTargetMD(); MethodDescChunk * pTargetChunk = pTargetMD->GetMethodDescChunk(); MethodTable * pTargetMT = pTargetChunk->GetMethodTable(); // If pTargetMT is null, this indicates that the target MethodDesc belongs // to the current type. Otherwise, the MethodDesc MUST be owned by a parent // of the type we're building. BOOL fTargetIsOwnedByParent = pTargetMT != NULL; // If the method is owned by a parent, we need to use the parent's module if (fTargetIsOwnedByParent) { pTargetModule = pTargetMT->GetModule(); } // Now compare the method constraints. if (!MetaSig::CompareMethodConstraints(pTargetModule, pTargetMD->GetMemberDef(), pSubst, pMTItf->GetModule(), mdTok)) { LOG((LF_CLASSLOADER, LL_INFO1000, "BADCONSTRAINTS on interface method implementation: %x\n", pTargetMD)); // This exception will be due to an implicit implementation, since explicit errors // will be detected in MethodImplCompareSignatures (for now, anyway). CONSISTENCY_CHECK(!it.IsMethodImpl()); DWORD idsError = it.IsMethodImpl() ? IDS_CLASSLOAD_CONSTRAINT_MISMATCH_ON_INTERFACE_METHOD_IMPL : IDS_CLASSLOAD_CONSTRAINT_MISMATCH_ON_IMPLICIT_IMPLEMENTATION; if (fTargetIsOwnedByParent) { DefineFullyQualifiedNameForClass(); LPCUTF8 szClassName = GetFullyQualifiedNameForClassNestedAware(pTargetMD->GetClass()); LPCUTF8 szMethodName = pTargetMD->GetName(); CQuickBytes qb; // allocate enough room for "<class>.<method>\0" size_t cchFullName = strlen(szClassName) + 1 + strlen(szMethodName) + 1; LPUTF8 szFullName = (LPUTF8) qb.AllocThrows(cchFullName); strcpy_s(szFullName, cchFullName, szClassName); strcat_s(szFullName, cchFullName, "."); strcat_s(szFullName, cchFullName, szMethodName); BuildMethodTableThrowException(idsError, szFullName); } else { BuildMethodTableThrowException(idsError, pTargetMD->GetMemberDef()); } } } // Move to the next entry it.Next(); } } // // Used by BuildMethodTable // // If we're a value class, we want to create duplicate slots and MethodDescs for all methods in the vtable // section (i.e. not non-virtual instance methods or statics). // In the name of uniformity it would be much nicer // if we created _all_ value class BoxedEntryPointStubs at this point. // However, non-virtual instance methods only require unboxing // stubs in the rare case that we create a delegate to such a // method, and thus it would be inefficient to create them on // loading: after all typical structs will have many non-virtual // instance methods. // // Unboxing stubs for non-virtual instance methods are created // in MethodDesc::FindOrCreateAssociatedMethodDesc. VOID MethodTableBuilder::ChangeValueClassVirtualsToBoxedEntryPointsAndCreateUnboxedEntryPoints(AllocMemTracker *pamTracker) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END; // If we're a value class, we want to create duplicate slots and MethodDescs for all methods in the vtable // section (i.e. not privates or statics). if (IsValueClass()) { DeclaredMethodIterator it(*this); while (it.Next()) { MethodDesc *pMD; pMD = it.GetMethodDesc(); if (pMD == NULL) continue; if (IsMdStatic(it.Attrs()) || !IsMdVirtual(it.Attrs()) || (it.Classification() & mdcClassification) == mcInstantiated || IsMdRTSpecialName(it.Attrs())) continue; bmtTokenRangeNode *pTR = GetTokenRange(it.Token(), &(bmtMetaData->ranges[it.MethodType()][it.MethodImpl()])); bmtMethodDescSet *set = &bmtMFDescs->sets[it.MethodType()][it.MethodImpl()]; MethodDescChunk * pChunk = set->pChunkList[pTR->dwCurrentChunk]; MethodDesc *pNewMD = pChunk->GetMethodDescAt(pTR->dwCurrentIndex); // <NICE> memcpy operations on data structures like MethodDescs are extremely fragile // and should not be used. We should go to the effort of having proper constructors // in the MethodDesc class. </NICE> memcpy(pNewMD, pMD, pChunk->GetMethodDescSize() - METHOD_PREPAD); // Reset the chunk index pNewMD->SetChunkIndex(pChunk, pTR->dwCurrentIndex); pNewMD->SetMemberDef(pMD->GetMemberDef()); // Update counters to prepare for next method desc allocation. pTR->dwCurrentIndex++; if (pTR->dwCurrentIndex == MethodDescChunk::GetMaxMethodDescs(it.Classification())) { pTR->dwCurrentChunk++; pTR->dwCurrentIndex = 0; } bmtMFDescs->ppUnboxMethodDescList[it.CurrentIndex()] = pNewMD; pNewMD->SetSlot((WORD) bmtVT->dwCurrentNonVtableSlot); // Change the original MD in the vtable section // to be a stub method which takes a BOXed this pointer. pMD->SetIsUnboxingStub(); bmtVT->pNonVtableMD[ bmtVT->dwCurrentNonVtableSlot ] = pNewMD; // not pre-stub addr, refer to statics above bmtVT->dwCurrentNonVtableSlot++; } } } //******************************************************************************* // // Used by BuildMethodTable // // // If we are a class, then there may be some unplaced vtable methods (which are by definition // interface methods, otherwise they'd already have been placed). Place as many unplaced methods // as possible, in the order preferred by interfaces. However, do not allow any duplicates - once // a method has been placed, it cannot be placed again - if we are unable to neatly place an interface, // create duplicate slots for it starting at dwCurrentDuplicateVtableSlot. Fill out the interface // map for all interfaces as they are placed. // // If we are an interface, then all methods are already placed. Fill out the interface map for // interfaces as they are placed. // // BEHAVIOUR (based on Partition II: 11.2, not including MethodImpls) // C is current class, P is a parent class, I is the interface being implemented // // FOREACH interface I implemented by this class C // FOREACH method I::M // IF I is EXPLICITLY implemented by C // IF some method C::M matches I::M // USE C::M as implementation for I::M // ELIF we inherit a method P::M that matches I::M // USE P::M as implementation for I::M // ENDIF // ELSE // IF I::M lacks implementation // IF some method C::M matches I::M // USE C::M as implementation for I::M // ELIF we inherit a method P::M that matches I::M // USE P::M as implementation for I::M // ENDIF // ENDIF // ENDIF // ENDFOR // ENDFOR // VOID MethodTableBuilder::PlaceVtableMethods( DWORD numDeclaredInterfaces, BuildingInterfaceInfo_t *pBuildingInterfaceList) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END; BOOL fParentInterface; for (DWORD dwCurInterface = 0; dwCurInterface < bmtInterface->dwInterfaceMapSize; dwCurInterface++) { // Default to not being implemented by the current class fParentInterface = FALSE; // Keep track of the current interface InterfaceInfo_t *pCurItfInfo = &(bmtInterface->pInterfaceMap[dwCurInterface]); // The interface we are attempting to place MethodTable* pInterface = pCurItfInfo->m_pMethodTable; Substitution* pIntfSubst = bmtInterface->ppInterfaceSubstitutionChains[dwCurInterface]; // Check if this type is allowed to implement this interface. { Assembly *pItfAssembly = pInterface->GetAssembly(); Assembly *pThisAssembly = bmtInternal->pModule->GetAssembly(); if(pCurItfInfo->IsDeclaredOnClass() && !pInterface->IsExternallyVisible() && pItfAssembly != pThisAssembly && !pItfAssembly->GrantsFriendAccessTo(pThisAssembly)) { BuildMethodTableThrowException(IDS_CLASSLOAD_INTERFACE_NO_ACCESS); } } if (pCurItfInfo->IsImplementedByParent()) { if (!pCurItfInfo->IsDeclaredOnClass()) { fParentInterface = TRUE; } } // For each method declared in this interface MethodTable::MethodIterator it(pInterface); MethodTable::MethodDataWrapper hParentData; if (!pCurItfInfo->IsDeclaredOnClass()) { CONSISTENCY_CHECK(CheckPointer(bmtParent->pParentMethodTable)); // NOTE: This override does not cache the resulting MethodData object hParentData = MethodTable::GetMethodData( ComputeDispatchMapTypeID(pInterface, pIntfSubst), pInterface, bmtParent->pParentMethodTable); } for (;it.IsValid() && it.IsVirtual(); it.Next()) { MethodDesc **ppImplementingMD = &bmtInterface->ppInterfaceMethodDescList[it.GetSlotNumber()]; MethodDesc **ppDeclaringMD = &bmtInterface->ppInterfaceDeclMethodDescList[it.GetSlotNumber()]; // Provide default values *ppImplementingMD = NULL; *ppDeclaringMD = NULL; // See if we have info gathered while placing members if (bmtInterface->pppInterfaceImplementingMD[dwCurInterface] && bmtInterface->pppInterfaceImplementingMD[dwCurInterface][it.GetSlotNumber()] != NULL) { *ppImplementingMD = bmtInterface->pppInterfaceImplementingMD[dwCurInterface][it.GetSlotNumber()]; *ppDeclaringMD = bmtInterface->pppInterfaceDeclaringMD[dwCurInterface][it.GetSlotNumber()]; continue; } MethodDesc *pItfMD = it.GetDeclMethodDesc(); CONSISTENCY_CHECK(CheckPointer(pItfMD)); if (!pCurItfInfo->IsDeclaredOnClass()) { if (!hParentData->GetImplSlot(it.GetSlotNumber()).IsNull()) { // If this interface is not explicitly declared on this class, and the interface slot has already been // given an implementation, then the only way to provide a new implementation is through an override // or through a MethodImpl. continue; } } LPCUTF8 pszInterfaceMethodName = pItfMD->GetNameOnNonArrayClass(); PCCOR_SIGNATURE pInterfaceMethodSig; DWORD cInterfaceMethodSig; BOOL fFoundMatchInBuildingClass = FALSE; pItfMD->GetSig(&pInterfaceMethodSig, &cInterfaceMethodSig); // // First, try to find the method explicitly declared in our class // DeclaredMethodIterator methIt(*this); while (methIt.Next()) { // Note that non-publics can legally be exposed via an interface, but only // through methodImpls. if (IsMdVirtual(methIt.Attrs()) && IsMdPublic(methIt.Attrs())) { if (methIt.Name() == NULL) { BuildMethodTableThrowException(IDS_CLASSLOAD_NOMETHOD_NAME); } #ifdef _DEBUG if(GetHalfBakedClass()->m_fDebuggingClass && g_pConfig->ShouldBreakOnMethod(methIt.Name())) _ASSERTE(!"BreakOnMethodName"); #endif // _DEBUG if (strcmp(methIt.Name(),pszInterfaceMethodName) == 0) { PCCOR_SIGNATURE pMemberSignature; DWORD cMemberSignature; pMemberSignature = methIt.GetSig(&cMemberSignature); if (MetaSig::CompareMethodSigs( pMemberSignature, cMemberSignature, bmtInternal->pModule, NULL, pInterfaceMethodSig, cInterfaceMethodSig, pItfMD->GetModule(), pIntfSubst)) { fFoundMatchInBuildingClass = TRUE; *ppImplementingMD = methIt.GetMethodDesc(); *ppDeclaringMD = pItfMD; break; } } } } // end ... try to find method CONSISTENCY_CHECK(it.GetSlotNumber() < bmtInterface->dwLargestInterfaceSize); if (!fFoundMatchInBuildingClass) { // If this interface has been layed out by our parent then // we do not need to define a new method desc for it. This // is needed only for APPHACK behaviour defined above. if(fParentInterface) { *ppImplementingMD = NULL; *ppDeclaringMD = NULL; continue; } // We will use the interface implemenation if we do not find one in the // parent. It will have to be overriden by the a method impl unless the // class is abstract or it is a special COM type class. MethodDesc* pParentMD = NULL; if(bmtParent->pParentMethodTable != NULL) { CONSISTENCY_CHECK_MSG(!(GetHalfBakedClass()->m_fDebuggingClass && g_pConfig->ShouldBreakOnMethod(pszInterfaceMethodName)), "BreakOnMethodName"); // Check the parent class. pParentMD = bmtParent->pParentMethodTable->GetClass()->FindMethod( pszInterfaceMethodName, pInterfaceMethodSig, cInterfaceMethodSig, pItfMD->GetModule(), pIntfSubst, EEClass::FM_ForInterface, &bmtParent->parentSubst); } // If the found method is virtual and public, we can use it. Otherwise, by definition // of Partition II, chapter 11.2, we are not allowed to use this method. if(pParentMD != NULL) { CONSISTENCY_CHECK(IsMdVirtual(pParentMD->GetAttrs())); CONSISTENCY_CHECK(IsMdPublic(pParentMD->GetAttrs())); *ppImplementingMD = pParentMD; *ppDeclaringMD = pItfMD; } else { *ppImplementingMD = pItfMD; *ppDeclaringMD = NULL; } } } // // Now that all matches for the current interface have been determined, // add these matches to the dispatch map (for stub dispatch) or to the // vtable (for vtable interface dispatch). // it.MoveToBegin(); for (; it.IsValid() && it.IsVirtual(); it.Next()) { // The entry can be null if the interface was previously // laid out by a parent and we did not have a method // that subclassed the interface. // Get the MethodDesc which was allocated for the method MethodDesc *pMD = bmtInterface->ppInterfaceMethodDescList[it.GetSlotNumber()]; MethodDesc *pMDDecl = bmtInterface->ppInterfaceDeclMethodDescList[it.GetSlotNumber()]; // Now fill out the stub dispatch implementation table. if (pMD != NULL && pMDDecl != NULL) { DispatchMapTypeID dispatchMapTypeID = DispatchMapTypeID::InterfaceClassID(dwCurInterface); CONSISTENCY_CHECK(dispatchMapTypeID.IsImplementedInterface()); #ifdef _DEBUG DispatchMapTypeID dispatchMapTypeID2 = ComputeDispatchMapTypeID(pInterface, pIntfSubst); CONSISTENCY_CHECK(dispatchMapTypeID2.IsImplementedInterface()); CONSISTENCY_CHECK(dispatchMapTypeID == dispatchMapTypeID2); CONSISTENCY_CHECK(!bmtVT->pDispatchMapBuilder->Contains(dispatchMapTypeID, pMDDecl->GetSlot())); #endif // _DEBUG bmtVT->pDispatchMapBuilder->InsertMDMapping(dispatchMapTypeID, pMDDecl->GetSlot(), pMD, TRUE); } } } } //******************************************************************************* // // Used by BuildMethodTable // // Place static fields // VOID MethodTableBuilder::PlaceStaticFields() { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END DWORD i; //=============================================================== // BEGIN: Place static fields //=============================================================== LOG((LF_CLASSLOADER, LL_INFO10000, "STATICS: Placing statics for %s\n", this->GetDebugClassName())); // // Place gc refs and value types first, as they need to have handles created for them. // (Placing them together allows us to easily create the handles when Restoring the class, // and when initializing new DLS for the class.) // DWORD dwCumulativeStaticFieldPos = 0 ; DWORD dwCumulativeStaticGCFieldPos = 0; DWORD dwCumulativeStaticBoxFieldPos = 0; // We don't need to do any calculations for the gc refs or valuetypes, as they're // guaranteed to be aligned in ModuleStaticsInfo bmtFP->NumStaticFieldsOfSize[LOG2_PTRSIZE] -= bmtFP->NumStaticGCBoxedFields + bmtFP->NumStaticGCPointerFields; // Place fields, largest first, padding so that each group is aligned to its natural size for (i = MAX_LOG2_PRIMITIVE_FIELD_SIZE; (signed long) i >= 0; i--) { // Fields of this size start at the next available location bmtFP->StaticFieldStart[i] = dwCumulativeStaticFieldPos; dwCumulativeStaticFieldPos += (bmtFP->NumStaticFieldsOfSize[i] << i); // Reset counters for the loop after this one bmtFP->NumStaticFieldsOfSize[i] = 0; } if (dwCumulativeStaticFieldPos > FIELD_OFFSET_LAST_REAL_OFFSET) BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); DWORD dwNumHandleStatics = bmtFP->NumStaticGCBoxedFields + bmtFP->NumStaticGCPointerFields; if (dwNumHandleStatics != (WORD)dwNumHandleStatics) { BuildMethodTableThrowException(IDS_EE_TOOMANYFIELDS); } SetNumHandleStatics(dwNumHandleStatics); SetNumBoxedStatics(bmtFP->NumStaticGCBoxedFields); // Tell the module to give us the offsets we'll be using and commit space for us // if necessary DWORD dwNonGCOffset, dwGCOffset; GetModule()->GetOffsetsForStaticData(bmtInternal->cl, bmtProp->fDynamicStatics, GetNumHandleStatics(), dwCumulativeStaticFieldPos, &dwGCOffset, &dwNonGCOffset); // Allocate boxed statics first dwCumulativeStaticGCFieldPos = bmtFP->NumStaticGCBoxedFields<<LOG2_PTRSIZE; FieldDesc *pFieldDescList = GetHalfBakedClass()->GetApproxFieldDescListRaw(); // Place static fields for (i = 0; i < bmtEnumMF->dwNumStaticFields; i++) { DWORD dwIndex = bmtEnumMF->dwNumInstanceFields+i; // index in the FieldDesc list DWORD dwFieldSize = (DWORD)(size_t)pFieldDescList[dwIndex].m_pMTOfEnclosingClass; // log2(field size) DWORD dwOffset = (DWORD) pFieldDescList[dwIndex].m_dwOffset; // offset or type of field switch (dwOffset) { case FIELD_OFFSET_UNPLACED_GC_PTR: pFieldDescList[dwIndex].SetOffset(dwCumulativeStaticGCFieldPos + dwGCOffset); dwCumulativeStaticGCFieldPos += 1<<LOG2_PTRSIZE; LOG((LF_CLASSLOADER, LL_INFO10000, "STATICS: Field placed at GC offset 0x%x\n", pFieldDescList[dwIndex].GetOffset_NoLogging())); break; case FIELD_OFFSET_VALUE_CLASS: pFieldDescList[dwIndex].SetOffset(dwCumulativeStaticBoxFieldPos + dwGCOffset); dwCumulativeStaticBoxFieldPos += 1<<LOG2_PTRSIZE; LOG((LF_CLASSLOADER, LL_INFO10000, "STATICS: Field placed at GC offset 0x%x\n", pFieldDescList[dwIndex].GetOffset_NoLogging())); break; case FIELD_OFFSET_UNPLACED: pFieldDescList[dwIndex].SetOffset(bmtFP->StaticFieldStart[dwFieldSize] + (bmtFP->NumStaticFieldsOfSize[dwFieldSize] << dwFieldSize) + + dwNonGCOffset); bmtFP->NumStaticFieldsOfSize[dwFieldSize]++; LOG((LF_CLASSLOADER, LL_INFO10000, "STATICS: Field placed at non GC offset 0x%x\n", pFieldDescList[dwIndex].GetOffset_NoLogging())); break; default: // RVA field break; } LOG((LF_CLASSLOADER, LL_INFO1000000, "Offset of %s: %i\n", pFieldDescList[dwIndex].m_debugName, pFieldDescList[dwIndex].GetOffset_NoLogging())); } if (bmtProp->fDynamicStatics) { _ASSERTE(dwNonGCOffset == 0 || // no statics at all dwNonGCOffset == DomainLocalModule::DynamicEntry::GetOffsetOfDataBlob()); // We need space to point to the GC statics bmtVT->dwNonGCStaticFieldBytes = dwCumulativeStaticFieldPos; } else { bmtVT->dwNonGCStaticFieldBytes = MODULE_NON_DYNAMIC_STATICS; // Non dynamics shouldnt be using this } LOG((LF_CLASSLOADER, LL_INFO10000, "STATICS: Static field bytes needed (-1 is normal for non dynamic case)%i\n", bmtVT->dwNonGCStaticFieldBytes)); } //******************************************************************************* // // Used by BuildMethodTable // // Place instance fields // VOID MethodTableBuilder::PlaceInstanceFields(EEClass** pByValueClassCache) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END; DWORD i; //=============================================================== // BEGIN: Place instance fields //=============================================================== FieldDesc *pFieldDescList = GetHalfBakedClass()->GetApproxFieldDescListRaw(); DWORD dwCumulativeInstanceFieldPos; // Instance fields start right after the parent dwCumulativeInstanceFieldPos = (bmtParent->pParentMethodTable != NULL) ? bmtParent->pParentMethodTable->GetClass()->GetNumInstanceFieldBytes() : 0; // place small fields first if the parent have a number of field bytes that is not aligned if (!IS_ALIGNED(dwCumulativeInstanceFieldPos, DATA_ALIGNMENT)) { for (i = 0; i < MAX_LOG2_PRIMITIVE_FIELD_SIZE; i++) { DWORD j; if (IS_ALIGNED(dwCumulativeInstanceFieldPos, 1<<(i+1))) continue; // check whether there are any bigger fields for (j = i + 1; j <= MAX_LOG2_PRIMITIVE_FIELD_SIZE; j++) { if (bmtFP->NumInstanceFieldsOfSize[j] != 0) break; } // nothing to gain if there are no bigger fields if (j > MAX_LOG2_PRIMITIVE_FIELD_SIZE) break; // check whether there are any small enough fields for (j = i; (signed long) j >= 0; j--) { if (bmtFP->NumInstanceFieldsOfSize[j] != 0) break; } // nothing to play with if there are no smaller fields if ((signed long) j < 0) break; // eventually go back and use the smaller field as filling i = j; CONSISTENCY_CHECK(bmtFP->NumInstanceFieldsOfSize[i] != 0); j = bmtFP->FirstInstanceFieldOfSize[i]; // Avoid reordering of gcfields if (i == LOG2SLOT) { for ( ; j < bmtEnumMF->dwNumInstanceFields; j++) { if ((pFieldDescList[j].GetOffset_NoLogging() == FIELD_OFFSET_UNPLACED) && (pFieldDescList[j].m_pMTOfEnclosingClass == (MethodTable *)(size_t)i)) break; } // out of luck - can't reorder gc fields if (j >= bmtEnumMF->dwNumInstanceFields) break; } // Place the field dwCumulativeInstanceFieldPos = (DWORD)ALIGN_UP(dwCumulativeInstanceFieldPos, 1 << i); pFieldDescList[j].SetOffset(dwCumulativeInstanceFieldPos); dwCumulativeInstanceFieldPos += (1 << i); // We've placed this field now, so there is now one less of this size field to place if (--bmtFP->NumInstanceFieldsOfSize[i] == 0) continue; // We are done in this round if we haven't picked the first field if (bmtFP->FirstInstanceFieldOfSize[i] != j) continue; // Update FirstInstanceFieldOfSize[i] to point to the next such field for (j = j+1; j < bmtEnumMF->dwNumInstanceFields; j++) { // The log of the field size is stored in the method table if (pFieldDescList[j].m_pMTOfEnclosingClass == (MethodTable *)(size_t)i) { bmtFP->FirstInstanceFieldOfSize[i] = j; break; } } _ASSERTE(j < bmtEnumMF->dwNumInstanceFields); } } // Place fields, largest first for (i = MAX_LOG2_PRIMITIVE_FIELD_SIZE; (signed long) i >= 0; i--) { if (bmtFP->NumInstanceFieldsOfSize[i] == 0) continue; // Align instance fields if we aren't already dwCumulativeInstanceFieldPos = (DWORD)ALIGN_UP(dwCumulativeInstanceFieldPos, min(1 << i, DATA_ALIGNMENT)); // Fields of this size start at the next available location bmtFP->InstanceFieldStart[i] = dwCumulativeInstanceFieldPos; dwCumulativeInstanceFieldPos += (bmtFP->NumInstanceFieldsOfSize[i] << i); // Reset counters for the loop after this one bmtFP->NumInstanceFieldsOfSize[i] = 0; } // Make corrections to reserve space for GC Pointer Fields // // The GC Pointers simply take up the top part of the region associated // with fields of that size (GC pointers can be 64 bit on certain systems) if (bmtFP->NumInstanceGCPointerFields) { bmtFP->GCPointerFieldStart = bmtFP->InstanceFieldStart[LOG2SLOT]; bmtFP->InstanceFieldStart[LOG2SLOT] = bmtFP->InstanceFieldStart[LOG2SLOT] + (bmtFP->NumInstanceGCPointerFields << LOG2SLOT); bmtFP->NumInstanceGCPointerFields = 0; // reset to zero here, counts up as pointer slots are assigned below } // Place instance fields - be careful not to place any already-placed fields for (i = 0; i < bmtEnumMF->dwNumInstanceFields; i++) { DWORD dwFieldSize = (DWORD)(size_t)pFieldDescList[i].m_pMTOfEnclosingClass; DWORD dwOffset; dwOffset = pFieldDescList[i].GetOffset_NoLogging(); // Don't place already-placed fields if ((dwOffset == FIELD_OFFSET_UNPLACED || dwOffset == FIELD_OFFSET_UNPLACED_GC_PTR || dwOffset == FIELD_OFFSET_VALUE_CLASS)) { if (dwOffset == FIELD_OFFSET_UNPLACED_GC_PTR) { pFieldDescList[i].SetOffset(bmtFP->GCPointerFieldStart + (bmtFP->NumInstanceGCPointerFields << LOG2SLOT)); bmtFP->NumInstanceGCPointerFields++; } else if (pFieldDescList[i].IsByValue() == FALSE) // it's a regular field { pFieldDescList[i].SetOffset(bmtFP->InstanceFieldStart[dwFieldSize] + (bmtFP->NumInstanceFieldsOfSize[dwFieldSize] << dwFieldSize)); bmtFP->NumInstanceFieldsOfSize[dwFieldSize]++; } } } WORD wNumGCPointerSeries; // Save Number of pointer series if (bmtFP->NumInstanceGCPointerFields) wNumGCPointerSeries = bmtParent->NumParentPointerSeries + 1; else wNumGCPointerSeries = bmtParent->NumParentPointerSeries; // Place by value class fields last // Update the number of GC pointer series for (i = 0; i < bmtEnumMF->dwNumInstanceFields; i++) { if (pFieldDescList[i].IsByValue()) { EEClass *pByValueClass = pByValueClassCache[i]; // value classes could have GC pointers in them, which need to be pointer-size aligned // so do this if it has not been done already #if !defined(_WIN64) && (DATA_ALIGNMENT > 4) dwCumulativeInstanceFieldPos = (DWORD)ALIGN_UP(dwCumulativeInstanceFieldPos, (pByValueClass->GetNumInstanceFieldBytes() >= DATA_ALIGNMENT) ? DATA_ALIGNMENT : sizeof(void*)); #else // !(!defined(_WIN64) && (DATA_ALIGNMENT > 4)) dwCumulativeInstanceFieldPos = (DWORD)ALIGN_UP(dwCumulativeInstanceFieldPos, sizeof(void*)); #endif // !(!defined(_WIN64) && (DATA_ALIGNMENT > 4)) pFieldDescList[i].SetOffset(dwCumulativeInstanceFieldPos); dwCumulativeInstanceFieldPos += pByValueClass->GetAlignedNumInstanceFieldBytes(); // Add pointer series for by-value classes wNumGCPointerSeries += pByValueClass->m_wNumGCPointerSeries; } } // Can be unaligned DWORD dwNumInstanceFieldBytes = dwCumulativeInstanceFieldPos; if (IsValueClass()) { // Like C++ we enforce that there can be no 0 length structures. // Thus for a value class with no fields, we 'pad' the length to be 1 if (dwNumInstanceFieldBytes == 0) dwNumInstanceFieldBytes = 1; // The JITs like to copy full machine words, // so if the size is bigger than a void* round it up to minAlign // and if the size is smaller than void* round it up to next power of two unsigned minAlign; if (dwNumInstanceFieldBytes > sizeof(void*)) { minAlign = sizeof(void*); } else { minAlign = 1; while (minAlign < dwNumInstanceFieldBytes) minAlign *= 2; } dwNumInstanceFieldBytes = (dwNumInstanceFieldBytes + minAlign-1) & ~(minAlign-1); } if (dwNumInstanceFieldBytes > FIELD_OFFSET_LAST_REAL_OFFSET) { BuildMethodTableThrowException(IDS_CLASSLOAD_FIELDTOOLARGE); } SetNumInstanceFieldBytes(dwNumInstanceFieldBytes); SetNumGCPointerSeries(wNumGCPointerSeries); //=============================================================== // END: Place instance fields //=============================================================== } //******************************************************************************* // this accesses the field size which is temporarily stored in m_pMTOfEnclosingClass // during class loading. Don't use any other time DWORD MethodTableBuilder::GetFieldSize(FieldDesc *pFD) { STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_GC_NOTRIGGER; STATIC_CONTRACT_FORBID_FAULT; // We should only be calling this while this class is being built. _ASSERTE(GetHalfBakedMethodTable() == 0); BAD_FORMAT_NOTHROW_ASSERT(! pFD->IsByValue() || HasExplicitFieldOffsetLayout()); if (pFD->IsByValue()) return (DWORD)(size_t)(pFD->m_pMTOfEnclosingClass); return (1 << (DWORD)(size_t)(pFD->m_pMTOfEnclosingClass)); } //---------------------------------------------------------------------------------------------- // This class is a helper for HandleExplicitLayout. To make it harder to introduce security holes // into this function, we will manage all updates to the class's trust level through the ExplicitClassTrust // class. This abstraction enforces the rule that the overall class is only as trustworthy as // the least trustworthy field. //---------------------------------------------------------------------------------------------- class ExplicitClassTrust : private ExplicitFieldTrust { public: ExplicitClassTrust() { LEAF_CONTRACT; m_trust = kMaxTrust; // Yes, we start out with maximal trust. This reflects that explicit layout structures with no fields do represent no risk. } VOID AddField(TrustLevel fieldTrust) { LEAF_CONTRACT; m_trust = min(m_trust, fieldTrust); } BOOL IsLegal() { LEAF_CONTRACT; return m_trust >= kLegal; } BOOL IsVerifiable() { LEAF_CONTRACT; return m_trust >= kVerifiable; } BOOL IsNonOverLayed() { LEAF_CONTRACT; return m_trust >= kNonOverLayed; } TrustLevel GetTrustLevel() { LEAF_CONTRACT; return m_trust; } private: TrustLevel m_trust; }; //---------------------------------------------------------------------------------------------- // This class is a helper for HandleExplicitLayout. To make it harder to introduce security holes // into this function, this class will collect trust information about individual fields to be later // aggregated into the overall class level. // // This abstraction enforces the rule that all fields are presumed guilty until explicitly declared // safe by calling SetTrust(). If you fail to call SetTrust before leaving the block, the destructor // will automatically cause the entire class to be declared illegal (and you will get an assert // telling you to fix this bug.) //---------------------------------------------------------------------------------------------- class ExplicitFieldTrustHolder : private ExplicitFieldTrust { public: ExplicitFieldTrustHolder(ExplicitClassTrust *pExplicitClassTrust) { LEAF_CONTRACT; m_pExplicitClassTrust = pExplicitClassTrust; #ifdef _DEBUG m_trustDeclared = FALSE; #endif m_fieldTrust = kNone; } VOID SetTrust(TrustLevel fieldTrust) { LEAF_CONTRACT; _ASSERTE(fieldTrust >= kNone && fieldTrust <= kMaxTrust); _ASSERTE(!m_trustDeclared && "You should not set the trust value more than once."); #ifdef _DEBUG m_trustDeclared = TRUE; #endif m_fieldTrust = fieldTrust; } ~ExplicitFieldTrustHolder() { LEAF_CONTRACT; // If no SetTrust() was ever called, we will default to kNone (i.e. declare the entire type // illegal.) It'd be nice to assert here but since this case can be legitimately reached // on exception unwind, we cannot. m_pExplicitClassTrust->AddField(m_fieldTrust); } private: ExplicitClassTrust* m_pExplicitClassTrust; TrustLevel m_fieldTrust; #ifdef _DEBUG BOOL m_trustDeclared; // Debug flag to detect multiple Sets. (Which we treat as a bug as this shouldn't be necessary.) #endif }; //******************************************************************************* // make sure that no object fields are overlapped incorrectly and define the // GC pointer series for the class. We are assuming that this class will always be laid out within // its enclosing class by the compiler in such a way that offset 0 will be the correct alignment // for object ref fields so we don't need to try to align it VOID MethodTableBuilder::HandleExplicitLayout(EEClass **pByValueClassCache) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END // need to calculate instance size as can't use nativeSize or anything else that // has been previously calculated. UINT instanceSliceSize = 0; DWORD firstObjectOverlapOffset = ((DWORD)(-1)); UINT i; for (i=0; i < bmtMetaData->cFields; i++) { FieldDesc *pFD = bmtMFDescs->ppFieldDescList[i]; if (!pFD) continue; if (pFD->IsStatic()) continue; UINT fieldExtent = 0; if (!ClrSafeInt<UINT>::addition(pFD->GetOffset_NoLogging(), GetFieldSize(pFD), fieldExtent)) BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); if (fieldExtent > instanceSliceSize) instanceSliceSize = fieldExtent; } CQuickBytes qb; // Helping out prefix PREFIX_ASSUME(sizeof(BYTE) == 1); BYTE *pFieldLayout = (BYTE*) qb.AllocThrows(instanceSliceSize * sizeof(BYTE)); for (i=0; i < instanceSliceSize; i++) pFieldLayout[i] = empty; // go through each field and look for invalid layout // (note that we are more permissive than what Ecma allows. We only disallow the minimum set necessary to // close security holes.) // // This is what we implment: // // 1. Verify that every OREF is on a valid alignment // 2. Verify that OREFs only overlap with other OREFs. // 3. If an OREF does overlap with another OREF, the class is marked unverifiable. // 4. If an overlap of any kind occurs, the class will be marked NotTightlyPacked (affects ValueType.Equals()). // char emptyObject[sizeof(void*)]; char isObject[sizeof(void*)]; for (i = 0; i < sizeof(void*); i++) { emptyObject[i] = empty; isObject[i] = oref; } ExplicitClassTrust explicitClassTrust; UINT valueClassCacheIndex = ((UINT)(-1)); UINT badOffset = 0; FieldDesc *pFD = NULL; for (i=0; i < bmtMetaData->cFields; i++) { // Note about this loop body: // // This loop is coded to make it as hard as possible to allow a field to be trusted when it shouldn't. // // Every path in this loop body must lead to an explicit decision as to whether the field nonoverlaps, // overlaps in a verifiable fashion, overlaps in a nonverifiable fashion or overlaps in a completely illegal fashion. // // It must call fieldTrust.SetTrust() with the appropriate result. If you don't call it, fieldTrust's destructor // will intentionally default to kNone and mark the entire class illegal. // // If your result is anything but kNone (class is illegal), you must also explicitly "continue" the loop. // There is a "break" at end of this loop body that will abort the loop if you don't do this. And // if you don't finish iterating through all the fields, this function will automatically mark the entire // class illegal. This rule is a vestige of an earlier version of this function. // This object's dtor will aggregate the trust decision for this field into the trust level for the class as a whole. ExplicitFieldTrustHolder fieldTrust(&explicitClassTrust); pFD = bmtMFDescs->ppFieldDescList[i]; if (pFD == NULL || pFD->IsStatic()) { fieldTrust.SetTrust(ExplicitFieldTrust::kNonOverLayed); continue; } // "i" indexes all fields, valueClassCacheIndex indexes non-static fields only. Don't get them confused! valueClassCacheIndex++; if (CorTypeInfo::IsObjRef(pFD->GetFieldType())) { if (pFD->GetOffset_NoLogging() & ((ULONG)sizeof(OBJECTREF) - 1)) { badOffset = pFD->GetOffset_NoLogging(); fieldTrust.SetTrust(ExplicitFieldTrust::kNone); // If we got here, OREF field was not pointer aligned. THROW. break; } // check if overlaps another object if (memcmp((void *)&pFieldLayout[pFD->GetOffset_NoLogging()], (void *)isObject, sizeof(isObject)) == 0) { // If we got here, an OREF overlapped another OREF. We permit this but mark the class unverifiable. fieldTrust.SetTrust(ExplicitFieldTrust::kLegal); if (firstObjectOverlapOffset == ((DWORD)(-1))) { firstObjectOverlapOffset = pFD->GetOffset_NoLogging(); } continue; } // check if is empty at this point if (memcmp((void *)&pFieldLayout[pFD->GetOffset_NoLogging()], (void *)emptyObject, sizeof(emptyObject)) == 0) { // If we got here, this OREF is overlapping no other fields (yet). Record that these bytes now contain an OREF. memset((void *)&pFieldLayout[pFD->GetOffset_NoLogging()], oref, sizeof(isObject)); fieldTrust.SetTrust(ExplicitFieldTrust::kNonOverLayed); continue; } // If we got here, the OREF overlaps a non-OREF. THROW. badOffset = pFD->GetOffset_NoLogging(); fieldTrust.SetTrust(ExplicitFieldTrust::kNone); break; } else { UINT fieldSize; if (pFD->IsByValue()) { EEClass *pByValue = pByValueClassCache[valueClassCacheIndex]; if (pByValue->GetMethodTable()->ContainsPointers()) { if ((pFD->GetOffset_NoLogging() & ((ULONG)sizeof(void*) - 1)) == 0) { ExplicitFieldTrust::TrustLevel trust; DWORD firstObjectOverlapOffsetInsideValueClass = ((DWORD)(-1)); trust = CheckValueClassLayout(pByValue, &pFieldLayout[pFD->GetOffset_NoLogging()], &firstObjectOverlapOffsetInsideValueClass); fieldTrust.SetTrust(trust); if (firstObjectOverlapOffsetInsideValueClass != ((DWORD)(-1))) { if (firstObjectOverlapOffset == ((DWORD)(-1))) { firstObjectOverlapOffset = pFD->GetOffset_NoLogging() + firstObjectOverlapOffsetInsideValueClass; } } if (trust != ExplicitFieldTrust::kNone) { continue; } else { // If we got here, then an OREF inside the valuetype illegally overlapped a non-OREF field. THROW. badOffset = pFD->GetOffset_NoLogging(); break; } } // If we got here, then a valuetype containing an OREF was misaligned. badOffset = pFD->GetOffset_NoLogging(); fieldTrust.SetTrust(ExplicitFieldTrust::kNone); break; } // no pointers so fall through to do standard checking fieldSize = pByValue->m_dwNumInstanceFieldBytes; } else { // field size temporarily stored in pInterface field fieldSize = GetFieldSize(pFD); } // If we got here, we are trying to place a non-OREF (or a valuetype composed of non-OREFs.) // Look for any orefs under this field BYTE *loc; if ((loc = (BYTE*)memchr((void*)&pFieldLayout[pFD->GetOffset_NoLogging()], oref, fieldSize)) == NULL) { // If we have a nonoref in the range then we are doing an overlay if(memchr((void*)&pFieldLayout[pFD->GetOffset_NoLogging()], nonoref, fieldSize)) { fieldTrust.SetTrust(ExplicitFieldTrust::kVerifiable); } else { fieldTrust.SetTrust(ExplicitFieldTrust::kNonOverLayed); } memset((void*)&pFieldLayout[pFD->GetOffset_NoLogging()], nonoref, fieldSize); continue; } // If we got here, we tried to place a non-OREF (or a valuetype composed of non-OREFs) // on top of an OREF. THROW. badOffset = (UINT)(loc - pFieldLayout); fieldTrust.SetTrust(ExplicitFieldTrust::kNone); break; // anything else is an error } // We have to comment out this assert because otherwise, the compiler refuses to build because the _ASSERT is unreachable // (Thanks for nothing, compiler, that's what the assert is trying to enforce!) But the intent of the assert is correct. //_ASSERTE(!"You aren't supposed to be here. Some path inside the loop body did not execute an explicit break or continue."); // If we got here, some code above failed to execute an explicit "break" or "continue." This is a bug! To be safe, // we will put a catchall "break" here which will cause the typeload to abort (albeit with a probably misleading // error message.) break; } // for(;;) // We only break out of the loop above if we detected an error. if (i < bmtMetaData->cFields || !explicitClassTrust.IsLegal()) { ThrowFieldLayoutError(GetCl(), bmtInternal->pModule, badOffset, IDS_CLASSLOAD_EXPLICIT_LAYOUT); } if(!explicitClassTrust.IsVerifiable()) { GCX_COOP(); if (!Security::CanSkipVerification(GetAssembly()->GetDomainAssembly())) { ThrowFieldLayoutError(GetCl(), bmtInternal->pModule, firstObjectOverlapOffset, IDS_CLASSLOAD_UNVERIFIABLE_FIELD_LAYOUT); } //SetHasNonVerifiablyOverLayedFields(); } if(!explicitClassTrust.IsNonOverLayed()) { SetHasOverLayedFields(); } FindPointerSeriesExplicit(instanceSliceSize, pFieldLayout); // Fixup the offset to include parent as current offsets are relative to instance slice // Could do this earlier, but it's just easier to assume instance relative for most // of the earlier calculations // Instance fields start right after the parent size_t dwInstanceSliceOffset = InstanceSliceOffsetForExplicit(bmtGCSeries->numSeries != 0, bmtParent->pParentMethodTable); size_t numInstanceFieldBytes = dwInstanceSliceOffset + instanceSliceSize; if (numInstanceFieldBytes < dwInstanceSliceOffset || ((size_t)(DWORD)numInstanceFieldBytes) != numInstanceFieldBytes) { // addition overflow or cast truncation BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); } if (IsValueClass()) { ULONG tmpclstotalsize = 0; GetMDImport()->GetClassTotalSize(GetCl(), &tmpclstotalsize); if (tmpclstotalsize) { size_t clstotalsize = (size_t)tmpclstotalsize; if (clstotalsize != tmpclstotalsize) { // addition overflow or cast truncation BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); } // size must be large enough to accomodate layout. If not, we use the layout size instead. if (clstotalsize < numInstanceFieldBytes) { clstotalsize = numInstanceFieldBytes; } numInstanceFieldBytes = clstotalsize; // use the size they told us } } // The GC requires that all valuetypes containing orefs be sized to a multiple of sizeof(void*). if (bmtGCSeries->numSeries != 0) { size_t tmp = ALIGN_UP(numInstanceFieldBytes, sizeof(void*)); if (tmp < numInstanceFieldBytes) { // Integer overflow BuildMethodTableThrowException(IDS_CLASSLOAD_GENERAL); } numInstanceFieldBytes = tmp; } // Set the total size SetNumInstanceFieldBytes((DWORD)numInstanceFieldBytes); for (i=0; i < bmtMetaData->cFields; i++) { FieldDesc *pTempFD = bmtMFDescs->ppFieldDescList[i]; if (pTempFD == NULL || pTempFD->IsStatic()) { continue; } HRESULT hr = pTempFD->SetOffset(pTempFD->GetOffset_NoLogging() + (DWORD)dwInstanceSliceOffset); if (FAILED(hr)) { BuildMethodTableThrowException(hr, *bmtError); } } } //******************************************************************************* // Check that the class type parameters are used consistently in this signature blob // in accordance with their variance annotations // The signature is assumed to be well-formed but indices and arities might not be correct BOOL EEClass::CheckVarianceInSig(DWORD numGenericArgs, BYTE* pVarianceInfo, SigPointer psig, CorGenericParamAttr position) { CONTRACT(BOOL) { THROWS; MODE_ANY; GC_TRIGGERS; INSTANCE_CHECK; PRECONDITION(position == gpNonVariant || position == gpCovariant || position == gpContravariant); } CONTRACT_END if (pVarianceInfo == NULL) RETURN TRUE; CorElementType typ; IfFailThrow(psig.GetElemType(&typ)); switch(typ) { case ELEMENT_TYPE_STRING: case ELEMENT_TYPE_U: case ELEMENT_TYPE_I: case ELEMENT_TYPE_I1: case ELEMENT_TYPE_U1: case ELEMENT_TYPE_BOOLEAN: case ELEMENT_TYPE_I2: case ELEMENT_TYPE_U2: case ELEMENT_TYPE_CHAR: case ELEMENT_TYPE_I4: case ELEMENT_TYPE_U4: case ELEMENT_TYPE_I8: case ELEMENT_TYPE_U8: case ELEMENT_TYPE_R4: case ELEMENT_TYPE_R8: case ELEMENT_TYPE_VOID: case ELEMENT_TYPE_OBJECT: case ELEMENT_TYPE_TYPEDBYREF: case ELEMENT_TYPE_MVAR: case ELEMENT_TYPE_CLASS: case ELEMENT_TYPE_VALUETYPE: RETURN TRUE; case ELEMENT_TYPE_VAR: { DWORD index; IfFailThrow(psig.GetData(&index)); // This will be checked later anyway; so give up and don't indicate a variance failure if (index < 0 || index >= numGenericArgs) RETURN TRUE; // Non-variant parameters are allowed to appear anywhere if (pVarianceInfo[index] == gpNonVariant) RETURN TRUE; // Covariant and contravariant parameters can *only* appear in resp. covariant and contravariant positions RETURN ((CorGenericParamAttr) (pVarianceInfo[index]) == position); } case ELEMENT_TYPE_GENERICINST: { IfFailThrow(psig.GetElemType(&typ)); mdTypeRef typeref; IfFailThrow(psig.GetToken(&typeref)); // The number of type parameters follows DWORD ntypars; IfFailThrow(psig.GetData(&ntypars)); // If this is a value type, or position == gpNonVariant, then // we're disallowing covariant and contravariant completely if (typ == ELEMENT_TYPE_VALUETYPE || position == gpNonVariant) { for (unsigned i = 0; i < ntypars; i++) { if (!CheckVarianceInSig(numGenericArgs, pVarianceInfo, psig, gpNonVariant)) RETURN FALSE; psig.SkipExactlyOne(); } } // Otherwise we need to take notice of the variance annotation on each type parameter to the generic type else { mdTypeDef typeDef; Module* pDefModule; // This will also be resolved later; so, give up and don't indicate a variance failure if (!ClassLoader::ResolveTokenToTypeDefThrowing(GetModule(), typeref, &pDefModule, &typeDef)) RETURN TRUE; HENUMInternal hEnumGenericPars; if (FAILED(pDefModule->GetMDImport()->EnumInit(mdtGenericParam, typeDef, &hEnumGenericPars))) pDefModule->GetAssembly()->ThrowTypeLoadException(pDefModule->GetMDImport(), typeDef, IDS_CLASSLOAD_BADFORMAT); for (unsigned i = 0; i < ntypars; i++) { mdGenericParam tkTyPar; pDefModule->GetMDImport()->EnumNext(&hEnumGenericPars, &tkTyPar); DWORD flags; pDefModule->GetMDImport()->GetGenericParamProps(tkTyPar, NULL, &flags, NULL, NULL, NULL); CorGenericParamAttr genPosition = (CorGenericParamAttr) (flags & gpVarianceMask); // If the surrounding context is contravariant then we need to flip the variance of this parameter if (position == gpContravariant) { genPosition = genPosition == gpCovariant ? gpContravariant : genPosition == gpContravariant ? gpCovariant : gpNonVariant; } if (!CheckVarianceInSig(numGenericArgs, pVarianceInfo, psig, genPosition)) RETURN FALSE; psig.SkipExactlyOne(); } pDefModule->GetMDImport()->EnumClose(&hEnumGenericPars); } RETURN TRUE; } // Arrays behave covariantly case ELEMENT_TYPE_ARRAY: case ELEMENT_TYPE_SZARRAY: RETURN CheckVarianceInSig(numGenericArgs, pVarianceInfo, psig, position); // Pointers behave non-variantly case ELEMENT_TYPE_BYREF: case ELEMENT_TYPE_PTR: RETURN CheckVarianceInSig(numGenericArgs, pVarianceInfo, psig, gpNonVariant); case ELEMENT_TYPE_FNPTR: { // Calling convention IfFailThrow(psig.GetData(NULL)); // Get arg count; ULONG cArgs; IfFailThrow(psig.GetData(&cArgs)); // Conservatively, assume non-variance of function pointer types if (!CheckVarianceInSig(numGenericArgs, pVarianceInfo, psig, gpNonVariant)) RETURN FALSE; IfFailThrow(psig.SkipExactlyOne()); for (unsigned i = 0; i < cArgs; i++) { if (!CheckVarianceInSig(numGenericArgs, pVarianceInfo, psig, gpNonVariant)) RETURN FALSE; IfFailThrow(psig.SkipExactlyOne()); } RETURN TRUE; } default: THROW_BAD_FORMAT(IDS_CLASSLOAD_BAD_VARIANCE_SIG, this); } RETURN FALSE; } //******************************************************************************* // make sure that no object fields are overlapped incorrectly, returns S_FALSE if // there overlap but nothing illegal, S_OK if there is no overlap /*static*/ ExplicitFieldTrust::TrustLevel MethodTableBuilder::CheckValueClassLayout(EEClass *pClass, BYTE *pFieldLayout, DWORD *pFirstObjectOverlapOffset) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END *pFirstObjectOverlapOffset = (DWORD)(-1); // Build a layout of the value class. Don't know the sizes of all the fields easily, but // do know a) vc is already consistent so don't need to check it's overlaps and // b) size and location of all objectrefs. So build it by setting all non-oref // then fill in the orefs later UINT fieldSize = pClass->GetNumInstanceFieldBytes(); CQuickBytes qb; BYTE *vcLayout = (BYTE*) qb.AllocThrows(fieldSize * sizeof(BYTE)); memset((void*)vcLayout, nonoref, fieldSize); // use pointer series to locate the orefs _ASSERTE(pClass->m_wNumGCPointerSeries > 0); CGCDescSeries *pSeries = ((CGCDesc*) pClass->GetMethodTable())->GetLowestSeries(); for (UINT j = 0; j < pClass->GetNumGCPointerSeries(); j++) { CONSISTENCY_CHECK(pSeries <= CGCDesc::GetCGCDescFromMT(pClass->GetMethodTable())->GetHighestSeries()); memset((void*)&vcLayout[pSeries->GetSeriesOffset()-sizeof(Object)], oref, pSeries->GetSeriesSize() + pClass->GetMethodTable()->GetBaseSize()); pSeries++; } ExplicitClassTrust explicitClassTrust; for (UINT i=0; i < fieldSize; i++) { ExplicitFieldTrustHolder fieldTrust(&explicitClassTrust); if (vcLayout[i] == oref) { switch (pFieldLayout[i]) { // oref <--> empty case empty: pFieldLayout[i] = oref; fieldTrust.SetTrust(ExplicitFieldTrust::kNonOverLayed); break; // oref <--> nonoref case nonoref: fieldTrust.SetTrust(ExplicitFieldTrust::kNone); break; // oref <--> oref case oref: fieldTrust.SetTrust(ExplicitFieldTrust::kLegal); if ((*pFirstObjectOverlapOffset) == ((DWORD)(-1))) { *pFirstObjectOverlapOffset = (DWORD)i; } break; default: _ASSERTE(!"Can't get here."); } } else if (vcLayout[i] == nonoref) { switch (pFieldLayout[i]) { // nonoref <--> empty case empty: pFieldLayout[i] = nonoref; fieldTrust.SetTrust(ExplicitFieldTrust::kNonOverLayed); break; // nonoref <--> nonoref case nonoref: fieldTrust.SetTrust(ExplicitFieldTrust::kVerifiable); break; // nonoref <--> oref case oref: fieldTrust.SetTrust(ExplicitFieldTrust::kNone); break; default: _ASSERTE(!"Can't get here."); } } else { _ASSERTE(!"Can't get here."); } } return explicitClassTrust.GetTrustLevel(); } //******************************************************************************* void MethodTableBuilder::FindPointerSeriesExplicit(UINT instanceSliceSize, BYTE *pFieldLayout) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END // allocate a structure to track the series. We know that the worst case is a oref-non-oref-non // so would the number of series is total instance size div 2 div size of oref. // But watch out for the case where we have e.g. an instanceSlizeSize of 4. DWORD sz = (instanceSliceSize + (2 * sizeof(OBJECTREF)) - 1); bmtGCSeries->pSeries = new bmtGCSeriesInfo::Series[sz/2/sizeof(OBJECTREF)]; BYTE *loc = pFieldLayout; BYTE *layoutEnd = pFieldLayout + instanceSliceSize; while (loc < layoutEnd) { loc = (BYTE*)memchr((void*)loc, oref, layoutEnd-loc); if (!loc) break; BYTE *cur = loc; while(*cur == oref && cur < layoutEnd) cur++; // so we have a GC series at loc for cur-loc bytes bmtGCSeries->pSeries[bmtGCSeries->numSeries].offset = (DWORD)(loc - pFieldLayout); bmtGCSeries->pSeries[bmtGCSeries->numSeries].len = (DWORD)(cur - loc); CONSISTENCY_CHECK(IS_ALIGNED(cur - loc, sizeof(size_t))); bmtGCSeries->numSeries++; loc = cur; } SetNumGCPointerSeries(bmtGCSeries->numSeries + (bmtParent->pParentMethodTable ? bmtParent->pParentMethodTable->GetClass()->m_wNumGCPointerSeries : 0)); } //******************************************************************************* VOID MethodTableBuilder::HandleGCForExplicitLayout() { CONTRACTL { NOTHROW; GC_TRIGGERS; FORBID_FAULT; } CONTRACTL_END if (! bmtGCSeries->numSeries) { delete [] bmtGCSeries->pSeries; bmtGCSeries->pSeries = NULL; return; } MethodTable *pMT = GetHalfBakedMethodTable(); pMT->SetContainsPointers(); // Copy the pointer series map from the parent CGCDesc::Init( (PVOID) pMT, pMT->GetNumGCPointerSeries() ); EEClass *pParentClass = bmtParent->pParentMethodTable ? bmtParent->pParentMethodTable->GetClass() : NULL; if (pParentClass && pParentClass->m_wNumGCPointerSeries > 0) { size_t ParentGCSize = CGCDesc::ComputeSize(pParentClass->m_wNumGCPointerSeries); memcpy( (PVOID) (((BYTE*) pMT) - ParentGCSize), (PVOID) (((BYTE*) bmtParent->pParentMethodTable) - ParentGCSize), ParentGCSize - sizeof(UINT) ); } // Build the pointer series map for this pointers in this instance CGCDescSeries *pSeries = ((CGCDesc*)pMT)->GetLowestSeries(); for (UINT i=0; i < bmtGCSeries->numSeries; i++) { // See gcdesc.h for an explanation of why we adjust by subtracting BaseSize BAD_FORMAT_NOTHROW_ASSERT(pSeries <= CGCDesc::GetCGCDescFromMT(pMT)->GetHighestSeries()); pSeries->SetSeriesSize( (size_t) bmtGCSeries->pSeries[i].len - (size_t) pMT->GetBaseSize() ); pSeries->SetSeriesOffset(bmtGCSeries->pSeries[i].offset + sizeof(Object) + InstanceSliceOffsetForExplicit(TRUE, bmtParent->pParentMethodTable)); pSeries++; } delete [] bmtGCSeries->pSeries; bmtGCSeries->pSeries = NULL; } static BOOL InsertMethodTable(MethodTable *pNew, MethodTable **pArray, DWORD *pNumAssigned) { LEAF_CONTRACT; for (DWORD j = 0; j < (*pNumAssigned); j++) { if (pNew == pArray[j]) { #ifdef _DEBUG LOG((LF_CLASSLOADER, LL_INFO1000, "GENERICS: Found duplicate interface %s (%p) at position %d out of %d\n", pNew->GetDebugClassName(), pNew, j, *pNumAssigned)); #endif return pNew->HasInstantiation(); // bail out - we found a duplicate instantiated interface } else { #ifdef _DEBUG LOG((LF_CLASSLOADER, LL_INFO1000, " GENERICS: InsertMethodTable ignored interface %s (%p) at position %d out of %d\n", pArray[j]->GetDebugClassName(), pArray[j], j, *pNumAssigned)); #endif } } LOG((LF_CLASSLOADER, LL_INFO1000, "GENERICS: Inserting interface %s (%p) at position %d\n", pNew->GetDebugClassName(), pNew, *pNumAssigned)); pArray[(*pNumAssigned)++] = pNew; return FALSE; } BOOL ClassLoader::LoadExactParentAndInterfacesTransitively(MethodTable *pMT) { CONTRACT(BOOL) { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(pMT)); POSTCONDITION(pMT->CheckLoadLevel(CLASS_LOAD_EXACTPARENTS)); } CONTRACT_END; TypeHandle thisTH(pMT); SigTypeContext typeContext(thisTH); IMDInternalImport* pInternalImport = pMT->GetMDImport(); MethodTable *pParentMT = pMT->GetParentMethodTable(); if (!pMT->IsArray()) { // Fill in exact parent if it's instantiated mdToken crExtends; pInternalImport->GetTypeDefProps(pMT->GetCl(), NULL, &crExtends); BOOL parentChanged = FALSE; if (!IsNilToken(crExtends) && TypeFromToken(crExtends) == mdtTypeSpec) { TypeHandle newParent = ClassLoader::LoadTypeDefOrRefOrSpecThrowing(pMT->GetModule(), crExtends, &typeContext, ClassLoader::ThrowIfNotFound, ClassLoader::FailIfUninstDefOrRef, ClassLoader::LoadTypes, CLASS_LOAD_EXACTPARENTS, TRUE); MethodTable* pNewParentMT = newParent.AsMethodTable(); if (pNewParentMT != pParentMT) { #ifdef _DEBUG LOG((LF_CLASSLOADER, LL_INFO1000, "GENERICS: Replaced approximate parent %s with exact parent %s from token %x\n", pParentMT->GetDebugClassName(), pNewParentMT->GetDebugClassName(), crExtends)); #endif pMT->SetParentMethodTable (pNewParentMT); pParentMT = pNewParentMT; parentChanged = TRUE; } } else if (pParentMT != NULL) { EnsureLoaded(pParentMT, CLASS_LOAD_EXACTPARENTS); } } // Restore action, not in MethodTable::Restore because we may have had approx parents at that point if (pMT->IsZapped()) { for (MethodTable *pChain = pMT; pChain != NULL; pChain = pChain->GetParentMethodTable()) { if (pChain->HasInstantiation()) { _ASSERTE(pMT->GetPerInstInfo() != NULL); // Copy down all inherited dictionary pointers which we // could not embed. DWORD dictNum = pChain->GetClass()->GetNumDicts()-1; Dictionary **ppDict = pMT->GetPerInstInfo() + dictNum; if (*ppDict == NULL) { *ppDict = pChain->GetPerInstInfo()[dictNum]; } } } } BOOL hasInstantiatedInterfaces = FALSE; MethodTable::InterfaceMapIterator it = pMT->IterateInterfaceMap(); while (it.Next()) { if (it.GetInterface()->HasInstantiation()) { hasInstantiatedInterfaces = TRUE; break; } } // If we have some instantiated interfaces, then we have lots more work to do... // In the worst case we have to use the metadata to // (a) load the exact interfaces and determine the order in which they // go. We do those by re-running the interface layout algorithm // and using metadata-comparisons to place interfaces in the list. // (b) do a check to see if any ambiguity in the interface dispatch map is introduced // by the instantiation // // However, we can do something simpler: we just use // the loaded interface method tables to determine ordering. This can be done // if there are no duplicate instantiated interfaces in the interface // set. if (hasInstantiatedInterfaces) { // Exact interface instantiation loading TECHNIQUE 1. // (a) For interfaces inherited from an instantiated parent class, just copy down from exact parent // (b) Grab newly declared interfaces by loading and then copying down all their inherited parents // (c) But check for any exact duplicates along the way // (d) If no duplicates then we can use the computed interface map we've created // (e) If duplicates found then use the slow metadata-based technique MethodTable **pExactMTs = (MethodTable**) _alloca(sizeof(MethodTable *) * pMT->GetNumInterfaces()); DWORD nAssigned = 0; BOOL duplicates = false; if (pParentMT != NULL) { MethodTable::InterfaceMapIterator parentIt = pParentMT->IterateInterfaceMap(); while (parentIt.Next()) { LOG((LF_CLASSLOADER, LL_INFO1000, "PHASEDLOAD: Calling InsertMethodTable on imap for %s with interface %s and %d assigned so far\n", pMT->GetDebugClassName(), parentIt.GetInterface()->GetDebugClassName(), nAssigned)); duplicates |= InsertMethodTable(parentIt.GetInterface(), pExactMTs, &nAssigned); } } InterfaceImplEnum ie(pMT->GetModule(), pMT->GetCl(), NULL); while (ie.Next()) { MethodTable *pNewIntfMT = ClassLoader::LoadTypeDefOrRefOrSpecThrowing(pMT->GetModule(), ie.CurrentToken(), &typeContext, ClassLoader::ThrowIfNotFound, ClassLoader::FailIfUninstDefOrRef, ClassLoader::LoadTypes, CLASS_LOAD_EXACTPARENTS, TRUE).GetMethodTable(); LOG((LF_CLASSLOADER, LL_INFO1000, "PHASEDLOAD: Calling InsertMethodTable on imap for %s with interface %s and %d assigned so far\n", pMT->GetDebugClassName(), pNewIntfMT->GetDebugClassName(), nAssigned)); duplicates |= InsertMethodTable(pNewIntfMT, pExactMTs, &nAssigned); MethodTable::InterfaceMapIterator intIt = pNewIntfMT->IterateInterfaceMap(); while (intIt.Next()) { LOG((LF_CLASSLOADER, LL_INFO1000, "PHASEDLOAD: Calling InsertMethodTable on imap for %s with interface %s and %d assigned so far\n", pMT->GetDebugClassName(), intIt.GetInterface()->GetDebugClassName(), nAssigned)); duplicates |= InsertMethodTable(intIt.GetInterface(), pExactMTs, &nAssigned); } } #ifdef _DEBUG duplicates |= EEConfig::GetConfigDWORD(L"AlwaysUseMetadataInterfaceMapLayout", FALSE); #endif CONSISTENCY_CHECK(duplicates || nAssigned == pMT->GetNumInterfaces()); if (duplicates) { // // // Thread *pThread = GetThread(); CheckPointHolder cph(pThread->m_MarshalAlloc.GetCheckpoint()); //hold checkpoint for autorelease // *********************************************************** // ****** This must be consistent with ExpandApproxInterface etc. ******* // // The correlation to ExpandApproxInterfaces etc. simply drops out by how we // traverse interfaces. // *********************************************************** MethodTableBuilder::bmtExactInterfaceInfo bmtExactInterface; bmtExactInterface.ppInterfaceSubstitutionChains = (Substitution**) pThread->m_MarshalAlloc.Alloc(sizeof(Substitution *) * pMT->GetNumInterfaces()); bmtExactInterface.pExactMTs = pExactMTs; bmtExactInterface.nAssigned = 0; bmtExactInterface.typeContext = typeContext; // Do the interfaces inherited from a parent class if (pParentMT != NULL && pParentMT->GetNumInterfaces() > 0) { Substitution parentSubst = pMT->GetClass()->GetSubstitutionForParent(NULL); MethodTableBuilder::ExpandExactInheritedInterfaces(&bmtExactInterface,pParentMT,&parentSubst); } _ASSERTE(pParentMT->GetNumInterfaces() == bmtExactInterface.nAssigned); MethodTableBuilder::bmtInterfaceAmbiguityCheckInfo bmtCheckInfo; bmtCheckInfo.pMT = pMT; bmtCheckInfo.ppInterfaceSubstitutionChains = (Substitution**) pThread->m_MarshalAlloc.Alloc(sizeof(Substitution *) * pMT->GetNumInterfaces()); bmtCheckInfo.ppExactDeclaredInterfaces = (MethodTable**) pThread->m_MarshalAlloc.Alloc(sizeof(MethodTable *) * pMT->GetNumInterfaces()); bmtCheckInfo.nAssigned = 0; bmtCheckInfo.typeContext = typeContext; MethodTableBuilder::InterfacesAmbiguityCheck(&bmtCheckInfo, pMT->GetModule(), pMT->GetCl(), NULL); // OK, there is no ambiguity amongst the instantiated interfaces declared on this class. MethodTableBuilder::ExpandExactDeclaredInterfaces(&bmtExactInterface, pMT->GetModule(), pMT->GetCl(), NULL); CONSISTENCY_CHECK(bmtExactInterface.nAssigned == pMT->GetNumInterfaces()); } // OK, if we've got this far then pExactMTs should now hold the array of exact instantiated interfaces. MethodTable::InterfaceMapIterator thisIt = pMT->IterateInterfaceMap(); DWORD i = 0; while (thisIt.Next()) { #ifdef _DEBUG MethodTable*pOldMT = thisIt.GetInterface(); MethodTable *pNewMT = pExactMTs[i]; CONSISTENCY_CHECK(pOldMT->HasSameTypeDefAs(pNewMT)); #endif thisIt.SetInterface(pExactMTs[i]); i++; } } // We can now mark this type as having exact parents pMT->SetHasExactParent(); RETURN FALSE; } // CLASS_LOAD_EXACTPARENTS phase of loading: // * Load the base class at exact instantiation // * Recurse LoadExactParents up parent hierarchy // * Load explicitly declared interfaces on this class at exact instantiation // * Fixup vtable (STUB_DISPATCH off) // /*static*/ void ClassLoader::LoadExactParents(MethodTable *pMT) { CONTRACT_VOID { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(pMT)); POSTCONDITION(pMT->CheckLoadLevel(CLASS_LOAD_EXACTPARENTS)); } CONTRACT_END; if (!pMT->IsCanonicalMethodTable()) { EnsureLoaded(TypeHandle(pMT->GetCanonicalMethodTable()), CLASS_LOAD_EXACTPARENTS); } LoadExactParentAndInterfacesTransitively(pMT); // Copy down inherited dictionary pointers MethodTable* pParentMT = pMT->GetParentMethodTable(); if (pMT->GetPerInstInfo() && pParentMT && pParentMT->GetPerInstInfo()) { memcpy(pMT->GetPerInstInfo(), pParentMT->GetPerInstInfo(), sizeof(TypeHandle*) * pParentMT->GetNumDicts()); } //fix up wrongly-inherited method descriptors </STRIP> for (DWORD i = 0; i < pMT->GetNumParentVirtuals(); i++) { MethodDesc* pMD = pMT->GetUnknownMethodDescForSlot(i); if (pMD->GetCanonicalMethodTable() != pMT->GetCanonicalMethodTable()) { pMT->SetSlot(i, pParentMT->GetRestoredSlot(i)); } } RETURN; } /* static */ void MethodTableBuilder::LoadExactInterfaceMap(MethodTable *pMT) { CONTRACT_VOID { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(pMT)); } CONTRACT_END; TypeHandle thisTH(pMT); SigTypeContext typeContext(thisTH); MethodTable *pParentMT = pMT->GetParentMethodTable(); BOOL hasInstantiatedInterfaces = FALSE; MethodTable::InterfaceMapIterator it = pMT->IterateInterfaceMap(); while (it.Next()) { if (it.GetInterface()->HasInstantiation()) { hasInstantiatedInterfaces = TRUE; break; } } // If we have some instantiated interfaces, then we have lots more work to do... // In the worst case we have to use the metadata to // (a) load the exact interfaces and determine the order in which they // go. We do those by re-running the interface layout algorithm // and using metadata-comparisons to place interfaces in the list. // (b) do a check to see if any ambiguity in the interface dispatch map is introduced // by the instantiation // // However, we can do something simpler: we just use // the loaded interface method tables to determine ordering. This can be done // if there are no duplicate instantiated interfaces in the interface // set. if (hasInstantiatedInterfaces) { // Exact interface instantiation loading TECHNIQUE 1. // (a) For interfaces inherited from an instantiated parent class, just copy down from exact parent // (b) Grab newly declared interfaces by loading and then copying down all their inherited parents // (c) But check for any exact duplicates along the way // (d) If no duplicates then we can use the computed interface map we've created // (e) If duplicates found then use the slow metadata-based technique MethodTable **pExactMTs = (MethodTable**) _alloca(sizeof(MethodTable *) * pMT->GetNumInterfaces()); DWORD nAssigned = 0; BOOL duplicates = false; if (pParentMT != NULL) { MethodTable::InterfaceMapIterator parentIt = pParentMT->IterateInterfaceMap(); while (parentIt.Next()) { duplicates |= InsertMethodTable(parentIt.GetInterface(), pExactMTs, &nAssigned); } } InterfaceImplEnum ie(pMT->GetModule(), pMT->GetCl(), NULL); while (ie.Next()) { MethodTable *pNewIntfMT = ClassLoader::LoadTypeDefOrRefOrSpecThrowing(pMT->GetModule(), ie.CurrentToken(), &typeContext, ClassLoader::ThrowIfNotFound, ClassLoader::FailIfUninstDefOrRef, ClassLoader::LoadTypes, CLASS_LOAD_EXACTPARENTS, TRUE).GetMethodTable(); duplicates |= InsertMethodTable(pNewIntfMT, pExactMTs, &nAssigned); MethodTable::InterfaceMapIterator intIt = pNewIntfMT->IterateInterfaceMap(); while (intIt.Next()) { duplicates |= InsertMethodTable(intIt.GetInterface(), pExactMTs, &nAssigned); } } #ifdef _DEBUG duplicates |= EEConfig::GetConfigDWORD(L"AlwaysUseMetadataInterfaceMapLayout", FALSE); #endif CONSISTENCY_CHECK(duplicates || nAssigned == pMT->GetNumInterfaces()); if (duplicates) { // // // Thread *pThread = GetThread(); CheckPointHolder cph(pThread->m_MarshalAlloc.GetCheckpoint()); //hold checkpoint for autorelease // *********************************************************** // ****** This must be consistent with ExpandApproxInterface etc. ******* // // The correlation to ExpandApproxInterfaces etc. simply drops out by how we // traverse interfaces. // *********************************************************** bmtExactInterfaceInfo bmtExactInterface; bmtExactInterface.ppInterfaceSubstitutionChains = (Substitution**) pThread->m_MarshalAlloc.Alloc(sizeof(Substitution *) * pMT->GetNumInterfaces()); bmtExactInterface.pExactMTs = pExactMTs; bmtExactInterface.nAssigned = 0; bmtExactInterface.typeContext = typeContext; // Do the interfaces inherited from a parent class if (pParentMT != NULL && pParentMT->GetNumInterfaces() > 0) { Substitution parentSubst = pMT->GetClass()->GetSubstitutionForParent(NULL); ExpandExactInheritedInterfaces(&bmtExactInterface,pParentMT,&parentSubst); } _ASSERTE(pParentMT->GetNumInterfaces() == bmtExactInterface.nAssigned); bmtInterfaceAmbiguityCheckInfo bmtCheckInfo; bmtCheckInfo.pMT = pMT; bmtCheckInfo.ppInterfaceSubstitutionChains = (Substitution**) pThread->m_MarshalAlloc.Alloc(sizeof(Substitution *) * pMT->GetNumInterfaces()); bmtCheckInfo.ppExactDeclaredInterfaces = (MethodTable**) pThread->m_MarshalAlloc.Alloc(sizeof(MethodTable *) * pMT->GetNumInterfaces()); bmtCheckInfo.nAssigned = 0; bmtCheckInfo.typeContext = typeContext; MethodTableBuilder::InterfacesAmbiguityCheck(&bmtCheckInfo, pMT->GetModule(), pMT->GetCl(), NULL); // OK, there is no ambiguity amongst the instantiated interfaces declared on this class. MethodTableBuilder::ExpandExactDeclaredInterfaces(&bmtExactInterface, pMT->GetModule(), pMT->GetCl(), NULL); CONSISTENCY_CHECK(bmtExactInterface.nAssigned == pMT->GetNumInterfaces()); } // OK, if we've got this far then pExactMTs should now hold the array of exact instantiated interfaces. MethodTable::InterfaceMapIterator thisIt = pMT->IterateInterfaceMap(); DWORD i = 0; while (thisIt.Next()) { #ifdef _DEBUG MethodTable*pOldMT = thisIt.GetInterface(); MethodTable *pNewMT = pExactMTs[i]; CONSISTENCY_CHECK(pOldMT->HasSameTypeDefAs(pNewMT)); #endif // _DEBUG thisIt.SetInterface(pExactMTs[i]); i++; } } RETURN; } //******************************************************************************* void MethodTableBuilder::ExpandExactInheritedInterfaces(bmtExactInterfaceInfo *bmtInfo, MethodTable *pMT, const Substitution *pSubstChain) { WRAPPER_CONTRACT; MethodTable *pParentMT = pMT->GetParentMethodTable(); if (pParentMT) { Substitution parentSubst = pMT->GetClass()->GetSubstitutionForParent(pSubstChain); ExpandExactInheritedInterfaces(bmtInfo,pParentMT,&parentSubst); } ExpandExactDeclaredInterfaces(bmtInfo,pMT->GetModule(),pMT->GetCl(),pSubstChain); } //******************************************************************************* /* static */ void MethodTableBuilder::ExpandExactDeclaredInterfaces(bmtExactInterfaceInfo *bmtInfo, Module *pModule, mdToken typeDef, const Substitution *pSubstChain) { WRAPPER_CONTRACT; InterfaceImplEnum ie(pModule, typeDef, pSubstChain); while (ie.Next()) { MethodTable *pInterface = ClassLoader::LoadTypeDefOrRefOrSpecThrowing(pModule, ie.CurrentToken(), &bmtInfo->typeContext, ClassLoader::ThrowIfNotFound, ClassLoader::FailIfUninstDefOrRef, ClassLoader::LoadTypes, CLASS_LOAD_EXACTPARENTS, TRUE, pSubstChain).GetMethodTable(); ExpandExactInterface(bmtInfo, ie.CurrentSubst(), pInterface); } } //******************************************************************************* void MethodTableBuilder::ExpandExactInterface(bmtExactInterfaceInfo *bmtInfo, const Substitution *pItfSubstChain, MethodTable *pIntf) { WRAPPER_CONTRACT; // Is it already present according to the "generic" layout of the interfaces. // Note we use exactly the same algorithm as when we // determined the layout of the interface map for the "generic" version of the class. for (DWORD i = 0; i < bmtInfo->nAssigned; i++) { if (MetaSig::CompareTypeDefsUnderSubstitutions(bmtInfo->pExactMTs[i], pIntf, bmtInfo->ppInterfaceSubstitutionChains[i], pItfSubstChain)) return; // found it, don't add it again } // Add it and each sub-interface // Also save the substitution chain for future comparisons during this run of ExpandExactInterfaces DWORD n = bmtInfo->nAssigned; bmtInfo->pExactMTs[n] = pIntf; bmtInfo->ppInterfaceSubstitutionChains[n] = (Substitution *) GetThread()->m_MarshalAlloc.Alloc(sizeof(Substitution) * pItfSubstChain->GetLength()); pItfSubstChain->CopyToArray(bmtInfo->ppInterfaceSubstitutionChains[n]); bmtInfo->nAssigned++; ExpandExactDeclaredInterfaces(bmtInfo, pIntf->GetModule(), pIntf->GetCl(), pItfSubstChain); } //******************************************************************************* /* static */ void MethodTableBuilder::InterfacesAmbiguityCheck(bmtInterfaceAmbiguityCheckInfo *bmtCheckInfo, Module *pModule, mdToken typeDef, const Substitution *pSubstChain) { WRAPPER_CONTRACT; InterfaceImplEnum ie(pModule, typeDef, pSubstChain); while (ie.Next()) { MethodTable *pInterface = ClassLoader::LoadTypeDefOrRefOrSpecThrowing(pModule, ie.CurrentToken(), &bmtCheckInfo->typeContext, ClassLoader::ThrowIfNotFound, ClassLoader::FailIfUninstDefOrRef, ClassLoader::LoadTypes, CLASS_LOAD_EXACTPARENTS, TRUE, pSubstChain).GetMethodTable(); InterfaceAmbiguityCheck(bmtCheckInfo, ie.CurrentSubst(), pInterface); } } //******************************************************************************* void MethodTableBuilder::InterfaceAmbiguityCheck(bmtInterfaceAmbiguityCheckInfo *bmtCheckInfo, const Substitution *pItfSubstChain, MethodTable *pIntf) { WRAPPER_CONTRACT; for (DWORD i = 0; i < bmtCheckInfo->nAssigned; i++) { if (MetaSig::CompareTypeDefsUnderSubstitutions(bmtCheckInfo->ppExactDeclaredInterfaces[i], pIntf, bmtCheckInfo->ppInterfaceSubstitutionChains[i], pItfSubstChain)) return; // found it, don't add it again } // OK, so it isn't a duplicate based on the generic IL, now check if the instantiation // makes it a duplicate. for (DWORD i = 0; i < bmtCheckInfo->nAssigned; i++) { if (bmtCheckInfo->ppExactDeclaredInterfaces[i] == pIntf) { bmtCheckInfo->pMT->GetModule()->GetAssembly()->ThrowTypeLoadException(bmtCheckInfo->pMT->GetModule()->GetMDImport(), bmtCheckInfo->pMT->GetCl(), IDS_CLASSLOAD_OVERLAPPING_INTERFACES); } } DWORD n = bmtCheckInfo->nAssigned; bmtCheckInfo->ppExactDeclaredInterfaces[n] = pIntf; bmtCheckInfo->ppInterfaceSubstitutionChains[n] = (Substitution *) GetThread()->m_MarshalAlloc.Alloc(sizeof(Substitution) * pItfSubstChain->GetLength()); pItfSubstChain->CopyToArray(bmtCheckInfo->ppInterfaceSubstitutionChains[n]); bmtCheckInfo->nAssigned++; InterfacesAmbiguityCheck(bmtCheckInfo,pIntf->GetModule(),pIntf->GetCl(),pItfSubstChain); } //******************************************************************************* int __cdecl CompareUnknownSlotAddressSlotNumbers(const void *md1, const void *md2) { WRAPPER_CONTRACT; MethodDesc *pMD1 = MethodTable::GetUnknownMethodDescForSlotAddress(*((SLOT*)md1)); MethodDesc *pMD2 = MethodTable::GetUnknownMethodDescForSlotAddress(*((SLOT*)md2)); return (int)pMD1->GetSlot() - (int)pMD2->GetSlot(); } //******************************************************************************* // Private helper method used by the code below to check whether the given // method is annotated to be a VTS event callback. BOOL MethodTableBuilder::CheckForVtsEventMethod(IMDInternalImport *pImport, MethodDesc *pMD, DWORD dwAttrs, LPCUTF8 szAttrName, MethodDesc **ppMethodDesc) { CONTRACTL { THROWS; GC_TRIGGERS; } CONTRACTL_END; // For each method with an attriubte we need to check that: // o The method is not static, virtual, abstract or generic. // o The signature is correct. // o No other method on the same type is marked with the same // attribute. if (pImport->GetCustomAttributeByName(pMD->GetMemberDef(), szAttrName, NULL, NULL) == S_OK) { if (IsMdStatic(dwAttrs) || IsMdVirtual(dwAttrs) || IsMdAbstract(dwAttrs) || pMD->IsGenericMethodDefinition()) { BuildMethodTableThrowException(IDS_CLASSLOAD_INVALID_VTS_METHOD, pMD->GetMemberDef()); } // Check whether we've seen one of these methods before. if (*ppMethodDesc != NULL) { BuildMethodTableThrowException(IDS_CLASSLOAD_TOO_MANY_VTS_METHODS, szAttrName); } // Check the signature, it should be "void M(StreamingContext)". DWORD cbSig; PCCOR_SIGNATURE pSig = pImport->GetSigOfMethodDef(pMD->GetMemberDef(), &cbSig); // Should be an instance method with no generic type parameters. if (CorSigUncompressCallingConv(pSig) != IMAGE_CEE_CS_CALLCONV_HASTHIS) goto BadSignature; // Should have one argument. if (CorSigUncompressData(pSig) != 1) goto BadSignature; // And a return type of void. if (*pSig++ != (BYTE)ELEMENT_TYPE_VOID) goto BadSignature; // The argument should be a value type. if (*pSig++ != (BYTE)ELEMENT_TYPE_VALUETYPE) goto BadSignature; // Now the tricky bit: we want to verify the value type is // StreamingContext, but we don't want to simply load the type since it // might be any other arbitrary type and cause recursive loading // problems. SO we manually check the type via the metadata APIs // instead. mdToken tkType = CorSigUncompressToken(pSig); LPCUTF8 szType; LPCUTF8 szNamespace; // Compute type name and namespace. if (TypeFromToken(tkType) == mdtTypeDef) { pImport->GetNameOfTypeDef(tkType, &szType, &szNamespace); } else { _ASSERTE(TypeFromToken(tkType) == mdtTypeRef); pImport->GetNameOfTypeRef(tkType, &szNamespace, &szType); } // Do the names match? if (strcmp(szType, g_Mscorlib.GetClassName(CLASS__STREAMING_CONTEXT)) != 0 || strcmp(szNamespace, g_Mscorlib.GetClassNameSpace(CLASS__STREAMING_CONTEXT))) goto BadSignature; // For typedefs we can directly check whether the current module is // part of mscorlib. For refs we have to dig deeper (into the token // resolution scope). if (TypeFromToken(tkType) == mdtTypeDef) { if (bmtError->pModule->GetAssembly()->GetManifestModule() != SystemDomain::SystemAssembly()->GetManifestModule()) goto BadSignature; } else { // The scope needs to be an assembly ref. mdToken tkScope = pImport->GetResolutionScopeOfTypeRef(tkType); if (TypeFromToken(tkScope) != mdtAssemblyRef) goto BadSignature; // Fetch the name and public key or public key token. BYTE *pbPublicKeyOrToken; DWORD cbPublicKeyOrToken; LPCSTR szAssembly; DWORD dwAssemblyFlags; pImport->GetAssemblyRefProps(tkScope, (const void**)&pbPublicKeyOrToken, &cbPublicKeyOrToken, &szAssembly, NULL, // AssemblyMetaDataInternal: we don't care about version, culture etc. NULL, // Hash value pointer, obsolete information NULL, // Byte count for above &dwAssemblyFlags); // Validate the name. if (stricmpUTF8(szAssembly, g_psBaseLibraryName) != 0) goto BadSignature; // And the public key or token, whichever was burned into the reference by the compiler. For mscorlib this is the ECMA key or // token. if (IsAfPublicKeyToken(dwAssemblyFlags)) { if (cbPublicKeyOrToken != sizeof(g_rbNeutralPublicKeyToken) || memcmp(pbPublicKeyOrToken, g_rbNeutralPublicKeyToken, cbPublicKeyOrToken) != 0) goto BadSignature; } else { if (cbPublicKeyOrToken != sizeof(g_rbNeutralPublicKey) || memcmp(pbPublicKeyOrToken, g_rbNeutralPublicKey, cbPublicKeyOrToken) != 0) goto BadSignature; } } // We managed to pass all tests; record this method. *ppMethodDesc = pMD; return TRUE; } return FALSE; BadSignature: BuildMethodTableThrowException(IDS_CLASSLOAD_INVALID_VTS_SIG, pMD->GetMemberDef()); } //******************************************************************************* // Names of the various VTS custom attributes #define VTS_ON_SERIALIZING_ATTRIBUTE "System.Runtime.Serialization.OnSerializingAttribute" #define VTS_ON_SERIALIZED_ATTRIBUTE "System.Runtime.Serialization.OnSerializedAttribute" #define VTS_ON_DESERIALIZING_ATTRIBUTE "System.Runtime.Serialization.OnDeserializingAttribute" #define VTS_ON_DESERIALIZED_ATTRIBUTE "System.Runtime.Serialization.OnDeserializedAttribute" #define VTS_OPTIONAL_FIELD_ATTRIBUTE "System.Runtime.Serialization.OptionalFieldAttribute" //******************************************************************************* // Look for VTS event methods or fields with interesting serialization // attributes on this type (only called for serializable types). VOID MethodTableBuilder::ScanTypeForVtsInfo() { CONTRACTL { THROWS; GC_TRIGGERS; PRECONDITION(IsTdSerializable(GetAttrClass())); } CONTRACTL_END; DWORD i; // Scan all the non-virtual, non-abstract, non-generic instance methods for // one of the special custom attributes indicating a VTS event method. DeclaredMethodIterator it(*this); while (it.Next()) { if (CheckForVtsEventMethod(bmtInternal->pInternalImport, it.GetMethodDesc(), it.Attrs(), VTS_ON_SERIALIZING_ATTRIBUTE, &bmtMFDescs->pOnSerializingMethod)) bmtMFDescs->fNeedsRemotingVtsInfo = true; if (CheckForVtsEventMethod(bmtInternal->pInternalImport, it.GetMethodDesc(), it.Attrs(), VTS_ON_SERIALIZED_ATTRIBUTE, &bmtMFDescs->pOnSerializedMethod)) bmtMFDescs->fNeedsRemotingVtsInfo = true; if (CheckForVtsEventMethod(bmtInternal->pInternalImport, it.GetMethodDesc(), it.Attrs(), VTS_ON_DESERIALIZING_ATTRIBUTE, &bmtMFDescs->pOnDeserializingMethod)) bmtMFDescs->fNeedsRemotingVtsInfo = true; if (CheckForVtsEventMethod(bmtInternal->pInternalImport, it.GetMethodDesc(), it.Attrs(), VTS_ON_DESERIALIZED_ATTRIBUTE, &bmtMFDescs->pOnDeserializedMethod)) bmtMFDescs->fNeedsRemotingVtsInfo = true; } // Scan all the instance fields introduced on this type for NotSerialized or // OptionalField attributes. DWORD dwNumIntroducedInstanceFields = bmtEnumMF->dwNumInstanceFields; FieldDesc *pFieldDescList = GetHalfBakedClass()->GetApproxFieldDescListRaw(); for (i = 0; i < dwNumIntroducedInstanceFields; i++) { FieldDesc *pFD = &pFieldDescList[i]; if (IsFdNotSerialized(bmtInternal->pInternalImport->GetFieldDefProps(pFD->GetMemberDef()))) bmtMFDescs->SetFieldNotSerialized(i, dwNumIntroducedInstanceFields); if (bmtInternal->pInternalImport->GetCustomAttributeByName(pFD->GetMemberDef(), VTS_OPTIONAL_FIELD_ATTRIBUTE, NULL, NULL) == S_OK) bmtMFDescs->SetFieldOptionallySerialized(i, dwNumIntroducedInstanceFields); } } //******************************************************************************* // // Used by BuildMethodTable // // Setup the method table // VOID MethodTableBuilder::SetupMethodTable2(AllocMemTracker *pamTracker, Module* pLoaderModule) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(this)); PRECONDITION(CheckPointer(bmtVT)); PRECONDITION(CheckPointer(bmtInterface)); PRECONDITION(CheckPointer(bmtInternal)); PRECONDITION(CheckPointer(bmtProp)); PRECONDITION(CheckPointer(bmtMFDescs)); PRECONDITION(CheckPointer(bmtEnumMF)); PRECONDITION(CheckPointer(bmtError)); PRECONDITION(CheckPointer(bmtMetaData)); PRECONDITION(CheckPointer(bmtParent)); PRECONDITION(CheckPointer(bmtGenerics)); } CONTRACTL_END; // When calling GetUnknownMethodDescForSlotAddress below (which is called by // bmtVTable::GetMethodDescForSlot()), this calls into MNativeJitManager, which // has a NOTHROW contract on all of its methods. But deep in the bowels of this // code there is a BEGIN_ENTRYPOINT_VOIDRET in MNativeJitManager::JitCodeToMethodInfo, // which probes for enough stack space, and on failure SKIPS CODE AND DOESN'T // INFORM THE CALLER OF FAILURE. As such, the call to GetMethodDescForSlot was // returning NULL instead of some sort of SO or other failure code. So, to cover // this case we probe for the default number of pages plus extra to cover the // stack used between here and the call to MNativeJitManager::JitCodeToMethodInfo. BEGIN_SO_INTOLERANT_CODE_FOR(GetThread(), DefaultEntryProbeAmount() + 2) DWORD i; EEClass *pClass = GetHalfBakedClass(); DWORD cbDict = bmtGenerics->HasInstantiation() ? DictionaryLayout::GetFirstDictionaryBucketSize(bmtGenerics->GetNumGenericArgs(), pClass->GetDictionaryLayout()) : 0; BOOL fHasThreadOrContextStatics = (bmtTCSInfo) ? (bmtTCSInfo->dwThreadStaticsSize | bmtTCSInfo->dwContextStaticsSize) : FALSE; BOOL fNeedsRemotableMethodInfo = (bmtProp->fMarshaledByRef || IsInterface() || g_pObjectClass == NULL); // Now setup the method table // interface map is allocated along with the method table MethodTable *pMT = MethodTable::AllocateNewMT(pClass, bmtVT->dwCurrentNonVtableSlot, pClass->m_wNumGCPointerSeries ? (DWORD)CGCDesc::ComputeSize(pClass->m_wNumGCPointerSeries) : 0, bmtInterface->dwInterfaceMapSize, bmtGenerics->GetNumGenericArgs(), bmtGenerics->numDicts, cbDict, GetClassLoader(), bmtDomain, IsInterface(), bmtProp->fGenericsStatics, fNeedsRemotableMethodInfo, bmtMFDescs->fNeedsRemotingVtsInfo, fHasThreadOrContextStatics, pamTracker); pClass->m_pMethodTable = pMT; #ifdef _DEBUG pMT->SetDebugClassName(GetDebugClassName()); #endif pMT->SetIsNotFullyLoaded(); pMT->SetHasApproxParent(); // Need to do this before anyone inquires about optional data offsets or sizes. if (bmtProp->fGenericsStatics) pMT->SetHasGenericsStaticsInfo(); if (bmtMFDescs->fNeedsRemotingVtsInfo) pMT->SetHasRemotingVtsInfo(); if (fHasThreadOrContextStatics) pMT->SetHasThreadOrContextStatics(); if (bmtProp->fDynamicStatics) pMT->SetDynamicStatics(); if (bmtProp->fMarshaledByRef) pMT->SetMarshaledByRef(); if (IsInterface()) pMT->SetIsInterface(); // Must be done early because various methods test HasInstantiation() and ContainsGenericVariables() if (bmtGenerics->GetNumGenericArgs() != 0) { pMT->SetHasInstantiation(bmtGenerics->genericsKind == EEClass::VMFLAG_GENERIC_TYPICALINST); if (bmtGenerics->fContainsGenericVariables) pMT->SetContainsGenericVariables(); } pMT->SetDictInfo(bmtGenerics->numDicts, bmtGenerics->GetNumGenericArgs()); CONSISTENCY_CHECK(pMT->GetNumGenericArgs() == bmtGenerics->GetNumGenericArgs()); CONSISTENCY_CHECK(pMT->GetNumDicts() == bmtGenerics->numDicts); CONSISTENCY_CHECK(pMT->HasInstantiation() == bmtGenerics->HasInstantiation()); CONSISTENCY_CHECK(pMT->HasInstantiation() == (pMT->GetInstantiation() != NULL)); _ASSERTE(bmtInternal->pModule != NULL); pMT->SetModule (bmtInternal->pModule); pMT->SetLoaderModule(pLoaderModule); pMT->SetInternalCorElementType (ELEMENT_TYPE_CLASS); SetNonGCStaticFieldBytes (bmtVT->dwNonGCStaticFieldBytes); pMT->SetNumVirtuals(bmtVT->dwCurrentVtableSlot); pMT->SetClassConstructorSlot(GetClassConstructorSlot()); PSecurityProperties psp = GetSecurityProperties(); // Check whether we have any runtime actions such as Demand, Assert etc // that can result in methods needing the security stub. We dont care about Linkdemands etc if ( !psp->GetRuntimeActions() && !psp->GetNullRuntimeActions()) pMT->SetNoSecurityProperties(); pMT->SetCompiledDomainNeutral(bmtDomain->IsSharedDomain()); pMT->SetClassConstructorSlot (bmtVT->wCCtorSlot); pMT->SetDefaultConstructorSlot (bmtVT->wDefaultCtorSlot); // Push pointer to method table into the head of each of the method desc // chunks we allocated earlier, so that method descs can map back to method // tables. for (DWORD impl=0; impl<METHOD_IMPL_COUNT; impl++) { for (DWORD type=0; type<METHOD_TYPE_COUNT; type++) { bmtMethodDescSet *set = &bmtMFDescs->sets[type][impl]; for (i=0; i<set->dwChunks; i++) { set->pChunkList[i]->SetMethodTable(pMT); } } } #ifdef _DEBUG { DeclaredMethodIterator it(*this); while (it.Next()) { if (it.GetMethodDesc() != NULL) { it.GetMethodDesc()->m_pDebugMethodTable = pMT; it.GetMethodDesc()->m_pszDebugMethodSignature = FormatSig(it.GetMethodDesc(), bmtDomain, pamTracker); } if (it.GetUnboxedMethodDesc() != NULL) { it.GetUnboxedMethodDesc()->m_pDebugMethodTable = pMT; it.GetUnboxedMethodDesc()->m_pszDebugMethodSignature = FormatSig(it.GetUnboxedMethodDesc(), bmtDomain, pamTracker); } } } #endif // _DEBUG // Note that for value classes, the following calculation is only appropriate // when the instance is in its "boxed" state. if (!IsInterface()) { DWORD baseSize = (DWORD) MAX(GetNumInstanceFieldBytes() + ObjSizeOf(Object), MIN_OBJECT_SIZE); baseSize = (baseSize + ALLOC_ALIGN_CONSTANT) & ~ALLOC_ALIGN_CONSTANT; // m_BaseSize must be aligned pMT->SetBaseSize(baseSize); pMT->SetComponentSize(0); } else { } _ASSERTE((pMT->IsInterface() == 0) == (IsInterface() == 0)); if (HasLayout()) { pMT->SetNativeSize(GetLayoutInfo()->GetNativeSize()); } #ifdef _DEBUG for (i = 0; i < bmtVT->dwCurrentNonVtableSlot; i++) { _ASSERTE(bmtVT->GetMethodDescForSlot(i) != NULL); } #endif // _DEBUG FieldDesc *pFieldDescList = pClass->GetApproxFieldDescListRaw(); // Set all field slots to point to the newly created MethodTable for (i = 0; i < (bmtEnumMF->dwNumStaticFields + bmtEnumMF->dwNumInstanceFields); i++) { pFieldDescList[i].m_pMTOfEnclosingClass = pMT; } // Fill in type parameters before looking up exact parent or fetching the types of any field descriptors! // This must come before the use of GetFieldType in the value class representation optimization below. if (bmtGenerics->GetNumGenericArgs() != 0) { // Space has already been allocated for the instantiation but the parameters haven't been filled in TypeHandle *pInstDest = pMT->GetInstantiation(); TypeHandle *pInst = bmtGenerics->GetInstantiation(); CONSISTENCY_CHECK(pInst != NULL); CONSISTENCY_CHECK(pInstDest != NULL); // So fill them in... for (DWORD j = 0; j < bmtGenerics->GetNumGenericArgs(); j++) pInstDest[j] = pInst[j]; } if (IsValueClass()) { pMT->SetInternalCorElementType (ELEMENT_TYPE_VALUETYPE); if (IsEnum()) { if (GetNumInstanceFields() != 1 || !CorTypeInfo::IsPrimitiveType(pFieldDescList[0].GetFieldType())) { BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil); } CONSISTENCY_CHECK(!pFieldDescList->IsStatic()); pMT->SetInternalCorElementType (pFieldDescList->GetFieldType()); } else { LPCUTF8 name, nameSpace; #ifdef _X86_ CorElementType normalizedType = ELEMENT_TYPE_END; if (pClass->ComputeInternalCorElementTypeForValueType(&normalizedType)) { CONSISTENCY_CHECK(ELEMENT_TYPE_END != normalizedType); pMT->SetInternalCorElementType(normalizedType); #ifdef _DEBUG bmtInternal->pModule->GetMDImport()->GetNameOfTypeDef(GetCl(), &name, &nameSpace); LOG((LF_CLASSLOADER, LL_INFO10000, "%s::%s marked as primitive type %i\n", nameSpace, name, normalizedType)); #endif // _DEBUG } #endif // _X86_ // Check if it is a primitive type or other special type if (!IsNested() && bmtInternal->pModule->IsSystem()) // we are in mscorlib { bmtInternal->pModule->GetMDImport()->GetNameOfTypeDef(GetCl(), &name, &nameSpace); if (strcmp(nameSpace, "System") == 0) { CorElementType type = CorTypeInfo::FindPrimitiveType(nameSpace, name); if (type == ELEMENT_TYPE_END) { // Mark the special types that have embeded stack poitners in them if (strcmp(name, "ArgIterator") == 0 || strcmp(name, "RuntimeArgumentHandle") == 0) pClass->SetContainsStackPtr(); #ifndef _X86_ pMT->SetInternalCorElementType (ELEMENT_TYPE_VALUETYPE); if ((strcmp(name, g_RuntimeTypeHandleName) == 0) || (strcmp(name, g_RuntimeMethodHandleName) == 0) || (strcmp(name, g_RuntimeFieldHandleName) == 0) || (strcmp(name, g_RuntimeArgumentHandleName) == 0)) { pMT->SetInternalCorElementType (ELEMENT_TYPE_I); } #endif // !_X86_ #ifdef ALIGN_ACCESS // This is required because native layout of System.Decimal causes it to be aligned // differently to the layout of the native DECIMAL structure, which will cause // data misalignent exceptions if Decimal is embedded in another type. if (strcmp(name, "Decimal") == 0) { EEClassLayoutInfo* pLayout = pClass->GetLayoutInfo(); pLayout->m_LargestAlignmentRequirementOfAllMembers = sizeof(ULONGLONG); pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = sizeof(ULONGLONG); } #endif // ALIGN_ACCESS } else { pMT->SetInternalCorElementType(type, TRUE /* isTruePrimitive */ ); pClass->SetIsTruePrimitive(); _ASSERTE(pMT->IsTruePrimitive()); #ifdef _DEBUG bmtInternal->pModule->GetMDImport()->GetNameOfTypeDef(GetCl(), &name, &nameSpace); LOG((LF_CLASSLOADER, LL_INFO10000, "%s::%s marked as primitive type %i\n", nameSpace, name, type)); #endif // _DEBUG if (pMT->GetInternalCorElementType() == ELEMENT_TYPE_TYPEDBYREF) pClass->SetContainsStackPtr(); } } } } } // Now fill in the real interface map with the approximate interfaces if (bmtInterface->dwInterfaceMapSize > 0) { InterfaceInfo_t *pInterfaces = pMT->GetInterfaceMap(); CONSISTENCY_CHECK(CheckPointer(pInterfaces)); // Copy from temporary interface map memcpy(pInterfaces, bmtInterface->pInterfaceMap, bmtInterface->dwInterfaceMapSize * sizeof(InterfaceInfo_t)); } for (i = 0; i < bmtVT->dwCurrentNonVtableSlot; i++) { TADDR addr = (TADDR)bmtVT->pVtable[i]; MethodDesc* pMD = bmtVT->pVtableMD[i]; if (addr == NULL) { _ASSERTE(pMD != NULL); if (pMD->GetMethodTable() == pMT) { if (pMD->ComputeMayHaveNativeCode()) pMD->SetMayHaveNativeCode(); pMD->GetMethodDescChunk()-> EnsureTemporaryEntryPointsCreated(bmtDomain, pamTracker); addr = pMD->GetTemporaryEntryPoint(); _ASSERTE(!pMD->HasNonVtableSlot()); } else { addr = pMD->HasStableEntryPoint() ? pMD->GetStableEntryPoint() : pMD->GetTemporaryEntryPoint(); } } _ASSERTE(addr != NULL); pMT->SetSlot(i,(SLOT)addr); if (pMD != NULL && pMD->GetMethodTable() == pMT && pMD->GetSlot() == i) { if (pMD->RequiresStableEntryPoint()) { // The rest of the system assumes that certain methods always have stable entrypoints. // Create them now. pMD->GetOrCreatePrecode(); } } } pMT->SetParentMethodTable (bmtParent->pParentMethodTable); #if _DEBUG // bmtInterface now contains old, invalid information.... bmtInterface->pInterfaceMap= (InterfaceInfo_t *) (UINT_PTR) 0xbaddf00d; #endif // _DEBUG // If we have any entries, then finalize them and allocate the object in class loader heap DispatchMap *pDispatchMap = NULL; DispatchMapBuilder *pDispatchMapBuilder = bmtVT->pDispatchMapBuilder; CONSISTENCY_CHECK(CheckPointer(pDispatchMapBuilder)); if (pDispatchMapBuilder->Count() > 0) { // Create a map in stacking memory. BYTE *pbMap; UINT32 cbMap; DispatchMap::CreateEncodedMapping(pMT, pDispatchMapBuilder, pDispatchMapBuilder->GetAllocator(), &pbMap, &cbMap); // Now finalize the impltable and allocate the block in the low frequency loader heap size_t objSize = (size_t) DispatchMap::GetObjectSize(cbMap); void *pv = pamTracker->Track(bmtDomain->GetLowFrequencyHeap()->AllocMem(objSize)); _ASSERTE(pv != NULL); // Use placement new pDispatchMap = new (pv) DispatchMap( pbMap, cbMap); pMT->SetDispatchMap(pDispatchMap); #ifdef LOGGING g_sdStats.m_cDispatchMap++; g_sdStats.m_cbDispatchMap += (UINT32) objSize; LOG((LF_LOADER, LL_INFO1000, "SD: Dispatch map for %s: %d bytes for map, %d bytes total for object.\n", pMT->GetDebugClassName(), cbMap, objSize)); #endif // LOGGING } BOOL fCheckForMissingMethod = !IsAbstract() && !IsInterface(); if (!IsInterface()) { // Propagate inheritance. // NOTE: In the world of unfolded interface this was used to propagate overrides into // the unfolded interface vtables to make sure that overrides of virtual methods // also overrode the interface methods that they contributed to. This had the // unfortunate side-effect of also overwriting regular vtable slots that had been // methodimpl'd and as a result changed the meaning of methodimpl from "substitute // the body of method A with the body of method B" to "unify the slots of methods // A and B". But now compilers have come to rely on this side-effect and it can // not be brought back to its originally intended behaviour. for (i = 0; i < bmtVT->dwCurrentVtableSlot; i++) { // For now only propagate inheritance for method desc that are not interface MD's. // This is not sufficient but InterfaceImpl's will complete the picture. MethodDesc* pMD = pMT->GetUnknownMethodDescForSlot(i); CONSISTENCY_CHECK(CheckPointer(pMD)); CONSISTENCY_CHECK(!pMD->GetClass()->IsInterface()); // Do not use pMD->IsInterface here as that asks the method table and the // MT may not yet be set up. if( pMD->GetSlot() != i) { INDEBUG(MethodDesc *pMDNew; pMDNew = pMT->GetUnknownMethodDescForSlot(pMD->GetSlot());) pMT->SetSlot(i,pMT->GetSlot(pMD->GetSlot())); // Update the pMD to the new method desc we just copied over ourselves with. This will // be used in the check for missing method block below. pMD = pMT->GetUnknownMethodDescForSlot(pMD->GetSlot()); // This method is now duplicate pMD->SetDuplicate(); INDEBUG(g_dupMethods++;) } if (fCheckForMissingMethod) { // Do not use pMD->IsInterface here as that asks the method table and the // MT may not yet be set up. if ( pMD->IsAbstract()) { BuildMethodTableThrowException(IDS_CLASSLOAD_NOTIMPLEMENTED, pMD->GetNameOnNonArrayClass()); } // we check earlier to make certain only abstract methods have RVA != 0 _ASSERTE(!(pMD->GetModule()->IsPEFile() && pMD->IsIL() && pMD->GetRVA() == 0)); } } } // GetMethodData by default will cache its result. However, in the case that we're // building a MethodTable, we aren't guaranteed that this type is going to successfully // load and so caching it would result in errors down the road since the memory and // type occupying the same memory location would very likely be incorrect. The second // argument specifies that GetMethodData should not cache the returned object. MethodTable::MethodDataWrapper hMTData(MethodTable::GetMethodData(pMT, FALSE)); // Since interfaces aren't laid out in the vtable for stub dispatch, what we need to do // is try to find an implementation for every interface contract by iterating through // the interfaces not declared on a parent. if (fCheckForMissingMethod) { BOOL fParentIsAbstract = FALSE; if (bmtParent->pParentMethodTable != NULL) { fParentIsAbstract = bmtParent->pParentMethodTable->IsAbstract(); } // If the parent is abstract, we need to check that each virtual method is implemented if (fParentIsAbstract) { // NOTE: Uses hMTData to avoid caching a MethodData object for the type being built. MethodTable::MethodIterator it(hMTData); for (; it.IsValid() && it.IsVirtual(); it.Next()) { MethodDesc *pMD = it.GetMethodDesc(); if (pMD->IsAbstract()) { MethodDesc *pDeclMD = it.GetDeclMethodDesc(); BuildMethodTableThrowException(IDS_CLASSLOAD_NOTIMPLEMENTED, pDeclMD->GetNameOnNonArrayClass()); } } } MethodTable::InterfaceMapIterator intIt = pMT->IterateInterfaceMap(); while (intIt.Next()) { if (fParentIsAbstract || !intIt.IsImplementedByParent()) { // Since the type is not completely loaded, we must explicitly determine and provide // the interface ID for the iterator. // NOTE: This override does not cache the resulting MethodData object. MethodTable::MethodDataWrapper hData(MethodTable::GetMethodData( DispatchMapTypeID::InterfaceClassID(intIt.GetIndex()), intIt.GetInterface(), pMT)); MethodTable::MethodIterator it(hData); for (; it.IsValid() && it.IsVirtual(); it.Next()) { if (it.GetTarget().IsNull()) { MethodDesc *pMD = it.GetDeclMethodDesc(); BuildMethodTableThrowException(IDS_CLASSLOAD_NOTIMPLEMENTED, pMD->GetNameOnNonArrayClass()); } } } } } #ifdef _DEBUG { for (UINT32 i = 0; i < bmtVT->dwCurrentNonVtableSlot; i++) { _ASSERTE(bmtVT->GetMethodDescForSlot(i) != NULL); } } #endif // _DEBUG // If this class uses any VTS (Version Tolerant Serialization) features // (event callbacks or OptionalField attributes) we've previously cached the // additional information in the bmtMFDescs structure. Now it's time to add // this information as an optional extension to the MethodTable. if (bmtMFDescs->fNeedsRemotingVtsInfo) { DWORD dwNumIntroducedInstanceFields = bmtEnumMF->dwNumInstanceFields; PTR_RemotingVtsInfo pInfo = pMT->AllocateRemotingVtsInfo(bmtDomain, pamTracker, dwNumIntroducedInstanceFields); pInfo->m_pCallbacks[RemotingVtsInfo::VTS_CALLBACK_ON_SERIALIZING] = bmtMFDescs->pOnSerializingMethod; pInfo->m_pCallbacks[RemotingVtsInfo::VTS_CALLBACK_ON_SERIALIZED] = bmtMFDescs->pOnSerializedMethod; pInfo->m_pCallbacks[RemotingVtsInfo::VTS_CALLBACK_ON_DESERIALIZING] = bmtMFDescs->pOnDeserializingMethod; pInfo->m_pCallbacks[RemotingVtsInfo::VTS_CALLBACK_ON_DESERIALIZED] = bmtMFDescs->pOnDeserializedMethod; for (i = 0; i < dwNumIntroducedInstanceFields; i++) { if (bmtMFDescs->prfNotSerializedFields && bmtMFDescs->prfNotSerializedFields[i]) pInfo->SetIsNotSerialized(i); if (bmtMFDescs->prfOptionallySerializedFields && bmtMFDescs->prfOptionallySerializedFields[i]) pInfo->SetIsOptionallySerialized(i); } } if (fNeedsRemotableMethodInfo) pMT->SetupRemotableMethodInfo(bmtDomain, pamTracker); #if defined(_DEBUG) && !defined(STUB_DISPATCH_ALL) if (bmtParent->pParentMethodTable) MarkInheritedVirtualMethods(pMT, bmtParent->pParentMethodTable); #endif // defined(_DEBUG) && !defined(STUB_DISPATCH_ALL) END_SO_INTOLERANT_CODE } //******************************************************************************* bool EEClass::ComputeInternalCorElementTypeForValueType(CorElementType* pInternalTypeOut) { CONTRACTL { THROWS; GC_TRIGGERS; PRECONDITION(CheckPointer(pInternalTypeOut, NULL_OK)); } CONTRACTL_END; if (GetNumInstanceFields() == 1 && (!HasLayout() || GetNumInstanceFieldBytes() == sizeof(void*)) // Don't do the optimization // if we're getting specified // anything but the trivial // layout ) { CorElementType type = m_pFieldDescList->GetFieldType(); if (type == ELEMENT_TYPE_VALUETYPE) { TypeHandle fldHnd = m_pFieldDescList->GetApproxFieldTypeHandleThrowing(); CONSISTENCY_CHECK(!fldHnd.IsNull()); type = fldHnd.GetInternalCorElementType(); } switch (type) { case ELEMENT_TYPE_I: case ELEMENT_TYPE_U: case ELEMENT_TYPE_I4: case ELEMENT_TYPE_U4: case ELEMENT_TYPE_PTR: { if (pInternalTypeOut) { *pInternalTypeOut = type; } return true; } default: break; } } return false; } INT32 __stdcall IsDefined(Module *pModule, mdToken token, TypeHandle attributeClass) { CONTRACTL { THROWS; GC_TRIGGERS; } CONTRACTL_END; BOOL isDefined = FALSE; IMDInternalImport *pInternalImport = pModule->GetMDImport(); BOOL isSealed = FALSE; HRESULT hr; HENUMInternalHolderNoRef hEnum(pInternalImport); TypeHandle caTH; // Get the enum first but don't get any values hr = pInternalImport->EnumInit(mdtCustomAttribute, token, &hEnum); if (SUCCEEDED(hr)) { ULONG cMax = pInternalImport->EnumGetCount(&hEnum); if (cMax) { // we have something to look at if (!attributeClass.IsNull()) isSealed = attributeClass.GetClass()->IsSealed(); // Loop through the Attributes and look for the requested one mdCustomAttribute cv; while (pInternalImport->EnumNext(&hEnum, &cv)) { // // fetch the ctor mdToken tkCtor; pInternalImport->GetCustomAttributeProps(cv, &tkCtor); mdToken tkType = TypeFromToken(tkCtor); if(tkType != mdtMemberRef && tkType != mdtMethodDef) continue; // we only deal with the ctor case // // get the info to load the type, so we can check whether the current // attribute is a subtype of the requested attribute hr = pInternalImport->GetParentToken(tkCtor, &tkType); if (FAILED(hr)) { _ASSERTE(!"GetParentToken Failed, bogus metadata"); COMPlusThrow(kInvalidProgramException); } _ASSERTE(TypeFromToken(tkType) == mdtTypeRef || TypeFromToken(tkType) == mdtTypeDef); // load the type if (isSealed) { caTH=ClassLoader::LoadTypeDefOrRefThrowing(pModule, tkType, ClassLoader::ReturnNullIfNotFound, ClassLoader::FailIfUninstDefOrRef, TypeFromToken(tkType) == mdtTypeDef ? tdAllTypes : tdNoTypes); } else { caTH = ClassLoader::LoadTypeDefOrRefThrowing(pModule, tkType, ClassLoader::ReturnNullIfNotFound, ClassLoader::FailIfUninstDefOrRef); } if (caTH.IsNull()) continue; // a null class implies all custom attribute if (!attributeClass.IsNull()) { if (isSealed) { if (attributeClass != caTH) continue; } else { if (!caTH.CanCastTo(attributeClass)) continue; } } // // if we are here we got one isDefined = TRUE; break; } } } else { _ASSERTE(!"EnumInit Failed"); COMPlusThrow(kInvalidProgramException); } return isDefined; } //******************************************************************************* VOID MethodTableBuilder::CheckForRemotingProxyAttrib() { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END GCX_COOP(); // See if our parent class has a proxy attribute _ASSERTE(g_pObjectClass != NULL); if (!bmtParent->pParentMethodTable->GetClass()->HasRemotingProxyAttribute()) { // Call the metadata api to look for a proxy attribute on this type // Note: the api does not check for inherited attributes // Set the flag is the type has a non-default proxy attribute if(IsDefined( bmtInternal->pModule, bmtInternal->cl, TypeHandle(CRemotingServices::GetProxyAttributeClass()))) { SetHasRemotingProxyAttribute(); } } else { // parent has proxyAttribute ... mark this class as having one too! SetHasRemotingProxyAttribute(); } } //******************************************************************************* // // Used by BuildMethodTable // // Set the contextful or marshaledbyref flag on the attributes of the class // VOID MethodTableBuilder::SetContextfulOrByRef() { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(this)); PRECONDITION(CheckPointer(bmtInternal)); } CONTRACTL_END; // Check whether these classes are the root classes of contextful // and marshalbyref classes i.e. System.ContextBoundObject and // System.MarshalByRefObject respectively. // Extract the class name LPCUTF8 pszClassName = NULL; LPCUTF8 pszNameSpace = NULL; bmtInternal->pModule->GetMDImport()->GetNameOfTypeDef(GetCl(), &pszClassName, &pszNameSpace); StackSString ssFullyQualifiedName; ns::MakePath(ssFullyQualifiedName, StackSString(SString::Utf8, pszNameSpace), StackSString(SString::Utf8, pszClassName)); // Compare if(ssFullyQualifiedName.Equals(SL(g_ContextBoundObjectClassName))) { // Set the contextful and marshalbyref flag SetContextfull(); bmtProp->fMarshaledByRef = true; } else if(ssFullyQualifiedName.Equals(SL(g_MarshalByRefObjectClassName))) { // Set the marshalbyref flag bmtProp->fMarshaledByRef = true; } else { // First check whether the parent class is contextful or // marshalbyref EEClass* pParent = (bmtParent->pParentMethodTable) ? bmtParent->pParentMethodTable->GetClass() : NULL; if(pParent) { if(pParent->IsContextful()) { // Set the contextful and marshalbyref flag SetContextfull(); bmtProp->fMarshaledByRef = true; // While these could work with a bit of work in the JIT, // we will not support generic context-bound objects in V2.0. if (bmtGenerics->GetNumGenericArgs() > 0) BuildMethodTableThrowException(IDS_CLASSLOAD_GENERIC_CONTEXT_BOUND_OBJECT); } else if (pParent->IsMarshaledByRef()) // Set the marshalbyref flag bmtProp->fMarshaledByRef = true; } } } #if CHECK_APP_DOMAIN_LEAKS //******************************************************************************* void EEClass::GetPredefinedAgility(Module *pModule, mdTypeDef td, BOOL *pfIsAgile, BOOL *pfCheckAgile) { CONTRACTL { NOTHROW; GC_NOTRIGGER; FORBID_FAULT; } CONTRACTL_END // // There are 4 settings possible: // IsAgile CheckAgile // F F (default) Use normal type logic to determine agility // T F "Proxy" Treated as agile even though may not be. // F T "Maybe" Not agile, but specific instances can be made agile. // T T "Force" All instances are forced agile, even though not typesafe. // // Also, note that object arrays of agile or maybe agile types are made maybe agile. // static const struct PredefinedAgility { const char *name; BOOL isAgile; BOOL checkAgile; } agility[] = { // The Thread and its LocalDataStore leak across context boundaries. // We manage the leaks manually { g_ThreadClassName, TRUE, FALSE }, { g_LocalDataStoreClassName, TRUE, FALSE }, { g_LocalDataStoreMgrClassName, FALSE, TRUE }, // The SharedStatics class is a container for process-wide data { g_SharedStaticsClassName, FALSE, TRUE }, { "System.ActivationArguments", FALSE, TRUE }, // Make all containers maybe agile { "System.Collections.*", FALSE, TRUE }, { "System.Collections.Generic.*", FALSE, TRUE }, // Make all globalization objects agile // We have CultureInfo objects on thread. Because threads leak across // app domains, we have to be prepared for CultureInfo to leak across. // CultureInfo exposes all of the other globalization objects, so we // just make the entire namespace app domain agile. { "System.Globalization.*", FALSE, TRUE }, // Remoting structures for legally smuggling messages across app domains { "System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage", FALSE, TRUE }, { "System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage", FALSE, TRUE }, { "System.Runtime.Remoting.Messaging.SmuggledObjRef", FALSE, TRUE}, { "System.Runtime.Remoting.ObjRef", FALSE, TRUE }, { "System.Runtime.Remoting.ChannelInfo", FALSE, TRUE }, { "System.Runtime.Remoting.Channels.CrossAppDomainData", FALSE, TRUE }, // Remoting cached data structures are all in mscorlib { "System.Runtime.Remoting.Metadata.RemotingCachedData", FALSE, TRUE }, { "System.Runtime.Remoting.Metadata.RemotingMethodCachedData", FALSE, TRUE }, { "System.Runtime.Remoting.Metadata.RemotingTypeCachedData", FALSE, TRUE }, { g_ReflectionMemberInfoName, FALSE, TRUE }, { g_TypeClassName, FALSE, TRUE }, { g_ReflectionClassName, FALSE, TRUE }, { g_ReflectionConstructorInfoName, FALSE, TRUE }, { g_ReflectionConstructorName, FALSE, TRUE }, { "System.Reflection.EventInfo", FALSE, TRUE }, { g_ReflectionEventInfoName, FALSE, TRUE }, { g_ReflectionFieldInfoName, FALSE, TRUE }, { g_ReflectionFieldName, FALSE, TRUE }, { g_MethodBaseName, FALSE, TRUE }, { g_ReflectionMethodName, FALSE, TRUE }, { g_ReflectionPropertyInfoName, FALSE, TRUE }, { g_ReflectionPropInfoName, FALSE, TRUE }, { g_ReflectionParamInfoName, FALSE, TRUE }, { "System.Runtime.Remoting.Metadata.SoapAttribute", FALSE, TRUE }, { "System.Runtime.Remoting.Metadata.SoapFieldAttribute", FALSE, TRUE }, { "System.Runtime.Remoting.Metadata.SoapMethodAttribute",FALSE, TRUE }, { "System.Runtime.Remoting.Metadata.SoapParameterAttribute", FALSE, TRUE }, { "System.Runtime.Remoting.Metadata.SoapTypeAttribute", FALSE, TRUE }, { "System.Reflection.Cache.InternalCache", FALSE, TRUE }, { "System.Reflection.Cache.InternalCacheItem", FALSE, TRUE }, { "System.RuntimeType+RuntimeTypeCache", FALSE, TRUE }, { "System.RuntimeType+RuntimeTypeCache+MemberInfoCache`1+Filter", FALSE, TRUE }, { "System.Reflection.CerArrayList`1", FALSE, TRUE }, { "System.Reflection.CerHashtable`2", FALSE, TRUE }, { "System.RuntimeType+RuntimeTypeCache+MemberInfoCache", FALSE, TRUE }, { "System.Reflection.RtFieldInfo", FALSE, TRUE }, { "System.Reflection.MdFieldInfo", FALSE, TRUE }, { "System.Signature", FALSE, TRUE }, { "System.Reflection.MetadataImport", FALSE, TRUE }, { "System.SignatureStruct", FALSE, TRUE }, // LogSwitches are agile even though we can't prove it { "System.Diagnostics.LogSwitch", FALSE, TRUE }, // There is a process global PermissionTokenFactory { "System.Security.PermissionToken", FALSE, TRUE }, { g_PermissionTokenFactoryName, FALSE, TRUE }, // Mark all the exceptions we throw agile. This makes // most BVTs pass even though exceptions leak // // Note that making exception checked automatically // makes a bunch of subclasses checked as well. // // Pre-allocated exceptions { g_ExceptionClassName, FALSE, TRUE }, { g_OutOfMemoryExceptionClassName, FALSE, TRUE }, { g_StackOverflowExceptionClassName, FALSE, TRUE }, { g_ExecutionEngineExceptionClassName, FALSE, TRUE }, // SecurityDocument contains pointers and other agile types { "System.Security.SecurityDocument", TRUE, TRUE }, // BinaryFormatter smuggles these across appdomains. { "System.Runtime.Serialization.Formatters.Binary.BinaryObjectWithMap", TRUE, FALSE}, { "System.Runtime.Serialization.Formatters.Binary.BinaryObjectWithMapTyped", TRUE, FALSE}, { NULL } }; if (pModule == SystemDomain::SystemModule()) { while (TRUE) { LPCUTF8 pszName; LPCUTF8 pszNamespace; HRESULT hr; mdTypeDef tdEnclosing; pModule->GetMDImport()->GetNameOfTypeDef(td, &pszName, &pszNamespace); const PredefinedAgility *p = agility; while (p->name != NULL) { SIZE_T length = strlen(pszNamespace); if (strncmp(pszNamespace, p->name, length) == 0 && (strcmp(pszName, p->name + length + 1) == 0 || strcmp("*", p->name + length + 1) == 0)) { *pfIsAgile = p->isAgile; *pfCheckAgile = p->checkAgile; return; } p++; } // Perhaps we have a nested type like 'bucket' that is supposed to be // agile or checked agile by virtue of being enclosed in a type like // hashtable, which is itself inside "System.Collections". tdEnclosing = mdTypeDefNil; hr = pModule->GetMDImport()->GetNestedClassProps(td, &tdEnclosing); if (SUCCEEDED(hr)) { BAD_FORMAT_NOTHROW_ASSERT(tdEnclosing != td && TypeFromToken(tdEnclosing) == mdtTypeDef); td = tdEnclosing; } else break; } } *pfIsAgile = FALSE; *pfCheckAgile = FALSE; } //******************************************************************************* void EEClass::SetAppDomainAgileAttribute() { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM()); // PRECONDITION(!IsAppDomainAgilityDone()); } CONTRACTL_END // // The most general case for provably a agile class is // (1) No instance fields of non-sealed or non-agile types // (2) Class is in system domain (its type must be not unloadable // & loaded in all app domains) // (3) The class can't have a finalizer // (4) The class can't be a COMClass // _ASSERTE(!IsAppDomainAgilityDone()); BOOL fCheckAgile = FALSE; BOOL fAgile = FALSE; BOOL fFieldsAgile = TRUE; WORD nFields = 0; if (!GetModule()->IsSystem()) { // // No types outside of the system domain can even think about // being agile // goto exit; } if (m_pMethodTable->IsComObjectType()) { // // No COM type is agile, as there is domain specific stuff in the sync block // goto exit; } if (m_pMethodTable->IsInterface()) { // // Don't mark interfaces agile // goto exit; } if (TypeHandle(m_pMethodTable).ContainsGenericVariables()) { // Types containing formal type parameters aren't agile goto exit; } // // See if we need agile checking in the class // GetPredefinedAgility(GetModule(), GetCl(), &fAgile, &fCheckAgile); if (m_pMethodTable->HasFinalizer()) { if (!fAgile && !fCheckAgile) { // // If we're finalizable, we need domain affinity. Otherwise, we may appear // to a particular app domain not to call the finalizer (since it may run // in a different domain.) // // Note: do not change this assumption. The eager finalizaton code for // appdomain unloading assumes that no obects other than those in mscorlib // can be agile and finalizable // goto exit; } else { // Note that a finalizable object will be considered potentially agile if it has one of the two // predefined agility bits set. This will cause an assert in the eager finalization code if you add // a finalizer to such a class - we don't want to have them as we can't run them eagerly and running // them after we've cleared the roots/handles means it can't do much safely. Right now thread is the // only one we allow. _ASSERTE(g_pThreadClass == NULL || m_pMethodTable->IsAgileAndFinalizable()); } } // // Now see if the type is "naturally agile" - that is, it's type structure // guarantees agility. // if (GetParentClass() != NULL) { // // Make sure our parent was computed. This should only happen // when we are prejitting - otherwise it is computed for each // class as its loaded. // _ASSERTE(GetParentClass()->IsAppDomainAgilityDone()); if (!GetParentClass()->IsAppDomainAgile()) { fFieldsAgile = FALSE; if (fCheckAgile) _ASSERTE(GetParentClass()->IsCheckAppDomainAgile()); } // // To save having to list a lot of trivial (layout-wise) subclasses, // automatically check a subclass if its parent is checked and // it introduces no new fields. // if (!fCheckAgile && GetParentClass()->IsCheckAppDomainAgile() && GetNumInstanceFields() == GetParentClass()->GetNumInstanceFields()) fCheckAgile = TRUE; } nFields = GetNumInstanceFields() - (GetParentClass() == NULL ? 0 : GetParentClass()->GetNumInstanceFields()); if (fFieldsAgile || fCheckAgile) { FieldDesc *pFD = m_pFieldDescList; FieldDesc *pFDEnd = pFD + nFields; while (pFD < pFDEnd) { switch (pFD->GetFieldType()) { case ELEMENT_TYPE_CLASS: { // // There is a bit of a problem in computing the classes which are naturally agile - // we don't want to load types of non-value type fields. So for now we'll // err on the side of conservatism and not allow any non-value type fields other than // the forced agile types listed above. // MetaSig sig(pFD); CorElementType type = sig.NextArg(); SigPointer sigPtr = sig.GetArgProps(); // // Don't worry about strings // if (type == ELEMENT_TYPE_STRING) break; // Find our field's token so we can proceed cautiously mdToken token = mdTokenNil; if (type == ELEMENT_TYPE_CLASS) IfFailThrow(sigPtr.GetToken(&token)); // // First, a special check to see if the field is of our own type. // if (token == GetCl() && IsSealed()) break; // // Now, look for the field's TypeHandle. // TypeHandle th; th = pFD->LookupFieldTypeHandle(); // // See if the referenced type is agile. Note that there is a reasonable // chance that the type hasn't been loaded yet. If this is the case, // we just have to assume that it's not agile, since we can't trigger // extra loads here (for fear of circular recursion.) // // If you have an agile class which runs into this problem, you can solve it by // setting the type manually to be agile. // if (th.IsNull() || !th.IsAppDomainAgile() || (th.IsUnsharedMT() && !th.GetClass()->IsSealed())) { // // Treat the field as non-agile. // fFieldsAgile = FALSE; if (fCheckAgile) pFD->SetDangerousAppDomainAgileField(); } } break; case ELEMENT_TYPE_VALUETYPE: { TypeHandle th; th = pFD->GetApproxFieldTypeHandleThrowing(); _ASSERTE(!th.IsNull()); if (!th.IsAppDomainAgile()) { fFieldsAgile = FALSE; if (fCheckAgile) pFD->SetDangerousAppDomainAgileField(); } } break; default: break; } pFD++; } } if (fFieldsAgile || fAgile) SetAppDomainAgile(); if (fCheckAgile && !fFieldsAgile) SetCheckAppDomainAgile(); exit: LOG((LF_CLASSLOADER, LL_INFO1000, "CLASSLOADER: AppDomainAgileAttribute for %s is %d\n", GetDebugClassName(), IsAppDomainAgile())); SetAppDomainAgilityDone(); } #endif // CHECK_APP_DOMAIN_LEAKS #ifdef DEBUGGING_SUPPORTED //******************************************************************************* // // Debugger notification // BOOL TypeHandle::NotifyDebuggerLoad(AppDomain *pDomain, BOOL attaching) const { WRAPPER_CONTRACT; if (IsIntrospectionOnly()) { return FALSE; } if (!CORDebuggerAttached()) { return FALSE; } return g_pDebugInterface->LoadClass( *this, GetCl(), GetModule(), pDomain, GetAssembly()->IsSystem(), attaching); } //******************************************************************************* void TypeHandle::NotifyDebuggerUnload(AppDomain *pDomain) const { WRAPPER_CONTRACT; if (IsIntrospectionOnly()) return; if (!pDomain->IsDebuggerAttached()) return; g_pDebugInterface->UnloadClass(GetCl(), GetModule(), pDomain, FALSE); } #endif // DEBUGGING_SUPPORTED //******************************************************************************* // // Used by BuildMethodTable // // Perform relevant GC calculations for value classes // VOID MethodTableBuilder::HandleGCForValueClasses(EEClass** pByValueClassCache) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END DWORD i, j; EEClass *pClass = GetHalfBakedClass(); MethodTable *pMT = GetHalfBakedMethodTable(); FieldDesc *pFieldDescList = pClass->GetApproxFieldDescListRaw(); // Note that for value classes, the following calculation is only appropriate // when the instance is in its "boxed" state. if (pClass->m_wNumGCPointerSeries > 0) { CGCDescSeries *pSeries; CGCDescSeries *pHighest; pMT->SetContainsPointers(); // Copy the pointer series map from the parent CGCDesc::Init( (PVOID) pMT, pClass->GetNumGCPointerSeries() ); if (GetParentClass() && (GetParentClass()->m_wNumGCPointerSeries > 0)) { size_t ParentGCSize = CGCDesc::ComputeSize(GetParentClass()->m_wNumGCPointerSeries); memcpy( (PVOID) (((BYTE*) pMT) - ParentGCSize), (PVOID) (((BYTE*) GetParentClass()->m_pMethodTable) - ParentGCSize), ParentGCSize - sizeof(size_t) // sizeof(size_t) is the NumSeries count ); } // Build the pointer series map for this pointers in this instance pSeries = ((CGCDesc*)pMT)->GetLowestSeries(); if (bmtFP->NumInstanceGCPointerFields) { // See gcdesc.h for an explanation of why we adjust by subtracting BaseSize pSeries->SetSeriesSize( (size_t) (bmtFP->NumInstanceGCPointerFields * sizeof(OBJECTREF)) - (size_t) pMT->GetBaseSize()); pSeries->SetSeriesOffset(bmtFP->GCPointerFieldStart+sizeof(Object)); pSeries++; } // Insert GC info for fields which are by-value classes for (i = 0; i < bmtEnumMF->dwNumInstanceFields; i++) { if (pFieldDescList[i].IsByValue()) { EEClass *pByValueClass = pByValueClassCache[i]; MethodTable *pByValueMT = pByValueClass->GetMethodTable(); CGCDescSeries *pByValueSeries; // The by value class may have more than one pointer series DWORD dwNumByValueSeries = pByValueClass->m_wNumGCPointerSeries; if (dwNumByValueSeries > 0) { // Offset of the by value class in the class we are building, does NOT include Object DWORD dwCurrentOffset = pFieldDescList[i].GetOffset_NoLogging(); pByValueSeries = ((CGCDesc*) pByValueMT)->GetLowestSeries(); for (j = 0; j < dwNumByValueSeries; j++) { size_t cbSeriesSize; size_t cbSeriesOffset; _ASSERTE(pSeries <= CGCDesc::GetCGCDescFromMT(pMT)->GetHighestSeries()); cbSeriesSize = pByValueSeries->GetSeriesSize(); // Add back the base size of the by value class, since it's being transplanted to this class cbSeriesSize += pByValueMT->GetBaseSize(); // Subtract the base size of the class we're building cbSeriesSize -= pMT->GetBaseSize(); // Set current series we're building pSeries->SetSeriesSize(cbSeriesSize); // Get offset into the value class of the first pointer field (includes a +Object) cbSeriesOffset = pByValueSeries->GetSeriesOffset(); // Add it to the offset of the by value class in our class cbSeriesOffset += dwCurrentOffset; pSeries->SetSeriesOffset(cbSeriesOffset); // Offset of field pSeries++; pByValueSeries++; } } } } // Adjust the inherited series - since the base size has increased by "# new field instance bytes", we need to // subtract that from all the series (since the series always has BaseSize subtracted for it - see gcdesc.h) pHighest = CGCDesc::GetCGCDescFromMT(pMT)->GetHighestSeries(); while (pSeries <= pHighest) { CONSISTENCY_CHECK(CheckPointer(GetParentClass())); pSeries->SetSeriesSize( pSeries->GetSeriesSize() - ((size_t) pMT->GetBaseSize() - (size_t) GetParentClass()->GetMethodTable()->GetBaseSize()) ); pSeries++; } _ASSERTE(pSeries-1 <= CGCDesc::GetCGCDescFromMT(pMT)->GetHighestSeries()); } } //******************************************************************************* // // Helper method for VerifyInheritanceSecurity // VOID MethodTableBuilder::VerifyClassInheritanceSecurityHelper( EEClass *pParentCls, EEClass *pChildCls) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(pParentCls)); PRECONDITION(CheckPointer(pChildCls)); } CONTRACTL_END; //@ASSUMPTION: The current class has been resolved to the point that // we can construct a reflection object on the class or its methods. // This is required for the security checks. // Check the entire parent chain for inheritance permission demands. while (pParentCls != NULL) { if (pParentCls->RequiresInheritanceCheck()) { // This method throws on failure. Security::ClassInheritanceCheck(pChildCls, pParentCls); } pParentCls = pParentCls->GetParentClass(); } } //******************************************************************************* // // Helper method for VerifyInheritanceSecurity // VOID MethodTableBuilder::VerifyMethodInheritanceSecurityHelper( MethodDesc *pParentMD, MethodDesc *pChildMD) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(CheckPointer(pParentMD)); PRECONDITION(CheckPointer(pChildMD)); } CONTRACTL_END; // If no inheritance checks are required, just return. if (!pParentMD->RequiresInheritanceCheck() && !pParentMD->ParentRequiresInheritanceCheck()) { return; } DWORD dwSlot = pParentMD->GetSlot(); #ifdef _DEBUG // Get the name and signature for the method so we can find the new parent method desc. // We use the parent MethodDesc for this because the child could actually have a very // different name in the case that the child is MethodImpling the parent. // Get the name. LPCUTF8 szName; szName = pParentMD->GetName(); // Get the signature. PCCOR_SIGNATURE pSignature; DWORD cSignature; pParentMD->GetSig(&pSignature, &cSignature); Module *pModule = pParentMD->GetModule(); #endif do { if (pParentMD->RequiresInheritanceCheck()) { Security::MethodInheritanceCheck(pChildMD, pParentMD); } if (pParentMD->ParentRequiresInheritanceCheck()) { MethodTable *pGrandParentMT = pParentMD->GetMethodTable()->GetParentMethodTable(); CONSISTENCY_CHECK(CheckPointer(pGrandParentMT)); // Find this method in the parent. // If it does exist in the parent, it would be at the same vtable slot. if (dwSlot >= pGrandParentMT->GetNumVirtuals()) { // Parent does not have this many vtable slots, so it doesn't exist there pParentMD = NULL; } else { // It is in the vtable of the parent pParentMD = pGrandParentMT->GetUnknownMethodDescForSlot(dwSlot); _ASSERTE(pParentMD != NULL); #ifdef _DEBUG _ASSERTE(pParentMD == pGrandParentMT->GetClass()->FindMethod( szName, pSignature, cSignature, pModule)); #endif } } else { pParentMD = NULL; } } while (pParentMD != NULL); } //******************************************************************************* // // Used by BuildMethodTable // // If we have a non-interface class, then do inheritance security // checks on it. The check starts by checking for inheritance // permission demands on the current class. If these first checks // succeeded, then the cached declared method list is scanned for // methods that have inheritance permission demands. // void MethodTableBuilder::VerifyInheritanceSecurity() { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END; // If we have a non-interface class, then do inheritance security // checks on it. The check starts by checking for inheritance // permission demands on the current class. If these first checks // succeeded, then the cached declared method list is scanned for // methods that have inheritance permission demands. if (!IsInterface() && (bmtInternal->pModule->IsSystem() == FALSE) && Security::IsSecurityOn()) { //We need to disable preemptive GC if there's any chance that it could still be //active. The inheritance checks might allocate objects. GCX_COOP(); if (GetParentClass() != NULL) { // Check the parent for inheritance permission demands. VerifyClassInheritanceSecurityHelper(GetParentClass(), GetHalfBakedClass()); // Iterate all the declared methods and check each of them for inheritance demands DeclaredMethodIterator mIt(*this); while (mIt.Next()) { _ASSERTE(mIt.GetMethodDesc() != NULL); if (mIt.GetParentMethodDesc() != NULL) { VerifyMethodInheritanceSecurityHelper(mIt.GetParentMethodDesc(), mIt.GetMethodDesc()); } // If this method is a MethodImpl, we need to verify that all // decls are allowed to be overridden. if (mIt.GetMethodDesc()->IsMethodImpl()) { // Iterate through each decl that this method is an impl for and // test that inheritance demands are met. MethodImpl *pMethodImpl = mIt.GetMethodDesc()->GetMethodImpl(); for (DWORD iCurImpl = 0; iCurImpl < pMethodImpl->GetSize(); iCurImpl++) { MethodDesc *pDeclMD = pMethodImpl->GetImplementedMDs()[iCurImpl]; _ASSERTE(pDeclMD != NULL); // We deal with interfaces below, so don't duplicate work if (!pDeclMD->IsInterface()) { VerifyMethodInheritanceSecurityHelper(pDeclMD, mIt.GetMethodDesc()); } } } } } // Now we need to verify that we are meeting all inheritance demands // that were placed on interfaces and their methods. The logic is as // follows: for each method contributing an implementation to this type, // if a method it could contribute to any interface described in the // interface map, check that both method-level and type-level inheritance // demands are met (only need to check type-level once per interface). { // Iterate through each interface MethodTable *pMT = GetHalfBakedClass()->GetMethodTable(); MethodTable::InterfaceMapIterator itfIt = pMT->IterateInterfaceMap(); while (itfIt.Next()) { // Get current interface details EEClass *pCurItfCls = itfIt.GetInterface()->GetClass(); CONSISTENCY_CHECK(CheckPointer(pCurItfCls)); if (pCurItfCls->RequiresInheritanceCheck() || pCurItfCls->SomeMethodsRequireInheritanceCheck()) { // Keep track of whether or not type-level inheritance demands // have been evaluated for each interface. BOOL fMustEvaluateTypeLevelInheritanceDemand = itfIt.IsDeclaredOnClass(); // Now iterate through every method contributing any implementation // and if it lies within the interface vtable, then we must evaluate demands // NOTE: Avoid caching the MethodData object for the type being built. MethodTable::MethodDataWrapper hItfImplData(MethodTable::GetMethodData(itfIt.GetInterface(), pMT, FALSE)); MethodTable::MethodIterator methIt(hItfImplData); for (;methIt.IsValid(); methIt.Next()) { MethodDesc *pMDImpl = methIt.GetMethodDesc(); if (pMDImpl->GetMethodTable() == pMT) { // Check security on the interface for this method in its default slot placement VerifyMethodInheritanceSecurityHelper(methIt.GetDeclMethodDesc(), pMDImpl); fMustEvaluateTypeLevelInheritanceDemand = TRUE; } } // If any previous methods contributed to this interface's implementation, that means we // need to check the type-level inheritance for the interface. if (fMustEvaluateTypeLevelInheritanceDemand) { VerifyClassInheritanceSecurityHelper(pCurItfCls, pMT->GetClass()); } } } } } } //******************************************************************************* // // Used by BuildMethodTable // // Before we make the final leap, make sure we've allocated all memory needed to // fill out the RID maps. // VOID MethodTableBuilder::EnsureRIDMapsCanBeFilled() { CONTRACTL { THROWS; GC_TRIGGERS; MODE_ANY; INJECT_FAULT(COMPlusThrowOM()); } CONTRACTL_END DWORD i; // Rather than call Ensure***CanBeStored() hundreds of times, we // will call it once on the largest token we find. This relies // on an invariant that RidMaps don't use some kind of sparse // allocation. { mdMethodDef largest = mdMethodDefNil; DeclaredMethodIterator it(*this); while (it.Next()) { if (it.Token() > largest) { largest = it.Token(); } } if ( largest != mdMethodDefNil ) { bmtInternal->pModule->EnsureMethodDefCanBeStored(largest); } } { mdFieldDef largest = mdFieldDefNil; for (i = 0; i < bmtMetaData->cFields; i++) { if (bmtMetaData->pFields[i] > largest) { largest = bmtMetaData->pFields[i]; } } if ( largest != mdFieldDefNil ) { bmtInternal->pModule->EnsureFieldDefCanBeStored(largest); } } } //******************************************************************************* // Given the (generics-shared or generics-exact) value class method, find the // (generics-shared) unboxing Stub for the given method . We search the vtable. // // This is needed when creating a delegate to an instance method in a value type MethodDesc* EEClass::GetBoxedEntryPointMD(MethodDesc *pMD) { CONTRACT (MethodDesc *) { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(IsValueClass()); PRECONDITION(!pMD->ContainsGenericVariables()); PRECONDITION(!pMD->IsUnboxingStub()); POSTCONDITION(RETVAL->IsUnboxingStub()); } CONTRACT_END; RETURN MethodDesc::FindOrCreateAssociatedMethodDesc(pMD, pMD->GetMethodTable(), TRUE /* get unboxing entry point */, pMD->GetNumGenericMethodArgs(), pMD->GetMethodInstantiation(), FALSE /* no allowInstParam */ ); } //******************************************************************************* // Given the unboxing value class method, find the non-unboxing method // This is used when generating the code for an BoxedEntryPointStub. MethodDesc* MethodTable::GetUnboxedEntryPointMD(MethodDesc *pMD) { CONTRACT (MethodDesc *) { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(IsValueClass()); // reflection needs to call this for methods in non instantiated classes, // so move the assert to the caller when needed //PRECONDITION(!pMD->ContainsGenericVariables()); PRECONDITION(pMD->IsUnboxingStub()); POSTCONDITION(!RETVAL->IsUnboxingStub()); } CONTRACT_END; BOOL allowInstParam = (pMD->GetNumGenericMethodArgs() == 0); RETURN MethodDesc::FindOrCreateAssociatedMethodDesc(pMD, this, FALSE /* don't get unboxing entry point */, pMD->GetNumGenericMethodArgs(), pMD->GetMethodInstantiation(), allowInstParam); } //******************************************************************************* // Given the unboxing value class method, find the non-unboxing method // This is used when generating the code for an BoxedEntryPointStub. MethodDesc* MethodTable::GetExistingUnboxedEntryPointMD(MethodDesc *pMD) { CONTRACT (MethodDesc *) { THROWS; GC_NOTRIGGER; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(IsValueClass()); // reflection needs to call this for methods in non instantiated classes, // so move the assert to the caller when needed //PRECONDITION(!pMD->ContainsGenericVariables()); PRECONDITION(pMD->IsUnboxingStub()); POSTCONDITION(!RETVAL->IsUnboxingStub()); } CONTRACT_END; BOOL allowInstParam = (pMD->GetNumGenericMethodArgs() == 0); RETURN MethodDesc::FindOrCreateAssociatedMethodDesc(pMD, this, FALSE /* don't get unboxing entry point */, pMD->GetNumGenericMethodArgs(), pMD->GetMethodInstantiation(), allowInstParam, FALSE, /* forceRemotableMethod */ FALSE /* allowCreate */ ); } #endif // !DACCESS_COMPILE //******************************************************************************* BOOL EEClass::FM_ShouldSkipMethod(DWORD dwAttrs, FM_Flags flags) { LEAF_CONTRACT; // If we have any special selection flags, then we need to check a little deeper. if (flags & FM_SpecialVirtualMask) { if (((flags & FM_ExcludeVirtual) && IsMdVirtual(dwAttrs)) || ((flags & FM_ExcludeNonVirtual) && !IsMdVirtual(dwAttrs))) { return TRUE; } } // This makes for quick shifting in determining if an access mask bit matches C_ASSERT((FM_ExcludePrivateScope >> 0x3) == 0x1); if (flags & FM_SpecialAccessMask) { DWORD dwAccess = dwAttrs & mdMemberAccessMask; if ((1 << dwAccess) & ((DWORD)(flags & FM_SpecialAccessMask) >> 0x3)) { return TRUE; } } // No exclusion for this method return FALSE; } //******************************************************************************* // Finds a method by name and signature, where scope is the scope in which the // signature is defined. MethodDesc *EEClass::FindMethod(LPCUTF8 pszName, PCCOR_SIGNATURE pSignature, DWORD cSignature, Module* pModule, const Substitution *pSigSubst, // = NULL FM_Flags flags, // = FM_Default const Substitution *pDefSubst) // = NULL { CONTRACT (MethodDesc *) { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(!IsThunking()); MODE_ANY; } CONTRACT_END; #ifndef DACCESS_COMPILE // Retrive the right comparition function to use. UTF8StringCompareFuncPtr StrCompFunc = FM_GetStrCompFunc(flags); // Statistically it's most likely for a method to be found in non-vtable portion of this class's members, then in the // vtable of this class's declared members, then in the inherited portion of the vtable, so we search backwards. // For value classes, if it's a value class method, we want to return the duplicated MethodDesc, not the one in the vtable // section. We'll find the one in the duplicate section before the one in the vtable section, so we're ok. // Search non-vtable portion of this class first g_IBCLogger.LogEEClassAndMethodTableAccess(this); MethodTable::MethodIterator it(GetMethodTable()); // Move the iterator to the appropriate starting point it.MoveToEnd(); // Iterate through the methods of the current type searching for a match. for (; it.IsValid(); it.Prev()) { MethodDesc *pCurDeclMD = it.GetDeclMethodDesc(); MethodTable *pCurDeclMT = pCurDeclMD->GetMethodTable(); CONSISTENCY_CHECK(!IsInterface() || pCurDeclMT == GetMethodTable()); { if (FM_ShouldSkipMethod(pCurDeclMD->GetAttrs(), flags)) { continue; } BOOL fIgnoreMethodDueToInstantiationCheck = pCurDeclMT->HasInstantiation() && pCurDeclMT != GetMethodTable(); if ( !fIgnoreMethodDueToInstantiationCheck // This is done last since it is the most expensive of the IF statement. && StrCompFunc(pszName, pCurDeclMD->GetName()) == 0 ) { PCCOR_SIGNATURE pCurMethodSig; DWORD cCurMethodSig; pCurDeclMD->GetSig(&pCurMethodSig, &cCurMethodSig); if (MetaSig::CompareMethodSigs(pSignature, cSignature, pModule, pSigSubst,pCurMethodSig, cCurMethodSig, pCurDeclMD->GetModule(), pDefSubst)) { RETURN pCurDeclMD; } } } } // No inheritance on value types or interfaces if (IsValueClass() || IsInterface()) { RETURN NULL; } // Recurse up the hierarchy if the method was not found. CONSISTENCY_CHECK(GetMethodTable()->CheckLoadLevel(CLASS_LOAD_APPROXPARENTS)); MethodTable *pParentMT = GetMethodTable()->GetParentMethodTable(); if (pParentMT != NULL) { Substitution subst2 = GetSubstitutionForParent(pDefSubst); MethodDesc *md = pParentMT->GetClass()->FindMethod( pszName, pSignature, cSignature, pModule, pSigSubst, flags, &subst2); if (md) { if (IsMdInstanceInitializer(md->GetAttrs(), pszName)) { md = NULL; } } RETURN md; } RETURN NULL; #else // DACCESS_COMPILE DacNotImpl(); RETURN NULL; #endif // DACCESS_COMPILE } #ifndef DACCESS_COMPILE //******************************************************************************* // This will return the MethodDesc that implements the interface method <pInterface,slotNum>. MethodDesc *EEClass::FindMethodForInterfaceSlot(MethodTable *pInterface, WORD slotNum) { CONTRACTL { THROWS; GC_TRIGGERS; PRECONDITION(CheckPointer(pInterface)); PRECONDITION(pInterface->IsInterface()); PRECONDITION(slotNum < pInterface->GetNumMethods()); } CONTRACTL_END; MethodDesc *pMDRet = NULL; MethodTable *pMT = GetMethodTable(); DispatchSlot ds(pMT->FindDispatchSlot(pInterface->GetTypeID(), (UINT32)slotNum)); if (!ds.IsNull()) { pMDRet = ds.GetMethodDesc(); } CONSISTENCY_CHECK(CheckPointer(pMDRet)); return pMDRet; } #endif // #ifndef DACCESS_COMPILE //******************************************************************************* MethodDesc *EEClass::FindMethod(LPCUTF8 pwzName, LPHARDCODEDMETASIG pwzSignature, FM_Flags flags) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(!IsThunking()); MODE_ANY; SO_TOLERANT; } CONTRACTL_END; PCCOR_SIGNATURE pBinarySig; ULONG cbBinarySigLength; pwzSignature->GetBinarySig(&pBinarySig, &cbBinarySigLength ); return FindMethod(pwzName, pBinarySig, cbBinarySigLength, SystemDomain::SystemModule(), NULL, flags); } //******************************************************************************* MethodDesc *EEClass::FindMethod(mdMethodDef mb) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(!IsThunking()); MODE_ANY; } CONTRACTL_END; // We have the EEClass (this) and so lets just look this up in the ridmap. MethodDesc *pMD = NULL; Module *pModule = GetModule(); PREFIX_ASSUME(pModule != NULL); if (TypeFromToken(mb) == mdtMemberRef) pMD = pModule->LookupMemberRefAsMethod(mb); else pMD = pModule->LookupMethodDef(mb); if (pMD != NULL) pMD->CheckRestore(); return pMD; } //******************************************************************************* MethodDesc *EEClass::FindMethodByName(LPCUTF8 pszName, FM_Flags flags) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); PRECONDITION(!IsThunking()); PRECONDITION(!IsArrayClass()); MODE_ANY; SO_TOLERANT; } CONTRACTL_END; #ifndef DACCESS_COMPILE // Caching of MethodDescs (impl and decl) for MethodTable slots provided significant // performance gain in some reflection emit scenarios. MethodTable::AllowMethodDataCaching(); // Retrive the right comparition function to use. UTF8StringCompareFuncPtr StrCompFunc = FM_GetStrCompFunc(flags); // Scan all classes in the hierarchy, starting at the current class and // moving back up towards the base. MethodTable *pMT = GetMethodTable(); while (pMT != NULL) { // Iterate through the methods searching for a match. MethodTable::MethodIterator it(pMT); it.MoveToEnd(); for (; it.IsValid(); it.Prev()) { MethodDesc *pCurMD = it.GetDeclMethodDesc(); if (pCurMD != NULL) { // If we're working from the end of the vtable, we'll cover all the non-virtuals // first, and so if we're supposed to ignore virtuals (see setting of the flag // below) then we can just break out of the loop and go to the parent. if ((flags & FM_ExcludeVirtual) && pCurMD->IsVirtual()) { break; } if (FM_ShouldSkipMethod(pCurMD->GetAttrs(), flags)) { continue; } if (StrCompFunc(pszName, pCurMD->GetNameOnNonArrayClass()) == 0) { MethodDesc* pRetMD = it.GetMethodDesc(); pRetMD->CheckRestore(); return pRetMD; } } } // Check the parent type for a matching method. pMT = pMT->GetParentMethodTable(); // There is no need to check virtuals for parent types, since by definition they have the same name. flags = (FM_Flags)(flags | FM_ExcludeVirtual); } return NULL; #else // DACCESS_COMPILE DacNotImpl(); RETURN NULL; #endif // DACCESS_COMPILE } #ifndef DACCESS_COMPILE //******************************************************************************* MethodDesc *EEClass::FindPropertyMethod(LPCUTF8 pszName, EnumPropertyMethods Method, FM_Flags flags) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); MODE_ANY; PRECONDITION(Method < 2); } CONTRACTL_END; // The format strings for the getter and setter. These must stay in synch with the // EnumPropertyMethods enum defined in class.h static const LPCUTF8 aFormatStrings[] = { "get_%s", "set_%s" }; CQuickBytes qbMethName; size_t len = strlen(pszName) + strlen(aFormatStrings[Method]) + 1; LPUTF8 strMethName = (LPUTF8) qbMethName.AllocThrows(len); sprintf_s(strMethName, len, aFormatStrings[Method], pszName); return FindMethodByName(strMethName, flags); } //******************************************************************************* MethodDesc *EEClass::FindEventMethod(LPCUTF8 pszName, EnumEventMethods Method, FM_Flags flags) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); MODE_ANY; SO_TOLERANT; PRECONDITION(Method < 3); } CONTRACTL_END; // The format strings for the getter and setter. These must stay in synch with the // EnumPropertyMethods enum defined in class.h static const LPCUTF8 aFormatStrings[] = { "add_%s", "remove_%s", "raise_%s" }; CQuickBytes qbMethName; size_t len = strlen(pszName) + strlen(aFormatStrings[Method]) + 1; LPUTF8 strMethName = (LPUTF8) qbMethName.AllocThrows(len); sprintf_s(strMethName, len, aFormatStrings[Method], pszName); return FindMethodByName(strMethName, flags); } #endif // #ifndef DACCESS_COMPILE FieldDesc *EEClass::FindField(LPCUTF8 pszName, PCCOR_SIGNATURE pSignature, DWORD cSignature, Module* pModule, BOOL bCaseSensitive) { CONTRACTL { THROWS; GC_TRIGGERS; SO_TOLERANT; INJECT_FAULT(COMPlusThrowOM();); MODE_ANY; } CONTRACTL_END DWORD i; DWORD dwFieldDescsToScan; IMDInternalImport *pInternalImport = GetMDImport(); // All explicitly declared fields in this class will have the same scope CONSISTENCY_CHECK(GetMethodTable()->CheckLoadLevel(CLASS_LOAD_APPROXPARENTS)); // Retrive the right comparition function to use. UTF8StringCompareFuncPtr StrCompFunc = bCaseSensitive ? strcmp : stricmpUTF8; // The following assert is very important, but we need to special case it enough // to allow us access to the legitimate fields of a context proxy object. CONSISTENCY_CHECK(!IsThunking() || !strcmp(pszName, "actualObject") || !strcmp(pszName, "contextID") || !strcmp(pszName, "_rp") || !strcmp(pszName, "_stubData") || !strcmp(pszName, "_pMT") || !strcmp(pszName, "_pInterfaceMT") || !strcmp(pszName, "_stub")); // Array classes don't have fields, and don't have metadata if (IsArrayClass()) return NULL; MethodTable *pParentMT = GetMethodTable()->GetParentMethodTable(); // Scan the FieldDescs of this class if (pParentMT != NULL) dwFieldDescsToScan = m_wNumInstanceFields - pParentMT->GetClass()->m_wNumInstanceFields + m_wNumStaticFields; else dwFieldDescsToScan = m_wNumInstanceFields + m_wNumStaticFields; for (i = 0; i < dwFieldDescsToScan; i++) { LPCUTF8 szMemberName; FieldDesc * pFD = &GetFieldDescListPtr()[i]; PREFIX_ASSUME(pFD!=NULL); mdFieldDef mdField = pFD->GetMemberDef(); // Check is valid FieldDesc, and not some random memory INDEBUGIMPL(pFD->GetApproxEnclosingMethodTable()->SanityCheck()); szMemberName = pInternalImport->GetNameOfFieldDef(mdField); if (StrCompFunc(szMemberName, pszName) != 0) { continue; } if (pSignature != NULL) { PCCOR_SIGNATURE pMemberSig; DWORD cMemberSig; pMemberSig = pInternalImport->GetSigOfFieldDef( mdField, &cMemberSig ); if (!MetaSig::CompareFieldSigs( pMemberSig, cMemberSig, GetModule(), pSignature, cSignature, pModule)) { continue; } } return pFD; } return NULL; } #ifndef DACCESS_COMPILE //******************************************************************************* MethodDesc *EEClass::FindConstructor(LPHARDCODEDMETASIG pwzSignature) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); MODE_ANY; } CONTRACTL_END PCCOR_SIGNATURE pBinarySig; ULONG cbBinarySigLength; pwzSignature->GetBinarySig(&pBinarySig, &cbBinarySigLength); return FindConstructor(pBinarySig, cbBinarySigLength, SystemDomain::SystemModule()); } //******************************************************************************* MethodDesc *EEClass::FindConstructor(PCCOR_SIGNATURE pSignature,DWORD cSignature, Module* pModule) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); MODE_ANY; } CONTRACTL_END // Array classes don't have metadata if (IsArrayClass()) return NULL; MethodTable::MethodIterator it(this->GetMethodTable()); for (; it.IsValid(); it.Next()) { if (it.IsVirtual()) { continue; } MethodDesc *pCurMethod = it.GetMethodDesc(); if (pCurMethod == NULL) { continue; } DWORD dwCurMethodAttrs = pCurMethod->GetAttrs(); if(!IsMdRTSpecialName(dwCurMethodAttrs)) { continue; } // Don't want class initializers. if (IsMdStatic(dwCurMethodAttrs)) { continue; } // Find only the constructor for for this object _ASSERTE(pCurMethod->GetMethodTable() == this->GetMethodTable()); PCCOR_SIGNATURE pCurMethodSig; DWORD cCurMethodSig; pCurMethod->GetSig(&pCurMethodSig, &cCurMethodSig); if (MetaSig::CompareMethodSigs(pSignature, cSignature, pModule, NULL, pCurMethodSig, cCurMethodSig, pCurMethod->GetModule(), NULL)) { return pCurMethod; } } return NULL; } #endif // !DACCESS_COMPILE //******************************************************************************* // // Helper routines for the macros defined at the top of this class. // You probably should not use these functions directly. // SString &EEClass::_GetFullyQualifiedNameForClassNestedAware(SString &ssBuf) { CONTRACTL { THROWS; GC_NOTRIGGER; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END; ssBuf.Clear(); LPCUTF8 pszNamespace; LPCUTF8 pszName; pszName = GetFullyQualifiedNameInfo(&pszNamespace); if (pszName == NULL) { return ssBuf; } StackSString ssName(SString::Utf8, pszName); mdTypeDef mdEncl = GetCl(); IMDInternalImport *pImport = GetMDImport(); // Check if the type is nested DWORD dwAttr; pImport->GetTypeDefProps(GetCl(), &dwAttr, NULL); if (IsTdNested(dwAttr)) { StackSString ssFullyQualifiedName; StackSString ssPath; // Build the nesting chain. while (SUCCEEDED(pImport->GetNestedClassProps(mdEncl, &mdEncl))) { LPCUTF8 szEnclName; LPCUTF8 szEnclNameSpace; pImport->GetNameOfTypeDef(mdEncl, &szEnclName, &szEnclNameSpace); ns::MakePath(ssPath, StackSString(SString::Utf8, szEnclNameSpace), StackSString(SString::Utf8, szEnclName)); ns::MakeNestedTypeName(ssFullyQualifiedName, ssPath, ssName); ssName = ssFullyQualifiedName; } } ns::MakePath(ssBuf, StackSString(SString::Utf8, pszNamespace), ssName); return ssBuf; } //******************************************************************************* SString &EEClass::_GetFullyQualifiedNameForClass(SString &ssBuf) { CONTRACTL { THROWS; GC_NOTRIGGER; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END ssBuf.Clear(); if (IsArrayClass()) { TypeDesc::ConstructName(GetMethodTable()->GetInternalCorElementType(), GetMethodTable()->GetApproxArrayElementTypeHandle_NoLogging(), GetMethodTable()->GetRank(), ssBuf); } else if (!IsNilToken(GetCl())) { LPCUTF8 szNamespace; LPCUTF8 szName; GetMDImport()->GetNameOfTypeDef(GetCl(), &szName, &szNamespace); ns::MakePath(ssBuf, StackSString(SString::Utf8, szNamespace), StackSString(SString::Utf8, szName)); } return ssBuf; } // // LPCUTF8 EEClass::GetFullyQualifiedNameInfo(LPCUTF8 *ppszNamespace) { CONTRACTL { NOTHROW; GC_NOTRIGGER; FORBID_FAULT; } CONTRACTL_END if (IsArrayClass()) { *ppszNamespace = NULL; return NULL; } else { LPCUTF8 szName; GetMDImport()->GetNameOfTypeDef(GetCl(), &szName, ppszNamespace); return szName; } } //******************************************************************************* DWORD EEClass::GetInstAndDictSize() { LEAF_CONTRACT; if (!HasInstantiation()) return 0; else return DictionaryLayout::GetFirstDictionaryBucketSize(GetNumGenericArgs(), GetDictionaryLayout()); } #ifndef DACCESS_COMPILE //******************************************************************************* void EEClass::DebugRecursivelyDumpInstanceFields(LPCUTF8 pszClassName, BOOL debug) { WRAPPER_CONTRACT; // It's a dev helper, who cares about contracts EX_TRY { StackSString ssBuff; DWORD cParentInstanceFields; DWORD i; CONSISTENCY_CHECK(GetMethodTable()->CheckLoadLevel(CLASS_LOAD_APPROXPARENTS)); MethodTable *pParentMT = GetMethodTable()->GetParentMethodTable(); if (pParentMT != NULL) { cParentInstanceFields = pParentMT->GetClass()->m_wNumInstanceFields; DefineFullyQualifiedNameForClass(); LPCUTF8 name = GetFullyQualifiedNameForClass(pParentMT->GetClass()); pParentMT->GetClass()->DebugRecursivelyDumpInstanceFields(name, debug); } else { cParentInstanceFields = 0; } // Are there any new instance fields declared by this class? if (m_wNumInstanceFields > cParentInstanceFields) { // Display them if(debug) { ssBuff.Printf(L"%S:\n", pszClassName); WszOutputDebugString(ssBuff.GetUnicode()); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "%s:\n", pszClassName)); } for (i = 0; i < (m_wNumInstanceFields-cParentInstanceFields); i++) { FieldDesc *pFD = &m_pFieldDescList[i]; // printf("offset %s%3d %s\n", pFD->IsByValue() ? "byvalue " : "", pFD->GetOffset_NoLogging(), pFD->GetName()); if(debug) { ssBuff.Printf(L"offset %3d %S\n", pFD->GetOffset_NoLogging(), pFD->GetName()); WszOutputDebugString(ssBuff.GetUnicode()); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "offset %3d %s\n", pFD->GetOffset_NoLogging(), pFD->GetName())); } } } } EX_CATCH { if(debug) { WszOutputDebugString(L"<Exception Thrown>\n"); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "<Exception Thrown>\n")); } } EX_END_CATCH(SwallowAllExceptions); } //******************************************************************************* void EEClass::DebugDumpFieldLayout(LPCUTF8 pszClassName, BOOL debug) { WRAPPER_CONTRACT; // It's a dev helper, who cares about contracts if (m_wNumStaticFields == 0 && m_wNumInstanceFields == 0) return; EX_TRY { StackSString ssBuff; DWORD i; DWORD cParentInstanceFields; CONSISTENCY_CHECK(GetMethodTable()->CheckLoadLevel(CLASS_LOAD_APPROXPARENTS)); if (GetParentClass() != NULL) cParentInstanceFields = GetParentClass()->m_wNumInstanceFields; else cParentInstanceFields = 0; if(debug) { ssBuff.Printf(L"Field layout for '%S':\n\n", pszClassName); WszOutputDebugString(ssBuff.GetUnicode()); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "Field layout for '%s':\n\n", pszClassName)); } if (m_wNumStaticFields > 0) { if(debug) { WszOutputDebugString(L"Static fields (stored at vtable offsets)\n"); WszOutputDebugString(L"----------------------------------------\n"); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "Static fields (stored at vtable offsets)\n")); LOG((LF_CLASSLOADER, LL_ALWAYS, "----------------------------------------\n")); } for (i = 0; i < m_wNumStaticFields; i++) { FieldDesc *pFD = &m_pFieldDescList[(m_wNumInstanceFields-cParentInstanceFields) + i]; if(debug) { ssBuff.Printf(L"offset %3d %S\n", pFD->GetOffset_NoLogging(), pFD->GetName()); WszOutputDebugString(ssBuff.GetUnicode()); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "offset %3d %s\n", pFD->GetOffset_NoLogging(), pFD->GetName())); } } } if (m_wNumInstanceFields > 0) { if (m_wNumStaticFields) { if(debug) { WszOutputDebugString(L"\n"); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "\n")); } } if(debug) { WszOutputDebugString(L"Instance fields\n"); WszOutputDebugString(L"---------------\n"); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "Instance fields\n")); LOG((LF_CLASSLOADER, LL_ALWAYS, "---------------\n")); } DebugRecursivelyDumpInstanceFields(pszClassName, debug); } if(debug) { WszOutputDebugString(L"\n"); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "\n")); } } EX_CATCH { if(debug) { WszOutputDebugString(L"<Exception Thrown>\n"); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "<Exception Thrown>\n")); } } EX_END_CATCH(SwallowAllExceptions); } //******************************************************************************* void EEClass::DebugDumpGCDesc(LPCUTF8 pszClassName, BOOL debug) { WRAPPER_CONTRACT; // It's a dev helper, who cares about contracts EX_TRY { StackSString ssBuff; if(debug) { ssBuff.Printf(L"GC description for '%S':\n\n", pszClassName); WszOutputDebugString(ssBuff.GetUnicode()); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "GC description for '%s':\n\n", pszClassName)); } if (GetMethodTable()->ContainsPointers()) { CGCDescSeries *pSeries; CGCDescSeries *pHighest; if(debug) { WszOutputDebugString(L"GCDesc:\n"); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "GCDesc:\n")); } pSeries = CGCDesc::GetCGCDescFromMT(GetMethodTable())->GetLowestSeries(); pHighest = CGCDesc::GetCGCDescFromMT(GetMethodTable())->GetHighestSeries(); while (pSeries <= pHighest) { if(debug) { ssBuff.Printf(L" offset %5d (%d w/o Object), size %5d (%5d w/o BaseSize subtr)\n", pSeries->GetSeriesOffset(), pSeries->GetSeriesOffset() - sizeof(Object), pSeries->GetSeriesSize(), pSeries->GetSeriesSize() + GetMethodTable()->GetBaseSize() ); WszOutputDebugString(ssBuff.GetUnicode()); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, " offset %5d (%d w/o Object), size %5d (%5d w/o BaseSize subtr)\n", pSeries->GetSeriesOffset(), pSeries->GetSeriesOffset() - sizeof(Object), pSeries->GetSeriesSize(), pSeries->GetSeriesSize() + GetMethodTable()->GetBaseSize() )); } pSeries++; } if(debug) { WszOutputDebugString(L"\n"); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "\n")); } } } EX_CATCH { if(debug) { WszOutputDebugString(L"<Exception Thrown>\n"); } else { LOG((LF_CLASSLOADER, LL_ALWAYS, "<Exception Thrown>\n")); } } EX_END_CATCH(SwallowAllExceptions); } // For X86, INSTALL_COMPLUS_EXCEPTION_HANDLER grants us sufficient protection to call into // managed code. // // But on 64-bit, the personality routine will not pop frames or trackers as exceptions unwind // out of managed code. Instead, we rely on explicit cleanup like CLRException::HandlerState::CleanupTry // or UMThunkUnwindFrameChainHandler. // // So most callers should call through CallDescrWorkerWithHandler (or a wrapper like MethodDesc::Call) // and get the platform-appropriate exception handling. A few places try to optimize by calling direct // to managed methods (see ArrayInitializeWorker or FastCallFinalize). This sort of thing is // dangerous. You have to worry about marking yourself as a legal managed caller and you have to // worry about how exceptions will be handled on a WIN64EXCEPTIONS plan. It is generally only suitable // for X86. //******************************************************************************* extern "C" ARG_SLOT CallDescrWorkerWithHandler( LPVOID pSrcEnd, UINT32 numStackSlots, #ifdef CALLDESCR_ARGREGS const ArgumentRegisters * pArgumentRegisters, #endif #ifdef CALLDESCR_REGTYPEMAP UINT64 dwRegTypeMap, #endif #ifdef CALLDESCR_RETBUF LPVOID pRetBuff, UINT64 cbRetBuff, #endif // CALLDESCR_RETBUF UINT32 fpReturnSize, LPVOID pTarget, BOOL fCriticalCall) { ARG_SLOT retval = 0; BEGIN_CALL_TO_MANAGEDEX(fCriticalCall ? EEToManagedCriticalCall : EEToManagedDefault); retval = CallDescrWorker(pSrcEnd, numStackSlots, #ifdef CALLDESCR_ARGREGS pArgumentRegisters, #endif #ifdef CALLDESCR_REGTYPEMAP dwRegTypeMap, #endif #ifdef CALLDESCR_RETBUF pRetBuff, cbRetBuff, #endif // CALLDESCR_RETBUF fpReturnSize, pTarget); END_CALL_TO_MANAGED(); return retval; } #if !defined(_WIN64) && defined(_DEBUG) //******************************************************************************* // assembly code, in i386/asmhelpers.asm extern "C" ARG_SLOT __stdcall CallDescrWorkerInternal( LPVOID pSrcEnd, UINT32 numStackSlots, #ifdef CALLDESCR_ARGREGS const ArgumentRegisters * pArgumentRegisters, #endif #ifdef CALLDESCR_REGTYPEMAP UINT64 dwRegTypeMap, #endif #ifdef CALLDESCR_RETBUF LPVOID pRetBuff, UINT64 cbRetBuff, #endif // CALLDESCR_RETBUF UINT32 fpRetSize, LPVOID pTarget); extern "C" ARG_SLOT __stdcall CallDescrWorker( LPVOID pSrcEnd, UINT32 numStackSlots, #ifdef CALLDESCR_ARGREGS const ArgumentRegisters * pArgumentRegisters, #endif #ifdef CALLDESCR_REGTYPEMAP UINT64 dwRegTypeMap, #endif #ifdef CALLDESCR_RETBUF LPVOID pRetBuff, UINT64 cbRetBuff, #endif // CALLDESCR_RETBUF UINT32 fpRetSize, LPVOID pTarget) { // // This function must not have a contract ... it's caller has pushed an FS:0 frame (COMPlusFrameHandler) that must // be the first handler on the stack. The contract causes, at a minimum, a C++ exception handler to be pushed to // handle the destruction of the contract object. If there is an exception in the managed code called from here, // and that exception is handled in that same block of managed code, then the COMPlusFrameHandler will actually // unwind the C++ handler before branching to the catch clause in managed code. That essentially causes an // out-of-order destruction of the contract object, resulting in very odd crashes later. // TRIGGERSGC_NOSTOMP(); // Can't stomp object refs because they are args to the function ARG_SLOT retValue; // Save a copy of dangerousObjRefs in table. Thread* curThread; DWORD_PTR ObjRefTable[OBJREF_TABSIZE]; curThread = GetThread(); _ASSERTE(curThread != NULL); C_ASSERT(sizeof(curThread->dangerousObjRefs) == sizeof(ObjRefTable)); memcpy(ObjRefTable, curThread->dangerousObjRefs, sizeof(ObjRefTable)); _ASSERTE(curThread->PreemptiveGCDisabled()); // Jitted code expects to be in cooperative mode // If current thread owns spinlock or unbreakalble lock, it can not call managed code. _ASSERTE(!curThread->HasUnbreakableLock() && (curThread->m_StateNC & Thread::TSNC_OwnsSpinLock) == 0); retValue = (ARG_SLOT) CallDescrWorkerInternal ( pSrcEnd, numStackSlots, #ifdef CALLDESCR_ARGREGS pArgumentRegisters, #endif #ifdef CALLDESCR_REGTYPEMAP dwRegTypeMap, #endif #ifdef CALLDESCR_RETBUF pRetBuff, cbRetBuff, #endif // CALLDESCR_RETBUF fpRetSize, pTarget); // Restore dangerousObjRefs when we return back to EE after call memcpy(curThread->dangerousObjRefs, ObjRefTable, sizeof(ObjRefTable)); TRIGGERSGC(); ENABLESTRESSHEAP(); return retValue; } #endif // !defined(_WIN64) && defined(_DEBUG) //******************************************************************************* Substitution EEClass::GetSubstitutionForParent(const Substitution *pSubst) { CONTRACTL { NOTHROW; GC_NOTRIGGER; FORBID_FAULT; } CONTRACTL_END mdToken crExtends; DWORD dwAttrClass; if (IsArrayClass()) return Substitution(GetModule(), NULL, pSubst); GetMDImport()->GetTypeDefProps( GetCl(), &dwAttrClass, &crExtends ); return Substitution(crExtends, GetModule(), pSubst); } #endif // !DACCESS_COMPILE //******************************************************************************* Assembly* EEClass::GetAssembly() { WRAPPER_CONTRACT; return GetModule()->GetAssembly(); } //******************************************************************************* BaseDomain* EEClass::GetDomain() { CONTRACTL { NOTHROW; GC_NOTRIGGER; FORBID_FAULT; } CONTRACTL_END #ifndef DACCESS_COMPILE Module *pZapModule = GetZapModule(); if (pZapModule) { return pZapModule->GetDomain(); } else { if (!IsGenericTypeDefinition() && HasInstantiation()) { _ASSERTE(m_pMethodTable != NULL && "Cannot call EEClass::GetDomain so early for an instantiated type: use bmtDomain instead?"); return BaseDomain::ComputeBaseDomain(GetAssembly()->GetDomain(), GetNumGenericArgs(), GetCanonicalInstantiation()); } else return GetAssembly()->GetDomain(); } #else // DACCESS_COMPILE return NULL; #endif // DACCESS_COMPILE } #ifndef DACCESS_COMPILE //******************************************************************************* void EEClass::AddChunk (MethodDescChunk* pNewChunk) { STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_GC_NOTRIGGER; STATIC_CONTRACT_FORBID_FAULT; pNewChunk->SetNextChunk(GetChunks()); SetChunks(pNewChunk); } //******************************************************************************* struct TempEnumValue { LPCUTF8 name; UINT64 value; }; //******************************************************************************* class TempEnumValueSorter : public CQuickSort<TempEnumValue> { public: TempEnumValueSorter(TempEnumValue *pArray, SSIZE_T iCount) : CQuickSort<TempEnumValue>(pArray, iCount) { LEAF_CONTRACT; } int Compare(TempEnumValue *pFirst, TempEnumValue *pSecond) { LEAF_CONTRACT; if (pFirst->value == pSecond->value) return 0; if (pFirst->value > pSecond->value) return 1; else return -1; } }; //******************************************************************************* int EnumEEClass::GetEnumLogSize() { WRAPPER_CONTRACT; switch (GetMethodTable()->GetInternalCorElementType()) { case ELEMENT_TYPE_I1: case ELEMENT_TYPE_U1: case ELEMENT_TYPE_BOOLEAN: return 0; case ELEMENT_TYPE_I2: case ELEMENT_TYPE_U2: case ELEMENT_TYPE_CHAR: return 1; case ELEMENT_TYPE_I4: case ELEMENT_TYPE_U4: case ELEMENT_TYPE_R4: IN_WIN32(case ELEMENT_TYPE_I:) IN_WIN32(case ELEMENT_TYPE_U:) return 2; case ELEMENT_TYPE_I8: case ELEMENT_TYPE_U8: case ELEMENT_TYPE_R8: IN_WIN64(case ELEMENT_TYPE_I:) IN_WIN64(case ELEMENT_TYPE_U:) return 3; default: BAD_FORMAT_NOTHROW_ASSERT(!"Illegal enum type"); return 0; } } //******************************************************************************* HRESULT EnumEEClass::BuildEnumTables() { CONTRACTL { NOTHROW; GC_NOTRIGGER; INJECT_FAULT(return E_OUTOFMEMORY;); } CONTRACTL_END HRESULT hr; BAD_FORMAT_NOTHROW_ASSERT(IsEnum()); // Note about synchronization: // This routine is synchronized OK without any locking since it's idempotent. (although it // may leak in races.) // Right now we'll be satisfied with this - external code can lock if appropriate. if (EnumTablesBuilt()) return S_OK; IMDInternalImport *pImport = GetMDImport(); HENUMInternal fields; IfFailRet(pImport->EnumInit(mdtFieldDef, GetCl(), &fields)); // // Note that we're fine treating signed types as unsigned, because all we really // want to do is sort them based on a convenient strong ordering. // int logSize = GetEnumLogSize(); int size = 1<<logSize; ULONG fieldCount = pImport->EnumGetCount(&fields)-1; // Omit one for __value field if (fieldCount > 0) { CQuickArray<TempEnumValue> temps; if (FAILED(temps.ReSizeNoThrow(fieldCount))) return E_OUTOFMEMORY; TempEnumValue *pTemps = temps.Ptr(); // The following is not portable code - it assumes that the address of all union members // is the same. C_ASSERT(offsetof(MDDefaultValue, m_byteValue) == offsetof(MDDefaultValue, m_usValue)); C_ASSERT(offsetof(MDDefaultValue, m_ulValue) == offsetof(MDDefaultValue, m_ullValue)); mdFieldDef field; int nTotalInstanceFields = 0; while (pImport->EnumNext(&fields, &field)) { if (IsFdStatic(pImport->GetFieldDefProps(field))) { pTemps->name = pImport->GetNameOfFieldDef(field); MDDefaultValue defaultValue; IfFailRet(pImport->GetDefaultValue(field, &defaultValue)); switch (logSize) { case 0: pTemps->value = defaultValue.m_byteValue; break; case 1: pTemps->value = defaultValue.m_usValue; break; case 2: pTemps->value = defaultValue.m_ulValue; break; case 3: pTemps->value = defaultValue.m_ullValue; break; } pTemps++; } else { nTotalInstanceFields++; } } BAD_FORMAT_NOTHROW_ASSERT((nTotalInstanceFields == 1) && "Zero or Multiple instance fields in an enum!"); // // Check to see if we are already sorted. This may seem extraneous, but is // actually probably the normal case. // BOOL sorted = TRUE; pTemps = temps.Ptr(); TempEnumValue *pTempsEnd = pTemps + fieldCount - 1; while (pTemps < pTempsEnd) { if (pTemps[0].value > pTemps[1].value) { sorted = FALSE; break; } pTemps++; } if (!sorted) { TempEnumValueSorter sorter(temps.Ptr(), fieldCount); sorter.Sort(); } // Last chance to exit race without leaking! if (EnumTablesBuilt()) return S_OK; // Overflow check if (fieldCount > 0x7fffffff) return E_INVALIDARG; AllocMemHolder<LPCUTF8> pNames (GetDomain()->GetHighFrequencyHeap()->AllocMem_NoThrow(fieldCount * sizeof(LPCUTF8))); if (!pNames) { return E_OUTOFMEMORY; } ULONG cbAllocSize = 0; if (!ClrSafeInt<ULONG>::multiply(fieldCount, size, cbAllocSize)) return E_INVALIDARG; AllocMemHolder<BYTE> pValues (GetDomain()->GetHighFrequencyHeap()->AllocMem_NoThrow(cbAllocSize)); if (!pValues) { return E_OUTOFMEMORY; } pTemps = temps.Ptr(); pTempsEnd = pTemps + fieldCount; LPCUTF8 *pn = pNames; BYTE *pv = pValues; while (pTemps < pTempsEnd) { *pn++ = pTemps->name; switch (logSize) { case 0: *pv++ = (BYTE) pTemps->value; break; case 1: *(USHORT*)pv = (USHORT) pTemps->value; pv += sizeof(USHORT); break; case 2: *(UINT*)pv = (UINT) pTemps->value; pv += sizeof(UINT); break; case 3: *(UINT64*)pv = (UINT64) pTemps->value; pv += sizeof(UINT64); break; } pTemps++; } _ASSERTE( 0 == ( ((UINT_PTR)&m_names) & (sizeof(LPVOID)-1) )); if (NULL == InterlockedCompareExchangePointer((volatile PVOID *)&m_names, (PVOID)pNames, NULL)) { pNames.SuppressRelease(); } _ASSERTE( 0 == ( ((UINT_PTR)&m_values) & (sizeof(LPVOID)-1) )); if (NULL == InterlockedCompareExchangePointer((volatile PVOID *)&m_values, (PVOID)pValues, NULL)) { pValues.SuppressRelease(); } pImport->EnumClose(&fields); } m_countPlusOne = fieldCount+1; return S_OK; } #endif // !DACCESS_COMPILE //******************************************************************************* // ApproxFieldDescIterator is used to iterate over fields in a given class. // It does not includes EnC fields, and not inherited fields. // <NICE> ApproxFieldDescIterator is only used to iterate over static fields in one place, // and this will probably change anyway. After // we clean this up we should make ApproxFieldDescIterator work // over instance fields only </NICE> ApproxFieldDescIterator::ApproxFieldDescIterator() { CONTRACTL { NOTHROW; GC_NOTRIGGER; FORBID_FAULT; } CONTRACTL_END m_iteratorType = 0; m_pClass = NULL; m_currField = -1; m_totalFields = 0; } //******************************************************************************* void ApproxFieldDescIterator::Init(MethodTable *pMT, int iteratorType, BOOL fixupEnC) { CONTRACTL { NOTHROW; GC_NOTRIGGER; FORBID_FAULT; } CONTRACTL_END m_iteratorType = iteratorType; m_pClass = pMT->GetClass(); m_currField = -1; // This gets non-EnC fields. m_totalFields = m_pClass->GetNumIntroducedInstanceFields(); if (!(iteratorType & (int)INSTANCE_FIELDS)) { // if not handling instances then skip them by setting curr to last one m_currField = m_pClass->GetNumIntroducedInstanceFields() - 1; } if (iteratorType & (int)STATIC_FIELDS) { m_totalFields += m_pClass->GetNumStaticFields(); } } //******************************************************************************* FieldDesc* ApproxFieldDescIterator::Next() { CONTRACTL { NOTHROW; GC_NOTRIGGER; FORBID_FAULT; } CONTRACTL_END // This will iterate through all non-inherited and non-EnC fields. ++m_currField; if (m_currField >= m_totalFields) { return NULL; } return (m_pClass->GetFieldDescListPtr()) + m_currField; } //******************************************************************************* bool DeepFieldDescIterator::NextClass() { WRAPPER_CONTRACT; if (m_curClass <= 0) { return false; } if (m_numClasses <= 0) { _ASSERTE(m_numClasses > 0); return false; } EEClass* cls; // // If we're in the cache just grab the cache entry. // // If we're deeper in the hierarchy than the // portion we cached we need to take the // deepest cache entry and search down manually. // if (--m_curClass < m_numClasses) { cls = m_classes[m_curClass]; } else { cls = m_classes[m_numClasses - 1]; int depthDiff = m_curClass - m_numClasses + 1; while (depthDiff--) { cls = cls->GetParentClass(); } } m_fieldIter.Init(cls->GetMethodTable(), m_fieldIter.GetIteratorType()); return true; } //******************************************************************************* void DeepFieldDescIterator::Init(MethodTable* pMT, int iteratorType, bool includeParents) { WRAPPER_CONTRACT; EEClass* lastClass = NULL; int numClasses; // // Walk up the parent chain, collecting // parent pointers and counting fields. // numClasses = 0; m_numClasses = 0; m_deepTotalFields = 0; m_lastNextFromParentClass = false; EEClass *cls = pMT->GetClass(); while (cls) { if (m_numClasses < (int)NumItems(m_classes)) { m_classes[m_numClasses++] = cls; } if ((iteratorType & ApproxFieldDescIterator::INSTANCE_FIELDS) != 0) { m_deepTotalFields += cls->GetNumIntroducedInstanceFields(); } if ((iteratorType & ApproxFieldDescIterator::STATIC_FIELDS) != 0) { m_deepTotalFields += cls->GetNumStaticFields(); } numClasses++; lastClass = cls; if (includeParents) { cls = cls->GetParentClass(); } else { break; } } // Start the per-class field iterator on the base-most parent. if (numClasses) { m_curClass = numClasses - 1; m_fieldIter.Init(lastClass->GetMethodTable(), iteratorType); } else { m_curClass = 0; } } //******************************************************************************* FieldDesc* DeepFieldDescIterator::Next() { WRAPPER_CONTRACT; FieldDesc* field; do { m_lastNextFromParentClass = m_curClass > 0; field = m_fieldIter.Next(); if (!field && !NextClass()) { return NULL; } } while (!field); return field; } //******************************************************************************* bool DeepFieldDescIterator::Skip(int numSkip) { WRAPPER_CONTRACT; while (numSkip >= m_fieldIter.CountRemaining()) { numSkip -= m_fieldIter.CountRemaining(); if (!NextClass()) { return false; } } while (numSkip--) { m_fieldIter.Next(); } return true; } #ifdef DACCESS_COMPILE //******************************************************************************* void EEClass::EnumMemoryRegions(CLRDataEnumMemoryFlags flags) { DAC_ENUM_DTHIS(); EMEM_OUT(("MEM: %p EEClass\n", PTR_HOST_TO_TADDR(this))); if (flags != CLRDATA_ENUM_MEM_MINI) { if (m_pModule.IsValid()) { m_pModule->EnumMemoryRegions(flags, true); } if (m_pMethodTable.IsValid()) { m_pMethodTable->EnumMemoryRegions(flags); } PTR_MethodDescChunk chunk = GetChunks(); while (chunk.IsValid()) { chunk->EnumMemoryRegions(flags); chunk = chunk->m_next; } } if (GetFieldDescListPtr().IsValid() && (IsValueClass() || (m_pMethodTable.IsValid() && GetMethodTable()->IsRestored()))) { // add one to make sos's code happy. DacEnumMemoryRegion((TADDR)m_pFieldDescList_UseAccessor, (GetNumIntroducedInstanceFields() + GetNumStaticFields() + 1) * sizeof(FieldDesc)); } } #endif // DACCESS_COMPILE //******************************************************************************* void MethodTableBuilder::bmtMethodImplInfo::AddMethod(MethodDesc* pImplDesc, MethodDesc* pDesc, mdToken mdDecl, Substitution *pDeclSubst) { LEAF_CONTRACT; _ASSERTE((pDesc == NULL || mdDecl == mdTokenNil) && (pDesc != NULL || mdDecl != mdTokenNil)); rgEntries[pIndex].pDeclDesc = pDesc; rgEntries[pIndex].declToken = mdDecl; rgEntries[pIndex].declSubst = *pDeclSubst; rgEntries[pIndex].pBodyDesc = pImplDesc; pIndex++; } //******************************************************************************* // Returns TRUE if tok acts as a body for any methodImpl entry. FALSE, otherwise. BOOL MethodTableBuilder::bmtMethodImplInfo::IsBody(mdToken tok) { LEAF_CONTRACT; CONSISTENCY_CHECK(TypeFromToken(tok) == mdtMethodDef); for (DWORD i = 0; i < pIndex; i++) { if (GetBodyMethodDesc(i)->GetMemberDef() == tok) { return TRUE; } } return FALSE; } //------------------------------------------------------------------------------- // Make best-case effort to obtain an image name for use in an error message. // // This routine must expect to be called before the this object is fully loaded. // It can return an empty if the name isn't available or the object isn't initialized // enough to get a name, but it mustn't crash. //------------------------------------------------------------------------------- void EEClass::GetPathForErrorMessages(SString & result) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END Module *pModule = GetModule(); if (pModule) { pModule->GetPathForErrorMessages(result); } else { result = L""; } } //------------------------------------------------------------------------------- // Make best-case effort to obtain an image name for use in an error message. // // This routine must expect to be called before the this object is fully loaded. // It can return an empty if the name isn't available or the object isn't initialized // enough to get a name, but it mustn't crash. //------------------------------------------------------------------------------- void MethodTableBuilder::GetPathForErrorMessages(SString & result) { CONTRACTL { THROWS; GC_TRIGGERS; INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END EEClass *pClass = m_pHalfBakedClass; if (pClass) { pClass->GetPathForErrorMessages(result); } else { result = L""; } }
37.89303
229
0.560832
intj-t
b5e14825564f8f01c7ff1ab23134bab817e44cd1
314
cpp
C++
tests_old/test_array_enumerator.cpp
EthanTLee/Go-Sheep-Go
9536eed84074627ae4ed8bb848be1b7fdaf54486
[ "MIT" ]
null
null
null
tests_old/test_array_enumerator.cpp
EthanTLee/Go-Sheep-Go
9536eed84074627ae4ed8bb848be1b7fdaf54486
[ "MIT" ]
null
null
null
tests_old/test_array_enumerator.cpp
EthanTLee/Go-Sheep-Go
9536eed84074627ae4ed8bb848be1b7fdaf54486
[ "MIT" ]
null
null
null
#include "catch.hpp" #include <array> #include <extern/array_enumerator.hh> #include <iostream> TEST_CASE("array enumerator test") { std::array<std::array<int, 30>, 10> my_array1; for (auto [c, d] : array_helpers::enumarate(my_array1)) { std::cout << "c " << c << ", d " << d << "\n"; } }
19.625
61
0.589172
EthanTLee
b5e3311a6b077c2c153a44622faf076fd48b6a72
53,153
cc
C++
tensorflow/compiler/xla/service/plaidml/tests/plaidml_i3d_3b_test.cc
dgkutnic/tensorflow
527268ff7f5eaeec5b0d074670a4d9d8ce5cbc73
[ "Apache-2.0" ]
null
null
null
tensorflow/compiler/xla/service/plaidml/tests/plaidml_i3d_3b_test.cc
dgkutnic/tensorflow
527268ff7f5eaeec5b0d074670a4d9d8ce5cbc73
[ "Apache-2.0" ]
5
2020-07-17T17:36:44.000Z
2020-08-05T20:18:02.000Z
tensorflow/compiler/xla/service/plaidml/tests/plaidml_i3d_3b_test.cc
dgkutnic/tensorflow
527268ff7f5eaeec5b0d074670a4d9d8ce5cbc73
[ "Apache-2.0" ]
null
null
null
// Tests that show HLO Module conversion to PlaidML Program. #include <algorithm> #include <string> #include <gtest/gtest.h> #include "absl/strings/str_cat.h" #include "tensorflow/compiler/xla/service/plaidml/compiler.h" #include "tensorflow/compiler/xla/service/plaidml/tests/plaidml_codegen_test.h" #include "tensorflow/compiler/xla/service/plaidml/tests/i3d_pretrained_inputs_and_weights.h" #include "tensorflow/compiler/xla/service/plaidml/tests/i3d_3b_output.h" #include "tensorflow/compiler/xla/service/hlo_computation.h" #include "tensorflow/compiler/xla/service/hlo_instruction.h" #include "tensorflow/compiler/xla/tests/verified_hlo_module.h" #include "tensorflow/compiler/xla/service/hlo_opcode.h" #include "tensorflow/compiler/xla/tests/filecheck.h" #include "tensorflow/compiler/xla/tests/test_utils.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" #include "plaidml/testenv.h" using ::plaidml::edsl::TensorBuffers; namespace xla { namespace plaidml { namespace { using TestCaseVal = std::vector<std::vector<float>>; using TestCasePairs = std::map<TestCaseVal, TestCaseVal>; struct I3DTestSpec { PrimitiveType primitive_type; string filecheck_lines; }; string I3DTestSpecToString(const ::testing::TestParamInfo<I3DTestSpec>& info) { return PrimitiveType_Name(info.param.primitive_type); } class PlaidMLI3DOperationTest : public PlaidMLCodegenTest, public ::testing::WithParamInterface<I3DTestSpec> { protected: Status CompileAndCheck(std::unique_ptr<HloModule> hlo_module, const string& filecheck_lines, const TestCasePairs& testcase_pairs) { auto program = CompileToProgram(std::move(hlo_module)); StatusOr<bool> fc_result = RunFileCheck(program->str(), filecheck_lines); //TF_ASSERT_OK(fc_result.status()); EXPECT_TRUE(fc_result.ValueOrDie()); VLOG(0) << "Evaluating results"; for (auto pair : testcase_pairs) { TensorBuffers inp; TensorBuffers exp; auto program_inputs = program->inputs(); auto tcp_inputs = pair.first; if (tcp_inputs.size() != program_inputs.size()) { VLOG(1) << "Found mismatch in input sizes: tcp " << tcp_inputs.size() << " program " << program_inputs.size(); } for (auto i = 0; i < program_inputs.size(); i++) { VLOG(1) << "Adding TestCaseInput " << i; inp.insert(std::make_pair(program_inputs[i].tensor, pair.first[i])); } auto program_outputs = program->outputs(); auto tcp_outputs = pair.second; if (tcp_outputs.size() != program_outputs.size()) { VLOG(1) << "Found mismatch in output sizes: tcp " << tcp_outputs.size() << " program " << program_outputs.size(); } for (auto i = 0; i < program_outputs.size(); i++) { VLOG(1) << "Adding TestCaseOutput " << i; exp.insert(std::make_pair(program_outputs[i].tensor, pair.second[i])); } VLOG(0) << "Calling checkProgram"; checkProgram(*program, inp, exp); } return Status::OK(); } }; TEST_P(PlaidMLI3DOperationTest, SimpleI3D) { std::vector<float> input_tensor(4816896, 1.0); TestCaseVal I3D_WeightsInputs = {{0}, ::weights::RGB_inception_i3d_Mixed_3b_Branch_0_Conv3d_0a_1x1_conv_3d_w, {0}, ::weights::RGB_inception_i3d_Conv3d_2c_3x3_conv_3d_w, // {0}, ::weights::RGB_inception_i3d_Conv3d_2b_1x1_conv_3d_w, {0}, ::weights::RGB_inception_i3d_Conv3d_1a_7x7_conv_3d_w, input_tensor, // {0.001}, ::weights::RGB_inception_i3d_Conv3d_1a_7x7_batch_norm_beta, {0.001}, ::weights::RGB_inception_i3d_Conv3d_2b_1x1_batch_norm_beta, // {0.001}, ::weights::RGB_inception_i3d_Conv3d_2c_3x3_batch_norm_beta, {0.001}, ::weights::RGB_inception_i3d_Mixed_3b_Branch_0_Conv3d_0a_1x1_batch_norm_beta}; TestCaseVal I3D_Output = ::outputs::I3D_Outputs; TestCasePairs testcase_pairs = {{I3D_WeightsInputs, I3D_Output}}; I3DTestSpec spec = GetParam(); HloModuleConfig cfg; //std::unique_ptr<HloModule> hlo_module = absl::make_unique<HloModule>("module", cfg); std::unique_ptr<VerifiedHloModule> hlo_module = absl::make_unique<VerifiedHloModule>( "module", cfg, false, false, nullptr); std::string hlo_text = R"(HloModule cluster_1__XlaCompiledKernel_true__XlaNumConstantArgs_8__XlaNumResourceArgs_8_.266 %RGB_inception_i3d_Conv3d_1a_7x7_batch_norm_normalize_moments_mean-reduction.15 (x.16: f32[], y.17: f32[]) -> f32[] { %x.16 = f32[] parameter(0) %y.17 = f32[] parameter(1) ROOT %add.18 = f32[] add(f32[] %x.16, f32[] %y.17) } %RGB_inception_i3d_Conv3d_1a_7x7_batch_norm_normalize_moments_variance-reduction.39 (x.40: f32[], y.41: f32[]) -> f32[] { %x.40 = f32[] parameter(0) %y.41 = f32[] parameter(1) ROOT %add.42 = f32[] add(f32[] %x.40, f32[] %y.41) } %max_F32.69 (lhs.70: f32[], rhs.71: f32[]) -> f32[] { %lhs.70 = f32[] parameter(0) %rhs.71 = f32[] parameter(1) ROOT %maximum.72 = f32[] maximum(f32[] %lhs.70, f32[] %rhs.71) } %RGB_inception_i3d_Conv3d_2b_1x1_batch_norm_normalize_moments_mean-reduction.81 (x.82: f32[], y.83: f32[]) -> f32[] { %x.82 = f32[] parameter(0) %y.83 = f32[] parameter(1) ROOT %add.84 = f32[] add(f32[] %x.82, f32[] %y.83) } %RGB_inception_i3d_Conv3d_2b_1x1_batch_norm_normalize_moments_variance-reduction.105 (x.106: f32[], y.107: f32[]) -> f32[] { %x.106 = f32[] parameter(0) %y.107 = f32[] parameter(1) ROOT %add.108 = f32[] add(f32[] %x.106, f32[] %y.107) } %RGB_inception_i3d_Conv3d_2c_3x3_batch_norm_normalize_moments_mean-reduction.141 (x.142: f32[], y.143: f32[]) -> f32[] { %x.142 = f32[] parameter(0) %y.143 = f32[] parameter(1) ROOT %add.144 = f32[] add(f32[] %x.142, f32[] %y.143) } %RGB_inception_i3d_Conv3d_2c_3x3_batch_norm_normalize_moments_variance-reduction.165 (x.166: f32[], y.167: f32[]) -> f32[] { %x.166 = f32[] parameter(0) %y.167 = f32[] parameter(1) ROOT %add.168 = f32[] add(f32[] %x.166, f32[] %y.167) } %max_F32.195 (lhs.196: f32[], rhs.197: f32[]) -> f32[] { %lhs.196 = f32[] parameter(0) %rhs.197 = f32[] parameter(1) ROOT %maximum.198 = f32[] maximum(f32[] %lhs.196, f32[] %rhs.197) } %RGB_inception_i3d_Mixed_3b_Branch_0_Conv3d_0a_1x1_batch_norm_normalize_moments_mean-reduction.207 (x.208: f32[], y.209: f32[]) -> f32[] { %x.208 = f32[] parameter(0) %y.209 = f32[] parameter(1) ROOT %add.210 = f32[] add(f32[] %x.208, f32[] %y.209) } %RGB_inception_i3d_Mixed_3b_Branch_0_Conv3d_0a_1x1_batch_norm_normalize_moments_variance-reduction.231 (x.232: f32[], y.233: f32[]) -> f32[] { %x.232 = f32[] parameter(0) %y.233 = f32[] parameter(1) ROOT %add.234 = f32[] add(f32[] %x.232, f32[] %y.233) } ENTRY %cluster_1__XlaCompiledKernel_true__XlaNumConstantArgs_8__XlaNumResourceArgs_8_.266 (arg0.1: f32[1,32,224,224,3], arg1.2: f32[1,1,1,1,64], arg2.3: f32[7,7,7,3,64], arg3.4: f32[1,1,1,1,64], arg4.5: f32[1,1,1,1,64], arg5.6: f32[1,1,1,1,192], arg6.7: f32[1,1,1,64,64], arg7.8: f32[3,3,3,64,192], arg8.9: f32[1,1,1,192,64]) -> f32[1,16,28,28,64] { %constant.260 = f32[] constant(0), metadata={op_type="Relu" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/Relu"} %broadcast.261 = f32[1,16,28,28,64]{4,3,2,1,0} broadcast(f32[] %constant.260), dimensions={}, metadata={op_type="Relu" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/Relu"} %constant.248 = f32[] constant(0.001), metadata={op_type="Add" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/add"} %broadcast.249 = f32[1,1,1,1,64]{4,3,2,1,0} broadcast(f32[] %constant.248), dimensions={}, metadata={op_type="Add" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/add"} %constant.200 = f32[] constant(0), metadata={op_type="Relu" op_name="RGB/inception_i3d/Conv3d_2c_3x3/Relu"} %broadcast.201 = f32[1,16,28,28,192]{4,3,2,1,0} broadcast(f32[] %constant.200), dimensions={}, metadata={op_type="Relu" op_name="RGB/inception_i3d/Conv3d_2c_3x3/Relu"} %constant.134 = f32[] constant(0), metadata={op_type="Relu" op_name="RGB/inception_i3d/Conv3d_2b_1x1/Relu"} %broadcast.135 = f32[1,16,56,56,64]{4,3,2,1,0} broadcast(f32[] %constant.134), dimensions={}, metadata={op_type="Relu" op_name="RGB/inception_i3d/Conv3d_2b_1x1/Relu"} %constant.74 = f32[] constant(0), metadata={op_type="Relu" op_name="RGB/inception_i3d/Conv3d_1a_7x7/Relu"} %broadcast.75 = f32[1,16,56,56,64]{4,3,2,1,0} broadcast(f32[] %constant.74), dimensions={}, metadata={op_type="Relu" op_name="RGB/inception_i3d/Conv3d_1a_7x7/Relu"} %arg0.1 = f32[1,32,224,224,3]{4,3,2,1,0} parameter(0), parameter_replication={false}, metadata={op_name="XLA_Args"} %reshape.10 = f32[1,32,224,224,3]{4,3,2,1,0} reshape(f32[1,32,224,224,3]{4,3,2,1,0} %arg0.1) %arg2.3 = f32[7,7,7,3,64]{4,3,2,1,0} parameter(2), parameter_replication={false}, metadata={op_name="XLA_Args"} %convolution.11 = f32[1,16,112,112,64]{4,3,2,1,0} convolution(f32[1,32,224,224,3]{4,3,2,1,0} %reshape.10, f32[7,7,7,3,64]{4,3,2,1,0} %arg2.3), window={size=7x7x7 stride=2x2x2 pad=2_3x2_3x2_3}, dim_labels=b012f_012io->b012f, metadata={op_type="Conv3D" op_name="RGB/inception_i3d/Conv3d_1a_7x7/conv_3d/convolution"} %convert.12 = f32[1,16,112,112,64]{4,3,2,1,0} convert(f32[1,16,112,112,64]{4,3,2,1,0} %convolution.11), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %constant.13 = f32[] constant(0), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %convert.14 = f32[] convert(f32[] %constant.13), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %reduce.19 = f32[64]{0} reduce(f32[1,16,112,112,64]{4,3,2,1,0} %convert.12, f32[] %convert.14), dimensions={0,1,2,3}, to_apply=%RGB_inception_i3d_Conv3d_1a_7x7_batch_norm_normalize_moments_mean-reduction.15, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %get-dimension-size.20 = s32[] get-dimension-size(f32[1,16,112,112,64]{4,3,2,1,0} %convert.12), dimensions={0}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %get-dimension-size.21 = s32[] get-dimension-size(f32[1,16,112,112,64]{4,3,2,1,0} %convert.12), dimensions={1}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %multiply.22 = s32[] multiply(s32[] %get-dimension-size.20, s32[] %get-dimension-size.21), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %get-dimension-size.23 = s32[] get-dimension-size(f32[1,16,112,112,64]{4,3,2,1,0} %convert.12), dimensions={2}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %multiply.24 = s32[] multiply(s32[] %multiply.22, s32[] %get-dimension-size.23), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %get-dimension-size.25 = s32[] get-dimension-size(f32[1,16,112,112,64]{4,3,2,1,0} %convert.12), dimensions={3}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %multiply.26 = s32[] multiply(s32[] %multiply.24, s32[] %get-dimension-size.25), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %convert.27 = f32[] convert(s32[] %multiply.26), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %broadcast.28 = f32[64]{0} broadcast(f32[] %convert.27), dimensions={}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %divide.29 = f32[64]{0} divide(f32[64]{0} %reduce.19, f32[64]{0} %broadcast.28), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %convert.30 = f32[64]{0} convert(f32[64]{0} %divide.29), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %reshape.31 = f32[1,1,1,1,64]{4,3,2,1,0} reshape(f32[64]{0} %convert.30), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/mean"} %reshape.32 = f32[1,64]{1,0} reshape(f32[1,1,1,1,64]{4,3,2,1,0} %reshape.31), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/SquaredDifference"} %broadcast.33 = f32[1,16,112,112,64]{4,3,2,1,0} broadcast(f32[1,64]{1,0} %reshape.32), dimensions={0,4}, metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/SquaredDifference"} %subtract.34 = f32[1,16,112,112,64]{4,3,2,1,0} subtract(f32[1,16,112,112,64]{4,3,2,1,0} %broadcast.33, f32[1,16,112,112,64]{4,3,2,1,0} %convolution.11), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/SquaredDifference"} %multiply.35 = f32[1,16,112,112,64]{4,3,2,1,0} multiply(f32[1,16,112,112,64]{4,3,2,1,0} %subtract.34, f32[1,16,112,112,64]{4,3,2,1,0} %subtract.34), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/SquaredDifference"} %convert.36 = f32[1,16,112,112,64]{4,3,2,1,0} convert(f32[1,16,112,112,64]{4,3,2,1,0} %multiply.35), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %constant.37 = f32[] constant(0), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %convert.38 = f32[] convert(f32[] %constant.37), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %reduce.43 = f32[64]{0} reduce(f32[1,16,112,112,64]{4,3,2,1,0} %convert.36, f32[] %convert.38), dimensions={0,1,2,3}, to_apply=%RGB_inception_i3d_Conv3d_1a_7x7_batch_norm_normalize_moments_variance-reduction.39, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %get-dimension-size.44 = s32[] get-dimension-size(f32[1,16,112,112,64]{4,3,2,1,0} %convert.36), dimensions={0}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %get-dimension-size.45 = s32[] get-dimension-size(f32[1,16,112,112,64]{4,3,2,1,0} %convert.36), dimensions={1}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %multiply.46 = s32[] multiply(s32[] %get-dimension-size.44, s32[] %get-dimension-size.45), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %get-dimension-size.47 = s32[] get-dimension-size(f32[1,16,112,112,64]{4,3,2,1,0} %convert.36), dimensions={2}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %multiply.48 = s32[] multiply(s32[] %multiply.46, s32[] %get-dimension-size.47), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %get-dimension-size.49 = s32[] get-dimension-size(f32[1,16,112,112,64]{4,3,2,1,0} %convert.36), dimensions={3}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %multiply.50 = s32[] multiply(s32[] %multiply.48, s32[] %get-dimension-size.49), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %convert.51 = f32[] convert(s32[] %multiply.50), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %broadcast.52 = f32[64]{0} broadcast(f32[] %convert.51), dimensions={}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %divide.53 = f32[64]{0} divide(f32[64]{0} %reduce.43, f32[64]{0} %broadcast.52), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %convert.54 = f32[64]{0} convert(f32[64]{0} %divide.53), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %reshape.55 = f32[1,1,1,1,64]{4,3,2,1,0} reshape(f32[64]{0} %convert.54), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/normalize_moments/variance"} %constant.56 = f32[] constant(0.001), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/add"} %broadcast.57 = f32[1,1,1,1,64]{4,3,2,1,0} broadcast(f32[] %constant.56), dimensions={}, metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/add"} %add.58 = f32[1,1,1,1,64]{4,3,2,1,0} add(f32[1,1,1,1,64]{4,3,2,1,0} %reshape.55, f32[1,1,1,1,64]{4,3,2,1,0} %broadcast.57), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/add"} %rsqrt.59 = f32[1,1,1,1,64]{4,3,2,1,0} rsqrt(f32[1,1,1,1,64]{4,3,2,1,0} %add.58), metadata={op_type="Rsqrt" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/Rsqrt"} %reshape.60 = f32[1,64]{1,0} reshape(f32[1,1,1,1,64]{4,3,2,1,0} %rsqrt.59), metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/mul"} %broadcast.61 = f32[1,16,112,112,64]{4,3,2,1,0} broadcast(f32[1,64]{1,0} %reshape.60), dimensions={0,4}, metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/mul"} %multiply.62 = f32[1,16,112,112,64]{4,3,2,1,0} multiply(f32[1,16,112,112,64]{4,3,2,1,0} %broadcast.61, f32[1,16,112,112,64]{4,3,2,1,0} %convolution.11), metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/mul"} %arg4.5 = f32[1,1,1,1,64]{4,3,2,1,0} parameter(4), parameter_replication={false}, metadata={op_name="XLA_Args"} %multiply.63 = f32[1,1,1,1,64]{4,3,2,1,0} multiply(f32[1,1,1,1,64]{4,3,2,1,0} %rsqrt.59, f32[1,1,1,1,64]{4,3,2,1,0} %reshape.31), metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/mul_1"} %subtract.64 = f32[1,1,1,1,64]{4,3,2,1,0} subtract(f32[1,1,1,1,64]{4,3,2,1,0} %arg4.5, f32[1,1,1,1,64]{4,3,2,1,0} %multiply.63), metadata={op_type="Sub" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/sub"} %reshape.65 = f32[1,64]{1,0} reshape(f32[1,1,1,1,64]{4,3,2,1,0} %subtract.64), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/add_1"} %broadcast.66 = f32[1,16,112,112,64]{4,3,2,1,0} broadcast(f32[1,64]{1,0} %reshape.65), dimensions={0,4}, metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/add_1"} %add.67 = f32[1,16,112,112,64]{4,3,2,1,0} add(f32[1,16,112,112,64]{4,3,2,1,0} %multiply.62, f32[1,16,112,112,64]{4,3,2,1,0} %broadcast.66), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_1a_7x7/batch_norm/batch_norm/add_1"} %constant.68 = f32[] constant(-inf), metadata={op_type="MaxPool3D" op_name="RGB/inception_i3d/MaxPool3d_2a_3x3"} %reduce-window.73 = f32[1,16,56,56,64]{4,3,2,1,0} reduce-window(f32[1,16,112,112,64]{4,3,2,1,0} %add.67, f32[] %constant.68), window={size=1x1x3x3x1 stride=1x1x2x2x1 pad=0_0x0_0x0_1x0_1x0_0}, to_apply=%max_F32.69, metadata={op_type="MaxPool3D" op_name="RGB/inception_i3d/MaxPool3d_2a_3x3"} %maximum.76 = f32[1,16,56,56,64]{4,3,2,1,0} maximum(f32[1,16,56,56,64]{4,3,2,1,0} %broadcast.75, f32[1,16,56,56,64]{4,3,2,1,0} %reduce-window.73), metadata={op_type="Relu" op_name="RGB/inception_i3d/Conv3d_1a_7x7/Relu"} %arg6.7 = f32[1,1,1,64,64]{4,3,2,1,0} parameter(6), parameter_replication={false}, metadata={op_name="XLA_Args"} %convolution.77 = f32[1,16,56,56,64]{4,3,2,1,0} convolution(f32[1,16,56,56,64]{4,3,2,1,0} %maximum.76, f32[1,1,1,64,64]{4,3,2,1,0} %arg6.7), window={size=1x1x1}, dim_labels=b012f_012io->b012f, metadata={op_type="Conv3D" op_name="RGB/inception_i3d/Conv3d_2b_1x1/conv_3d/convolution"} %convert.78 = f32[1,16,56,56,64]{4,3,2,1,0} convert(f32[1,16,56,56,64]{4,3,2,1,0} %convolution.77), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %constant.79 = f32[] constant(0), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %convert.80 = f32[] convert(f32[] %constant.79), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %reduce.85 = f32[64]{0} reduce(f32[1,16,56,56,64]{4,3,2,1,0} %convert.78, f32[] %convert.80), dimensions={0,1,2,3}, to_apply=%RGB_inception_i3d_Conv3d_2b_1x1_batch_norm_normalize_moments_mean-reduction.81, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %get-dimension-size.86 = s32[] get-dimension-size(f32[1,16,56,56,64]{4,3,2,1,0} %convert.78), dimensions={0}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %get-dimension-size.87 = s32[] get-dimension-size(f32[1,16,56,56,64]{4,3,2,1,0} %convert.78), dimensions={1}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %multiply.88 = s32[] multiply(s32[] %get-dimension-size.86, s32[] %get-dimension-size.87), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %get-dimension-size.89 = s32[] get-dimension-size(f32[1,16,56,56,64]{4,3,2,1,0} %convert.78), dimensions={2}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %multiply.90 = s32[] multiply(s32[] %multiply.88, s32[] %get-dimension-size.89), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %get-dimension-size.91 = s32[] get-dimension-size(f32[1,16,56,56,64]{4,3,2,1,0} %convert.78), dimensions={3}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %multiply.92 = s32[] multiply(s32[] %multiply.90, s32[] %get-dimension-size.91), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %convert.93 = f32[] convert(s32[] %multiply.92), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %broadcast.94 = f32[64]{0} broadcast(f32[] %convert.93), dimensions={}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %divide.95 = f32[64]{0} divide(f32[64]{0} %reduce.85, f32[64]{0} %broadcast.94), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %convert.96 = f32[64]{0} convert(f32[64]{0} %divide.95), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %reshape.97 = f32[1,1,1,1,64]{4,3,2,1,0} reshape(f32[64]{0} %convert.96), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/mean"} %reshape.98 = f32[1,64]{1,0} reshape(f32[1,1,1,1,64]{4,3,2,1,0} %reshape.97), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/SquaredDifference"} %broadcast.99 = f32[1,16,56,56,64]{4,3,2,1,0} broadcast(f32[1,64]{1,0} %reshape.98), dimensions={0,4}, metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/SquaredDifference"} %subtract.100 = f32[1,16,56,56,64]{4,3,2,1,0} subtract(f32[1,16,56,56,64]{4,3,2,1,0} %broadcast.99, f32[1,16,56,56,64]{4,3,2,1,0} %convolution.77), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/SquaredDifference"} %multiply.101 = f32[1,16,56,56,64]{4,3,2,1,0} multiply(f32[1,16,56,56,64]{4,3,2,1,0} %subtract.100, f32[1,16,56,56,64]{4,3,2,1,0} %subtract.100), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/SquaredDifference"} %convert.102 = f32[1,16,56,56,64]{4,3,2,1,0} convert(f32[1,16,56,56,64]{4,3,2,1,0} %multiply.101), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %constant.103 = f32[] constant(0), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %convert.104 = f32[] convert(f32[] %constant.103), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %reduce.109 = f32[64]{0} reduce(f32[1,16,56,56,64]{4,3,2,1,0} %convert.102, f32[] %convert.104), dimensions={0,1,2,3}, to_apply=%RGB_inception_i3d_Conv3d_2b_1x1_batch_norm_normalize_moments_variance-reduction.105, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %get-dimension-size.110 = s32[] get-dimension-size(f32[1,16,56,56,64]{4,3,2,1,0} %convert.102), dimensions={0}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %get-dimension-size.111 = s32[] get-dimension-size(f32[1,16,56,56,64]{4,3,2,1,0} %convert.102), dimensions={1}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %multiply.112 = s32[] multiply(s32[] %get-dimension-size.110, s32[] %get-dimension-size.111), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %get-dimension-size.113 = s32[] get-dimension-size(f32[1,16,56,56,64]{4,3,2,1,0} %convert.102), dimensions={2}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %multiply.114 = s32[] multiply(s32[] %multiply.112, s32[] %get-dimension-size.113), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %get-dimension-size.115 = s32[] get-dimension-size(f32[1,16,56,56,64]{4,3,2,1,0} %convert.102), dimensions={3}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %multiply.116 = s32[] multiply(s32[] %multiply.114, s32[] %get-dimension-size.115), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %convert.117 = f32[] convert(s32[] %multiply.116), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %broadcast.118 = f32[64]{0} broadcast(f32[] %convert.117), dimensions={}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %divide.119 = f32[64]{0} divide(f32[64]{0} %reduce.109, f32[64]{0} %broadcast.118), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %convert.120 = f32[64]{0} convert(f32[64]{0} %divide.119), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %reshape.121 = f32[1,1,1,1,64]{4,3,2,1,0} reshape(f32[64]{0} %convert.120), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/normalize_moments/variance"} %constant.122 = f32[] constant(0.001), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/add"} %broadcast.123 = f32[1,1,1,1,64]{4,3,2,1,0} broadcast(f32[] %constant.122), dimensions={}, metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/add"} %add.124 = f32[1,1,1,1,64]{4,3,2,1,0} add(f32[1,1,1,1,64]{4,3,2,1,0} %reshape.121, f32[1,1,1,1,64]{4,3,2,1,0} %broadcast.123), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/add"} %rsqrt.125 = f32[1,1,1,1,64]{4,3,2,1,0} rsqrt(f32[1,1,1,1,64]{4,3,2,1,0} %add.124), metadata={op_type="Rsqrt" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/Rsqrt"} %reshape.126 = f32[1,64]{1,0} reshape(f32[1,1,1,1,64]{4,3,2,1,0} %rsqrt.125), metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/mul"} %broadcast.127 = f32[1,16,56,56,64]{4,3,2,1,0} broadcast(f32[1,64]{1,0} %reshape.126), dimensions={0,4}, metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/mul"} %multiply.128 = f32[1,16,56,56,64]{4,3,2,1,0} multiply(f32[1,16,56,56,64]{4,3,2,1,0} %broadcast.127, f32[1,16,56,56,64]{4,3,2,1,0} %convolution.77), metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/mul"} %arg3.4 = f32[1,1,1,1,64]{4,3,2,1,0} parameter(3), parameter_replication={false}, metadata={op_name="XLA_Args"} %multiply.129 = f32[1,1,1,1,64]{4,3,2,1,0} multiply(f32[1,1,1,1,64]{4,3,2,1,0} %rsqrt.125, f32[1,1,1,1,64]{4,3,2,1,0} %reshape.97), metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/mul_1"} %subtract.130 = f32[1,1,1,1,64]{4,3,2,1,0} subtract(f32[1,1,1,1,64]{4,3,2,1,0} %arg3.4, f32[1,1,1,1,64]{4,3,2,1,0} %multiply.129), metadata={op_type="Sub" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/sub"} %reshape.131 = f32[1,64]{1,0} reshape(f32[1,1,1,1,64]{4,3,2,1,0} %subtract.130), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/add_1"} %broadcast.132 = f32[1,16,56,56,64]{4,3,2,1,0} broadcast(f32[1,64]{1,0} %reshape.131), dimensions={0,4}, metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/add_1"} %add.133 = f32[1,16,56,56,64]{4,3,2,1,0} add(f32[1,16,56,56,64]{4,3,2,1,0} %multiply.128, f32[1,16,56,56,64]{4,3,2,1,0} %broadcast.132), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2b_1x1/batch_norm/batch_norm/add_1"} %maximum.136 = f32[1,16,56,56,64]{4,3,2,1,0} maximum(f32[1,16,56,56,64]{4,3,2,1,0} %broadcast.135, f32[1,16,56,56,64]{4,3,2,1,0} %add.133), metadata={op_type="Relu" op_name="RGB/inception_i3d/Conv3d_2b_1x1/Relu"} %arg7.8 = f32[3,3,3,64,192]{4,3,2,1,0} parameter(7), parameter_replication={false}, metadata={op_name="XLA_Args"} %convolution.137 = f32[1,16,56,56,192]{4,3,2,1,0} convolution(f32[1,16,56,56,64]{4,3,2,1,0} %maximum.136, f32[3,3,3,64,192]{4,3,2,1,0} %arg7.8), window={size=3x3x3 pad=1_1x1_1x1_1}, dim_labels=b012f_012io->b012f, metadata={op_type="Conv3D" op_name="RGB/inception_i3d/Conv3d_2c_3x3/conv_3d/convolution"} %convert.138 = f32[1,16,56,56,192]{4,3,2,1,0} convert(f32[1,16,56,56,192]{4,3,2,1,0} %convolution.137), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %constant.139 = f32[] constant(0), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %convert.140 = f32[] convert(f32[] %constant.139), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %reduce.145 = f32[192]{0} reduce(f32[1,16,56,56,192]{4,3,2,1,0} %convert.138, f32[] %convert.140), dimensions={0,1,2,3}, to_apply=%RGB_inception_i3d_Conv3d_2c_3x3_batch_norm_normalize_moments_mean-reduction.141, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %get-dimension-size.146 = s32[] get-dimension-size(f32[1,16,56,56,192]{4,3,2,1,0} %convert.138), dimensions={0}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %get-dimension-size.147 = s32[] get-dimension-size(f32[1,16,56,56,192]{4,3,2,1,0} %convert.138), dimensions={1}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %multiply.148 = s32[] multiply(s32[] %get-dimension-size.146, s32[] %get-dimension-size.147), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %get-dimension-size.149 = s32[] get-dimension-size(f32[1,16,56,56,192]{4,3,2,1,0} %convert.138), dimensions={2}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %multiply.150 = s32[] multiply(s32[] %multiply.148, s32[] %get-dimension-size.149), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %get-dimension-size.151 = s32[] get-dimension-size(f32[1,16,56,56,192]{4,3,2,1,0} %convert.138), dimensions={3}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %multiply.152 = s32[] multiply(s32[] %multiply.150, s32[] %get-dimension-size.151), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %convert.153 = f32[] convert(s32[] %multiply.152), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %broadcast.154 = f32[192]{0} broadcast(f32[] %convert.153), dimensions={}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %divide.155 = f32[192]{0} divide(f32[192]{0} %reduce.145, f32[192]{0} %broadcast.154), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %convert.156 = f32[192]{0} convert(f32[192]{0} %divide.155), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %reshape.157 = f32[1,1,1,1,192]{4,3,2,1,0} reshape(f32[192]{0} %convert.156), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/mean"} %reshape.158 = f32[1,192]{1,0} reshape(f32[1,1,1,1,192]{4,3,2,1,0} %reshape.157), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/SquaredDifference"} %broadcast.159 = f32[1,16,56,56,192]{4,3,2,1,0} broadcast(f32[1,192]{1,0} %reshape.158), dimensions={0,4}, metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/SquaredDifference"} %subtract.160 = f32[1,16,56,56,192]{4,3,2,1,0} subtract(f32[1,16,56,56,192]{4,3,2,1,0} %broadcast.159, f32[1,16,56,56,192]{4,3,2,1,0} %convolution.137), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/SquaredDifference"} %multiply.161 = f32[1,16,56,56,192]{4,3,2,1,0} multiply(f32[1,16,56,56,192]{4,3,2,1,0} %subtract.160, f32[1,16,56,56,192]{4,3,2,1,0} %subtract.160), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/SquaredDifference"} %convert.162 = f32[1,16,56,56,192]{4,3,2,1,0} convert(f32[1,16,56,56,192]{4,3,2,1,0} %multiply.161), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %constant.163 = f32[] constant(0), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %convert.164 = f32[] convert(f32[] %constant.163), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %reduce.169 = f32[192]{0} reduce(f32[1,16,56,56,192]{4,3,2,1,0} %convert.162, f32[] %convert.164), dimensions={0,1,2,3}, to_apply=%RGB_inception_i3d_Conv3d_2c_3x3_batch_norm_normalize_moments_variance-reduction.165, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %get-dimension-size.170 = s32[] get-dimension-size(f32[1,16,56,56,192]{4,3,2,1,0} %convert.162), dimensions={0}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %get-dimension-size.171 = s32[] get-dimension-size(f32[1,16,56,56,192]{4,3,2,1,0} %convert.162), dimensions={1}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %multiply.172 = s32[] multiply(s32[] %get-dimension-size.170, s32[] %get-dimension-size.171), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %get-dimension-size.173 = s32[] get-dimension-size(f32[1,16,56,56,192]{4,3,2,1,0} %convert.162), dimensions={2}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %multiply.174 = s32[] multiply(s32[] %multiply.172, s32[] %get-dimension-size.173), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %get-dimension-size.175 = s32[] get-dimension-size(f32[1,16,56,56,192]{4,3,2,1,0} %convert.162), dimensions={3}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %multiply.176 = s32[] multiply(s32[] %multiply.174, s32[] %get-dimension-size.175), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %convert.177 = f32[] convert(s32[] %multiply.176), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %broadcast.178 = f32[192]{0} broadcast(f32[] %convert.177), dimensions={}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %divide.179 = f32[192]{0} divide(f32[192]{0} %reduce.169, f32[192]{0} %broadcast.178), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %convert.180 = f32[192]{0} convert(f32[192]{0} %divide.179), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %reshape.181 = f32[1,1,1,1,192]{4,3,2,1,0} reshape(f32[192]{0} %convert.180), metadata={op_type="Mean" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/normalize_moments/variance"} %constant.182 = f32[] constant(0.001), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/add"} %broadcast.183 = f32[1,1,1,1,192]{4,3,2,1,0} broadcast(f32[] %constant.182), dimensions={}, metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/add"} %add.184 = f32[1,1,1,1,192]{4,3,2,1,0} add(f32[1,1,1,1,192]{4,3,2,1,0} %reshape.181, f32[1,1,1,1,192]{4,3,2,1,0} %broadcast.183), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/add"} %rsqrt.185 = f32[1,1,1,1,192]{4,3,2,1,0} rsqrt(f32[1,1,1,1,192]{4,3,2,1,0} %add.184), metadata={op_type="Rsqrt" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/Rsqrt"} %reshape.186 = f32[1,192]{1,0} reshape(f32[1,1,1,1,192]{4,3,2,1,0} %rsqrt.185), metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/mul"} %broadcast.187 = f32[1,16,56,56,192]{4,3,2,1,0} broadcast(f32[1,192]{1,0} %reshape.186), dimensions={0,4}, metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/mul"} %multiply.188 = f32[1,16,56,56,192]{4,3,2,1,0} multiply(f32[1,16,56,56,192]{4,3,2,1,0} %broadcast.187, f32[1,16,56,56,192]{4,3,2,1,0} %convolution.137), metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/mul"} %arg5.6 = f32[1,1,1,1,192]{4,3,2,1,0} parameter(5), parameter_replication={false}, metadata={op_name="XLA_Args"} %multiply.189 = f32[1,1,1,1,192]{4,3,2,1,0} multiply(f32[1,1,1,1,192]{4,3,2,1,0} %rsqrt.185, f32[1,1,1,1,192]{4,3,2,1,0} %reshape.157), metadata={op_type="Mul" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/mul_1"} %subtract.190 = f32[1,1,1,1,192]{4,3,2,1,0} subtract(f32[1,1,1,1,192]{4,3,2,1,0} %arg5.6, f32[1,1,1,1,192]{4,3,2,1,0} %multiply.189), metadata={op_type="Sub" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/sub"} %reshape.191 = f32[1,192]{1,0} reshape(f32[1,1,1,1,192]{4,3,2,1,0} %subtract.190), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/add_1"} %broadcast.192 = f32[1,16,56,56,192]{4,3,2,1,0} broadcast(f32[1,192]{1,0} %reshape.191), dimensions={0,4}, metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/add_1"} %add.193 = f32[1,16,56,56,192]{4,3,2,1,0} add(f32[1,16,56,56,192]{4,3,2,1,0} %multiply.188, f32[1,16,56,56,192]{4,3,2,1,0} %broadcast.192), metadata={op_type="Add" op_name="RGB/inception_i3d/Conv3d_2c_3x3/batch_norm/batch_norm/add_1"} %constant.194 = f32[] constant(-inf), metadata={op_type="MaxPool3D" op_name="RGB/inception_i3d/MaxPool3d_3a_3x3"} %reduce-window.199 = f32[1,16,28,28,192]{4,3,2,1,0} reduce-window(f32[1,16,56,56,192]{4,3,2,1,0} %add.193, f32[] %constant.194), window={size=1x1x3x3x1 stride=1x1x2x2x1 pad=0_0x0_0x0_1x0_1x0_0}, to_apply=%max_F32.195, metadata={op_type="MaxPool3D" op_name="RGB/inception_i3d/MaxPool3d_3a_3x3"} %maximum.202 = f32[1,16,28,28,192]{4,3,2,1,0} maximum(f32[1,16,28,28,192]{4,3,2,1,0} %broadcast.201, f32[1,16,28,28,192]{4,3,2,1,0} %reduce-window.199), metadata={op_type="Relu" op_name="RGB/inception_i3d/Conv3d_2c_3x3/Relu"} %arg8.9 = f32[1,1,1,192,64]{4,3,2,1,0} parameter(8), parameter_replication={false}, metadata={op_name="XLA_Args"} %convolution.203 = f32[1,16,28,28,64]{4,3,2,1,0} convolution(f32[1,16,28,28,192]{4,3,2,1,0} %maximum.202, f32[1,1,1,192,64]{4,3,2,1,0} %arg8.9), window={size=1x1x1}, dim_labels=b012f_012io->b012f, metadata={op_type="Conv3D" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/conv_3d/convolution"} %convert.204 = f32[1,16,28,28,64]{4,3,2,1,0} convert(f32[1,16,28,28,64]{4,3,2,1,0} %convolution.203), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %constant.205 = f32[] constant(0), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %convert.206 = f32[] convert(f32[] %constant.205), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %reduce.211 = f32[64]{0} reduce(f32[1,16,28,28,64]{4,3,2,1,0} %convert.204, f32[] %convert.206), dimensions={0,1,2,3}, to_apply=%RGB_inception_i3d_Mixed_3b_Branch_0_Conv3d_0a_1x1_batch_norm_normalize_moments_mean-reduction.207, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %get-dimension-size.212 = s32[] get-dimension-size(f32[1,16,28,28,64]{4,3,2,1,0} %convert.204), dimensions={0}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %get-dimension-size.213 = s32[] get-dimension-size(f32[1,16,28,28,64]{4,3,2,1,0} %convert.204), dimensions={1}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %multiply.214 = s32[] multiply(s32[] %get-dimension-size.212, s32[] %get-dimension-size.213), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %get-dimension-size.215 = s32[] get-dimension-size(f32[1,16,28,28,64]{4,3,2,1,0} %convert.204), dimensions={2}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %multiply.216 = s32[] multiply(s32[] %multiply.214, s32[] %get-dimension-size.215), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %get-dimension-size.217 = s32[] get-dimension-size(f32[1,16,28,28,64]{4,3,2,1,0} %convert.204), dimensions={3}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %multiply.218 = s32[] multiply(s32[] %multiply.216, s32[] %get-dimension-size.217), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %convert.219 = f32[] convert(s32[] %multiply.218), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %broadcast.220 = f32[64]{0} broadcast(f32[] %convert.219), dimensions={}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %divide.221 = f32[64]{0} divide(f32[64]{0} %reduce.211, f32[64]{0} %broadcast.220), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %convert.222 = f32[64]{0} convert(f32[64]{0} %divide.221), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %reshape.223 = f32[1,1,1,1,64]{4,3,2,1,0} reshape(f32[64]{0} %convert.222), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/mean"} %reshape.224 = f32[1,64]{1,0} reshape(f32[1,1,1,1,64]{4,3,2,1,0} %reshape.223), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/SquaredDifference"} %broadcast.225 = f32[1,16,28,28,64]{4,3,2,1,0} broadcast(f32[1,64]{1,0} %reshape.224), dimensions={0,4}, metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/SquaredDifference"} %subtract.226 = f32[1,16,28,28,64]{4,3,2,1,0} subtract(f32[1,16,28,28,64]{4,3,2,1,0} %broadcast.225, f32[1,16,28,28,64]{4,3,2,1,0} %convolution.203), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/SquaredDifference"} %multiply.227 = f32[1,16,28,28,64]{4,3,2,1,0} multiply(f32[1,16,28,28,64]{4,3,2,1,0} %subtract.226, f32[1,16,28,28,64]{4,3,2,1,0} %subtract.226), metadata={op_type="SquaredDifference" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/SquaredDifference"} %convert.228 = f32[1,16,28,28,64]{4,3,2,1,0} convert(f32[1,16,28,28,64]{4,3,2,1,0} %multiply.227), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %constant.229 = f32[] constant(0), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %convert.230 = f32[] convert(f32[] %constant.229), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %reduce.235 = f32[64]{0} reduce(f32[1,16,28,28,64]{4,3,2,1,0} %convert.228, f32[] %convert.230), dimensions={0,1,2,3}, to_apply=%RGB_inception_i3d_Mixed_3b_Branch_0_Conv3d_0a_1x1_batch_norm_normalize_moments_variance-reduction.231, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %get-dimension-size.236 = s32[] get-dimension-size(f32[1,16,28,28,64]{4,3,2,1,0} %convert.228), dimensions={0}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %get-dimension-size.237 = s32[] get-dimension-size(f32[1,16,28,28,64]{4,3,2,1,0} %convert.228), dimensions={1}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %multiply.238 = s32[] multiply(s32[] %get-dimension-size.236, s32[] %get-dimension-size.237), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %get-dimension-size.239 = s32[] get-dimension-size(f32[1,16,28,28,64]{4,3,2,1,0} %convert.228), dimensions={2}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %multiply.240 = s32[] multiply(s32[] %multiply.238, s32[] %get-dimension-size.239), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %get-dimension-size.241 = s32[] get-dimension-size(f32[1,16,28,28,64]{4,3,2,1,0} %convert.228), dimensions={3}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %multiply.242 = s32[] multiply(s32[] %multiply.240, s32[] %get-dimension-size.241), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %convert.243 = f32[] convert(s32[] %multiply.242), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %broadcast.244 = f32[64]{0} broadcast(f32[] %convert.243), dimensions={}, metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %divide.245 = f32[64]{0} divide(f32[64]{0} %reduce.235, f32[64]{0} %broadcast.244), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %convert.246 = f32[64]{0} convert(f32[64]{0} %divide.245), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %reshape.247 = f32[1,1,1,1,64]{4,3,2,1,0} reshape(f32[64]{0} %convert.246), metadata={op_type="Mean" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/normalize_moments/variance"} %add.250 = f32[1,1,1,1,64]{4,3,2,1,0} add(f32[1,1,1,1,64]{4,3,2,1,0} %broadcast.249, f32[1,1,1,1,64]{4,3,2,1,0} %reshape.247), metadata={op_type="Add" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/add"} %rsqrt.251 = f32[1,1,1,1,64]{4,3,2,1,0} rsqrt(f32[1,1,1,1,64]{4,3,2,1,0} %add.250), metadata={op_type="Rsqrt" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/Rsqrt"} %reshape.252 = f32[1,64]{1,0} reshape(f32[1,1,1,1,64]{4,3,2,1,0} %rsqrt.251), metadata={op_type="Mul" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/mul"} %broadcast.253 = f32[1,16,28,28,64]{4,3,2,1,0} broadcast(f32[1,64]{1,0} %reshape.252), dimensions={0,4}, metadata={op_type="Mul" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/mul"} %multiply.254 = f32[1,16,28,28,64]{4,3,2,1,0} multiply(f32[1,16,28,28,64]{4,3,2,1,0} %broadcast.253, f32[1,16,28,28,64]{4,3,2,1,0} %convolution.203), metadata={op_type="Mul" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/mul"} %arg1.2 = f32[1,1,1,1,64]{4,3,2,1,0} parameter(1), parameter_replication={false}, metadata={op_name="XLA_Args"} %multiply.255 = f32[1,1,1,1,64]{4,3,2,1,0} multiply(f32[1,1,1,1,64]{4,3,2,1,0} %rsqrt.251, f32[1,1,1,1,64]{4,3,2,1,0} %reshape.223), metadata={op_type="Mul" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/mul_1"} %subtract.256 = f32[1,1,1,1,64]{4,3,2,1,0} subtract(f32[1,1,1,1,64]{4,3,2,1,0} %arg1.2, f32[1,1,1,1,64]{4,3,2,1,0} %multiply.255), metadata={op_type="Sub" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/sub"} %reshape.257 = f32[1,64]{1,0} reshape(f32[1,1,1,1,64]{4,3,2,1,0} %subtract.256), metadata={op_type="Add" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/add_1"} %broadcast.258 = f32[1,16,28,28,64]{4,3,2,1,0} broadcast(f32[1,64]{1,0} %reshape.257), dimensions={0,4}, metadata={op_type="Add" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/add_1"} %add.259 = f32[1,16,28,28,64]{4,3,2,1,0} add(f32[1,16,28,28,64]{4,3,2,1,0} %multiply.254, f32[1,16,28,28,64]{4,3,2,1,0} %broadcast.258), metadata={op_type="Add" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/batch_norm/batch_norm/add_1"} %maximum.262 = f32[1,16,28,28,64]{4,3,2,1,0} maximum(f32[1,16,28,28,64]{4,3,2,1,0} %broadcast.261, f32[1,16,28,28,64]{4,3,2,1,0} %add.259), metadata={op_type="Relu" op_name="RGB/inception_i3d/Mixed_3b/Branch_0/Conv3d_0a_1x1/Relu"} %reshape.263 = f32[1,16,28,28,64]{4,3,2,1,0} reshape(f32[1,16,28,28,64]{4,3,2,1,0} %maximum.262), metadata={op_name="XLA_Retvals"} %tuple.264 = (f32[1,16,28,28,64]{4,3,2,1,0}) tuple(f32[1,16,28,28,64]{4,3,2,1,0} %reshape.263), metadata={op_name="XLA_Retvals"} ROOT %get-tuple-element.265 = f32[1,16,28,28,64]{4,3,2,1,0} get-tuple-element((f32[1,16,28,28,64]{4,3,2,1,0}) %tuple.264), index=0, metadata={op_name="XLA_Retvals"} } )"; hlo_module->ParseHloStringAndVerifyModule(hlo_text); CompileAndCheck(std::move(hlo_module), spec.filecheck_lines, testcase_pairs); } std::vector<I3DTestSpec> GetI3DTestCases() { std::vector<I3DTestSpec> result; result.push_back( {F32, R"(CHECK: func @hlo_module)"}); return result; } /**/ // TODO: INSTANTIATE_TEST_CASE_P was deprecated in favor for INSTANTIATE_TEST_SUITE_P, but the version of gtest that bazel links in is looking for INSTANTIATE_TEST_CASE_P right now. INSTANTIATE_TEST_CASE_P(All, PlaidMLI3DOperationTest, ::testing::ValuesIn(GetI3DTestCases()), I3DTestSpecToString); /**/ } // namespace } // namespace plaidml } // namespace xla
123.039352
357
0.737569
dgkutnic
b5e80b79e563ad815406eecfdc779dc136fc80e6
4,275
cpp
C++
3rdparty/g2o/g2o/apps/g2o_simulator/simutils.cpp
Refstop/VSLAM_Example
060b9419f79f035d1c9ebfa75ad46e2e9a53e992
[ "MIT" ]
null
null
null
3rdparty/g2o/g2o/apps/g2o_simulator/simutils.cpp
Refstop/VSLAM_Example
060b9419f79f035d1c9ebfa75ad46e2e9a53e992
[ "MIT" ]
null
null
null
3rdparty/g2o/g2o/apps/g2o_simulator/simutils.cpp
Refstop/VSLAM_Example
060b9419f79f035d1c9ebfa75ad46e2e9a53e992
[ "MIT" ]
null
null
null
// g2o - General Graph Optimization // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, H. Strasdat, W. Burgard // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "simutils.h" namespace g2o { // -1: outside // 0: p1Clipped // 1: p2clipped // 2: inside // 3: all clipped using namespace Eigen; int clipSegmentCircle(Eigen::Vector2d& p1, Eigen::Vector2d& p2, double r) { double r2 = r * r; Eigen::Vector2d pBase = p1; Eigen::Vector2d dp = p2 - p1; double length = dp.norm(); dp.normalize(); double p = 2 * dp.dot(p1); double q = p1.squaredNorm() - r2; double disc = p * p - 4 * q; if (disc <= 0) { // no intersection or single point intersection return -1; } disc = sqrt(disc); double t1 = .5 * (-p - disc); double t2 = .5 * (-p + disc); if (t1 > length || t2 < 0) return -1; // no intersection bool clip1 = false; bool clip2 = false; if (t1 > 0) { p1 = pBase + dp * t1; clip1 = true; } if (t2 < length) { p2 = pBase + dp * t1; clip2 = true; } if (clip1) if (clip2) return 3; else return 0; else if (clip2) return 1; return 2; } // -1: outside // 0: p1Clipped // 1: p2clipped // 2: inside int clipSegmentLine(Eigen::Vector2d& p1, Eigen::Vector2d& p2, double a, double b, double c) { bool p1inside = true; bool p2inside = true; if (a * p1.x() + b * p1.y() + c < 0) { p1inside = false; } if (a * p2.x() + b * p2.y() + c < 0) { p2inside = false; } if (p1inside && p2inside) return 2; if (!p1inside && !p2inside) return -1; Eigen::Vector2d dp = p2 - p1; double den = a * dp.x() + b * dp.y(); if (den == 0) return -1; double num = c + a * p1.x() + b * p1.y(); double t = -num / den; if (p1inside) { p2 = p1 + dp * t; return 1; } p1 = p1 + dp * t; return 0; } int clipSegmentFov(Eigen::Vector2d& p1, Eigen::Vector2d& p2, double min, double max) { bool clip1 = false, clip2 = false; // normal to the first line double amin = sin(min), bmin = -cos(min); int minClip = clipSegmentLine(p1, p2, amin, bmin, 0); switch (minClip) { case -1: return -1; case 0: clip1 = true; break; case 1: clip2 = true; break; default:; } // normal to the second line double amax = -sin(max), bmax = cos(max); int maxClip = clipSegmentLine(p1, p2, amax, bmax, 0); switch (maxClip) { case -1: return -1; case 0: clip1 = true; break; case 1: clip2 = true; break; default:; } if (clip1) if (clip2) return 3; else return 0; else if (clip2) return 1; return 2; } Eigen::Vector2d computeLineParameters(const Eigen::Vector2d& p1, const Eigen::Vector2d& p2) { Eigen::Vector2d lp; Eigen::Vector2d dp = p2 - p1; lp[0] = atan2(-dp.x(), dp.y()); Eigen::Vector2d n(cos(lp[0]), sin(lp[0])); lp[1] = n.dot(p1 + p2) * .5; return lp; } } // namespace g2o
27.056962
75
0.61731
Refstop
b5ead38bc228f2c217a8badfdeffb3ca9fc326ee
5,598
cpp
C++
SDK/Extras/VRML Reader/Source/VRML 1/VRML1 node handlers/CylinderV1ToObject.cpp
seanm/Quesa
b7bd607a5d04e7d90d3434208437ea392667c339
[ "BSD-3-Clause" ]
null
null
null
SDK/Extras/VRML Reader/Source/VRML 1/VRML1 node handlers/CylinderV1ToObject.cpp
seanm/Quesa
b7bd607a5d04e7d90d3434208437ea392667c339
[ "BSD-3-Clause" ]
null
null
null
SDK/Extras/VRML Reader/Source/VRML 1/VRML1 node handlers/CylinderV1ToObject.cpp
seanm/Quesa
b7bd607a5d04e7d90d3434208437ea392667c339
[ "BSD-3-Clause" ]
null
null
null
/* NAME: CylinderV1ToObject.cp DESCRIPTION: VRML 1 node handler. COPYRIGHT: Copyright (c) 2005, Quesa Developers. All rights reserved. For the current release of Quesa, please see: <https://github.com/jwwalker/Quesa> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: o Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. o 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. o Neither the name of Quesa nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ___________________________________________________________________________ */ #include "CylinderV1ToObject.h" #include "CVRMLReader.h" #include "IsKeyPresent.h" #include "GetIndexedMaterial.h" #include "PolyValue.h" #include "SVRML1State.h" #include "VRML_1_constants.h" #include "VRML-reader-prefix.h" #if __MACH__ #include <Quesa/QuesaGeometry.h> #include <Quesa/QuesaGroup.h> #else #include <QuesaGeometry.h> #include <QuesaGroup.h> #endif /*! @function CylinderV1ToObject @abstract Attempt to convert a VRML 1 Cylinder node to a Quesa object. @param ioNode Node to convert. @param inReader The reader object. @result An object reference, or NULL on failure. */ CQ3ObjectRef CylinderV1ToObject( PolyValue& ioNode, CVRMLReader& inReader ) { CQ3ObjectRef theCylinder; PolyValue::Dictionary& theDict( ioNode.GetDictionary() ); float radius = 1.0f; if (IsKeyPresent( theDict, "radius" )) { radius = theDict["radius"].GetFloat(); } float height = 2.0f; if (IsKeyPresent( theDict, "height" )) { height = theDict["height"].GetFloat(); } int partsMask = eVRML1Parts_ALL; if (IsKeyPresent( theDict, "parts" )) { partsMask = theDict["parts"].GetInt(); } bool hasBottom = ((partsMask & eVRML1Parts_BOTTOM) != 0); bool hasTop = ((partsMask & eVRML1Parts_TOP) != 0); bool hasSides = ((partsMask & eVRML1Parts_SIDES) != 0); int curMaterialBinding = inReader.GetVRML1State().materialBinding; bool isMultiColored = (curMaterialBinding == eVRML1Value_PER_PART) or (curMaterialBinding == eVRML1Value_PER_PART_INDEXED); TQ3CylinderData cylData = { { 0.0f, -height/2, 0.0f }, { 0.0f, height, 0.0f }, { 0.0f, 0.0f, radius }, { radius, 0.0f, 0.0f }, 0.0f, 1.0f, 0.0f, 1.0f, 0, NULL, NULL, NULL, NULL, NULL }; CQ3ObjectRef sideColor, bottomColor, topColor, allColor; if (isMultiColored) { sideColor = GetIndexedMaterial( inReader, 0 ); topColor = GetIndexedMaterial( inReader, 1 ); bottomColor = GetIndexedMaterial( inReader, 2 ); } else { allColor = GetIndexedMaterial( inReader, 0 ); } if (hasSides) { if (isMultiColored) { cylData.topAttributeSet = topColor.get(); cylData.faceAttributeSet = sideColor.get(); cylData.bottomAttributeSet = bottomColor.get(); } else { cylData.cylinderAttributeSet = allColor.get(); } if (hasTop) { cylData.caps |= kQ3EndCapMaskTop; } if (hasBottom) { cylData.caps |= kQ3EndCapMaskBottom; } theCylinder = CQ3ObjectRef( Q3Cylinder_New( &cylData ) ); } else if (hasTop or hasBottom) { theCylinder = CQ3ObjectRef( Q3DisplayGroup_New() ); ThrowIfNullQuesaOb_( theCylinder ); if (hasTop) { TQ3DiskData topData = { { 0.0f, height/2, 0.0f }, { 0.0f, 0.0f, radius }, { radius, 0.0f, 0.0f }, 0.0f, 1.0f, 0.0f, 1.0f, NULL }; if (isMultiColored) { topData.diskAttributeSet = topColor.get(); } else { topData.diskAttributeSet = allColor.get(); } CQ3ObjectRef topDisk( Q3Disk_New( &topData ) ); ThrowIfNullQuesaOb_( topDisk ); Q3Group_AddObject( theCylinder.get(), topDisk.get() ); } if (hasBottom) { TQ3DiskData bottomData = { { 0.0f, -height/2, 0.0f }, { radius, 0.0f, 0.0f }, { 0.0f, 0.0f, radius }, 0.0f, 1.0f, 0.0f, 1.0f, NULL }; if (isMultiColored) { bottomData.diskAttributeSet = bottomColor.get(); } else { bottomData.diskAttributeSet = allColor.get(); } CQ3ObjectRef bottomDisk( Q3Disk_New( &bottomData ) ); ThrowIfNullQuesaOb_( bottomDisk ); Q3Group_AddObject( theCylinder.get(), bottomDisk.get() ); } } return theCylinder; }
27.712871
80
0.672919
seanm
b5f689f7b6ffc9c9c60ca8842526aeb36040e5e8
481
cpp
C++
hdu/1000/1859.cpp
TheBadZhang/OJ
b5407f2483aa630068343b412ecaf3a9e3303f7e
[ "Apache-2.0" ]
1
2020-07-22T16:54:07.000Z
2020-07-22T16:54:07.000Z
hdu/1000/1859.cpp
TheBadZhang/OJ
b5407f2483aa630068343b412ecaf3a9e3303f7e
[ "Apache-2.0" ]
1
2018-05-12T12:53:06.000Z
2018-05-12T12:53:06.000Z
hdu/1000/1859.cpp
TheBadZhang/OJ
b5407f2483aa630068343b412ecaf3a9e3303f7e
[ "Apache-2.0" ]
null
null
null
#include <stdio.h> #include <algorithm> using namespace std; int x[1000], y[1000]; int i = 0; int main() { int flag; flag = 0; while (scanf("%d %d", &x[i], &y[i])) { if (x[i] == 0 && y[i] == 0 && flag == 0) break; if (x[i] != 0 || y[i] != 0) { i++; flag = 1; continue; } else if (x[i] == 0 && y[i] == 0) { sort(x, x + i); sort(y, y + i); printf("%d %d %d %d\n", x[0], y[0], x[i - 1], y[i - 1]); flag = 0; i = 0; continue; } } return 0; }
17.814815
59
0.432432
TheBadZhang
b5f75f4906652a7e5377488a829d028935a45a5a
1,892
cpp
C++
src/Scene/EntityComponent.cpp
Strife-AI/Strife.Engine
6b83e762f28acb3f4440d5b7763beccfd08dfc8f
[ "NCSA" ]
12
2020-12-27T22:13:58.000Z
2021-03-14T09:03:02.000Z
src/Scene/EntityComponent.cpp
Strife-AI/Strife.Engine
6b83e762f28acb3f4440d5b7763beccfd08dfc8f
[ "NCSA" ]
10
2021-01-14T15:14:31.000Z
2021-05-24T22:01:09.000Z
src/Scene/EntityComponent.cpp
Strife-AI/Strife.Engine
6b83e762f28acb3f4440d5b7763beccfd08dfc8f
[ "NCSA" ]
null
null
null
#include "EntityComponent.hpp" #include "Entity.hpp" #include "Scene.hpp" Scene* IEntityComponent::GetScene() const { return owner->scene; } void IEntityComponent::Render(Renderer* renderer) { componentFlags.ResetFlag(EntityComponentFlags::EnableRender); FlagsChanged(); } void IEntityComponent::FlagsChanged() { owner->scene->GetComponentManager().ScheduleToUpdateInterfaces(this); } void IEntityComponent::Update(float deltaTime) { componentFlags.ResetFlag(EntityComponentFlags::EnableUpdate); FlagsChanged(); } void IEntityComponent::FixedUpdate(float deltaTime) { componentFlags.ResetFlag(EntityComponentFlags::EnableFixedUpdate); FlagsChanged(); } IEntityComponent::IEntityComponent() : componentFlags({ EntityComponentFlags::EnableFixedUpdate, EntityComponentFlags::EnableUpdate, EntityComponentFlags::EnableRender }) { } void IEntityComponent::Register() { GetScene()->GetComponentManager().Register(this); } void EntityComponentManager::Register(IEntityComponent* component) { if (component->componentFlags.HasFlag(EntityComponentFlags::EnableUpdate)) updatables.insert(component); else updatables.erase(component); if (component->componentFlags.HasFlag(EntityComponentFlags::EnableRender)) renderables.insert(component); else renderables.erase(component); if (component->componentFlags.HasFlag(EntityComponentFlags::EnableFixedUpdate)) fixedUpdatables.insert(component); else fixedUpdatables.erase(component); } void EntityComponentManager::Unregister(IEntityComponent* component) { renderables.erase(component); updatables.erase(component); fixedUpdatables.erase(component); } void EntityComponentManager::ScheduleToUpdateInterfaces(IEntityComponent* component) { toBeUpdated.insert(component); } void EntityComponentManager::UpdateScheduledComponents() { for(auto component : toBeUpdated) { Register(component); } toBeUpdated.clear(); }
24.571429
134
0.805497
Strife-AI
b5fbd0561418ba437ba1a6d33b1d75f1656c6626
66
hpp
C++
module/buff/abstract_buff.hpp
PaPaPR/WolfVision
4092a313491349397106e3c050a332b2a5c6e611
[ "MIT" ]
null
null
null
module/buff/abstract_buff.hpp
PaPaPR/WolfVision
4092a313491349397106e3c050a332b2a5c6e611
[ "MIT" ]
null
null
null
module/buff/abstract_buff.hpp
PaPaPR/WolfVision
4092a313491349397106e3c050a332b2a5c6e611
[ "MIT" ]
null
null
null
#pragma once #include <fmt/core.h> namespace abstract_buff { }
8.25
25
0.712121
PaPaPR
b5fe23bea0248f24d30fc40d0d27832fbc9af81c
832,013
cpp
C++
src/main_1100.cpp
v0idp/virtuoso-codegen
6f560f04822c67f092d438a3f484249072c1d21d
[ "Unlicense" ]
null
null
null
src/main_1100.cpp
v0idp/virtuoso-codegen
6f560f04822c67f092d438a3f484249072c1d21d
[ "Unlicense" ]
null
null
null
src/main_1100.cpp
v0idp/virtuoso-codegen
6f560f04822c67f092d438a3f484249072c1d21d
[ "Unlicense" ]
1
2022-03-30T21:07:35.000Z
2022-03-30T21:07:35.000Z
// Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIButton #include "VROSC/UIButton.hpp" // Including type: UnityEngine.TextMesh #include "UnityEngine/TextMesh.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: VROSC.SimpleHaptic #include "VROSC/SimpleHaptic.hpp" // Including type: System.Action #include "System/Action.hpp" // Including type: VROSC.ClickData #include "VROSC/ClickData.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.TextMesh _label [[deprecated("Use field access instead!")]] ::UnityEngine::TextMesh*& VROSC::UIButton::dyn__label() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIButton::dyn__label"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_label"))->offset; return *reinterpret_cast<::UnityEngine::TextMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _tmpLabel [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::UIButton::dyn__tmpLabel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIButton::dyn__tmpLabel"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_tmpLabel"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.SimpleHaptic _hapticFeedBack [[deprecated("Use field access instead!")]] ::VROSC::SimpleHaptic*& VROSC::UIButton::dyn__hapticFeedBack() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIButton::dyn__hapticFeedBack"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hapticFeedBack"))->offset; return *reinterpret_cast<::VROSC::SimpleHaptic**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action OnButtonPress [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::UIButton::dyn_OnButtonPress() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIButton::dyn_OnButtonPress"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnButtonPress"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIButton.get_Text ::StringW VROSC::UIButton::get_Text() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIButton::get_Text"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Text", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIButton.Start void VROSC::UIButton::Start() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIButton::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: VROSC.UIButton.ButtonWasPressed void VROSC::UIButton::ButtonWasPressed(::VROSC::ClickData* clickData) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIButton::ButtonWasPressed"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIButton*), 11)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clickData); } // Autogenerated method: VROSC.UIButton.SetText void VROSC::UIButton::SetText(::StringW text) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIButton::SetText"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetText", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(text)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, text); } // Autogenerated method: VROSC.UIButton.get_InteractionStopsLaser bool VROSC::UIButton::get_InteractionStopsLaser() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIButton::get_InteractionStopsLaser"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIInteractable*), 10)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UIDataButton #include "VROSC/UIDataButton.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: VROSC.ClickData #include "VROSC/ClickData.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: private System.Object _data [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UIDataButton::dyn__data() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIDataButton::dyn__data"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_data"))->offset; return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<System.Object> OnButtonPress [[deprecated("Use field access instead!")]] ::System::Action_1<::Il2CppObject*>*& VROSC::UIDataButton::dyn_OnButtonPress() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIDataButton::dyn_OnButtonPress"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnButtonPress"))->offset; return *reinterpret_cast<::System::Action_1<::Il2CppObject*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIDataButton.SetData void VROSC::UIDataButton::SetData(::Il2CppObject* data) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIDataButton::SetData"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(data)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, data); } // Autogenerated method: VROSC.UIDataButton.ButtonWasPressed void VROSC::UIDataButton::ButtonWasPressed(::VROSC::ClickData* clickData) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIDataButton::ButtonWasPressed"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIButton*), 11)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clickData); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIHoldButton #include "VROSC/UIHoldButton.hpp" // Including type: VROSC.UIHoldButton/VROSC.<Pressing>d__20 #include "VROSC/UIHoldButton_-Pressing-d__20.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: VROSC.AdjustableMesh #include "VROSC/AdjustableMesh.hpp" // Including type: VROSC.SimpleHaptic #include "VROSC/SimpleHaptic.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: System.Action #include "System/Action.hpp" // Including type: VROSC.ClickData #include "VROSC/ClickData.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.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 TMPro.TextMeshPro _inProgressText [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::UIHoldButton::dyn__inProgressText() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__inProgressText"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inProgressText"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _pressTime [[deprecated("Use field access instead!")]] float& VROSC::UIHoldButton::dyn__pressTime() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__pressTime"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pressTime"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AdjustableMesh _adjustableMesh [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMesh*& VROSC::UIHoldButton::dyn__adjustableMesh() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__adjustableMesh"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_adjustableMesh"))->offset; return *reinterpret_cast<::VROSC::AdjustableMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _color [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::UIHoldButton::dyn__color() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__color"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_color"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _previewValue [[deprecated("Use field access instead!")]] float& VROSC::UIHoldButton::dyn__previewValue() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__previewValue"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_previewValue"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.SimpleHaptic _hapticFeedBack [[deprecated("Use field access instead!")]] ::VROSC::SimpleHaptic*& VROSC::UIHoldButton::dyn__hapticFeedBack() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__hapticFeedBack"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hapticFeedBack"))->offset; return *reinterpret_cast<::VROSC::SimpleHaptic**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _pressedFor [[deprecated("Use field access instead!")]] float& VROSC::UIHoldButton::dyn__pressedFor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__pressedFor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pressedFor"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _pressing [[deprecated("Use field access instead!")]] bool& VROSC::UIHoldButton::dyn__pressing() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__pressing"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pressing"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _pressCompleteToken [[deprecated("Use field access instead!")]] bool& VROSC::UIHoldButton::dyn__pressCompleteToken() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__pressCompleteToken"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pressCompleteToken"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InputDevice _heldBy [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UIHoldButton::dyn__heldBy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__heldBy"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_heldBy"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.TriggerButton _heldByButton [[deprecated("Use field access instead!")]] ::VROSC::TriggerButton& VROSC::UIHoldButton::dyn__heldByButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn__heldByButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_heldByButton"))->offset; return *reinterpret_cast<::VROSC::TriggerButton*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action OnPressCompleted [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::UIHoldButton::dyn_OnPressCompleted() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::dyn_OnPressCompleted"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnPressCompleted"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIHoldButton.OnEnable void VROSC::UIHoldButton::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::OnEnable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHoldButton.Update void VROSC::UIHoldButton::Update() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::Update"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHoldButton.Start void VROSC::UIHoldButton::Start() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::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: VROSC.UIHoldButton.OnDestroy void VROSC::UIHoldButton::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHoldButton.OnAnyPressEnd void VROSC::UIHoldButton::OnAnyPressEnd(::VROSC::InputDevice* device, ::VROSC::TriggerButton button) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::OnAnyPressEnd"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnAnyPressEnd", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(button)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, button); } // Autogenerated method: VROSC.UIHoldButton.ButtonWasPressed void VROSC::UIHoldButton::ButtonWasPressed(::VROSC::ClickData* clickData, bool pressed) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::ButtonWasPressed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ButtonWasPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(clickData), ::il2cpp_utils::ExtractType(pressed)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clickData, pressed); } // Autogenerated method: VROSC.UIHoldButton.Pressing ::System::Collections::IEnumerator* VROSC::UIHoldButton::Pressing(::VROSC::ClickData* clickData) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::Pressing"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Pressing", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(clickData)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, clickData); } // Autogenerated method: VROSC.UIHoldButton.SetValue void VROSC::UIHoldButton::SetValue(float value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::SetValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UIHoldButton.get_InteractionStopsLaser bool VROSC::UIHoldButton::get_InteractionStopsLaser() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::get_InteractionStopsLaser"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIInteractable*), 10)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UIHoldButton/VROSC.<Pressing>d__20 #include "VROSC/UIHoldButton_-Pressing-d__20.hpp" // Including type: VROSC.ClickData #include "VROSC/ClickData.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 [[deprecated("Use field access instead!")]] int& VROSC::UIHoldButton::$Pressing$d__20::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::$Pressing$d__20::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UIHoldButton::$Pressing$d__20::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::$Pressing$d__20::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UIHoldButton <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UIHoldButton*& VROSC::UIHoldButton::$Pressing$d__20::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::$Pressing$d__20::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<::VROSC::UIHoldButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.ClickData clickData [[deprecated("Use field access instead!")]] ::VROSC::ClickData*& VROSC::UIHoldButton::$Pressing$d__20::dyn_clickData() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::$Pressing$d__20::dyn_clickData"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "clickData"))->offset; return *reinterpret_cast<::VROSC::ClickData**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIHoldButton/VROSC.<Pressing>d__20.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UIHoldButton::$Pressing$d__20::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::$Pressing$d__20::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIHoldButton::$Pressing$d__20*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHoldButton/VROSC.<Pressing>d__20.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UIHoldButton::$Pressing$d__20::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::$Pressing$d__20::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIHoldButton::$Pressing$d__20*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHoldButton/VROSC.<Pressing>d__20.System.IDisposable.Dispose void VROSC::UIHoldButton::$Pressing$d__20::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::$Pressing$d__20::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIHoldButton::$Pressing$d__20*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHoldButton/VROSC.<Pressing>d__20.MoveNext bool VROSC::UIHoldButton::$Pressing$d__20::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::$Pressing$d__20::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIHoldButton::$Pressing$d__20*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHoldButton/VROSC.<Pressing>d__20.System.Collections.IEnumerator.Reset void VROSC::UIHoldButton::$Pressing$d__20::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHoldButton::$Pressing$d__20::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIHoldButton::$Pressing$d__20*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UISlideToggle #include "VROSC/UISlideToggle.hpp" // Including type: System.Action`2 #include "System/Action_2.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.AdjustableMesh #include "VROSC/AdjustableMesh.hpp" // Including type: VROSC.UI.UIColorGetter #include "VROSC/UI/UIColorGetter.hpp" // Including type: VROSC.SimpleHaptic #include "VROSC/SimpleHaptic.hpp" // Including type: VROSC.ClickData #include "VROSC/ClickData.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: private System.Boolean <IsOn>k__BackingField [[deprecated("Use field access instead!")]] bool& VROSC::UISlideToggle::dyn_$IsOn$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::dyn_$IsOn$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<IsOn>k__BackingField"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`2<VROSC.InputDevice,System.Boolean> OnToggle [[deprecated("Use field access instead!")]] ::System::Action_2<::VROSC::InputDevice*, bool>*& VROSC::UISlideToggle::dyn_OnToggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::dyn_OnToggle"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnToggle"))->offset; return *reinterpret_cast<::System::Action_2<::VROSC::InputDevice*, bool>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _startInOnState [[deprecated("Use field access instead!")]] bool& VROSC::UISlideToggle::dyn__startInOnState() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::dyn__startInOnState"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startInOnState"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AdjustableMesh _base [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMesh*& VROSC::UISlideToggle::dyn__base() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::dyn__base"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_base"))->offset; return *reinterpret_cast<::VROSC::AdjustableMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.UI.UIColorGetter _baseColorOn [[deprecated("Use field access instead!")]] ::VROSC::UI::UIColorGetter*& VROSC::UISlideToggle::dyn__baseColorOn() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::dyn__baseColorOn"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_baseColorOn"))->offset; return *reinterpret_cast<::VROSC::UI::UIColorGetter**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.UI.UIColorGetter _baseColorOff [[deprecated("Use field access instead!")]] ::VROSC::UI::UIColorGetter*& VROSC::UISlideToggle::dyn__baseColorOff() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::dyn__baseColorOff"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_baseColorOff"))->offset; return *reinterpret_cast<::VROSC::UI::UIColorGetter**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.UI.UIColorGetter _knobColor [[deprecated("Use field access instead!")]] ::VROSC::UI::UIColorGetter*& VROSC::UISlideToggle::dyn__knobColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::dyn__knobColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_knobColor"))->offset; return *reinterpret_cast<::VROSC::UI::UIColorGetter**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AdjustableMesh _knob [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMesh*& VROSC::UISlideToggle::dyn__knob() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::dyn__knob"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_knob"))->offset; return *reinterpret_cast<::VROSC::AdjustableMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.SimpleHaptic _hapticFeedBack [[deprecated("Use field access instead!")]] ::VROSC::SimpleHaptic*& VROSC::UISlideToggle::dyn__hapticFeedBack() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::dyn__hapticFeedBack"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hapticFeedBack"))->offset; return *reinterpret_cast<::VROSC::SimpleHaptic**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _isSet [[deprecated("Use field access instead!")]] bool& VROSC::UISlideToggle::dyn__isSet() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::dyn__isSet"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isSet"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISlideToggle.get_IsOn bool VROSC::UISlideToggle::get_IsOn() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::get_IsOn"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsOn", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlideToggle.set_IsOn void VROSC::UISlideToggle::set_IsOn(bool value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::set_IsOn"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_IsOn", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UISlideToggle.OnEnable void VROSC::UISlideToggle::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::OnEnable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlideToggle.Awake void VROSC::UISlideToggle::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::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: VROSC.UISlideToggle.OnDestroy void VROSC::UISlideToggle::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlideToggle.ButtonWasPressed void VROSC::UISlideToggle::ButtonWasPressed(::VROSC::ClickData* clickData) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::ButtonWasPressed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ButtonWasPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(clickData)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clickData); } // Autogenerated method: VROSC.UISlideToggle.SetToggled void VROSC::UISlideToggle::SetToggled(bool shouldBeActive, bool alsoInvoke) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::SetToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(shouldBeActive), ::il2cpp_utils::ExtractType(alsoInvoke)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, shouldBeActive, alsoInvoke); } // Autogenerated method: VROSC.UISlideToggle.SetColor void VROSC::UISlideToggle::SetColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::SetColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlideToggle.<Awake>b__17_0 void VROSC::UISlideToggle::$Awake$b__17_0(bool disabled) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::<Awake>b__17_0"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__17_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disabled)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disabled); } // Autogenerated method: VROSC.UISlideToggle.<Awake>b__17_1 void VROSC::UISlideToggle::$Awake$b__17_1(bool hovering) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::<Awake>b__17_1"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__17_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hovering)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, hovering); } // Autogenerated method: VROSC.UISlideToggle.<Awake>b__17_2 void VROSC::UISlideToggle::$Awake$b__17_2(bool interacting) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::<Awake>b__17_2"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__17_2", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(interacting)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, interacting); } // Autogenerated method: VROSC.UISlideToggle.get_InteractionStopsLaser bool VROSC::UISlideToggle::get_InteractionStopsLaser() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::get_InteractionStopsLaser"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIInteractable*), 10)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlideToggle.OnDisable void VROSC::UISlideToggle::OnDisable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlideToggle::OnDisable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::Interactable*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UISlider #include "VROSC/UISlider.hpp" // Including type: VROSC.UISlider/VROSC.<GrabSliderRemotely>d__17 #include "VROSC/UISlider_-GrabSliderRemotely-d__17.hpp" // Including type: VROSC.UISlider/VROSC.<GrabSlider>d__19 #include "VROSC/UISlider_-GrabSlider-d__19.hpp" // Including type: VROSC.UISliderData #include "VROSC/UISliderData.hpp" // Including type: UnityEngine.RectTransform #include "UnityEngine/RectTransform.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.ClickData #include "VROSC/ClickData.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.hpp" // Including type: UnityEngine.Vector3 #include "UnityEngine/Vector3.hpp" // Including type: UnityEngine.Vector2 #include "UnityEngine/Vector2.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 VROSC.UISliderData _data [[deprecated("Use field access instead!")]] ::VROSC::UISliderData*& VROSC::UISlider::dyn__data() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::dyn__data"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_data"))->offset; return *reinterpret_cast<::VROSC::UISliderData**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.RectTransform _sliderKnob [[deprecated("Use field access instead!")]] ::UnityEngine::RectTransform*& VROSC::UISlider::dyn__sliderKnob() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::dyn__sliderKnob"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_sliderKnob"))->offset; return *reinterpret_cast<::UnityEngine::RectTransform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _onlyShowKnobOnHover [[deprecated("Use field access instead!")]] bool& VROSC::UISlider::dyn__onlyShowKnobOnHover() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::dyn__onlyShowKnobOnHover"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_onlyShowKnobOnHover"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _showVisualPopout [[deprecated("Use field access instead!")]] bool& VROSC::UISlider::dyn__showVisualPopout() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::dyn__showVisualPopout"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_showVisualPopout"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InputDevice _grabbingDevice [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UISlider::dyn__grabbingDevice() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::dyn__grabbingDevice"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_grabbingDevice"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.TriggerButton _grabbingButton [[deprecated("Use field access instead!")]] ::VROSC::TriggerButton& VROSC::UISlider::dyn__grabbingButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::dyn__grabbingButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_grabbingButton"))->offset; return *reinterpret_cast<::VROSC::TriggerButton*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _remoteSliderActive [[deprecated("Use field access instead!")]] bool& VROSC::UISlider::dyn__remoteSliderActive() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::dyn__remoteSliderActive"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_remoteSliderActive"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.RectTransform _rectTransform [[deprecated("Use field access instead!")]] ::UnityEngine::RectTransform*& VROSC::UISlider::dyn__rectTransform() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::dyn__rectTransform"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rectTransform"))->offset; return *reinterpret_cast<::UnityEngine::RectTransform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISlider.get_Data ::VROSC::UISliderData* VROSC::UISlider::get_Data() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::get_Data"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Data", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::UISliderData*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider.HoverChanged void VROSC::UISlider::HoverChanged(bool hovering) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::HoverChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HoverChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hovering)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, hovering); } // Autogenerated method: VROSC.UISlider.StopGrabSlider void VROSC::UISlider::StopGrabSlider(::VROSC::InputDevice* device, ::VROSC::TriggerButton button) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::StopGrabSlider"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopGrabSlider", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(button)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, button); } // Autogenerated method: VROSC.UISlider.ButtonWasPressed void VROSC::UISlider::ButtonWasPressed(::VROSC::ClickData* clickData) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::ButtonWasPressed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ButtonWasPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(clickData)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clickData); } // Autogenerated method: VROSC.UISlider.GrabSliderRemotely ::System::Collections::IEnumerator* VROSC::UISlider::GrabSliderRemotely(::VROSC::InputDevice* device, ::VROSC::TriggerButton grabbingButton) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::GrabSliderRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GrabSliderRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(grabbingButton)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, device, grabbingButton); } // Autogenerated method: VROSC.UISlider.StopGrabRemotely void VROSC::UISlider::StopGrabRemotely(::VROSC::InputDevice* device) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::StopGrabRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopGrabRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device); } // Autogenerated method: VROSC.UISlider.GrabSlider ::System::Collections::IEnumerator* VROSC::UISlider::GrabSlider(::VROSC::InputDevice* device, ::VROSC::TriggerButton grabbingButton, bool pointing) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::GrabSlider"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GrabSlider", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(grabbingButton), ::il2cpp_utils::ExtractType(pointing)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, device, grabbingButton, pointing); } // Autogenerated method: VROSC.UISlider.GetValueByPosition float VROSC::UISlider::GetValueByPosition(::UnityEngine::Vector3 worldPosition) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::GetValueByPosition"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValueByPosition", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(worldPosition)}))); return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, worldPosition); } // Autogenerated method: VROSC.UISlider.GetRectTransform void VROSC::UISlider::GetRectTransform() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::GetRectTransform"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetRectTransform", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider.GetValueInRange float VROSC::UISlider::GetValueInRange(float normalizedValue) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::GetValueInRange"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValueInRange", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(normalizedValue)}))); return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, normalizedValue); } // Autogenerated method: VROSC.UISlider.GetNormalizedValue float VROSC::UISlider::GetNormalizedValue(float valueInRange) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::GetNormalizedValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetNormalizedValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(valueInRange)}))); return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, valueInRange); } // Autogenerated method: VROSC.UISlider.Awake void VROSC::UISlider::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::Awake"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 11)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider.OnDestroy void VROSC::UISlider::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::OnDestroy"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 13)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider.OnEnable void VROSC::UISlider::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::OnEnable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 12)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider.OnDisable void VROSC::UISlider::OnDisable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::OnDisable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider.GetSize ::UnityEngine::Vector2 VROSC::UISlider::GetSize() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::GetSize"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 15)); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector2, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider.SetValue void VROSC::UISlider::SetValue(float value, bool force, bool useCallback) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::SetValue"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 14)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, force, useCallback); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UISlider/VROSC.<GrabSliderRemotely>d__17 #include "VROSC/UISlider_-GrabSliderRemotely-d__17.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 [[deprecated("Use field access instead!")]] int& VROSC::UISlider::$GrabSliderRemotely$d__17::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSliderRemotely$d__17::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UISlider::$GrabSliderRemotely$d__17::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSliderRemotely$d__17::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UISlider <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::UISlider::$GrabSliderRemotely$d__17::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSliderRemotely$d__17::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<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.InputDevice device [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UISlider::$GrabSliderRemotely$d__17::dyn_device() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSliderRemotely$d__17::dyn_device"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "device"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.TriggerButton grabbingButton [[deprecated("Use field access instead!")]] ::VROSC::TriggerButton& VROSC::UISlider::$GrabSliderRemotely$d__17::dyn_grabbingButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSliderRemotely$d__17::dyn_grabbingButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "grabbingButton"))->offset; return *reinterpret_cast<::VROSC::TriggerButton*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISlider/VROSC.<GrabSliderRemotely>d__17.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UISlider::$GrabSliderRemotely$d__17::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSliderRemotely$d__17::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISlider::$GrabSliderRemotely$d__17*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider/VROSC.<GrabSliderRemotely>d__17.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UISlider::$GrabSliderRemotely$d__17::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSliderRemotely$d__17::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISlider::$GrabSliderRemotely$d__17*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider/VROSC.<GrabSliderRemotely>d__17.System.IDisposable.Dispose void VROSC::UISlider::$GrabSliderRemotely$d__17::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSliderRemotely$d__17::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISlider::$GrabSliderRemotely$d__17*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider/VROSC.<GrabSliderRemotely>d__17.MoveNext bool VROSC::UISlider::$GrabSliderRemotely$d__17::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSliderRemotely$d__17::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISlider::$GrabSliderRemotely$d__17*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider/VROSC.<GrabSliderRemotely>d__17.System.Collections.IEnumerator.Reset void VROSC::UISlider::$GrabSliderRemotely$d__17::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSliderRemotely$d__17::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISlider::$GrabSliderRemotely$d__17*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UISlider/VROSC.<GrabSlider>d__19 #include "VROSC/UISlider_-GrabSlider-d__19.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 [[deprecated("Use field access instead!")]] int& VROSC::UISlider::$GrabSlider$d__19::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UISlider::$GrabSlider$d__19::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UISlider <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::UISlider::$GrabSlider$d__19::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::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<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.InputDevice device [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UISlider::$GrabSlider$d__19::dyn_device() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::dyn_device"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "device"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.TriggerButton grabbingButton [[deprecated("Use field access instead!")]] ::VROSC::TriggerButton& VROSC::UISlider::$GrabSlider$d__19::dyn_grabbingButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::dyn_grabbingButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "grabbingButton"))->offset; return *reinterpret_cast<::VROSC::TriggerButton*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Boolean pointing [[deprecated("Use field access instead!")]] bool& VROSC::UISlider::$GrabSlider$d__19::dyn_pointing() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::dyn_pointing"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "pointing"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector3 <point>5__2 [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::UISlider::$GrabSlider$d__19::dyn_$point$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::dyn_$point$5__2"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<point>5__2"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISlider/VROSC.<GrabSlider>d__19.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UISlider::$GrabSlider$d__19::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISlider::$GrabSlider$d__19*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider/VROSC.<GrabSlider>d__19.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UISlider::$GrabSlider$d__19::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISlider::$GrabSlider$d__19*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider/VROSC.<GrabSlider>d__19.System.IDisposable.Dispose void VROSC::UISlider::$GrabSlider$d__19::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISlider::$GrabSlider$d__19*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider/VROSC.<GrabSlider>d__19.MoveNext bool VROSC::UISlider::$GrabSlider$d__19::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISlider::$GrabSlider$d__19*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISlider/VROSC.<GrabSlider>d__19.System.Collections.IEnumerator.Reset void VROSC::UISlider::$GrabSlider$d__19::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISlider::$GrabSlider$d__19::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISlider::$GrabSlider$d__19*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UISliderBase #include "VROSC/UISliderBase.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: VROSC.UI.UIColorGetter #include "VROSC/UI/UIColorGetter.hpp" // Including type: VROSC.AdjustableMesh #include "VROSC/AdjustableMesh.hpp" // Including type: VROSC.MinMaxFloat #include "VROSC/MinMaxFloat.hpp" // Including type: UnityEngine.Vector2 #include "UnityEngine/Vector2.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.Single <Value>k__BackingField [[deprecated("Use field access instead!")]] float& VROSC::UISliderBase::dyn_$Value$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::dyn_$Value$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Value>k__BackingField"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<System.Single> OnValueChanged [[deprecated("Use field access instead!")]] ::System::Action_1<float>*& VROSC::UISliderBase::dyn_OnValueChanged() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::dyn_OnValueChanged"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnValueChanged"))->offset; return *reinterpret_cast<::System::Action_1<float>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<System.Boolean> OnGrabbed [[deprecated("Use field access instead!")]] ::System::Action_1<bool>*& VROSC::UISliderBase::dyn_OnGrabbed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::dyn_OnGrabbed"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnGrabbed"))->offset; return *reinterpret_cast<::System::Action_1<bool>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.UI.UIColorGetter _sliderColor [[deprecated("Use field access instead!")]] ::VROSC::UI::UIColorGetter*& VROSC::UISliderBase::dyn__sliderColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::dyn__sliderColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_sliderColor"))->offset; return *reinterpret_cast<::VROSC::UI::UIColorGetter**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.AdjustableMesh _adjustableMesh [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMesh*& VROSC::UISliderBase::dyn__adjustableMesh() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::dyn__adjustableMesh"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_adjustableMesh"))->offset; return *reinterpret_cast<::VROSC::AdjustableMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.MinMaxFloat _uvRange [[deprecated("Use field access instead!")]] ::VROSC::MinMaxFloat*& VROSC::UISliderBase::dyn__uvRange() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::dyn__uvRange"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_uvRange"))->offset; return *reinterpret_cast<::VROSC::MinMaxFloat**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _preview [[deprecated("Use field access instead!")]] float& VROSC::UISliderBase::dyn__preview() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::dyn__preview"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_preview"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISliderBase.get_Value float VROSC::UISliderBase::get_Value() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::get_Value"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Value", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderBase.set_Value void VROSC::UISliderBase::set_Value(float value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::set_Value"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Value", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UISliderBase.get_Size ::UnityEngine::Vector2 VROSC::UISliderBase::get_Size() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::get_Size"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Size", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector2, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderBase.Awake void VROSC::UISliderBase::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::Awake"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 11)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderBase.OnEnable void VROSC::UISliderBase::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::OnEnable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 12)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderBase.OnDestroy void VROSC::UISliderBase::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::OnDestroy"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 13)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderBase.SetValue void VROSC::UISliderBase::SetValue(float value, bool force, bool useCallback) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::SetValue"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 14)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, force, useCallback); } // Autogenerated method: VROSC.UISliderBase.SetColor void VROSC::UISliderBase::SetColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::SetColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderBase.OnDrawGizmos void VROSC::UISliderBase::OnDrawGizmos() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::OnDrawGizmos"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDrawGizmos", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderBase.GetSize ::UnityEngine::Vector2 VROSC::UISliderBase::GetSize() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::GetSize"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 15)); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector2, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderBase.get_InteractionStopsLaser bool VROSC::UISliderBase::get_InteractionStopsLaser() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::get_InteractionStopsLaser"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIInteractable*), 10)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderBase.OnDisable void VROSC::UISliderBase::OnDisable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::OnDisable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::Interactable*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderBase.SetDisabled void VROSC::UISliderBase::SetDisabled(::Il2CppObject* disabler, bool shouldBeDisabled) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderBase::SetDisabled"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::Interactable*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disabler, shouldBeDisabled); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UISpinner #include "VROSC/UISpinner.hpp" // Including type: VROSC.UISpinner/VROSC.<GrabSpinnerRemotely>d__33 #include "VROSC/UISpinner_-GrabSpinnerRemotely-d__33.hpp" // Including type: VROSC.UIButton #include "VROSC/UIButton.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: VROSC.UISpinnerData #include "VROSC/UISpinnerData.hpp" // Including type: UnityEngine.RectTransform #include "UnityEngine/RectTransform.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.MinMaxInt #include "VROSC/MinMaxInt.hpp" // Including type: UnityEngine.Vector2 #include "UnityEngine/Vector2.hpp" // Including type: VROSC.ClickData #include "VROSC/ClickData.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.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.Boolean InverseSpinners bool VROSC::UISpinner::_get_InverseSpinners() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::_get_InverseSpinners"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("VROSC", "UISpinner", "InverseSpinners")); } // Autogenerated static field setter // Set static field: static public System.Boolean InverseSpinners void VROSC::UISpinner::_set_InverseSpinners(bool value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::_set_InverseSpinners"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "UISpinner", "InverseSpinners", value)); } // Autogenerated instance field getter // Get instance field: private System.Boolean <IsGrabbingRemotely>k__BackingField [[deprecated("Use field access instead!")]] bool& VROSC::UISpinner::dyn_$IsGrabbingRemotely$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn_$IsGrabbingRemotely$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<IsGrabbingRemotely>k__BackingField"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 <Selection>k__BackingField [[deprecated("Use field access instead!")]] int& VROSC::UISpinner::dyn_$Selection$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn_$Selection$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Selection>k__BackingField"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single <Value>k__BackingField [[deprecated("Use field access instead!")]] float& VROSC::UISpinner::dyn_$Value$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn_$Value$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Value>k__BackingField"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.UIButton _nextButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::UISpinner::dyn__nextButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn__nextButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_nextButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.UIButton _previousButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::UISpinner::dyn__previousButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn__previousButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_previousButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<System.Int32> OnSelectionChanged [[deprecated("Use field access instead!")]] ::System::Action_1<int>*& VROSC::UISpinner::dyn_OnSelectionChanged() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn_OnSelectionChanged"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnSelectionChanged"))->offset; return *reinterpret_cast<::System::Action_1<int>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _valueDisplay [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::UISpinner::dyn__valueDisplay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn__valueDisplay"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valueDisplay"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISpinnerData _data [[deprecated("Use field access instead!")]] ::VROSC::UISpinnerData*& VROSC::UISpinner::dyn__data() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn__data"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_data"))->offset; return *reinterpret_cast<::VROSC::UISpinnerData**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.RectTransform _sizeTransform [[deprecated("Use field access instead!")]] ::UnityEngine::RectTransform*& VROSC::UISpinner::dyn__sizeTransform() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn__sizeTransform"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_sizeTransform"))->offset; return *reinterpret_cast<::UnityEngine::RectTransform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InputDevice _grabbingDevice [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UISpinner::dyn__grabbingDevice() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn__grabbingDevice"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_grabbingDevice"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.MinMaxInt _remapValue [[deprecated("Use field access instead!")]] ::VROSC::MinMaxInt*& VROSC::UISpinner::dyn__remapValue() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn__remapValue"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_remapValue"))->offset; return *reinterpret_cast<::VROSC::MinMaxInt**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.TriggerButton _grabbingButton [[deprecated("Use field access instead!")]] ::VROSC::TriggerButton& VROSC::UISpinner::dyn__grabbingButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::dyn__grabbingButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_grabbingButton"))->offset; return *reinterpret_cast<::VROSC::TriggerButton*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISpinner.get_IsGrabbingRemotely bool VROSC::UISpinner::get_IsGrabbingRemotely() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::get_IsGrabbingRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsGrabbingRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.set_IsGrabbingRemotely void VROSC::UISpinner::set_IsGrabbingRemotely(bool value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::set_IsGrabbingRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_IsGrabbingRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UISpinner.get_Selection int VROSC::UISpinner::get_Selection() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::get_Selection"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Selection", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.set_Selection void VROSC::UISpinner::set_Selection(int value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::set_Selection"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Selection", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UISpinner.get_Value float VROSC::UISpinner::get_Value() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::get_Value"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Value", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.set_Value void VROSC::UISpinner::set_Value(float value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::set_Value"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Value", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UISpinner.get_Size ::UnityEngine::Vector2 VROSC::UISpinner::get_Size() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::get_Size"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Size", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector2, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.get_Data ::VROSC::UISpinnerData* VROSC::UISpinner::get_Data() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::get_Data"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Data", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::UISpinnerData*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner..cctor void VROSC::UISpinner::_cctor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::.cctor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "UISpinner", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method); } // Autogenerated method: VROSC.UISpinner.Start void VROSC::UISpinner::Start() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::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: VROSC.UISpinner.OnEnable void VROSC::UISpinner::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::OnEnable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.Setup void VROSC::UISpinner::Setup(::VROSC::MinMaxInt* remapValue, int startValue) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(remapValue), ::il2cpp_utils::ExtractType(startValue)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, remapValue, startValue); } // Autogenerated method: VROSC.UISpinner.ButtonWasPressed void VROSC::UISpinner::ButtonWasPressed(::VROSC::ClickData* clickData, bool pressed) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::ButtonWasPressed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ButtonWasPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(clickData), ::il2cpp_utils::ExtractType(pressed)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clickData, pressed); } // Autogenerated method: VROSC.UISpinner.GrabSpinnerRemotely ::System::Collections::IEnumerator* VROSC::UISpinner::GrabSpinnerRemotely(::VROSC::InputDevice* device, ::VROSC::TriggerButton grabbingButton) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::GrabSpinnerRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GrabSpinnerRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(grabbingButton)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, device, grabbingButton); } // Autogenerated method: VROSC.UISpinner.StopGrabSpinnerRemotely void VROSC::UISpinner::StopGrabSpinnerRemotely(::VROSC::InputDevice* device) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::StopGrabSpinnerRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopGrabSpinnerRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device); } // Autogenerated method: VROSC.UISpinner.StopGrabSpinner void VROSC::UISpinner::StopGrabSpinner(::VROSC::InputDevice* device, ::VROSC::TriggerButton button) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::StopGrabSpinner"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopGrabSpinner", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(button)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, button); } // Autogenerated method: VROSC.UISpinner.SetRemappedValue void VROSC::UISpinner::SetRemappedValue(int value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::SetRemappedValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetRemappedValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UISpinner.SetSelectedIndex void VROSC::UISpinner::SetSelectedIndex(int index, bool force, bool useCallback) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::SetSelectedIndex"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetSelectedIndex", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(force), ::il2cpp_utils::ExtractType(useCallback)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, index, force, useCallback); } // Autogenerated method: VROSC.UISpinner.SetFloatValue void VROSC::UISpinner::SetFloatValue(float value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::SetFloatValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetFloatValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UISpinner.Next void VROSC::UISpinner::Next() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::Next"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Next", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.Previous void VROSC::UISpinner::Previous() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::Previous"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Previous", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.SetButtonsDisabled void VROSC::UISpinner::SetButtonsDisabled(bool disabled) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::SetButtonsDisabled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetButtonsDisabled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disabled)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disabled); } // Autogenerated method: VROSC.UISpinner.GetSize ::UnityEngine::Vector2 VROSC::UISpinner::GetSize() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::GetSize"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetSize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector2, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.OnDrawGizmos void VROSC::UISpinner::OnDrawGizmos() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::OnDrawGizmos"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDrawGizmos", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.get_InteractionStopsLaser bool VROSC::UISpinner::get_InteractionStopsLaser() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::get_InteractionStopsLaser"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIInteractable*), 10)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.OnDisable void VROSC::UISpinner::OnDisable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::OnDisable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::Interactable*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner.SetDisabled void VROSC::UISpinner::SetDisabled(::Il2CppObject* disabler, bool shouldBeDisabled) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::SetDisabled"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::Interactable*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disabler, shouldBeDisabled); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UISpinner/VROSC.<GrabSpinnerRemotely>d__33 #include "VROSC/UISpinner_-GrabSpinnerRemotely-d__33.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 [[deprecated("Use field access instead!")]] int& VROSC::UISpinner::$GrabSpinnerRemotely$d__33::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::$GrabSpinnerRemotely$d__33::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UISpinner::$GrabSpinnerRemotely$d__33::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::$GrabSpinnerRemotely$d__33::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UISpinner <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UISpinner*& VROSC::UISpinner::$GrabSpinnerRemotely$d__33::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::$GrabSpinnerRemotely$d__33::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<::VROSC::UISpinner**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.InputDevice device [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UISpinner::$GrabSpinnerRemotely$d__33::dyn_device() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::$GrabSpinnerRemotely$d__33::dyn_device"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "device"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.TriggerButton grabbingButton [[deprecated("Use field access instead!")]] ::VROSC::TriggerButton& VROSC::UISpinner::$GrabSpinnerRemotely$d__33::dyn_grabbingButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::$GrabSpinnerRemotely$d__33::dyn_grabbingButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "grabbingButton"))->offset; return *reinterpret_cast<::VROSC::TriggerButton*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISpinner/VROSC.<GrabSpinnerRemotely>d__33.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UISpinner::$GrabSpinnerRemotely$d__33::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::$GrabSpinnerRemotely$d__33::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISpinner::$GrabSpinnerRemotely$d__33*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner/VROSC.<GrabSpinnerRemotely>d__33.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UISpinner::$GrabSpinnerRemotely$d__33::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::$GrabSpinnerRemotely$d__33::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISpinner::$GrabSpinnerRemotely$d__33*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner/VROSC.<GrabSpinnerRemotely>d__33.System.IDisposable.Dispose void VROSC::UISpinner::$GrabSpinnerRemotely$d__33::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::$GrabSpinnerRemotely$d__33::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISpinner::$GrabSpinnerRemotely$d__33*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner/VROSC.<GrabSpinnerRemotely>d__33.MoveNext bool VROSC::UISpinner::$GrabSpinnerRemotely$d__33::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::$GrabSpinnerRemotely$d__33::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISpinner::$GrabSpinnerRemotely$d__33*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinner/VROSC.<GrabSpinnerRemotely>d__33.System.Collections.IEnumerator.Reset void VROSC::UISpinner::$GrabSpinnerRemotely$d__33::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinner::$GrabSpinnerRemotely$d__33::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISpinner::$GrabSpinnerRemotely$d__33*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIToggle #include "VROSC/UIToggle.hpp" // Including type: System.Action`2 #include "System/Action_2.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: UnityEngine.GameObject #include "UnityEngine/GameObject.hpp" // Including type: VROSC.SimpleHaptic #include "VROSC/SimpleHaptic.hpp" // Including type: VROSC.ClickData #include "VROSC/ClickData.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: private System.Boolean <IsOn>k__BackingField [[deprecated("Use field access instead!")]] bool& VROSC::UIToggle::dyn_$IsOn$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::dyn_$IsOn$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<IsOn>k__BackingField"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`2<VROSC.InputDevice,System.Boolean> OnToggle [[deprecated("Use field access instead!")]] ::System::Action_2<::VROSC::InputDevice*, bool>*& VROSC::UIToggle::dyn_OnToggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::dyn_OnToggle"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnToggle"))->offset; return *reinterpret_cast<::System::Action_2<::VROSC::InputDevice*, bool>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _tmpLabel [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::UIToggle::dyn__tmpLabel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::dyn__tmpLabel"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_tmpLabel"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _startInOnState [[deprecated("Use field access instead!")]] bool& VROSC::UIToggle::dyn__startInOnState() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::dyn__startInOnState"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startInOnState"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _toggleObject [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::UIToggle::dyn__toggleObject() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::dyn__toggleObject"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_toggleObject"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.SimpleHaptic _hapticFeedBack [[deprecated("Use field access instead!")]] ::VROSC::SimpleHaptic*& VROSC::UIToggle::dyn__hapticFeedBack() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::dyn__hapticFeedBack"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hapticFeedBack"))->offset; return *reinterpret_cast<::VROSC::SimpleHaptic**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _isSet [[deprecated("Use field access instead!")]] bool& VROSC::UIToggle::dyn__isSet() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::dyn__isSet"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isSet"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIToggle.get_IsOn bool VROSC::UIToggle::get_IsOn() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::get_IsOn"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsOn", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIToggle.set_IsOn void VROSC::UIToggle::set_IsOn(bool value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::set_IsOn"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_IsOn", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UIToggle.Awake void VROSC::UIToggle::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::Awake"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIToggle*), 11)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIToggle.OnDestroy void VROSC::UIToggle::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIToggle.ButtonWasPressed void VROSC::UIToggle::ButtonWasPressed(::VROSC::ClickData* clickData) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::ButtonWasPressed"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIToggle*), 12)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clickData); } // Autogenerated method: VROSC.UIToggle.SetToggled void VROSC::UIToggle::SetToggled(bool shouldBeActive, bool alsoInvoke) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::SetToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(shouldBeActive), ::il2cpp_utils::ExtractType(alsoInvoke)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, shouldBeActive, alsoInvoke); } // Autogenerated method: VROSC.UIToggle.SetText void VROSC::UIToggle::SetText(::StringW text) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::SetText"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetText", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(text)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, text); } // Autogenerated method: VROSC.UIToggle.get_InteractionStopsLaser bool VROSC::UIToggle::get_InteractionStopsLaser() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIToggle::get_InteractionStopsLaser"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIInteractable*), 10)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIInteractable #include "VROSC/UIInteractable.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: VROSC.UIInteractable.get_InteractionStopsLaser bool VROSC::UIInteractable::get_InteractionStopsLaser() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractable::get_InteractionStopsLaser"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::Clickable*), 10)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIInteractableColorSettings #include "VROSC/UIInteractableColorSettings.hpp" // Including type: VROSC.UIScrollableItem #include "VROSC/UIScrollableItem.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.Color _activeColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::UIInteractableColorSettings::dyn__activeColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractableColorSettings::dyn__activeColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_activeColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _inactiveColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::UIInteractableColorSettings::dyn__inactiveColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractableColorSettings::dyn__inactiveColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inactiveColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _hoverColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::UIInteractableColorSettings::dyn__hoverColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractableColorSettings::dyn__hoverColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hoverColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _disabledColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::UIInteractableColorSettings::dyn__disabledColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractableColorSettings::dyn__disabledColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_disabledColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIInteractableColorSettings.get_ActiveColor ::UnityEngine::Color VROSC::UIInteractableColorSettings::get_ActiveColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractableColorSettings::get_ActiveColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ActiveColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIInteractableColorSettings.get_InactiveColor ::UnityEngine::Color VROSC::UIInteractableColorSettings::get_InactiveColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractableColorSettings::get_InactiveColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InactiveColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIInteractableColorSettings.get_HoverColor ::UnityEngine::Color VROSC::UIInteractableColorSettings::get_HoverColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractableColorSettings::get_HoverColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_HoverColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIInteractableColorSettings.get_DisabledColor ::UnityEngine::Color VROSC::UIInteractableColorSettings::get_DisabledColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractableColorSettings::get_DisabledColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DisabledColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIInteractableColorSettings.GetColor ::UnityEngine::Color VROSC::UIInteractableColorSettings::GetColor(bool isHovering, bool isActive, bool isDisabled) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractableColorSettings::GetColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(isHovering), ::il2cpp_utils::ExtractType(isActive), ::il2cpp_utils::ExtractType(isDisabled)}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method, isHovering, isActive, isDisabled); } // Autogenerated method: VROSC.UIInteractableColorSettings.GetColor ::UnityEngine::Color VROSC::UIInteractableColorSettings::GetColor(::VROSC::UIScrollableItem* selectionBarButton) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIInteractableColorSettings::GetColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(selectionBarButton)}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method, selectionBarButton); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UISchemeController #include "VROSC/UISchemeController.hpp" // Including type: VROSC.UI.UIScheme #include "VROSC/UI/UIScheme.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 VROSC.UI.UIScheme _uIScheme [[deprecated("Use field access instead!")]] ::VROSC::UI::UIScheme*& VROSC::UISchemeController::dyn__uIScheme() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISchemeController::dyn__uIScheme"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_uIScheme"))->offset; return *reinterpret_cast<::VROSC::UI::UIScheme**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISchemeController.get_UIScheme ::VROSC::UI::UIScheme* VROSC::UISchemeController::get_UIScheme() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISchemeController::get_UIScheme"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UIScheme", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::UI::UIScheme*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISchemeController.Setup void VROSC::UISchemeController::Setup() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISchemeController::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", 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: VROSC.TextSpinner #include "VROSC/TextSpinner.hpp" // Including type: VROSC.TextSpinnerItem #include "VROSC/TextSpinnerItem.hpp" // Including type: VROSC.MinMaxFloat #include "VROSC/MinMaxFloat.hpp" // Including type: UnityEngine.Transform #include "UnityEngine/Transform.hpp" // Including type: UnityEngine.AnimationCurve #include "UnityEngine/AnimationCurve.hpp" // Including type: VROSC.SimpleHaptic #include "VROSC/SimpleHaptic.hpp" // Including type: System.Collections.Generic.List`1 #include "System/Collections/Generic/List_1.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 <SelectedValue>k__BackingField [[deprecated("Use field access instead!")]] int& VROSC::TextSpinner::dyn_$SelectedValue$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn_$SelectedValue$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<SelectedValue>k__BackingField"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _maxDisplay [[deprecated("Use field access instead!")]] int& VROSC::TextSpinner::dyn__maxDisplay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__maxDisplay"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_maxDisplay"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.TextSpinnerItem _valuePrefab [[deprecated("Use field access instead!")]] ::VROSC::TextSpinnerItem*& VROSC::TextSpinner::dyn__valuePrefab() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__valuePrefab"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valuePrefab"))->offset; return *reinterpret_cast<::VROSC::TextSpinnerItem**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.MinMaxFloat _rotationRange [[deprecated("Use field access instead!")]] ::VROSC::MinMaxFloat*& VROSC::TextSpinner::dyn__rotationRange() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__rotationRange"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rotationRange"))->offset; return *reinterpret_cast<::VROSC::MinMaxFloat**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _maxVisibleAngle [[deprecated("Use field access instead!")]] float& VROSC::TextSpinner::dyn__maxVisibleAngle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__maxVisibleAngle"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_maxVisibleAngle"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _valueDistance [[deprecated("Use field access instead!")]] float& VROSC::TextSpinner::dyn__valueDistance() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__valueDistance"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valueDistance"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _valueTickAngle [[deprecated("Use field access instead!")]] float& VROSC::TextSpinner::dyn__valueTickAngle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__valueTickAngle"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valueTickAngle"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Transform _rotator [[deprecated("Use field access instead!")]] ::UnityEngine::Transform*& VROSC::TextSpinner::dyn__rotator() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__rotator"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rotator"))->offset; return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.AnimationCurve _rotationCurve [[deprecated("Use field access instead!")]] ::UnityEngine::AnimationCurve*& VROSC::TextSpinner::dyn__rotationCurve() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__rotationCurve"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rotationCurve"))->offset; return *reinterpret_cast<::UnityEngine::AnimationCurve**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.AnimationCurve _scaleCurve [[deprecated("Use field access instead!")]] ::UnityEngine::AnimationCurve*& VROSC::TextSpinner::dyn__scaleCurve() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__scaleCurve"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scaleCurve"))->offset; return *reinterpret_cast<::UnityEngine::AnimationCurve**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.SimpleHaptic _hapticFeedBack [[deprecated("Use field access instead!")]] ::VROSC::SimpleHaptic*& VROSC::TextSpinner::dyn__hapticFeedBack() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__hapticFeedBack"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hapticFeedBack"))->offset; return *reinterpret_cast<::VROSC::SimpleHaptic**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Collections.Generic.List`1<VROSC.TextSpinnerItem> _textLines [[deprecated("Use field access instead!")]] ::System::Collections::Generic::List_1<::VROSC::TextSpinnerItem*>*& VROSC::TextSpinner::dyn__textLines() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__textLines"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_textLines"))->offset; return *reinterpret_cast<::System::Collections::Generic::List_1<::VROSC::TextSpinnerItem*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Collections.Generic.List`1<System.String> _textValues [[deprecated("Use field access instead!")]] ::System::Collections::Generic::List_1<::StringW>*& VROSC::TextSpinner::dyn__textValues() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__textValues"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_textValues"))->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 VROSC.InputDevice _inputDevice [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::TextSpinner::dyn__inputDevice() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::dyn__inputDevice"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputDevice"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.TextSpinner.get_SelectedValue int VROSC::TextSpinner::get_SelectedValue() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::get_SelectedValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SelectedValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.TextSpinner.set_SelectedValue void VROSC::TextSpinner::set_SelectedValue(int value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::set_SelectedValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_SelectedValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.TextSpinner.SetValues void VROSC::TextSpinner::SetValues(::System::Collections::Generic::List_1<::StringW>* texts, ::VROSC::InputDevice* inputDevice) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::SetValues"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetValues", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(texts), ::il2cpp_utils::ExtractType(inputDevice)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, texts, inputDevice); } // Autogenerated method: VROSC.TextSpinner.ClearTextLines void VROSC::TextSpinner::ClearTextLines() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::ClearTextLines"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ClearTextLines", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.TextSpinner.UpdateValues void VROSC::TextSpinner::UpdateValues(float currentValue) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::UpdateValues"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateValues", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(currentValue)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, currentValue); } // Autogenerated method: VROSC.TextSpinner.SetSelectedValue void VROSC::TextSpinner::SetSelectedValue(int newSelectedValue) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinner::SetSelectedValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetSelectedValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(newSelectedValue)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, newSelectedValue); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.TextSpinnerItem #include "VROSC/TextSpinnerItem.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: VROSC.AdjustableMesh #include "VROSC/AdjustableMesh.hpp" // Including type: UnityEngine.AnimationCurve #include "UnityEngine/AnimationCurve.hpp" // Including type: UnityEngine.Renderer #include "UnityEngine/Renderer.hpp" // Including type: UnityEngine.Material #include "UnityEngine/Material.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 TMPro.TextMeshPro _valueText [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::TextSpinnerItem::dyn__valueText() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__valueText"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valueText"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AdjustableMesh _background [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMesh*& VROSC::TextSpinnerItem::dyn__background() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__background"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_background"))->offset; return *reinterpret_cast<::VROSC::AdjustableMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _selectedColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::TextSpinnerItem::dyn__selectedColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__selectedColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_selectedColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _inactiveColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::TextSpinnerItem::dyn__inactiveColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__inactiveColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inactiveColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _backgroundColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::TextSpinnerItem::dyn__backgroundColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__backgroundColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_backgroundColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.AnimationCurve _alphaCurve [[deprecated("Use field access instead!")]] ::UnityEngine::AnimationCurve*& VROSC::TextSpinnerItem::dyn__alphaCurve() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__alphaCurve"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_alphaCurve"))->offset; return *reinterpret_cast<::UnityEngine::AnimationCurve**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _currentTextColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::TextSpinnerItem::dyn__currentTextColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__currentTextColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_currentTextColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _currentBackgroundColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::TextSpinnerItem::dyn__currentBackgroundColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__currentBackgroundColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_currentBackgroundColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _currentAlpha [[deprecated("Use field access instead!")]] float& VROSC::TextSpinnerItem::dyn__currentAlpha() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__currentAlpha"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_currentAlpha"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Renderer _adjustableMeshRenderer [[deprecated("Use field access instead!")]] ::UnityEngine::Renderer*& VROSC::TextSpinnerItem::dyn__adjustableMeshRenderer() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__adjustableMeshRenderer"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_adjustableMeshRenderer"))->offset; return *reinterpret_cast<::UnityEngine::Renderer**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Material _transparentMaterial [[deprecated("Use field access instead!")]] ::UnityEngine::Material*& VROSC::TextSpinnerItem::dyn__transparentMaterial() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__transparentMaterial"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_transparentMaterial"))->offset; return *reinterpret_cast<::UnityEngine::Material**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Material _normalMaterial [[deprecated("Use field access instead!")]] ::UnityEngine::Material*& VROSC::TextSpinnerItem::dyn__normalMaterial() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__normalMaterial"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_normalMaterial"))->offset; return *reinterpret_cast<::UnityEngine::Material**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _isTransparent [[deprecated("Use field access instead!")]] bool& VROSC::TextSpinnerItem::dyn__isTransparent() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::dyn__isTransparent"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isTransparent"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.TextSpinnerItem.Awake void VROSC::TextSpinnerItem::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::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: VROSC.TextSpinnerItem.AddHook void VROSC::TextSpinnerItem::AddHook() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::AddHook"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AddHook", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.TextSpinnerItem.SetMaterial void VROSC::TextSpinnerItem::SetMaterial(::UnityEngine::Color color) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::SetMaterial"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetMaterial", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(color)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, color); } // Autogenerated method: VROSC.TextSpinnerItem.Set void VROSC::TextSpinnerItem::Set(::StringW text, bool selected, float valueOffCenter) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TextSpinnerItem::Set"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Set", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(text), ::il2cpp_utils::ExtractType(selected), ::il2cpp_utils::ExtractType(valueOffCenter)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, text, selected, valueOffCenter); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIColorPickerHelper #include "VROSC/UIColorPickerHelper.hpp" // Including type: VROSC.UIColorPickerHelper/VROSC.<GrabRemotely>d__22 #include "VROSC/UIColorPickerHelper_-GrabRemotely-d__22.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: VROSC.ProceduralAdjustableMesh #include "VROSC/ProceduralAdjustableMesh.hpp" // Including type: VROSC.UI.Meshes.ColorPickerMesh #include "VROSC/UI/Meshes/ColorPickerMesh.hpp" // Including type: VROSC.UIColorPickerMiniBar #include "VROSC/UIColorPickerMiniBar.hpp" // Including type: UnityEngine.Transform #include "UnityEngine/Transform.hpp" // Including type: VROSC.AdjustableMesh #include "VROSC/AdjustableMesh.hpp" // Including type: UnityEngine.GameObject #include "UnityEngine/GameObject.hpp" // Including type: VROSC.UIHelperPositioning #include "VROSC/UIHelperPositioning.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.UIColorPicker #include "VROSC/UIColorPicker.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.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 TMPro.TextMeshPro _name [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::UIColorPickerHelper::dyn__name() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__name"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_name"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ProceduralAdjustableMesh _colorDisplay [[deprecated("Use field access instead!")]] ::VROSC::ProceduralAdjustableMesh*& VROSC::UIColorPickerHelper::dyn__colorDisplay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__colorDisplay"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_colorDisplay"))->offset; return *reinterpret_cast<::VROSC::ProceduralAdjustableMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UI.Meshes.ColorPickerMesh _hueDisplay [[deprecated("Use field access instead!")]] ::VROSC::UI::Meshes::ColorPickerMesh*& VROSC::UIColorPickerHelper::dyn__hueDisplay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__hueDisplay"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hueDisplay"))->offset; return *reinterpret_cast<::VROSC::UI::Meshes::ColorPickerMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UI.Meshes.ColorPickerMesh _saturationDisplay [[deprecated("Use field access instead!")]] ::VROSC::UI::Meshes::ColorPickerMesh*& VROSC::UIColorPickerHelper::dyn__saturationDisplay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__saturationDisplay"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_saturationDisplay"))->offset; return *reinterpret_cast<::VROSC::UI::Meshes::ColorPickerMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIColorPickerMiniBar _miniHue [[deprecated("Use field access instead!")]] ::VROSC::UIColorPickerMiniBar*& VROSC::UIColorPickerHelper::dyn__miniHue() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__miniHue"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_miniHue"))->offset; return *reinterpret_cast<::VROSC::UIColorPickerMiniBar**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIColorPickerMiniBar _miniSaturation [[deprecated("Use field access instead!")]] ::VROSC::UIColorPickerMiniBar*& VROSC::UIColorPickerHelper::dyn__miniSaturation() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__miniSaturation"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_miniSaturation"))->offset; return *reinterpret_cast<::VROSC::UIColorPickerMiniBar**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIColorPickerMiniBar _miniValue [[deprecated("Use field access instead!")]] ::VROSC::UIColorPickerMiniBar*& VROSC::UIColorPickerHelper::dyn__miniValue() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__miniValue"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_miniValue"))->offset; return *reinterpret_cast<::VROSC::UIColorPickerMiniBar**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Transform _saturationDot [[deprecated("Use field access instead!")]] ::UnityEngine::Transform*& VROSC::UIColorPickerHelper::dyn__saturationDot() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__saturationDot"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_saturationDot"))->offset; return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _saturationHeight [[deprecated("Use field access instead!")]] float& VROSC::UIColorPickerHelper::dyn__saturationHeight() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__saturationHeight"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_saturationHeight"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Transform _valueDot [[deprecated("Use field access instead!")]] ::UnityEngine::Transform*& VROSC::UIColorPickerHelper::dyn__valueDot() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__valueDot"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valueDot"))->offset; return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _valueHeight [[deprecated("Use field access instead!")]] float& VROSC::UIColorPickerHelper::dyn__valueHeight() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__valueHeight"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valueHeight"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _hueRange [[deprecated("Use field access instead!")]] float& VROSC::UIColorPickerHelper::dyn__hueRange() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__hueRange"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hueRange"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AdjustableMesh _valueSphere [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMesh*& VROSC::UIColorPickerHelper::dyn__valueSphere() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__valueSphere"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valueSphere"))->offset; return *reinterpret_cast<::VROSC::AdjustableMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _valueSphereScaleAdjust [[deprecated("Use field access instead!")]] float& VROSC::UIColorPickerHelper::dyn__valueSphereScaleAdjust() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__valueSphereScaleAdjust"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valueSphereScaleAdjust"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector3 _inputSensitivity [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::UIColorPickerHelper::dyn__inputSensitivity() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__inputSensitivity"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputSensitivity"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _visual [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::UIColorPickerHelper::dyn__visual() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__visual"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_visual"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIHelperPositioning _positioning [[deprecated("Use field access instead!")]] ::VROSC::UIHelperPositioning*& VROSC::UIColorPickerHelper::dyn__positioning() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__positioning"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_positioning"))->offset; return *reinterpret_cast<::VROSC::UIHelperPositioning**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _testColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::UIColorPickerHelper::dyn__testColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__testColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_testColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InputDevice _grabbingDevice [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UIColorPickerHelper::dyn__grabbingDevice() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::dyn__grabbingDevice"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_grabbingDevice"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIColorPickerHelper.Awake void VROSC::UIColorPickerHelper::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::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: VROSC.UIColorPickerHelper.Grab void VROSC::UIColorPickerHelper::Grab(::VROSC::UIColorPicker* target, ::VROSC::InputDevice* inputDevice) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::Grab"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Grab", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(inputDevice)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, target, inputDevice); } // Autogenerated method: VROSC.UIColorPickerHelper.StopGrab void VROSC::UIColorPickerHelper::StopGrab(::VROSC::InputDevice* device) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::StopGrab"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopGrab", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device); } // Autogenerated method: VROSC.UIColorPickerHelper.GrabRemotely ::System::Collections::IEnumerator* VROSC::UIColorPickerHelper::GrabRemotely(::VROSC::UIColorPicker* target, ::VROSC::InputDevice* device) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::GrabRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GrabRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(device)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, target, device); } // Autogenerated method: VROSC.UIColorPickerHelper.Verify void VROSC::UIColorPickerHelper::Verify(bool forceUpdate) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::Verify"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Verify", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(forceUpdate)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, forceUpdate); } // Autogenerated method: VROSC.UIColorPickerHelper.SetColor void VROSC::UIColorPickerHelper::SetColor(float hue, float saturation, float value, ::UnityEngine::Color color) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::SetColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hue), ::il2cpp_utils::ExtractType(saturation), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(color)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, hue, saturation, value, color); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UIColorPickerHelper/VROSC.<GrabRemotely>d__22 #include "VROSC/UIColorPickerHelper_-GrabRemotely-d__22.hpp" // Including type: VROSC.UIColorPicker #include "VROSC/UIColorPicker.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 [[deprecated("Use field access instead!")]] int& VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UIColorPicker target [[deprecated("Use field access instead!")]] ::VROSC::UIColorPicker*& VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_target() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_target"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "target"))->offset; return *reinterpret_cast<::VROSC::UIColorPicker**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.InputDevice device [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_device() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_device"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "device"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UIColorPickerHelper <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UIColorPickerHelper*& VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::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<::VROSC::UIColorPickerHelper**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single <startHue>5__2 [[deprecated("Use field access instead!")]] float& VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$startHue$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$startHue$5__2"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<startHue>5__2"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single <startValue>5__3 [[deprecated("Use field access instead!")]] float& VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$startValue$5__3() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$startValue$5__3"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<startValue>5__3"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single <startSaturation>5__4 [[deprecated("Use field access instead!")]] float& VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$startSaturation$5__4() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$startSaturation$5__4"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<startSaturation>5__4"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector3 <size>5__5 [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$size$5__5() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$size$5__5"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<size>5__5"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector3 <startpos>5__6 [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$startpos$5__6() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::dyn_$startpos$5__6"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<startpos>5__6"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIColorPickerHelper/VROSC.<GrabRemotely>d__22.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UIColorPickerHelper::$GrabRemotely$d__22::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPickerHelper::$GrabRemotely$d__22*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPickerHelper/VROSC.<GrabRemotely>d__22.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UIColorPickerHelper::$GrabRemotely$d__22::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPickerHelper::$GrabRemotely$d__22*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPickerHelper/VROSC.<GrabRemotely>d__22.System.IDisposable.Dispose void VROSC::UIColorPickerHelper::$GrabRemotely$d__22::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPickerHelper::$GrabRemotely$d__22*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPickerHelper/VROSC.<GrabRemotely>d__22.MoveNext bool VROSC::UIColorPickerHelper::$GrabRemotely$d__22::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPickerHelper::$GrabRemotely$d__22*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPickerHelper/VROSC.<GrabRemotely>d__22.System.Collections.IEnumerator.Reset void VROSC::UIColorPickerHelper::$GrabRemotely$d__22::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerHelper::$GrabRemotely$d__22::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPickerHelper::$GrabRemotely$d__22*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIColorPickerMiniBar #include "VROSC/UIColorPickerMiniBar.hpp" // Including type: VROSC.UI.Meshes.ColorPickerMesh #include "VROSC/UI/Meshes/ColorPickerMesh.hpp" // Including type: UnityEngine.Transform #include "UnityEngine/Transform.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 VROSC.UIColorPickerMiniBar/VROSC.Type _type [[deprecated("Use field access instead!")]] ::VROSC::UIColorPickerMiniBar::Type& VROSC::UIColorPickerMiniBar::dyn__type() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::dyn__type"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_type"))->offset; return *reinterpret_cast<::VROSC::UIColorPickerMiniBar::Type*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UI.Meshes.ColorPickerMesh _mesh [[deprecated("Use field access instead!")]] ::VROSC::UI::Meshes::ColorPickerMesh*& VROSC::UIColorPickerMiniBar::dyn__mesh() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::dyn__mesh"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_mesh"))->offset; return *reinterpret_cast<::VROSC::UI::Meshes::ColorPickerMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Transform _marker [[deprecated("Use field access instead!")]] ::UnityEngine::Transform*& VROSC::UIColorPickerMiniBar::dyn__marker() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::dyn__marker"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_marker"))->offset; return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _width [[deprecated("Use field access instead!")]] float& VROSC::UIColorPickerMiniBar::dyn__width() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::dyn__width"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_width"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIColorPickerMiniBar.Awake void VROSC::UIColorPickerMiniBar::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::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: VROSC.UIColorPickerMiniBar.Verify void VROSC::UIColorPickerMiniBar::Verify(bool forceUpdate) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::Verify"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Verify", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(forceUpdate)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, forceUpdate); } // Autogenerated method: VROSC.UIColorPickerMiniBar.Set void VROSC::UIColorPickerMiniBar::Set(float hue, float saturation, float value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::Set"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Set", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hue), ::il2cpp_utils::ExtractType(saturation), ::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, hue, saturation, value); } // Autogenerated method: VROSC.UIColorPickerMiniBar.SetMarker void VROSC::UIColorPickerMiniBar::SetMarker(float value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::SetMarker"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetMarker", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIColorPickerMiniBar/VROSC.Type #include "VROSC/UIColorPickerMiniBar.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 VROSC.UIColorPickerMiniBar/VROSC.Type Hue ::VROSC::UIColorPickerMiniBar::Type VROSC::UIColorPickerMiniBar::Type::_get_Hue() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::Type::_get_Hue"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::UIColorPickerMiniBar::Type>("VROSC", "UIColorPickerMiniBar/Type", "Hue")); } // Autogenerated static field setter // Set static field: static public VROSC.UIColorPickerMiniBar/VROSC.Type Hue void VROSC::UIColorPickerMiniBar::Type::_set_Hue(::VROSC::UIColorPickerMiniBar::Type value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::Type::_set_Hue"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "UIColorPickerMiniBar/Type", "Hue", value)); } // Autogenerated static field getter // Get static field: static public VROSC.UIColorPickerMiniBar/VROSC.Type Saturation ::VROSC::UIColorPickerMiniBar::Type VROSC::UIColorPickerMiniBar::Type::_get_Saturation() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::Type::_get_Saturation"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::UIColorPickerMiniBar::Type>("VROSC", "UIColorPickerMiniBar/Type", "Saturation")); } // Autogenerated static field setter // Set static field: static public VROSC.UIColorPickerMiniBar/VROSC.Type Saturation void VROSC::UIColorPickerMiniBar::Type::_set_Saturation(::VROSC::UIColorPickerMiniBar::Type value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::Type::_set_Saturation"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "UIColorPickerMiniBar/Type", "Saturation", value)); } // Autogenerated static field getter // Get static field: static public VROSC.UIColorPickerMiniBar/VROSC.Type Value ::VROSC::UIColorPickerMiniBar::Type VROSC::UIColorPickerMiniBar::Type::_get_Value() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::Type::_get_Value"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::UIColorPickerMiniBar::Type>("VROSC", "UIColorPickerMiniBar/Type", "Value")); } // Autogenerated static field setter // Set static field: static public VROSC.UIColorPickerMiniBar/VROSC.Type Value void VROSC::UIColorPickerMiniBar::Type::_set_Value(::VROSC::UIColorPickerMiniBar::Type value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::Type::_set_Value"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "UIColorPickerMiniBar/Type", "Value", value)); } // Autogenerated instance field getter // Get instance field: public System.Int32 value__ [[deprecated("Use field access instead!")]] int& VROSC::UIColorPickerMiniBar::Type::dyn_value__() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerMiniBar::Type::dyn_value__"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIColorPickerSwatch #include "VROSC/UIColorPickerSwatch.hpp" // Including type: VROSC.ProceduralAdjustableMesh #include "VROSC/ProceduralAdjustableMesh.hpp" // Including type: UnityEngine.GameObject #include "UnityEngine/GameObject.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.Color <Color>k__BackingField [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::UIColorPickerSwatch::dyn_$Color$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerSwatch::dyn_$Color$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Color>k__BackingField"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ProceduralAdjustableMesh _colorDisplay [[deprecated("Use field access instead!")]] ::VROSC::ProceduralAdjustableMesh*& VROSC::UIColorPickerSwatch::dyn__colorDisplay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerSwatch::dyn__colorDisplay"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_colorDisplay"))->offset; return *reinterpret_cast<::VROSC::ProceduralAdjustableMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _selected [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::UIColorPickerSwatch::dyn__selected() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerSwatch::dyn__selected"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_selected"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIColorPickerSwatch.get_Color ::UnityEngine::Color VROSC::UIColorPickerSwatch::get_Color() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerSwatch::get_Color"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Color", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPickerSwatch.set_Color void VROSC::UIColorPickerSwatch::set_Color(::UnityEngine::Color value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerSwatch::set_Color"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Color", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UIColorPickerSwatch.Awake void VROSC::UIColorPickerSwatch::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerSwatch::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: VROSC.UIColorPickerSwatch.SetColor void VROSC::UIColorPickerSwatch::SetColor(::UnityEngine::Color color) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerSwatch::SetColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(color)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, color); } // Autogenerated method: VROSC.UIColorPickerSwatch.SetHovering void VROSC::UIColorPickerSwatch::SetHovering(bool hovering) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPickerSwatch::SetHovering"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetHovering", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hovering)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, hovering); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIHelperInfoIcon #include "VROSC/UIHelperInfoIcon.hpp" // Including type: VROSC.IconMesh #include "VROSC/IconMesh.hpp" // Including type: VROSC.UIHelperPositioning #include "VROSC/UIHelperPositioning.hpp" // Including type: VROSC.UI.IconData #include "VROSC/UI/IconData.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 VROSC.IconMesh _icon [[deprecated("Use field access instead!")]] ::VROSC::IconMesh*& VROSC::UIHelperInfoIcon::dyn__icon() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperInfoIcon::dyn__icon"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_icon"))->offset; return *reinterpret_cast<::VROSC::IconMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIHelperPositioning _positioning [[deprecated("Use field access instead!")]] ::VROSC::UIHelperPositioning*& VROSC::UIHelperInfoIcon::dyn__positioning() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperInfoIcon::dyn__positioning"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_positioning"))->offset; return *reinterpret_cast<::VROSC::UIHelperPositioning**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIHelperInfoIcon.ShowIcon void VROSC::UIHelperInfoIcon::ShowIcon(::VROSC::UI::IconData* iconData) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperInfoIcon::ShowIcon"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ShowIcon", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(iconData)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, iconData); } // Autogenerated method: VROSC.UIHelperInfoIcon.HideIcon void VROSC::UIHelperInfoIcon::HideIcon() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperInfoIcon::HideIcon"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HideIcon", 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: VROSC.UIHelperPositioning #include "VROSC/UIHelperPositioning.hpp" // Including type: VROSC.UIHelperPositioning/VROSC.<MoveOutObject>d__8 #include "VROSC/UIHelperPositioning_-MoveOutObject-d__8.hpp" // Including type: UnityEngine.Transform #include "UnityEngine/Transform.hpp" // Including type: UnityEngine.AnimationCurve #include "UnityEngine/AnimationCurve.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.hpp" // Including type: UnityEngine.Vector3 #include "UnityEngine/Vector3.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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.Single _directionOffset [[deprecated("Use field access instead!")]] float& VROSC::UIHelperPositioning::dyn__directionOffset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::dyn__directionOffset"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_directionOffset"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _verticalOffset [[deprecated("Use field access instead!")]] float& VROSC::UIHelperPositioning::dyn__verticalOffset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::dyn__verticalOffset"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_verticalOffset"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _moveTowardsFace [[deprecated("Use field access instead!")]] bool& VROSC::UIHelperPositioning::dyn__moveTowardsFace() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::dyn__moveTowardsFace"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_moveTowardsFace"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _minDistance [[deprecated("Use field access instead!")]] float& VROSC::UIHelperPositioning::dyn__minDistance() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::dyn__minDistance"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_minDistance"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _lookAtCamera [[deprecated("Use field access instead!")]] float& VROSC::UIHelperPositioning::dyn__lookAtCamera() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::dyn__lookAtCamera"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lookAtCamera"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Transform _targetBone [[deprecated("Use field access instead!")]] ::UnityEngine::Transform*& VROSC::UIHelperPositioning::dyn__targetBone() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::dyn__targetBone"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_targetBone"))->offset; return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _moveDuration [[deprecated("Use field access instead!")]] float& VROSC::UIHelperPositioning::dyn__moveDuration() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::dyn__moveDuration"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_moveDuration"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.AnimationCurve _moveCurve [[deprecated("Use field access instead!")]] ::UnityEngine::AnimationCurve*& VROSC::UIHelperPositioning::dyn__moveCurve() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::dyn__moveCurve"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_moveCurve"))->offset; return *reinterpret_cast<::UnityEngine::AnimationCurve**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIHelperPositioning.MoveOutObject ::System::Collections::IEnumerator* VROSC::UIHelperPositioning::MoveOutObject(::UnityEngine::Transform* target, ::UnityEngine::Vector3 endPosition, ::UnityEngine::Vector3 size) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::MoveOutObject"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveOutObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(endPosition), ::il2cpp_utils::ExtractType(size)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, target, endPosition, size); } // Autogenerated method: VROSC.UIHelperPositioning.PlaceAtEndPosition void VROSC::UIHelperPositioning::PlaceAtEndPosition(::UnityEngine::Transform* target, ::VROSC::InputDevice* device) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::PlaceAtEndPosition"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PlaceAtEndPosition", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(device)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, target, device); } // Autogenerated method: VROSC.UIHelperPositioning.PlaceTargetBone void VROSC::UIHelperPositioning::PlaceTargetBone(::UnityEngine::Transform* target, ::UnityEngine::Vector3 size) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::PlaceTargetBone"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PlaceTargetBone", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(size)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, target, size); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UIHelperPositioning/VROSC.<MoveOutObject>d__8 #include "VROSC/UIHelperPositioning_-MoveOutObject-d__8.hpp" // Including type: UnityEngine.Transform #include "UnityEngine/Transform.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 [[deprecated("Use field access instead!")]] int& VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UIHelperPositioning <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UIHelperPositioning*& VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::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<::VROSC::UIHelperPositioning**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public UnityEngine.Transform target [[deprecated("Use field access instead!")]] ::UnityEngine::Transform*& VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_target() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_target"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "target"))->offset; return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public UnityEngine.Vector3 size [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_size() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_size"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "size"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public UnityEngine.Vector3 endPosition [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_endPosition() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_endPosition"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "endPosition"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single <time>5__2 [[deprecated("Use field access instead!")]] float& VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_$time$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::dyn_$time$5__2"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<time>5__2"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIHelperPositioning/VROSC.<MoveOutObject>d__8.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UIHelperPositioning::$MoveOutObject$d__8::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIHelperPositioning::$MoveOutObject$d__8*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHelperPositioning/VROSC.<MoveOutObject>d__8.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UIHelperPositioning::$MoveOutObject$d__8::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIHelperPositioning::$MoveOutObject$d__8*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHelperPositioning/VROSC.<MoveOutObject>d__8.System.IDisposable.Dispose void VROSC::UIHelperPositioning::$MoveOutObject$d__8::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIHelperPositioning::$MoveOutObject$d__8*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHelperPositioning/VROSC.<MoveOutObject>d__8.MoveNext bool VROSC::UIHelperPositioning::$MoveOutObject$d__8::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIHelperPositioning::$MoveOutObject$d__8*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHelperPositioning/VROSC.<MoveOutObject>d__8.System.Collections.IEnumerator.Reset void VROSC::UIHelperPositioning::$MoveOutObject$d__8::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelperPositioning::$MoveOutObject$d__8::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIHelperPositioning::$MoveOutObject$d__8*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIHelpers #include "VROSC/UIHelpers.hpp" // Including type: VROSC.UISliderHelper #include "VROSC/UISliderHelper.hpp" // Including type: VROSC.UISpinnerHelper #include "VROSC/UISpinnerHelper.hpp" // Including type: VROSC.UIColorPickerHelper #include "VROSC/UIColorPickerHelper.hpp" // Including type: VROSC.UIHelperInfoIcon #include "VROSC/UIHelperInfoIcon.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: private System.Boolean _useHelpers [[deprecated("Use field access instead!")]] bool& VROSC::UIHelpers::dyn__useHelpers() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelpers::dyn__useHelpers"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_useHelpers"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISliderHelper _sliderHelper [[deprecated("Use field access instead!")]] ::VROSC::UISliderHelper*& VROSC::UIHelpers::dyn__sliderHelper() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelpers::dyn__sliderHelper"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_sliderHelper"))->offset; return *reinterpret_cast<::VROSC::UISliderHelper**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISpinnerHelper _spinnerHelper [[deprecated("Use field access instead!")]] ::VROSC::UISpinnerHelper*& VROSC::UIHelpers::dyn__spinnerHelper() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelpers::dyn__spinnerHelper"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_spinnerHelper"))->offset; return *reinterpret_cast<::VROSC::UISpinnerHelper**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIColorPickerHelper _colorPickerHelper [[deprecated("Use field access instead!")]] ::VROSC::UIColorPickerHelper*& VROSC::UIHelpers::dyn__colorPickerHelper() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelpers::dyn__colorPickerHelper"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_colorPickerHelper"))->offset; return *reinterpret_cast<::VROSC::UIColorPickerHelper**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIHelperInfoIcon _infoIcon [[deprecated("Use field access instead!")]] ::VROSC::UIHelperInfoIcon*& VROSC::UIHelpers::dyn__infoIcon() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelpers::dyn__infoIcon"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_infoIcon"))->offset; return *reinterpret_cast<::VROSC::UIHelperInfoIcon**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIHelpers.get_UseHelpers bool VROSC::UIHelpers::get_UseHelpers() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelpers::get_UseHelpers"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UseHelpers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHelpers.get_UISliderHelper ::VROSC::UISliderHelper* VROSC::UIHelpers::get_UISliderHelper() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelpers::get_UISliderHelper"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UISliderHelper", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::UISliderHelper*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHelpers.get_SpinnerHelper ::VROSC::UISpinnerHelper* VROSC::UIHelpers::get_SpinnerHelper() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelpers::get_SpinnerHelper"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SpinnerHelper", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::UISpinnerHelper*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHelpers.get_ColorPickerHelper ::VROSC::UIColorPickerHelper* VROSC::UIHelpers::get_ColorPickerHelper() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelpers::get_ColorPickerHelper"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ColorPickerHelper", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::UIColorPickerHelper*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIHelpers.get_InfoIcon ::VROSC::UIHelperInfoIcon* VROSC::UIHelpers::get_InfoIcon() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIHelpers::get_InfoIcon"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InfoIcon", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::UIHelperInfoIcon*, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UISliderHelper #include "VROSC/UISliderHelper.hpp" // Including type: VROSC.UISliderHelper/VROSC.<MoveOutObject>d__27 #include "VROSC/UISliderHelper_-MoveOutObject-d__27.hpp" // Including type: VROSC.UISliderHelper/VROSC.<GrabSliderRemotely>d__28 #include "VROSC/UISliderHelper_-GrabSliderRemotely-d__28.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: UnityEngine.GameObject #include "UnityEngine/GameObject.hpp" // Including type: UnityEngine.Transform #include "UnityEngine/Transform.hpp" // Including type: UnityEngine.AnimationCurve #include "UnityEngine/AnimationCurve.hpp" // Including type: VROSC.SimpleHaptic #include "VROSC/SimpleHaptic.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.UISlider #include "VROSC/UISlider.hpp" // Including type: VROSC.TooltipData #include "VROSC/TooltipData.hpp" // Including type: VROSC.TriggerButton #include "VROSC/TriggerButton.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.hpp" // Including type: UnityEngine.Vector3 #include "UnityEngine/Vector3.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 TMPro.TextMeshPro _name [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::UISliderHelper::dyn__name() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__name"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_name"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _value [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::UISliderHelper::dyn__value() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__value"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_value"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _valueMin [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::UISliderHelper::dyn__valueMin() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__valueMin"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valueMin"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _valueMax [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::UISliderHelper::dyn__valueMax() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__valueMax"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_valueMax"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _directionOffset [[deprecated("Use field access instead!")]] float& VROSC::UISliderHelper::dyn__directionOffset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__directionOffset"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_directionOffset"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _verticalOffset [[deprecated("Use field access instead!")]] float& VROSC::UISliderHelper::dyn__verticalOffset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__verticalOffset"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_verticalOffset"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _offsetVisually [[deprecated("Use field access instead!")]] bool& VROSC::UISliderHelper::dyn__offsetVisually() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__offsetVisually"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_offsetVisually"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _moveTowardsFace [[deprecated("Use field access instead!")]] bool& VROSC::UISliderHelper::dyn__moveTowardsFace() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__moveTowardsFace"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_moveTowardsFace"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _lookAtCamera [[deprecated("Use field access instead!")]] float& VROSC::UISliderHelper::dyn__lookAtCamera() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__lookAtCamera"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lookAtCamera"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _minDistance [[deprecated("Use field access instead!")]] float& VROSC::UISliderHelper::dyn__minDistance() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__minDistance"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_minDistance"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _visual [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::UISliderHelper::dyn__visual() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__visual"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_visual"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Transform _targetBone [[deprecated("Use field access instead!")]] ::UnityEngine::Transform*& VROSC::UISliderHelper::dyn__targetBone() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__targetBone"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_targetBone"))->offset; return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _moveDuration [[deprecated("Use field access instead!")]] float& VROSC::UISliderHelper::dyn__moveDuration() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__moveDuration"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_moveDuration"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.AnimationCurve _moveCurve [[deprecated("Use field access instead!")]] ::UnityEngine::AnimationCurve*& VROSC::UISliderHelper::dyn__moveCurve() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__moveCurve"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_moveCurve"))->offset; return *reinterpret_cast<::UnityEngine::AnimationCurve**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.SimpleHaptic _hapticFeedBack [[deprecated("Use field access instead!")]] ::VROSC::SimpleHaptic*& VROSC::UISliderHelper::dyn__hapticFeedBack() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__hapticFeedBack"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hapticFeedBack"))->offset; return *reinterpret_cast<::VROSC::SimpleHaptic**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector2 _size [[deprecated("Use field access instead!")]] ::UnityEngine::Vector2& VROSC::UISliderHelper::dyn__size() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__size"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_size"))->offset; return *reinterpret_cast<::UnityEngine::Vector2*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InputDevice _grabbingDevice [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UISliderHelper::dyn__grabbingDevice() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__grabbingDevice"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_grabbingDevice"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _currentValue [[deprecated("Use field access instead!")]] float& VROSC::UISliderHelper::dyn__currentValue() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__currentValue"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_currentValue"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _ticks [[deprecated("Use field access instead!")]] int& VROSC::UISliderHelper::dyn__ticks() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__ticks"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_ticks"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlider _targetSlider [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::UISliderHelper::dyn__targetSlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__targetSlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_targetSlider"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.TooltipData _toggleIntegerMode [[deprecated("Use field access instead!")]] ::VROSC::TooltipData*& VROSC::UISliderHelper::dyn__toggleIntegerMode() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::dyn__toggleIntegerMode"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_toggleIntegerMode"))->offset; return *reinterpret_cast<::VROSC::TooltipData**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISliderHelper.ToggleIntegerMode void VROSC::UISliderHelper::ToggleIntegerMode(::VROSC::InputDevice* device, ::VROSC::TriggerButton button) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::ToggleIntegerMode"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToggleIntegerMode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(button)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, button); } // Autogenerated method: VROSC.UISliderHelper.Grab void VROSC::UISliderHelper::Grab(::VROSC::UISlider* target, ::VROSC::InputDevice* inputDevice, bool showVisualPopout) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::Grab"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Grab", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(inputDevice), ::il2cpp_utils::ExtractType(showVisualPopout)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, target, inputDevice, showVisualPopout); } // Autogenerated method: VROSC.UISliderHelper.StopGrab void VROSC::UISliderHelper::StopGrab(::VROSC::InputDevice* device) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::StopGrab"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopGrab", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device); } // Autogenerated method: VROSC.UISliderHelper.MoveOutObject ::System::Collections::IEnumerator* VROSC::UISliderHelper::MoveOutObject(::VROSC::UISlider* target, ::UnityEngine::Vector3 endPosition) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::MoveOutObject"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveOutObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(endPosition)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, target, endPosition); } // Autogenerated method: VROSC.UISliderHelper.GrabSliderRemotely ::System::Collections::IEnumerator* VROSC::UISliderHelper::GrabSliderRemotely(::VROSC::UISlider* target, ::VROSC::InputDevice* device, bool showVisualPopout) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::GrabSliderRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GrabSliderRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(showVisualPopout)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, target, device, showVisualPopout); } // Autogenerated method: VROSC.UISliderHelper.PlaceTargetBone void VROSC::UISliderHelper::PlaceTargetBone(::VROSC::UISlider* target) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::PlaceTargetBone"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PlaceTargetBone", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, target); } // Autogenerated method: VROSC.UISliderHelper.Awake void VROSC::UISliderHelper::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::Awake"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 11)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper.OnEnable void VROSC::UISliderHelper::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::OnEnable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 12)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper.OnDisable void VROSC::UISliderHelper::OnDisable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::OnDisable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper.GetSize ::UnityEngine::Vector2 VROSC::UISliderHelper::GetSize() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::GetSize"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 15)); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector2, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper.SetValue void VROSC::UISliderHelper::SetValue(float value, bool force, bool useCallback) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::SetValue"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderBase*), 14)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, force, useCallback); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UISliderHelper/VROSC.<MoveOutObject>d__27 #include "VROSC/UISliderHelper_-MoveOutObject-d__27.hpp" // Including type: VROSC.UISlider #include "VROSC/UISlider.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 [[deprecated("Use field access instead!")]] int& VROSC::UISliderHelper::$MoveOutObject$d__27::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UISliderHelper::$MoveOutObject$d__27::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UISliderHelper <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UISliderHelper*& VROSC::UISliderHelper::$MoveOutObject$d__27::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::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<::VROSC::UISliderHelper**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UISlider target [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::UISliderHelper::$MoveOutObject$d__27::dyn_target() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::dyn_target"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "target"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public UnityEngine.Vector3 endPosition [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::UISliderHelper::$MoveOutObject$d__27::dyn_endPosition() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::dyn_endPosition"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "endPosition"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single <time>5__2 [[deprecated("Use field access instead!")]] float& VROSC::UISliderHelper::$MoveOutObject$d__27::dyn_$time$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::dyn_$time$5__2"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<time>5__2"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISliderHelper/VROSC.<MoveOutObject>d__27.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UISliderHelper::$MoveOutObject$d__27::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderHelper::$MoveOutObject$d__27*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper/VROSC.<MoveOutObject>d__27.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UISliderHelper::$MoveOutObject$d__27::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderHelper::$MoveOutObject$d__27*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper/VROSC.<MoveOutObject>d__27.System.IDisposable.Dispose void VROSC::UISliderHelper::$MoveOutObject$d__27::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderHelper::$MoveOutObject$d__27*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper/VROSC.<MoveOutObject>d__27.MoveNext bool VROSC::UISliderHelper::$MoveOutObject$d__27::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderHelper::$MoveOutObject$d__27*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper/VROSC.<MoveOutObject>d__27.System.Collections.IEnumerator.Reset void VROSC::UISliderHelper::$MoveOutObject$d__27::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$MoveOutObject$d__27::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderHelper::$MoveOutObject$d__27*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UISliderHelper/VROSC.<GrabSliderRemotely>d__28 #include "VROSC/UISliderHelper_-GrabSliderRemotely-d__28.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.UISlider #include "VROSC/UISlider.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 [[deprecated("Use field access instead!")]] int& VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Boolean showVisualPopout [[deprecated("Use field access instead!")]] bool& VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_showVisualPopout() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_showVisualPopout"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "showVisualPopout"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UISliderHelper <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UISliderHelper*& VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::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<::VROSC::UISliderHelper**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.InputDevice device [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_device() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_device"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "device"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UISlider target [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_target() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_target"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "target"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector3 <startpos>5__2 [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_$startpos$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_$startpos$5__2"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<startpos>5__2"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single <startValue>5__3 [[deprecated("Use field access instead!")]] float& VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_$startValue$5__3() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::dyn_$startValue$5__3"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<startValue>5__3"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISliderHelper/VROSC.<GrabSliderRemotely>d__28.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UISliderHelper::$GrabSliderRemotely$d__28::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderHelper::$GrabSliderRemotely$d__28*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper/VROSC.<GrabSliderRemotely>d__28.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UISliderHelper::$GrabSliderRemotely$d__28::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderHelper::$GrabSliderRemotely$d__28*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper/VROSC.<GrabSliderRemotely>d__28.System.IDisposable.Dispose void VROSC::UISliderHelper::$GrabSliderRemotely$d__28::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderHelper::$GrabSliderRemotely$d__28*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper/VROSC.<GrabSliderRemotely>d__28.MoveNext bool VROSC::UISliderHelper::$GrabSliderRemotely$d__28::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderHelper::$GrabSliderRemotely$d__28*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISliderHelper/VROSC.<GrabSliderRemotely>d__28.System.Collections.IEnumerator.Reset void VROSC::UISliderHelper::$GrabSliderRemotely$d__28::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISliderHelper::$GrabSliderRemotely$d__28::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISliderHelper::$GrabSliderRemotely$d__28*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UISpinnerHelper #include "VROSC/UISpinnerHelper.hpp" // Including type: VROSC.UISpinnerHelper/VROSC.<GrabSpinnerRemotely>d__14 #include "VROSC/UISpinnerHelper_-GrabSpinnerRemotely-d__14.hpp" // Including type: VROSC.TextSpinner #include "VROSC/TextSpinner.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: UnityEngine.GameObject #include "UnityEngine/GameObject.hpp" // Including type: VROSC.UIHelperPositioning #include "VROSC/UIHelperPositioning.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.UISpinner #include "VROSC/UISpinner.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.hpp" // Including type: UnityEngine.Vector2 #include "UnityEngine/Vector2.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 VROSC.TextSpinner _spinner [[deprecated("Use field access instead!")]] ::VROSC::TextSpinner*& VROSC::UISpinnerHelper::dyn__spinner() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::dyn__spinner"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_spinner"))->offset; return *reinterpret_cast<::VROSC::TextSpinner**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _name [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::UISpinnerHelper::dyn__name() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::dyn__name"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_name"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _inputHeightPerTick [[deprecated("Use field access instead!")]] float& VROSC::UISpinnerHelper::dyn__inputHeightPerTick() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::dyn__inputHeightPerTick"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputHeightPerTick"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _thumbStickInputSpeed [[deprecated("Use field access instead!")]] float& VROSC::UISpinnerHelper::dyn__thumbStickInputSpeed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::dyn__thumbStickInputSpeed"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_thumbStickInputSpeed"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _continuous [[deprecated("Use field access instead!")]] bool& VROSC::UISpinnerHelper::dyn__continuous() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::dyn__continuous"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_continuous"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _visual [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::UISpinnerHelper::dyn__visual() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::dyn__visual"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_visual"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIHelperPositioning _positioning [[deprecated("Use field access instead!")]] ::VROSC::UIHelperPositioning*& VROSC::UISpinnerHelper::dyn__positioning() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::dyn__positioning"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_positioning"))->offset; return *reinterpret_cast<::VROSC::UIHelperPositioning**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InputDevice _grabbingDevice [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UISpinnerHelper::dyn__grabbingDevice() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::dyn__grabbingDevice"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_grabbingDevice"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _thumbstickInput [[deprecated("Use field access instead!")]] float& VROSC::UISpinnerHelper::dyn__thumbstickInput() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::dyn__thumbstickInput"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_thumbstickInput"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISpinnerHelper.Awake void VROSC::UISpinnerHelper::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::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: VROSC.UISpinnerHelper.OnEnable void VROSC::UISpinnerHelper::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::OnEnable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinnerHelper.OnDisable void VROSC::UISpinnerHelper::OnDisable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::OnDisable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDisable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinnerHelper.Grab void VROSC::UISpinnerHelper::Grab(::VROSC::UISpinner* target, ::VROSC::InputDevice* inputDevice) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::Grab"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Grab", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(inputDevice)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, target, inputDevice); } // Autogenerated method: VROSC.UISpinnerHelper.StopGrab void VROSC::UISpinnerHelper::StopGrab(::VROSC::InputDevice* device) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::StopGrab"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopGrab", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device); } // Autogenerated method: VROSC.UISpinnerHelper.GrabSpinnerRemotely ::System::Collections::IEnumerator* VROSC::UISpinnerHelper::GrabSpinnerRemotely(::VROSC::UISpinner* target, ::VROSC::InputDevice* device) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::GrabSpinnerRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GrabSpinnerRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(device)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, target, device); } // Autogenerated method: VROSC.UISpinnerHelper.EvaluateThumbstickInput void VROSC::UISpinnerHelper::EvaluateThumbstickInput(::VROSC::InputDevice* device, ::UnityEngine::Vector2 vector) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::EvaluateThumbstickInput"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EvaluateThumbstickInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(vector)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, vector); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UISpinnerHelper/VROSC.<GrabSpinnerRemotely>d__14 #include "VROSC/UISpinnerHelper_-GrabSpinnerRemotely-d__14.hpp" // Including type: VROSC.UISpinner #include "VROSC/UISpinner.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 [[deprecated("Use field access instead!")]] int& VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UISpinner target [[deprecated("Use field access instead!")]] ::VROSC::UISpinner*& VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_target() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_target"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "target"))->offset; return *reinterpret_cast<::VROSC::UISpinner**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.InputDevice device [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_device() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_device"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "device"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UISpinnerHelper <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UISpinnerHelper*& VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::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<::VROSC::UISpinnerHelper**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single <startValue>5__2 [[deprecated("Use field access instead!")]] float& VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_$startValue$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_$startValue$5__2"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<startValue>5__2"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector3 <size>5__3 [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_$size$5__3() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_$size$5__3"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<size>5__3"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector3 <startpos>5__4 [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_$startpos$5__4() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::dyn_$startpos$5__4"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<startpos>5__4"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UISpinnerHelper/VROSC.<GrabSpinnerRemotely>d__14.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinnerHelper/VROSC.<GrabSpinnerRemotely>d__14.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinnerHelper/VROSC.<GrabSpinnerRemotely>d__14.System.IDisposable.Dispose void VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinnerHelper/VROSC.<GrabSpinnerRemotely>d__14.MoveNext bool VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UISpinnerHelper/VROSC.<GrabSpinnerRemotely>d__14.System.Collections.IEnumerator.Reset void VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UISpinnerHelper::$GrabSpinnerRemotely$d__14*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.VersionDisplay #include "VROSC/VersionDisplay.hpp" // Including type: TMPro.TMP_Text #include "TMPro/TMP_Text.hpp" // Including type: System.String #include "System/String.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static private System.String AndroidBundleNumberFileName ::StringW VROSC::VersionDisplay::_get_AndroidBundleNumberFileName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VersionDisplay::_get_AndroidBundleNumberFileName"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "VersionDisplay", "AndroidBundleNumberFileName")); } // Autogenerated static field setter // Set static field: static private System.String AndroidBundleNumberFileName void VROSC::VersionDisplay::_set_AndroidBundleNumberFileName(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VersionDisplay::_set_AndroidBundleNumberFileName"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "VersionDisplay", "AndroidBundleNumberFileName", value)); } // Autogenerated instance field getter // Get instance field: private TMPro.TMP_Text _tmpText [[deprecated("Use field access instead!")]] ::TMPro::TMP_Text*& VROSC::VersionDisplay::dyn__tmpText() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VersionDisplay::dyn__tmpText"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_tmpText"))->offset; return *reinterpret_cast<::TMPro::TMP_Text**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.VersionDisplay.get_AndroidBundleNumberFilePath ::StringW VROSC::VersionDisplay::get_AndroidBundleNumberFilePath() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VersionDisplay::get_AndroidBundleNumberFilePath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "VersionDisplay", "get_AndroidBundleNumberFilePath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method); } // Autogenerated method: VROSC.VersionDisplay.Awake void VROSC::VersionDisplay::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VersionDisplay::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: VROSC.VersionDisplay.GetAndroidBundleNumberFromFile ::StringW VROSC::VersionDisplay::GetAndroidBundleNumberFromFile() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VersionDisplay::GetAndroidBundleNumberFromFile"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetAndroidBundleNumberFromFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.VideoButton #include "VROSC/VideoButton.hpp" // Including type: VROSC.VideoButton/VROSC.<DownloadThumbnail>d__5 #include "VROSC/VideoButton_-DownloadThumbnail-d__5.hpp" // Including type: UnityEngine.MeshRenderer #include "UnityEngine/MeshRenderer.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: UnityEngine.GameObject #include "UnityEngine/GameObject.hpp" // Including type: VROSC.VideoInfo #include "VROSC/VideoInfo.hpp" // Including type: UnityEngine.Texture #include "UnityEngine/Texture.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.PaginatedList #include "VROSC/PaginatedList.hpp" // Including type: VROSC.PaginatedListDataHolder #include "VROSC/PaginatedListDataHolder.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.MeshRenderer _thumbnailMesh [[deprecated("Use field access instead!")]] ::UnityEngine::MeshRenderer*& VROSC::VideoButton::dyn__thumbnailMesh() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::dyn__thumbnailMesh"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_thumbnailMesh"))->offset; return *reinterpret_cast<::UnityEngine::MeshRenderer**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _titleUI [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::VideoButton::dyn__titleUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::dyn__titleUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_titleUI"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _playIcon [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::VideoButton::dyn__playIcon() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::dyn__playIcon"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_playIcon"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.VideoButton.DownloadThumbnail void VROSC::VideoButton::DownloadThumbnail(::VROSC::VideoInfo* videoInfo) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::DownloadThumbnail"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DownloadThumbnail", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(videoInfo)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, videoInfo); } // Autogenerated method: VROSC.VideoButton.SetThumbnail void VROSC::VideoButton::SetThumbnail(::UnityEngine::Texture* thumbnail) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::SetThumbnail"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetThumbnail", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(thumbnail)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, thumbnail); } // Autogenerated method: VROSC.VideoButton.Toggled void VROSC::VideoButton::Toggled(::VROSC::InputDevice* inputDevice, bool toggledOn) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::Toggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Toggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputDevice), ::il2cpp_utils::ExtractType(toggledOn)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, inputDevice, toggledOn); } // Autogenerated method: VROSC.VideoButton.Setup void VROSC::VideoButton::Setup(::VROSC::PaginatedList* paginatedList) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::PaginatedListItemUI*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, paginatedList); } // Autogenerated method: VROSC.VideoButton.SetNewData void VROSC::VideoButton::SetNewData(::VROSC::PaginatedListDataHolder* dataholder) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::SetNewData"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::PaginatedListItemUI*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, dataholder); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.VideoButton/VROSC.<DownloadThumbnail>d__5 #include "VROSC/VideoButton_-DownloadThumbnail-d__5.hpp" // Including type: VROSC.VideoInfo #include "VROSC/VideoInfo.hpp" // Including type: UnityEngine.Networking.UnityWebRequest #include "UnityEngine/Networking/UnityWebRequest.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::VideoButton::$DownloadThumbnail$d__5::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::$DownloadThumbnail$d__5::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: public System.Runtime.CompilerServices.AsyncVoidMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncVoidMethodBuilder& VROSC::VideoButton::$DownloadThumbnail$d__5::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::$DownloadThumbnail$d__5::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncVoidMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.VideoInfo videoInfo [[deprecated("Use field access instead!")]] ::VROSC::VideoInfo*& VROSC::VideoButton::$DownloadThumbnail$d__5::dyn_videoInfo() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::$DownloadThumbnail$d__5::dyn_videoInfo"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "videoInfo"))->offset; return *reinterpret_cast<::VROSC::VideoInfo**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.VideoButton <>4__this [[deprecated("Use field access instead!")]] ::VROSC::VideoButton*& VROSC::VideoButton::$DownloadThumbnail$d__5::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::$DownloadThumbnail$d__5::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<::VROSC::VideoButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Networking.UnityWebRequest <request>5__2 [[deprecated("Use field access instead!")]] ::UnityEngine::Networking::UnityWebRequest*& VROSC::VideoButton::$DownloadThumbnail$d__5::dyn_$request$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::$DownloadThumbnail$d__5::dyn_$request$5__2"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<request>5__2"))->offset; return *reinterpret_cast<::UnityEngine::Networking::UnityWebRequest**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::VideoButton::$DownloadThumbnail$d__5::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::$DownloadThumbnail$d__5::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.VideoButton/VROSC.<DownloadThumbnail>d__5.MoveNext void VROSC::VideoButton::$DownloadThumbnail$d__5::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::$DownloadThumbnail$d__5::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::VideoButton::$DownloadThumbnail$d__5), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideoButton/VROSC.<DownloadThumbnail>d__5.SetStateMachine void VROSC::VideoButton::$DownloadThumbnail$d__5::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoButton::$DownloadThumbnail$d__5::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::VideoButton::$DownloadThumbnail$d__5), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.VideoUI #include "VROSC/VideoUI.hpp" // Including type: VROSC.VideoUI/VROSC.<Play>d__19 #include "VROSC/VideoUI_-Play-d__19.hpp" // Including type: UnityEngine.Video.VideoPlayer #include "UnityEngine/Video/VideoPlayer.hpp" // Including type: VROSC.UIButton #include "VROSC/UIButton.hpp" // Including type: UnityEngine.GameObject #include "UnityEngine/GameObject.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: UnityEngine.AudioSource #include "UnityEngine/AudioSource.hpp" // Including type: VROSC.UISlider #include "VROSC/UISlider.hpp" // Including type: VROSC.TimeSlider #include "VROSC/TimeSlider.hpp" // Including type: System.Action #include "System/Action.hpp" // Including type: VROSC.UserDataControllers #include "VROSC/UserDataControllers.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 OnClose ::System::Action* VROSC::VideoUI::_get_OnClose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::_get_OnClose"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action*>("VROSC", "VideoUI", "OnClose")); } // Autogenerated static field setter // Set static field: static public System.Action OnClose void VROSC::VideoUI::_set_OnClose(::System::Action* value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::_set_OnClose"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "VideoUI", "OnClose", value)); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Video.VideoPlayer _videoPlayer [[deprecated("Use field access instead!")]] ::UnityEngine::Video::VideoPlayer*& VROSC::VideoUI::dyn__videoPlayer() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__videoPlayer"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_videoPlayer"))->offset; return *reinterpret_cast<::UnityEngine::Video::VideoPlayer**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIButton _closeButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::VideoUI::dyn__closeButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__closeButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_closeButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIButton _playPauseButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::VideoUI::dyn__playPauseButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__playPauseButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_playPauseButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIButton _videoAreaButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::VideoUI::dyn__videoAreaButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__videoAreaButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_videoAreaButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _playIcon [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::VideoUI::dyn__playIcon() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__playIcon"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_playIcon"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _pauseIcon [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::VideoUI::dyn__pauseIcon() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__pauseIcon"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pauseIcon"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _loadingIcon [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::VideoUI::dyn__loadingIcon() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__loadingIcon"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_loadingIcon"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _videoSurface [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::VideoUI::dyn__videoSurface() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__videoSurface"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_videoSurface"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _header [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::VideoUI::dyn__header() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__header"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_header"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _timeText [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::VideoUI::dyn__timeText() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__timeText"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_timeText"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.AudioSource _audioSource [[deprecated("Use field access instead!")]] ::UnityEngine::AudioSource*& VROSC::VideoUI::dyn__audioSource() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__audioSource"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_audioSource"))->offset; return *reinterpret_cast<::UnityEngine::AudioSource**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlider _volumeSlider [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::VideoUI::dyn__volumeSlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__volumeSlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_volumeSlider"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.TimeSlider _timeSlider [[deprecated("Use field access instead!")]] ::VROSC::TimeSlider*& VROSC::VideoUI::dyn__timeSlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__timeSlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_timeSlider"))->offset; return *reinterpret_cast<::VROSC::TimeSlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _shouldPlay [[deprecated("Use field access instead!")]] bool& VROSC::VideoUI::dyn__shouldPlay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::dyn__shouldPlay"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_shouldPlay"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.VideoUI.Awake void VROSC::VideoUI::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::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: VROSC.VideoUI.Setup void VROSC::VideoUI::Setup() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideoUI.UserDataLoaded void VROSC::VideoUI::UserDataLoaded(::VROSC::UserDataControllers* user) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::UserDataLoaded"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UserDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(user)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user); } // Autogenerated method: VROSC.VideoUI.TogglePlay void VROSC::VideoUI::TogglePlay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::TogglePlay"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "TogglePlay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideoUI.Play void VROSC::VideoUI::Play() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::Play"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Play", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideoUI.Pause void VROSC::VideoUI::Pause() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::Pause"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Pause", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideoUI.Stop void VROSC::VideoUI::Stop() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::Stop"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Stop", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideoUI.Open void VROSC::VideoUI::Open(::StringW videoPath, ::StringW title) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::Open"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Open", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(videoPath), ::il2cpp_utils::ExtractType(title)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, videoPath, title); } // Autogenerated method: VROSC.VideoUI.Close void VROSC::VideoUI::Close() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::Close"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Close", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideoUI.VolumeChanged void VROSC::VideoUI::VolumeChanged(float newVolume) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::VolumeChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "VolumeChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(newVolume)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, newVolume); } // Autogenerated method: VROSC.VideoUI.EndReached void VROSC::VideoUI::EndReached(::UnityEngine::Video::VideoPlayer* videoPlayer) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::EndReached"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndReached", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(videoPlayer)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, videoPlayer); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.VideoUI/VROSC.<Play>d__19 #include "VROSC/VideoUI_-Play-d__19.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::VideoUI::$Play$d__19::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::$Play$d__19::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: public System.Runtime.CompilerServices.AsyncVoidMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncVoidMethodBuilder& VROSC::VideoUI::$Play$d__19::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::$Play$d__19::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncVoidMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.VideoUI <>4__this [[deprecated("Use field access instead!")]] ::VROSC::VideoUI*& VROSC::VideoUI::$Play$d__19::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::$Play$d__19::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<::VROSC::VideoUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::VideoUI::$Play$d__19::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::$Play$d__19::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.VideoUI/VROSC.<Play>d__19.MoveNext void VROSC::VideoUI::$Play$d__19::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::$Play$d__19::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::VideoUI::$Play$d__19), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideoUI/VROSC.<Play>d__19.SetStateMachine void VROSC::VideoUI::$Play$d__19::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoUI::$Play$d__19::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::VideoUI::$Play$d__19), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.VideosPanelUI #include "VROSC/VideosPanelUI.hpp" // Including type: VROSC.VideosPanelUI/VROSC.<Awake>d__6 #include "VROSC/VideosPanelUI_-Awake-d__6.hpp" // Including type: UnityEngine.GameObject #include "UnityEngine/GameObject.hpp" // Including type: VROSC.PaginatedList #include "VROSC/PaginatedList.hpp" // Including type: System.Collections.Generic.List`1 #include "System/Collections/Generic/List_1.hpp" // Including type: VROSC.PaginatedListDataHolder #include "VROSC/PaginatedListDataHolder.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.GameObject _loadingIcon [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::VideosPanelUI::dyn__loadingIcon() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::dyn__loadingIcon"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_loadingIcon"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _noVideosErrorLabel [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::VideosPanelUI::dyn__noVideosErrorLabel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::dyn__noVideosErrorLabel"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_noVideosErrorLabel"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _connectionErrorLabel [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::VideosPanelUI::dyn__connectionErrorLabel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::dyn__connectionErrorLabel"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_connectionErrorLabel"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.PaginatedList _paginatedList [[deprecated("Use field access instead!")]] ::VROSC::PaginatedList*& VROSC::VideosPanelUI::dyn__paginatedList() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::dyn__paginatedList"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_paginatedList"))->offset; return *reinterpret_cast<::VROSC::PaginatedList**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Collections.Generic.List`1<VROSC.PaginatedListDataHolder> _dataList [[deprecated("Use field access instead!")]] ::System::Collections::Generic::List_1<::VROSC::PaginatedListDataHolder*>*& VROSC::VideosPanelUI::dyn__dataList() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::dyn__dataList"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_dataList"))->offset; return *reinterpret_cast<::System::Collections::Generic::List_1<::VROSC::PaginatedListDataHolder*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.PaginatedListDataHolder _selectedDataHolder [[deprecated("Use field access instead!")]] ::VROSC::PaginatedListDataHolder*& VROSC::VideosPanelUI::dyn__selectedDataHolder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::dyn__selectedDataHolder"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_selectedDataHolder"))->offset; return *reinterpret_cast<::VROSC::PaginatedListDataHolder**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.VideosPanelUI.Awake void VROSC::VideosPanelUI::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::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: VROSC.VideosPanelUI.VideoButtonPressed void VROSC::VideosPanelUI::VideoButtonPressed(::VROSC::PaginatedListDataHolder* dataHolder) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::VideoButtonPressed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "VideoButtonPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dataHolder)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, dataHolder); } // Autogenerated method: VROSC.VideosPanelUI.VideoPlayerClosed void VROSC::VideosPanelUI::VideoPlayerClosed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::VideoPlayerClosed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "VideoPlayerClosed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideosPanelUI.IsVersionCompatible bool VROSC::VideosPanelUI::IsVersionCompatible(::StringW requiredVersion, ::StringW versionToCheck) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::IsVersionCompatible"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "IsVersionCompatible", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(requiredVersion), ::il2cpp_utils::ExtractType(versionToCheck)}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, requiredVersion, versionToCheck); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.VideosPanelUI/VROSC.<Awake>d__6 #include "VROSC/VideosPanelUI_-Awake-d__6.hpp" // Including type: UnityEngine.Networking.UnityWebRequest #include "UnityEngine/Networking/UnityWebRequest.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::VideosPanelUI::$Awake$d__6::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::$Awake$d__6::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: public System.Runtime.CompilerServices.AsyncVoidMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncVoidMethodBuilder& VROSC::VideosPanelUI::$Awake$d__6::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::$Awake$d__6::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncVoidMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.VideosPanelUI <>4__this [[deprecated("Use field access instead!")]] ::VROSC::VideosPanelUI*& VROSC::VideosPanelUI::$Awake$d__6::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::$Awake$d__6::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<::VROSC::VideosPanelUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Networking.UnityWebRequest <request>5__2 [[deprecated("Use field access instead!")]] ::UnityEngine::Networking::UnityWebRequest*& VROSC::VideosPanelUI::$Awake$d__6::dyn_$request$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::$Awake$d__6::dyn_$request$5__2"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<request>5__2"))->offset; return *reinterpret_cast<::UnityEngine::Networking::UnityWebRequest**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::VideosPanelUI::$Awake$d__6::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::$Awake$d__6::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.VideosPanelUI/VROSC.<Awake>d__6.MoveNext void VROSC::VideosPanelUI::$Awake$d__6::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::$Awake$d__6::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::VideosPanelUI::$Awake$d__6), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideosPanelUI/VROSC.<Awake>d__6.SetStateMachine void VROSC::VideosPanelUI::$Awake$d__6::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosPanelUI::$Awake$d__6::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::VideosPanelUI::$Awake$d__6), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.VideoInfo #include "VROSC/VideoInfo.hpp" // Including type: UnityEngine.Texture #include "UnityEngine/Texture.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.String VideoId [[deprecated("Use field access instead!")]] ::StringW& VROSC::VideoInfo::dyn_VideoId() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoInfo::dyn_VideoId"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VideoId"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String VideoPath [[deprecated("Use field access instead!")]] ::StringW& VROSC::VideoInfo::dyn_VideoPath() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoInfo::dyn_VideoPath"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VideoPath"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String Title [[deprecated("Use field access instead!")]] ::StringW& VROSC::VideoInfo::dyn_Title() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoInfo::dyn_Title"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Title"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String RequiredVersion [[deprecated("Use field access instead!")]] ::StringW& VROSC::VideoInfo::dyn_RequiredVersion() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoInfo::dyn_RequiredVersion"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "RequiredVersion"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Texture <Thumbnail>k__BackingField [[deprecated("Use field access instead!")]] ::UnityEngine::Texture*& VROSC::VideoInfo::dyn_$Thumbnail$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoInfo::dyn_$Thumbnail$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Thumbnail>k__BackingField"))->offset; return *reinterpret_cast<::UnityEngine::Texture**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.VideoInfo.get_Thumbnail ::UnityEngine::Texture* VROSC::VideoInfo::get_Thumbnail() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoInfo::get_Thumbnail"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Thumbnail", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Texture*, false>(this, ___internal__method); } // Autogenerated method: VROSC.VideoInfo.set_Thumbnail void VROSC::VideoInfo::set_Thumbnail(::UnityEngine::Texture* value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideoInfo::set_Thumbnail"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Thumbnail", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.VideosSettings #include "VROSC/VideosSettings.hpp" // Including type: VROSC.VideoInfo #include "VROSC/VideoInfo.hpp" // Including type: System.String #include "System/String.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 RequiredVersion ::StringW VROSC::VideosSettings::_get_RequiredVersion() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosSettings::_get_RequiredVersion"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "VideosSettings", "RequiredVersion")); } // Autogenerated static field setter // Set static field: static public System.String RequiredVersion void VROSC::VideosSettings::_set_RequiredVersion(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosSettings::_set_RequiredVersion"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "VideosSettings", "RequiredVersion", value)); } // Autogenerated instance field getter // Get instance field: private VROSC.VideoInfo[] _videoInfos [[deprecated("Use field access instead!")]] ::ArrayW<::VROSC::VideoInfo*>& VROSC::VideosSettings::dyn__videoInfos() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosSettings::dyn__videoInfos"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_videoInfos"))->offset; return *reinterpret_cast<::ArrayW<::VROSC::VideoInfo*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.VideosSettings.GenerateJson void VROSC::VideosSettings::GenerateJson() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::VideosSettings::GenerateJson"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GenerateJson", 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: VROSC.UIColorPicker #include "VROSC/UIColorPicker.hpp" // Including type: VROSC.UIColorPicker/VROSC.UIColorPickerData #include "VROSC/UIColorPicker_UIColorPickerData.hpp" // Including type: VROSC.UIColorPicker/VROSC.<GrabSliderRemotely>d__21 #include "VROSC/UIColorPicker_-GrabSliderRemotely-d__21.hpp" // Including type: VROSC.UIColorPicker/VROSC.<GrabPicker>d__23 #include "VROSC/UIColorPicker_-GrabPicker-d__23.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: UnityEngine.RectTransform #include "UnityEngine/RectTransform.hpp" // Including type: UnityEngine.Vector2 #include "UnityEngine/Vector2.hpp" // Including type: VROSC.ClickData #include "VROSC/ClickData.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.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.Color <Color>k__BackingField [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::UIColorPicker::dyn_$Color$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::dyn_$Color$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Color>k__BackingField"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<UnityEngine.Color> OnColorPicked [[deprecated("Use field access instead!")]] ::System::Action_1<::UnityEngine::Color>*& VROSC::UIColorPicker::dyn_OnColorPicked() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::dyn_OnColorPicked"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnColorPicked"))->offset; return *reinterpret_cast<::System::Action_1<::UnityEngine::Color>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIColorPicker/VROSC.UIColorPickerData _data [[deprecated("Use field access instead!")]] ::VROSC::UIColorPicker::UIColorPickerData*& VROSC::UIColorPicker::dyn__data() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::dyn__data"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_data"))->offset; return *reinterpret_cast<::VROSC::UIColorPicker::UIColorPickerData**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InputDevice _grabbingDevice [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UIColorPicker::dyn__grabbingDevice() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::dyn__grabbingDevice"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_grabbingDevice"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.TriggerButton _grabbingButton [[deprecated("Use field access instead!")]] ::VROSC::TriggerButton& VROSC::UIColorPicker::dyn__grabbingButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::dyn__grabbingButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_grabbingButton"))->offset; return *reinterpret_cast<::VROSC::TriggerButton*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _uiHelperActive [[deprecated("Use field access instead!")]] bool& VROSC::UIColorPicker::dyn__uiHelperActive() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::dyn__uiHelperActive"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_uiHelperActive"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.RectTransform _rectTransform [[deprecated("Use field access instead!")]] ::UnityEngine::RectTransform*& VROSC::UIColorPicker::dyn__rectTransform() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::dyn__rectTransform"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rectTransform"))->offset; return *reinterpret_cast<::UnityEngine::RectTransform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIColorPicker.get_Size ::UnityEngine::Vector2 VROSC::UIColorPicker::get_Size() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::get_Size"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Size", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector2, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker.get_Data ::VROSC::UIColorPicker::UIColorPickerData* VROSC::UIColorPicker::get_Data() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::get_Data"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Data", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::UIColorPicker::UIColorPickerData*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker.get_Color ::UnityEngine::Color VROSC::UIColorPicker::get_Color() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::get_Color"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Color", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker.set_Color void VROSC::UIColorPicker::set_Color(::UnityEngine::Color value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::set_Color"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Color", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.UIColorPicker.Awake void VROSC::UIColorPicker::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::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: VROSC.UIColorPicker.OnDestroy void VROSC::UIColorPicker::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker.OnEnable void VROSC::UIColorPicker::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::OnEnable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker.StopGrabPicker void VROSC::UIColorPicker::StopGrabPicker(::VROSC::InputDevice* device, ::VROSC::TriggerButton button) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::StopGrabPicker"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopGrabPicker", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(button)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, button); } // Autogenerated method: VROSC.UIColorPicker.ButtonWasPressed void VROSC::UIColorPicker::ButtonWasPressed(::VROSC::ClickData* clickData) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::ButtonWasPressed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ButtonWasPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(clickData)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clickData); } // Autogenerated method: VROSC.UIColorPicker.GrabSliderRemotely ::System::Collections::IEnumerator* VROSC::UIColorPicker::GrabSliderRemotely(::VROSC::InputDevice* device, ::VROSC::TriggerButton grabbingButton) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::GrabSliderRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GrabSliderRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(grabbingButton)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, device, grabbingButton); } // Autogenerated method: VROSC.UIColorPicker.StopGrabRemotely void VROSC::UIColorPicker::StopGrabRemotely(::VROSC::InputDevice* device) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::StopGrabRemotely"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopGrabRemotely", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device); } // Autogenerated method: VROSC.UIColorPicker.GrabPicker ::System::Collections::IEnumerator* VROSC::UIColorPicker::GrabPicker(::VROSC::InputDevice* device, ::VROSC::TriggerButton grabbingButton, bool pointing) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::GrabPicker"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GrabPicker", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(grabbingButton), ::il2cpp_utils::ExtractType(pointing)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, device, grabbingButton, pointing); } // Autogenerated method: VROSC.UIColorPicker.GetRectTransform void VROSC::UIColorPicker::GetRectTransform() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::GetRectTransform"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetRectTransform", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker.GetSize ::UnityEngine::Vector2 VROSC::UIColorPicker::GetSize() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::GetSize"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetSize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector2, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker.SetColor void VROSC::UIColorPicker::SetColor(::UnityEngine::Color color, bool useCallback) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::SetColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(color), ::il2cpp_utils::ExtractType(useCallback)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, color, useCallback); } // Autogenerated method: VROSC.UIColorPicker.OnDisable void VROSC::UIColorPicker::OnDisable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::OnDisable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::Interactable*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.UIColorPicker/VROSC.UIColorPickerData #include "VROSC/UIColorPicker_UIColorPickerData.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: private System.String _displayName [[deprecated("Use field access instead!")]] ::StringW& VROSC::UIColorPicker::UIColorPickerData::dyn__displayName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::UIColorPickerData::dyn__displayName"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_displayName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIColorPicker/VROSC.UIColorPickerData.get_DisplayName ::StringW VROSC::UIColorPicker::UIColorPickerData::get_DisplayName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::UIColorPickerData::get_DisplayName"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DisplayName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker/VROSC.UIColorPickerData.SetDisplayName void VROSC::UIColorPicker::UIColorPickerData::SetDisplayName(::StringW displayName) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::UIColorPickerData::SetDisplayName"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetDisplayName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(displayName)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, displayName); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UIColorPicker/VROSC.<GrabSliderRemotely>d__21 #include "VROSC/UIColorPicker_-GrabSliderRemotely-d__21.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 [[deprecated("Use field access instead!")]] int& VROSC::UIColorPicker::$GrabSliderRemotely$d__21::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabSliderRemotely$d__21::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UIColorPicker::$GrabSliderRemotely$d__21::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabSliderRemotely$d__21::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UIColorPicker <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UIColorPicker*& VROSC::UIColorPicker::$GrabSliderRemotely$d__21::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabSliderRemotely$d__21::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<::VROSC::UIColorPicker**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.InputDevice device [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UIColorPicker::$GrabSliderRemotely$d__21::dyn_device() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabSliderRemotely$d__21::dyn_device"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "device"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.TriggerButton grabbingButton [[deprecated("Use field access instead!")]] ::VROSC::TriggerButton& VROSC::UIColorPicker::$GrabSliderRemotely$d__21::dyn_grabbingButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabSliderRemotely$d__21::dyn_grabbingButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "grabbingButton"))->offset; return *reinterpret_cast<::VROSC::TriggerButton*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIColorPicker/VROSC.<GrabSliderRemotely>d__21.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UIColorPicker::$GrabSliderRemotely$d__21::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabSliderRemotely$d__21::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPicker::$GrabSliderRemotely$d__21*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker/VROSC.<GrabSliderRemotely>d__21.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UIColorPicker::$GrabSliderRemotely$d__21::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabSliderRemotely$d__21::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPicker::$GrabSliderRemotely$d__21*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker/VROSC.<GrabSliderRemotely>d__21.System.IDisposable.Dispose void VROSC::UIColorPicker::$GrabSliderRemotely$d__21::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabSliderRemotely$d__21::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPicker::$GrabSliderRemotely$d__21*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker/VROSC.<GrabSliderRemotely>d__21.MoveNext bool VROSC::UIColorPicker::$GrabSliderRemotely$d__21::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabSliderRemotely$d__21::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPicker::$GrabSliderRemotely$d__21*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker/VROSC.<GrabSliderRemotely>d__21.System.Collections.IEnumerator.Reset void VROSC::UIColorPicker::$GrabSliderRemotely$d__21::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabSliderRemotely$d__21::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPicker::$GrabSliderRemotely$d__21*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.UIColorPicker/VROSC.<GrabPicker>d__23 #include "VROSC/UIColorPicker_-GrabPicker-d__23.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 [[deprecated("Use field access instead!")]] int& VROSC::UIColorPicker::$GrabPicker$d__23::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::UIColorPicker::$GrabPicker$d__23::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.UIColorPicker <>4__this [[deprecated("Use field access instead!")]] ::VROSC::UIColorPicker*& VROSC::UIColorPicker::$GrabPicker$d__23::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::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<::VROSC::UIColorPicker**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.InputDevice device [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::UIColorPicker::$GrabPicker$d__23::dyn_device() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::dyn_device"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "device"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.TriggerButton grabbingButton [[deprecated("Use field access instead!")]] ::VROSC::TriggerButton& VROSC::UIColorPicker::$GrabPicker$d__23::dyn_grabbingButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::dyn_grabbingButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "grabbingButton"))->offset; return *reinterpret_cast<::VROSC::TriggerButton*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Boolean pointing [[deprecated("Use field access instead!")]] bool& VROSC::UIColorPicker::$GrabPicker$d__23::dyn_pointing() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::dyn_pointing"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "pointing"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.UIColorPicker/VROSC.<GrabPicker>d__23.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::UIColorPicker::$GrabPicker$d__23::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPicker::$GrabPicker$d__23*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker/VROSC.<GrabPicker>d__23.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::UIColorPicker::$GrabPicker$d__23::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPicker::$GrabPicker$d__23*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker/VROSC.<GrabPicker>d__23.System.IDisposable.Dispose void VROSC::UIColorPicker::$GrabPicker$d__23::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPicker::$GrabPicker$d__23*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker/VROSC.<GrabPicker>d__23.MoveNext bool VROSC::UIColorPicker::$GrabPicker$d__23::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPicker::$GrabPicker$d__23*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.UIColorPicker/VROSC.<GrabPicker>d__23.System.Collections.IEnumerator.Reset void VROSC::UIColorPicker::$GrabPicker$d__23::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UIColorPicker::$GrabPicker$d__23::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::UIColorPicker::$GrabPicker$d__23*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.ChannelControlUI #include "VROSC/ChannelControlUI.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: VROSC.UISpinner #include "VROSC/UISpinner.hpp" // Including type: VROSC.SynthController #include "VROSC/SynthController.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 TMPro.TextMeshPro _label [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::ChannelControlUI::dyn__label() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ChannelControlUI::dyn__label"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_label"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISpinner _uISpinner [[deprecated("Use field access instead!")]] ::VROSC::UISpinner*& VROSC::ChannelControlUI::dyn__uISpinner() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ChannelControlUI::dyn__uISpinner"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_uISpinner"))->offset; return *reinterpret_cast<::VROSC::UISpinner**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.SynthController _instrument [[deprecated("Use field access instead!")]] ::VROSC::SynthController*& VROSC::ChannelControlUI::dyn__instrument() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ChannelControlUI::dyn__instrument"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instrument"))->offset; return *reinterpret_cast<::VROSC::SynthController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _usingMidi [[deprecated("Use field access instead!")]] bool& VROSC::ChannelControlUI::dyn__usingMidi() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ChannelControlUI::dyn__usingMidi"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_usingMidi"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.ChannelControlUI.Start void VROSC::ChannelControlUI::Start() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ChannelControlUI::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: VROSC.ChannelControlUI.Setup void VROSC::ChannelControlUI::Setup(::VROSC::SynthController* instrument) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ChannelControlUI::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrument)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, instrument); } // Autogenerated method: VROSC.ChannelControlUI.UseMidiChanged void VROSC::ChannelControlUI::UseMidiChanged(bool usingMidi) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ChannelControlUI::UseMidiChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UseMidiChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(usingMidi)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, usingMidi); } // Autogenerated method: VROSC.ChannelControlUI.Toggled void VROSC::ChannelControlUI::Toggled(bool isActive) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ChannelControlUI::Toggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Toggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(isActive)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, isActive); } // Autogenerated method: VROSC.ChannelControlUI.SetData void VROSC::ChannelControlUI::SetData(bool usingMidi) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ChannelControlUI::SetData"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(usingMidi)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, usingMidi); } // Autogenerated method: VROSC.ChannelControlUI.UpdateSelection void VROSC::ChannelControlUI::UpdateSelection(int selectedIndex) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ChannelControlUI::UpdateSelection"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateSelection", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(selectedIndex)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, selectedIndex); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.ControlPanelUI #include "VROSC/ControlPanelUI.hpp" // Including type: VROSC.TransformMoverRelay #include "VROSC/TransformMoverRelay.hpp" // Including type: VROSC.InfoPanel #include "VROSC/InfoPanel.hpp" // Including type: VROSC.UIToggle #include "VROSC/UIToggle.hpp" // Including type: VROSC.UIButton #include "VROSC/UIButton.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: System.Action #include "System/Action.hpp" // Including type: VROSC.WidgetController #include "VROSC/WidgetController.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 VROSC.TransformMoverRelay _transformMoverRelay [[deprecated("Use field access instead!")]] ::VROSC::TransformMoverRelay*& VROSC::ControlPanelUI::dyn__transformMoverRelay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::dyn__transformMoverRelay"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_transformMoverRelay"))->offset; return *reinterpret_cast<::VROSC::TransformMoverRelay**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InfoPanel _infoPanelUI [[deprecated("Use field access instead!")]] ::VROSC::InfoPanel*& VROSC::ControlPanelUI::dyn__infoPanelUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::dyn__infoPanelUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_infoPanelUI"))->offset; return *reinterpret_cast<::VROSC::InfoPanel**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIToggle _infoButton [[deprecated("Use field access instead!")]] ::VROSC::UIToggle*& VROSC::ControlPanelUI::dyn__infoButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::dyn__infoButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_infoButton"))->offset; return *reinterpret_cast<::VROSC::UIToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIButton _closeButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::ControlPanelUI::dyn__closeButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::dyn__closeButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_closeButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected TMPro.TextMeshPro _header [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::ControlPanelUI::dyn__header() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::dyn__header"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_header"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action OnClosePressed [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::ControlPanelUI::dyn_OnClosePressed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::dyn_OnClosePressed"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnClosePressed"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.ControlPanelUI.get_TransformMoverRelay ::VROSC::TransformMoverRelay* VROSC::ControlPanelUI::get_TransformMoverRelay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::get_TransformMoverRelay"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_TransformMoverRelay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::TransformMoverRelay*, false>(this, ___internal__method); } // Autogenerated method: VROSC.ControlPanelUI.Awake void VROSC::ControlPanelUI::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::Awake"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ControlPanelUI*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ControlPanelUI.OnDestroy void VROSC::ControlPanelUI::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::OnDestroy"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ControlPanelUI*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ControlPanelUI.Setup void VROSC::ControlPanelUI::Setup(::VROSC::WidgetController* widgetController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ControlPanelUI*), 6)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, widgetController); } // Autogenerated method: VROSC.ControlPanelUI.InfoButtonToggled void VROSC::ControlPanelUI::InfoButtonToggled(::VROSC::InputDevice* device, bool isOn) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::InfoButtonToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InfoButtonToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(isOn)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, isOn); } // Autogenerated method: VROSC.ControlPanelUI.CloseButtonPressed void VROSC::ControlPanelUI::CloseButtonPressed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ControlPanelUI::CloseButtonPressed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CloseButtonPressed", 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: VROSC.DrumEffectsUI #include "VROSC/DrumEffectsUI.hpp" // Including type: VROSC.UISlider #include "VROSC/UISlider.hpp" // Including type: VROSC.AnimatedPanel #include "VROSC/AnimatedPanel.hpp" // Including type: VROSC.ModularDrumsDataController #include "VROSC/ModularDrumsDataController.hpp" // Including type: VROSC.ModularDrumsController #include "VROSC/ModularDrumsController.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 VROSC.UISlider _reverbAmountSlider [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::DrumEffectsUI::dyn__reverbAmountSlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::dyn__reverbAmountSlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_reverbAmountSlider"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlider _reverbLengthSlider [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::DrumEffectsUI::dyn__reverbLengthSlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::dyn__reverbLengthSlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_reverbLengthSlider"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlider _dryVolumeSlider [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::DrumEffectsUI::dyn__dryVolumeSlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::dyn__dryVolumeSlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_dryVolumeSlider"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlider _compressionSlider [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::DrumEffectsUI::dyn__compressionSlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::dyn__compressionSlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_compressionSlider"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AnimatedPanel _animation [[deprecated("Use field access instead!")]] ::VROSC::AnimatedPanel*& VROSC::DrumEffectsUI::dyn__animation() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::dyn__animation"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_animation"))->offset; return *reinterpret_cast<::VROSC::AnimatedPanel**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ModularDrumsDataController _dataController [[deprecated("Use field access instead!")]] ::VROSC::ModularDrumsDataController*& VROSC::DrumEffectsUI::dyn__dataController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::dyn__dataController"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_dataController"))->offset; return *reinterpret_cast<::VROSC::ModularDrumsDataController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.DrumEffectsUI.Setup void VROSC::DrumEffectsUI::Setup(::VROSC::ModularDrumsController* controller) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(controller)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, controller); } // Autogenerated method: VROSC.DrumEffectsUI.SetActive void VROSC::DrumEffectsUI::SetActive(bool shouldBeOpen, bool animate) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::SetActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(shouldBeOpen), ::il2cpp_utils::ExtractType(animate)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, shouldBeOpen, animate); } // Autogenerated method: VROSC.DrumEffectsUI.DataLoaded void VROSC::DrumEffectsUI::DataLoaded(::VROSC::ModularDrumsDataController* dataController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::DataLoaded"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dataController)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, dataController); } // Autogenerated method: VROSC.DrumEffectsUI.OnDestroy void VROSC::DrumEffectsUI::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.DrumEffectsUI.SetReverbAmount void VROSC::DrumEffectsUI::SetReverbAmount(float amount) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::SetReverbAmount"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetReverbAmount", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(amount)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, amount); } // Autogenerated method: VROSC.DrumEffectsUI.SetReverbLength void VROSC::DrumEffectsUI::SetReverbLength(float length) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::SetReverbLength"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetReverbLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(length)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, length); } // Autogenerated method: VROSC.DrumEffectsUI.SetDryVolume void VROSC::DrumEffectsUI::SetDryVolume(float volume) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::SetDryVolume"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetDryVolume", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(volume)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, volume); } // Autogenerated method: VROSC.DrumEffectsUI.SetCompression void VROSC::DrumEffectsUI::SetCompression(float compression) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumEffectsUI::SetCompression"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetCompression", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(compression)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, compression); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.DrumsControlPanelUI #include "VROSC/DrumsControlPanelUI.hpp" // Including type: VROSC.UIHoldButton #include "VROSC/UIHoldButton.hpp" // Including type: VROSC.UISlideToggle #include "VROSC/UISlideToggle.hpp" // Including type: VROSC.UISlider #include "VROSC/UISlider.hpp" // Including type: VROSC.UIToggle #include "VROSC/UIToggle.hpp" // Including type: VROSC.DrumEffectsUI #include "VROSC/DrumEffectsUI.hpp" // Including type: MalletSettingsPanel #include "GlobalNamespace/MalletSettingsPanel.hpp" // Including type: System.Action #include "System/Action.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.UserPreferencesDataController #include "VROSC/UserPreferencesDataController.hpp" // Including type: VROSC.WidgetController #include "VROSC/WidgetController.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 VROSC.UIHoldButton _deleteAllButton [[deprecated("Use field access instead!")]] ::VROSC::UIHoldButton*& VROSC::DrumsControlPanelUI::dyn__deleteAllButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::dyn__deleteAllButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_deleteAllButton"))->offset; return *reinterpret_cast<::VROSC::UIHoldButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlideToggle _previewSampleSoundsToggle [[deprecated("Use field access instead!")]] ::VROSC::UISlideToggle*& VROSC::DrumsControlPanelUI::dyn__previewSampleSoundsToggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::dyn__previewSampleSoundsToggle"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_previewSampleSoundsToggle"))->offset; return *reinterpret_cast<::VROSC::UISlideToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlider _previewVolumeSlider [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::DrumsControlPanelUI::dyn__previewVolumeSlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::dyn__previewVolumeSlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_previewVolumeSlider"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIToggle _effectsPanelButton [[deprecated("Use field access instead!")]] ::VROSC::UIToggle*& VROSC::DrumsControlPanelUI::dyn__effectsPanelButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::dyn__effectsPanelButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_effectsPanelButton"))->offset; return *reinterpret_cast<::VROSC::UIToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.DrumEffectsUI _drumEffectsUI [[deprecated("Use field access instead!")]] ::VROSC::DrumEffectsUI*& VROSC::DrumsControlPanelUI::dyn__drumEffectsUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::dyn__drumEffectsUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_drumEffectsUI"))->offset; return *reinterpret_cast<::VROSC::DrumEffectsUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private MalletSettingsPanel _malletSettingsPanel [[deprecated("Use field access instead!")]] ::GlobalNamespace::MalletSettingsPanel*& VROSC::DrumsControlPanelUI::dyn__malletSettingsPanel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::dyn__malletSettingsPanel"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_malletSettingsPanel"))->offset; return *reinterpret_cast<::GlobalNamespace::MalletSettingsPanel**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action OnDeleteAll [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::DrumsControlPanelUI::dyn_OnDeleteAll() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::dyn_OnDeleteAll"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnDeleteAll"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.DrumsControlPanelUI.SetPreviewVolume void VROSC::DrumsControlPanelUI::SetPreviewVolume(float volume) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::SetPreviewVolume"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPreviewVolume", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(volume)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, volume); } // Autogenerated method: VROSC.DrumsControlPanelUI.SetPreviewSoundsToggled void VROSC::DrumsControlPanelUI::SetPreviewSoundsToggled(::VROSC::InputDevice* device, bool active) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::SetPreviewSoundsToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPreviewSoundsToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(active)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, active); } // Autogenerated method: VROSC.DrumsControlPanelUI.SetMalletsValues void VROSC::DrumsControlPanelUI::SetMalletsValues(::VROSC::UserPreferencesDataController* data) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::SetMalletsValues"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetMalletsValues", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(data)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, data); } // Autogenerated method: VROSC.DrumsControlPanelUI.SetPreviewValues void VROSC::DrumsControlPanelUI::SetPreviewValues(::VROSC::UserPreferencesDataController* data) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::SetPreviewValues"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPreviewValues", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(data)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, data); } // Autogenerated method: VROSC.DrumsControlPanelUI.EffectsPanelButtonToggled void VROSC::DrumsControlPanelUI::EffectsPanelButtonToggled(::VROSC::InputDevice* device, bool isOn) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::EffectsPanelButtonToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EffectsPanelButtonToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(isOn)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, isOn); } // Autogenerated method: VROSC.DrumsControlPanelUI.DeleteAllPressed void VROSC::DrumsControlPanelUI::DeleteAllPressed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::DeleteAllPressed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DeleteAllPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.DrumsControlPanelUI.Setup void VROSC::DrumsControlPanelUI::Setup(::VROSC::WidgetController* widgetController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentControlPanelUI*), 6)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, widgetController); } // Autogenerated method: VROSC.DrumsControlPanelUI.Awake void VROSC::DrumsControlPanelUI::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::Awake"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ControlPanelUI*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.DrumsControlPanelUI.OnDestroy void VROSC::DrumsControlPanelUI::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DrumsControlPanelUI::OnDestroy"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ControlPanelUI*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.IncrementDecrementUI #include "VROSC/IncrementDecrementUI.hpp" // Including type: VROSC.UIButton #include "VROSC/UIButton.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: VROSC.IntNode #include "VROSC/IntNode.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 VROSC.UIButton _incrementButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::IncrementDecrementUI::dyn__incrementButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::IncrementDecrementUI::dyn__incrementButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_incrementButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIButton _decrementButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::IncrementDecrementUI::dyn__decrementButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::IncrementDecrementUI::dyn__decrementButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_decrementButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected TMPro.TextMeshPro _display [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::IncrementDecrementUI::dyn__display() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::IncrementDecrementUI::dyn__display"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_display"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.IntNode _output [[deprecated("Use field access instead!")]] ::VROSC::IntNode*& VROSC::IncrementDecrementUI::dyn__output() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::IncrementDecrementUI::dyn__output"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_output"))->offset; return *reinterpret_cast<::VROSC::IntNode**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.IncrementDecrementUI.Start void VROSC::IncrementDecrementUI::Start() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::IncrementDecrementUI::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: VROSC.IncrementDecrementUI.IncrementButtonPressed void VROSC::IncrementDecrementUI::IncrementButtonPressed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::IncrementDecrementUI::IncrementButtonPressed"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::IncrementDecrementUI*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.IncrementDecrementUI.DecrementButtonPressed void VROSC::IncrementDecrementUI::DecrementButtonPressed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::IncrementDecrementUI::DecrementButtonPressed"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::IncrementDecrementUI*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.IncrementDecrementUI.OnDestroy void VROSC::IncrementDecrementUI::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::IncrementDecrementUI::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", 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: VROSC.InstrumentControlPanelUI #include "VROSC/InstrumentControlPanelUI.hpp" // Including type: VROSC.QuantizeUI #include "VROSC/QuantizeUI.hpp" // Including type: VROSC.InstrumentFrameDisplayUI #include "VROSC/InstrumentFrameDisplayUI.hpp" // Including type: VROSC.WidgetController #include "VROSC/WidgetController.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 VROSC.QuantizeUI _quantizeUI [[deprecated("Use field access instead!")]] ::VROSC::QuantizeUI*& VROSC::InstrumentControlPanelUI::dyn__quantizeUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentControlPanelUI::dyn__quantizeUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_quantizeUI"))->offset; return *reinterpret_cast<::VROSC::QuantizeUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InstrumentFrameDisplayUI _frameDisplayUI [[deprecated("Use field access instead!")]] ::VROSC::InstrumentFrameDisplayUI*& VROSC::InstrumentControlPanelUI::dyn__frameDisplayUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentControlPanelUI::dyn__frameDisplayUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_frameDisplayUI"))->offset; return *reinterpret_cast<::VROSC::InstrumentFrameDisplayUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.InstrumentControlPanelUI.UpdateFrameIsVisible void VROSC::InstrumentControlPanelUI::UpdateFrameIsVisible(bool frameIsVisible) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentControlPanelUI::UpdateFrameIsVisible"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateFrameIsVisible", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(frameIsVisible)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, frameIsVisible); } // Autogenerated method: VROSC.InstrumentControlPanelUI.Setup void VROSC::InstrumentControlPanelUI::Setup(::VROSC::WidgetController* widgetController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentControlPanelUI::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ControlPanelUI*), 6)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, widgetController); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.OctaveControlUI #include "VROSC/OctaveControlUI.hpp" // Including type: VROSC.UIButton #include "VROSC/UIButton.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: VROSC.IntNode #include "VROSC/IntNode.hpp" // Including type: VROSC.SynthController #include "VROSC/SynthController.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 VROSC.UIButton _incrementButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::OctaveControlUI::dyn__incrementButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::dyn__incrementButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_incrementButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIButton _decrementButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::OctaveControlUI::dyn__decrementButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::dyn__decrementButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_decrementButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected TMPro.TextMeshPro _display [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::OctaveControlUI::dyn__display() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::dyn__display"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_display"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.IntNode _output [[deprecated("Use field access instead!")]] ::VROSC::IntNode*& VROSC::OctaveControlUI::dyn__output() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::dyn__output"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_output"))->offset; return *reinterpret_cast<::VROSC::IntNode**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.SynthController _instrumentController [[deprecated("Use field access instead!")]] ::VROSC::SynthController*& VROSC::OctaveControlUI::dyn__instrumentController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::dyn__instrumentController"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instrumentController"))->offset; return *reinterpret_cast<::VROSC::SynthController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.OctaveControlUI.Setup void VROSC::OctaveControlUI::Setup(::VROSC::SynthController* instrumentController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::OctaveControlUI*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, instrumentController); } // Autogenerated method: VROSC.OctaveControlUI.Start void VROSC::OctaveControlUI::Start() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::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: VROSC.OctaveControlUI.OnEnable void VROSC::OctaveControlUI::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::OnEnable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.OctaveControlUI.IncrementButtonPressed void VROSC::OctaveControlUI::IncrementButtonPressed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::IncrementButtonPressed"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::OctaveControlUI*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.OctaveControlUI.DecrementButtonPressed void VROSC::OctaveControlUI::DecrementButtonPressed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::DecrementButtonPressed"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::OctaveControlUI*), 6)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.OctaveControlUI.UpdateDisplayAndOutput void VROSC::OctaveControlUI::UpdateDisplayAndOutput() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::UpdateDisplayAndOutput"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::OctaveControlUI*), 7)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.OctaveControlUI.OnDestroy void VROSC::OctaveControlUI::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::OctaveControlUI::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", 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: VROSC.QuantizeUI #include "VROSC/QuantizeUI.hpp" // Including type: VROSC.UISpinner #include "VROSC/UISpinner.hpp" // Including type: VROSC.UISlideToggle #include "VROSC/UISlideToggle.hpp" // Including type: VROSC.TempoSyncDisplay #include "VROSC/TempoSyncDisplay.hpp" // Including type: VROSC.InstrumentController #include "VROSC/InstrumentController.hpp" // Including type: System.Collections.Generic.List`1 #include "System/Collections/Generic/List_1.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 VROSC.UISpinner _quantize [[deprecated("Use field access instead!")]] ::VROSC::UISpinner*& VROSC::QuantizeUI::dyn__quantize() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::dyn__quantize"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_quantize"))->offset; return *reinterpret_cast<::VROSC::UISpinner**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlideToggle _quantizeLateHits [[deprecated("Use field access instead!")]] ::VROSC::UISlideToggle*& VROSC::QuantizeUI::dyn__quantizeLateHits() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::dyn__quantizeLateHits"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_quantizeLateHits"))->offset; return *reinterpret_cast<::VROSC::UISlideToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.TempoSyncDisplay _tempoSyncDisplay [[deprecated("Use field access instead!")]] ::VROSC::TempoSyncDisplay*& VROSC::QuantizeUI::dyn__tempoSyncDisplay() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::dyn__tempoSyncDisplay"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_tempoSyncDisplay"))->offset; return *reinterpret_cast<::VROSC::TempoSyncDisplay**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InstrumentController _instrument [[deprecated("Use field access instead!")]] ::VROSC::InstrumentController*& VROSC::QuantizeUI::dyn__instrument() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::dyn__instrument"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instrument"))->offset; return *reinterpret_cast<::VROSC::InstrumentController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _setQuantization [[deprecated("Use field access instead!")]] int& VROSC::QuantizeUI::dyn__setQuantization() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::dyn__setQuantization"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_setQuantization"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _setupDone [[deprecated("Use field access instead!")]] bool& VROSC::QuantizeUI::dyn__setupDone() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::dyn__setupDone"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_setupDone"))->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> _quantizeSelectionValues [[deprecated("Use field access instead!")]] ::System::Collections::Generic::List_1<::StringW>*& VROSC::QuantizeUI::dyn__quantizeSelectionValues() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::dyn__quantizeSelectionValues"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_quantizeSelectionValues"))->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.Int32[] _quantizeMap [[deprecated("Use field access instead!")]] ::ArrayW<int>& VROSC::QuantizeUI::dyn__quantizeMap() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::dyn__quantizeMap"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_quantizeMap"))->offset; return *reinterpret_cast<::ArrayW<int>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _hasStartedBeatCounter [[deprecated("Use field access instead!")]] bool& VROSC::QuantizeUI::dyn__hasStartedBeatCounter() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::dyn__hasStartedBeatCounter"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hasStartedBeatCounter"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.QuantizeUI.Setup void VROSC::QuantizeUI::Setup(::VROSC::InstrumentController* instrument) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrument)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, instrument); } // Autogenerated method: VROSC.QuantizeUI.OnEnable void VROSC::QuantizeUI::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::OnEnable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.QuantizeUI.OnDisable void VROSC::QuantizeUI::OnDisable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::OnDisable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDisable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.QuantizeUI.CheckIfQuantizationCanBeSet void VROSC::QuantizeUI::CheckIfQuantizationCanBeSet(float BPM) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::CheckIfQuantizationCanBeSet"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CheckIfQuantizationCanBeSet", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(BPM)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, BPM); } // Autogenerated method: VROSC.QuantizeUI.ApplyInstrumentQuantizeValues void VROSC::QuantizeUI::ApplyInstrumentQuantizeValues() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::ApplyInstrumentQuantizeValues"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ApplyInstrumentQuantizeValues", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.QuantizeUI.ChangeQuantizeLateHits void VROSC::QuantizeUI::ChangeQuantizeLateHits(::VROSC::InputDevice* inputDevice, bool quantizeLateHits) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::ChangeQuantizeLateHits"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ChangeQuantizeLateHits", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputDevice), ::il2cpp_utils::ExtractType(quantizeLateHits)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, inputDevice, quantizeLateHits); } // Autogenerated method: VROSC.QuantizeUI.QuantizeSelectionChanged void VROSC::QuantizeUI::QuantizeSelectionChanged(int selection) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::QuantizeSelectionChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "QuantizeSelectionChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(selection)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, selection); } // Autogenerated method: VROSC.QuantizeUI.ShouldDisableBeatCounter bool VROSC::QuantizeUI::ShouldDisableBeatCounter() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::ShouldDisableBeatCounter"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ShouldDisableBeatCounter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.QuantizeUI.SetQuantize void VROSC::QuantizeUI::SetQuantize(int quantize) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::QuantizeUI::SetQuantize"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetQuantize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(quantize)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, quantize); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.SynthControlPanelUI #include "VROSC/SynthControlPanelUI.hpp" // Including type: VROSC.ChannelControlUI #include "VROSC/ChannelControlUI.hpp" // Including type: VROSC.OctaveControlUI #include "VROSC/OctaveControlUI.hpp" // Including type: VROSC.EffectsPanel #include "VROSC/EffectsPanel.hpp" // Including type: VROSC.ScalePanelUI #include "VROSC/ScalePanelUI.hpp" // Including type: VROSC.UIToggle #include "VROSC/UIToggle.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.WidgetController #include "VROSC/WidgetController.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 VROSC.ChannelControlUI _chanelControllUI [[deprecated("Use field access instead!")]] ::VROSC::ChannelControlUI*& VROSC::SynthControlPanelUI::dyn__chanelControllUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::dyn__chanelControllUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_chanelControllUI"))->offset; return *reinterpret_cast<::VROSC::ChannelControlUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.OctaveControlUI _octaveControlUI [[deprecated("Use field access instead!")]] ::VROSC::OctaveControlUI*& VROSC::SynthControlPanelUI::dyn__octaveControlUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::dyn__octaveControlUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_octaveControlUI"))->offset; return *reinterpret_cast<::VROSC::OctaveControlUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.EffectsPanel _effectsPanelUI [[deprecated("Use field access instead!")]] ::VROSC::EffectsPanel*& VROSC::SynthControlPanelUI::dyn__effectsPanelUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::dyn__effectsPanelUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_effectsPanelUI"))->offset; return *reinterpret_cast<::VROSC::EffectsPanel**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ScalePanelUI _scalePanelUI [[deprecated("Use field access instead!")]] ::VROSC::ScalePanelUI*& VROSC::SynthControlPanelUI::dyn__scalePanelUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::dyn__scalePanelUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scalePanelUI"))->offset; return *reinterpret_cast<::VROSC::ScalePanelUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIToggle _scalePanelButton [[deprecated("Use field access instead!")]] ::VROSC::UIToggle*& VROSC::SynthControlPanelUI::dyn__scalePanelButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::dyn__scalePanelButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scalePanelButton"))->offset; return *reinterpret_cast<::VROSC::UIToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIToggle _effectsPanelButton [[deprecated("Use field access instead!")]] ::VROSC::UIToggle*& VROSC::SynthControlPanelUI::dyn__effectsPanelButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::dyn__effectsPanelButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_effectsPanelButton"))->offset; return *reinterpret_cast<::VROSC::UIToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.SynthControlPanelUI.SynthesizerChanged void VROSC::SynthControlPanelUI::SynthesizerChanged(bool useExternal) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::SynthesizerChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SynthesizerChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(useExternal)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, useExternal); } // Autogenerated method: VROSC.SynthControlPanelUI.ScalePanelButtonToggled void VROSC::SynthControlPanelUI::ScalePanelButtonToggled(::VROSC::InputDevice* device, bool isOn) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::ScalePanelButtonToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ScalePanelButtonToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(isOn)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, isOn); } // Autogenerated method: VROSC.SynthControlPanelUI.EffectsPanelButtonToggled void VROSC::SynthControlPanelUI::EffectsPanelButtonToggled(::VROSC::InputDevice* device, bool isOn) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::EffectsPanelButtonToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EffectsPanelButtonToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(isOn)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, isOn); } // Autogenerated method: VROSC.SynthControlPanelUI.Setup void VROSC::SynthControlPanelUI::Setup(::VROSC::WidgetController* widgetController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentControlPanelUI*), 6)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, widgetController); } // Autogenerated method: VROSC.SynthControlPanelUI.Awake void VROSC::SynthControlPanelUI::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::Awake"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ControlPanelUI*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthControlPanelUI.OnDestroy void VROSC::SynthControlPanelUI::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthControlPanelUI::OnDestroy"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ControlPanelUI*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.TempoSyncDisplay #include "VROSC/TempoSyncDisplay.hpp" // Including type: VROSC.TempoSyncDisplay/VROSC.<StrokeFlow>d__14 #include "VROSC/TempoSyncDisplay_-StrokeFlow-d__14.hpp" // Including type: UnityEngine.AnimationCurve #include "UnityEngine/AnimationCurve.hpp" // Including type: VROSC.AdjustableMesh #include "VROSC/AdjustableMesh.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.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.Color _offColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::TempoSyncDisplay::dyn__offColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::dyn__offColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_offColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _beatColor [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::TempoSyncDisplay::dyn__beatColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::dyn__beatColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_beatColor"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.AnimationCurve _strikeCurve [[deprecated("Use field access instead!")]] ::UnityEngine::AnimationCurve*& VROSC::TempoSyncDisplay::dyn__strikeCurve() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::dyn__strikeCurve"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_strikeCurve"))->offset; return *reinterpret_cast<::UnityEngine::AnimationCurve**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AdjustableMesh _beatVisual [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMesh*& VROSC::TempoSyncDisplay::dyn__beatVisual() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::dyn__beatVisual"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_beatVisual"))->offset; return *reinterpret_cast<::VROSC::AdjustableMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _beatDivision [[deprecated("Use field access instead!")]] int& VROSC::TempoSyncDisplay::dyn__beatDivision() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::dyn__beatDivision"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_beatDivision"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _lastSubdivision [[deprecated("Use field access instead!")]] int& VROSC::TempoSyncDisplay::dyn__lastSubdivision() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::dyn__lastSubdivision"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lastSubdivision"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _strikeduration [[deprecated("Use field access instead!")]] float& VROSC::TempoSyncDisplay::dyn__strikeduration() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::dyn__strikeduration"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_strikeduration"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _isOn [[deprecated("Use field access instead!")]] bool& VROSC::TempoSyncDisplay::dyn__isOn() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::dyn__isOn"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isOn"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.TempoSyncDisplay.Awake void VROSC::TempoSyncDisplay::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::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: VROSC.TempoSyncDisplay.Update void VROSC::TempoSyncDisplay::Update() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::Update"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.TempoSyncDisplay.OnDestroy void VROSC::TempoSyncDisplay::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.TempoSyncDisplay.SetBeatDivision void VROSC::TempoSyncDisplay::SetBeatDivision(int beatDivision) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::SetBeatDivision"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetBeatDivision", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(beatDivision)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, beatDivision); } // Autogenerated method: VROSC.TempoSyncDisplay.SetActive void VROSC::TempoSyncDisplay::SetActive(bool shouldBeActive) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::SetActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(shouldBeActive)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, shouldBeActive); } // Autogenerated method: VROSC.TempoSyncDisplay.MakeStroke void VROSC::TempoSyncDisplay::MakeStroke() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::MakeStroke"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MakeStroke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.TempoSyncDisplay.StrokeFlow ::System::Collections::IEnumerator* VROSC::TempoSyncDisplay::StrokeFlow() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::StrokeFlow"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StrokeFlow", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method); } // Autogenerated method: VROSC.TempoSyncDisplay.SetColor void VROSC::TempoSyncDisplay::SetColor(::UnityEngine::Color color) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::SetColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(color)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, color); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.TempoSyncDisplay/VROSC.<StrokeFlow>d__14 #include "VROSC/TempoSyncDisplay_-StrokeFlow-d__14.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 [[deprecated("Use field access instead!")]] int& VROSC::TempoSyncDisplay::$StrokeFlow$d__14::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::$StrokeFlow$d__14::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::TempoSyncDisplay::$StrokeFlow$d__14::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::$StrokeFlow$d__14::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.TempoSyncDisplay <>4__this [[deprecated("Use field access instead!")]] ::VROSC::TempoSyncDisplay*& VROSC::TempoSyncDisplay::$StrokeFlow$d__14::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::$StrokeFlow$d__14::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<::VROSC::TempoSyncDisplay**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single <time>5__2 [[deprecated("Use field access instead!")]] float& VROSC::TempoSyncDisplay::$StrokeFlow$d__14::dyn_$time$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::$StrokeFlow$d__14::dyn_$time$5__2"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<time>5__2"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.TempoSyncDisplay/VROSC.<StrokeFlow>d__14.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::TempoSyncDisplay::$StrokeFlow$d__14::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::$StrokeFlow$d__14::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::TempoSyncDisplay::$StrokeFlow$d__14*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.TempoSyncDisplay/VROSC.<StrokeFlow>d__14.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::TempoSyncDisplay::$StrokeFlow$d__14::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::$StrokeFlow$d__14::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::TempoSyncDisplay::$StrokeFlow$d__14*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.TempoSyncDisplay/VROSC.<StrokeFlow>d__14.System.IDisposable.Dispose void VROSC::TempoSyncDisplay::$StrokeFlow$d__14::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::$StrokeFlow$d__14::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::TempoSyncDisplay::$StrokeFlow$d__14*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.TempoSyncDisplay/VROSC.<StrokeFlow>d__14.MoveNext bool VROSC::TempoSyncDisplay::$StrokeFlow$d__14::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::$StrokeFlow$d__14::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::TempoSyncDisplay::$StrokeFlow$d__14*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.TempoSyncDisplay/VROSC.<StrokeFlow>d__14.System.Collections.IEnumerator.Reset void VROSC::TempoSyncDisplay::$StrokeFlow$d__14::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::TempoSyncDisplay::$StrokeFlow$d__14::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::TempoSyncDisplay::$StrokeFlow$d__14*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.EffectsPanel #include "VROSC/EffectsPanel.hpp" // Including type: VROSC.ArpeggiatorWrapper #include "VROSC/ArpeggiatorWrapper.hpp" // Including type: VROSC.AnimatedPanel #include "VROSC/AnimatedPanel.hpp" // Including type: VROSC.ParameterController #include "VROSC/ParameterController.hpp" // Including type: VROSC.ParametricPositionSignalGenerator #include "VROSC/ParametricPositionSignalGenerator.hpp" // Including type: VROSC.SynthController #include "VROSC/SynthController.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 VROSC.ArpeggiatorWrapper _arpeggiatorWrapper [[deprecated("Use field access instead!")]] ::VROSC::ArpeggiatorWrapper*& VROSC::EffectsPanel::dyn__arpeggiatorWrapper() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::EffectsPanel::dyn__arpeggiatorWrapper"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_arpeggiatorWrapper"))->offset; return *reinterpret_cast<::VROSC::ArpeggiatorWrapper**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AnimatedPanel _animation [[deprecated("Use field access instead!")]] ::VROSC::AnimatedPanel*& VROSC::EffectsPanel::dyn__animation() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::EffectsPanel::dyn__animation"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_animation"))->offset; return *reinterpret_cast<::VROSC::AnimatedPanel**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ParameterController[] _parameterControllers [[deprecated("Use field access instead!")]] ::ArrayW<::VROSC::ParameterController*>& VROSC::EffectsPanel::dyn__parameterControllers() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::EffectsPanel::dyn__parameterControllers"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_parameterControllers"))->offset; return *reinterpret_cast<::ArrayW<::VROSC::ParameterController*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ParametricPositionSignalGenerator[] _parametricPositionSignalGenerators [[deprecated("Use field access instead!")]] ::ArrayW<::VROSC::ParametricPositionSignalGenerator*>& VROSC::EffectsPanel::dyn__parametricPositionSignalGenerators() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::EffectsPanel::dyn__parametricPositionSignalGenerators"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_parametricPositionSignalGenerators"))->offset; return *reinterpret_cast<::ArrayW<::VROSC::ParametricPositionSignalGenerator*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.SynthController _instrument [[deprecated("Use field access instead!")]] ::VROSC::SynthController*& VROSC::EffectsPanel::dyn__instrument() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::EffectsPanel::dyn__instrument"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instrument"))->offset; return *reinterpret_cast<::VROSC::SynthController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.EffectsPanel.Setup void VROSC::EffectsPanel::Setup(::VROSC::SynthController* synthController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::EffectsPanel::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(synthController)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, synthController); } // Autogenerated method: VROSC.EffectsPanel.ResetPanel void VROSC::EffectsPanel::ResetPanel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::EffectsPanel::ResetPanel"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ResetPanel", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.EffectsPanel.SynthesizerChanged void VROSC::EffectsPanel::SynthesizerChanged(bool useExternal) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::EffectsPanel::SynthesizerChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SynthesizerChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(useExternal)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, useExternal); } // Autogenerated method: VROSC.EffectsPanel.SetActive void VROSC::EffectsPanel::SetActive(bool shouldBeOpen, bool animate) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::EffectsPanel::SetActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(shouldBeOpen), ::il2cpp_utils::ExtractType(animate)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, shouldBeOpen, animate); } // Autogenerated method: VROSC.EffectsPanel.OnDestroy void VROSC::EffectsPanel::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::EffectsPanel::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", 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: VROSC.InstrumentFrameController #include "VROSC/InstrumentFrameController.hpp" // Including type: VROSC.TimelineActivation #include "VROSC/TimelineActivation.hpp" // Including type: VROSC.InstrumentController #include "VROSC/InstrumentController.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 VROSC.TimelineActivation _timelineActivation [[deprecated("Use field access instead!")]] ::VROSC::TimelineActivation*& VROSC::InstrumentFrameController::dyn__timelineActivation() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameController::dyn__timelineActivation"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_timelineActivation"))->offset; return *reinterpret_cast<::VROSC::TimelineActivation**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InstrumentController _instrumentController [[deprecated("Use field access instead!")]] ::VROSC::InstrumentController*& VROSC::InstrumentFrameController::dyn__instrumentController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameController::dyn__instrumentController"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instrumentController"))->offset; return *reinterpret_cast<::VROSC::InstrumentController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _frameIsDisplayed [[deprecated("Use field access instead!")]] bool& VROSC::InstrumentFrameController::dyn__frameIsDisplayed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameController::dyn__frameIsDisplayed"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_frameIsDisplayed"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _userWantsFrame [[deprecated("Use field access instead!")]] bool& VROSC::InstrumentFrameController::dyn__userWantsFrame() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameController::dyn__userWantsFrame"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_userWantsFrame"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.InstrumentFrameController.Setup void VROSC::InstrumentFrameController::Setup(::VROSC::InstrumentController* instrumentController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameController::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrumentController)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, instrumentController); } // Autogenerated method: VROSC.InstrumentFrameController.OnDestroy void VROSC::InstrumentFrameController::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameController::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentFrameController.UserDataLoaded void VROSC::InstrumentFrameController::UserDataLoaded(bool userWantsFrame) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameController::UserDataLoaded"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UserDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(userWantsFrame)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, userWantsFrame); } // Autogenerated method: VROSC.InstrumentFrameController.SetUserWantsFrame void VROSC::InstrumentFrameController::SetUserWantsFrame(bool userWantsFrame) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameController::SetUserWantsFrame"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetUserWantsFrame", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(userWantsFrame)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, userWantsFrame); } // Autogenerated method: VROSC.InstrumentFrameController.SetFrameVisible void VROSC::InstrumentFrameController::SetFrameVisible(bool shouldDisplayFrame) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameController::SetFrameVisible"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetFrameVisible", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(shouldDisplayFrame)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, shouldDisplayFrame); } // Autogenerated method: VROSC.InstrumentFrameController.OnInstrumentToggled void VROSC::InstrumentFrameController::OnInstrumentToggled(bool active) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameController::OnInstrumentToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnInstrumentToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(active)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, active); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.InstrumentFrameDisplayUI #include "VROSC/InstrumentFrameDisplayUI.hpp" // Including type: VROSC.UIToggle #include "VROSC/UIToggle.hpp" // Including type: VROSC.InstrumentController #include "VROSC/InstrumentController.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 VROSC.UIToggle _useFrame [[deprecated("Use field access instead!")]] ::VROSC::UIToggle*& VROSC::InstrumentFrameDisplayUI::dyn__useFrame() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameDisplayUI::dyn__useFrame"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_useFrame"))->offset; return *reinterpret_cast<::VROSC::UIToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InstrumentController _instrumentController [[deprecated("Use field access instead!")]] ::VROSC::InstrumentController*& VROSC::InstrumentFrameDisplayUI::dyn__instrumentController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameDisplayUI::dyn__instrumentController"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instrumentController"))->offset; return *reinterpret_cast<::VROSC::InstrumentController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.InstrumentFrameDisplayUI.Awake void VROSC::InstrumentFrameDisplayUI::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameDisplayUI::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: VROSC.InstrumentFrameDisplayUI.OnDestroy void VROSC::InstrumentFrameDisplayUI::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameDisplayUI::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentFrameDisplayUI.Setup void VROSC::InstrumentFrameDisplayUI::Setup(::VROSC::InstrumentController* instrumentController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameDisplayUI::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrumentController)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, instrumentController); } // Autogenerated method: VROSC.InstrumentFrameDisplayUI.UpdateIsVisibleStatus void VROSC::InstrumentFrameDisplayUI::UpdateIsVisibleStatus(bool frameIsOn) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameDisplayUI::UpdateIsVisibleStatus"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateIsVisibleStatus", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(frameIsOn)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, frameIsOn); } // Autogenerated method: VROSC.InstrumentFrameDisplayUI.FrameToggled void VROSC::InstrumentFrameDisplayUI::FrameToggled(::VROSC::InputDevice* inputDevice, bool isOn) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentFrameDisplayUI::FrameToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FrameToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputDevice), ::il2cpp_utils::ExtractType(isOn)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, inputDevice, isOn); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.InfoPanel #include "VROSC/InfoPanel.hpp" // Including type: VROSC.AnimatedPanel #include "VROSC/AnimatedPanel.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 VROSC.AnimatedPanel _animation [[deprecated("Use field access instead!")]] ::VROSC::AnimatedPanel*& VROSC::InfoPanel::dyn__animation() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InfoPanel::dyn__animation"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_animation"))->offset; return *reinterpret_cast<::VROSC::AnimatedPanel**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.InfoPanel.Setup void VROSC::InfoPanel::Setup() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InfoPanel::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.InfoPanel.SetActive void VROSC::InfoPanel::SetActive(bool shouldBeOpen, bool animate) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InfoPanel::SetActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(shouldBeOpen), ::il2cpp_utils::ExtractType(animate)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, shouldBeOpen, animate); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.InstrumentController #include "VROSC/InstrumentController.hpp" // Including type: VROSC.InstrumentControlPanelUI #include "VROSC/InstrumentControlPanelUI.hpp" // Including type: VROSC.InfoPanel #include "VROSC/InfoPanel.hpp" // Including type: UnityEngine.Transform #include "UnityEngine/Transform.hpp" // Including type: VROSC.InstrumentFrameController #include "VROSC/InstrumentFrameController.hpp" // Including type: VROSC.InstrumentDataController #include "VROSC/InstrumentDataController.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: System.Action`2 #include "System/Action_2.hpp" // Including type: VROSC.InstrumentSettings #include "VROSC/InstrumentSettings.hpp" // Including type: VROSC.PatchSettings #include "VROSC/PatchSettings.hpp" // Including type: VROSC.UserDataControllers #include "VROSC/UserDataControllers.hpp" // Including type: VROSC.TransformMover #include "VROSC/TransformMover.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: protected VROSC.InstrumentControlPanelUI _controlPanelUI [[deprecated("Use field access instead!")]] ::VROSC::InstrumentControlPanelUI*& VROSC::InstrumentController::dyn__controlPanelUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::dyn__controlPanelUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_controlPanelUI"))->offset; return *reinterpret_cast<::VROSC::InstrumentControlPanelUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.InfoPanel _infoPanel [[deprecated("Use field access instead!")]] ::VROSC::InfoPanel*& VROSC::InstrumentController::dyn__infoPanel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::dyn__infoPanel"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_infoPanel"))->offset; return *reinterpret_cast<::VROSC::InfoPanel**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Transform _spawnPosition [[deprecated("Use field access instead!")]] ::UnityEngine::Transform*& VROSC::InstrumentController::dyn__spawnPosition() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::dyn__spawnPosition"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_spawnPosition"))->offset; return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InstrumentFrameController _frameController [[deprecated("Use field access instead!")]] ::VROSC::InstrumentFrameController*& VROSC::InstrumentController::dyn__frameController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::dyn__frameController"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_frameController"))->offset; return *reinterpret_cast<::VROSC::InstrumentFrameController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector3 _spawnOriginalPosition [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::InstrumentController::dyn__spawnOriginalPosition() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::dyn__spawnOriginalPosition"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_spawnOriginalPosition"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _spawnPointSet [[deprecated("Use field access instead!")]] bool& VROSC::InstrumentController::dyn__spawnPointSet() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::dyn__spawnPointSet"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_spawnPointSet"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.InstrumentDataController _dataController [[deprecated("Use field access instead!")]] ::VROSC::InstrumentDataController*& VROSC::InstrumentController::dyn__dataController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::dyn__dataController"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_dataController"))->offset; return *reinterpret_cast<::VROSC::InstrumentDataController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<System.Boolean> OnUseMidiChanged [[deprecated("Use field access instead!")]] ::System::Action_1<bool>*& VROSC::InstrumentController::dyn_OnUseMidiChanged() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::dyn_OnUseMidiChanged"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnUseMidiChanged"))->offset; return *reinterpret_cast<::System::Action_1<bool>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`2<VROSC.HandType,System.Object> OnPlayNote [[deprecated("Use field access instead!")]] ::System::Action_2<::VROSC::HandType, ::Il2CppObject*>*& VROSC::InstrumentController::dyn_OnPlayNote() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::dyn_OnPlayNote"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnPlayNote"))->offset; return *reinterpret_cast<::System::Action_2<::VROSC::HandType, ::Il2CppObject*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`2<VROSC.HandType,System.Object> OnStopNote [[deprecated("Use field access instead!")]] ::System::Action_2<::VROSC::HandType, ::Il2CppObject*>*& VROSC::InstrumentController::dyn_OnStopNote() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::dyn_OnStopNote"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnStopNote"))->offset; return *reinterpret_cast<::System::Action_2<::VROSC::HandType, ::Il2CppObject*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.InstrumentController.get_InstrumentSettings ::VROSC::InstrumentSettings* VROSC::InstrumentController::get_InstrumentSettings() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::get_InstrumentSettings"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InstrumentSettings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::InstrumentSettings*, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.get_CurrentPatchSettings ::VROSC::PatchSettings* VROSC::InstrumentController::get_CurrentPatchSettings() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::get_CurrentPatchSettings"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 10)); return ::il2cpp_utils::RunMethodRethrow<::VROSC::PatchSettings*, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.get_CurrentMidiChannel int VROSC::InstrumentController::get_CurrentMidiChannel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::get_CurrentMidiChannel"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 11)); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.get_UsingMidi bool VROSC::InstrumentController::get_UsingMidi() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::get_UsingMidi"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UsingMidi", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.get_Quantize bool VROSC::InstrumentController::get_Quantize() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::get_Quantize"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Quantize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.get_QuantizeTolerance float VROSC::InstrumentController::get_QuantizeTolerance() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::get_QuantizeTolerance"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_QuantizeTolerance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.get_QuantizeBeatDivision int VROSC::InstrumentController::get_QuantizeBeatDivision() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::get_QuantizeBeatDivision"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_QuantizeBeatDivision", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.Setup void VROSC::InstrumentController::Setup() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 12)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.PlayNote void VROSC::InstrumentController::PlayNote(int note, float velocity, ::Il2CppObject* source, double predictedDspTime, ::VROSC::HandType handType, float pitch) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::PlayNote"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 13)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note, velocity, source, predictedDspTime, handType, pitch); } // Autogenerated method: VROSC.InstrumentController.StopNote void VROSC::InstrumentController::StopNote(int note, ::Il2CppObject* source, ::VROSC::HandType handType) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::StopNote"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 14)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note, source, handType); } // Autogenerated method: VROSC.InstrumentController.SetMidiPitchBend void VROSC::InstrumentController::SetMidiPitchBend(float value, bool sendExternal, ::VROSC::HandType handType) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::SetMidiPitchBend"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 15)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, sendExternal, handType); } // Autogenerated method: VROSC.InstrumentController.SetMidiCC void VROSC::InstrumentController::SetMidiCC(float value, int midiCC, bool sendExternal, ::VROSC::HandType handType, bool saveToPatch) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::SetMidiCC"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 16)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value, midiCC, sendExternal, handType, saveToPatch); } // Autogenerated method: VROSC.InstrumentController.UpdateOutput void VROSC::InstrumentController::UpdateOutput() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::UpdateOutput"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 17)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.SynthesizerSourceChanged void VROSC::InstrumentController::SynthesizerSourceChanged(bool useMidi) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::SynthesizerSourceChanged"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 18)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, useMidi); } // Autogenerated method: VROSC.InstrumentController.SetQuantize void VROSC::InstrumentController::SetQuantize(bool quantize) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::SetQuantize"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetQuantize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(quantize)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, quantize); } // Autogenerated method: VROSC.InstrumentController.SetQuantizeTolerance void VROSC::InstrumentController::SetQuantizeTolerance(float tolerance) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::SetQuantizeTolerance"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetQuantizeTolerance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(tolerance)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, tolerance); } // Autogenerated method: VROSC.InstrumentController.SetQuantizeBeatDivision void VROSC::InstrumentController::SetQuantizeBeatDivision(int division) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::SetQuantizeBeatDivision"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetQuantizeBeatDivision", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(division)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, division); } // Autogenerated method: VROSC.InstrumentController.SetInstrumentFrameActive void VROSC::InstrumentController::SetInstrumentFrameActive(bool frameActive) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::SetInstrumentFrameActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetInstrumentFrameActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(frameActive)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, frameActive); } // Autogenerated method: VROSC.InstrumentController.SetActivationPositions void VROSC::InstrumentController::SetActivationPositions(::UnityEngine::Vector3 pressPos, bool active) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::SetActivationPositions"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 6)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, pressPos, active); } // Autogenerated method: VROSC.InstrumentController.OnDestroy void VROSC::InstrumentController::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.UserDataLoaded void VROSC::InstrumentController::UserDataLoaded(::VROSC::UserDataControllers* user) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::UserDataLoaded"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user); } // Autogenerated method: VROSC.InstrumentController.Toggle void VROSC::InstrumentController::Toggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::Toggle"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentController.TransformChanged void VROSC::InstrumentController::TransformChanged(::VROSC::TransformMover* mover) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentController::TransformChanged"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 7)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, mover); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.InstrumentHub #include "VROSC/InstrumentHub.hpp" // Including type: VROSC.WidgetController #include "VROSC/WidgetController.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: UnityEngine.Vector3 #include "UnityEngine/Vector3.hpp" // Including type: VROSC.WidgetSettings/VROSC.Identifier #include "VROSC/WidgetSettings.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.Single _spawnDistanceFromBoard [[deprecated("Use field access instead!")]] float& VROSC::InstrumentHub::dyn__spawnDistanceFromBoard() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentHub::dyn__spawnDistanceFromBoard"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_spawnDistanceFromBoard"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _spawnDistanceFromController [[deprecated("Use field access instead!")]] float& VROSC::InstrumentHub::dyn__spawnDistanceFromController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentHub::dyn__spawnDistanceFromController"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_spawnDistanceFromController"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _instrumentSizeMultiplier [[deprecated("Use field access instead!")]] float& VROSC::InstrumentHub::dyn__instrumentSizeMultiplier() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentHub::dyn__instrumentSizeMultiplier"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instrumentSizeMultiplier"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _gripSpawnHeightOffset [[deprecated("Use field access instead!")]] float& VROSC::InstrumentHub::dyn__gripSpawnHeightOffset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentHub::dyn__gripSpawnHeightOffset"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_gripSpawnHeightOffset"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.InstrumentHub.get_InstrumentSizeMultiplier float VROSC::InstrumentHub::get_InstrumentSizeMultiplier() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentHub::get_InstrumentSizeMultiplier"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InstrumentSizeMultiplier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentHub.Setup void VROSC::InstrumentHub::Setup() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentHub::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.InstrumentHub.GetInstrumentName ::StringW VROSC::InstrumentHub::GetInstrumentName(::VROSC::WidgetSettings::Identifier instrumentId) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentHub::GetInstrumentName"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetInstrumentName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrumentId)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, instrumentId); } // Autogenerated method: VROSC.InstrumentHub.PlaceWidget void VROSC::InstrumentHub::PlaceWidget(::VROSC::WidgetController* target, ::VROSC::InputDevice* device, ::UnityEngine::Vector3 pressPos, bool gripping, bool userHasOpenedBefore) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InstrumentHub::PlaceWidget"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetHub*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, target, device, pressPos, gripping, userHasOpenedBefore); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.ModularDrumsController #include "VROSC/ModularDrumsController.hpp" // Including type: VROSC.ModularDrumpads #include "VROSC/ModularDrumpads.hpp" // Including type: VROSC.DrumEffectsUI #include "VROSC/DrumEffectsUI.hpp" // Including type: VROSC.PatchSettings #include "VROSC/PatchSettings.hpp" // Including type: VROSC.ModularDrumsDataController #include "VROSC/ModularDrumsDataController.hpp" // Including type: VROSC.DrumsControlPanelUI #include "VROSC/DrumsControlPanelUI.hpp" // Including type: VROSC.UserDataControllers #include "VROSC/UserDataControllers.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 VROSC.ModularDrumpads _modularDrumpads [[deprecated("Use field access instead!")]] ::VROSC::ModularDrumpads*& VROSC::ModularDrumsController::dyn__modularDrumpads() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::dyn__modularDrumpads"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_modularDrumpads"))->offset; return *reinterpret_cast<::VROSC::ModularDrumpads**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.DrumEffectsUI _effectsUI [[deprecated("Use field access instead!")]] ::VROSC::DrumEffectsUI*& VROSC::ModularDrumsController::dyn__effectsUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::dyn__effectsUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_effectsUI"))->offset; return *reinterpret_cast<::VROSC::DrumEffectsUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.PatchSettings _patchSettings [[deprecated("Use field access instead!")]] ::VROSC::PatchSettings*& VROSC::ModularDrumsController::dyn__patchSettings() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::dyn__patchSettings"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_patchSettings"))->offset; return *reinterpret_cast<::VROSC::PatchSettings**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.ModularDrumsController.get_DataController ::VROSC::ModularDrumsDataController* VROSC::ModularDrumsController::get_DataController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::get_DataController"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DataController", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::ModularDrumsDataController*, false>(this, ___internal__method); } // Autogenerated method: VROSC.ModularDrumsController.get__drumsControlPanelUI ::VROSC::DrumsControlPanelUI* VROSC::ModularDrumsController::get__drumsControlPanelUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::get__drumsControlPanelUI"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get__drumsControlPanelUI", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::DrumsControlPanelUI*, false>(this, ___internal__method); } // Autogenerated method: VROSC.ModularDrumsController.DeleteAllPressed void VROSC::ModularDrumsController::DeleteAllPressed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::DeleteAllPressed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DeleteAllPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ModularDrumsController.get_CurrentPatchSettings ::VROSC::PatchSettings* VROSC::ModularDrumsController::get_CurrentPatchSettings() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::get_CurrentPatchSettings"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 10)); return ::il2cpp_utils::RunMethodRethrow<::VROSC::PatchSettings*, false>(this, ___internal__method); } // Autogenerated method: VROSC.ModularDrumsController.get_CurrentMidiChannel int VROSC::ModularDrumsController::get_CurrentMidiChannel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::get_CurrentMidiChannel"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 11)); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.ModularDrumsController.Awake void VROSC::ModularDrumsController::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::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: VROSC.ModularDrumsController.OnDestroy void VROSC::ModularDrumsController::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ModularDrumsController.Setup void VROSC::ModularDrumsController::Setup() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 12)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ModularDrumsController.UserDataLoaded void VROSC::ModularDrumsController::UserDataLoaded(::VROSC::UserDataControllers* user) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::UserDataLoaded"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user); } // Autogenerated method: VROSC.ModularDrumsController.UpdateOutput void VROSC::ModularDrumsController::UpdateOutput() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::UpdateOutput"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 17)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ModularDrumsController.Toggle void VROSC::ModularDrumsController::Toggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ModularDrumsController::Toggle"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.NoteFieldMonitor #include "VROSC/NoteFieldMonitor.hpp" // Including type: VROSC.NoteFieldMonitor/VROSC.HandData #include "VROSC/NoteFieldMonitor_HandData.hpp" // Including type: VROSC.NoteFieldMonitor/VROSC.PlayData #include "VROSC/NoteFieldMonitor_PlayData.hpp" // Including type: VROSC.ControllerInputNode #include "VROSC/ControllerInputNode.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 VROSC.ControllerInputNode _inputNode [[deprecated("Use field access instead!")]] ::VROSC::ControllerInputNode*& VROSC::NoteFieldMonitor::dyn__inputNode() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::dyn__inputNode"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputNode"))->offset; return *reinterpret_cast<::VROSC::ControllerInputNode**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.NoteFieldMonitor/VROSC.HandData _leftHand [[deprecated("Use field access instead!")]] ::VROSC::NoteFieldMonitor::HandData*& VROSC::NoteFieldMonitor::dyn__leftHand() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::dyn__leftHand"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_leftHand"))->offset; return *reinterpret_cast<::VROSC::NoteFieldMonitor::HandData**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.NoteFieldMonitor/VROSC.HandData _righthand [[deprecated("Use field access instead!")]] ::VROSC::NoteFieldMonitor::HandData*& VROSC::NoteFieldMonitor::dyn__righthand() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::dyn__righthand"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_righthand"))->offset; return *reinterpret_cast<::VROSC::NoteFieldMonitor::HandData**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.NoteFieldMonitor.get_Left ::VROSC::NoteFieldMonitor::HandData* VROSC::NoteFieldMonitor::get_Left() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::get_Left"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Left", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::NoteFieldMonitor::HandData*, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor.get_Right ::VROSC::NoteFieldMonitor::HandData* VROSC::NoteFieldMonitor::get_Right() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::get_Right"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Right", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::NoteFieldMonitor::HandData*, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor.Awake void VROSC::NoteFieldMonitor::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::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: VROSC.NoteFieldMonitor.HoverBegin void VROSC::NoteFieldMonitor::HoverBegin(::VROSC::InputDevice* inputDevice) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HoverBegin"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HoverBegin", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputDevice)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, inputDevice); } // Autogenerated method: VROSC.NoteFieldMonitor.HoverEnd void VROSC::NoteFieldMonitor::HoverEnd(::VROSC::InputDevice* inputDevice) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HoverEnd"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HoverEnd", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputDevice)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, inputDevice); } // Autogenerated method: VROSC.NoteFieldMonitor.GetPlayData ::System::Collections::Generic::List_1<::VROSC::NoteFieldMonitor::PlayData*>* VROSC::NoteFieldMonitor::GetPlayData() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::GetPlayData"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetPlayData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::List_1<::VROSC::NoteFieldMonitor::PlayData*>*, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor.Update void VROSC::NoteFieldMonitor::Update() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::Update"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor.GetHandDataByInputDevice ::VROSC::NoteFieldMonitor::HandData* VROSC::NoteFieldMonitor::GetHandDataByInputDevice(::VROSC::InputDevice* inputDevice) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::GetHandDataByInputDevice"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetHandDataByInputDevice", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputDevice)}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::NoteFieldMonitor::HandData*, false>(this, ___internal__method, inputDevice); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.NoteFieldMonitor/VROSC.HandData #include "VROSC/NoteFieldMonitor_HandData.hpp" // Including type: VROSC.NoteBoardPlayer #include "VROSC/NoteBoardPlayer.hpp" // Including type: System.Action #include "System/Action.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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 VROSC.NoteBoardPlayer[] _notePlayers [[deprecated("Use field access instead!")]] ::ArrayW<::VROSC::NoteBoardPlayer*>& VROSC::NoteFieldMonitor::HandData::dyn__notePlayers() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::dyn__notePlayers"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_notePlayers"))->offset; return *reinterpret_cast<::ArrayW<::VROSC::NoteBoardPlayer*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color[] _playingColors [[deprecated("Use field access instead!")]] ::ArrayW<::UnityEngine::Color>& VROSC::NoteFieldMonitor::HandData::dyn__playingColors() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::dyn__playingColors"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_playingColors"))->offset; return *reinterpret_cast<::ArrayW<::UnityEngine::Color>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _maxNotes [[deprecated("Use field access instead!")]] int& VROSC::NoteFieldMonitor::HandData::dyn__maxNotes() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::dyn__maxNotes"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_maxNotes"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32[] <HoveredNotes>k__BackingField [[deprecated("Use field access instead!")]] ::ArrayW<int>& VROSC::NoteFieldMonitor::HandData::dyn_$HoveredNotes$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::dyn_$HoveredNotes$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<HoveredNotes>k__BackingField"))->offset; return *reinterpret_cast<::ArrayW<int>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32[] <PlayingNotes>k__BackingField [[deprecated("Use field access instead!")]] ::ArrayW<int>& VROSC::NoteFieldMonitor::HandData::dyn_$PlayingNotes$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::dyn_$PlayingNotes$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<PlayingNotes>k__BackingField"))->offset; return *reinterpret_cast<::ArrayW<int>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action OnPlayingChanged [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::NoteFieldMonitor::HandData::dyn_OnPlayingChanged() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::dyn_OnPlayingChanged"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnPlayingChanged"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action OnHoveringChanged [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::NoteFieldMonitor::HandData::dyn_OnHoveringChanged() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::dyn_OnHoveringChanged"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnHoveringChanged"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.InputDevice _inputDevice [[deprecated("Use field access instead!")]] ::VROSC::InputDevice*& VROSC::NoteFieldMonitor::HandData::dyn__inputDevice() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::dyn__inputDevice"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputDevice"))->offset; return *reinterpret_cast<::VROSC::InputDevice**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _handIsInsideInstrument [[deprecated("Use field access instead!")]] bool& VROSC::NoteFieldMonitor::HandData::dyn__handIsInsideInstrument() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::dyn__handIsInsideInstrument"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_handIsInsideInstrument"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.HandData.get_MaxNotes int VROSC::NoteFieldMonitor::HandData::get_MaxNotes() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::get_MaxNotes"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MaxNotes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.HandData.get_HoveredNotes ::ArrayW<int> VROSC::NoteFieldMonitor::HandData::get_HoveredNotes() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::get_HoveredNotes"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_HoveredNotes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::ArrayW<int>, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.HandData.set_HoveredNotes void VROSC::NoteFieldMonitor::HandData::set_HoveredNotes(::ArrayW<int> value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::set_HoveredNotes"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_HoveredNotes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.HandData.get_PlayingNotes ::ArrayW<int> VROSC::NoteFieldMonitor::HandData::get_PlayingNotes() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::get_PlayingNotes"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_PlayingNotes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::ArrayW<int>, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.HandData.set_PlayingNotes void VROSC::NoteFieldMonitor::HandData::set_PlayingNotes(::ArrayW<int> value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::set_PlayingNotes"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_PlayingNotes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.HandData.get_PlayingColors ::ArrayW<::UnityEngine::Color> VROSC::NoteFieldMonitor::HandData::get_PlayingColors() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::get_PlayingColors"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_PlayingColors", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::UnityEngine::Color>, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.HandData.Setup void VROSC::NoteFieldMonitor::HandData::Setup(::VROSC::InputDevice* inputDevice) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputDevice)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, inputDevice); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.HandData.SetHandInsideInstrument void VROSC::NoteFieldMonitor::HandData::SetHandInsideInstrument(bool isInside) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::SetHandInsideInstrument"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetHandInsideInstrument", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(isInside)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, isInside); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.HandData.CheckNotePlayers void VROSC::NoteFieldMonitor::HandData::CheckNotePlayers() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::HandData::CheckNotePlayers"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CheckNotePlayers", 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: VROSC.NoteFieldMonitor/VROSC.PlayData #include "VROSC/NoteFieldMonitor_PlayData.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.Int32 <Note>k__BackingField [[deprecated("Use field access instead!")]] int& VROSC::NoteFieldMonitor::PlayData::dyn_$Note$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::PlayData::dyn_$Note$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Note>k__BackingField"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private readonly System.Boolean <Playing>k__BackingField [[deprecated("Use field access instead!")]] bool& VROSC::NoteFieldMonitor::PlayData::dyn_$Playing$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::PlayData::dyn_$Playing$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Playing>k__BackingField"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color <Color>k__BackingField [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::NoteFieldMonitor::PlayData::dyn_$Color$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::PlayData::dyn_$Color$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Color>k__BackingField"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.PlayData.get_Note int VROSC::NoteFieldMonitor::PlayData::get_Note() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::PlayData::get_Note"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Note", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.PlayData.get_Playing bool VROSC::NoteFieldMonitor::PlayData::get_Playing() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::PlayData::get_Playing"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Playing", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.PlayData.get_Color ::UnityEngine::Color VROSC::NoteFieldMonitor::PlayData::get_Color() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::PlayData::get_Color"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Color", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.PlayData.set_Color void VROSC::NoteFieldMonitor::PlayData::set_Color(::UnityEngine::Color value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::PlayData::set_Color"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Color", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.NoteFieldMonitor/VROSC.PlayData.AddColor void VROSC::NoteFieldMonitor::PlayData::AddColor(::UnityEngine::Color color) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::NoteFieldMonitor::PlayData::AddColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AddColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(color)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, color); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.SynthController #include "VROSC/SynthController.hpp" // Including type: VROSC.ScalePanelUI #include "VROSC/ScalePanelUI.hpp" // Including type: VROSC.EffectsPanel #include "VROSC/EffectsPanel.hpp" // Including type: VROSC.SynthControlPanelUI #include "VROSC/SynthControlPanelUI.hpp" // Including type: VROSC.ParameterLinksPreset #include "VROSC/ParameterLinksPreset.hpp" // Including type: System.Action #include "System/Action.hpp" // Including type: VROSC.SynthDataController #include "VROSC/SynthDataController.hpp" // Including type: System.Collections.Generic.List`1 #include "System/Collections/Generic/List_1.hpp" // Including type: VROSC.PatchSettings #include "VROSC/PatchSettings.hpp" // Including type: VROSC.UserDataControllers #include "VROSC/UserDataControllers.hpp" // Including type: VROSC.InstrumentDataController #include "VROSC/InstrumentDataController.hpp" // Including type: VROSC.ScalePreset #include "VROSC/ScalePreset.hpp" // Including type: VROSC.Note #include "VROSC/Note.hpp" // Including type: VROSC.Signal #include "VROSC/Signal.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 VROSC.ScalePanelUI _scalePanelUI [[deprecated("Use field access instead!")]] ::VROSC::ScalePanelUI*& VROSC::SynthController::dyn__scalePanelUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn__scalePanelUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scalePanelUI"))->offset; return *reinterpret_cast<::VROSC::ScalePanelUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.EffectsPanel _effectspanel [[deprecated("Use field access instead!")]] ::VROSC::EffectsPanel*& VROSC::SynthController::dyn__effectspanel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn__effectspanel"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_effectspanel"))->offset; return *reinterpret_cast<::VROSC::EffectsPanel**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.SynthControlPanelUI _synthControlPanelUI [[deprecated("Use field access instead!")]] ::VROSC::SynthControlPanelUI*& VROSC::SynthController::dyn__synthControlPanelUI() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn__synthControlPanelUI"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_synthControlPanelUI"))->offset; return *reinterpret_cast<::VROSC::SynthControlPanelUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ParameterLinksPreset _defaultPreset [[deprecated("Use field access instead!")]] ::VROSC::ParameterLinksPreset*& VROSC::SynthController::dyn__defaultPreset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn__defaultPreset"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_defaultPreset"))->offset; return *reinterpret_cast<::VROSC::ParameterLinksPreset**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ParameterLinksPreset _classicPreset [[deprecated("Use field access instead!")]] ::VROSC::ParameterLinksPreset*& VROSC::SynthController::dyn__classicPreset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn__classicPreset"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_classicPreset"))->offset; return *reinterpret_cast<::VROSC::ParameterLinksPreset**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _selectedParameterLinksPreset [[deprecated("Use field access instead!")]] int& VROSC::SynthController::dyn__selectedParameterLinksPreset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn__selectedParameterLinksPreset"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_selectedParameterLinksPreset"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _lastSendTimeLeft [[deprecated("Use field access instead!")]] float& VROSC::SynthController::dyn__lastSendTimeLeft() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn__lastSendTimeLeft"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lastSendTimeLeft"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _lastSendTimeRight [[deprecated("Use field access instead!")]] float& VROSC::SynthController::dyn__lastSendTimeRight() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn__lastSendTimeRight"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lastSendTimeRight"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _maxExternalSendFrequency [[deprecated("Use field access instead!")]] float& VROSC::SynthController::dyn__maxExternalSendFrequency() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn__maxExternalSendFrequency"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_maxExternalSendFrequency"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action OnPatchChanged [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::SynthController::dyn_OnPatchChanged() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn_OnPatchChanged"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnPatchChanged"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _panelsAreSetup [[deprecated("Use field access instead!")]] bool& VROSC::SynthController::dyn__panelsAreSetup() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::dyn__panelsAreSetup"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_panelsAreSetup"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.SynthController.get_SynthDataController ::VROSC::SynthDataController* VROSC::SynthController::get_SynthDataController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::get_SynthDataController"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SynthDataController", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::SynthDataController*, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.get_CurrentOctave int VROSC::SynthController::get_CurrentOctave() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::get_CurrentOctave"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CurrentOctave", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.get_MinOctave int VROSC::SynthController::get_MinOctave() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::get_MinOctave"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MinOctave", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.get_LinkHands bool VROSC::SynthController::get_LinkHands() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::get_LinkHands"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_LinkHands", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.get_MinMidiChannel int VROSC::SynthController::get_MinMidiChannel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::get_MinMidiChannel"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MinMidiChannel", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.get_MaxMidiChannel int VROSC::SynthController::get_MaxMidiChannel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::get_MaxMidiChannel"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MaxMidiChannel", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.get_AllPatchSettings ::System::Collections::Generic::List_1<::VROSC::PatchSettings*>* VROSC::SynthController::get_AllPatchSettings() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::get_AllPatchSettings"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AllPatchSettings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::List_1<::VROSC::PatchSettings*>*, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.get_ArpeggiatorActive bool VROSC::SynthController::get_ArpeggiatorActive() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::get_ArpeggiatorActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ArpeggiatorActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.SetupPanels void VROSC::SynthController::SetupPanels(::VROSC::UserDataControllers* user) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::SetupPanels"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetupPanels", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(user)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user); } // Autogenerated method: VROSC.SynthController.SynthsDataLoaded void VROSC::SynthController::SynthsDataLoaded(::VROSC::InstrumentDataController* dataController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::SynthsDataLoaded"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SynthsDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dataController)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, dataController); } // Autogenerated method: VROSC.SynthController.SetSound void VROSC::SynthController::SetSound(int index) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::SetSound"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetSound", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, index); } // Autogenerated method: VROSC.SynthController.SetNextOctave void VROSC::SynthController::SetNextOctave() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::SetNextOctave"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetNextOctave", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.SetPreviousOctave void VROSC::SynthController::SetPreviousOctave() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::SetPreviousOctave"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPreviousOctave", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.ScalePresetChanged void VROSC::SynthController::ScalePresetChanged(::VROSC::ScalePreset* scalePreset, ::VROSC::Note key) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::ScalePresetChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ScalePresetChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(scalePreset), ::il2cpp_utils::ExtractType(key)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, scalePreset, key); } // Autogenerated method: VROSC.SynthController.UpdateParameters void VROSC::SynthController::UpdateParameters(::VROSC::Signal* signal) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::UpdateParameters"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateParameters", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(signal)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, signal); } // Autogenerated method: VROSC.SynthController.get_CurrentMidiChannel int VROSC::SynthController::get_CurrentMidiChannel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::get_CurrentMidiChannel"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 11)); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.get_CurrentPatchSettings ::VROSC::PatchSettings* VROSC::SynthController::get_CurrentPatchSettings() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::get_CurrentPatchSettings"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 10)); return ::il2cpp_utils::RunMethodRethrow<::VROSC::PatchSettings*, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.Setup void VROSC::SynthController::Setup() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 12)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.OnDestroy void VROSC::SynthController::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.SynthController.UserDataLoaded void VROSC::SynthController::UserDataLoaded(::VROSC::UserDataControllers* user) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::UserDataLoaded"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user); } // Autogenerated method: VROSC.SynthController.UpdateOutput void VROSC::SynthController::UpdateOutput() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SynthController::UpdateOutput"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::InstrumentController*), 17)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.WaveminOctaveControl #include "VROSC/WaveminOctaveControl.hpp" // Including type: VROSC.IntNode #include "VROSC/IntNode.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 VROSC.IntNode _octave [[deprecated("Use field access instead!")]] ::VROSC::IntNode*& VROSC::WaveminOctaveControl::dyn__octave() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WaveminOctaveControl::dyn__octave"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_octave"))->offset; return *reinterpret_cast<::VROSC::IntNode**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.IntNode _note [[deprecated("Use field access instead!")]] ::VROSC::IntNode*& VROSC::WaveminOctaveControl::dyn__note() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WaveminOctaveControl::dyn__note"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_note"))->offset; return *reinterpret_cast<::VROSC::IntNode**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _lastNoteValue [[deprecated("Use field access instead!")]] int& VROSC::WaveminOctaveControl::dyn__lastNoteValue() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WaveminOctaveControl::dyn__lastNoteValue"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lastNoteValue"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _lastOctaveValue [[deprecated("Use field access instead!")]] int& VROSC::WaveminOctaveControl::dyn__lastOctaveValue() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WaveminOctaveControl::dyn__lastOctaveValue"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lastOctaveValue"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.WaveminOctaveControl.Awake void VROSC::WaveminOctaveControl::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WaveminOctaveControl::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: VROSC.WaveminOctaveControl.OnDestroy void VROSC::WaveminOctaveControl::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WaveminOctaveControl::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.WaveminOctaveControl.OctaveChanged void VROSC::WaveminOctaveControl::OctaveChanged(int octave) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WaveminOctaveControl::OctaveChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OctaveChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(octave)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, octave); } // Autogenerated method: VROSC.WaveminOctaveControl.NoteChanged void VROSC::WaveminOctaveControl::NoteChanged(int note) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WaveminOctaveControl::NoteChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NoteChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.LightUpRenderersOnHover #include "VROSC/LightUpRenderersOnHover.hpp" // Including type: VROSC.LightUpRenderersOnHover/VROSC.<HoverFlow>d__9 #include "VROSC/LightUpRenderersOnHover_-HoverFlow-d__9.hpp" // Including type: UnityEngine.Renderer #include "UnityEngine/Renderer.hpp" // Including type: VROSC.Interactable #include "VROSC/Interactable.hpp" // Including type: UnityEngine.MaterialPropertyBlock #include "UnityEngine/MaterialPropertyBlock.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.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.Renderer[] _renderers [[deprecated("Use field access instead!")]] ::ArrayW<::UnityEngine::Renderer*>& VROSC::LightUpRenderersOnHover::dyn__renderers() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::dyn__renderers"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_renderers"))->offset; return *reinterpret_cast<::ArrayW<::UnityEngine::Renderer*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.Interactable _interactable [[deprecated("Use field access instead!")]] ::VROSC::Interactable*& VROSC::LightUpRenderersOnHover::dyn__interactable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::dyn__interactable"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_interactable"))->offset; return *reinterpret_cast<::VROSC::Interactable**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color _lightUp [[deprecated("Use field access instead!")]] ::UnityEngine::Color& VROSC::LightUpRenderersOnHover::dyn__lightUp() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::dyn__lightUp"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lightUp"))->offset; return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _fallSpeed [[deprecated("Use field access instead!")]] float& VROSC::LightUpRenderersOnHover::dyn__fallSpeed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::dyn__fallSpeed"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_fallSpeed"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.MaterialPropertyBlock[] _materialBlocks [[deprecated("Use field access instead!")]] ::ArrayW<::UnityEngine::MaterialPropertyBlock*>& VROSC::LightUpRenderersOnHover::dyn__materialBlocks() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::dyn__materialBlocks"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_materialBlocks"))->offset; return *reinterpret_cast<::ArrayW<::UnityEngine::MaterialPropertyBlock*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _hovering [[deprecated("Use field access instead!")]] bool& VROSC::LightUpRenderersOnHover::dyn__hovering() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::dyn__hovering"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hovering"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Color[] _startColor [[deprecated("Use field access instead!")]] ::ArrayW<::UnityEngine::Color>& VROSC::LightUpRenderersOnHover::dyn__startColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::dyn__startColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startColor"))->offset; return *reinterpret_cast<::ArrayW<::UnityEngine::Color>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.LightUpRenderersOnHover.Awake void VROSC::LightUpRenderersOnHover::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::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: VROSC.LightUpRenderersOnHover.LightUp void VROSC::LightUpRenderersOnHover::LightUp(bool hovering) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::LightUp"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LightUp", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hovering)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, hovering); } // Autogenerated method: VROSC.LightUpRenderersOnHover.HoverFlow ::System::Collections::IEnumerator* VROSC::LightUpRenderersOnHover::HoverFlow() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::HoverFlow"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HoverFlow", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method); } // Autogenerated method: VROSC.LightUpRenderersOnHover.SetColor void VROSC::LightUpRenderersOnHover::SetColor(float amount) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::SetColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(amount)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, amount); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.LightUpRenderersOnHover/VROSC.<HoverFlow>d__9 #include "VROSC/LightUpRenderersOnHover_-HoverFlow-d__9.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 [[deprecated("Use field access instead!")]] int& VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.LightUpRenderersOnHover <>4__this [[deprecated("Use field access instead!")]] ::VROSC::LightUpRenderersOnHover*& VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::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<::VROSC::LightUpRenderersOnHover**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single <time>5__2 [[deprecated("Use field access instead!")]] float& VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::dyn_$time$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::dyn_$time$5__2"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<time>5__2"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.LightUpRenderersOnHover/VROSC.<HoverFlow>d__9.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.LightUpRenderersOnHover/VROSC.<HoverFlow>d__9.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.LightUpRenderersOnHover/VROSC.<HoverFlow>d__9.System.IDisposable.Dispose void VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.LightUpRenderersOnHover/VROSC.<HoverFlow>d__9.MoveNext bool VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.LightUpRenderersOnHover/VROSC.<HoverFlow>d__9.System.Collections.IEnumerator.Reset void VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::LightUpRenderersOnHover::$HoverFlow$d__9*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.ScalePanelUI #include "VROSC/ScalePanelUI.hpp" // Including type: VROSC.ScaleRowUI #include "VROSC/ScaleRowUI.hpp" // Including type: VROSC.AnimatedPanel #include "VROSC/AnimatedPanel.hpp" // Including type: VROSC.SynthController #include "VROSC/SynthController.hpp" // Including type: VROSC.Scale #include "VROSC/Scale.hpp" // Including type: VROSC.ScalePreset #include "VROSC/ScalePreset.hpp" // Including type: VROSC.Note #include "VROSC/Note.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 VROSC.ScaleRowUI[] _scaleRows [[deprecated("Use field access instead!")]] ::ArrayW<::VROSC::ScaleRowUI*>& VROSC::ScalePanelUI::dyn__scaleRows() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScalePanelUI::dyn__scaleRows"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scaleRows"))->offset; return *reinterpret_cast<::ArrayW<::VROSC::ScaleRowUI*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AnimatedPanel _animation [[deprecated("Use field access instead!")]] ::VROSC::AnimatedPanel*& VROSC::ScalePanelUI::dyn__animation() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScalePanelUI::dyn__animation"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_animation"))->offset; return *reinterpret_cast<::VROSC::AnimatedPanel**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.SynthController _instrumentController [[deprecated("Use field access instead!")]] ::VROSC::SynthController*& VROSC::ScalePanelUI::dyn__instrumentController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScalePanelUI::dyn__instrumentController"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instrumentController"))->offset; return *reinterpret_cast<::VROSC::SynthController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.ScalePanelUI.Awake void VROSC::ScalePanelUI::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScalePanelUI::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: VROSC.ScalePanelUI.Setup void VROSC::ScalePanelUI::Setup(::VROSC::SynthController* instrumentController) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScalePanelUI::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrumentController)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, instrumentController); } // Autogenerated method: VROSC.ScalePanelUI.SetActive void VROSC::ScalePanelUI::SetActive(bool shouldBeOpen, bool animate) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScalePanelUI::SetActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(shouldBeOpen), ::il2cpp_utils::ExtractType(animate)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, shouldBeOpen, animate); } // Autogenerated method: VROSC.ScalePanelUI.OnDestroy void VROSC::ScalePanelUI::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScalePanelUI::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScalePanelUI.RowNotesUpdated void VROSC::ScalePanelUI::RowNotesUpdated(int axis, ::VROSC::Scale scale) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScalePanelUI::RowNotesUpdated"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RowNotesUpdated", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(axis), ::il2cpp_utils::ExtractType(scale)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, axis, scale); } // Autogenerated method: VROSC.ScalePanelUI.GlobalScaleChanged void VROSC::ScalePanelUI::GlobalScaleChanged(::VROSC::ScalePreset* scalePreset, ::VROSC::Note key) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScalePanelUI::GlobalScaleChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GlobalScaleChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(scalePreset), ::il2cpp_utils::ExtractType(key)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, scalePreset, key); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.PreviewScaleOnNoteboard #include "VROSC/PreviewScaleOnNoteboard.hpp" // Including type: VROSC.NoteBoardNoteController #include "VROSC/NoteBoardNoteController.hpp" // Including type: VROSC.ScaleRowUI #include "VROSC/ScaleRowUI.hpp" // Including type: VROSC.ScaleNoteButtonUI #include "VROSC/ScaleNoteButtonUI.hpp" // Including type: VROSC.Note #include "VROSC/Note.hpp" // Including type: VROSC.Scale #include "VROSC/Scale.hpp" // Including type: VROSC.NoteFieldNoteData #include "VROSC/NoteFieldNoteData.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 VROSC.NoteBoardNoteController _noteboard [[deprecated("Use field access instead!")]] ::VROSC::NoteBoardNoteController*& VROSC::PreviewScaleOnNoteboard::dyn__noteboard() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::dyn__noteboard"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_noteboard"))->offset; return *reinterpret_cast<::VROSC::NoteBoardNoteController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ScaleRowUI _scaleRow [[deprecated("Use field access instead!")]] ::VROSC::ScaleRowUI*& VROSC::PreviewScaleOnNoteboard::dyn__scaleRow() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::dyn__scaleRow"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scaleRow"))->offset; return *reinterpret_cast<::VROSC::ScaleRowUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.NoteBoard/VROSC.PlayAxis _axis [[deprecated("Use field access instead!")]] ::VROSC::NoteBoard::PlayAxis& VROSC::PreviewScaleOnNoteboard::dyn__axis() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::dyn__axis"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_axis"))->offset; return *reinterpret_cast<::VROSC::NoteBoard::PlayAxis*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _highLightPower [[deprecated("Use field access instead!")]] float& VROSC::PreviewScaleOnNoteboard::dyn__highLightPower() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::dyn__highLightPower"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_highLightPower"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ScaleNoteButtonUI[] _noteButtons [[deprecated("Use field access instead!")]] ::ArrayW<::VROSC::ScaleNoteButtonUI*>& VROSC::PreviewScaleOnNoteboard::dyn__noteButtons() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::dyn__noteButtons"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_noteButtons"))->offset; return *reinterpret_cast<::ArrayW<::VROSC::ScaleNoteButtonUI*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.get_Valid bool VROSC::PreviewScaleOnNoteboard::get_Valid() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::get_Valid"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Valid", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.Awake void VROSC::PreviewScaleOnNoteboard::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::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: VROSC.PreviewScaleOnNoteboard.OnDestroy void VROSC::PreviewScaleOnNoteboard::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.LateUpdate void VROSC::PreviewScaleOnNoteboard::LateUpdate() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::LateUpdate"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LateUpdate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.Hover void VROSC::PreviewScaleOnNoteboard::Hover(::VROSC::Note note, bool hovering) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::Hover"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Hover", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note), ::il2cpp_utils::ExtractType(hovering)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note, hovering); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.NotesChanged void VROSC::PreviewScaleOnNoteboard::NotesChanged(int axis, ::VROSC::Scale scale) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::NotesChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NotesChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(axis), ::il2cpp_utils::ExtractType(scale)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, axis, scale); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.ShowNote void VROSC::PreviewScaleOnNoteboard::ShowNote(::VROSC::Note note, bool hovering) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::ShowNote"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ShowNote", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note), ::il2cpp_utils::ExtractType(hovering)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note, hovering); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.UpdateNoteTexts void VROSC::PreviewScaleOnNoteboard::UpdateNoteTexts() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::UpdateNoteTexts"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateNoteTexts", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.HideAll void VROSC::PreviewScaleOnNoteboard::HideAll() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::HideAll"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HideAll", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.ShouldHighlight bool VROSC::PreviewScaleOnNoteboard::ShouldHighlight(::VROSC::NoteFieldNoteData* data, ::VROSC::Note note) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::ShouldHighlight"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ShouldHighlight", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(data), ::il2cpp_utils::ExtractType(note)}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, data, note); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.HighlightColor ::UnityEngine::Vector3 VROSC::PreviewScaleOnNoteboard::HighlightColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::HighlightColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HighlightColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector3, false>(this, ___internal__method); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.OnEnable void VROSC::PreviewScaleOnNoteboard::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::OnEnable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.PreviewScaleOnNoteboard.OnDisable void VROSC::PreviewScaleOnNoteboard::OnDisable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PreviewScaleOnNoteboard::OnDisable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDisable", 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: VROSC.ScaleNoteButtonUI #include "VROSC/ScaleNoteButtonUI.hpp" // Including type: VROSC.UIToggle #include "VROSC/UIToggle.hpp" // Including type: VROSC.ControllerInputNode #include "VROSC/ControllerInputNode.hpp" // Including type: TMPro.TextMeshPro #include "TMPro/TextMeshPro.hpp" // Including type: VROSC.UI.UIScalePanelButtonColoring #include "VROSC/UI/UIScalePanelButtonColoring.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: System.Action`2 #include "System/Action_2.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.Scale #include "VROSC/Scale.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 VROSC.Note _note [[deprecated("Use field access instead!")]] ::VROSC::Note& VROSC::ScaleNoteButtonUI::dyn__note() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::dyn__note"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_note"))->offset; return *reinterpret_cast<::VROSC::Note*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIToggle _toggleButton [[deprecated("Use field access instead!")]] ::VROSC::UIToggle*& VROSC::ScaleNoteButtonUI::dyn__toggleButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::dyn__toggleButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_toggleButton"))->offset; return *reinterpret_cast<::VROSC::UIToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIToggle _startNoteToggle [[deprecated("Use field access instead!")]] ::VROSC::UIToggle*& VROSC::ScaleNoteButtonUI::dyn__startNoteToggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::dyn__startNoteToggle"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startNoteToggle"))->offset; return *reinterpret_cast<::VROSC::UIToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ControllerInputNode _inputNode [[deprecated("Use field access instead!")]] ::VROSC::ControllerInputNode*& VROSC::ScaleNoteButtonUI::dyn__inputNode() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::dyn__inputNode"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputNode"))->offset; return *reinterpret_cast<::VROSC::ControllerInputNode**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private TMPro.TextMeshPro _display [[deprecated("Use field access instead!")]] ::TMPro::TextMeshPro*& VROSC::ScaleNoteButtonUI::dyn__display() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::dyn__display"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_display"))->offset; return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UI.UIScalePanelButtonColoring _backgroundColoring [[deprecated("Use field access instead!")]] ::VROSC::UI::UIScalePanelButtonColoring*& VROSC::ScaleNoteButtonUI::dyn__backgroundColoring() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::dyn__backgroundColoring"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_backgroundColoring"))->offset; return *reinterpret_cast<::VROSC::UI::UIScalePanelButtonColoring**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Note> OnSetAsStartNode [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Note>*& VROSC::ScaleNoteButtonUI::dyn_OnSetAsStartNode() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::dyn_OnSetAsStartNode"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnSetAsStartNode"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Note>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`2<VROSC.Note,System.Boolean> OnSetNoteActive [[deprecated("Use field access instead!")]] ::System::Action_2<::VROSC::Note, bool>*& VROSC::ScaleNoteButtonUI::dyn_OnSetNoteActive() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::dyn_OnSetNoteActive"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnSetNoteActive"))->offset; return *reinterpret_cast<::System::Action_2<::VROSC::Note, bool>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`2<VROSC.Note,System.Boolean> OnNoteHovered [[deprecated("Use field access instead!")]] ::System::Action_2<::VROSC::Note, bool>*& VROSC::ScaleNoteButtonUI::dyn_OnNoteHovered() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::dyn_OnNoteHovered"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnNoteHovered"))->offset; return *reinterpret_cast<::System::Action_2<::VROSC::Note, bool>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.ScaleNoteButtonUI.Start void VROSC::ScaleNoteButtonUI::Start() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::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: VROSC.ScaleNoteButtonUI.SetAxis void VROSC::ScaleNoteButtonUI::SetAxis(int axis) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::SetAxis"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetAxis", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(axis)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, axis); } // Autogenerated method: VROSC.ScaleNoteButtonUI.AssignStartNote void VROSC::ScaleNoteButtonUI::AssignStartNote(::VROSC::InputDevice* device, bool active) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::AssignStartNote"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AssignStartNote", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(active)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, active); } // Autogenerated method: VROSC.ScaleNoteButtonUI.SetToScale void VROSC::ScaleNoteButtonUI::SetToScale(::VROSC::Scale scale, ::VROSC::Note startNote) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::SetToScale"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetToScale", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(scale), ::il2cpp_utils::ExtractType(startNote)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, scale, startNote); } // Autogenerated method: VROSC.ScaleNoteButtonUI.Toggle void VROSC::ScaleNoteButtonUI::Toggle(::VROSC::InputDevice* device, bool active) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::Toggle"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Toggle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(active)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, active); } // Autogenerated method: VROSC.ScaleNoteButtonUI.OnDestroy void VROSC::ScaleNoteButtonUI::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleNoteButtonUI.SetText void VROSC::ScaleNoteButtonUI::SetText() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::SetText"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetText", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleNoteButtonUI.IsHovering void VROSC::ScaleNoteButtonUI::IsHovering(bool hovering) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleNoteButtonUI::IsHovering"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "IsHovering", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hovering)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, hovering); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.ScaleRowUI #include "VROSC/ScaleRowUI.hpp" // Including type: VROSC.ScaleRowUI/VROSC.<OnEnableCoroutine>d__23 #include "VROSC/ScaleRowUI_-OnEnableCoroutine-d__23.hpp" // Including type: VROSC.NoteNode #include "VROSC/NoteNode.hpp" // Including type: VROSC.ScaleNode #include "VROSC/ScaleNode.hpp" // Including type: VROSC.UIButton #include "VROSC/UIButton.hpp" // Including type: VROSC.ScaleNoteButtonUI #include "VROSC/ScaleNoteButtonUI.hpp" // Including type: VROSC.SynthController #include "VROSC/SynthController.hpp" // Including type: VROSC.ScalePreset #include "VROSC/ScalePreset.hpp" // Including type: System.Action`2 #include "System/Action_2.hpp" // Including type: VROSC.UserDataControllers #include "VROSC/UserDataControllers.hpp" // Including type: System.Collections.IEnumerator #include "System/Collections/IEnumerator.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 VROSC.NoteNode _startNoteNode [[deprecated("Use field access instead!")]] ::VROSC::NoteNode*& VROSC::ScaleRowUI::dyn__startNoteNode() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__startNoteNode"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startNoteNode"))->offset; return *reinterpret_cast<::VROSC::NoteNode**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ScaleNode _scaleNode [[deprecated("Use field access instead!")]] ::VROSC::ScaleNode*& VROSC::ScaleRowUI::dyn__scaleNode() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__scaleNode"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scaleNode"))->offset; return *reinterpret_cast<::VROSC::ScaleNode**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIButton _resetButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::ScaleRowUI::dyn__resetButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__resetButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_resetButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ScaleNoteButtonUI[] _notebuttons [[deprecated("Use field access instead!")]] ::ArrayW<::VROSC::ScaleNoteButtonUI*>& VROSC::ScaleRowUI::dyn__notebuttons() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__notebuttons"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_notebuttons"))->offset; return *reinterpret_cast<::ArrayW<::VROSC::ScaleNoteButtonUI*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.SynthController _instrumentController [[deprecated("Use field access instead!")]] ::VROSC::SynthController*& VROSC::ScaleRowUI::dyn__instrumentController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__instrumentController"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instrumentController"))->offset; return *reinterpret_cast<::VROSC::SynthController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _scaleRowIndex [[deprecated("Use field access instead!")]] int& VROSC::ScaleRowUI::dyn__scaleRowIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__scaleRowIndex"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scaleRowIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.Scale _initScale [[deprecated("Use field access instead!")]] ::VROSC::Scale& VROSC::ScaleRowUI::dyn__initScale() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__initScale"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_initScale"))->offset; return *reinterpret_cast<::VROSC::Scale*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ScalePreset _initGlobalScalePreset [[deprecated("Use field access instead!")]] ::VROSC::ScalePreset*& VROSC::ScaleRowUI::dyn__initGlobalScalePreset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__initGlobalScalePreset"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_initGlobalScalePreset"))->offset; return *reinterpret_cast<::VROSC::ScalePreset**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.Note _initStartNote [[deprecated("Use field access instead!")]] ::VROSC::Note& VROSC::ScaleRowUI::dyn__initStartNote() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__initStartNote"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_initStartNote"))->offset; return *reinterpret_cast<::VROSC::Note*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.Note _initGlobalKey [[deprecated("Use field access instead!")]] ::VROSC::Note& VROSC::ScaleRowUI::dyn__initGlobalKey() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__initGlobalKey"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_initGlobalKey"))->offset; return *reinterpret_cast<::VROSC::Note*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 _initNoteCount [[deprecated("Use field access instead!")]] int& VROSC::ScaleRowUI::dyn__initNoteCount() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__initNoteCount"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_initNoteCount"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ScalePreset _lastGlobalScalePreset [[deprecated("Use field access instead!")]] ::VROSC::ScalePreset*& VROSC::ScaleRowUI::dyn__lastGlobalScalePreset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__lastGlobalScalePreset"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lastGlobalScalePreset"))->offset; return *reinterpret_cast<::VROSC::ScalePreset**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.Note _lastGlobalKey [[deprecated("Use field access instead!")]] ::VROSC::Note& VROSC::ScaleRowUI::dyn__lastGlobalKey() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__lastGlobalKey"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lastGlobalKey"))->offset; return *reinterpret_cast<::VROSC::Note*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _overrideScaleDefaults [[deprecated("Use field access instead!")]] bool& VROSC::ScaleRowUI::dyn__overrideScaleDefaults() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__overrideScaleDefaults"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_overrideScaleDefaults"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _locked [[deprecated("Use field access instead!")]] bool& VROSC::ScaleRowUI::dyn__locked() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__locked"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_locked"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Boolean _customized [[deprecated("Use field access instead!")]] bool& VROSC::ScaleRowUI::dyn__customized() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn__customized"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_customized"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`2<System.Int32,VROSC.Scale> OnNotesUpdated [[deprecated("Use field access instead!")]] ::System::Action_2<int, ::VROSC::Scale>*& VROSC::ScaleRowUI::dyn_OnNotesUpdated() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::dyn_OnNotesUpdated"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnNotesUpdated"))->offset; return *reinterpret_cast<::System::Action_2<int, ::VROSC::Scale>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.ScaleRowUI.Setup void VROSC::ScaleRowUI::Setup(::VROSC::ScalePreset* globalScale, ::VROSC::Note globalKey, ::VROSC::Scale scale, int startNoteOffset, bool overrideScaleDefaults, ::VROSC::SynthController* instrumentController, int scaleRowIndex) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::Setup"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(globalScale), ::il2cpp_utils::ExtractType(globalKey), ::il2cpp_utils::ExtractType(scale), ::il2cpp_utils::ExtractType(startNoteOffset), ::il2cpp_utils::ExtractType(overrideScaleDefaults), ::il2cpp_utils::ExtractType(instrumentController), ::il2cpp_utils::ExtractType(scaleRowIndex)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, globalScale, globalKey, scale, startNoteOffset, overrideScaleDefaults, instrumentController, scaleRowIndex); } // Autogenerated method: VROSC.ScaleRowUI.UserDataLoaded void VROSC::ScaleRowUI::UserDataLoaded(::VROSC::UserDataControllers* user) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::UserDataLoaded"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UserDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(user)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user); } // Autogenerated method: VROSC.ScaleRowUI.GlobalScaleChanged void VROSC::ScaleRowUI::GlobalScaleChanged(::VROSC::ScalePreset* globalScalePreset, ::VROSC::Note globalKey) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::GlobalScaleChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GlobalScaleChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(globalScalePreset), ::il2cpp_utils::ExtractType(globalKey)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, globalScalePreset, globalKey); } // Autogenerated method: VROSC.ScaleRowUI.ResetToCurrentScaleButtonPressed void VROSC::ScaleRowUI::ResetToCurrentScaleButtonPressed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::ResetToCurrentScaleButtonPressed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ResetToCurrentScaleButtonPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleRowUI.SetLocked void VROSC::ScaleRowUI::SetLocked(bool locked) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::SetLocked"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetLocked", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(locked)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, locked); } // Autogenerated method: VROSC.ScaleRowUI.OnEnable void VROSC::ScaleRowUI::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::OnEnable"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleRowUI.OnEnableCoroutine ::System::Collections::IEnumerator* VROSC::ScaleRowUI::OnEnableCoroutine() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::OnEnableCoroutine"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnableCoroutine", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleRowUI.UpdateButtons void VROSC::ScaleRowUI::UpdateButtons() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::UpdateButtons"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateButtons", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleRowUI.StartNoteAssigned void VROSC::ScaleRowUI::StartNoteAssigned(::VROSC::Note note) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::StartNoteAssigned"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StartNoteAssigned", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note); } // Autogenerated method: VROSC.ScaleRowUI.SetScaleNoteActive void VROSC::ScaleRowUI::SetScaleNoteActive(::VROSC::Note note, bool active) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::SetScaleNoteActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetScaleNoteActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note), ::il2cpp_utils::ExtractType(active)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note, active); } // Autogenerated method: VROSC.ScaleRowUI.OnDestroy void VROSC::ScaleRowUI::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleRowUI.GetAllScaleNoteButtonsInChildren void VROSC::ScaleRowUI::GetAllScaleNoteButtonsInChildren() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::GetAllScaleNoteButtonsInChildren"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetAllScaleNoteButtonsInChildren", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleRowUI.CustomizedChanged void VROSC::ScaleRowUI::CustomizedChanged(bool saveData) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::CustomizedChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CustomizedChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(saveData)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, saveData); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: VROSC.ScaleRowUI/VROSC.<OnEnableCoroutine>d__23 #include "VROSC/ScaleRowUI_-OnEnableCoroutine-d__23.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 [[deprecated("Use field access instead!")]] int& VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::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.Object <>2__current [[deprecated("Use field access instead!")]] ::Il2CppObject*& VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::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<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public VROSC.ScaleRowUI <>4__this [[deprecated("Use field access instead!")]] ::VROSC::ScaleRowUI*& VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::dyn_$$4__this() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::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<::VROSC::ScaleRowUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.ScaleRowUI/VROSC.<OnEnableCoroutine>d__23.System.Collections.Generic.IEnumerator<System.Object>.get_Current ::Il2CppObject* VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::System_Collections_Generic_IEnumerator$System_Object$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::System.Collections.Generic.IEnumerator<System.Object>.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23*), 4)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleRowUI/VROSC.<OnEnableCoroutine>d__23.System.Collections.IEnumerator.get_Current ::Il2CppObject* VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23*), 7)); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleRowUI/VROSC.<OnEnableCoroutine>d__23.System.IDisposable.Dispose void VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleRowUI/VROSC.<OnEnableCoroutine>d__23.MoveNext bool VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23*), 6)); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.ScaleRowUI/VROSC.<OnEnableCoroutine>d__23.System.Collections.IEnumerator.Reset void VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ScaleRowUI::$OnEnableCoroutine$d__23*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.ThereminOctaveControlUI #include "VROSC/ThereminOctaveControlUI.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: VROSC.ThereminOctaveControlUI.GetNoteValue int VROSC::ThereminOctaveControlUI::GetNoteValue(int octave) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ThereminOctaveControlUI::GetNoteValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetNoteValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(octave)}))); return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, octave); } // Autogenerated method: VROSC.ThereminOctaveControlUI.UpdateDisplayAndOutput void VROSC::ThereminOctaveControlUI::UpdateDisplayAndOutput() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ThereminOctaveControlUI::UpdateDisplayAndOutput"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::OctaveControlUI*), 7)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.MicrophoneController #include "VROSC/MicrophoneController.hpp" // Including type: VROSC.Microphone #include "VROSC/Microphone.hpp" // Including type: VROSC.UISlider #include "VROSC/UISlider.hpp" // Including type: VROSC.UISlideToggle #include "VROSC/UISlideToggle.hpp" // Including type: UnityEngine.GameObject #include "UnityEngine/GameObject.hpp" // Including type: VROSC.ControlPanelUI #include "VROSC/ControlPanelUI.hpp" // Including type: VROSC.InfoPanel #include "VROSC/InfoPanel.hpp" // Including type: VROSC.UISpinner #include "VROSC/UISpinner.hpp" // Including type: VROSC.UIButton #include "VROSC/UIButton.hpp" // Including type: VROSC.MicrophoneDeviceManager #include "VROSC/MicrophoneDeviceManager.hpp" // Including type: System.Collections.Generic.Dictionary`2 #include "System/Collections/Generic/Dictionary_2.hpp" // Including type: NatSuite.Devices.AudioDevice #include "NatSuite/Devices/AudioDevice.hpp" // Including type: System.String #include "System/String.hpp" // Including type: VROSC.MicrophoneDataController #include "VROSC/MicrophoneDataController.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.hpp" // Including type: VROSC.UserDataControllers #include "VROSC/UserDataControllers.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 SelectedMicrophonePrefsString ::StringW VROSC::MicrophoneController::_get_SelectedMicrophonePrefsString() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::_get_SelectedMicrophonePrefsString"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "MicrophoneController", "SelectedMicrophonePrefsString")); } // Autogenerated static field setter // Set static field: static public System.String SelectedMicrophonePrefsString void VROSC::MicrophoneController::_set_SelectedMicrophonePrefsString(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::_set_SelectedMicrophonePrefsString"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "MicrophoneController", "SelectedMicrophonePrefsString", value)); } // Autogenerated static field getter // Get static field: static public System.String LatencyCompensationPrefsString ::StringW VROSC::MicrophoneController::_get_LatencyCompensationPrefsString() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::_get_LatencyCompensationPrefsString"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "MicrophoneController", "LatencyCompensationPrefsString")); } // Autogenerated static field setter // Set static field: static public System.String LatencyCompensationPrefsString void VROSC::MicrophoneController::_set_LatencyCompensationPrefsString(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::_set_LatencyCompensationPrefsString"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "MicrophoneController", "LatencyCompensationPrefsString", value)); } // Autogenerated instance field getter // Get instance field: private VROSC.Microphone _microphone [[deprecated("Use field access instead!")]] ::VROSC::Microphone*& VROSC::MicrophoneController::dyn__microphone() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__microphone"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_microphone"))->offset; return *reinterpret_cast<::VROSC::Microphone**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlider _volumeSlider [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::MicrophoneController::dyn__volumeSlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__volumeSlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_volumeSlider"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlider _reverbSlider [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::MicrophoneController::dyn__reverbSlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__reverbSlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_reverbSlider"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlideToggle _proximityToggle [[deprecated("Use field access instead!")]] ::VROSC::UISlideToggle*& VROSC::MicrophoneController::dyn__proximityToggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__proximityToggle"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_proximityToggle"))->offset; return *reinterpret_cast<::VROSC::UISlideToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlider _inputVisualizer [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::MicrophoneController::dyn__inputVisualizer() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__inputVisualizer"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputVisualizer"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _peakWarning [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::MicrophoneController::dyn__peakWarning() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__peakWarning"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_peakWarning"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.ControlPanelUI _controlPanel [[deprecated("Use field access instead!")]] ::VROSC::ControlPanelUI*& VROSC::MicrophoneController::dyn__controlPanel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__controlPanel"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_controlPanel"))->offset; return *reinterpret_cast<::VROSC::ControlPanelUI**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.InfoPanel _infoPanel [[deprecated("Use field access instead!")]] ::VROSC::InfoPanel*& VROSC::MicrophoneController::dyn__infoPanel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__infoPanel"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_infoPanel"))->offset; return *reinterpret_cast<::VROSC::InfoPanel**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected UnityEngine.GameObject _failedToInitializeText [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::MicrophoneController::dyn__failedToInitializeText() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__failedToInitializeText"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_failedToInitializeText"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _pcOnlyObjects [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::MicrophoneController::dyn__pcOnlyObjects() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__pcOnlyObjects"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pcOnlyObjects"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISpinner _inputSpinner [[deprecated("Use field access instead!")]] ::VROSC::UISpinner*& VROSC::MicrophoneController::dyn__inputSpinner() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__inputSpinner"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputSpinner"))->offset; return *reinterpret_cast<::VROSC::UISpinner**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlider _latencySlider [[deprecated("Use field access instead!")]] ::VROSC::UISlider*& VROSC::MicrophoneController::dyn__latencySlider() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__latencySlider"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_latencySlider"))->offset; return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UIButton _resetLatencyButton [[deprecated("Use field access instead!")]] ::VROSC::UIButton*& VROSC::MicrophoneController::dyn__resetLatencyButton() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__resetLatencyButton"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_resetLatencyButton"))->offset; return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlideToggle _grabToActivateToggle [[deprecated("Use field access instead!")]] ::VROSC::UISlideToggle*& VROSC::MicrophoneController::dyn__grabToActivateToggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__grabToActivateToggle"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_grabToActivateToggle"))->offset; return *reinterpret_cast<::VROSC::UISlideToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.UISlideToggle _previewReverbToggle [[deprecated("Use field access instead!")]] ::VROSC::UISlideToggle*& VROSC::MicrophoneController::dyn__previewReverbToggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__previewReverbToggle"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_previewReverbToggle"))->offset; return *reinterpret_cast<::VROSC::UISlideToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.MicrophoneDeviceManager _microphoneDeviceManager [[deprecated("Use field access instead!")]] ::VROSC::MicrophoneDeviceManager*& VROSC::MicrophoneController::dyn__microphoneDeviceManager() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__microphoneDeviceManager"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_microphoneDeviceManager"))->offset; return *reinterpret_cast<::VROSC::MicrophoneDeviceManager**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Collections.Generic.Dictionary`2<System.String,NatSuite.Devices.AudioDevice> _inputDevices [[deprecated("Use field access instead!")]] ::System::Collections::Generic::Dictionary_2<::StringW, ::NatSuite::Devices::AudioDevice*>*& VROSC::MicrophoneController::dyn__inputDevices() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__inputDevices"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputDevices"))->offset; return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::StringW, ::NatSuite::Devices::AudioDevice*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _microphoneGrabbed [[deprecated("Use field access instead!")]] bool& VROSC::MicrophoneController::dyn__microphoneGrabbed() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::dyn__microphoneGrabbed"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_microphoneGrabbed"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.MicrophoneController.get_MicrophoneDataController ::VROSC::MicrophoneDataController* VROSC::MicrophoneController::get_MicrophoneDataController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::get_MicrophoneDataController"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MicrophoneDataController", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::MicrophoneDataController*, false>(this, ___internal__method); } // Autogenerated method: VROSC.MicrophoneController.PopulateInputDeviceList void VROSC::MicrophoneController::PopulateInputDeviceList() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::PopulateInputDeviceList"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PopulateInputDeviceList", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.MicrophoneController.InputSelectionChanged void VROSC::MicrophoneController::InputSelectionChanged(int selection) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::InputSelectionChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InputSelectionChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(selection)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, selection); } // Autogenerated method: VROSC.MicrophoneController.VolumeChanged void VROSC::MicrophoneController::VolumeChanged(float newValue) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::VolumeChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "VolumeChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(newValue)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, newValue); } // Autogenerated method: VROSC.MicrophoneController.ReverbChanged void VROSC::MicrophoneController::ReverbChanged(float newValue) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::ReverbChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReverbChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(newValue)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, newValue); } // Autogenerated method: VROSC.MicrophoneController.LatencyCompensationChanged void VROSC::MicrophoneController::LatencyCompensationChanged(float newValue) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::LatencyCompensationChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LatencyCompensationChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(newValue)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, newValue); } // Autogenerated method: VROSC.MicrophoneController.ResetLatency void VROSC::MicrophoneController::ResetLatency() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::ResetLatency"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ResetLatency", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.MicrophoneController.ProximityToggled void VROSC::MicrophoneController::ProximityToggled(::VROSC::InputDevice* device, bool state) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::ProximityToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ProximityToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(state)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, state); } // Autogenerated method: VROSC.MicrophoneController.GrabToActivateToggled void VROSC::MicrophoneController::GrabToActivateToggled(::VROSC::InputDevice* device, bool state) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::GrabToActivateToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GrabToActivateToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(state)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, state); } // Autogenerated method: VROSC.MicrophoneController.PreviewReverbToggled void VROSC::MicrophoneController::PreviewReverbToggled(::VROSC::InputDevice* device, bool state) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::PreviewReverbToggled"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PreviewReverbToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(state)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, state); } // Autogenerated method: VROSC.MicrophoneController.SaveUserPreferences void VROSC::MicrophoneController::SaveUserPreferences() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::SaveUserPreferences"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SaveUserPreferences", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.MicrophoneController.EnableMicrophone void VROSC::MicrophoneController::EnableMicrophone(bool enable) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::EnableMicrophone"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EnableMicrophone", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(enable)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, enable); } // Autogenerated method: VROSC.MicrophoneController.MicrophoneGrabbed void VROSC::MicrophoneController::MicrophoneGrabbed(bool grabbed) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::MicrophoneGrabbed"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MicrophoneGrabbed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(grabbed)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, grabbed); } // Autogenerated method: VROSC.MicrophoneController.MicrophoneProximityChanged void VROSC::MicrophoneController::MicrophoneProximityChanged(float distance) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::MicrophoneProximityChanged"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MicrophoneProximityChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(distance)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, distance); } // Autogenerated method: VROSC.MicrophoneController.UpdateInputVisualizer void VROSC::MicrophoneController::UpdateInputVisualizer(float value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::UpdateInputVisualizer"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateInputVisualizer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.MicrophoneController.ShowPeakWarning void VROSC::MicrophoneController::ShowPeakWarning() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::ShowPeakWarning"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ShowPeakWarning", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.MicrophoneController.HidePeakWarning void VROSC::MicrophoneController::HidePeakWarning() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::HidePeakWarning"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HidePeakWarning", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.MicrophoneController.Setup void VROSC::MicrophoneController::Setup() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ToolController*), 10)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.MicrophoneController.Toggle void VROSC::MicrophoneController::Toggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::Toggle"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ToolController*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.MicrophoneController.OnDestroy void VROSC::MicrophoneController::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.MicrophoneController.UserDataLoaded void VROSC::MicrophoneController::UserDataLoaded(::VROSC::UserDataControllers* user) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::UserDataLoaded"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ToolController*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user); } // Autogenerated method: VROSC.MicrophoneController.SynthesizerSourceChanged void VROSC::MicrophoneController::SynthesizerSourceChanged(bool useMidi) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::MicrophoneController::SynthesizerSourceChanged"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ToolController*), 11)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, useMidi); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.ToolController #include "VROSC/ToolController.hpp" // Including type: VROSC.ToolDataController #include "VROSC/ToolDataController.hpp" // Including type: VROSC.ToolSettings #include "VROSC/ToolSettings.hpp" // Including type: VROSC.UserDataControllers #include "VROSC/UserDataControllers.hpp" // Including type: VROSC.TransformMover #include "VROSC/TransformMover.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: protected VROSC.ToolDataController _dataController [[deprecated("Use field access instead!")]] ::VROSC::ToolDataController*& VROSC::ToolController::dyn__dataController() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ToolController::dyn__dataController"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_dataController"))->offset; return *reinterpret_cast<::VROSC::ToolDataController**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.ToolController.get_ToolSettings ::VROSC::ToolSettings* VROSC::ToolController::get_ToolSettings() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ToolController::get_ToolSettings"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ToolSettings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::ToolSettings*, false>(this, ___internal__method); } // Autogenerated method: VROSC.ToolController.Setup void VROSC::ToolController::Setup() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ToolController::Setup"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ToolController*), 10)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ToolController.SynthesizerSourceChanged void VROSC::ToolController::SynthesizerSourceChanged(bool useMidi) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ToolController::SynthesizerSourceChanged"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::ToolController*), 11)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, useMidi); } // Autogenerated method: VROSC.ToolController.OnDestroy void VROSC::ToolController::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ToolController::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ToolController.UserDataLoaded void VROSC::ToolController::UserDataLoaded(::VROSC::UserDataControllers* user) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ToolController::UserDataLoaded"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user); } // Autogenerated method: VROSC.ToolController.Toggle void VROSC::ToolController::Toggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ToolController::Toggle"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.ToolController.TransformChanged void VROSC::ToolController::TransformChanged(::VROSC::TransformMover* mover) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ToolController::TransformChanged"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 7)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, mover); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.WidgetController #include "VROSC/WidgetController.hpp" // Including type: VROSC.WidgetController/VROSC.WidgetPositionalData #include "VROSC/WidgetController_WidgetPositionalData.hpp" // Including type: VROSC.UserDataControllers #include "VROSC/UserDataControllers.hpp" // Including type: UnityEngine.GameObject #include "UnityEngine/GameObject.hpp" // Including type: VROSC.TimelineInstrumentActivation #include "VROSC/TimelineInstrumentActivation.hpp" // Including type: VROSC.TransformMover #include "VROSC/TransformMover.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: System.Action`2 #include "System/Action_2.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`2<VROSC.WidgetSettings,System.Boolean> OnWidgetActivationChange ::System::Action_2<::VROSC::WidgetSettings*, bool>* VROSC::WidgetController::_get_OnWidgetActivationChange() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::_get_OnWidgetActivationChange"); return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Action_2<::VROSC::WidgetSettings*, bool>*>("VROSC", "WidgetController", "OnWidgetActivationChange"))); } // Autogenerated static field setter // Set static field: static public System.Action`2<VROSC.WidgetSettings,System.Boolean> OnWidgetActivationChange void VROSC::WidgetController::_set_OnWidgetActivationChange(::System::Action_2<::VROSC::WidgetSettings*, bool>* value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::_set_OnWidgetActivationChange"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "WidgetController", "OnWidgetActivationChange", value)); } // Autogenerated instance field getter // Get instance field: protected VROSC.WidgetSettings _widgetSettings [[deprecated("Use field access instead!")]] ::VROSC::WidgetSettings*& VROSC::WidgetController::dyn__widgetSettings() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::dyn__widgetSettings"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_widgetSettings"))->offset; return *reinterpret_cast<::VROSC::WidgetSettings**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.GameObject _toggleObject [[deprecated("Use field access instead!")]] ::UnityEngine::GameObject*& VROSC::WidgetController::dyn__toggleObject() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::dyn__toggleObject"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_toggleObject"))->offset; return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.TimelineInstrumentActivation _timelineActivation [[deprecated("Use field access instead!")]] ::VROSC::TimelineInstrumentActivation*& VROSC::WidgetController::dyn__timelineActivation() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::dyn__timelineActivation"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_timelineActivation"))->offset; return *reinterpret_cast<::VROSC::TimelineInstrumentActivation**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.WidgetController/VROSC.WidgetPositionalData _positionalData [[deprecated("Use field access instead!")]] ::VROSC::WidgetController::WidgetPositionalData*& VROSC::WidgetController::dyn__positionalData() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::dyn__positionalData"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_positionalData"))->offset; return *reinterpret_cast<::VROSC::WidgetController::WidgetPositionalData**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.TransformMover _transformMover [[deprecated("Use field access instead!")]] ::VROSC::TransformMover*& VROSC::WidgetController::dyn__transformMover() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::dyn__transformMover"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_transformMover"))->offset; return *reinterpret_cast<::VROSC::TransformMover**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean <IsActive>k__BackingField [[deprecated("Use field access instead!")]] bool& VROSC::WidgetController::dyn_$IsActive$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::dyn_$IsActive$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<IsActive>k__BackingField"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean <UserHasOpened>k__BackingField [[deprecated("Use field access instead!")]] bool& VROSC::WidgetController::dyn_$UserHasOpened$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::dyn_$UserHasOpened$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<UserHasOpened>k__BackingField"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector3 <InitalLocalScale>k__BackingField [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::WidgetController::dyn_$InitalLocalScale$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::dyn_$InitalLocalScale$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<InitalLocalScale>k__BackingField"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Vector3 <UserMoverScale>k__BackingField [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::WidgetController::dyn_$UserMoverScale$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::dyn_$UserMoverScale$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<UserMoverScale>k__BackingField"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<System.Boolean> OnToggled [[deprecated("Use field access instead!")]] ::System::Action_1<bool>*& VROSC::WidgetController::dyn_OnToggled() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::dyn_OnToggled"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnToggled"))->offset; return *reinterpret_cast<::System::Action_1<bool>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.WidgetController.get_PositionalData ::VROSC::WidgetController::WidgetPositionalData* VROSC::WidgetController::get_PositionalData() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::get_PositionalData"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_PositionalData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::WidgetController::WidgetPositionalData*, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.get_ID ::VROSC::WidgetSettings::Identifier VROSC::WidgetController::get_ID() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::get_ID"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ID", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::WidgetSettings::Identifier, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.get_DefaultSettings ::VROSC::WidgetSettings* VROSC::WidgetController::get_DefaultSettings() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::get_DefaultSettings"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DefaultSettings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::WidgetSettings*, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.get_DisplayName ::StringW VROSC::WidgetController::get_DisplayName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::get_DisplayName"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DisplayName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.get_IsActive bool VROSC::WidgetController::get_IsActive() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::get_IsActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.set_IsActive void VROSC::WidgetController::set_IsActive(bool value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::set_IsActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_IsActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.WidgetController.get_UserHasOpened bool VROSC::WidgetController::get_UserHasOpened() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::get_UserHasOpened"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UserHasOpened", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.set_UserHasOpened void VROSC::WidgetController::set_UserHasOpened(bool value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::set_UserHasOpened"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_UserHasOpened", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.WidgetController.get_TransformMover ::VROSC::TransformMover* VROSC::WidgetController::get_TransformMover() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::get_TransformMover"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_TransformMover", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::TransformMover*, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.get_SpawnHeightModifier float VROSC::WidgetController::get_SpawnHeightModifier() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::get_SpawnHeightModifier"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SpawnHeightModifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.get_InitalLocalScale ::UnityEngine::Vector3 VROSC::WidgetController::get_InitalLocalScale() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::get_InitalLocalScale"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InitalLocalScale", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector3, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.set_InitalLocalScale void VROSC::WidgetController::set_InitalLocalScale(::UnityEngine::Vector3 value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::set_InitalLocalScale"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_InitalLocalScale", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.WidgetController.get_UserMoverScale ::UnityEngine::Vector3 VROSC::WidgetController::get_UserMoverScale() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::get_UserMoverScale"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UserMoverScale", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector3, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.set_UserMoverScale void VROSC::WidgetController::set_UserMoverScale(::UnityEngine::Vector3 value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::set_UserMoverScale"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_UserMoverScale", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.WidgetController.Awake void VROSC::WidgetController::Awake() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::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: VROSC.WidgetController.OnDestroy void VROSC::WidgetController::OnDestroy() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::OnDestroy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.OnApplicationQuit void VROSC::WidgetController::OnApplicationQuit() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::OnApplicationQuit"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnApplicationQuit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.Toggle void VROSC::WidgetController::Toggle() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::Toggle"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.SetActive void VROSC::WidgetController::SetActive(bool shouldBeActive, bool forceImmediate) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::SetActive"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, shouldBeActive, forceImmediate); } // Autogenerated method: VROSC.WidgetController.SetActivationPositions void VROSC::WidgetController::SetActivationPositions(::UnityEngine::Vector3 pressPos, bool active) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::SetActivationPositions"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 6)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, pressPos, active); } // Autogenerated method: VROSC.WidgetController.TransformChanged void VROSC::WidgetController::TransformChanged(::VROSC::TransformMover* mover) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::TransformChanged"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 7)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, mover); } // Autogenerated method: VROSC.WidgetController.UserDataLoaded void VROSC::WidgetController::UserDataLoaded(::VROSC::UserDataControllers* user) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::UserDataLoaded"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user); } // Autogenerated method: VROSC.WidgetController.OnDrawGizmosSelected void VROSC::WidgetController::OnDrawGizmosSelected() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::OnDrawGizmosSelected"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetController*), 9)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetController.SendToAnalytics void VROSC::WidgetController::SendToAnalytics(::VROSC::WidgetSettings::Identifier id, bool isActive) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::SendToAnalytics"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SendToAnalytics", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(id), ::il2cpp_utils::ExtractType(isActive)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, id, isActive); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.WidgetController/VROSC.WidgetPositionalData #include "VROSC/WidgetController_WidgetPositionalData.hpp" // Including type: UnityEngine.Transform #include "UnityEngine/Transform.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 UnityEngine.Vector3 Size [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::WidgetController::WidgetPositionalData::dyn_Size() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::WidgetPositionalData::dyn_Size"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Size"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public UnityEngine.Vector3 Center [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::WidgetController::WidgetPositionalData::dyn_Center() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::WidgetPositionalData::dyn_Center"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Center"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public UnityEngine.Vector3 SpawnPoint [[deprecated("Use field access instead!")]] ::UnityEngine::Vector3& VROSC::WidgetController::WidgetPositionalData::dyn_SpawnPoint() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::WidgetPositionalData::dyn_SpawnPoint"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "SpawnPoint"))->offset; return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.WidgetController/VROSC.WidgetPositionalData.IsPointInside bool VROSC::WidgetController::WidgetPositionalData::IsPointInside(::UnityEngine::Transform* transform, ::UnityEngine::Vector3 worldPosition) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetController::WidgetPositionalData::IsPointInside"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "IsPointInside", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(transform), ::il2cpp_utils::ExtractType(worldPosition)}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, transform, worldPosition); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.WidgetHub #include "VROSC/WidgetHub.hpp" // Including type: System.Collections.Generic.List`1 #include "System/Collections/Generic/List_1.hpp" // Including type: VROSC.WidgetController #include "VROSC/WidgetController.hpp" // Including type: System.Collections.Generic.Dictionary`2 #include "System/Collections/Generic/Dictionary_2.hpp" // Including type: VROSC.InputDevice #include "VROSC/InputDevice.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: protected System.Collections.Generic.List`1<VROSC.WidgetController> _widgetsPrefabs [[deprecated("Use field access instead!")]] ::System::Collections::Generic::List_1<::VROSC::WidgetController*>*& VROSC::WidgetHub::dyn__widgetsPrefabs() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetHub::dyn__widgetsPrefabs"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_widgetsPrefabs"))->offset; return *reinterpret_cast<::System::Collections::Generic::List_1<::VROSC::WidgetController*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected System.Collections.Generic.Dictionary`2<VROSC.WidgetSettings/VROSC.Identifier,VROSC.WidgetController> _widgets [[deprecated("Use field access instead!")]] ::System::Collections::Generic::Dictionary_2<::VROSC::WidgetSettings::Identifier, ::VROSC::WidgetController*>*& VROSC::WidgetHub::dyn__widgets() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetHub::dyn__widgets"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_widgets"))->offset; return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::VROSC::WidgetSettings::Identifier, ::VROSC::WidgetController*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.WidgetHub.ToggleById void VROSC::WidgetHub::ToggleById(::VROSC::WidgetSettings::Identifier identifier, ::UnityEngine::Vector3 position, ::VROSC::InputDevice* device, bool gripping) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetHub::ToggleById"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToggleById", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(identifier), ::il2cpp_utils::ExtractType(position), ::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(gripping)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, identifier, position, device, gripping); } // Autogenerated method: VROSC.WidgetHub.GetTogglabeObjectByIdentifier ::VROSC::WidgetController* VROSC::WidgetHub::GetTogglabeObjectByIdentifier(::VROSC::WidgetSettings::Identifier identifier) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetHub::GetTogglabeObjectByIdentifier"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetTogglabeObjectByIdentifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(identifier)}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::WidgetController*, false>(this, ___internal__method, identifier); } // Autogenerated method: VROSC.WidgetHub.GetIsActive bool VROSC::WidgetHub::GetIsActive(::VROSC::WidgetSettings::Identifier identifier) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetHub::GetIsActive"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetIsActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(identifier)}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, identifier); } // Autogenerated method: VROSC.WidgetHub.GetWidgetsDefaultSettings ::System::Collections::Generic::List_1<::VROSC::WidgetSettings*>* VROSC::WidgetHub::GetWidgetsDefaultSettings() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetHub::GetWidgetsDefaultSettings"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetWidgetsDefaultSettings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::List_1<::VROSC::WidgetSettings*>*, false>(this, ___internal__method); } // Autogenerated method: VROSC.WidgetHub.GetWidget ::VROSC::WidgetController* VROSC::WidgetHub::GetWidget(::VROSC::WidgetSettings::Identifier identifier) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetHub::GetWidget"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetWidget", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(identifier)}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::WidgetController*, false>(this, ___internal__method, identifier); } // Autogenerated method: VROSC.WidgetHub.PlaceWidget void VROSC::WidgetHub::PlaceWidget(::VROSC::WidgetController* target, ::VROSC::InputDevice* device, ::UnityEngine::Vector3 pressPos, bool gripping, bool userHasOpenedBefore) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::WidgetHub::PlaceWidget"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::WidgetHub*), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, target, device, pressPos, gripping, userHasOpenedBefore); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.DateUtil #include "VROSC/DateUtil.hpp" // Including type: System.Collections.Generic.List`1 #include "System/Collections/Generic/List_1.hpp" // Including type: System.DateTime #include "System/DateTime.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static private System.String _defaultDateFormat ::StringW VROSC::DateUtil::_get__defaultDateFormat() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::_get__defaultDateFormat"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "DateUtil", "_defaultDateFormat")); } // Autogenerated static field setter // Set static field: static private System.String _defaultDateFormat void VROSC::DateUtil::_set__defaultDateFormat(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::_set__defaultDateFormat"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "DateUtil", "_defaultDateFormat", value)); } // Autogenerated static field getter // Get static field: static private System.String _filepathDateFormat ::StringW VROSC::DateUtil::_get__filepathDateFormat() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::_get__filepathDateFormat"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "DateUtil", "_filepathDateFormat")); } // Autogenerated static field setter // Set static field: static private System.String _filepathDateFormat void VROSC::DateUtil::_set__filepathDateFormat(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::_set__filepathDateFormat"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "DateUtil", "_filepathDateFormat", value)); } // Autogenerated static field getter // Get static field: static private System.String _sessionIdDateFormat ::StringW VROSC::DateUtil::_get__sessionIdDateFormat() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::_get__sessionIdDateFormat"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "DateUtil", "_sessionIdDateFormat")); } // Autogenerated static field setter // Set static field: static private System.String _sessionIdDateFormat void VROSC::DateUtil::_set__sessionIdDateFormat(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::_set__sessionIdDateFormat"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "DateUtil", "_sessionIdDateFormat", value)); } // Autogenerated static field getter // Get static field: static private System.Collections.Generic.List`1<System.String> _dateFormats ::System::Collections::Generic::List_1<::StringW>* VROSC::DateUtil::_get__dateFormats() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::_get__dateFormats"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Collections::Generic::List_1<::StringW>*>("VROSC", "DateUtil", "_dateFormats")); } // Autogenerated static field setter // Set static field: static private System.Collections.Generic.List`1<System.String> _dateFormats void VROSC::DateUtil::_set__dateFormats(::System::Collections::Generic::List_1<::StringW>* value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::_set__dateFormats"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "DateUtil", "_dateFormats", value)); } // Autogenerated method: VROSC.DateUtil..cctor void VROSC::DateUtil::_cctor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::.cctor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method); } // Autogenerated method: VROSC.DateUtil.GetEpochTime ::StringW VROSC::DateUtil::GetEpochTime() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::GetEpochTime"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", "GetEpochTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method); } // Autogenerated method: VROSC.DateUtil.GetSyncedDate ::System::DateTime VROSC::DateUtil::GetSyncedDate() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::GetSyncedDate"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", "GetSyncedDate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method); } // Autogenerated method: VROSC.DateUtil.GetDate ::System::DateTime VROSC::DateUtil::GetDate() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::GetDate"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", "GetDate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method); } // Autogenerated method: VROSC.DateUtil.GetSyncedDateString ::StringW VROSC::DateUtil::GetSyncedDateString() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::GetSyncedDateString"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", "GetSyncedDateString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method); } // Autogenerated method: VROSC.DateUtil.ParseDate ::System::DateTime VROSC::DateUtil::ParseDate(::StringW date) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::ParseDate"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", "ParseDate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(date)}))); return ::il2cpp_utils::RunMethodRethrow<::System::DateTime, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, date); } // Autogenerated method: VROSC.DateUtil.FormatDateForDisplay ::StringW VROSC::DateUtil::FormatDateForDisplay(::System::DateTime date) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::FormatDateForDisplay"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", "FormatDateForDisplay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(date)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, date); } // Autogenerated method: VROSC.DateUtil.GetDateForFilePath ::StringW VROSC::DateUtil::GetDateForFilePath() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::GetDateForFilePath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", "GetDateForFilePath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method); } // Autogenerated method: VROSC.DateUtil.GetDateForLocalSessionId ::StringW VROSC::DateUtil::GetDateForLocalSessionId() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::GetDateForLocalSessionId"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", "GetDateForLocalSessionId", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method); } // Autogenerated method: VROSC.DateUtil.GetDateForLogs ::StringW VROSC::DateUtil::GetDateForLogs() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::GetDateForLogs"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", "GetDateForLogs", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method); } // Autogenerated method: VROSC.DateUtil.ConvertOldDateString ::StringW VROSC::DateUtil::ConvertOldDateString(::StringW date) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::DateUtil::ConvertOldDateString"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "DateUtil", "ConvertOldDateString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(date)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, date); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter #include "VROSC/FileWriter.hpp" // Including type: VROSC.FileWriter/VROSC.<GetTextFile>d__14 #include "VROSC/FileWriter_-GetTextFile-d__14.hpp" // Including type: VROSC.FileWriter/VROSC.<SavePatchToFile>d__15 #include "VROSC/FileWriter_-SavePatchToFile-d__15.hpp" // Including type: VROSC.FileWriter/VROSC.<LoadPatchFile>d__16 #include "VROSC/FileWriter_-LoadPatchFile-d__16.hpp" // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass17_0 #include "VROSC/FileWriter_--c__DisplayClass17_0.hpp" // Including type: VROSC.FileWriter/VROSC.<SaveSampleToFile>d__17 #include "VROSC/FileWriter_-SaveSampleToFile-d__17.hpp" // Including type: VROSC.FileWriter/VROSC.<LoadSampleFile>d__18 #include "VROSC/FileWriter_-LoadSampleFile-d__18.hpp" // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass19_0 #include "VROSC/FileWriter_--c__DisplayClass19_0.hpp" // Including type: VROSC.FileWriter/VROSC.<ExportTapeRecording>d__19 #include "VROSC/FileWriter_-ExportTapeRecording-d__19.hpp" // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass20_0 #include "VROSC/FileWriter_--c__DisplayClass20_0.hpp" // Including type: VROSC.FileWriter/VROSC.<SaveAudioToFile>d__20 #include "VROSC/FileWriter_-SaveAudioToFile-d__20.hpp" // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass21_0 #include "VROSC/FileWriter_--c__DisplayClass21_0.hpp" // Including type: VROSC.FileWriter/VROSC.<LoadAudioFromFile>d__21 #include "VROSC/FileWriter_-LoadAudioFromFile-d__21.hpp" // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass22_0 #include "VROSC/FileWriter_--c__DisplayClass22_0.hpp" // Including type: VROSC.FileWriter/VROSC.<SavePreviewToFile>d__22 #include "VROSC/FileWriter_-SavePreviewToFile-d__22.hpp" // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass23_0 #include "VROSC/FileWriter_--c__DisplayClass23_0.hpp" // Including type: VROSC.FileWriter/VROSC.<LoadPreviewFromFile>d__23 #include "VROSC/FileWriter_-LoadPreviewFromFile-d__23.hpp" // Including type: VROSC.FileWriter/VROSC.<GetAudioClip>d__29 #include "VROSC/FileWriter_-GetAudioClip-d__29.hpp" // Including type: System.String #include "System/String.hpp" // Including type: UnityEngine.AudioClip #include "UnityEngine/AudioClip.hpp" // Including type: System.Action #include "System/Action.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: System.Threading.Tasks.Task #include "System/Threading/Tasks/Task.hpp" // Including type: System.Action`2 #include "System/Action_2.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 PreviewFilePrefix ::StringW VROSC::FileWriter::_get_PreviewFilePrefix() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_PreviewFilePrefix"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "PreviewFilePrefix")); } // Autogenerated static field setter // Set static field: static public System.String PreviewFilePrefix void VROSC::FileWriter::_set_PreviewFilePrefix(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_PreviewFilePrefix"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "PreviewFilePrefix", value)); } // Autogenerated static field getter // Get static field: static public System.String PreviewsFolderName ::StringW VROSC::FileWriter::_get_PreviewsFolderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_PreviewsFolderName"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "PreviewsFolderName")); } // Autogenerated static field setter // Set static field: static public System.String PreviewsFolderName void VROSC::FileWriter::_set_PreviewsFolderName(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_PreviewsFolderName"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "PreviewsFolderName", value)); } // Autogenerated static field getter // Get static field: static public System.String PatchesFolderName ::StringW VROSC::FileWriter::_get_PatchesFolderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_PatchesFolderName"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "PatchesFolderName")); } // Autogenerated static field setter // Set static field: static public System.String PatchesFolderName void VROSC::FileWriter::_set_PatchesFolderName(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_PatchesFolderName"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "PatchesFolderName", value)); } // Autogenerated static field getter // Get static field: static public System.String SamplesFolderName ::StringW VROSC::FileWriter::_get_SamplesFolderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_SamplesFolderName"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "SamplesFolderName")); } // Autogenerated static field setter // Set static field: static public System.String SamplesFolderName void VROSC::FileWriter::_set_SamplesFolderName(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_SamplesFolderName"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "SamplesFolderName", value)); } // Autogenerated static field getter // Get static field: static public System.String TapeRecordingsFolderName ::StringW VROSC::FileWriter::_get_TapeRecordingsFolderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_TapeRecordingsFolderName"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "TapeRecordingsFolderName")); } // Autogenerated static field setter // Set static field: static public System.String TapeRecordingsFolderName void VROSC::FileWriter::_set_TapeRecordingsFolderName(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_TapeRecordingsFolderName"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "TapeRecordingsFolderName", value)); } // Autogenerated static field getter // Get static field: static public System.String AudioDataFolderName ::StringW VROSC::FileWriter::_get_AudioDataFolderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_AudioDataFolderName"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "AudioDataFolderName")); } // Autogenerated static field setter // Set static field: static public System.String AudioDataFolderName void VROSC::FileWriter::_set_AudioDataFolderName(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_AudioDataFolderName"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "AudioDataFolderName", value)); } // Autogenerated static field getter // Get static field: static public System.String PatchesFileExtension ::StringW VROSC::FileWriter::_get_PatchesFileExtension() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_PatchesFileExtension"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "PatchesFileExtension")); } // Autogenerated static field setter // Set static field: static public System.String PatchesFileExtension void VROSC::FileWriter::_set_PatchesFileExtension(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_PatchesFileExtension"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "PatchesFileExtension", value)); } // Autogenerated static field getter // Get static field: static public System.String AudioDataFileExtension ::StringW VROSC::FileWriter::_get_AudioDataFileExtension() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_AudioDataFileExtension"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "AudioDataFileExtension")); } // Autogenerated static field setter // Set static field: static public System.String AudioDataFileExtension void VROSC::FileWriter::_set_AudioDataFileExtension(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_AudioDataFileExtension"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "AudioDataFileExtension", value)); } // Autogenerated static field getter // Get static field: static public System.String SamplesFileExtension ::StringW VROSC::FileWriter::_get_SamplesFileExtension() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_SamplesFileExtension"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "SamplesFileExtension")); } // Autogenerated static field setter // Set static field: static public System.String SamplesFileExtension void VROSC::FileWriter::_set_SamplesFileExtension(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_SamplesFileExtension"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "SamplesFileExtension", value)); } // Autogenerated static field getter // Get static field: static public System.String SaveFileExtension ::StringW VROSC::FileWriter::_get_SaveFileExtension() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_SaveFileExtension"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "SaveFileExtension")); } // Autogenerated static field setter // Set static field: static public System.String SaveFileExtension void VROSC::FileWriter::_set_SaveFileExtension(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_SaveFileExtension"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "SaveFileExtension", value)); } // Autogenerated static field getter // Get static field: static public System.String BackupSuffix ::StringW VROSC::FileWriter::_get_BackupSuffix() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get_BackupSuffix"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "FileWriter", "BackupSuffix")); } // Autogenerated static field setter // Set static field: static public System.String BackupSuffix void VROSC::FileWriter::_set_BackupSuffix(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set_BackupSuffix"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "BackupSuffix", value)); } // Autogenerated static field getter // Get static field: static private UnityEngine.AudioClip _cachedClip ::UnityEngine::AudioClip* VROSC::FileWriter::_get__cachedClip() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_get__cachedClip"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::UnityEngine::AudioClip*>("VROSC", "FileWriter", "_cachedClip")); } // Autogenerated static field setter // Set static field: static private UnityEngine.AudioClip _cachedClip void VROSC::FileWriter::_set__cachedClip(::UnityEngine::AudioClip* value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::_set__cachedClip"); THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "FileWriter", "_cachedClip", value)); } // Autogenerated method: VROSC.FileWriter.RemoveAllPatchesFiles void VROSC::FileWriter::RemoveAllPatchesFiles(::StringW folderName, ::System::Action* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::RemoveAllPatchesFiles"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "RemoveAllPatchesFiles", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.RemoveAllSamplesFiles void VROSC::FileWriter::RemoveAllSamplesFiles(::StringW folderName, ::System::Action* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::RemoveAllSamplesFiles"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "RemoveAllSamplesFiles", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.GetTextFile ::System::Threading::Tasks::Task* VROSC::FileWriter::GetTextFile(::StringW filePath, ::System::Action_1<::StringW>* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetTextFile"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetTextFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filePath), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filePath, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.SavePatchToFile ::System::Threading::Tasks::Task* VROSC::FileWriter::SavePatchToFile(::StringW folderName, ::StringW fileName, ::StringW text, ::System::Action* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::SavePatchToFile"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "SavePatchToFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(fileName), ::il2cpp_utils::ExtractType(text), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, fileName, text, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.LoadPatchFile ::System::Threading::Tasks::Task* VROSC::FileWriter::LoadPatchFile(::StringW folderName, ::StringW fileName, ::System::Action_1<::StringW>* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::LoadPatchFile"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "LoadPatchFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(fileName), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, fileName, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.SaveSampleToFile ::System::Threading::Tasks::Task* VROSC::FileWriter::SaveSampleToFile(::StringW folderName, ::StringW fileName, ::UnityEngine::AudioClip* audioClip, ::System::Action* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::SaveSampleToFile"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "SaveSampleToFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(fileName), ::il2cpp_utils::ExtractType(audioClip), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, fileName, audioClip, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.LoadSampleFile ::System::Threading::Tasks::Task* VROSC::FileWriter::LoadSampleFile(::StringW folderName, ::StringW fileName, ::System::Action_1<::UnityEngine::AudioClip*>* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::LoadSampleFile"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "LoadSampleFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(fileName), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, fileName, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.ExportTapeRecording void VROSC::FileWriter::ExportTapeRecording(::StringW songName, ::ArrayW<float> samples, int startIndex, int endIndex, int sampleRate, int channels, ::System::Action* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::ExportTapeRecording"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "ExportTapeRecording", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(songName), ::il2cpp_utils::ExtractType(samples), ::il2cpp_utils::ExtractType(startIndex), ::il2cpp_utils::ExtractType(endIndex), ::il2cpp_utils::ExtractType(sampleRate), ::il2cpp_utils::ExtractType(channels), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, songName, samples, startIndex, endIndex, sampleRate, channels, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.SaveAudioToFile ::System::Threading::Tasks::Task* VROSC::FileWriter::SaveAudioToFile(::StringW folderName, ::StringW fileName, ::ArrayW<float> samples, int sampleRate, int channels, float normalizeMultiplier, int startIndex, int endIndex, ::System::Action* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::SaveAudioToFile"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "SaveAudioToFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(fileName), ::il2cpp_utils::ExtractType(samples), ::il2cpp_utils::ExtractType(sampleRate), ::il2cpp_utils::ExtractType(channels), ::il2cpp_utils::ExtractType(normalizeMultiplier), ::il2cpp_utils::ExtractType(startIndex), ::il2cpp_utils::ExtractType(endIndex), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, fileName, samples, sampleRate, channels, normalizeMultiplier, startIndex, endIndex, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.LoadAudioFromFile ::System::Threading::Tasks::Task* VROSC::FileWriter::LoadAudioFromFile(::StringW folderName, ::StringW fileName, ::System::Action_2<::ArrayW<float>, int>* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure, ::ArrayW<float> loadIntoArray) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::LoadAudioFromFile"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "LoadAudioFromFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(fileName), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure), ::il2cpp_utils::ExtractType(loadIntoArray)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, fileName, onSuccess, onFailure, loadIntoArray); } // Autogenerated method: VROSC.FileWriter.SavePreviewToFile ::System::Threading::Tasks::Task* VROSC::FileWriter::SavePreviewToFile(::StringW fileName, ::ArrayW<float> samples, int sampleRate, int channels, float normalizeMultiplier, int startIndex, int endIndex, ::System::Action* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::SavePreviewToFile"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "SavePreviewToFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(fileName), ::il2cpp_utils::ExtractType(samples), ::il2cpp_utils::ExtractType(sampleRate), ::il2cpp_utils::ExtractType(channels), ::il2cpp_utils::ExtractType(normalizeMultiplier), ::il2cpp_utils::ExtractType(startIndex), ::il2cpp_utils::ExtractType(endIndex), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, fileName, samples, sampleRate, channels, normalizeMultiplier, startIndex, endIndex, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.LoadPreviewFromFile ::System::Threading::Tasks::Task* VROSC::FileWriter::LoadPreviewFromFile(::StringW fileName, bool isTemp, bool isOgg, ::System::Action_1<::UnityEngine::AudioClip*>* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::LoadPreviewFromFile"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "LoadPreviewFromFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(fileName), ::il2cpp_utils::ExtractType(isTemp), ::il2cpp_utils::ExtractType(isOgg), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, fileName, isTemp, isOgg, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.DoesPreviewExist bool VROSC::FileWriter::DoesPreviewExist(::StringW fileName, bool isTemp, bool isOgg) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::DoesPreviewExist"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "DoesPreviewExist", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(fileName), ::il2cpp_utils::ExtractType(isTemp), ::il2cpp_utils::ExtractType(isOgg)}))); return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, fileName, isTemp, isOgg); } // Autogenerated method: VROSC.FileWriter.DeleteSave void VROSC::FileWriter::DeleteSave(::StringW filename, ::System::Action_1<::StringW>* onSuccess, ::System::Action_2<::StringW, ::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::DeleteSave"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "DeleteSave", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filename), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filename, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.DeletePreview void VROSC::FileWriter::DeletePreview(::StringW filename, bool isTemp, ::System::Action* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::DeletePreview"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "DeletePreview", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filename), ::il2cpp_utils::ExtractType(isTemp), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filename, isTemp, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.MoveSessionToSavesFolder void VROSC::FileWriter::MoveSessionToSavesFolder(::StringW filename) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::MoveSessionToSavesFolder"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "MoveSessionToSavesFolder", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filename)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filename); } // Autogenerated method: VROSC.FileWriter.MovePreviewToSavesFolder void VROSC::FileWriter::MovePreviewToSavesFolder(::StringW filename) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::MovePreviewToSavesFolder"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "MovePreviewToSavesFolder", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filename)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filename); } // Autogenerated method: VROSC.FileWriter.GetAudioClip ::System::Threading::Tasks::Task* VROSC::FileWriter::GetAudioClip(::StringW filePath, ::System::Action_1<::UnityEngine::AudioClip*>* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetAudioClip"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetAudioClip", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filePath), ::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filePath, onSuccess, onFailure); } // Autogenerated method: VROSC.FileWriter.GetSaveFilePath ::StringW VROSC::FileWriter::GetSaveFilePath(::StringW filename, bool isTemp) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetSaveFilePath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetSaveFilePath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filename), ::il2cpp_utils::ExtractType(isTemp)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filename, isTemp); } // Autogenerated method: VROSC.FileWriter.GetPreviewsFolderPath ::StringW VROSC::FileWriter::GetPreviewsFolderPath(bool isTemp) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetPreviewsFolderPath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetPreviewsFolderPath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(isTemp)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, isTemp); } // Autogenerated method: VROSC.FileWriter.GetPreviewsFilePath ::StringW VROSC::FileWriter::GetPreviewsFilePath(::StringW filename, bool isTemp, bool useOgg) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetPreviewsFilePath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetPreviewsFilePath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filename), ::il2cpp_utils::ExtractType(isTemp), ::il2cpp_utils::ExtractType(useOgg)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filename, isTemp, useOgg); } // Autogenerated method: VROSC.FileWriter.GetPatchesFolderPath ::StringW VROSC::FileWriter::GetPatchesFolderPath(::StringW folderName) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetPatchesFolderPath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetPatchesFolderPath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName); } // Autogenerated method: VROSC.FileWriter.GetPatchesFilePath ::StringW VROSC::FileWriter::GetPatchesFilePath(::StringW folderName, ::StringW filename) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetPatchesFilePath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetPatchesFilePath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(filename)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, filename); } // Autogenerated method: VROSC.FileWriter.GetSamplesFolderPath ::StringW VROSC::FileWriter::GetSamplesFolderPath(::StringW folderName) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetSamplesFolderPath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetSamplesFolderPath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName); } // Autogenerated method: VROSC.FileWriter.GetSamplesFilePath ::StringW VROSC::FileWriter::GetSamplesFilePath(::StringW folderName, ::StringW filename) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetSamplesFilePath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetSamplesFilePath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(filename)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, filename); } // Autogenerated method: VROSC.FileWriter.GetAudioDataFolderPath ::StringW VROSC::FileWriter::GetAudioDataFolderPath(::StringW folderName) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetAudioDataFolderPath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetAudioDataFolderPath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName); } // Autogenerated method: VROSC.FileWriter.GetAudioDataFilePath ::StringW VROSC::FileWriter::GetAudioDataFilePath(::StringW folderName, ::StringW filename) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::GetAudioDataFilePath"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "FileWriter", "GetAudioDataFilePath", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(folderName), ::il2cpp_utils::ExtractType(filename)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, folderName, filename); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<GetTextFile>d__14 #include "VROSC/FileWriter_-GetTextFile-d__14.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: UnityEngine.Networking.UnityWebRequest #include "UnityEngine/Networking/UnityWebRequest.hpp" // Including type: UnityEngine.Networking.UnityWebRequestAsyncOperation #include "UnityEngine/Networking/UnityWebRequestAsyncOperation.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$GetTextFile$d__14::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetTextFile$d__14::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: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::FileWriter::$GetTextFile$d__14::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetTextFile$d__14::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String filePath [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$GetTextFile$d__14::dyn_filePath() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetTextFile$d__14::dyn_filePath"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "filePath"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<System.String> onSuccess [[deprecated("Use field access instead!")]] ::System::Action_1<::StringW>*& VROSC::FileWriter::$GetTextFile$d__14::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetTextFile$d__14::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action_1<::StringW>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$GetTextFile$d__14::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetTextFile$d__14::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Networking.UnityWebRequest <www>5__2 [[deprecated("Use field access instead!")]] ::UnityEngine::Networking::UnityWebRequest*& VROSC::FileWriter::$GetTextFile$d__14::dyn_$www$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetTextFile$d__14::dyn_$www$5__2"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<www>5__2"))->offset; return *reinterpret_cast<::UnityEngine::Networking::UnityWebRequest**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Networking.UnityWebRequestAsyncOperation <webRequest>5__3 [[deprecated("Use field access instead!")]] ::UnityEngine::Networking::UnityWebRequestAsyncOperation*& VROSC::FileWriter::$GetTextFile$d__14::dyn_$webRequest$5__3() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetTextFile$d__14::dyn_$webRequest$5__3"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<webRequest>5__3"))->offset; return *reinterpret_cast<::UnityEngine::Networking::UnityWebRequestAsyncOperation**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$GetTextFile$d__14::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetTextFile$d__14::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<GetTextFile>d__14.MoveNext void VROSC::FileWriter::$GetTextFile$d__14::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetTextFile$d__14::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$GetTextFile$d__14), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<GetTextFile>d__14.SetStateMachine void VROSC::FileWriter::$GetTextFile$d__14::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetTextFile$d__14::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$GetTextFile$d__14), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<SavePatchToFile>d__15 #include "VROSC/FileWriter_-SavePatchToFile-d__15.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: System.Action #include "System/Action.hpp" // Including type: System.IO.StreamWriter #include "System/IO/StreamWriter.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SavePatchToFile$d__15::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::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: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::FileWriter::$SavePatchToFile$d__15::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String folderName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$SavePatchToFile$d__15::dyn_folderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::dyn_folderName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "folderName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String fileName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$SavePatchToFile$d__15::dyn_fileName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::dyn_fileName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "fileName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$SavePatchToFile$d__15::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String text [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$SavePatchToFile$d__15::dyn_text() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::dyn_text"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "text"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action onSuccess [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::FileWriter::$SavePatchToFile$d__15::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.IO.StreamWriter <sw>5__2 [[deprecated("Use field access instead!")]] ::System::IO::StreamWriter*& VROSC::FileWriter::$SavePatchToFile$d__15::dyn_$sw$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::dyn_$sw$5__2"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<sw>5__2"))->offset; return *reinterpret_cast<::System::IO::StreamWriter**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$SavePatchToFile$d__15::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<SavePatchToFile>d__15.MoveNext void VROSC::FileWriter::$SavePatchToFile$d__15::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$SavePatchToFile$d__15), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<SavePatchToFile>d__15.SetStateMachine void VROSC::FileWriter::$SavePatchToFile$d__15::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePatchToFile$d__15::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$SavePatchToFile$d__15), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<LoadPatchFile>d__16 #include "VROSC/FileWriter_-LoadPatchFile-d__16.hpp" // Including type: System.Action`1 #include "System/Action_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: public System.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$LoadPatchFile$d__16::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPatchFile$d__16::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: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::FileWriter::$LoadPatchFile$d__16::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPatchFile$d__16::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String folderName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$LoadPatchFile$d__16::dyn_folderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPatchFile$d__16::dyn_folderName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "folderName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String fileName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$LoadPatchFile$d__16::dyn_fileName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPatchFile$d__16::dyn_fileName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "fileName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<System.String> onSuccess [[deprecated("Use field access instead!")]] ::System::Action_1<::StringW>*& VROSC::FileWriter::$LoadPatchFile$d__16::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPatchFile$d__16::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action_1<::StringW>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$LoadPatchFile$d__16::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPatchFile$d__16::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$LoadPatchFile$d__16::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPatchFile$d__16::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<LoadPatchFile>d__16.MoveNext void VROSC::FileWriter::$LoadPatchFile$d__16::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPatchFile$d__16::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$LoadPatchFile$d__16), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<LoadPatchFile>d__16.SetStateMachine void VROSC::FileWriter::$LoadPatchFile$d__16::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPatchFile$d__16::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$LoadPatchFile$d__16), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass17_0 #include "VROSC/FileWriter_--c__DisplayClass17_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 System.String filePath [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$$c__DisplayClass17_0::dyn_filePath() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass17_0::dyn_filePath"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "filePath"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single[] samples [[deprecated("Use field access instead!")]] ::ArrayW<float>& VROSC::FileWriter::$$c__DisplayClass17_0::dyn_samples() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass17_0::dyn_samples"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "samples"))->offset; return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 frequency [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass17_0::dyn_frequency() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass17_0::dyn_frequency"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "frequency"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 channels [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass17_0::dyn_channels() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass17_0::dyn_channels"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "channels"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<>c__DisplayClass17_0.<SaveSampleToFile>b__0 void VROSC::FileWriter::$$c__DisplayClass17_0::$SaveSampleToFile$b__0() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass17_0::<SaveSampleToFile>b__0"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<SaveSampleToFile>b__0", 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: VROSC.FileWriter/VROSC.<SaveSampleToFile>d__17 #include "VROSC/FileWriter_-SaveSampleToFile-d__17.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: UnityEngine.AudioClip #include "UnityEngine/AudioClip.hpp" // Including type: System.Action #include "System/Action.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveSampleToFile$d__17::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: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String folderName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_folderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_folderName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "folderName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String fileName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_fileName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_fileName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "fileName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public UnityEngine.AudioClip audioClip [[deprecated("Use field access instead!")]] ::UnityEngine::AudioClip*& VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_audioClip() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_audioClip"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "audioClip"))->offset; return *reinterpret_cast<::UnityEngine::AudioClip**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action onSuccess [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveSampleToFile$d__17::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<SaveSampleToFile>d__17.MoveNext void VROSC::FileWriter::$SaveSampleToFile$d__17::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveSampleToFile$d__17::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$SaveSampleToFile$d__17), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<SaveSampleToFile>d__17.SetStateMachine void VROSC::FileWriter::$SaveSampleToFile$d__17::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveSampleToFile$d__17::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$SaveSampleToFile$d__17), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<LoadSampleFile>d__18 #include "VROSC/FileWriter_-LoadSampleFile-d__18.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: UnityEngine.AudioClip #include "UnityEngine/AudioClip.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$LoadSampleFile$d__18::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadSampleFile$d__18::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: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::FileWriter::$LoadSampleFile$d__18::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadSampleFile$d__18::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String folderName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$LoadSampleFile$d__18::dyn_folderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadSampleFile$d__18::dyn_folderName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "folderName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String fileName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$LoadSampleFile$d__18::dyn_fileName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadSampleFile$d__18::dyn_fileName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "fileName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<UnityEngine.AudioClip> onSuccess [[deprecated("Use field access instead!")]] ::System::Action_1<::UnityEngine::AudioClip*>*& VROSC::FileWriter::$LoadSampleFile$d__18::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadSampleFile$d__18::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action_1<::UnityEngine::AudioClip*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$LoadSampleFile$d__18::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadSampleFile$d__18::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$LoadSampleFile$d__18::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadSampleFile$d__18::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<LoadSampleFile>d__18.MoveNext void VROSC::FileWriter::$LoadSampleFile$d__18::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadSampleFile$d__18::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$LoadSampleFile$d__18), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<LoadSampleFile>d__18.SetStateMachine void VROSC::FileWriter::$LoadSampleFile$d__18::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadSampleFile$d__18::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$LoadSampleFile$d__18), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass19_0 #include "VROSC/FileWriter_--c__DisplayClass19_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 System.Single[] samples [[deprecated("Use field access instead!")]] ::ArrayW<float>& VROSC::FileWriter::$$c__DisplayClass19_0::dyn_samples() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass19_0::dyn_samples"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "samples"))->offset; return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 sampleRate [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass19_0::dyn_sampleRate() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass19_0::dyn_sampleRate"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "sampleRate"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 channels [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass19_0::dyn_channels() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass19_0::dyn_channels"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "channels"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single normalizeMultiplier [[deprecated("Use field access instead!")]] float& VROSC::FileWriter::$$c__DisplayClass19_0::dyn_normalizeMultiplier() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass19_0::dyn_normalizeMultiplier"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "normalizeMultiplier"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 startIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass19_0::dyn_startIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass19_0::dyn_startIndex"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "startIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 endIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass19_0::dyn_endIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass19_0::dyn_endIndex"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "endIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String filePath [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$$c__DisplayClass19_0::dyn_filePath() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass19_0::dyn_filePath"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "filePath"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String previewFilePath [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$$c__DisplayClass19_0::dyn_previewFilePath() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass19_0::dyn_previewFilePath"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "previewFilePath"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<>c__DisplayClass19_0.<ExportTapeRecording>b__0 void VROSC::FileWriter::$$c__DisplayClass19_0::$ExportTapeRecording$b__0() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass19_0::<ExportTapeRecording>b__0"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<ExportTapeRecording>b__0", 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: VROSC.FileWriter/VROSC.<ExportTapeRecording>d__19 #include "VROSC/FileWriter_-ExportTapeRecording-d__19.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: System.Action #include "System/Action.hpp" // Including type: UnityEngine.AndroidJavaClass #include "UnityEngine/AndroidJavaClass.hpp" // Including type: UnityEngine.AndroidJavaObject #include "UnityEngine/AndroidJavaObject.hpp" // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass19_0 #include "VROSC/FileWriter_--c__DisplayClass19_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 System.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::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: public System.Runtime.CompilerServices.AsyncVoidMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncVoidMethodBuilder& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncVoidMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single[] samples [[deprecated("Use field access instead!")]] ::ArrayW<float>& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_samples() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_samples"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "samples"))->offset; return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 sampleRate [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_sampleRate() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_sampleRate"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "sampleRate"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 channels [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_channels() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_channels"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "channels"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 startIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_startIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_startIndex"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "startIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 endIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_endIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_endIndex"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "endIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String songName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_songName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_songName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "songName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.FileWriter/VROSC.<>c__DisplayClass19_0 <>8__1 [[deprecated("Use field access instead!")]] ::VROSC::FileWriter::$$c__DisplayClass19_0*& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$$8__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$$8__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>8__1"))->offset; return *reinterpret_cast<::VROSC::FileWriter::$$c__DisplayClass19_0**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action onSuccess [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.AndroidJavaClass <unityPlayer>5__2 [[deprecated("Use field access instead!")]] ::UnityEngine::AndroidJavaClass*& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$unityPlayer$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$unityPlayer$5__2"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<unityPlayer>5__2"))->offset; return *reinterpret_cast<::UnityEngine::AndroidJavaClass**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.AndroidJavaObject <context>5__3 [[deprecated("Use field access instead!")]] ::UnityEngine::AndroidJavaObject*& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$context$5__3() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$context$5__3"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<context>5__3"))->offset; return *reinterpret_cast<::UnityEngine::AndroidJavaObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.AndroidJavaClass <environment>5__4 [[deprecated("Use field access instead!")]] ::UnityEngine::AndroidJavaClass*& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$environment$5__4() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$environment$5__4"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<environment>5__4"))->offset; return *reinterpret_cast<::UnityEngine::AndroidJavaClass**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<ExportTapeRecording>d__19.MoveNext void VROSC::FileWriter::$ExportTapeRecording$d__19::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$ExportTapeRecording$d__19), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<ExportTapeRecording>d__19.SetStateMachine void VROSC::FileWriter::$ExportTapeRecording$d__19::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$ExportTapeRecording$d__19::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$ExportTapeRecording$d__19), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass20_0 #include "VROSC/FileWriter_--c__DisplayClass20_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 System.String filePath [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$$c__DisplayClass20_0::dyn_filePath() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass20_0::dyn_filePath"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "filePath"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single[] samples [[deprecated("Use field access instead!")]] ::ArrayW<float>& VROSC::FileWriter::$$c__DisplayClass20_0::dyn_samples() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass20_0::dyn_samples"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "samples"))->offset; return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 sampleRate [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass20_0::dyn_sampleRate() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass20_0::dyn_sampleRate"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "sampleRate"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 channels [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass20_0::dyn_channels() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass20_0::dyn_channels"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "channels"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single normalizeMultiplier [[deprecated("Use field access instead!")]] float& VROSC::FileWriter::$$c__DisplayClass20_0::dyn_normalizeMultiplier() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass20_0::dyn_normalizeMultiplier"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "normalizeMultiplier"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 startIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass20_0::dyn_startIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass20_0::dyn_startIndex"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "startIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 endIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass20_0::dyn_endIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass20_0::dyn_endIndex"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "endIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<>c__DisplayClass20_0.<SaveAudioToFile>b__0 void VROSC::FileWriter::$$c__DisplayClass20_0::$SaveAudioToFile$b__0() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass20_0::<SaveAudioToFile>b__0"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<SaveAudioToFile>b__0", 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: VROSC.FileWriter/VROSC.<SaveAudioToFile>d__20 #include "VROSC/FileWriter_-SaveAudioToFile-d__20.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: System.Action #include "System/Action.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::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: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single[] samples [[deprecated("Use field access instead!")]] ::ArrayW<float>& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_samples() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_samples"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "samples"))->offset; return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 sampleRate [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_sampleRate() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_sampleRate"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "sampleRate"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 channels [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_channels() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_channels"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "channels"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single normalizeMultiplier [[deprecated("Use field access instead!")]] float& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_normalizeMultiplier() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_normalizeMultiplier"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "normalizeMultiplier"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 startIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_startIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_startIndex"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "startIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 endIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_endIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_endIndex"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "endIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String folderName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_folderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_folderName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "folderName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String fileName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_fileName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_fileName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "fileName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action onSuccess [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<SaveAudioToFile>d__20.MoveNext void VROSC::FileWriter::$SaveAudioToFile$d__20::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$SaveAudioToFile$d__20), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<SaveAudioToFile>d__20.SetStateMachine void VROSC::FileWriter::$SaveAudioToFile$d__20::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SaveAudioToFile$d__20::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$SaveAudioToFile$d__20), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass21_0 #include "VROSC/FileWriter_--c__DisplayClass21_0.hpp" // Including type: System.Action`2 #include "System/Action_2.hpp" // Including type: UnityEngine.AudioClip #include "UnityEngine/AudioClip.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.Single[] loadIntoArray [[deprecated("Use field access instead!")]] ::ArrayW<float>& VROSC::FileWriter::$$c__DisplayClass21_0::dyn_loadIntoArray() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass21_0::dyn_loadIntoArray"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "loadIntoArray"))->offset; return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`2<System.Single[],System.Int32> onSuccess [[deprecated("Use field access instead!")]] ::System::Action_2<::ArrayW<float>, int>*& VROSC::FileWriter::$$c__DisplayClass21_0::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass21_0::dyn_onSuccess"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action_2<::ArrayW<float>, int>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<>c__DisplayClass21_0.<LoadAudioFromFile>b__0 void VROSC::FileWriter::$$c__DisplayClass21_0::$LoadAudioFromFile$b__0(::UnityEngine::AudioClip* audioClip) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass21_0::<LoadAudioFromFile>b__0"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<LoadAudioFromFile>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(audioClip)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, audioClip); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<LoadAudioFromFile>d__21 #include "VROSC/FileWriter_-LoadAudioFromFile-d__21.hpp" // Including type: System.Action`2 #include "System/Action_2.hpp" // Including type: System.Action`1 #include "System/Action_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: public System.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadAudioFromFile$d__21::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: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single[] loadIntoArray [[deprecated("Use field access instead!")]] ::ArrayW<float>& VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_loadIntoArray() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_loadIntoArray"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "loadIntoArray"))->offset; return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`2<System.Single[],System.Int32> onSuccess [[deprecated("Use field access instead!")]] ::System::Action_2<::ArrayW<float>, int>*& VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action_2<::ArrayW<float>, int>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String folderName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_folderName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_folderName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "folderName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String fileName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_fileName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_fileName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "fileName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadAudioFromFile$d__21::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<LoadAudioFromFile>d__21.MoveNext void VROSC::FileWriter::$LoadAudioFromFile$d__21::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadAudioFromFile$d__21::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$LoadAudioFromFile$d__21), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<LoadAudioFromFile>d__21.SetStateMachine void VROSC::FileWriter::$LoadAudioFromFile$d__21::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadAudioFromFile$d__21::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$LoadAudioFromFile$d__21), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass22_0 #include "VROSC/FileWriter_--c__DisplayClass22_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 System.Int32 endIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass22_0::dyn_endIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass22_0::dyn_endIndex"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "endIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 startIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass22_0::dyn_startIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass22_0::dyn_startIndex"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "startIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single[] samples [[deprecated("Use field access instead!")]] ::ArrayW<float>& VROSC::FileWriter::$$c__DisplayClass22_0::dyn_samples() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass22_0::dyn_samples"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "samples"))->offset; return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single normalizeMultiplier [[deprecated("Use field access instead!")]] float& VROSC::FileWriter::$$c__DisplayClass22_0::dyn_normalizeMultiplier() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass22_0::dyn_normalizeMultiplier"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "normalizeMultiplier"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String filePath [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$$c__DisplayClass22_0::dyn_filePath() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass22_0::dyn_filePath"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "filePath"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 channels [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass22_0::dyn_channels() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass22_0::dyn_channels"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "channels"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 sampleRate [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$$c__DisplayClass22_0::dyn_sampleRate() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass22_0::dyn_sampleRate"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "sampleRate"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<>c__DisplayClass22_0.<SavePreviewToFile>b__0 void VROSC::FileWriter::$$c__DisplayClass22_0::$SavePreviewToFile$b__0() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass22_0::<SavePreviewToFile>b__0"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<SavePreviewToFile>b__0", 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: VROSC.FileWriter/VROSC.<SavePreviewToFile>d__22 #include "VROSC/FileWriter_-SavePreviewToFile-d__22.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: System.Action #include "System/Action.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::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: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 endIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_endIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_endIndex"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "endIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 startIndex [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_startIndex() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_startIndex"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "startIndex"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single[] samples [[deprecated("Use field access instead!")]] ::ArrayW<float>& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_samples() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_samples"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "samples"))->offset; return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Single normalizeMultiplier [[deprecated("Use field access instead!")]] float& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_normalizeMultiplier() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_normalizeMultiplier"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "normalizeMultiplier"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 channels [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_channels() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_channels"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "channels"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 sampleRate [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_sampleRate() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_sampleRate"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "sampleRate"))->offset; return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String fileName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_fileName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_fileName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "fileName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action onSuccess [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<SavePreviewToFile>d__22.MoveNext void VROSC::FileWriter::$SavePreviewToFile$d__22::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$SavePreviewToFile$d__22), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<SavePreviewToFile>d__22.SetStateMachine void VROSC::FileWriter::$SavePreviewToFile$d__22::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$SavePreviewToFile$d__22::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$SavePreviewToFile$d__22), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<>c__DisplayClass23_0 #include "VROSC/FileWriter_--c__DisplayClass23_0.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: UnityEngine.AudioClip #include "UnityEngine/AudioClip.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.Action`1<UnityEngine.AudioClip> onSuccess [[deprecated("Use field access instead!")]] ::System::Action_1<::UnityEngine::AudioClip*>*& VROSC::FileWriter::$$c__DisplayClass23_0::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass23_0::dyn_onSuccess"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action_1<::UnityEngine::AudioClip*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<>c__DisplayClass23_0.<LoadPreviewFromFile>b__0 void VROSC::FileWriter::$$c__DisplayClass23_0::$LoadPreviewFromFile$b__0(::UnityEngine::AudioClip* audioClip) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$$c__DisplayClass23_0::<LoadPreviewFromFile>b__0"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<LoadPreviewFromFile>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(audioClip)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, audioClip); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<LoadPreviewFromFile>d__23 #include "VROSC/FileWriter_-LoadPreviewFromFile-d__23.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: UnityEngine.AudioClip #include "UnityEngine/AudioClip.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPreviewFromFile$d__23::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: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<UnityEngine.AudioClip> onSuccess [[deprecated("Use field access instead!")]] ::System::Action_1<::UnityEngine::AudioClip*>*& VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action_1<::UnityEngine::AudioClip*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String fileName [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_fileName() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_fileName"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "fileName"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Boolean isTemp [[deprecated("Use field access instead!")]] bool& VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_isTemp() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_isTemp"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "isTemp"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Boolean isOgg [[deprecated("Use field access instead!")]] bool& VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_isOgg() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_isOgg"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "isOgg"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPreviewFromFile$d__23::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<LoadPreviewFromFile>d__23.MoveNext void VROSC::FileWriter::$LoadPreviewFromFile$d__23::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPreviewFromFile$d__23::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$LoadPreviewFromFile$d__23), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<LoadPreviewFromFile>d__23.SetStateMachine void VROSC::FileWriter::$LoadPreviewFromFile$d__23::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$LoadPreviewFromFile$d__23::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$LoadPreviewFromFile$d__23), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.FileWriter/VROSC.<GetAudioClip>d__29 #include "VROSC/FileWriter_-GetAudioClip-d__29.hpp" // Including type: System.Action`1 #include "System/Action_1.hpp" // Including type: UnityEngine.AudioClip #include "UnityEngine/AudioClip.hpp" // Including type: UnityEngine.Networking.UnityWebRequest #include "UnityEngine/Networking/UnityWebRequest.hpp" // Including type: UnityEngine.Networking.UnityWebRequestAsyncOperation #include "UnityEngine/Networking/UnityWebRequestAsyncOperation.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.Int32 <>1__state [[deprecated("Use field access instead!")]] int& VROSC::FileWriter::$GetAudioClip$d__29::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetAudioClip$d__29::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: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::FileWriter::$GetAudioClip$d__29::dyn_$$t__builder() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetAudioClip$d__29::dyn_$$t__builder"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.String filePath [[deprecated("Use field access instead!")]] ::StringW& VROSC::FileWriter::$GetAudioClip$d__29::dyn_filePath() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetAudioClip$d__29::dyn_filePath"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "filePath"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<UnityEngine.AudioClip> onSuccess [[deprecated("Use field access instead!")]] ::System::Action_1<::UnityEngine::AudioClip*>*& VROSC::FileWriter::$GetAudioClip$d__29::dyn_onSuccess() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetAudioClip$d__29::dyn_onSuccess"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onSuccess"))->offset; return *reinterpret_cast<::System::Action_1<::UnityEngine::AudioClip*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action`1<VROSC.Error> onFailure [[deprecated("Use field access instead!")]] ::System::Action_1<::VROSC::Error>*& VROSC::FileWriter::$GetAudioClip$d__29::dyn_onFailure() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetAudioClip$d__29::dyn_onFailure"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "onFailure"))->offset; return *reinterpret_cast<::System::Action_1<::VROSC::Error>**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Networking.UnityWebRequest <www>5__2 [[deprecated("Use field access instead!")]] ::UnityEngine::Networking::UnityWebRequest*& VROSC::FileWriter::$GetAudioClip$d__29::dyn_$www$5__2() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetAudioClip$d__29::dyn_$www$5__2"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<www>5__2"))->offset; return *reinterpret_cast<::UnityEngine::Networking::UnityWebRequest**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.Networking.UnityWebRequestAsyncOperation <webRequest>5__3 [[deprecated("Use field access instead!")]] ::UnityEngine::Networking::UnityWebRequestAsyncOperation*& VROSC::FileWriter::$GetAudioClip$d__29::dyn_$webRequest$5__3() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetAudioClip$d__29::dyn_$webRequest$5__3"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<webRequest>5__3"))->offset; return *reinterpret_cast<::UnityEngine::Networking::UnityWebRequestAsyncOperation**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1 [[deprecated("Use field access instead!")]] ::System::Runtime::CompilerServices::TaskAwaiter& VROSC::FileWriter::$GetAudioClip$d__29::dyn_$$u__1() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetAudioClip$d__29::dyn_$$u__1"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset; return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.FileWriter/VROSC.<GetAudioClip>d__29.MoveNext void VROSC::FileWriter::$GetAudioClip$d__29::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetAudioClip$d__29::MoveNext"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$GetAudioClip$d__29), 4)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.FileWriter/VROSC.<GetAudioClip>d__29.SetStateMachine void VROSC::FileWriter::$GetAudioClip$d__29::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::FileWriter::$GetAudioClip$d__29::SetStateMachine"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(*this, classof(::VROSC::FileWriter::$GetAudioClip$d__29), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: VROSC.AdjustableMesh #include "VROSC/AdjustableMesh.hpp" // Including type: VROSC.AdjustableMeshColors #include "VROSC/AdjustableMeshColors.hpp" // Including type: VROSC.AdjustableMeshUvs #include "VROSC/AdjustableMeshUvs.hpp" // Including type: VROSC.AdjustableMeshVerts #include "VROSC/AdjustableMeshVerts.hpp" // Including type: UnityEngine.Mesh #include "UnityEngine/Mesh.hpp" // Including type: UnityEngine.MeshFilter #include "UnityEngine/MeshFilter.hpp" // Including type: UnityEngine.MeshRenderer #include "UnityEngine/MeshRenderer.hpp" // Including type: UnityEngine.RectTransform #include "UnityEngine/RectTransform.hpp" // Including type: System.Action #include "System/Action.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 VROSC.AdjustableMeshColors <Colors>k__BackingField [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMeshColors*& VROSC::AdjustableMesh::dyn_$Colors$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn_$Colors$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Colors>k__BackingField"))->offset; return *reinterpret_cast<::VROSC::AdjustableMeshColors**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AdjustableMeshUvs <UVs>k__BackingField [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMeshUvs*& VROSC::AdjustableMesh::dyn_$UVs$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn_$UVs$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<UVs>k__BackingField"))->offset; return *reinterpret_cast<::VROSC::AdjustableMeshUvs**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AdjustableMeshVerts <Verts>k__BackingField [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMeshVerts*& VROSC::AdjustableMesh::dyn_$Verts$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn_$Verts$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Verts>k__BackingField"))->offset; return *reinterpret_cast<::VROSC::AdjustableMeshVerts**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected UnityEngine.Mesh _original [[deprecated("Use field access instead!")]] ::UnityEngine::Mesh*& VROSC::AdjustableMesh::dyn__original() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__original"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_original"))->offset; return *reinterpret_cast<::UnityEngine::Mesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private VROSC.AdjustableMeshUvs/VROSC.Channel _uvChannel [[deprecated("Use field access instead!")]] ::VROSC::AdjustableMeshUvs::Channel& VROSC::AdjustableMesh::dyn__uvChannel() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__uvChannel"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_uvChannel"))->offset; return *reinterpret_cast<::VROSC::AdjustableMeshUvs::Channel*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean _floatColors [[deprecated("Use field access instead!")]] bool& VROSC::AdjustableMesh::dyn__floatColors() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__floatColors"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_floatColors"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _multiplyOriginalVertexColor [[deprecated("Use field access instead!")]] float& VROSC::AdjustableMesh::dyn__multiplyOriginalVertexColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__multiplyOriginalVertexColor"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_multiplyOriginalVertexColor"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Single _appearFlashAmount [[deprecated("Use field access instead!")]] float& VROSC::AdjustableMesh::dyn__appearFlashAmount() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__appearFlashAmount"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_appearFlashAmount"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected System.Single _appearAmount [[deprecated("Use field access instead!")]] float& VROSC::AdjustableMesh::dyn__appearAmount() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__appearAmount"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_appearAmount"))->offset; return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected VROSC.AnimatedAppear/VROSC.Mode _appearMode [[deprecated("Use field access instead!")]] ::VROSC::AnimatedAppear::Mode& VROSC::AdjustableMesh::dyn__appearMode() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__appearMode"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_appearMode"))->offset; return *reinterpret_cast<::VROSC::AnimatedAppear::Mode*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected System.Boolean _useFlash [[deprecated("Use field access instead!")]] bool& VROSC::AdjustableMesh::dyn__useFlash() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__useFlash"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_useFlash"))->offset; return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected UnityEngine.Mesh _instantiatedMesh [[deprecated("Use field access instead!")]] ::UnityEngine::Mesh*& VROSC::AdjustableMesh::dyn__instantiatedMesh() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__instantiatedMesh"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instantiatedMesh"))->offset; return *reinterpret_cast<::UnityEngine::Mesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected UnityEngine.MeshFilter _meshFilter [[deprecated("Use field access instead!")]] ::UnityEngine::MeshFilter*& VROSC::AdjustableMesh::dyn__meshFilter() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__meshFilter"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_meshFilter"))->offset; return *reinterpret_cast<::UnityEngine::MeshFilter**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: protected UnityEngine.MeshRenderer _meshRenderer [[deprecated("Use field access instead!")]] ::UnityEngine::MeshRenderer*& VROSC::AdjustableMesh::dyn__meshRenderer() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__meshRenderer"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_meshRenderer"))->offset; return *reinterpret_cast<::UnityEngine::MeshRenderer**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private UnityEngine.RectTransform _rectTransform [[deprecated("Use field access instead!")]] ::UnityEngine::RectTransform*& VROSC::AdjustableMesh::dyn__rectTransform() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn__rectTransform"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rectTransform"))->offset; return *reinterpret_cast<::UnityEngine::RectTransform**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action OnMeshCreation [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::AdjustableMesh::dyn_OnMeshCreation() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn_OnMeshCreation"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnMeshCreation"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Action OnMeshVisible [[deprecated("Use field access instead!")]] ::System::Action*& VROSC::AdjustableMesh::dyn_OnMeshVisible() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::dyn_OnMeshVisible"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnMeshVisible"))->offset; return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset); } // Autogenerated method: VROSC.AdjustableMesh.get_Mesh ::UnityEngine::Mesh* VROSC::AdjustableMesh::get_Mesh() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::get_Mesh"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Mesh", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Mesh*, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.get_Original ::UnityEngine::Mesh* VROSC::AdjustableMesh::get_Original() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::get_Original"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::AdjustableMesh*), 4)); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Mesh*, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.get_Renderer ::UnityEngine::MeshRenderer* VROSC::AdjustableMesh::get_Renderer() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::get_Renderer"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Renderer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::MeshRenderer*, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.get_RectTransform ::UnityEngine::RectTransform* VROSC::AdjustableMesh::get_RectTransform() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::get_RectTransform"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_RectTransform", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::RectTransform*, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.get_MultiplyOriginalVertexColor float VROSC::AdjustableMesh::get_MultiplyOriginalVertexColor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::get_MultiplyOriginalVertexColor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MultiplyOriginalVertexColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.get_Colors ::VROSC::AdjustableMeshColors* VROSC::AdjustableMesh::get_Colors() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::get_Colors"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Colors", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::AdjustableMeshColors*, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.set_Colors void VROSC::AdjustableMesh::set_Colors(::VROSC::AdjustableMeshColors* value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::set_Colors"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Colors", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.AdjustableMesh.get_UVs ::VROSC::AdjustableMeshUvs* VROSC::AdjustableMesh::get_UVs() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::get_UVs"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UVs", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::AdjustableMeshUvs*, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.set_UVs void VROSC::AdjustableMesh::set_UVs(::VROSC::AdjustableMeshUvs* value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::set_UVs"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_UVs", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.AdjustableMesh.get_Verts ::VROSC::AdjustableMeshVerts* VROSC::AdjustableMesh::get_Verts() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::get_Verts"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Verts", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::VROSC::AdjustableMeshVerts*, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.set_Verts void VROSC::AdjustableMesh::set_Verts(::VROSC::AdjustableMeshVerts* value) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::set_Verts"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Verts", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value); } // Autogenerated method: VROSC.AdjustableMesh.GetRectTransform ::UnityEngine::RectTransform* VROSC::AdjustableMesh::GetRectTransform() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::GetRectTransform"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetRectTransform", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::RectTransform*, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.GetMeshRenderer ::UnityEngine::MeshRenderer* VROSC::AdjustableMesh::GetMeshRenderer() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::GetMeshRenderer"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetMeshRenderer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::MeshRenderer*, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.OnEnable void VROSC::AdjustableMesh::OnEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::OnEnable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::AdjustableMesh*), 5)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.GetMesh ::UnityEngine::Mesh* VROSC::AdjustableMesh::GetMesh() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::GetMesh"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetMesh", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Mesh*, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.Verify void VROSC::AdjustableMesh::Verify() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::Verify"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::AdjustableMesh*), 6)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.LoadMesh void VROSC::AdjustableMesh::LoadMesh(bool force) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::LoadMesh"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::AdjustableMesh*), 7)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, force); } // Autogenerated method: VROSC.AdjustableMesh.ClearMesh void VROSC::AdjustableMesh::ClearMesh() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::ClearMesh"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ClearMesh", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.PostLoadMesh void VROSC::AdjustableMesh::PostLoadMesh(bool useOriginalAsUV) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::PostLoadMesh"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PostLoadMesh", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(useOriginalAsUV)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, useOriginalAsUV); } // Autogenerated method: VROSC.AdjustableMesh.UpdateMeshAppearance void VROSC::AdjustableMesh::UpdateMeshAppearance(float appearAmount, ::VROSC::AnimatedAppear::Mode mode, bool useFlash) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::UpdateMeshAppearance"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::AdjustableMesh*), 8)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, appearAmount, mode, useFlash); } // Autogenerated method: VROSC.AdjustableMesh.OnDisable void VROSC::AdjustableMesh::OnDisable() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::OnDisable"); auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::VROSC::AdjustableMesh*), 9)); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.UseOriginalMesh void VROSC::AdjustableMesh::UseOriginalMesh() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::UseOriginalMesh"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UseOriginalMesh", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); } // Autogenerated method: VROSC.AdjustableMesh.SetMesh void VROSC::AdjustableMesh::SetMesh(::UnityEngine::Mesh* mesh) { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::SetMesh"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetMesh", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(mesh)}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, mesh); } // Autogenerated method: VROSC.AdjustableMesh.AddUIColoring void VROSC::AdjustableMesh::AddUIColoring() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AdjustableMesh::AddUIColoring"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AddUIColoring", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{}))); ::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method); }
75.507124
593
0.777489
v0idp
bd042340e98f74265e35d8846b034aed6372ad54
7,592
cpp
C++
libgramtools/src/prg/linearised_prg.cpp
bricoletc/gramtools
1ce06178b7b26f42d72e47d3d7b8a7a606e6f256
[ "MIT" ]
null
null
null
libgramtools/src/prg/linearised_prg.cpp
bricoletc/gramtools
1ce06178b7b26f42d72e47d3d7b8a7a606e6f256
[ "MIT" ]
null
null
null
libgramtools/src/prg/linearised_prg.cpp
bricoletc/gramtools
1ce06178b7b26f42d72e47d3d7b8a7a606e6f256
[ "MIT" ]
null
null
null
#include "prg/linearised_prg.hpp" #include "common/parameters.hpp" #include "common/utils.hpp" /********************** * Supporting nesting** **********************/ PRG_String::PRG_String(std::string const &file_in, endianness en) : odd_site_end_found(false), en(en) { std::fstream input(file_in, std::ios::in | std::ios::binary); if (!input) throw std::ios::failure("PRG String file not found"); else { uint32_t c{0}; uint8_t buffer[gram::num_bytes_per_integer]; // Note, use uint8_t and not // char which is signed size_t byte_pos; while (true) { input.read((char *)&buffer, gram::num_bytes_per_integer); // Read byte by byte if (input.eof()) break; if (en == endianness::big) { c = (uint32_t)buffer[0] << 24 | (uint32_t)buffer[1] << 16 | (uint32_t)buffer[2] << 8 | (uint32_t)buffer[3]; } else { c = (uint32_t)buffer[0] | (uint32_t)buffer[1] << 8 | (uint32_t)buffer[2] << 16 | (uint32_t)buffer[3] << 24; } if (input.eof()) break; assert(c >= 1); my_PRG_string.push_back(c); c = 0; } }; output_file = file_in; map_ends_and_check_for_duplicates(); // Rewrite `file_in`, in two cases: // - The PRG string was in legacy format (5G6C5) // - sdsl requires it in little endian for building the fm_index if (odd_site_end_found || en == endianness::big) write(output_file, endianness::little); } PRG_String::PRG_String(marker_vec const &v_in) { my_PRG_string = std::move(v_in); map_ends_and_check_for_duplicates(); }; void PRG_String::map_ends_and_check_for_duplicates() { int pos = 0; std::size_t v_size = my_PRG_string.size(); // Converts to signed Marker marker; std::set<Marker> seen_sites; while (pos < v_size) { marker = my_PRG_string[pos]; if (marker <= 4) { ++pos; continue; } if (is_site_marker(marker)) { bool seen_before = seen_sites.find(marker) != seen_sites.end(); if (seen_before) { // Duplicate site marker throw std::runtime_error( "PRG consistency error:" " site marker " + std::to_string(marker) + " used for two different sites"); } else seen_sites.insert(marker); } else { end_positions[marker] = pos; // Inserts if does not exist, updates otherwise } ++pos; } } void PRG_String::write(std::string const &fname, endianness en) { std::ofstream out(fname, std::ofstream::out | std::ofstream::binary); if (!out) { std::cerr << "Cannot open file: " << fname << std::endl; exit(1); } std::vector<char> buffer(gram::num_bytes_per_integer); uint8_t byte_number; uint8_t model_byte_number; if (en == endianness::big) model_byte_number = gram::num_bytes_per_integer - 1; else model_byte_number = 0; for (auto &s : my_PRG_string) { buffer.clear(); byte_number = model_byte_number; while (true) { // In big endian, will push the most significant bytes first in buffer // In little ^^, will push the least ^^ ^^ ^^ buffer.push_back(s >> 8 * byte_number); if (en == endianness::big) { if (byte_number-- == 0) break; } else { if (byte_number++ == gram::num_bytes_per_integer - 1) break; } } for (auto e : buffer) out.write(&e, 1); } out.close(); } std::ostream &operator<<(std::ostream &out, PRG_String const &e) { for (auto &s : e.my_PRG_string) out << s << " "; return out; } bool operator==(PRG_String const &first, PRG_String const &second) { auto const &p_1 = first.get_PRG_string(); auto const &p_2 = second.get_PRG_string(); if (p_1.size() != p_2.size()) return false; for (int i = 0; i < p_1.size(); ++i) { if (p_1[i] != p_2[i]) return false; } return true; } std::string gram::ints_to_prg_string(std::vector<Marker> const &int_vec) { std::string readable_string(int_vec.size(), '0'); std::unordered_map<int, int> last_allele_indices; // Will record where to close the sites. int pos{-1}; for (auto &s : int_vec) { pos++; if (s > 4) { if (s % 2 == 1) readable_string[pos] = '['; else { readable_string[pos] = ','; if (last_allele_indices.find(s) != last_allele_indices.end()) { last_allele_indices.erase(s); } last_allele_indices.insert({s, pos}); } continue; } // Implicit else: s <= 4 char base = decode_dna_base(s).c_str()[0]; readable_string[pos] = base; } // Close the sites for (auto s : last_allele_indices) { auto pos = s.second; readable_string[pos] = ']'; } return readable_string; } marker_vec gram::prg_string_to_ints(std::string const &string_prg) { int_Base base; std::stack<int> marker_stack; int max_var_marker{3}; int char_count{0}; marker_vec encoded_prg(string_prg.size()); for (std::size_t i = 0; i < string_prg.size(); ++i) { const auto &c = string_prg[i]; switch (c) { case '[': { max_var_marker += 2; marker_stack.push(max_var_marker); encoded_prg[char_count++] = max_var_marker; break; } case ']': { assert(!marker_stack.empty()); encoded_prg[char_count++] = marker_stack.top() + 1; marker_stack.pop(); break; } case ',': { assert(!marker_stack.empty()); encoded_prg[char_count++] = marker_stack.top() + 1; break; } default: { base = encode_dna_base(c); if (base == 0) { std::cerr << "Error: the argument " << c << " is not a nucleotide char"; exit(1); } encoded_prg[char_count++] = encode_dna_base(c); break; } } } // BOOST_LOG_TRIVIAL(info) << "Number of sites produced: " << (max_var_marker // -3 ) / 2; return encoded_prg; } /************************** * Not Supporting nesting** **************************/ /** * Converts a sequence of digits (0-9) into a single integer. */ uint64_t concat_marker_digits(const std::vector<int> &marker_digits) { uint64_t marker = 0; for (const auto &digit : marker_digits) marker = marker * 10 + digit; return marker; } /** * Write out marker digits to the encoded prg as a single integer. * @see concat_marker_digits() */ void flush_marker_digits(std::vector<int> &marker_digits, marker_vec &encoded_prg, uint64_t &count_chars) { if (marker_digits.empty()) return; uint64_t marker = concat_marker_digits(marker_digits); encoded_prg[count_chars++] = marker; marker_digits.clear(); } marker_vec gram::encode_prg(const std::string &prg_raw) { marker_vec encoded_prg(prg_raw.length(), 0); uint64_t count_chars = 0; // TODO: this should be possible without storing each individual digit std::vector<int> marker_digits; for (const auto &c : prg_raw) { EncodeResult encode_result = encode_char(c); if (encode_result.is_dna) { // `flush_marker_digits` flushes any latent marker characters flush_marker_digits(marker_digits, encoded_prg, count_chars); encoded_prg[count_chars++] = encode_result.character; continue; } // else: record the digit, and stand ready to record another // TODO: check that character is numeric? marker_digits.push_back(encode_result.character); } flush_marker_digits(marker_digits, encoded_prg, count_chars); encoded_prg.resize(count_chars); return encoded_prg; }
28.541353
79
0.606428
bricoletc
bd05f6e3d79d14594bc8a4a647fb8ac034a2e6fb
16,355
cpp
C++
src/mlpack/core/util/cli.cpp
17minutes/mlpack
8f4af1ec454a662dd7c990cf2146bfeb1bd0cb3a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
2
2021-09-22T18:12:40.000Z
2021-11-17T10:39:58.000Z
src/mlpack/core/util/cli.cpp
kosmaz/Mlpack
62100ddca45880a57e7abb0432df72d285e5728b
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
src/mlpack/core/util/cli.cpp
kosmaz/Mlpack
62100ddca45880a57e7abb0432df72d285e5728b
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
/** * @file cli.cpp * @author Matthew Amidon * * Implementation of the CLI module for parsing parameters. * * mlpack is free software; you may redistribute it and/or modify it under the * terms of the 3-clause BSD license. You should have received a copy of the * 3-clause BSD license along with mlpack. If not, see * http://www.opensource.org/licenses/BSD-3-Clause for more information. */ #include <list> #include <boost/program_options.hpp> #include <boost/scoped_ptr.hpp> #include <iostream> #include "cli.hpp" #include "log.hpp" #include "cli_deleter.hpp" // To make sure we can delete the singleton. #include "version.hpp" #include <mlpack/core/data/load.hpp> #include <mlpack/core/data/save.hpp> using namespace mlpack; using namespace mlpack::util; /* For clarity, we will alias boost's namespace. */ namespace po = boost::program_options; // Fake ProgramDoc in case none is supplied. static ProgramDoc emptyProgramDoc = ProgramDoc("", ""); /* Constructors, Destructors, Copy */ /* Make the constructor private, to preclude unauthorized instances */ CLI::CLI() : desc("Allowed Options") , didParse(false), doc(&emptyProgramDoc) { return; } // Private copy constructor; don't want copies floating around. CLI::CLI(const CLI& other) : desc(other.desc), didParse(false), doc(&emptyProgramDoc) { return; } CLI::~CLI() { // We only need to print output parameters if we're not printing any help or // anything like that. if (!HasParam("help") && !HasParam("info")) { // Print any output. std::list<std::string>::const_iterator it = outputOptions.begin(); while (it != outputOptions.end()) { ParamData& d = parameters[*it]; d.outputFunction(d); ++it; } } // Terminate the program timers. std::map<std::string, std::chrono::microseconds>::iterator it2; for (it2 = timer.GetAllTimers().begin(); it2 != timer.GetAllTimers().end(); ++it2) { std::string i = (*it2).first; if (timer.GetState(i) == 1) Timer::Stop(i); } // Did the user ask for verbose output? If so we need to print everything. // But only if the user did not ask for help or info. if (HasParam("verbose") && !HasParam("help") && !HasParam("info")) { Log::Info << std::endl << "Execution parameters:" << std::endl; std::map<std::string, ParamData>::iterator iter = parameters.begin(); // Print out all the values. while (iter != parameters.end()) { std::string key = iter->second.boostName; Log::Info << " " << key << ": "; // Now, figure out what type it is, and print it. // We can handle strings, ints, bools, floats, doubles. util::ParamData& data = iter->second; data.printFunction(data); Log::Info << std::endl; ++iter; } Log::Info << "Program timers:" << std::endl; std::map<std::string, std::chrono::microseconds>::iterator it; for (it = timer.GetAllTimers().begin(); it != timer.GetAllTimers().end(); ++it) { std::string i = (*it).first; Log::Info << " " << i << ": "; timer.PrintTimer((*it).first); } } // Notify the user if we are debugging, but only if we actually parsed the // options. This way this output doesn't show up inexplicably for someone who // may not have wanted it there, such as in Boost unit tests. if (didParse) Log::Debug << "Compiled with debugging symbols." << std::endl; } /** * Destroy the CLI object. This resets the pointer to the singleton, so in case * someone tries to access it after destruction, a new one will be made (the * program will not fail). */ void CLI::Destroy() { if (singleton != NULL) { delete singleton; singleton = NULL; // Reset pointer. } } /** * See if the specified flag was found while parsing. * * @param identifier The name of the parameter in question. */ bool CLI::HasParam(const std::string& key) { std::string usedKey = key; const po::variables_map& vmap = GetSingleton().vmap; const std::map<std::string, util::ParamData>& parameters = GetSingleton().parameters; if (!parameters.count(key)) { // Check any aliases, but only after we are sure the actual option as given // does not exist. if (key.length() == 1 && GetSingleton().aliases.count(key[0])) usedKey = GetSingleton().aliases[key[0]]; if (!parameters.count(usedKey)) Log::Fatal << "Parameter '--" << key << "' does not exist in this " << "program." << std::endl; } const std::string& checkKey = usedKey; return (vmap.count(parameters.at(checkKey).boostName) > 0); } /**  * Hyphenate a string or split it onto multiple 80-character lines, with some  * amount of padding on each line.  This is used for option output.  *  * @param str String to hyphenate (splits are on ' ').  * @param padding Amount of padding on the left for each new line.  */ std::string CLI::HyphenateString(const std::string& str, int padding) { size_t margin = 80 - padding; if (str.length() < margin) return str; std::string out(""); unsigned int pos = 0; // First try to look as far as possible. while (pos < str.length()) { size_t splitpos; // Check that we don't have a newline first. splitpos = str.find('\n', pos); if (splitpos == std::string::npos || splitpos > (pos + margin)) { // We did not find a newline. if (str.length() - pos < margin) { splitpos = str.length(); // The rest fits on one line. } else { splitpos = str.rfind(' ', margin + pos); // Find nearest space. if (splitpos <= pos || splitpos == std::string::npos) // Not found. splitpos = pos + margin; } } out += str.substr(pos, (splitpos - pos)); if (splitpos < str.length()) { out += '\n'; out += std::string(padding, ' '); } pos = splitpos; if (str[pos] == ' ' || str[pos] == '\n') pos++; } return out; } // Returns the sole instance of this class. CLI& CLI::GetSingleton() { if (singleton == NULL) singleton = new CLI(); return *singleton; } /** * Parses the commandline for arguments. * * @param argc The number of arguments on the commandline. * @param argv The array of arguments as strings */ void CLI::ParseCommandLine(int argc, char** line) { Timer::Start("total_time"); GetSingleton().programName = std::string(line[0]); po::variables_map& vmap = GetSingleton().vmap; po::options_description& desc = GetSingleton().desc; // Parse the command line, place the options & values into vmap. try { // Get the basic_parsed_options. po::basic_parsed_options<char> bpo( po::parse_command_line(argc, line, desc)); // Iterate over all the program_options, looking for duplicate parameters. // If we find any, remove the duplicates. Note that vector options can have // duplicates so we check for those with max_tokens(). for (unsigned int i = 0; i < bpo.options.size(); i++) { for (unsigned int j = i + 1; j < bpo.options.size(); j++) { if ((bpo.options[i].string_key == bpo.options[j].string_key) && (desc.find(bpo.options[i].string_key, false). semantic()->max_tokens() <= 1)) { // If a duplicate is found, check to see if either one has a value. if (bpo.options[i].value.size() == 0 && bpo.options[j].value.size() == 0) { // If neither has a value, consider it a duplicate flag and remove // the duplicate. It's important to not break out of this loop // because there might be another duplicate later on in the vector. bpo.options.erase(bpo.options.begin() + j); --j; } else { // If one or both has a value, produce an error and politely // terminate. We pull the name from the original_tokens, rather than // from the string_key, because the string_key is the parameter // after aliases have been expanded. Log::Fatal << "\"" << bpo.options[j].original_tokens[0] << "\"" << " is defined multiple times." << std::endl; } } } } // Record the basic_parsed_options po::store(bpo, vmap); } catch (std::exception& ex) { Log::Fatal << "Caught exception from parsing command line:\t"; Log::Fatal << ex.what() << std::endl; } // Flush the buffer, make sure changes are propagated to vmap. po::notify(vmap); // If the user specified any of the default options (--help, --version, or // --info), handle those. // --version is prioritized over --help. if (HasParam("version")) { std::cout << GetSingleton().programName << ": part of " << util::GetVersion() << std::endl; exit(0); } // Default help message. if (HasParam("help")) { Log::Info.ignoreInput = false; PrintHelp(); exit(0); // The user doesn't want to run the program, he wants help. } if (HasParam("info")) { Log::Info.ignoreInput = false; std::string str = GetParam<std::string>("info"); // The info node should always be there, but the user may not have specified // anything. if (str != "") { PrintHelp(str); exit(0); } // Otherwise just print the generalized help. PrintHelp(); exit(0); } if (HasParam("verbose")) { // Give [INFO ] output. Log::Info.ignoreInput = false; } // Notify the user if we are debugging. This is not done in the constructor // because the output streams may not be set up yet. We also don't want this // message twice if the user just asked for help or information. Log::Debug << "Compiled with debugging symbols." << std::endl; // Now, warn the user if they missed any required options. std::list<std::string>& rOpt = GetSingleton().requiredOptions; std::list<std::string>::iterator iter; std::map<std::string, util::ParamData>& parameters = GetSingleton().parameters; for (iter = rOpt.begin(); iter != rOpt.end(); ++iter) { const std::string& boostName = parameters[*iter].boostName; if (!vmap.count(parameters[*iter].boostName)) Log::Fatal << "Required option --" << boostName << " is undefined." << std::endl; } // Iterate through vmap, and overwrite default values with anything found on // command line. po::variables_map::iterator i; for (i = vmap.begin(); i != vmap.end(); ++i) { // There is not a possibility of an unknown option, since // boost::program_options will throw an exception. Because some names may // be mapped, we have to look through each ParamData object and get its // boost name. std::string identifier; std::map<std::string, util::ParamData>::const_iterator it = parameters.begin(); while (it != parameters.end()) { if (it->second.boostName == i->first) { identifier = it->first; break; } ++it; } util::ParamData& param = parameters[identifier]; if (param.isFlag) param.value = boost::any(true); else param.value = vmap[i->first].value(); } } /* Prints the descriptions of the current hierarchy. */ void CLI::PrintHelp(const std::string& param) { std::string usedParam = param; std::map<std::string, util::ParamData>& parameters = GetSingleton().parameters; std::map<char, std::string>& aliases = GetSingleton().aliases; std::map<std::string, util::ParamData>::iterator iter; ProgramDoc docs = *GetSingleton().doc; // If we pass a single param, alias it if necessary. if (usedParam.length() == 1 && aliases.count(usedParam[0])) usedParam = aliases[usedParam[0]]; // Do we only want to print out one value? if (usedParam != "" && parameters.count(usedParam)) { util::ParamData& data = parameters[usedParam]; std::string alias = (data.alias != '\0') ? " (-" + std::string(1, data.alias) + ")" : ""; // Figure out the name of the type. std::string type = " [" + data.stringTypeFunction() + "]"; // Now, print the descriptions. std::string fullDesc = " --" + usedParam + alias + type + " "; if (fullDesc.length() <= 32) // It all fits on one line. std::cout << fullDesc << std::string(32 - fullDesc.length(), ' '); else // We need multiple lines. std::cout << fullDesc << std::endl << std::string(32, ' '); std::cout << HyphenateString(data.desc, 32) << std::endl; return; } else if (usedParam != "") { // User passed a single variable, but it doesn't exist. std::cerr << "Parameter --" << usedParam << " does not exist." << std::endl; exit(1); // Nothing left to do. } // Print out the descriptions. if (docs.programName != "") { std::cout << docs.programName << std::endl << std::endl; std::cout << " " << HyphenateString(docs.documentation, 2) << std::endl << std::endl; } else std::cout << "[undocumented program]" << std::endl << std::endl; for (size_t pass = 0; pass < 3; ++pass) { bool printedHeader = false; // Print out the descriptions of everything else. for (iter = parameters.begin(); iter != parameters.end(); ++iter) { util::ParamData& data = iter->second; std::string key = data.boostName; std::string desc = data.desc; std::string alias = (iter->second.alias != '\0') ? std::string(1, iter->second.alias) : ""; alias = alias.length() ? " (-" + alias + ")" : alias; // Filter un-printed options. if ((pass == 0) && !(data.required && data.input)) // Required input. continue; if ((pass == 1) && !(!data.required && data.input)) // Optional input. continue; if ((pass == 2) && data.input) // Output options only (always optional). continue; // For reverse compatibility: this can be removed when these options are // gone in mlpack 3.0.0. We don't want to print the deprecated options. if (data.name == "inputFile") continue; if (!printedHeader) { printedHeader = true; if (pass == 0) std::cout << "Required input options:" << std::endl << std::endl; else if (pass == 1) std::cout << "Optional input options: " << std::endl << std::endl; else if (pass == 2) std::cout << "Optional output options: " << std::endl << std::endl; } if (pass >= 1) // Append default value to description. desc += " Default value " + data.defaultFunction(data) + "."; // Now, print the descriptions. std::string type = " [" + data.stringTypeFunction() + "]"; std::string fullDesc = " --" + key + alias + type + " "; if (fullDesc.length() <= 32) // It all fits on one line. std::cout << fullDesc << std::string(32 - fullDesc.length(), ' '); else // We need multiple lines. std::cout << fullDesc << std::endl << std::string(32, ' '); std::cout << HyphenateString(desc, 32) << std::endl; } if (printedHeader) std::cout << std::endl; } // Helpful information at the bottom of the help output, to point the user to // citations and better documentation (if necessary). See ticket #201. std::cout << HyphenateString("For further information, including relevant " "papers, citations, and theory, consult the documentation found at " "http://www.mlpack.org or included with your distribution of mlpack.", 0) << std::endl; } /** * Registers a ProgramDoc object, which contains documentation about the * program. * * @param doc Pointer to the ProgramDoc object. */ void CLI::RegisterProgramDoc(ProgramDoc* doc) { // Only register the doc if it is not the dummy object we created at the // beginning of the file (as a default value in case this is never called). if (doc != &emptyProgramDoc) GetSingleton().doc = doc; } // Add default parameters that are included in every program. PARAM_FLAG("help", "Default help info.", "h"); PARAM_STRING_IN("info", "Get help on a specific module or option.", "", ""); PARAM_FLAG("verbose", "Display informational messages and the full list of " "parameters and timers at the end of execution.", "v"); PARAM_FLAG("version", "Display the version of mlpack.", "V");
31.757282
80
0.612901
17minutes
bd060b66a878f0e261a255c0bf551440b10985d7
9,928
cxx
C++
src/primitive.cxx
DaWelter/NaiveTrace
a904785a0e13c394b2c221bc918cddb41bc8b175
[ "FSFAP" ]
16
2018-04-25T08:14:14.000Z
2022-01-29T06:19:16.000Z
src/primitive.cxx
DaWelter/NaiveTrace
a904785a0e13c394b2c221bc918cddb41bc8b175
[ "FSFAP" ]
null
null
null
src/primitive.cxx
DaWelter/NaiveTrace
a904785a0e13c394b2c221bc918cddb41bc8b175
[ "FSFAP" ]
null
null
null
#include "primitive.hxx" #include "sampler.hxx" #include "ray.hxx" #include "scene.hxx" Mesh::Mesh(index_t num_triangles, index_t num_vertices) : Geometry{Geometry::PRIMITIVES_TRIANGLES} { // Using Eigen::NoChange because number of columns is fixed by compile time constant. vertices.resize(num_vertices, Eigen::NoChange); vert_indices.resize(num_triangles, Eigen::NoChange); normals.resize(num_vertices, Eigen::NoChange); uvs.resize(num_vertices, Eigen::NoChange); } void Mesh::MakeFlatNormals() { auto old_vertices = vertices; auto old_uvs = uvs; auto num_vertices = NumTriangles()*3; vertices.resize(num_vertices, Eigen::NoChange); normals.resize(num_vertices, Eigen::NoChange); uvs.resize(num_vertices, Eigen::NoChange); index_t k = 0; for (index_t i=0; i<NumTriangles(); ++i) { auto a = vert_indices(i, 0); auto b = vert_indices(i, 1); auto c = vert_indices(i, 2); Float3 d1 = old_vertices.row(b)-old_vertices.row(a); Float3 d2 = old_vertices.row(c)-old_vertices.row(a); Float3 n = Normalized(Cross(d1, d2)); for (index_t j=0; j<3; ++j) { auto v_idx = vert_indices(i, j); vertices.row(k) = old_vertices.row(v_idx); normals.row(k) = n; uvs.row(k) = old_uvs.row(v_idx); vert_indices(i, j) = k; ++k; } } } void Mesh::Append(const Geometry & other) { if (other.type != this->type) throw std::runtime_error("Geometry type mismatch!"); this->Append(static_cast<const Mesh&>(other)); } template<class M> static void AppendVertical(M &a, const M &b) { // Did NOT work for me: https://stackoverflow.com/questions/21496157/eigen-how-to-concatenate-matrix-along-a-specific-dimension auto prev_a_rows = a.rows(); M c(a.rows()+b.rows(), a.cols()); c << a, b; a.resizeLike(c); // Resizing uninitializes the matrix! Unlike e.g. numpy where the data is copied over. a = c; } void Mesh::Append(const Mesh &other) { //if (other.material_index != material_index) // throw std::runtime_error("Cannot merge geometries with mismatching materials"); // a + b > overflow => b > overflow - a if (other.NumTriangles() > std::numeric_limits<decltype(NumTriangles())>::max() - NumTriangles()) throw std::range_error("Cannot handle that many triangles in a mesh."); if (other.NumVertices() > std::numeric_limits<decltype(NumVertices())>::max() - NumVertices()) throw std::range_error("Cannot handle that many vertices in a mesh."); auto tri_start = vert_indices.rows(); auto vert_start = vertices.rows(); AppendVertical(vertices, other.vertices); AppendVertical(normals, other.normals); AppendVertical(uvs, other.uvs); AppendVertical(vert_indices, other.vert_indices); for (auto i=tri_start; i<vert_indices.rows(); ++i) { vert_indices(i, 0) += vert_start; vert_indices(i, 1) += vert_start; vert_indices(i, 2) += vert_start; } } void Mesh::GetLocalGeometry(SurfaceInteraction& ia) const { assert(ia.hitid.geom == this); assert(ia.hitid.index >= 0 && ia.hitid.index < Size()); const auto a = vert_indices(ia.hitid.index, 0), b = vert_indices(ia.hitid.index, 1), c = vert_indices(ia.hitid.index, 2); const Float3 f = ia.hitid.barry.cast<float>(); const Float3 pos = f[0] * vertices.row(a) + f[1] * vertices.row(b) + f[2] * vertices.row(c); ia.pos = pos.cast<double>(); const Float3 normal = Normalized(Cross(vertices.row(b)-vertices.row(a),vertices.row(c)-vertices.row(a))); ia.geometry_normal = normal.cast<double>(); const Float3 smooth_normal = Normalized( normals.row(a)*f[0]+ normals.row(b)*f[1]+ normals.row(c)*f[2]); ia.smooth_normal = smooth_normal.cast<double>(); assert (ia.pos.allFinite()); assert (ia.geometry_normal.allFinite()); assert (ia.smooth_normal.allFinite()); ASSERT_NORMALIZED(ia.geometry_normal); ASSERT_NORMALIZED(ia.smooth_normal); FillPosBoundsTriangle(ia, vertices.row(a), vertices.row(b), vertices.row(c)); } HitId Mesh::SampleUniformPosition(index_t index, Sampler &sampler) const { return HitId{ this, index, SampleTrafo::ToTriangleBarycentricCoords(sampler.UniformUnitSquare()) }; } double Mesh::Area(index_t index) const { assert(index >= 0 && index < Size()); const auto a = vert_indices(index, 0), b = vert_indices(index, 1), c = vert_indices(index, 2); const Float3 n(Cross(vertices.row(b)-vertices.row(a),vertices.row(c)-vertices.row(a))); return 0.5*Length(n); } std::unique_ptr<Geometry> Mesh::Clone() const { return std::make_unique<Mesh>(*this); } void AppendSingleTriangle( Mesh &dst, const Float3 &a, const Float3 &b, const Float3 &c, const Float3 &n) { Mesh m{1, 3}; m.vertices.transpose() << a, b, c; m.uvs.transpose() << Float2{a[0], a[1]}, Float2{b[0], b[1]}, Float2{c[0], c[1]}; m.normals.transpose() << n, n, n; m.vert_indices.transpose() << UInt3{0,1,2}; dst.Append(m); } ////////////////////////////////////////////////////////////////////// Spheres::Spheres() : Geometry(Geometry::PRIMITIVES_SPHERES) { } void Spheres::Append(const Float3 pos, const float radius) { if (Size() >= std::numeric_limits<decltype(Size())>::max()) throw std::range_error("Cannot handle that many spheres in a geometry."); spheres.push_back(Vector4f{ pos[0], pos[1], pos[2], radius }); } void Spheres::Append(const Spheres& other) { //if (other.material_index != material_index) // throw std::runtime_error("Cannot merge geometries with mismatching materials"); if (other.Size() > std::numeric_limits<decltype(Size())>::max() - Size()) throw std::range_error("Cannot handle that many spheres in a geometry."); spheres.insert(spheres.end(), other.spheres.begin(), other.spheres.end()); } void Spheres::Append(const Geometry & other) { if (other.type != this->type) throw std::runtime_error("Geometry type mismatch!"); this->Append(static_cast<const Spheres&>(other)); } HitId Spheres::SampleUniformPosition(index_t index, Sampler &sampler) const { assert(index >= 0 && index < spheres.size()); float rad = spheres[index][3]; Double3 barry = rad*SampleTrafo::ToUniformSphere(sampler.UniformUnitSquare()); return HitId{ this, index, barry.cast<double>() }; } double Spheres::Area(index_t index) const { assert(index >= 0 && index < spheres.size()); float radius = spheres[index][3]; return Sqr(radius)*UnitSphereSurfaceArea; } void Spheres::GetLocalGeometry(SurfaceInteraction& ia) const { assert(ia.hitid.geom == this); Float3 center = spheres[ia.hitid.index].head<3>(); float rad = spheres[ia.hitid.index][3]; ia.geometry_normal = Normalized(ia.hitid.barry); ia.smooth_normal = ia.geometry_normal; ia.pos = (center.cast<double>() + ia.hitid.barry); FillPosBoundsSphere(ia); } std::unique_ptr<Geometry> Spheres::Clone() const { return std::make_unique<Spheres>(*this); } ////////////////////////////////////////////////////////////////////// #if 0 Points::Points() : Geometry(PRIMITIVES_POINTS) { } Points::Points(Double3 & pos) : Geometry(PRIMITIVES_POINTS), points{pos} { } HitId Points::SampleUniformPosition(index_t index, Sampler & sampler) const { return HitId{ this, index, Double3::Zero() }; } double Points::Area(index_t index) const { return 0.0; } Geometry::index_t Points::Size() const { return isize(points); } void Points::GetLocalGeometry(SurfaceInteraction & ia) const { assert(ia.hitid.geom == this); ia.geometry_normal = Double3::Zero(); ia.smooth_normal = Double3::Zero(); ia.pos = points[ia.hitid.index]; // Points cannot be hit, so I don't care. ia.pos_bounds = Double3::Zero(); } void Points::Append(const Geometry & other) { if (Size() >= (std::numeric_limits<decltype(Size())>::max()-other.Size())) throw std::range_error("Cannot handle that many points in a geometry."); if (other.type != this->type) throw std::runtime_error("Geometry type mismatch!"); const auto &other_points = static_cast<const Points&>(other); points.insert(points.end(), other_points.points.begin(), other_points.points.end()); } std::unique_ptr<Geometry> Points::Clone() const { return std::make_unique<Points>(*this); } #endif ////////////////////////////////////////////////////////////////////// void FillPosBoundsTriangle(SurfaceInteraction &interaction, const Float3 &p0, const Float3 &p1, const Float3 &p2) { // Compute the position error bounds, according to PBRT Chpt 3.9, pg. 227 auto b = interaction.hitid.barry.cast<float>(); interaction.pos_bounds = ((p0*b[0]).cwiseAbs() + (p1*b[1]).cwiseAbs() + (p2*b[2]).cwiseAbs())*util::Gamma<float>(7); } void FillPosBoundsSphere(SurfaceInteraction &interaction) { // PBRT. pg.225 Chpt. 3 interaction.pos_bounds = interaction.pos.cast<float>().cwiseAbs()*util::Gamma<float>(5); } ////////////////////////////////////////////////////////////////////// std::tuple<bool, double, double> ClipRayToSphereInterior(const Double3 &ray_org, const Double3 &ray_dir, double tnear, double tfar, const Double3 &sphere_p, double sphere_r) { Double3 v = ray_org - sphere_p; ASSERT_NORMALIZED(ray_dir); const double A = 1.; //Dot(ray_dir,ray_dir); const double B = 2.0*Dot(v,ray_dir); const double C = Dot(v,v) - Sqr(sphere_r); //const float Berr = DotAbs(v, ray_dir)*Gamma<float>(3); //const float Cerr = (2.f*Dot(v,v) + Sqr(sphere_r))*Gamma<float>(3); double t0, t1; //, err0, err1; const bool has_solution = util::Quadratic(A, B, C, t0, t1); if (!has_solution || tfar <= t0 || tnear >= t1) { return std::make_tuple(false, tnear, tfar); } else { if (tnear < t0) { tnear = t0; } if (tfar > t1) { tfar = t1; } assert(tfar > tnear); return std::make_tuple(true, tnear, tfar); } }
29.286136
173
0.649778
DaWelter
bd08ee047e2e975e725dba8ba4780be5c5532372
131
cpp
C++
slides/index_cache/html/unnamed-chunk-2_sourceCpp/sourceCpp-x86_64-pc-linux-gnu-1.0.5/fileacd03ef60123.cpp
gomesfellipe/202011-rcpp
fe1145e4096dc12c42c3a5cc663e41fdcace2d25
[ "MIT" ]
2
2020-11-22T08:48:25.000Z
2020-11-28T12:06:01.000Z
slides/index_cache/html/unnamed-chunk-2_sourceCpp/sourceCpp-x86_64-pc-linux-gnu-1.0.5/fileacd03ef60123.cpp
gomesfellipe/202011-rcpp
fe1145e4096dc12c42c3a5cc663e41fdcace2d25
[ "MIT" ]
null
null
null
slides/index_cache/html/unnamed-chunk-2_sourceCpp/sourceCpp-x86_64-pc-linux-gnu-1.0.5/fileacd03ef60123.cpp
gomesfellipe/202011-rcpp
fe1145e4096dc12c42c3a5cc663e41fdcace2d25
[ "MIT" ]
2
2020-11-21T11:57:16.000Z
2020-11-28T12:06:04.000Z
#include <Rcpp.h> // [[Rcpp::export]] void hello (std::string name) { Rcpp::Rcout << "hello " + name << std::endl; }
14.555556
29
0.526718
gomesfellipe
bd0bca7183f6ec03c832d85dbe10e9596870066e
2,643
cpp
C++
test/json_test_suite_array_failures.cpp
kercl/JsonStream
273ae5d0354d70eb39e38ebe4b7570fbf9a840b9
[ "MIT" ]
1
2021-06-01T00:29:30.000Z
2021-06-01T00:29:30.000Z
test/json_test_suite_array_failures.cpp
kercl/JsonStreamReader
273ae5d0354d70eb39e38ebe4b7570fbf9a840b9
[ "MIT" ]
null
null
null
test/json_test_suite_array_failures.cpp
kercl/JsonStreamReader
273ae5d0354d70eb39e38ebe4b7570fbf9a840b9
[ "MIT" ]
null
null
null
#define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE JSON_TEST_SUITE_ARRAY_FAILURES #include <boost/test/unit_test.hpp> #include "TestParser.h" JSON_PARSER_EXPECT_FAILURE(n_array_1_true_without_comma, R"json( [1 true] )json") JSON_PARSER_EXPECT_FAILURE(n_array_a_invalid_utf8, R"json( [a�] )json") JSON_PARSER_EXPECT_FAILURE(n_array_colon_instead_of_comma, R"json( ["": 1] )json") JSON_PARSER_EXPECT_FAILURE(n_array_comma_after_close, R"json( [""], )json") JSON_PARSER_EXPECT_FAILURE(n_array_comma_and_number, R"json( [,1] )json") JSON_PARSER_EXPECT_FAILURE(n_array_double_comma, R"json( [1,,2] )json") JSON_PARSER_EXPECT_FAILURE(n_array_double_extra_comma, R"json( ["x",,] )json") JSON_PARSER_EXPECT_FAILURE(n_array_extra_close, R"json( ["x"]] )json") JSON_PARSER_EXPECT_FAILURE(n_array_extra_comma, R"json( ["",] )json") JSON_PARSER_EXPECT_FAILURE(n_array_incomplete_invalid_value, R"json( [x )json") JSON_PARSER_EXPECT_FAILURE(n_array_incomplete, R"json( ["x" )json") JSON_PARSER_EXPECT_FAILURE(n_array_inner_array_no_comma, R"json( [3[4]] )json") JSON_PARSER_EXPECT_FAILURE(n_array_invalid_utf8, R"json( [�] )json") JSON_PARSER_EXPECT_FAILURE(n_array_items_separated_by_semicolon, R"json( [1:2] )json") JSON_PARSER_EXPECT_FAILURE(n_array_just_comma, R"json( [,] )json") JSON_PARSER_EXPECT_FAILURE(n_array_just_minus, R"json( [-] )json") JSON_PARSER_EXPECT_FAILURE(n_array_missing_value, R"json( [ , ""] )json") JSON_PARSER_EXPECT_FAILURE(n_array_newlines_unclosed, R"json( ["a", 4 ,1, )json") JSON_PARSER_EXPECT_FAILURE(n_array_number_and_comma, R"json( [1,] )json") JSON_PARSER_EXPECT_FAILURE(n_array_number_and_several_commas, R"json( [1,,] )json") JSON_PARSER_EXPECT_FAILURE(n_array_spaces_vertical_tab_formfeed, R"json( ["a"\f] )json") JSON_PARSER_EXPECT_FAILURE(n_array_star_inside, R"json( [*] )json") JSON_PARSER_EXPECT_FAILURE(n_array_unclosed, R"json( ["" )json") JSON_PARSER_EXPECT_FAILURE(n_array_unclosed_trailing_comma, R"json( [1, )json") JSON_PARSER_EXPECT_FAILURE(n_array_unclosed_with_new_lines, R"json( [1, 1 ,1 )json") JSON_PARSER_EXPECT_FAILURE(n_array_unclosed_with_object_inside, R"json( [{} )json")
80.090909
95
0.649641
kercl
bd0d0d0a43a309fa891cab1fcfc4bf2a31bc9e24
1,131
cpp
C++
data/dailyCodingProblem55.cpp
vidit1999/daily_coding_problem
b90319cb4ddce11149f54010ba36c4bd6fa0a787
[ "MIT" ]
2
2020-09-04T20:56:23.000Z
2021-06-11T07:42:26.000Z
data/dailyCodingProblem55.cpp
vidit1999/daily_coding_problem
b90319cb4ddce11149f54010ba36c4bd6fa0a787
[ "MIT" ]
null
null
null
data/dailyCodingProblem55.cpp
vidit1999/daily_coding_problem
b90319cb4ddce11149f54010ba36c4bd6fa0a787
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; const string ALL_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; /* Implement a URL shortener with the following methods: shorten(url), which shortens the url into a six-character alphanumeric string, such as zLg6wl. restore(short), which expands the shortened string into the original url. If no such shortened string exists, return null. Hint: What if we enter the same URL twice? */ string shorten(int url){ string short_url; while(url){ short_url = ALL_CHARS[url%62] + short_url; url /= 62; } return short_url; } int restore(string short_url){ int id = 0; for(char c : short_url){ id *= 62; if('a' <= c && c <= 'z') id += (c - 'a'); else if('A' <= c && c <= 'Z') id += (c - 'A' + 26); else id += (c - '0' + 52); } return id; } // main function int main(){ srand(time(0)); for(int i=0; i<20; i++){ int url = rand(); string tiny = shorten(url); int res = restore(tiny); cout << boolalpha << url << ", " << tiny << ", " << res << ", " << (url == res) << "\n"; } return 0; }
19.5
94
0.603006
vidit1999
bd0e8102a83e724c54b9c3796f1ae6d126b15405
8,831
cpp
C++
MonoNative.Tests/mscorlib/System/Security/AccessControl/mscorlib_System_Security_AccessControl_DiscretionaryAcl_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/Security/AccessControl/mscorlib_System_Security_AccessControl_DiscretionaryAcl_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/Security/AccessControl/mscorlib_System_Security_AccessControl_DiscretionaryAcl_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.Security.AccessControl // Name: DiscretionaryAcl // C++ Typed Name: mscorlib::System::Security::AccessControl::DiscretionaryAcl #include <gtest/gtest.h> #include <mscorlib/System/Security/AccessControl/mscorlib_System_Security_AccessControl_DiscretionaryAcl.h> #include <mscorlib/System/Security/Principal/mscorlib_System_Security_Principal_SecurityIdentifier.h> #include <mscorlib/System/mscorlib_System_Guid.h> #include <mscorlib/System/Security/AccessControl/mscorlib_System_Security_AccessControl_GenericAce.h> #include <mscorlib/System/mscorlib_System_Type.h> #include <mscorlib/System/mscorlib_System_String.h> namespace mscorlib { namespace System { namespace Security { namespace AccessControl { //Constructors Tests //DiscretionaryAcl(mscorlib::System::Boolean isContainer, mscorlib::System::Boolean isDS, mscorlib::System::Int32 capacity) TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,Constructor_1) { } //DiscretionaryAcl(mscorlib::System::Boolean isContainer, mscorlib::System::Boolean isDS, mscorlib::System::Security::AccessControl::RawAcl rawAcl) TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,Constructor_2) { } //DiscretionaryAcl(mscorlib::System::Boolean isContainer, mscorlib::System::Boolean isDS, mscorlib::System::Byte revision, mscorlib::System::Int32 capacity) TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,Constructor_3) { } //Public Methods Tests // Method AddAccess // Signature: mscorlib::System::Security::AccessControl::AccessControlType::__ENUM__ accessType, mscorlib::System::Security::Principal::SecurityIdentifier sid, mscorlib::System::Int32 accessMask, mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__ inheritanceFlags, mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__ propagationFlags TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,AddAccess_1_Test) { } // Method AddAccess // Signature: mscorlib::System::Security::AccessControl::AccessControlType::__ENUM__ accessType, mscorlib::System::Security::Principal::SecurityIdentifier sid, mscorlib::System::Int32 accessMask, mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__ inheritanceFlags, mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__ propagationFlags, mscorlib::System::Security::AccessControl::ObjectAceFlags::__ENUM__ objectFlags, mscorlib::System::Guid objectType, mscorlib::System::Guid inheritedObjectType TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,AddAccess_2_Test) { } // Method RemoveAccess // Signature: mscorlib::System::Security::AccessControl::AccessControlType::__ENUM__ accessType, mscorlib::System::Security::Principal::SecurityIdentifier sid, mscorlib::System::Int32 accessMask, mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__ inheritanceFlags, mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__ propagationFlags TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,RemoveAccess_1_Test) { } // Method RemoveAccess // Signature: mscorlib::System::Security::AccessControl::AccessControlType::__ENUM__ accessType, mscorlib::System::Security::Principal::SecurityIdentifier sid, mscorlib::System::Int32 accessMask, mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__ inheritanceFlags, mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__ propagationFlags, mscorlib::System::Security::AccessControl::ObjectAceFlags::__ENUM__ objectFlags, mscorlib::System::Guid objectType, mscorlib::System::Guid inheritedObjectType TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,RemoveAccess_2_Test) { } // Method RemoveAccessSpecific // Signature: mscorlib::System::Security::AccessControl::AccessControlType::__ENUM__ accessType, mscorlib::System::Security::Principal::SecurityIdentifier sid, mscorlib::System::Int32 accessMask, mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__ inheritanceFlags, mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__ propagationFlags TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,RemoveAccessSpecific_1_Test) { } // Method RemoveAccessSpecific // Signature: mscorlib::System::Security::AccessControl::AccessControlType::__ENUM__ accessType, mscorlib::System::Security::Principal::SecurityIdentifier sid, mscorlib::System::Int32 accessMask, mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__ inheritanceFlags, mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__ propagationFlags, mscorlib::System::Security::AccessControl::ObjectAceFlags::__ENUM__ objectFlags, mscorlib::System::Guid objectType, mscorlib::System::Guid inheritedObjectType TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,RemoveAccessSpecific_2_Test) { } // Method SetAccess // Signature: mscorlib::System::Security::AccessControl::AccessControlType::__ENUM__ accessType, mscorlib::System::Security::Principal::SecurityIdentifier sid, mscorlib::System::Int32 accessMask, mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__ inheritanceFlags, mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__ propagationFlags TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,SetAccess_1_Test) { } // Method SetAccess // Signature: mscorlib::System::Security::AccessControl::AccessControlType::__ENUM__ accessType, mscorlib::System::Security::Principal::SecurityIdentifier sid, mscorlib::System::Int32 accessMask, mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__ inheritanceFlags, mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__ propagationFlags, mscorlib::System::Security::AccessControl::ObjectAceFlags::__ENUM__ objectFlags, mscorlib::System::Guid objectType, mscorlib::System::Guid inheritedObjectType TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,SetAccess_2_Test) { } //Public Properties Tests // Property BinaryLength // Return Type: mscorlib::System::Int32 // Property Get Method TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,get_BinaryLength_Test) { } // Property Count // Return Type: mscorlib::System::Int32 // Property Get Method TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,get_Count_Test) { } // Property IsCanonical // Return Type: mscorlib::System::Boolean // Property Get Method TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,get_IsCanonical_Test) { } // Property IsContainer // Return Type: mscorlib::System::Boolean // Property Get Method TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,get_IsContainer_Test) { } // Property IsDS // Return Type: mscorlib::System::Boolean // Property Get Method TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,get_IsDS_Test) { } // Property Revision // Return Type: mscorlib::System::Byte // Property Get Method TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,get_Revision_Test) { } // Property Item // Return Type: mscorlib::System::Security::AccessControl::GenericAce // Property Get Method TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,get_Item_Test) { } // Property Item // Return Type: mscorlib::System::Security::AccessControl::GenericAce // Property Set Method TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,set_Item_Test) { } // Property IsSynchronized // Return Type: mscorlib::System::Boolean // Property Get Method TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,get_IsSynchronized_Test) { } // Property SyncRoot // Return Type: mscorlib::System::Object // Property Get Method TEST(mscorlib_System_Security_AccessControl_DiscretionaryAcl_Fixture,get_SyncRoot_Test) { } } } } }
40.884259
535
0.760956
brunolauze
bd0f068063ce6bb091e72722a8fab3d36c3eba1f
226
cpp
C++
lib/net/cmd/mgcommand.cpp
matheopit/yayasensor
000ef90529858fcca2658f49114b1e659968e66c
[ "MIT" ]
null
null
null
lib/net/cmd/mgcommand.cpp
matheopit/yayasensor
000ef90529858fcca2658f49114b1e659968e66c
[ "MIT" ]
null
null
null
lib/net/cmd/mgcommand.cpp
matheopit/yayasensor
000ef90529858fcca2658f49114b1e659968e66c
[ "MIT" ]
null
null
null
#include "mgcommand.h" BaseCommand::BaseCommand(const std::string& name,const json_t*/*jdata*/) :m_cmdname(name) { } BaseCommand::~BaseCommand() { } std::string BaseCommand::commandName() { return m_cmdname; }
10.761905
72
0.681416
matheopit
bd1330a1edd7bf565eb65453e4d0ce4a7f558ace
9,269
cpp
C++
src/twofish.cpp
vster/OpenCL
fb29aead4e6345e23f3f7ba5fb038fa1fd217e10
[ "BSD-2-Clause" ]
46
2015-12-04T17:12:58.000Z
2022-03-11T04:30:49.000Z
src/twofish.cpp
vster/OpenCL
fb29aead4e6345e23f3f7ba5fb038fa1fd217e10
[ "BSD-2-Clause" ]
null
null
null
src/twofish.cpp
vster/OpenCL
fb29aead4e6345e23f3f7ba5fb038fa1fd217e10
[ "BSD-2-Clause" ]
23
2016-10-24T09:18:14.000Z
2022-02-25T02:11:35.000Z
/************************************************* * Twofish Source File * * (C) 1999-2001 The OpenCL Project * *************************************************/ #include <opencl/twofish.h> namespace OpenCL { /************************************************* * Twofish Encryption * *************************************************/ void Twofish::encrypt(const byte in[BLOCKSIZE], byte out[BLOCKSIZE]) const { u32bit A = make_u32bit(in[ 3], in[ 2], in[ 1], in[ 0]), B = make_u32bit(in[ 7], in[ 6], in[ 5], in[ 4]), C = make_u32bit(in[11], in[10], in[ 9], in[ 8]), D = make_u32bit(in[15], in[14], in[13], in[12]); A ^= round_key[0]; B ^= round_key[1]; C ^= round_key[2]; D ^= round_key[3]; encrypt_round(A, B, C, D, 0); encrypt_round(C, D, A, B, 1); encrypt_round(A, B, C, D, 2); encrypt_round(C, D, A, B, 3); encrypt_round(A, B, C, D, 4); encrypt_round(C, D, A, B, 5); encrypt_round(A, B, C, D, 6); encrypt_round(C, D, A, B, 7); encrypt_round(A, B, C, D, 8); encrypt_round(C, D, A, B, 9); encrypt_round(A, B, C, D,10); encrypt_round(C, D, A, B,11); encrypt_round(A, B, C, D,12); encrypt_round(C, D, A, B,13); encrypt_round(A, B, C, D,14); encrypt_round(C, D, A, B,15); C ^= round_key[4]; D ^= round_key[5]; A ^= round_key[6]; B ^= round_key[7]; out[ 0] = get_byte(3, C); out[ 1] = get_byte(2, C); out[ 2] = get_byte(1, C); out[ 3] = get_byte(0, C); out[ 4] = get_byte(3, D); out[ 5] = get_byte(2, D); out[ 6] = get_byte(1, D); out[ 7] = get_byte(0, D); out[ 8] = get_byte(3, A); out[ 9] = get_byte(2, A); out[10] = get_byte(1, A); out[11] = get_byte(0, A); out[12] = get_byte(3, B); out[13] = get_byte(2, B); out[14] = get_byte(1, B); out[15] = get_byte(0, B); } /************************************************* * Twofish Decryption * *************************************************/ void Twofish::decrypt(const byte in[BLOCKSIZE], byte out[BLOCKSIZE]) const { u32bit A = make_u32bit(in[ 3], in[ 2], in[ 1], in[ 0]), B = make_u32bit(in[ 7], in[ 6], in[ 5], in[ 4]), C = make_u32bit(in[11], in[10], in[ 9], in[ 8]), D = make_u32bit(in[15], in[14], in[13], in[12]); A ^= round_key[4]; B ^= round_key[5]; C ^= round_key[6]; D ^= round_key[7]; decrypt_round(A, B, C, D,15); decrypt_round(C, D, A, B,14); decrypt_round(A, B, C, D,13); decrypt_round(C, D, A, B,12); decrypt_round(A, B, C, D,11); decrypt_round(C, D, A, B,10); decrypt_round(A, B, C, D, 9); decrypt_round(C, D, A, B, 8); decrypt_round(A, B, C, D, 7); decrypt_round(C, D, A, B, 6); decrypt_round(A, B, C, D, 5); decrypt_round(C, D, A, B, 4); decrypt_round(A, B, C, D, 3); decrypt_round(C, D, A, B, 2); decrypt_round(A, B, C, D, 1); decrypt_round(C, D, A, B, 0); C ^= round_key[0]; D ^= round_key[1]; A ^= round_key[2]; B ^= round_key[3]; out[ 0] = get_byte(3, C); out[ 1] = get_byte(2, C); out[ 2] = get_byte(1, C); out[ 3] = get_byte(0, C); out[ 4] = get_byte(3, D); out[ 5] = get_byte(2, D); out[ 6] = get_byte(1, D); out[ 7] = get_byte(0, D); out[ 8] = get_byte(3, A); out[ 9] = get_byte(2, A); out[10] = get_byte(1, A); out[11] = get_byte(0, A); out[12] = get_byte(3, B); out[13] = get_byte(2, B); out[14] = get_byte(1, B); out[15] = get_byte(0, B); } /************************************************* * Twofish Encryption Round * *************************************************/ void Twofish::encrypt_round(u32bit A, u32bit B, u32bit& C, u32bit& D, u32bit round) const { u32bit X = SBox0[get_byte(3, A)] ^ SBox1[get_byte(2, A)] ^ SBox2[get_byte(1, A)] ^ SBox3[get_byte(0, A)]; u32bit Y = SBox0[get_byte(0, B)] ^ SBox1[get_byte(3, B)] ^ SBox2[get_byte(2, B)] ^ SBox3[get_byte(1, B)]; X += Y; Y += X + round_key[2*round + 9]; X += round_key[2*round + 8]; C = rotate_right(C ^ X, 1); D = rotate_left(D, 1) ^ Y; } /************************************************* * Twofish Decryption Round * *************************************************/ void Twofish::decrypt_round(u32bit A, u32bit B, u32bit& C, u32bit& D, u32bit round) const { u32bit X = SBox0[get_byte(3, A)] ^ SBox1[get_byte(2, A)] ^ SBox2[get_byte(1, A)] ^ SBox3[get_byte(0, A)]; u32bit Y = SBox0[get_byte(0, B)] ^ SBox1[get_byte(3, B)] ^ SBox2[get_byte(2, B)] ^ SBox3[get_byte(1, B)]; X += Y; Y += X + round_key[2*round + 9]; X += round_key[2*round + 8]; C = rotate_left(C, 1) ^ X; D = rotate_right(D ^ Y, 1); } /************************************************* * Twofish Key Schedule * *************************************************/ void Twofish::set_key(const byte key[], u32bit length) throw(InvalidKeyLength) { if(!valid_keylength(length)) throw InvalidKeyLength(name(), length); SecureBuffer<byte, 16> S; for(u32bit j = 0; j != length; j++) rs_mul(S + 4*(j/8), key[j], RS[(4*j )%32], RS[(4*j+1)%32], RS[(4*j+2)%32], RS[(4*j+3)%32]); if(length == 16) { for(u32bit j = 0; j != 256; j++) { SBox0[j] = MDS0[Q0[Q0[j]^S[ 0]]^S[ 4]]; SBox1[j] = MDS1[Q0[Q1[j]^S[ 1]]^S[ 5]]; SBox2[j] = MDS2[Q1[Q0[j]^S[ 2]]^S[ 6]]; SBox3[j] = MDS3[Q1[Q1[j]^S[ 3]]^S[ 7]]; } for(u32bit j = 0; j != 40; j += 2) { u32bit X = MDS0[Q0[Q0[j ]^key[ 8]]^key[ 0]] ^ MDS1[Q0[Q1[j ]^key[ 9]]^key[ 1]] ^ MDS2[Q1[Q0[j ]^key[10]]^key[ 2]] ^ MDS3[Q1[Q1[j ]^key[11]]^key[ 3]]; u32bit Y = MDS0[Q0[Q0[j+1]^key[12]]^key[ 4]] ^ MDS1[Q0[Q1[j+1]^key[13]]^key[ 5]] ^ MDS2[Q1[Q0[j+1]^key[14]]^key[ 6]] ^ MDS3[Q1[Q1[j+1]^key[15]]^key[ 7]]; Y = rotate_left(Y, 8); X += Y; Y += X; round_key[j] = X; round_key[j+1] = rotate_left(Y, 9); } } else if(length == 24) { for(u32bit j = 0; j != 256; j++) { SBox0[j] = MDS0[Q0[Q0[Q1[j]^S[ 0]]^S[ 4]]^S[ 8]]; SBox1[j] = MDS1[Q0[Q1[Q1[j]^S[ 1]]^S[ 5]]^S[ 9]]; SBox2[j] = MDS2[Q1[Q0[Q0[j]^S[ 2]]^S[ 6]]^S[10]]; SBox3[j] = MDS3[Q1[Q1[Q0[j]^S[ 3]]^S[ 7]]^S[11]]; } for(u32bit j = 0; j != 40; j += 2) { u32bit X = MDS0[Q0[Q0[Q1[j ]^key[16]]^key[ 8]]^key[ 0]] ^ MDS1[Q0[Q1[Q1[j ]^key[17]]^key[ 9]]^key[ 1]] ^ MDS2[Q1[Q0[Q0[j ]^key[18]]^key[10]]^key[ 2]] ^ MDS3[Q1[Q1[Q0[j ]^key[19]]^key[11]]^key[ 3]]; u32bit Y = MDS0[Q0[Q0[Q1[j+1]^key[20]]^key[12]]^key[ 4]] ^ MDS1[Q0[Q1[Q1[j+1]^key[21]]^key[13]]^key[ 5]] ^ MDS2[Q1[Q0[Q0[j+1]^key[22]]^key[14]]^key[ 6]] ^ MDS3[Q1[Q1[Q0[j+1]^key[23]]^key[15]]^key[ 7]]; Y = rotate_left(Y, 8); X += Y; Y += X; round_key[j] = X; round_key[j+1] = rotate_left(Y, 9); } } else if(length == 32) { for(u32bit j = 0; j != 256; j++) { SBox0[j] = MDS0[Q0[Q0[Q1[Q1[j]^S[ 0]]^S[ 4]]^S[ 8]]^S[12]]; SBox1[j] = MDS1[Q0[Q1[Q1[Q0[j]^S[ 1]]^S[ 5]]^S[ 9]]^S[13]]; SBox2[j] = MDS2[Q1[Q0[Q0[Q0[j]^S[ 2]]^S[ 6]]^S[10]]^S[14]]; SBox3[j] = MDS3[Q1[Q1[Q0[Q1[j]^S[ 3]]^S[ 7]]^S[11]]^S[15]]; } for(u32bit j = 0; j != 40; j += 2) { u32bit X = MDS0[Q0[Q0[Q1[Q1[j ]^key[24]]^key[16]]^key[ 8]]^key[ 0]] ^ MDS1[Q0[Q1[Q1[Q0[j ]^key[25]]^key[17]]^key[ 9]]^key[ 1]] ^ MDS2[Q1[Q0[Q0[Q0[j ]^key[26]]^key[18]]^key[10]]^key[ 2]] ^ MDS3[Q1[Q1[Q0[Q1[j ]^key[27]]^key[19]]^key[11]]^key[ 3]]; u32bit Y = MDS0[Q0[Q0[Q1[Q1[j+1]^key[28]]^key[20]]^key[12]]^key[ 4]] ^ MDS1[Q0[Q1[Q1[Q0[j+1]^key[29]]^key[21]]^key[13]]^key[ 5]] ^ MDS2[Q1[Q0[Q0[Q0[j+1]^key[30]]^key[22]]^key[14]]^key[ 6]] ^ MDS3[Q1[Q1[Q0[Q1[j+1]^key[31]]^key[23]]^key[15]]^key[ 7]]; Y = rotate_left(Y, 8); X += Y; Y += X; round_key[j] = X; round_key[j+1] = rotate_left(Y, 9); } } } /************************************************* * Do one column of the RS matrix multiplcation * *************************************************/ void Twofish::rs_mul(byte S[4], byte key, byte RS1, byte RS2, byte RS3, byte RS4) { if(key) { byte temp = POLY_TO_EXP[key - 1]; S[0] ^= EXP_TO_POLY[(temp + POLY_TO_EXP[RS1-1])%255]; S[1] ^= EXP_TO_POLY[(temp + POLY_TO_EXP[RS2-1])%255]; S[2] ^= EXP_TO_POLY[(temp + POLY_TO_EXP[RS3-1])%255]; S[3] ^= EXP_TO_POLY[(temp + POLY_TO_EXP[RS4-1])%255]; } } /************************************************* * Clear memory of sensitive data * *************************************************/ void Twofish::clear() throw() { SBox0.clear(); SBox1.clear(); SBox2.clear(); SBox3.clear(); round_key.clear(); } }
44.777778
79
0.437696
vster
bd1861711f9e08e0f2fbcd54a6bb1dac3804dbc6
6,095
cpp
C++
svd/src/main.cpp
rusheniii/ppmi-svd
bb9eb27712228f7c4f5e329809643d00bf0bf906
[ "BSD-2-Clause" ]
null
null
null
svd/src/main.cpp
rusheniii/ppmi-svd
bb9eb27712228f7c4f5e329809643d00bf0bf906
[ "BSD-2-Clause" ]
null
null
null
svd/src/main.cpp
rusheniii/ppmi-svd
bb9eb27712228f7c4f5e329809643d00bf0bf906
[ "BSD-2-Clause" ]
null
null
null
#include <iostream> #include "ppmisvd.hpp" static char help[] = "Singular value decomposition of a matrix.\n"; int main(int argc, char** argv) { using std::cout; using std::string; std::vector<IJPair> pairs; PetscErrorCode ierr=0; ierr = SlepcInitialize(&argc,&argv,(char*)0,help); if (ierr){ return ierr; } ierr = PetscPrintf(PETSC_COMM_WORLD,"Compute PPMI Matrix\n");CHKERRQ(ierr); Mat A; SVD svd; /* singular value problem solver context */ SVDType type; PetscReal error,tol,sigma,mu=PETSC_SQRT_MACHINE_EPSILON; PetscInt nrows,nsv,maxit,its,nconv; PetscBool helpOption, isSymmetricOption, eigenWeight, flg; PetscScalar alpha; int MAXSTRINGLENGTH = 255; char filename[MAXSTRINGLENGTH]={'\0'}, outputUFilePath[MAXSTRINGLENGTH]={'\0'}; PetscOptionsBegin(PETSC_COMM_WORLD,"","PPMI SVD Options","none"); PetscOptionsString("-inputFilePath","Parquet file with schema: i,j,count","",filename, filename, MAXSTRINGLENGTH,&flg); PetscOptionsString("-outputFilePath","This will write the U matrix to file","",outputUFilePath, outputUFilePath, MAXSTRINGLENGTH,&flg); helpOption = PETSC_FALSE; PetscOptionsBool("-help", "Display Help Menu", "", helpOption, &helpOption, NULL); isSymmetricOption = PETSC_FALSE; PetscOptionsBool("-sym", "Has the input file stored the symmetric matrix as triangular matrix?", "", isSymmetricOption, &isSymmetricOption, NULL); eigenWeight = PETSC_FALSE; PetscOptionsBool("-eigenWeight", "multiply left singular vectors by sqrt(sigma)?", "", eigenWeight, &eigenWeight, NULL); alpha = 0.75; PetscOptionsScalar("-alpha","The exponent for smoothing PPMI", "", alpha, &alpha, NULL); nrows = 0; PetscOptionsInt("-nrows","size of input matrix","",nrows,&nrows,NULL); PetscOptionsEnd(); if (helpOption) { ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr); ierr = MatSetFromOptions(A);CHKERRQ(ierr); ierr = SVDCreate(PETSC_COMM_WORLD,&svd);CHKERRQ(ierr); ierr = SVDSetFromOptions(svd);CHKERRQ(ierr); ierr = SlepcFinalize(); return 0; } std::string inputFilePath(filename); //for (int n = 1; n < argc; n++) { //cout << "Reading File:" << inputFilePath<< " "<<helpOption << std::endl; PetscMPIInt worldSize, worldRank; ierr = MPI_Comm_size(PETSC_COMM_WORLD,&worldSize); CHKERRQ(ierr); ierr = MPI_Comm_rank(PETSC_COMM_WORLD,&worldRank); CHKERRQ(ierr); long long int * wCounts=NULL; MatrixInfo mi = readParquetFile(inputFilePath, pairs, isSymmetricOption, worldRank, worldSize, wCounts, nrows); int ndim = mi.ndim; if (ndim == -1) { return 1; } buildMatrix(pairs, &A, mi,alpha, wCounts); pairs.clear(); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create the singular value solver and set various options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* Create singular value solver context */ ierr = SVDCreate(PETSC_COMM_WORLD,&svd);CHKERRQ(ierr); /* Set operator */ ierr = SVDSetOperator(svd,A);CHKERRQ(ierr); /* Use thick-restart Lanczos as default solver */ ierr = SVDSetType(svd,SVDTRLANCZOS);CHKERRQ(ierr); /* Set solver parameters at runtime */ ierr = SVDSetFromOptions(svd);CHKERRQ(ierr); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Solve the singular value system - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ ierr = SVDSolve(svd);CHKERRQ(ierr); ierr = SVDGetIterationNumber(svd,&its);CHKERRQ(ierr); ierr = PetscPrintf(PETSC_COMM_WORLD," Number of iterations of the method: %D\n",its);CHKERRQ(ierr); /* Get some information from the solver and display it */ ierr = SVDGetType(svd,&type);CHKERRQ(ierr); ierr = PetscPrintf(PETSC_COMM_WORLD," Solution method: %s\n\n",type);CHKERRQ(ierr); ierr = SVDGetDimensions(svd,&nsv,NULL,NULL);CHKERRQ(ierr); ierr = PetscPrintf(PETSC_COMM_WORLD," Number of singular values: %D\n",nsv);CHKERRQ(ierr); ierr = SVDGetTolerances(svd,&tol,&maxit);CHKERRQ(ierr); ierr = PetscPrintf(PETSC_COMM_WORLD," Stopping condition: tol=%.4g, maxit=%D\n",(double)tol,maxit);CHKERRQ(ierr); ierr = SVDGetConverged(svd,&nconv);CHKERRQ(ierr); ierr = PetscPrintf(PETSC_COMM_WORLD," Number of converged approximate singular triplets: %D\n\n",nconv);CHKERRQ(ierr); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Display solution and clean up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ if (nconv> 0){ for (int i=0;i<nconv;i++) { PetscViewer viewer; Vec u, v; /* Get converged singular triplets: i-th singular value is stored in sigma */ ierr = MatCreateVecs(A, &v, &u); CHKERRQ(ierr); ierr = SVDGetSingularTriplet(svd,i,&sigma, u, v);CHKERRQ(ierr); PetscScalar sqrt_sigma = (PetscScalar) std::sqrt(sigma); if (eigenWeight){ VecScale(u, sqrt_sigma); } if (i==0) { PetscViewerBinaryOpen(PETSC_COMM_WORLD, outputUFilePath, FILE_MODE_WRITE, &viewer); VecView(u, viewer); PetscViewerDestroy(&viewer); } else { PetscViewerBinaryOpen(PETSC_COMM_WORLD, outputUFilePath, FILE_MODE_APPEND, &viewer); VecView(u, viewer); PetscViewerDestroy(&viewer); } MPI_Barrier(PETSC_COMM_WORLD); ierr = VecDestroy(&u); CHKERRQ(ierr); ierr = VecDestroy(&v); CHKERRQ(ierr); } ierr = PetscPrintf(PETSC_COMM_WORLD,"Wrote U Matrix\n");CHKERRQ(ierr); MPI_Barrier(PETSC_COMM_WORLD); } /* Free work space */ ierr = SVDDestroy(&svd);CHKERRQ(ierr); ierr = MatDestroy(&A);CHKERRQ(ierr); ierr = SlepcFinalize(); return 0; }
42.622378
150
0.597375
rusheniii
bd18acca2a9ae003d62a9db6c8b19d111ab9f40b
23,121
hh
C++
handc/cfg/gc/rtgc/rtgc/colorset.hh
bitwize/rscheme
1c933d3418205038df0f90e7bffdcfa2bff75951
[ "TCL" ]
21
2015-07-27T06:14:35.000Z
2022-01-27T01:50:27.000Z
stage0/cfg/gc/rtgc/rtgc/colorset.hh
ecraven/rscheme
f7de3a1e2367b1828135d3c613877865f57f04da
[ "TCL" ]
1
2019-08-21T12:47:11.000Z
2019-08-21T12:47:11.000Z
stage0/cfg/gc/rtgc/rtgc/colorset.hh
ecraven/rscheme
f7de3a1e2367b1828135d3c613877865f57f04da
[ "TCL" ]
7
2016-06-03T02:03:17.000Z
2021-05-06T15:05:39.000Z
#ifndef COLORSET_HH #define COLORSET_HH // Revised: 16 Nov 1993 Mike Hewett // // Added: color_set data members: // unsigned int number_of_objects_per_snarf // unsigned int number_of_snarfed_objects_allocated // char * local_high_water_mark // // color_set member functions: // allocate_one_object(unsigned int object_size); // // --------------------------------------------------------------- // This file contains code specific to the implementation details of the // particular collection algorithm being used. // // It implements the segragated storage scheme using Baker like // color sets to implement the implicit reclaimation part of the // collector. #include <assert.h> #ifndef NDEBUG #include <iostream.h> #endif #include <rtgc/config.hh> #include <rtgc/gcserver.h> #undef LINK_TYPE #ifdef INLINES #define LINK_TYPE inline #else #define LINK_TYPE #endif // Forward declarations class PTR_Any; class color_set; class garbage_collector; extern garbage_collector gc; // There are only two colors, shaded and non shaded. Both black and gray are // shaded. There is no way to determine whethere black or gray just looking // at the object. The difference is simply the position in the list. // Also, there is no fixed color, like shaded or non-shaded. Each time, GC // cycle finishes, the shaded color is changed. In other words, if 1 is // shaded in this cycle, it will mean non shaded in the next cycle. So, // we don't have to change the color of objects when we whiten blacks. // In generational version, the shading color may be different depending on // the generation. // In future, we want to use bool as the definition of colors, instead of int. const int INIT_SHADING_COLOR=0; // Another color is !0. typedef int colors; class object_manager; // This class implements the hidden headers that must be on every garbage // collected object. It basically implements the doubly linked list // nature of the color set, as well as the generation, step and shaded // information. class gc_object_base { // ***** Variable sections. protected: // pointers to the previous and next color set object in the // color set list gc_object_base *previous_, *next_; #ifndef SMALL_GC_HEADERS char color; // The current color of the object char generation; // What generation the object belongs to char step; // What step within a generation // The dead flag is *only* for use with debugging. It is up to the // client code to set this flag. The garbage collector does *not* set // this flag in normal usage. Usually, the client code will set this // flag in every object that it gets from the dead object iterator // (see gcserveri.ci) after the end of each collection. char dead_flag; // If this flag is set, then the garbage collector // thinks that the object is really dead. // The next field is a pointer to the color set that contains an object. // This is used so that when we find a pointer to an object we can tell // that object to gray it self. I don't like this design because it uses // an extra word in every object allocated. Try to come up with a better // design. One possible idea is to code the size class of the object. // This would only take up one byte. The size class, along with the // object's generation would tell us which color set it is in. The // down side is that the code to find the object's color set would be // somewhat less efficient than the pointer reference that is now needed. // I should make the access to this field a method so that we can change // the access and test the impact both ways. color_set *containing_list; #endif // ******* Member funcitons. // ****** Contructors and Init public: gc_object_base () { // We assume that gc_objects are at least 8 bytes long. // Since a gc_object can have 0 useable bytes (to support // languages like C++ that can have pointers to 0 byte objects) // we assert that the size of the header for a gc_object // is at least 8 bytes in size. #ifndef NDEBUG if(!(sizeof(class gc_object_base) >= 8)){ cerr << "error: assertion failed at " << __LINE__ << " of " << __FILE__ << endl; exit(3); } #endif } // ******* Basic access functions. // ******* Linking pointers // We use some of the lower bits of the previous_ and next_ pointers // to hold additional garbage collector information. // If the flag SMALL_GC_HEADERS is defined, then we use the following // bits: // previous_ bit 0: the color // previous_ bit 1: the step // previous_ bit 2: the dead flag // next_ bits 0 & 1: the generation // Note: we are assuming that all garbage collection objects are at // least 8 bytes large (the size of the header). So, we know that they // will always be aligned on 8 byte boundaries. We can thus use the lower // 3 bits of the next_ and prevous_ pointers without loosing any // information. #ifndef SMALL_GC_HEADERS LINK_TYPE gc_object_base *get_previous(void) { return(previous_); } LINK_TYPE void set_previous(gc_object_base *pointer) { previous_ = pointer; } LINK_TYPE gc_object_base *get_next(void) { return(next_); } LINK_TYPE void set_next(gc_object_base *pointer) { next_ = pointer; } #else #define COLOR_SET_POINTER_MASK 0xfffffffc LINK_TYPE gc_object_base *get_previous() { return((gc_object_base *) (((unsigned)previous_) & COLOR_SET_POINTER_MASK)); } LINK_TYPE void set_previous(gc_object_base *pointer) { assert((unsigned(pointer) & (~COLOR_SET_POINTER_MASK)) == 0); previous_ = ((gc_object_base *) ((((unsigned)previous_) & (0x3)) | ((unsigned)pointer))); } LINK_TYPE gc_object_base *get_next() { return((gc_object_base *) (((unsigned)next_) & COLOR_SET_POINTER_MASK)); } LINK_TYPE void set_next(gc_object_base *pointer) { assert((unsigned(pointer) & (~COLOR_SET_POINTER_MASK)) == 0); next_ = ((gc_object_base *) ((((unsigned)next_) & (0x3)) | ((unsigned)pointer))); } #endif // ******** Colors #ifndef SMALL_GC_HEADERS // methods to get and set the color of the object LINK_TYPE void set_color(colors c) {color = (char)c;} LINK_TYPE colors get_color(void) {return (colors)color;} #else #define COLOR_BIT_MASK (WORD_OF_ONE - 1) LINK_TYPE void set_color(colors c) { assert(int(c) >=0 && int(c) <= 1); // assumes one bit of color // The color information goes into bit 0 of previous previous_ = (gc_object_base *)((((unsigned) previous_) & COLOR_BIT_MASK) | ((unsigned)c)); } LINK_TYPE colors get_color(void) { return((colors) (((unsigned) previous_) & (0x1))); } #endif // SMALL_GC_HEADERS // ********** Dead Flag #ifndef SMALL_GC_HEADERS // The dead flag is *only* for use with debugging. It is up to the // client code to set this flag. The garbage collector does *not* set // this flag in normal usage. Usually, the client code will set this // flag in every object that it gets from the dead object iterator // (see gcserveri.ci) after the end of each collection. // methods to get and set the dead flag of the object LINK_TYPE void set_dead_flag(char df) {dead_flag = df;} LINK_TYPE char get_dead_flag(void) {return dead_flag;} #else #define DEAD_FLAG_BIT_MASK (WORD_OF_ONE - 4) LINK_TYPE void set_dead_flag(char df) { assert(int(df) == 0 || int(df) == 1); // assumes one bit for the dead // flag. // The dead flag information goes into bit 2 of previous_ previous_ = (gc_object_base *)((((unsigned) previous_) & DEAD_FLAG_BIT_MASK) | ((unsigned)df)); } LINK_TYPE char get_dead_flag(void) { return((char) (((unsigned) previous_) & (0x4))); } #endif // SMALL_GC_HEADERS // ************** Generation ***************** // methods to get and set the generation of the object. #ifndef SMALL_GC_HEADERS #ifdef GENERATIONAL LINK_TYPE void set_gen_num(int generation_number) { generation = (char)generation_number; } #else LINK_TYPE void set_gen_num(int) { // do nothing } #endif #ifdef GENERATIONAL LINK_TYPE int get_gen_num(void) { return (int)generation; } #else LINK_TYPE int get_gen_num(void) { return(0); // if we are not using generational collection, then // all objects are in the 0ith generation. } #endif #else // small gc header case #define GENERATION_NUMBER_MASK 0xfffffffc #ifdef GENERATIONAL LINK_TYPE void set_gen_num(int generation_number) { // assume two bits for the generation number (i.e. max 4 generations) // The generation info goes in bits 0 & 1 of next assert(generation_number >= 0 && generation_number <= 3); next_ = (gc_object_base *)((((unsigned) next_) & GENERATION_NUMBER_MASK) | unsigned(generation_number)); } #else LINK_TYPE void set_gen_num(int) { /* do nothing */ } #endif LINK_TYPE int get_gen_num(void) { #ifdef GENERATIONAL return((int) (((unsigned) next_) & (~GENERATION_NUMBER_MASK))); #else return(0); // if we are not using generational collection, then // all objects are in the 0ith generation. #endif } #endif // SMALL_GC_HEADERS // ******* Step ************* // methods to get and set the step of the object. #ifndef SMALL_GC_HEADERS #ifdef GENERATIONAL LINK_TYPE void set_step(int step_number) { step = (char)step_number; } #else LINK_TYPE void set_step(int) { // do nothing } #endif LINK_TYPE int get_step(void) { #ifdef GENERATIONAL return(int)step; #else return(0); // if we are not using generational collection, then // all objects are in the 0ith step. #endif // GENERATIONAL } // This functions determines the target object is well matured to be // promoted, or not. The object should be shaded and younger generation, // otherwise it may return a false result. LINK_TYPE int to_be_promoted(void){ #ifdef GENERATIONAL assert(is_shaded()); assert(get_gen_num() != NUMBER_OF_GENERATIONS - 1); return(step >= NUMBER_OF_STEPS); #else // GENERATIONAL return(0); #endif // GENERATIONAL } LINK_TYPE void increment_step(void) { #ifdef GENERATIONAL assert(get_gen_num() <= NUMBER_OF_GENERATIONS - 1); step++; #endif // GENERATIONAL } #else //SMALL_GC_HEADERS #define STEP_NUMBER_MASK 0xfffffffd #ifdef GENERATIONAL LINK_TYPE void set_step(int step_number) { // assume one bits for the step number (i.e. max 2 steps) // The step info goes into bit 1 of previous. assert(step_number >= 0 && step_number <= 1); previous_ = (gc_object_base *)((((unsigned) previous_) & STEP_NUMBER_MASK) | (unsigned(step_number) << 1)); } #else LINK_TYPE void set_step(int) { // do nothing } #endif LINK_TYPE int get_step(void) { #ifdef GENERATIONAL // assert(is_shaded()); // assert(get_gen_num() != NUMBER_OF_GENERATIONS - 1); return((int) ((((unsigned) previous_) & (~STEP_NUMBER_MASK)) >> 1)); #else return(0); // if we are not using generational collection, then // all objects are in the 0ith step. #endif } LINK_TYPE int to_be_promoted(void){ #ifdef GENERATIONAL return (get_step() == 0); #else // GENERATIONAL return(0); #endif // GENERATIONAL } LINK_TYPE void increment_step(void){ #ifdef GENERATIONAL previous_ = (gc_object_base*)((unsigned)previous_ ^ ~STEP_NUMBER_MASK); #endif } #endif // SMALL_GC_HEADERS // Check whether it is shaded or not. It gets its belonging generation // and takes some time, so if you know the containing generation, you // should not use this member function. LINK_TYPE int is_shaded(); // ****** Containing list access ********* #ifndef SMALL_GC_HEADERS void set_containing_list(color_set *cs) { containing_list = cs; } #else void set_containing_list(color_set *) { // In the small gc header, there is no containing_list pointer. } #endif LINK_TYPE color_set *get_containing_list(void); // Call this version if you already have a pointer to the object // manager for the object. LINK_TYPE color_set *get_containing_list(object_manager *om); }; class color_set { // *********** Variables ************** protected: // This size is set to the maximum object size including the header. int size; // size_class is the size class number in which this object belongs. // currently, this is the log2 of the total object size (including the // header), but this is likely to change. int size_class; // This shows the generation to which this color set belongs to. int my_generation; object_manager *my_object_manager; // When allocating new objects black, the list is laid out in the // following form: // // [] GRAY BLACK FREE [] WHITE [] // ^ ^ ^ ^ ^ // G S F W T // // Where G is the gray (head) pointer // S is the scan pointer // F is the free pointer // W is the white pointer // T is the tail pointer // [] is a special object that takes no space and is only // included to make some of the routines slightly faster. // // With the sets of objects determined by the following pointer pairs: // // GRAY: gray(exclusive) to scan(exclusive) // BLACK: scan(inclusive) to free(exclusive) // FREE: free(inclusive) to white(exclusive) // WHITE: white(exclusive) to tail(exclusive) // // Note that this design keeps any pointers from every pointing at any // objects in the gray or white sets. With this, code in the write // barrier that grays objects can do so unconditionally. // // When allocating new objects white, the list is laid out in the // following form: // // [] GRAY BLACK [] WHITE FREE [] // ^ ^ ^ ^ ^ ^ // G S W OF F T // // Where the pointers are the same as above with OF being the old free pointer. // // With the sets of objects determined by the following pointer pairs: // // GRAY: gray(inclusive) to scan(exclusive) // BLACK: scan(inclusive) to white(exclusive) // FREE: free(inclusive) to tail(exclusive) // WHITE: white(exclusive) to free(exclusive) // Was black, Now garbage: white(exclusive) to old_free(exclusive) // Never been shaded: old_free(inclusive) to free(exclusive) // // Note, the algorithms in the garbage collector all assume that there // is always one free object on the free list, and when the free list is // down to one object, this is detected as no free objects. (this makes // the allocation routines much more efficient. This free object contains // no actual space (it is a member of the color_set class), so the list // incures no overhead for this optimization. // // Note, the algorithms in the garbage collector all assume that no pointers // point at any of the white or gray objects. This makes the write barrier // for the hard real-time code much more efficient; They can simply move an // object from the white set to the gray set without having to worry about // there being any pointers pointing to that object. #ifdef DEBUG_LEVEL2 public: #endif gc_object_base *gray; gc_object_base *scan; gc_object_base *white; gc_object_base *free; gc_object_base *tail; // old_free is used only when allocating WHITE to // segragate never been shaded from was black now is garbage. gc_object_base *old_free; // This is the tail object. Its purpose is to allow for some optimizations // in the color set routines. These optimizations always assume that // there will be at least one object in every size class, and that that // object will never be allocated. So, we do not need any actual memory // behind that object. We just allocate the header for the object // here in the size class. gc_object_base tail_object; // This is the head object. Its purpose is to allow for some optimizations // in the write barrier routines for the hard real-time collector. // The basic idea is to design the white set so that no pointers point // to any objects in that set. By doing this, an object can be moved // unconditionally to the black set (without worrying about moving the // set boundry pointers with that object). We need the head object so // that in degenerate cases (where some sets are empty), the pointers // that seperate the sets have something to point to. gc_object_base head_object; // This is an object who`s purpose is to seperate the white set from the // free set by at least one object. By doing this, we can always // unconditionally remove objects from the white set without having // to worry about there being set pointers pointing to any of them. gc_object_base separator_object; char * local_high_water_mark; // for incremental page chopping. // This variable is used to put a bounds on the current page // that is being carved up incrementally to add more objects // to the garbage collector`s heap. char *max_incremental_memory_extent; // For debugging only! int max_live; public: int number_of_free; // Ideally, gc must be done by the time this is 0. int number_of_objects; // The number of objects of this size // class // Number_of_non_black is the sum of the numbers of white, free and gray // objects in the color set. After a gc_flip, this value is equal to // the number of free objects, because all white object become free, and // there must not be any gray objects at the end of gc cycle. int number_of_non_black; protected: int number_of_objects_per_snarf; // amount of space allocated at once. int number_of_snarfed_objects_allocated; // The object iterators return each live and dead object respectively. // The live object iterator iterates through the black and gray objects, // and the dead object iterator iterats through the white objects. // The next two variables are pointers into these two lists. gc_object_base *not_known_free_object_iterator; gc_object_base *dead_object_iterator; // ************* Member functions ****************** public: // ***** Contructors and Init // This routine sets up the size class doubly linked list and the private // data members. void init(int gen_num, int size_class); // This is the constructor for color sets. It sets up the color set // pointers. color_set(int gen_num, int size_class); // **** color sets gc_object_base *get_free(void){return(free);} gc_object_base *get_white(void){return(white);} gc_object_base *get_gray(void){return(gray);} gc_object_base *get_black(void){return(scan);} gc_object_base *get_tail(void){return(&tail_object);} LINK_TYPE void insert_as_black(gc_object_base *object); LINK_TYPE void insert_as_white(gc_object_base *object); // This function inserts a list of objects into the free set. // It assumes that this set is empty void insert_objects_into_free_set(gc_object_base *free_head, gc_object_base *free_tail, int number_of_inserted); // **** Static information int get_num_of_objects(void){return(number_of_objects);} int get_num_of_non_black(void){return(number_of_non_black);} int get_num_of_free(void){return(number_of_free);} // **** Allocation // This routine returns one object of the size represented by this // size class. gc_object_base* allocate(void); //This routine prepares more objects for allocation when no free is left. void reclaim_or_allocate_objects_when_no_free(void); // Move free objects from the older generations to the younger generations. // This function assumes that there are no free objects in the youngest // generaiton. // If any objects are moved, this function returns 1, otherwise it returns // 0 int move_old_free_to_young_free(void); // allocates one object from snarfed memory. void allocate_one_object(UINT_32 object_size); // snarfs more memory for this size class from the OS. void snarf_more_memory(void); // ***** Tracing // This routine returns the amount of work that should be charged // against an allocation of this object. int get_work(void) {return size;} int get_size(void) {return size;} int get_gen_of_this_set(void) {return my_generation;} // returns true if there are any gray objects in this size class, // false otherwise. LINK_TYPE int any_grays(void); // This routine blackens (blackens the object and grays its children) the // next object in the gray set (the object at the scan pointer). // blacken's one gray, returns 0 when no grays are left LINK_TYPE int blacken_next_gray(UINT_32& work_done, UINT_32 work_left_to_do); // This routine blackens (blackens the object and grays its children) the // next object in the gray set (the object at the scan pointer). // If necessary, it promotes the object and do the necessary jobs. // If there is no gray, returns 0. LINK_TYPE int blacken_or_promote_next_gray(UINT_32& work_done, UINT_32 work_left_to_do); // This routine is a wrapper function that finds the object manager // for the object pointed to by the the argument and has that // object manager gray that object. LINK_TYPE static void gray_a_white(pos_ptr_addr ptr_addr, gc_obj_addr ptr_val); // This routine expects to be passed a pointer to an object which it will // gray. LINK_TYPE void gray_this_object(gc_object_base *object); // ***** Reclamation // this routine implicitly collects the garbage after all live data has // been marked void reclaim_garbage(); // ***** Interators // These functions implement the object iterators. They return NULL // when they are called after the last object is the appropriate set // has been returned. It is assumed that no garbage collector // activity occurs between the call to the reset functions and the // calls to the next...object functions. LINK_TYPE void reset_not_known_free_object_iterator(void); LINK_TYPE gc_obj_addr next_not_known_free_object(void); LINK_TYPE void reset_dead_object_iterator(void); LINK_TYPE gc_obj_addr next_dead_object(void); #ifdef DEBUG_LEVEL2 // sanity_check() is a debugging routine, and serves no purpose in the // finished garbage collector. void sanity_check(); // in_which_color_list scans this color_set and returns which part of // list the obj belongs to. int in_which_color_list(gc_object_base *obj); #endif //DEBUG_LEVEL2 #ifdef TEST_FRAGMENTATION public: int num_pages; int num_pages_with_n_objects[PAGE_SIZE]; #endif }; // end of class color_set #endif
32.518987
91
0.688854
bitwize
bd18eded4e952a05b4b4237e69d3ca35651c3592
526
hpp
C++
Azathothpp/include/system/AzVfs.hpp
Genkinger/azathoth
9d96d4668dbcaa958bd4a4f21094f7da9a87a07d
[ "BSD-2-Clause" ]
null
null
null
Azathothpp/include/system/AzVfs.hpp
Genkinger/azathoth
9d96d4668dbcaa958bd4a4f21094f7da9a87a07d
[ "BSD-2-Clause" ]
null
null
null
Azathothpp/include/system/AzVfs.hpp
Genkinger/azathoth
9d96d4668dbcaa958bd4a4f21094f7da9a87a07d
[ "BSD-2-Clause" ]
null
null
null
#pragma once #include <map> #include <vector> #include <string> #include <algorithm> #include "AzFilesystem.hpp" namespace Az{ class Vfs{ std::map<std::string, std::vector<std::string> > mMountPoints; public: void Mount(const std::string& fslocation, const std::string& mountpoint); void Unmount(const std::string& mountpoint); std::vector<std::string> ResolvePath(const std::string& path); std::vector<std::string> Find(const std::string& file); }; }
27.684211
85
0.63308
Genkinger
bd1a53c30989c1954cf158cc1a21e7a56486b7b2
1,067
hpp
C++
dune/xt/data/quadratures/fekete/triangle_fekete_rule.hpp
dune-community/dune-xt-data
32593bbcd52ed69b0a11963400a9173740089a75
[ "BSD-2-Clause" ]
1
2020-02-08T04:09:11.000Z
2020-02-08T04:09:11.000Z
dune/xt/data/quadratures/fekete/triangle_fekete_rule.hpp
dune-community/dune-xt-data
32593bbcd52ed69b0a11963400a9173740089a75
[ "BSD-2-Clause" ]
40
2018-08-26T08:34:34.000Z
2021-09-28T13:01:55.000Z
dune/xt/data/quadratures/fekete/triangle_fekete_rule.hpp
dune-community/dune-xt-data
32593bbcd52ed69b0a11963400a9173740089a75
[ "BSD-2-Clause" ]
1
2020-02-08T04:10:14.000Z
2020-02-08T04:10:14.000Z
// This file is taken from // http://people.sc.fsu.edu/~jburkardt%20/cpp_src/triangle_fekete_rule/triangle_fekete_rule.html // License: LGPL int fekete_degree(int rule); int fekete_order_num(int rule); void fekete_rule(int rule, int order_num, double xy[], double w[]); int fekete_rule_num(); int* fekete_suborder(int rule, int suborder_num); int fekete_suborder_num(int rule); void fekete_subrule(int rule, int suborder_num, double suborder_xyz[], double suborder_w[]); void fekete_subrule_1(int suborder_num, double suborder_xyz[], double suborder_w[]); void fekete_subrule_2(int suborder_num, double suborder_xyz[], double suborder_w[]); void fekete_subrule_3(int suborder_num, double suborder_xyz[], double suborder_w[]); void fekete_subrule_4(int suborder_num, double suborder_xyz[], double suborder_w[]); void fekete_subrule_5(int suborder_num, double suborder_xyz[], double suborder_w[]); void fekete_subrule_6(int suborder_num, double suborder_xyz[], double suborder_w[]); void fekete_subrule_7(int suborder_num, double suborder_xyz[], double suborder_w[]);
56.157895
96
0.7985
dune-community
bd20e520291378569d3e2d402de30c33d5ea967c
5,380
cpp
C++
Ver/ServerExample/server/source/server.cpp
vsevolod-oparin/RestaurantBES
9ffc8983a09d523295528db3513402cf86d6d10c
[ "MIT" ]
null
null
null
Ver/ServerExample/server/source/server.cpp
vsevolod-oparin/RestaurantBES
9ffc8983a09d523295528db3513402cf86d6d10c
[ "MIT" ]
null
null
null
Ver/ServerExample/server/source/server.cpp
vsevolod-oparin/RestaurantBES
9ffc8983a09d523295528db3513402cf86d6d10c
[ "MIT" ]
null
null
null
#include "server.h" #include "user.h" #include <utility> namespace restbes::server_structure { Server::Server() : service(new restbed::Service()) {} Server::UserCollection Server::getUsers() const { return *(users.rlock()); } std::shared_ptr<User> Server::getUser(const std::string &name) const { if (users.rlock()->count(name) == 0) return nullptr; else return users.rlock()->at(name); } void Server::addUser(const std::string &name) { if (users.rlock()->count(name) == 0) { users.wlock()->insert({name, std::make_shared<User>(name)}); } } void Server::addResource(std::shared_ptr<restbed::Resource> resource) { service->publish(resource); } void Server::setSettings(std::shared_ptr<restbed::Settings> newSettings) { settings = std::move(newSettings); } void Server::schedule(const ScheduledTask &task, std::shared_ptr<Server> server, const std::chrono::duration<int64_t, std::ratio<1, 1000>> &interval) { service->schedule(generateScheduledTask(task, std::move(server)), interval); } void Server::startServer() { service->start(settings); } std::shared_ptr<restbed::Response> generateResponse(const std::string &body, const std::string &content_type, Connection connection) { auto response = std::make_shared<restbed::Response>(); response->set_body(body); response->set_header("Content-Length", std::to_string(body.size())); response->set_header("Content-Type", content_type); switch (connection) { case Connection::KEEP_ALIVE: response->set_header("Connection", "keep-alive"); break; case Connection::CLOSE: response->set_header("Connection", "close"); break; } response->set_status_code(ResponseCode::OK); // TODO: make OK const response->set_status_message("OK"); return response; } restbed_HTTP_Handler Server::generatePostMethodHandler(const POST_Handler &callback, std::shared_ptr<Server> server) { return [callback, server](std::shared_ptr<Session> session) { int content_length = session->get_request()->get_header( "Content-Length", 0); session->fetch( content_length, [callback, server]( const std::shared_ptr<Session> session, const restbed::Bytes &body) { std::string data = std::string(body.begin(), body.end()); callback(session, data, server); }); }; } restbed_HTTP_Handler Server::generateGetMethodHandler(const GET_Handler &callback, std::shared_ptr<Server> server) { return [callback, server](std::shared_ptr<Session> session) { callback(std::move(session), server); }; } std::function<void(void)> Server::generateScheduledTask(const ScheduledTask &task, std::shared_ptr<Server> server) { return [task, server]() { task(server); }; } restbed_ErrorHandler Server::generateErrorHandler(const ErrorHandler &callback, std::shared_ptr<Server> server) { return [callback, server](const int code, const std::exception &exception, std::shared_ptr<Session> session) { callback(code, exception, std::move(session), server); }; } std::shared_ptr<restbed::Resource> createResource(const std::string &path, const Server::GET_Handler &getMethodHandler, const Server::POST_Handler &postMethodHandler, const Server::ErrorHandler &errorHandler, std::shared_ptr<Server> server) { auto resource = std::make_shared<restbed::Resource>(); resource->set_path(path); resource->set_method_handler("GET", Server::generateGetMethodHandler( getMethodHandler, server)); resource->set_method_handler("POST", Server::generatePostMethodHandler( postMethodHandler, server)); resource->set_error_handler( Server::generateErrorHandler(errorHandler, server)); return resource; } std::shared_ptr<restbed::Settings> createSettingsWithSSL( const std::string &SSL_ServerKey, const std::string &SSL_Certificate, const std::string &SSL_DHKey, const int port, const int workers) { auto ssl_settings = std::make_shared<restbed::SSLSettings>(); ssl_settings->set_http_disabled(true); ssl_settings->set_private_key( restbed::Uri("file://" + SSL_ServerKey)); ssl_settings->set_certificate( restbed::Uri("file://" + SSL_Certificate)); ssl_settings->set_temporary_diffie_hellman( restbed::Uri("file://" + SSL_DHKey)); ssl_settings->set_port(port); auto settings = std::make_shared<restbed::Settings>(); settings->set_ssl_settings(ssl_settings); settings->set_worker_limit(workers); return settings; } } //server_structure
36.849315
99
0.596283
vsevolod-oparin
bd21d818dc1d6b4440daa10aeace4d3dd82a2fd8
2,088
cpp
C++
FruitNinjaGL/FruitNinjaGL.cpp
CncGpp/FruitNinjaGL
90435c9e19733aece4a334c2d889ae5975f7706e
[ "Apache-2.0" ]
null
null
null
FruitNinjaGL/FruitNinjaGL.cpp
CncGpp/FruitNinjaGL
90435c9e19733aece4a334c2d889ae5975f7706e
[ "Apache-2.0" ]
null
null
null
FruitNinjaGL/FruitNinjaGL.cpp
CncGpp/FruitNinjaGL
90435c9e19733aece4a334c2d889ae5975f7706e
[ "Apache-2.0" ]
null
null
null
// FruitNinjaGL.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include "src/fn/ecs/ecs.hpp" struct Position : public fn::Component<Position>{ Position() = default; Position(int x, int y) : x(x), y(y) {} int x, y; void print() { std::cout << "X: " << x << "jfoisdjfoj " << y << "\n"; } }; struct Rotation { float theta; }; int main() { fn::Database db; fn::Entity e = db.create_entity(); fn::Entity e2 = db.create_entity(); fn::Entity e3 = db.create_entity(); std::cout << "Has: " << e.has<Position>() << "\n"; e.set<Rotation>({.theta=0.23478023f}); e.set<Position>({1, 3}); e2.set<Position>({ 21, 4 }); e3.set<Position>({ 231, 44 }); std::cout << "Has: " << e.has<Position>() << "\n"; e.remove<Position>(); std::cout << "Has: " << e.has<Position>() << "\n"; auto* p = e.get<Rotation>(); std::cout << "struct Rotation: " << p->theta << "\n"; std::cout << "Signature: " << e.signature() << "\n"; auto rs = db.having(Position::cid); std::cout << "Result set size: " << rs.size() << "\n"; rs = db.having<Position>(); std::cout << "Result set size: " << rs.size() << "\n"; db.for_each(fn::Sign<Position>, [](fn::Eid e) {std::cout << "Eid:" << e << "\n"; }); db.for_each(fn::Sign<Rotation>, [](fn::Entity& e) {std::cout << "Rotation:" << e.get<Rotation>()->theta << "\n"; }); std::cout << "\nSignature: " << fn::Sign<Position, Rotation> << "\n"; e2.set<Rotation>({ .theta = 420.69f }); std::cout << "Tupla" << std::get<1>(e2.get<Position, Rotation>())->theta << "\n"; auto [dio, cane] = e2.get<Position, Rotation>(); dio->print(); std::cout << "Has: " << e.has<Position, Rotation>() << "\n"; std::cout << "Has: " << e2.has<Position, Rotation>() << "\n"; db.for_each<Position>([](Position& p) {std::cout << "Posizione.y: " << p.y << "\n"; }); db.for_each<Position, Rotation>([](Position& p, Rotation& r) {std::cout << "Posizione.y: " << p.y << "\n"; }); }
30.705882
120
0.527778
CncGpp
bd228d806fd734560832970d7336ebd18fbaa7de
2,573
cpp
C++
UniEngine/src/PrivateComponentStorage.cpp
edisonlee0212/UniEngine-deprecated
4b899980c280ac501c3b5fa2746cf1e71cfedd28
[ "MIT" ]
null
null
null
UniEngine/src/PrivateComponentStorage.cpp
edisonlee0212/UniEngine-deprecated
4b899980c280ac501c3b5fa2746cf1e71cfedd28
[ "MIT" ]
null
null
null
UniEngine/src/PrivateComponentStorage.cpp
edisonlee0212/UniEngine-deprecated
4b899980c280ac501c3b5fa2746cf1e71cfedd28
[ "MIT" ]
1
2021-09-06T08:07:37.000Z
2021-09-06T08:07:37.000Z
#include "pch.h" #include "EntityManager.h" #include "PrivateComponentStorage.h" void UniEngine::PrivateComponentStorage::RemovePrivateComponent(Entity entity, size_t typeID) { const auto search = m_pOwnersCollectionsMap.find(typeID); if (search != m_pOwnersCollectionsMap.end()) { auto& collection = m_pOwnersCollectionsList[search->second].second; const auto entitySearch = collection->m_ownersMap.find(entity); if (entitySearch != collection->m_ownersMap.end()) { if (entity != entitySearch->first) { Debug::Error("RemovePrivateComponent: Entity mismatch!"); return; } if(collection->m_ownersList.size() == 1) { const auto eraseHash = typeID; const auto eraseIndex = search->second; const auto backHash = m_pOwnersCollectionsList.back().first; m_pOwnersCollectionsMap[backHash] = eraseIndex; std::swap(m_pOwnersCollectionsList[eraseIndex], m_pOwnersCollectionsList.back()); m_pOwnersCollectionsMap.erase(eraseHash); m_pOwnersCollectionsList.pop_back(); }else { const auto eraseIndex = entitySearch->second; const auto backEntity = collection->m_ownersList.back(); collection->m_ownersMap[backEntity] = eraseIndex; collection->m_ownersMap.erase(entity); collection->m_ownersList[eraseIndex] = backEntity; collection->m_ownersList.pop_back(); } } } } void UniEngine::PrivateComponentStorage::DeleteEntity(Entity entity) { for (auto& element : EntityManager::GetInstance().m_entityInfos->at(entity.m_index).m_privateComponentElements) { RemovePrivateComponent(entity, element.m_typeId); } } void UniEngine::PrivateComponentStorage::SetPrivateComponent(Entity entity, size_t id) { const auto search = m_pOwnersCollectionsMap.find(id); if (search != m_pOwnersCollectionsMap.end()) { const auto insearch = m_pOwnersCollectionsList[search->second].second->m_ownersMap.find(entity); if (insearch == m_pOwnersCollectionsList[search->second].second->m_ownersMap.end()) { m_pOwnersCollectionsList[search->second].second->m_ownersMap.insert({ entity, m_pOwnersCollectionsList[search->second].second->m_ownersList.size() }); m_pOwnersCollectionsList[search->second].second->m_ownersList.push_back(entity); } } else { std::unique_ptr<POwnersCollection> collection = std::make_unique<POwnersCollection>(); collection->m_ownersMap.insert({ entity, 0 }); collection->m_ownersList.push_back(entity); m_pOwnersCollectionsMap.insert({ id, m_pOwnersCollectionsList.size() }); m_pOwnersCollectionsList.push_back(std::make_pair(id, std::move(collection))); } }
37.838235
153
0.757482
edisonlee0212
bd24a6bf123c538c13cb943fdfd8124ea7425135
792
cpp
C++
example/has_member_type/has_member_type/main.cpp
leico/cpp_utility
28c2900836c66b05d90e3eeb7a2ffaed2b630b89
[ "MIT" ]
null
null
null
example/has_member_type/has_member_type/main.cpp
leico/cpp_utility
28c2900836c66b05d90e3eeb7a2ffaed2b630b89
[ "MIT" ]
null
null
null
example/has_member_type/has_member_type/main.cpp
leico/cpp_utility
28c2900836c66b05d90e3eeb7a2ffaed2b630b89
[ "MIT" ]
null
null
null
// // main.cpp // has_member_type // // Created by leico_studio on 2019/08/15. // Copyright © 2019 leico_studio. All rights reserved. // #include <iostream> #include <vector> #include <list> #include "has_member_type.h" struct dummy{}; void print( const bool value ){ std :: cout << std :: boolalpha << value << std :: endl; } int main(int argc, const char * argv[]) { namespace has_member_type = leico_cpp_utility :: has_member_type; print( has_member_type :: value_type< dummy > :: value ); //false print( has_member_type :: value_type< std :: vector< int > > :: value ); //true print( has_member_type :: iterator< dummy > :: value ); //false print( has_member_type :: iterator< std :: list< char > > :: value ); //true return 0; }
24
82
0.630051
leico
bd2b406506bf4d1a34d1b8d31dc723f74d4d9f22
2,850
cpp
C++
redBox/Classes/RedNode.cpp
RyukieSama/RYC2X
3142d0b1081c681c40cab32c5cfbfbbcb40a6c26
[ "MIT" ]
null
null
null
redBox/Classes/RedNode.cpp
RyukieSama/RYC2X
3142d0b1081c681c40cab32c5cfbfbbcb40a6c26
[ "MIT" ]
null
null
null
redBox/Classes/RedNode.cpp
RyukieSama/RYC2X
3142d0b1081c681c40cab32c5cfbfbbcb40a6c26
[ "MIT" ]
null
null
null
// // RedNode.cpp // redBox-mobile // // Created by 王荣庆 on 2017/7/23. // #include "RedNode.hpp" std::vector<std::string> contextRed = {"百万大奖", "五毛", "再来一次"}; bool RedNode::init() { if (!Node::init()) { return false; } backImage = Sprite::create("res/default.png"); backImage->setAnchorPoint(Point::ZERO);//方便触摸点的坐标计算 this->addChild(backImage); //设置红包contentSize和精灵一样大 setContentSize(backImage->getContentSize()); return true; } RedNode::RedNode() { //对成员变量进行初始赋值 backImage = 0; animate = 0; title = 0; } RedNode::~RedNode() { backImage = 0; animate = 0; title = 0; } void RedNode::loadAnimation() { //加载动画资源 一般在加载页面做这个事 SpriteFrameCache * spriteFrameCache = SpriteFrameCache::getInstance(); int index = 1; SpriteFrame * frame = NULL; //容器 是COCOCS封装的 Vector<SpriteFrame *> frameArray; do { frame = spriteFrameCache->getSpriteFrameByName(__String::createWithFormat("%d.png",index)->getCString()); if (frame == 0) { break; } else { frameArray.pushBack(frame); index++; } } while (true); Animation * animation = Animation::createWithSpriteFrames(frameArray); animation->setLoops(1);//循环次数 animation->setRestoreOriginalFrame(false);//是否在播放完成后恢复最初的样子 animation->setDelayPerUnit(0.1);//帧间隔 //通过animation创建animate animate = Animate::create(animation); //应为不需要立刻执行动画又不能被释放掉 这里需要retain一下 防止被释放掉 //其他成员变量使用了 addChild 方法的对象都会被自动 retain的所以不需要自己写 animate->retain(); } void RedNode::playAnimation() { if (backImage == 0 || animate == 0) { return; } backImage->setAnchorPoint(Vec2(0.5, 0.5));//恢复锚点位置 为了动画 CallFunc * callFunc = CallFunc::create(CC_CALLBACK_0(RedNode::aniCallBack, this)); Sequence * seq = Sequence::create(animate, callFunc, NULL); backImage->runAction(seq); } void RedNode::aniCallBack() { //从容器中随机获取字符创 std::string str = contextRed[std::rand()%contextRed.size()];//设置随机范围 printf("%s",str.c_str()); addTitle(str.c_str()); } void RedNode::setDefaultState() { if (backImage != 0) { backImage->removeFromParent(); backImage = Sprite::create("res/default.png"); backImage->setPosition(Point::ZERO); this->addChild(backImage); //或者直接更换纹理 if (title != 0) { title->setVisible(false); } } } void RedNode::addTitle(const char * text) { if (title != 0) {//非第一次点红包 title->setString(text); title->setVisible(true); return; } title = Label::createWithSystemFont(text, "", 40); title->setPosition(Point::ZERO); title->setColor(Color3B::RED); this->addChild(title,1); return; }
23.360656
113
0.600351
RyukieSama
bd2f1af5ac344d84bbe2dd56ba236aa05c8a254f
673
cpp
C++
CienciaDaComputacao/Capitulo01/Exercicios/Ex01.cpp
pedro-filho-81/C_Mais_Mais
d55105f62c626de3245697095532281c8254a9bd
[ "MIT" ]
null
null
null
CienciaDaComputacao/Capitulo01/Exercicios/Ex01.cpp
pedro-filho-81/C_Mais_Mais
d55105f62c626de3245697095532281c8254a9bd
[ "MIT" ]
null
null
null
CienciaDaComputacao/Capitulo01/Exercicios/Ex01.cpp
pedro-filho-81/C_Mais_Mais
d55105f62c626de3245697095532281c8254a9bd
[ "MIT" ]
null
null
null
/* Exercícios 1.2.1 Suponha que aeb são variáveis ​​inteiras. O que a seguinte sequência de afirmações faz? int t = a; b = t; a = b; Autor: Pedro,10/11/2021 */ #include <iostream> #include <locale> using namespace std; // função principal int main() { // localização geográfica setlocale( LC_ALL, "portuguese"); // limpa a tela system("cls"); int a = 1, b = 2; int t = a; b = t; a = b; cout << "a = " << a << "b = " << b << "t = " << t << endl; double x = 1; double y = 3; cout << x / y << endl; system("pause"); // pausa do programa return 0; // programa terminado com sucesso } // fim main
18.189189
62
0.542348
pedro-filho-81
bd2ff77dd5c1152d76a65cad0cc11cfd7ca60108
5,259
cpp
C++
book.cpp
farinc/book-tracker
a96b81dffba44af081907425b1b755d2bfc1fd66
[ "MIT" ]
null
null
null
book.cpp
farinc/book-tracker
a96b81dffba44af081907425b1b755d2bfc1fd66
[ "MIT" ]
null
null
null
book.cpp
farinc/book-tracker
a96b81dffba44af081907425b1b755d2bfc1fd66
[ "MIT" ]
null
null
null
#include "book.h" #include <cmath> #include <nlohmann/json.hpp> #include <QDebug> using json = nlohmann::json; namespace bookdata { CostConstants constants = CostConstants(); Book::Book(int bookID) { this->bookID = bookID; this->coverDim = {0, 0}; this->pageDim = {0,0}; this->status = Status::nostatus; this->bookType = BookType::notype; this->lastEdit = this->creation = time(0); this->signitures = 0; this->pagesPerSigniture = 0; this->weight = 0; this->spine = 0; this->costExtra = 0; this->box = std::string(); this->section = std::string(); this->threadColor = std::string(); this->endpageColor = std::string(); this->pageMaterial = std::string(); this->coverMaterial = std::string(); this->extra = std::string(); } void Book::updateTimestamp(Book &book) { book.lastEdit = time(0); } bool Book::isCalculatable(const Book &book) { bool flag = true; flag &= book.coverDim.height > 0; flag &= book.coverDim.width > 0; flag &= book.pageDim.height > 0; flag &= book.pageDim.width > 0; flag &= book.spine > 0; flag &= calculatePageCount(book) > 0; flag &= book.bookType > 0; flag &= book.status > 0; return flag; } bool Book::canHaveDiscription(const Book &book) { bool flag = true; flag &= !book.coverMaterial.empty(); flag &= !book.threadColor.empty(); flag &= !book.pageMaterial.empty(); flag &= !book.endpageColor.empty(); flag &= isCalculatable(book); return flag; } int Book::calculatePageCount(const Book &book) { return book.signitures * book.pagesPerSigniture; } bool Book::isValid(const Book &book) { return book.bookID >= 0; } std::string Book::getSpineType(const Book &book) { std::string spineType; auto bookType = book.bookType; if(bookType == BookType::quater || bookType == BookType::longstich) { spineType = "Spine"; } else if(bookType == BookType::coptic || bookType == BookType::coptic2) { spineType = "Thread"; } else if(bookType == BookType::stabstich) { spineType = "Ribbon"; } else { spineType = ""; } return spineType; } double Book::getExtraCosts(const Book &book) { return constants.pvaCost + constants.endpageCost; } double Book::getBoardCost(const Book &book) { double paddedWidth = book.coverDim.width + constants.paddingWidthBoard; double paddedHeight = book.coverDim.height + constants.paddingHeightBoard; double sqInchBoard = paddedHeight * paddedWidth; return sqInchBoard * constants.sqInchBoardPrice; } double Book::getPageCost(const Book &book) { int sheets = std::ceil(calculatePageCount(book) / 2); bool isHalfSheet = book.pageDim.width <= 4.25 || book.pageDim.height <= 5; double pricePages = sheets * constants.sheetPrice; if(isHalfSheet) { return pricePages / 2; } return pricePages; } double Book::getThreadRibbonCost(const Book &book) { if(book.bookType != BookType::stabstich){ double threadLength = (book.signitures * book.coverDim.height) + book.coverDim.height; double priceThread = threadLength * constants.threadLengthPrice; if(book.bookType == BookType::coptic2){ priceThread *= 2; } return priceThread; }else{ return book.coverDim.height * constants.ribbonPrice; } } double Book::getHeadbandCost(const Book &book) { if(book.bookType == BookType::traditional || book.bookType == BookType::quater){ return book.spine * 2 * constants.headbandPrice; } return 0; } double Book::getSuperCost(const Book &book) { if(book.bookType == BookType::traditional || book.bookType == BookType::quater){ double paddedSpine = book.spine + constants.paddingSpineForSuper; double sqInchSuper = paddedSpine * book.coverDim.height; return sqInchSuper * constants.superPrice; } return 0; } double Book::getClothCost(const Book &book) { double paddedHeight = book.coverDim.height + constants.paddingHeightBoard; if(book.bookType == BookType::coptic || book.bookType == BookType::coptic2 || book.bookType == BookType::stabstich) { double paddedWidth = book.coverDim.width + constants.paddingWidthBoard; double sqInchCloth = paddedHeight * paddedWidth * 2; return sqInchCloth * constants.sqInchClothPrice; }else{ double paddedSpine = book.spine; if(book.bookType == BookType::quater){ paddedSpine += constants.paddingSpineQuarter; }else if(book.bookType == BookType::longstich || book.bookType == BookType::traditional){ paddedSpine += constants.paddingSpineLongTrad; } double paddedWidth = book.coverDim.width + constants.paddingWidthBoard + paddedSpine; double sqInchCloth = paddedWidth * paddedHeight; return sqInchCloth * constants.sqInchClothPrice; } return 0; } double Book::getTotal(const Book &book) { return getExtraCosts(book) + getBoardCost(book) + getPageCost(book) + getThreadRibbonCost(book) + getHeadbandCost(book) + getSuperCost(book) + getClothCost(book) + book.costExtra; } };
27.390625
184
0.651264
farinc
bd31337c283b5ca8434bf1bad1462b79f485aaf8
902
cpp
C++
LeetcodeProblems/415E_Add_Strings.cpp
dimabreeze/Interview
72959c660c242dd22f456b24d8426c448bd1d5e9
[ "MIT" ]
null
null
null
LeetcodeProblems/415E_Add_Strings.cpp
dimabreeze/Interview
72959c660c242dd22f456b24d8426c448bd1d5e9
[ "MIT" ]
null
null
null
LeetcodeProblems/415E_Add_Strings.cpp
dimabreeze/Interview
72959c660c242dd22f456b24d8426c448bd1d5e9
[ "MIT" ]
null
null
null
#include "pch.h" #include "415E_Add_Strings.h" using namespace Leetcode::LC451E; using namespace std; string Solution::addStrings( string s1, string s2 ) { const auto& minS = s1.size() < s2.size() ? s1 : s2; auto& maxS = s1.size() < s2.size() ? s2 : s1; int carry = 0; auto iMin = minS.rbegin(); auto iMax = maxS.rbegin(); for (auto end = minS.rend(); iMin != end; ++iMin, ++iMax) { *iMax += carry + *iMin - '0'; carry = 0; if (*iMax > '9') { *iMax -= 10; ++carry; } } for (auto end = maxS.rend(); iMax != end; ++iMax) { *iMax += carry; carry = 0; if (*iMax > '9') { *iMax -= 10; ++carry; } } /* if (carry) return string( 1, '0' + carry ) + maxS; else return maxS; */ if (!carry) return std::move( maxS ); string ans( maxS.size() + 1, '0' + carry ); for (size_t i = 1; i < ans.size(); ++i) { ans[i] = maxS[i - 1]; } return std::move( ans ); }
19.191489
58
0.542129
dimabreeze
bd313bd8128bb8c8526f2139b05e58d3921f0c8a
1,079
cpp
C++
plugins/mmvtkm_gl/src/mmvtkm_gl.cpp
xge/megamol
1e298dd3d8b153d7468ed446f6b2ed3ac49f0d5b
[ "BSD-3-Clause" ]
49
2017-08-23T13:24:24.000Z
2022-03-16T09:10:58.000Z
plugins/mmvtkm_gl/src/mmvtkm_gl.cpp
xge/megamol
1e298dd3d8b153d7468ed446f6b2ed3ac49f0d5b
[ "BSD-3-Clause" ]
200
2018-07-20T15:18:26.000Z
2022-03-31T11:01:44.000Z
plugins/mmvtkm_gl/src/mmvtkm_gl.cpp
xge/megamol
1e298dd3d8b153d7468ed446f6b2ed3ac49f0d5b
[ "BSD-3-Clause" ]
31
2017-07-31T16:19:29.000Z
2022-02-14T23:41:03.000Z
/** * MegaMol * Copyright (c) 2019-2021, MegaMol Dev Team * All rights reserved. */ #include "mmcore/utility/plugins/AbstractPluginInstance.h" #include "mmcore/utility/plugins/PluginRegister.h" #include "mmvtkm_gl/mmvtkmMeshRenderTasks.h" //#include "mmvtkm_gl/mmvtkmRenderer.h" namespace megamol::mmvtkm_gl { class MmvtkmGLPluginInstance : public megamol::core::utility::plugins::AbstractPluginInstance { REGISTERPLUGIN(MmvtkmGLPluginInstance) public: MmvtkmGLPluginInstance() : megamol::core::utility::plugins::AbstractPluginInstance( "vtkm_gl", "Plugin to read and render vtkm data."){}; virtual ~MmvtkmGLPluginInstance() override = default; // Registers modules and calls void registerClasses() override { // register modules this->module_descriptions.RegisterAutoDescription<megamol::mmvtkm_gl::mmvtkmMeshRenderTasks>(); // this->module_descriptions.RegisterAutoDescription<megamol::mmvtkm_gl::mmvtkmDataRenderer>(); // register calls } }; } // namespace megamol::mmvtkm_gl
29.162162
103
0.722892
xge
bd3562be8660e9eb07434f956c88fd2d4472e3e5
491
cpp
C++
source/MenuItemEvent.cpp
iSLC/vaca
c9bc3284c2a1325f7056f455fd5ff1e47e7673bc
[ "MIT" ]
null
null
null
source/MenuItemEvent.cpp
iSLC/vaca
c9bc3284c2a1325f7056f455fd5ff1e47e7673bc
[ "MIT" ]
null
null
null
source/MenuItemEvent.cpp
iSLC/vaca
c9bc3284c2a1325f7056f455fd5ff1e47e7673bc
[ "MIT" ]
null
null
null
// Vaca - Visual Application Components Abstraction // Copyright (c) 2005-2010 David Capello // // This file is distributed under the terms of the MIT license, // please read LICENSE.txt for more information. #include "Wg/MenuItemEvent.hpp" #include "Wg/Menu.hpp" using namespace Wg; MenuItemEvent::MenuItemEvent(MenuItem* source) : Event(source) { } MenuItemEvent::~MenuItemEvent() = default; MenuItem* MenuItemEvent::getMenuItem() { return dynamic_cast<MenuItem*>(getSource()); }
20.458333
63
0.747454
iSLC
bd35b513a5f64716a1c122fa8fe0b9c5aac13fc6
2,099
cpp
C++
book/aoj/07/ALDS1_6_C/main.cpp
515hikaru/solutions
9fb3e4600f9a97b78211a5736c98354d4cbebc38
[ "MIT" ]
null
null
null
book/aoj/07/ALDS1_6_C/main.cpp
515hikaru/solutions
9fb3e4600f9a97b78211a5736c98354d4cbebc38
[ "MIT" ]
9
2019-12-29T17:57:39.000Z
2020-02-16T16:36:04.000Z
book/aoj/07/ALDS1_6_C/main.cpp
515hikaru/solutions
9fb3e4600f9a97b78211a5736c98354d4cbebc38
[ "MIT" ]
null
null
null
#include <cstdio> #include <string> const int N = 100005; const long MAX = 2000000000; struct Card { char name[10]; int number; }; void merge(struct Card *A, int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; struct Card L[N / 2 + 3], R[N / 2 + 3]; for (int i = 0; i < n1; i++) L[i] = A[left + i]; for (int i = 0; i < n2; i++) R[i] = A[mid + i]; L[n1] = A[0]; R[n2] = A[0]; L[n1].number = MAX; R[n2].number = MAX; int i = 0, j = 0; for (int k = left; k < right; k++) { if (L[i].number <= R[j].number) { A[k] = L[i]; i++; } else { A[k] = R[j]; j++; } } } void mergeSort(struct Card *A, int left, int right) { if (left + 1 < right) { int mid = (left + right) / 2; mergeSort(A, left, mid); mergeSort(A, mid, right); merge(A, left, mid, right); } } int partition(struct Card *A, int p, int r) { int x = A[r].number; int i, j; i = p - 1; struct Card tmp; for( j = p; j < r; j ++) { if(A[j].number <= x) { i++; tmp = A[j]; A[j] = A[i]; A[i] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = tmp; return i + 1; } void quickSort(struct Card *A, int left, int right) { if (left > right) return; int q = partition(A, left, right); // q の場所は既にソートが終わっているので // q より左、および q より右の場所に関するソートをする必要がある quickSort(A, left, q - 1); quickSort(A, q + 1, right); } int main() { int n; scanf("%d", &n); struct Card A[N], B[N]; for(int i = 0; i < n; i++) { scanf("%s", A[i].name); scanf("%d", &A[i].number); B[i] = A[i]; } mergeSort(B, 0, n); quickSort(A, 0, n-1); bool flg = true; for(int i = 0; i < n; i++) { if (B[i].name[0] != A[i].name[0]) flg = false; } if (flg) printf("Stable\n"); else printf("Not stable\n"); for(int i = 0; i < n; i++) { printf("%s %d\n", A[i].name, A[i].number); } return 0; }
22.329787
58
0.443545
515hikaru
bd37bde2bd601f0e5355828de7d68159ef5489ad
616
cpp
C++
codeforces/contests/1350/A.cpp
wingkwong/competitive-programming
e8bf7aa32e87b3a020b63acac20e740728764649
[ "MIT" ]
18
2020-08-27T05:27:50.000Z
2022-03-08T02:56:48.000Z
codeforces/contests/1350/A.cpp
wingkwong/competitive-programming
e8bf7aa32e87b3a020b63acac20e740728764649
[ "MIT" ]
null
null
null
codeforces/contests/1350/A.cpp
wingkwong/competitive-programming
e8bf7aa32e87b3a020b63acac20e740728764649
[ "MIT" ]
1
2020-10-13T05:23:58.000Z
2020-10-13T05:23:58.000Z
/* A. Orac and Factors https://codeforces.com/contest/1350/problem/A */ #include <bits/stdc++.h> using namespace std; #define FAST_INP ios_base::sync_with_stdio(false);cin.tie(NULL) int main() { FAST_INP; int t,n,k; cin >> t; while(t--){ cin >> n >> k; // n is even: n+2k // n is odd : n+2(k-1)+f(n) if(n%2==0){ cout << n+2*k << "\n"; continue; } int fn=0; for(int i=n;i>=2;i--){ if(n%i==0){ fn=i; } } cout << n+2*(k-1)+fn << "\n"; } return 0; }
18.117647
64
0.420455
wingkwong
bd3c935c2bf89dd674fa7ba96d8a0b3211fa61d9
11,380
cpp
C++
raptor/core/mpi_types.cpp
lukeolson/raptor
526c88d0801634e6fb41375ae077f2d4aa3241a4
[ "BSD-2-Clause" ]
25
2017-11-20T21:45:43.000Z
2019-01-27T15:03:25.000Z
raptor/core/mpi_types.cpp
haoxiangmiao/raptor
866977b8166e39675a6a1fb883c57b7b9395d32f
[ "BSD-2-Clause" ]
3
2019-12-04T18:18:59.000Z
2022-03-22T08:27:14.000Z
raptor/core/mpi_types.cpp
haoxiangmiao/raptor
866977b8166e39675a6a1fb883c57b7b9395d32f
[ "BSD-2-Clause" ]
5
2017-11-20T22:03:57.000Z
2018-12-05T10:30:22.000Z
bool profile = false; double collective_t = 0.0; double p2p_t = 0.0; double* current_t; double mat_t = 0.0; double vec_t = 0.0; double total_t = 0.0; double new_comm_t = 0.0; #include <mpi.h> #include "mpi_types.hpp" void init_profile() { profile = true; reset_profile(); } void reset_profile() { collective_t = 0.0; p2p_t = 0.0; mat_t = 0.0; vec_t = 0.0; new_comm_t = 0.0; if (profile) total_t = -MPI_Wtime(); else total_t = 0.0; } void finalize_profile() { profile = false; total_t += MPI_Wtime(); } void average_profile(int n_iter) { total_t /= n_iter; collective_t /= n_iter; p2p_t /= n_iter; vec_t /= n_iter; mat_t /= n_iter; new_comm_t /= n_iter; } void print_profile(const char* string) { int rank; double t0; RAPtor_MPI_Comm_rank(RAPtor_MPI_COMM_WORLD, &rank); MPI_Allreduce(&total_t, &t0, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); if (rank == 0) printf("%s Total Time: %e\n", string, t0); if (fabs(t0 - total_t) > zero_tol) reset_profile(); MPI_Reduce(&collective_t, &t0, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); if (rank == 0 && t0 > 0) printf("%s Collective Comm Time: %e\n", string, t0); MPI_Reduce(&p2p_t, &t0, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); if (rank == 0 && t0 > 0) printf("%s P2P Comm Time: %e\n", string, t0); MPI_Reduce(&vec_t, &t0, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); if (rank == 0 && t0 > 0) printf("%s Vec Comm Time: %e\n", string, t0); MPI_Reduce(&mat_t, &t0, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); if (rank == 0 && t0 > 0) printf("%s Mat Comm Time: %e\n", string, t0); } // Collective Methods int RAPtor_MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, RAPtor_MPI_Datatype datatype, RAPtor_MPI_Op op, RAPtor_MPI_Comm comm) { if (profile) collective_t -= RAPtor_MPI_Wtime(); int val = MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm); if (profile) collective_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Reduce(const void *sendbuf, void *recvbuf, int count, RAPtor_MPI_Datatype datatype, RAPtor_MPI_Op op, int root, RAPtor_MPI_Comm comm) { if (profile) collective_t -= RAPtor_MPI_Wtime(); int val = MPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm); if (profile) collective_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Gather(const void *sendbuf, int sendcount, RAPtor_MPI_Datatype sendtype, void *recvbuf, int recvcount, RAPtor_MPI_Datatype recvtype, int root, RAPtor_MPI_Comm comm) { if (profile) collective_t -= RAPtor_MPI_Wtime(); int val = MPI_Gather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm); if (profile) collective_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Allgather(const void* sendbuf, int sendcount, RAPtor_MPI_Datatype sendtype, void *recvbuf, int recvcount, RAPtor_MPI_Datatype recvtype, RAPtor_MPI_Comm comm) { if (profile) collective_t -= RAPtor_MPI_Wtime(); int val = MPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm); if (profile) collective_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Allgatherv(const void* sendbuf, int sendcount, RAPtor_MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int* displs, RAPtor_MPI_Datatype recvtype, RAPtor_MPI_Comm comm) { if (profile) collective_t -= RAPtor_MPI_Wtime(); int val = MPI_Allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm); if (profile) collective_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, RAPtor_MPI_Datatype datatype, RAPtor_MPI_Op op, RAPtor_MPI_Comm comm, RAPtor_MPI_Request* request) { if (profile) collective_t -= RAPtor_MPI_Wtime(); int val = MPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, request); if (profile) collective_t += RAPtor_MPI_Wtime(); if (profile) current_t = &collective_t; return val; } int RAPtor_MPI_Bcast(void *buffer, int count, RAPtor_MPI_Datatype datatype, int root, RAPtor_MPI_Comm comm) { if (profile) collective_t -= RAPtor_MPI_Wtime(); int val = MPI_Bcast(buffer, count, datatype, root, comm); if (profile) collective_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Ibarrier(RAPtor_MPI_Comm comm, RAPtor_MPI_Request *request) { if (profile) collective_t -= RAPtor_MPI_Wtime(); int val = MPI_Ibarrier(comm, request); if (profile) collective_t += RAPtor_MPI_Wtime(); if (profile) current_t = &collective_t; return val; } int RAPtor_MPI_Barrier(RAPtor_MPI_Comm comm) { if (profile) collective_t -= RAPtor_MPI_Wtime(); int val = MPI_Barrier(comm); if (profile) collective_t += RAPtor_MPI_Wtime(); return val; } // Point-to-Point Methods int RAPtor_MPI_Send(const void *buf, int count, RAPtor_MPI_Datatype datatype, int dest, int tag, RAPtor_MPI_Comm comm) { if (profile) p2p_t -= RAPtor_MPI_Wtime(); int val = MPI_Send(buf, count, datatype, dest, tag, comm); if (profile) p2p_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Isend(const void *buf, int count, RAPtor_MPI_Datatype datatype, int dest, int tag, RAPtor_MPI_Comm comm, RAPtor_MPI_Request * request) { if (profile) p2p_t -= RAPtor_MPI_Wtime(); int val = MPI_Isend(buf, count, datatype, dest, tag, comm, request); if (profile) p2p_t += RAPtor_MPI_Wtime(); if (profile) current_t = &p2p_t; return val; } int RAPtor_MPI_Issend(const void *buf, int count, RAPtor_MPI_Datatype datatype, int dest, int tag, RAPtor_MPI_Comm comm, RAPtor_MPI_Request * request) { if (profile) p2p_t -= RAPtor_MPI_Wtime(); int val = MPI_Issend(buf, count, datatype, dest, tag, comm, request); if (profile) p2p_t += RAPtor_MPI_Wtime(); if (profile) current_t = &p2p_t; return val; } int RAPtor_MPI_Recv(void *buf, int count, RAPtor_MPI_Datatype datatype, int source, int tag, RAPtor_MPI_Comm comm, RAPtor_MPI_Status * status) { if (profile) p2p_t -= RAPtor_MPI_Wtime(); int val = MPI_Recv(buf, count, datatype, source, tag, comm, status); if (profile) p2p_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Irecv(void *buf, int count, RAPtor_MPI_Datatype datatype, int source, int tag, RAPtor_MPI_Comm comm, RAPtor_MPI_Request * request) { if (profile) p2p_t -= RAPtor_MPI_Wtime(); int val = MPI_Irecv(buf, count, datatype, source, tag, comm, request); if (profile) p2p_t += RAPtor_MPI_Wtime(); if (profile) current_t = &p2p_t; return val; } int RAPtor_MPI_Probe(int source, int tag, RAPtor_MPI_Comm comm, RAPtor_MPI_Status* status) { if (profile) p2p_t -= RAPtor_MPI_Wtime(); int val = MPI_Probe(source, tag, comm, status); if (profile) p2p_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Iprobe(int source, int tag, RAPtor_MPI_Comm comm, int *flag, RAPtor_MPI_Status *status) { if (profile) p2p_t -= RAPtor_MPI_Wtime(); int val = MPI_Iprobe(source, tag, comm, flag, status); if (profile) p2p_t += RAPtor_MPI_Wtime(); if (profile) current_t = &p2p_t; return val; } // Waiting for completion int RAPtor_MPI_Wait(RAPtor_MPI_Request *request, RAPtor_MPI_Status *status) { if (profile) *current_t -= RAPtor_MPI_Wtime(); int val = MPI_Wait(request, status); if (profile) *current_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Waitall(int count, RAPtor_MPI_Request array_of_requests[], RAPtor_MPI_Status array_of_statuses[]) { if (profile) *current_t -= RAPtor_MPI_Wtime(); int val = MPI_Waitall(count, array_of_requests, array_of_statuses); if (profile) *current_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Test(MPI_Request *request, int *flag, MPI_Status *status) { if (profile) *current_t -= RAPtor_MPI_Wtime(); int val = MPI_Test(request, flag, status); if (profile) *current_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Testall(int count, MPI_Request array_of_requests[], int* flag, MPI_Status array_of_statuses[]) { if (profile) *current_t -= RAPtor_MPI_Wtime(); int val = MPI_Testall(count, array_of_requests, flag, array_of_statuses); if (profile) *current_t += RAPtor_MPI_Wtime(); return val; } // Packing/Unpacking Data int RAPtor_MPI_Pack(const void *inbuf, int incount, RAPtor_MPI_Datatype datatype, void *outbuf, int outside, int *position, RAPtor_MPI_Comm comm) { return MPI_Pack(inbuf, incount, datatype, outbuf, outside, position, comm); } int RAPtor_MPI_Unpack(const void *inbuf, int insize, int *position, void *outbuf, int outcount, RAPtor_MPI_Datatype datatype, RAPtor_MPI_Comm comm) { return MPI_Unpack(inbuf, insize, position, outbuf, outcount, datatype, comm); } int RAPtor_MPI_Pack_size(int incount, RAPtor_MPI_Datatype datatype, RAPtor_MPI_Comm comm, int *size) { return MPI_Pack_size(incount, datatype, comm, size); } // Other utilities (no communication) double RAPtor_MPI_Wtime() { return MPI_Wtime(); } int RAPtor_MPI_Get_count(const RAPtor_MPI_Status *status, RAPtor_MPI_Datatype datatype, int *count) { return MPI_Get_count(status, datatype, count); } int RAPtor_MPI_Comm_rank(RAPtor_MPI_Comm comm, int* rank) { return MPI_Comm_rank(comm, rank); } int RAPtor_MPI_Comm_size(RAPtor_MPI_Comm comm, int* size) { return MPI_Comm_size(comm, size); } // Creating New Communicator int RAPtor_MPI_Comm_split(RAPtor_MPI_Comm comm, int color, int key, RAPtor_MPI_Comm* new_comm) { if (profile) new_comm_t -= RAPtor_MPI_Wtime(); int val = MPI_Comm_split(comm, color, key, new_comm); if (profile) new_comm_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Comm_group(RAPtor_MPI_Comm comm, RAPtor_MPI_Group *group) { if (profile) new_comm_t -= RAPtor_MPI_Wtime(); int val = MPI_Comm_group(comm, group); if (profile) new_comm_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Comm_create_group(RAPtor_MPI_Comm comm, RAPtor_MPI_Group group, int tag, RAPtor_MPI_Comm* newcomm) { if (profile) new_comm_t -= RAPtor_MPI_Wtime(); int val = MPI_Comm_create_group(comm, group, tag, newcomm); if (profile) new_comm_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Group_incl(RAPtor_MPI_Group group, int n, const int ranks[], RAPtor_MPI_Group *newgroup) { if (profile) new_comm_t -= RAPtor_MPI_Wtime(); int val = MPI_Group_incl(group, n, ranks, newgroup); if (profile) new_comm_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Comm_free(RAPtor_MPI_Comm *comm) { if (profile) new_comm_t -= RAPtor_MPI_Wtime(); int val = MPI_Comm_free(comm); if (profile) new_comm_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Group_free(RAPtor_MPI_Group* group) { if (profile) new_comm_t -= RAPtor_MPI_Wtime(); int val = MPI_Group_free(group); if (profile) new_comm_t += RAPtor_MPI_Wtime(); return val; } int RAPtor_MPI_Comm_dup(MPI_Comm comm, MPI_Comm* new_comm) { if (profile) new_comm_t -= RAPtor_MPI_Wtime(); int val = MPI_Comm_dup(comm, new_comm); if (profile) new_comm_t += RAPtor_MPI_Wtime(); return val; }
34.277108
112
0.700527
lukeolson
bd417828d00a2349cb5552f64136d93462f78bb0
2,233
cpp
C++
master_slave.cpp
volatilflerovium/3D-Multithread
a25ad952a57f4268bf56cd83d3d39f26ea16557b
[ "MIT" ]
null
null
null
master_slave.cpp
volatilflerovium/3D-Multithread
a25ad952a57f4268bf56cd83d3d39f26ea16557b
[ "MIT" ]
null
null
null
master_slave.cpp
volatilflerovium/3D-Multithread
a25ad952a57f4268bf56cd83d3d39f26ea16557b
[ "MIT" ]
null
null
null
#include "master_slave.h" //==================================================================== std::mutex Master::m_controlMutex; std::mutex Master::m_mtx; std::unique_lock<mutex> Master::m_ulock=unique_lock<mutex>(m_mtx); std::condition_variable Master::m_cv; std::vector<Slave*> Master::m_slaves; std::vector<std::thread*> Master::m_threads; std::vector<bool> Master::m_slaveStatus; bool Master::m_ready(false); //====================================================================== void Slave::run(){ while(m_running){ while(!m_wait){ m_cv.wait(m_ulock, [this]{return this->m_wait;}); } if(!m_running){ break; } for(int i=0; i<m_shapes.size(); i++){ m_shapes[i]->rotate(); m_shapes[i]->move(2.0); m_shapes[i]->preDraw(); } m_wait=false; Master::workDone(m_id); } } //#################################################################### //#################################################################### void Master::registerSlave(Slave* tmp){ m_slaveStatus.push_back(false); m_slaves.push_back(tmp); tmp->setID(m_slaves.size()-1); m_threads.push_back(new std::thread(&Slave::run, tmp)); } //====================================================================== void Master::workDone(int id){ m_mtx.lock(); m_slaveStatus[id]=true; m_ready=true; for(int i=0; i<m_slaveStatus.size(); i++){ m_ready=m_ready && m_slaveStatus[i]; } if(m_ready){ m_cv.notify_one(); } m_mtx.unlock(); } //====================================================================== void Master::wakeUpSlaves(){ for(int i=0; i<m_slaves.size(); i++){ m_slaves[i]->notify(); } } //====================================================================== void Master::waiting(){ while(!m_ready){ m_cv.wait(m_ulock, []{ return Master::m_ready; }); } m_ready=false; for(int i=0; i<m_slaves.size(); i++){ m_slaveStatus[i]=false; } } //====================================================================== void Master::stop(){ for(int i=0; i<m_slaves.size(); i++){ m_slaves[i]->stop(); if(m_threads[i]->joinable()){ m_threads[i]->join(); } delete m_slaves[i]; delete m_threads[i]; } } //======================================================================
22.785714
72
0.461711
volatilflerovium
bd455a7b7d36778b9a9352ed2206e6b9a60d52ac
684
hpp
C++
src/skew_tent_generator1.hpp
botezatumihaicatalin/ChaoticImageCrypto
b8f41b159b21a618cec794584ca67a604bdf98ec
[ "MIT" ]
1
2017-06-23T01:52:23.000Z
2017-06-23T01:52:23.000Z
src/skew_tent_generator1.hpp
botezatumihaicatalin/ChaoticImageCrypto
b8f41b159b21a618cec794584ca67a604bdf98ec
[ "MIT" ]
null
null
null
src/skew_tent_generator1.hpp
botezatumihaicatalin/ChaoticImageCrypto
b8f41b159b21a618cec794584ca67a604bdf98ec
[ "MIT" ]
null
null
null
#pragma once #pragma once #include "generator1.hpp" class skew_tent_generator1 : public generator1 { protected: double exponent_; public: skew_tent_generator1(const double& start, const double& exponent) : generator1(start), exponent_(exponent) {} const double& next() override; const double& exponent() const; }; inline const double& skew_tent_generator1::next() { if (current_ <= exponent_ && current_ >= 0) { current_ = current_ / exponent_; } else if (current_ <= 1 && current_ > exponent_) { current_ = (1 - current_) / (1 - exponent_); } return current_; } inline const double& skew_tent_generator1::exponent() const { return exponent_; }
21.375
67
0.697368
botezatumihaicatalin
bd46707c24371583acbf60a14238cc4e34e1e0ce
427
hpp
C++
interpreter/stack.hpp
XenotriX1337/TRPL-Interpreter
976962090b2c2d0ade9d02567b83bd643e4ab9d2
[ "MIT" ]
null
null
null
interpreter/stack.hpp
XenotriX1337/TRPL-Interpreter
976962090b2c2d0ade9d02567b83bd643e4ab9d2
[ "MIT" ]
null
null
null
interpreter/stack.hpp
XenotriX1337/TRPL-Interpreter
976962090b2c2d0ade9d02567b83bd643e4ab9d2
[ "MIT" ]
null
null
null
#pragma once #include <map> #include <stack> #include "./ast.hpp" using Frame = std::map<std::string, ast::Expression*>; using Stack = std::stack<Frame>; class Storage { public: Storage(); ast::Expression* Get(const std::string& name) const; void Put(const std::string& name, ast::Expression*); void Update(const std::string& name, ast::Expression*); void NewFrame(); void PopFrame(); private: Stack stack; };
19.409091
57
0.679157
XenotriX1337
bd46e8f0fe5b418fe751843c4c56768934423d85
3,700
cpp
C++
src/src/Filters.cpp
AydinyanNarek/OpenCV
202551bd10cbd66f77e8dc008808cb499be21cc3
[ "MIT" ]
1
2020-06-22T08:48:51.000Z
2020-06-22T08:48:51.000Z
src/src/Filters.cpp
AydinyanNarek/OpenCV
202551bd10cbd66f77e8dc008808cb499be21cc3
[ "MIT" ]
null
null
null
src/src/Filters.cpp
AydinyanNarek/OpenCV
202551bd10cbd66f77e8dc008808cb499be21cc3
[ "MIT" ]
null
null
null
#include "../include/Filters.h" std::vector<cv::Mat> Filters::overlay(const std::vector<cv::Mat>& background, const std::vector<cv::Mat>& moving, const std::vector<cv::Mat>& mask) { auto frameNum = std::min(background.size(), moving.size()); std::vector<cv::Mat> output(frameNum); cv::Mat temp1; cv::Mat temp2; cv::Mat maskInv; for (int i = 0; i < frameNum; ++i) { cv::bitwise_not(mask[i], maskInv); temp1 = moving[i]; temp1.setTo(0, maskInv); temp2 = background[i]; temp2.setTo(0, mask[i]); output.emplace_back(temp1 + temp2); } return output; } cv::Rect2d Filters::toBoundingBox(const std::vector<cv::Point>& points) { int minX = 0; int minY = 0; int maxX = 0; int maxY = 0; for(const auto & it : points){ if(minX > it.x) { minX = it.x; } if(minY > it.y) { minY = it.y; } if(maxX < it.x) { maxX = it.x; } if(maxY < it.y) { maxY = it.y; } } return cv::Rect2d (cv::Point(minX, minY), cv::Point(maxX, maxY)); } cv::Rect2d Filters::ojectTracker(const cv::Rect2d& bBox, cv::Mat& begin, cv::Mat& next, cv::Ptr<cv::Tracker> tracker) { cv::Rect2d bBoxTemp; tracker->init(begin, bBox); // Update the tracking result bool ok = tracker->update(next, bBoxTemp); if(!ok) { return {}; } return bBoxTemp; } std::vector<cv::Mat> Filters::findMoveingObject(const std::vector< cv::Mat>& images) { //Starting with second frame for haveing referance to track std::vector<cv::Mat> result; result.resize(images.size()); auto backgrounds = subtractBackground(images); for(size_t i = 0; i < images.size(); ++i) { auto counts = detectContours(backgrounds[i]); filterObjects(images[i], counts, result[i]); } return result; } std::vector<cv::Mat> Filters::subtractBackground(const std::vector<cv::Mat>& video) { cv::Ptr<cv::BackgroundSubtractor> bgsubtractor = cv::createBackgroundSubtractorKNN(500, 400, false); std::vector<cv::Mat> bgmask; bgmask.resize(video.size()); int i = 0; for(auto& it: video) { bgsubtractor->apply(it, bgmask[i], true ? -1 : 0); ++i; } return bgmask; } Filters::Contours Filters::detectContours(const cv::Mat& mask) { int nIters = 3;//number of iterations std::vector<std::vector<cv::Point>> contours; std::vector<cv::Vec4i> hierarchy; cv::Mat temp; dilate(mask, temp, cv::Mat(), cv::Point(-1,-1), nIters); erode(temp, temp, cv::Mat(), cv::Point(-1,-1), nIters*2); dilate(temp, temp, cv::Mat(), cv::Point(-1,-1), nIters); cv::findContours( temp, contours, hierarchy, 2, 2); if( contours.size() == 0 ) { return {}; } return {contours, hierarchy}; } void Filters::filterObjects(const cv::Mat& img, const Filters::Contours & cont, cv::Mat& dst) { if( (cont.mContours.size() == 0) || (cont.mHierarchy.size() == 0)) { return; } dst = cv::Mat::zeros(img.size(), CV_8UC1); // iterate through all the top-level contours, // draw each connected component with its own random color int idx = 0, largestComp = 0; double maxArea = 0; for( ; idx >= 0; idx = cont.mHierarchy[idx][0] ) { const std::vector<cv::Point>& c = cont.mContours[idx]; double area = std::abs(cv::contourArea(cv::Mat(c))); if( area > maxArea ) { maxArea = area; largestComp = idx; } } cv::Scalar color(255); cv::drawContours(dst, cont.mContours, largestComp, color, -1, 8, cont.mHierarchy ); }
29.6
149
0.577027
AydinyanNarek
bd47cbd87bfc5caf9dd439a90d149e9e2b70c08f
632
cpp
C++
SingletonPattern/main.cpp
coologic/CppDesignPattern
f958610cded28264d0a6f90067e1d2ff3dc70eae
[ "MIT" ]
63
2020-02-21T05:34:04.000Z
2022-03-18T05:39:53.000Z
SingletonPattern/main.cpp
jhonconal/CppDesignPattern
79b55b20ffab670d2197be7ee66b4044c5dc965b
[ "MIT" ]
null
null
null
SingletonPattern/main.cpp
jhonconal/CppDesignPattern
79b55b20ffab670d2197be7ee66b4044c5dc965b
[ "MIT" ]
26
2020-04-01T06:17:29.000Z
2022-01-11T03:42:26.000Z
#include <cpp11_sigleton.h> #include <thread> int main(int argc, char *argv[]) { std::thread t1(Cpp11Sigleton<TestCpp11Sigleton>::GetInstance); t1.detach(); std::thread t2(Cpp11Sigleton<TestCpp11Sigleton>::GetInstance); t2.detach(); std::thread t3(Cpp11Sigleton<TestCpp11Sigleton>::GetInstance); t3.detach(); std::thread t4(Cpp11Sigleton<TestCpp11Sigleton>::GetInstance); t4.detach(); Cpp11Sigleton<TestCpp11Sigleton>::GetInstance(); Cpp11Sigleton<TestCpp11Sigleton>::GetInstance(); Cpp11Sigleton<TestCpp11Sigleton>::GetInstance(); Cpp11Sigleton<TestCpp11Sigleton>::GetInstance(); }
37.176471
66
0.72943
coologic
bd4a6235402b88e3d97e7297d4dca409875bbb7e
1,298
cpp
C++
src/base/utils/HandleMap.cpp
ysbing/voo
329d6a72ede6dd5903ca4d824bb3c49a5502f5c3
[ "Apache-2.0" ]
56
2022-01-29T04:52:27.000Z
2022-03-31T06:52:15.000Z
src/base/utils/HandleMap.cpp
jumpingfrog0/VOO
af191ece986f997cf98f85016aa7288c323210c3
[ "Apache-2.0" ]
null
null
null
src/base/utils/HandleMap.cpp
jumpingfrog0/VOO
af191ece986f997cf98f85016aa7288c323210c3
[ "Apache-2.0" ]
16
2022-01-29T04:52:39.000Z
2022-03-31T07:48:53.000Z
#include "HandleMap.h" #include <cassert> int64_t HandleMap::allocHandle(void *value) { assert(value != nullptr); std::lock_guard<std::mutex> locker(m_mutex); m_nextHandle++; int64_t handle = m_nextHandle; assert(handle != 0); m_map0[value] = handle; m_map1[handle] = value; return handle; } void HandleMap::freeHandle(void *value) { assert(value != nullptr); std::lock_guard<std::mutex> locker(m_mutex); auto iter = m_map0.find(value); assert(iter != m_map0.end()); if (iter != m_map0.end()) { int64_t handle = iter->second; m_map0.erase(iter); m_map1.erase(m_map1.find(handle)); } } int64_t HandleMap::getHandle(void *value) const { if (value == nullptr) { return 0; } std::lock_guard<std::mutex> locker(m_mutex); auto iter = m_map0.find(value); assert(iter != m_map0.end()); if (iter != m_map0.end()) { return iter->second; } return 0; } void *HandleMap::lockHandle(int64_t handle) const { if (handle == 0) { return nullptr; } std::lock_guard<std::mutex> locker(m_mutex); auto iter = m_map1.find(handle); // assert(iter != m_map1.end()); if (iter != m_map1.end()) { return iter->second; } return nullptr; }
23.178571
51
0.600154
ysbing