blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
986 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
23 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
145 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
122 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
39401419c41656a788a5c0603cb3a23819647172
8d448af63bcbc1869c5eeb01152a16a53201ef1d
/src/qq_mem/src/trie_bench.cc
2a397a225a463f0ab13024a01b693c6ead8df40a
[]
no_license
junhe/wiser
671b51d3fbf7eb8c4c96a3ed80226e5d35bedf6e
1f7a01dc96ca5bcf4594ddc8fa6360bba30a6465
refs/heads/master
2022-09-11T07:44:02.531744
2020-02-20T04:51:47
2020-02-20T04:51:47
106,583,941
10
5
null
2022-08-29T22:42:49
2017-10-11T17:03:02
Java
UTF-8
C++
false
false
2,060
cc
#include <algorithm> #include <iostream> #include <string> #include <memory> #include <thread> #include <vector> #include <climits> #include <random> #include <gperftools/profiler.h> #include <glog/logging.h> #include <gflags/gflags.h> #include "vacuum_engine.h" DEFINE_string(term_path, "", "path of the file with term and count"); class DocCountReader { public: DocCountReader(const std::string &path) :in_(path) { if (in_.good() == false) { throw std::runtime_error("File may not exist"); } } bool NextEntry(std::string &entry) { std::string line; auto &ret = std::getline(in_, line); utils::trim(line); // std::cout << "line:" << line << std::endl; if (ret) { if (line == "") { entry == ""; } else { std::vector<std::string> items = utils::explode(line, ' '); entry = items[0]; } return true; } else { return false; } } private: std::ifstream in_; }; void LoadTrie(TermTrieIndex *index, const std::string path) { DocCountReader reader(path); int cnt = 0; std::string term; while (reader.NextEntry(term)) { if (term == "") std::cout << "Skipped one empty term" << std::endl; // std::cout << "Adding '" << term << "'" << std::endl; index->Add(term, rand()); cnt++; if (cnt % 1000000 == 0) { std::cout << "Finished " << cnt << std::endl; // break; } } std::cout << "size: " << index->NumTerms() << std::endl; } int main(int argc, char **argv) { google::InitGoogleLogging(argv[0]); FLAGS_logtostderr = 1; // print to stderr instead of file FLAGS_minloglevel = 3; gflags::ParseCommandLineFlags(&argc, &argv, true); TermTrieIndex index; std::cout << "flag:" << FLAGS_term_path << std::endl; std::vector<std::string> paths = utils::explode(FLAGS_term_path, ':'); for (auto &path : paths) { std::cout << path << std::endl; LoadTrie(&index, path); } std::cout << "Final size: " << index.NumTerms() << std::endl; utils::sleep(1000); }
[ "jhe@cs.wisc.edu" ]
jhe@cs.wisc.edu
f728dc1d105b0298e2096e600e0a4f6ff1868776
c6ecad18dd41ea69c22baf78dfeb95cf9ba547d0
/src/boost_1_42_0/libs/math/test/compile_test/sf_binomial_incl_test.cpp
ebdbdfa212ebb01a09b1da69b84fb0a817f93f43
[ "BSL-1.0" ]
permissive
neuschaefer/qnap-gpl
b1418d504ebe17d7a31a504d315edac309430fcf
7bb76f6cfe7abef08777451a75924f667cca335b
refs/heads/master
2022-08-16T17:47:37.015870
2020-05-24T18:56:05
2020-05-24T18:56:05
266,605,194
3
2
null
null
null
null
UTF-8
C++
false
false
853
cpp
// Copyright John Maddock 2006. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // Basic sanity check that header <boost/math/special_functions/binomial.hpp> // #includes all the files that it needs to. // #include <boost/math/special_functions/binomial.hpp> // // Note this header includes no other headers, this is // important if this test is to be meaningful: // #include "test_compile_result.hpp" void check() { check_result<float>(boost::math::binomial_coefficient<float>(u, u)); check_result<double>(boost::math::binomial_coefficient<double>(u, u)); #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS check_result<long double>(boost::math::binomial_coefficient<long double>(u, u)); #endif }
[ "j.neuschaefer@gmx.net" ]
j.neuschaefer@gmx.net
2ea6d8d2d3abee1bda0c911fbebe44d48cb84bee
260e5dec446d12a7dd3f32e331c1fde8157e5cea
/Indi/SDK/Indi_INX2_T_10_RachelMeyer_parameters.hpp
a1dd434997286d0195a36a64d52734c649afab74
[]
no_license
jfmherokiller/TheOuterWorldsSdkDump
6e140fde4fcd1cade94ce0d7ea69f8a3f769e1c0
18a8c6b1f5d87bb1ad4334be4a9f22c52897f640
refs/heads/main
2023-08-30T09:27:17.723265
2021-09-17T00:24:52
2021-09-17T00:24:52
407,437,218
0
0
null
null
null
null
UTF-8
C++
false
false
368
hpp
#pragma once // TheOuterWorlds SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "Indi_INX2_T_10_RachelMeyer_classes.hpp" namespace SDK { //--------------------------------------------------------------------------- //Parameters //--------------------------------------------------------------------------- } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "peterpan0413@live.com" ]
peterpan0413@live.com
f0ee302dfdbe59f3d625f341a021bda2c862e3db
30bdd8ab897e056f0fb2f9937dcf2f608c1fd06a
/Codes/AC/3099.cpp
cf021c544e3c1f771a369a6a3533f474936bd1f3
[]
no_license
thegamer1907/Code_Analysis
0a2bb97a9fb5faf01d983c223d9715eb419b7519
48079e399321b585efc8a2c6a84c25e2e7a22a61
refs/heads/master
2020-05-27T01:20:55.921937
2019-11-20T11:15:11
2019-11-20T11:15:11
188,403,594
2
1
null
null
null
null
UTF-8
C++
false
false
428
cpp
#include<bits/stdc++.h> #define int long long int //#define endl '\n' using namespace std; int a[100007]; main() { ios::sync_with_stdio(0);cin.tie(0); int n;cin>>n; for(int i=1;i<=n;i++)cin>>a[i]; for(int i=1;i<=n;i++){ a[i]++; int t=i%n; a[i]+=(t-a[i]%n+n)%n; } int mn=2147483647,k; for(int i=1;i<=n;i++){ if(a[i]<mn){ mn=a[i]; k=i; } } cout<<k<<endl; }
[ "harshitagar1907@gmail.com" ]
harshitagar1907@gmail.com
e27c2a3a7b93d969696e22967aad44785c376551
fab1b21716a78810180be0b0d268482e8508613b
/alias.h
144a809ae9acddc9e8da642b121f7c3ad372eb83
[]
no_license
RichardCTT/ExactSim
b437f5a57202782a55434b7a4271cf93c980e4d3
0d044f991f67f5d8e61dd249d31c6028931abfb0
refs/heads/master
2023-03-19T20:23:33.458689
2020-10-01T02:12:57
2020-10-01T02:12:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,078
h
#ifndef ALIAS_H #define ALIAS_H #include <random> #include <algorithm> #include <stack> using namespace std; class Alias{ public: double* p; int* h; pair<int, int>* map1; int n; Alias(vector<pair<pair<int, int>, double> > pi){ double sum = 0; n = pi.size(); stack<int> small; stack<int> big; p = new double[n]; h = new int[n]; map1 = new pair<int, int>[n]; for(int i = 0; i < n; i++){ sum += pi[i].second; map1[i] = pi[i].first; } for(int i = 0; i < n; i++){ p[i] = pi[i].second * n / sum; if(p[i] > 1) big.push(i); else small.push(i); } while(!small.empty() && !big.empty()){ int smallId = small.top(); small.pop(); int bigId = big.top(); h[smallId] = bigId; p[bigId] -= (1-p[smallId]); if(p[bigId] < 1){ small.push(bigId); big.pop(); } } } ~Alias(){ delete[] p; delete[] h; delete[] map1; } pair<int, int> generateRandom(Random& R){ int firstId = R.drand() * n; pair<int, int> answer = R.drand() < p[firstId] ? map1[firstId] : map1[h[firstId]]; return answer; } }; #endif
[ "noreply@github.com" ]
RichardCTT.noreply@github.com
61cac4417e695f8315ae90df0654a139c0d90a33
172c67be0050eebfbf6bac65d7e35093796826c9
/简单数学/反序数.cpp
d4c4d682df74010a7c2840b4eb6fcd1a35836c3e
[]
no_license
chenyur0ng/codeup
bf7015caa64fcaa59ba4726322f2fa650a7a9cdd
b323c25e0e40d1149e55b86781b9f87d913db5c3
refs/heads/master
2021-04-09T10:41:16.541321
2018-03-06T14:28:41
2018-03-06T14:28:41
125,391,208
1
0
null
2018-03-15T15:52:42
2018-03-15T15:52:41
null
UTF-8
C++
false
false
289
cpp
#include<cstdio> int main() { int a,b,c,d,n,i; for(i = 1000;i <= 1111;i++){ a = i % 10; b = (i / 10) % 10; c = (i / 100) % 10; d = i / 1000; n = a * 1000 + b * 100 + c * 10 + d; if(9 * i == n)printf("%d\n",i); } return 0; }
[ "1091261998@qq.com" ]
1091261998@qq.com
bd39a720913f7e2ec76af352a71082153fadbb5a
7c396d8dfc29dd1815728b5b4a679c6353919c6a
/principal.h
555b26b3851dc8769e8b5d92e80dfeb5fb7a8a44
[]
no_license
joelcorrales25/Salario
ecc84d39df6a92283f1ba0d6de0ac925676ed047
71b76e3b69906baed186ee1f1fd14134134d99c9
refs/heads/main
2023-06-13T23:42:18.448608
2021-07-03T23:39:59
2021-07-03T23:39:59
382,727,068
0
0
null
null
null
null
UTF-8
C++
false
false
882
h
#ifndef PRINCIPAL_H #define PRINCIPAL_H #include "calculosalario.h" #include "acerca.h" #include <QMainWindow> #include <QDir> #include <QFileDialog> #include <QFile> #include <QTextStream> #define VERSION "1.1.0" QT_BEGIN_NAMESPACE namespace Ui { class Principal; } QT_END_NAMESPACE class Principal : public QMainWindow { Q_OBJECT public: Principal(QWidget *parent = nullptr); ~Principal(); private slots: void on_actionSalir_triggered(); void on_cmdCalc_clicked(); void on_actionCalcular_triggered(); void on_actionNuevo_triggered(); void on_actionAcerca_de_triggered(); void on_actionGuardar_triggered(); void on_actionAbrir_triggered(); private: Ui::Principal *ui; void calcular(); void borrar(); void nuevo(); void guardarArchivo(); void abrirArchivo(); CalculoSalario control; }; #endif // PRINCIPAL_H
[ "jcorralesg@est.ups.edu.ec" ]
jcorralesg@est.ups.edu.ec
7b3891f2fdefb64f06bc449177324de0ea14dade
a3ed36263839b2c50f39773f6c8c0b8780b0ee30
/690. Employee Importance.cpp
83a721e04570400b95f9697a45db869ee0167794
[]
no_license
ysyncby/Leetcode
52c0556f509a4dc157527c160c595d4cb72899ce
775836d0d91eb08d376220796b09b401199bbcd6
refs/heads/master
2021-05-27T02:40:05.682917
2019-10-31T03:02:05
2019-10-31T03:02:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
914
cpp
/* // Employee info class Employee { public: // It's the unique ID of each node. // unique id of this employee int id; // the importance value of this employee int importance; // the id of direct subordinates vector<int> subordinates; }; */ class Solution { public: int getImportance(vector<Employee*> employees, int id) { unordered_set<int> s; unordered_map<int, int> m1; unordered_map<int, vector<int>> m2; int res = 0; queue<int> q; q.push(id); for(auto e:employees){ m1[e->id] = e->importance; m2[e->id] = e->subordinates; } while(!q.empty()){ int n = q.front(); q.pop(); res += m1[n]; auto list = m2[n]; for(int i=0;i<list.size();++i){ q.push(list[i]); } } return res; } };
[ "879090429@qq.com" ]
879090429@qq.com
a684614615f81495c3fd39c853c8e5572d8c8033
b67fa0df1fbb1fdbae55764ebead075ce1a6a12c
/C++/new/on thi/Untitled1.cpp
ca63287fc4ede3d733f46a0f8225dc3b3a39a1a3
[]
no_license
dphuoc432000/DuyTan_1st
056e39f6b2013da4f1da38ca92fb5edb8ac66b89
7c50359b771724b6e31cd867fe00a66af63ba290
refs/heads/master
2023-05-30T04:25:18.161308
2021-06-24T03:37:14
2021-06-24T03:37:14
379,792,321
0
0
null
null
null
null
UTF-8
C++
false
false
1,015
cpp
#include <iostream> #include <cmath> using namespace std; void nhap(int A[], int &n) { for(int i = 0; i < n; i++) { cin >> A[i]; } } void xuat(int A[], int n) { for(int i = 0; i < n; i++) { cout << A[i] << " "; } } void tong(int A[], int n) { int tong = 0; for (int i =0; i < n; i++) { if(A[i] % 2 !=0) { tong= tong + A[i]; } } cout << tong; } int nt(int n)//checknt { if(n < 2) { return false; } for(int i = 2 ; i < n; i++ ) { if(n % i == 0) { return false; } } return true; } void innt(int A[], int n)// in ra so nt { for (int i =0; i < n; i++) { if (nt(A[i]) == true) cout << A[i] << " "; } } void inknt (int A[], int n) // in ra khong phai so nguyen to { for (int i =0; i < n; i++) { if (nt(A[i]) == false) cout << A[i] << " "; } } void sapXep(int A[], int n) { inknt(A,n); innt(A,n); } main() { int A[255], n; cin >> n; nhap(A,n); cout << endl; xuat(A,n); cout << endl; tong(A,n); cout << endl; innt(A,n); cout << endl; sapXep(A,n); }
[ "dphuoc432000@gmail.com" ]
dphuoc432000@gmail.com
1a9be1da32463432d419d0124ca537fa300b8ed9
46f53e9a564192eed2f40dc927af6448f8608d13
/components/update_client/test/url_request_post_interceptor.h
d261160f611db1b5f76437cdb9a3190714b99e34
[ "BSD-3-Clause" ]
permissive
sgraham/nope
deb2d106a090d71ae882ac1e32e7c371f42eaca9
f974e0c234388a330aab71a3e5bbf33c4dcfc33c
refs/heads/master
2022-12-21T01:44:15.776329
2015-03-23T17:25:47
2015-03-23T17:25:47
32,344,868
2
2
null
null
null
null
UTF-8
C++
false
false
5,529
h
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_UPDATE_CLIENT_TEST_URL_REQUEST_POST_INTERCEPTOR_H_ #define COMPONENTS_UPDATE_CLIENT_TEST_URL_REQUEST_POST_INTERCEPTOR_H_ #include <stdint.h> #include <map> #include <queue> #include <string> #include <utility> #include <vector> #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h" #include "url/gurl.h" namespace base { class FilePath; class SequencedTaskRunner; } namespace net { class URLRequest; } namespace update_client { // Intercepts requests to a file path, counts them, and captures the body of // the requests. Optionally, for each request, it can return a canned response // from a given file. The class maintains a queue of expectations, and returns // one and only one response for each request that matches and it is // intercepted. class URLRequestPostInterceptor { public: // Allows a generic string maching interface when setting up expectations. class RequestMatcher { public: virtual bool Match(const std::string& actual) const = 0; virtual ~RequestMatcher() {} }; // Returns the url that is intercepted. GURL GetUrl() const; // Sets an expection for the body of the POST request and optionally, // provides a canned response identified by a |file_path| to be returned when // the expectation is met. If no |file_path| is provided, then an empty // response body is served. If |response_code| is provided, then an empty // response body with that response code is returned. // Returns |true| if the expectation was set. This class takes ownership of // the |request_matcher| object. bool ExpectRequest(class RequestMatcher* request_matcher); bool ExpectRequest(class RequestMatcher* request_matcher, int response_code); bool ExpectRequest(class RequestMatcher* request_matcher, const base::FilePath& filepath); // Returns how many requests have been intercepted and matched by // an expectation. One expectation can only be matched by one request. int GetHitCount() const; // Returns how many requests in total have been captured by the interceptor. int GetCount() const; // Returns all requests that have been intercepted, matched or not. std::vector<std::string> GetRequests() const; // Returns all requests as a string for debugging purposes. std::string GetRequestsAsString() const; // Resets the state of the interceptor so that new expectations can be set. void Reset(); class Delegate; private: friend class URLRequestPostInterceptorFactory; static const int kResponseCode200 = 200; struct ExpectationResponse { ExpectationResponse(int code, const std::string& body) : response_code(code), response_body(body) {} const int response_code; const std::string response_body; }; typedef std::pair<const RequestMatcher*, ExpectationResponse> Expectation; URLRequestPostInterceptor( const GURL& url, const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); ~URLRequestPostInterceptor(); void ClearExpectations(); const GURL url_; scoped_refptr<base::SequencedTaskRunner> io_task_runner_; mutable base::Lock interceptor_lock_; mutable int hit_count_; mutable std::vector<std::string> requests_; mutable std::queue<Expectation> expectations_; DISALLOW_COPY_AND_ASSIGN(URLRequestPostInterceptor); }; class URLRequestPostInterceptorFactory { public: URLRequestPostInterceptorFactory( const std::string& scheme, const std::string& hostname, const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); ~URLRequestPostInterceptorFactory(); // Creates an interceptor object for the specified url path. Returns NULL // in case of errors or a valid interceptor object otherwise. The caller // does not own the returned object. URLRequestPostInterceptor* CreateInterceptor(const base::FilePath& filepath); private: const std::string scheme_; const std::string hostname_; scoped_refptr<base::SequencedTaskRunner> io_task_runner_; // After creation, |delegate_| lives on the IO thread and it is owned by // a URLRequestFilter after registration. A task to unregister it and // implicitly destroy it is posted from ~URLRequestPostInterceptorFactory(). URLRequestPostInterceptor::Delegate* delegate_; DISALLOW_COPY_AND_ASSIGN(URLRequestPostInterceptorFactory); }; // Intercepts HTTP POST requests sent to "localhost2". class InterceptorFactory : public URLRequestPostInterceptorFactory { public: explicit InterceptorFactory( const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); ~InterceptorFactory(); // Creates an interceptor for the url path defined by POST_INTERCEPT_PATH. URLRequestPostInterceptor* CreateInterceptor(); // Creates an interceptor for the given url path. URLRequestPostInterceptor* CreateInterceptorForPath(const char* url_path); private: DISALLOW_COPY_AND_ASSIGN(InterceptorFactory); }; class PartialMatch : public URLRequestPostInterceptor::RequestMatcher { public: explicit PartialMatch(const std::string& expected) : expected_(expected) {} bool Match(const std::string& actual) const override; private: const std::string expected_; DISALLOW_COPY_AND_ASSIGN(PartialMatch); }; } // namespace update_client #endif // COMPONENTS_UPDATE_CLIENT_TEST_URL_REQUEST_POST_INTERCEPTOR_H_
[ "scottmg@chromium.org" ]
scottmg@chromium.org
50f8a66aaa64d99d7bc8b73d3400412170a895f4
4be608aee12039835a0d844c8f300c332d3df2d0
/Arduino Intro/Project-02-LEDFlash/Project-02.ino
d93ba6a321f8c98297067900ce3a17677be3e82e
[]
no_license
track02/Arduino
96f230a4c20873b735d31180c3adeed8aab1c6de
1e5c2b69701fa22f19e60c344831db60d6f3c00f
refs/heads/master
2021-01-10T01:56:22.113211
2020-10-22T14:00:58
2020-10-22T14:00:58
44,553,193
0
0
null
null
null
null
UTF-8
C++
false
false
807
ino
int switchstate = 0; void setup() { //Specify inputs/outputs on each pin pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(2, INPUT); } void loop() { //Read input from pin 2 switchstate = digitalRead(2); //Digitalwrite sends a voltage over specified pin //LOW = 0v //HIGH = 5v if(switchstate == LOW){ //Turn on LED at pin 3 digitalWrite(3, HIGH); //Turn off LEDs at pins 4/5 digitalWrite(4, LOW); digitalWrite(5, LOW); } else{ //Turn off LEDs 3/4 digitalWrite(3, LOW); digitalWrite(4, LOW); //Turn on LED 5 digitalWrite(5, HIGH); //Sleep 1/4s delay(250); //Turn on LED 4 / Turn off LED 5 [Flashing] digitalWrite(4, HIGH); digitalWrite(5, LOW); //Sleep 1/4s delay(250); } }
[ "track02@homebox.home" ]
track02@homebox.home
af54eb26b6523028ed92864409ebb40cb24d9946
08ad85c3482baebf2918c232d58812a84da4c829
/TinyVectorExpressionInline.cxx
d12f5cc1e2729310d0b64745c7b797bc84f2c25d
[]
no_license
jafarpenot/ter
6fab7eb80a3e06b53026fa9135ad2805694dc2b8
8b43ca2e8768f83ff8108dd9fbc671e0df4e347e
refs/heads/master
2021-01-10T10:29:09.682155
2016-03-31T11:27:46
2016-03-31T11:27:46
55,145,179
0
0
null
null
null
null
UTF-8
C++
false
false
15,150
cxx
#ifndef LINALG_FILE_TINY_VECTOR_EXPRESSION_INLINE_CXX namespace linalg { //! returns the element i of expression template<class T, int m, class E> inline const T TinyVectorExpression<T, m, E>::operator()(int i) const { return static_cast<const E&>(*this)(i); } //! Constructor u-v with two expressions u and v template<class T, int m, class E1, class E2> template<class T1, class T2> inline TinyVectorDifference<T, m, E1, E2>:: TinyVectorDifference(const TinyVectorExpression<T1, m, E1>& u, const TinyVectorExpression<T2, m, E2>& v) : u_(u), v_(v) { } //! returns the i-th element of the difference template<class T, int m, class E1, class E2> inline const T TinyVectorDifference<T, m, E1, E2>::operator()(int i) const { return u_(i) - v_(i); } //! Constructor u+v with two expressions u and v template<class T, int m, class E1, class E2> template<class T1, class T2> inline TinyVectorSum<T, m, E1, E2> ::TinyVectorSum(const TinyVectorExpression<T1, m, E1>& u, const TinyVectorExpression<T2, m, E2>& v) : u_(u), v_(v) { } //! returns the i-th element of the sum template<class T, int m, class E1, class E2> inline const T TinyVectorSum<T, m, E1, E2>::operator()(int i) const { return u_(i) + v_(i); } //! Constructor u*v with two expressions u and v template<class T, int m, class E1, class E2> template<class T1, class T2> inline TinyVectorProduct<T, m, E1, E2> ::TinyVectorProduct(const TinyVectorExpression<T1, m, E1>& u, const TinyVectorExpression<T2, m, E2>& v) : u_(u), v_(v) { } //! returns the i-th element of the element-wise product template<class T, int m, class E1, class E2> inline const T TinyVectorProduct<T, m, E1, E2>::operator()(int i) const { return u_(i) * v_(i); } //! Constructor u / v with two expressions u and v template<class T, int m, class E1, class E2> template<class T1, class T2> inline TinyVectorDivision<T, m, E1, E2> ::TinyVectorDivision(const TinyVectorExpression<T1, m, E1>& u, const TinyVectorExpression<T2, m, E2>& v) : u_(u), v_(v) { } //! returns the i-th element of the element-wise division template<class T, int m, class E1, class E2> inline const T TinyVectorDivision<T, m, E1, E2>::operator()(int i) const { return u_(i) / v_(i); } //! Constructor alpha * u with a scalar alpha and an expression u template<class T, int m, class T0, class E> template<class T1> inline TinyVectorScaled<T, m, T0, E>::TinyVectorScaled(const T0& alpha, const TinyVectorExpression<T1, m, E>& u) : alpha_(alpha), u_(u) { } //! returns the i-th element of alpha*u template<class T, int m, class T0, class E> inline const T TinyVectorScaled<T, m, T0, E>::operator()(int i) const { return alpha_*u_(i); } //! Constructor alpha / u with a scalar alpha and an expression u template<class T, int m, class T0, class E> template<class T1> inline TinyVectorScalDiv<T, m, T0, E>::TinyVectorScalDiv(const T0& alpha, const TinyVectorExpression<T1, m, E>& u) : alpha_(alpha), u_(u) { } //! returns the i-th element of alpha / u template<class T, int m, class T0, class E> inline const T TinyVectorScalDiv<T, m, T0, E>::operator()(int i) const { return alpha_ / u_(i); } //! Constructor alpha + u with a scalar alpha and an expression u template<class T, int m, class T0, class E> template<class T1> inline TinyVectorScalSum<T, m, T0, E>::TinyVectorScalSum(const T0& alpha, const TinyVectorExpression<T1, m, E>& u) : alpha_(alpha), u_(u) { } //! returns the i-th element of alpha + u template<class T, int m, class T0, class E> inline const T TinyVectorScalSum<T, m, T0, E>::operator()(int i) const { return alpha_ + u_(i); } //! Constructor alpha - u with a scalar alpha and an expression u template<class T, int m, class T0, class E> template<class T1> inline TinyVectorScalDiff<T, m, T0, E>::TinyVectorScalDiff(const T0& alpha, const TinyVectorExpression<T1, m, E>& u) : alpha_(alpha), u_(u) { } //! returns the i-th element of alpha - u template<class T, int m, class T0, class E> inline const T TinyVectorScalDiff<T, m, T0, E>::operator()(int i) const { return alpha_ - u_(i); } //! Constructor -u with an expression u template<class T, int m, class E> inline TinyVectorOpposite<T, m, E>::TinyVectorOpposite(const TinyVectorExpression<T, m, E>& u) : u_(u) { } //! returns the i-th element of -u template<class T, int m, class E> inline const T TinyVectorOpposite<T, m, E>::operator()(int i) const { return -u_(i); } /************* * Operators * *************/ //! returns u+v template<class T, int m, class E1, class E2> inline const TinyVectorSum<T, m, E1, E2> operator +(const TinyVectorExpression<T, m, E1>& u, const TinyVectorExpression<T, m, E2>& v) { return TinyVectorSum<T, m, E1, E2>(u, v); } //! returns u+v template<class T, int m, class E1, class E2> inline const TinyVectorSum<complex<T>, m, E1, E2> operator +(const TinyVectorExpression<complex<T>, m, E1>& u, const TinyVectorExpression<T, m, E2>& v) { return TinyVectorSum<complex<T>, m, E1, E2>(u, v); } //! returns u+v template<class T, int m, class E1, class E2> inline const TinyVectorSum<complex<T>, m, E1, E2> operator +(const TinyVectorExpression<T, m, E1>& u, const TinyVectorExpression<complex<T>, m, E2>& v) { return TinyVectorSum<complex<T>, m, E1, E2>(u, v); } //! returns u-v template<class T, int m, class E1, class E2> inline const TinyVectorDifference<T, m, E1, E2> operator -(const TinyVectorExpression<T, m, E1>& u, const TinyVectorExpression<T, m, E2>& v) { return TinyVectorDifference<T, m, E1, E2>(u, v); } //! returns u-v template<class T, int m, class E1, class E2> inline const TinyVectorDifference<complex<T>, m, E1, E2> operator -(const TinyVectorExpression<complex<T>, m, E1>& u, const TinyVectorExpression<T, m, E2>& v) { return TinyVectorDifference<complex<T>, m, E1, E2>(u, v); } //! returns u-v template<class T, int m, class E1, class E2> inline const TinyVectorDifference<complex<T>, m, E1, E2> operator -(const TinyVectorExpression<T, m, E1>& u, const TinyVectorExpression<complex<T>, m, E2>& v) { return TinyVectorDifference<complex<T>, m, E1, E2>(u, v); } //! returns u*v element-wise template<class T, int m, class E1, class E2> inline const TinyVectorProduct<T, m, E1, E2> operator *(const TinyVectorExpression<T, m, E1>& u, const TinyVectorExpression<T, m, E2>& v) { return TinyVectorProduct<T, m, E1, E2>(u, v); } //! returns u*v element-wise template<class T, int m, class E1, class E2> inline const TinyVectorProduct<complex<T>, m, E1, E2> operator *(const TinyVectorExpression<complex<T>, m, E1>& u, const TinyVectorExpression<T, m, E2>& v) { return TinyVectorProduct<complex<T>, m, E1, E2>(u, v); } //! returns u*v element-wise template<class T, int m, class E1, class E2> inline const TinyVectorProduct<complex<T>, m, E1, E2> operator *(const TinyVectorExpression<T, m, E1>& u, const TinyVectorExpression<complex<T>, m, E2>& v) { return TinyVectorProduct<complex<T>, m, E1, E2>(u, v); } //! returns u/v element-wise template<class T, int m, class E1, class E2> inline const TinyVectorDivision<T, m, E1, E2> operator /(const TinyVectorExpression<T, m, E1>& u, const TinyVectorExpression<T, m, E2>& v) { return TinyVectorDivision<T, m, E1, E2>(u, v); } //! returns u/v element-wise template<class T, int m, class E1, class E2> inline const TinyVectorDivision<complex<T>, m, E1, E2> operator /(const TinyVectorExpression<complex<T>, m, E1>& u, const TinyVectorExpression<T, m, E2>& v) { return TinyVectorDivision<complex<T>, m, E1, E2>(u, v); } //! returns u/v element-wise template<class T, int m, class E1, class E2> inline const TinyVectorDivision<complex<T>, m, E1, E2> operator /(const TinyVectorExpression<T, m, E1>& u, const TinyVectorExpression<complex<T>, m, E2>& v) { return TinyVectorDivision<complex<T>, m, E1, E2>(u, v); } //! returns alpha*u template<class T, int m, class E> inline const TinyVectorScaled<T, m, T, E> operator *(const T& alpha, const TinyVectorExpression<T, m, E>& u) { return TinyVectorScaled<T, m, T, E>(alpha, u); } //! returns alpha*u template<class T, int m, class E> inline const TinyVectorScaled<complex<T>, m, complex<T>, E> operator *(const complex<T>& alpha, const TinyVectorExpression<T, m, E>& u) { return TinyVectorScaled<complex<T>, m, complex<T>, E>(alpha, u); } //! returns alpha*u template<class T, int m, class E> inline const TinyVectorScaled<complex<T>, m, T, E> operator *(const T& alpha, const TinyVectorExpression<complex<T>, m, E>& u) { return TinyVectorScaled<complex<T>, m, T, E>(alpha, u); } //! returns u*alpha template<class T, int m, class E> inline const TinyVectorScaled<T, m, T, E> operator *(const TinyVectorExpression<T, m, E>& u, const T& alpha) { return TinyVectorScaled<T, m, T, E>(alpha, u); } //! returns u*alpha template<class T, int m, class E> inline const TinyVectorScaled<complex<T>, m, complex<T>, E> operator *(const TinyVectorExpression<T, m, E>& u, const complex<T>& alpha) { return TinyVectorScaled<complex<T>, m, complex<T>, E>(alpha, u); } //! returns u*alpha template<class T, int m, class E> inline const TinyVectorScaled<complex<T>, m, T, E> operator *(const TinyVectorExpression<complex<T>, m, E>& u, const T& alpha) { return TinyVectorScaled<complex<T>, m, T, E>(alpha, u); } //! returns alpha / u template<class T, int m, class E> inline const TinyVectorScalDiv<T, m, T, E> operator /(const T& alpha, const TinyVectorExpression<T, m, E>& u) { return TinyVectorScalDiv<T, m, T, E>(alpha, u); } //! returns alpha / u template<class T, int m, class E> inline const TinyVectorScalDiv<complex<T>, m, complex<T>, E> operator /(const complex<T>& alpha, const TinyVectorExpression<T, m, E>& u) { return TinyVectorScalDiv<complex<T>, m, complex<T>, E>(alpha, u); } //! returns alpha / u template<class T, int m, class E> inline const TinyVectorScalDiv<complex<T>, m, T, E> operator /(const T& alpha, const TinyVectorExpression<complex<T>, m, E>& u) { return TinyVectorScalDiv<complex<T>, m, T, E>(alpha, u); } //! returns u / alpha template<class T, int m, class E> inline const TinyVectorScaled<T, m, T, E> operator /(const TinyVectorExpression<T, m, E>& u, const T& alpha) { T one(1); return TinyVectorScaled<T, m, T, E>(one/alpha, u); } //! returns u / alpha template<class T, int m, class E> inline const TinyVectorScaled<complex<T>, m, complex<T>, E> operator /(const TinyVectorExpression<T, m, E>& u, const complex<T>& alpha) { T one(1); return TinyVectorScaled<complex<T>, m, complex<T>, E>(one/alpha, u); } //! returns u / alpha template<class T, int m, class E> inline const TinyVectorScaled<complex<T>, m, T, E> operator /(const TinyVectorExpression<complex<T>, m, E>& u, const T& alpha) { T one(1); return TinyVectorScaled<complex<T>, m, T, E>(one/alpha, u); } //! returns alpha + u template<class T, int m, class E> inline const TinyVectorScalSum<T, m, T, E> operator +(const T& alpha, const TinyVectorExpression<T, m, E>& u) { return TinyVectorScalSum<T, m, T, E>(alpha, u); } //! returns alpha + u template<class T, int m, class E> inline const TinyVectorScalSum<complex<T>, m, complex<T>, E> operator +(const complex<T>& alpha, const TinyVectorExpression<T, m, E>& u) { return TinyVectorScalSum<complex<T>, m, complex<T>, E>(alpha, u); } //! returns alpha + u template<class T, int m, class E> inline const TinyVectorScalSum<complex<T>, m, T, E> operator +(const T& alpha, const TinyVectorExpression<complex<T>, m, E>& u) { return TinyVectorScalSum<complex<T>, m, T, E>(alpha, u); } //! returns u + alpha template<class T, int m, class E> inline const TinyVectorScalSum<T, m, T, E> operator +(const TinyVectorExpression<T, m, E>& u, const T& alpha) { return TinyVectorScalSum<T, m, T, E>(alpha, u); } //! returns u + alpha template<class T, int m, class E> inline const TinyVectorScalSum<complex<T>, m, complex<T>, E> operator +(const TinyVectorExpression<T, m, E>& u, const complex<T>& alpha) { return TinyVectorScalSum<complex<T>, m, complex<T>, E>(alpha, u); } //! returns u + alpha template<class T, int m, class E> inline const TinyVectorScalSum<complex<T>, m, T, E> operator +(const TinyVectorExpression<complex<T>, m, E>& u, const T& alpha) { return TinyVectorScalSum<complex<T>, m, T, E>(alpha, u); } //! returns u - alpha template<class T, int m, class E> inline const TinyVectorScalSum<T, m, T, E> operator -(const TinyVectorExpression<T, m, E>& u, const T& alpha) { return TinyVectorScalSum<T, m, T, E>(-alpha, u); } //! returns u - alpha template<class T, int m, class E> inline const TinyVectorScalSum<complex<T>, m, complex<T>, E> operator -(const TinyVectorExpression<T, m, E>& u, const complex<T>& alpha) { return TinyVectorScalSum<complex<T>, m, complex<T>, E>(-alpha, u); } //! returns u - alpha template<class T, int m, class E> inline const TinyVectorScalSum<complex<T>, m, T, E> operator -(const TinyVectorExpression<complex<T>, m, E>& u, const T& alpha) { return TinyVectorScalSum<complex<T>, m, T, E>(-alpha, u); } //! returns alpha - u template<class T, int m, class E> inline const TinyVectorScalDiff<T, m, T, E> operator -(const T& alpha, const TinyVectorExpression<T, m, E>& u) { return TinyVectorScalDiff<T, m, T, E>(alpha, u); } //! returns alpha - u template<class T, int m, class E> inline const TinyVectorScalDiff<complex<T>, m, complex<T>, E> operator -(const complex<T>& alpha, const TinyVectorExpression<T, m, E>& u) { return TinyVectorScalDiff<complex<T>, m, complex<T>, E>(alpha, u); } //! returns alpha - u template<class T, int m, class E> inline const TinyVectorScalDiff<complex<T>, m, T, E> operator -(const T& alpha, const TinyVectorExpression<complex<T>, m, E>& u) { return TinyVectorScalDiff<complex<T>, m, T, E>(alpha, u); } //! returns -u template<class T, int m, class E> inline const TinyVectorOpposite<T, m, E> operator-(const TinyVectorExpression<T, m, E>& u) { return TinyVectorOpposite<T, m, E>(u); } } #define LINALG_FILE_TINY_VECTOR_EXPRESSION_INLINE_CXX #endif
[ "jafar.penot@gmail.com" ]
jafar.penot@gmail.com
badb99a546539e5e3dce7f4bda56d14fa0a9b33a
f8e2b0c22e897eb208f84878ff7074dcc171b245
/android/audio_test/samples/parselib/src/main/cpp/wav/WavStreamReader.cpp
d1576f9560d8078d7bc2443980c7a407a9ebdf04
[]
no_license
slambang/shakey-shoes
2091a9217ed794f8a9a514e8c601b8c01d8b1965
d2d9135531d142c5e3ceef1b5ec9be1261c3c406
refs/heads/master
2022-12-19T13:31:04.684800
2020-09-16T16:15:42
2020-09-16T16:15:42
285,641,247
1
0
null
2020-09-16T16:15:43
2020-08-06T18:19:11
C++
UTF-8
C++
false
false
4,739
cpp
/* * Copyright 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <algorithm> #include <string.h> #include <android/log.h> #include "stream/InputStream.h" #include "AudioEncoding.h" #include "WavRIFFChunkHeader.h" #include "WavFmtChunkHeader.h" #include "WavChunkHeader.h" #include "WavStreamReader.h" static const char *TAG = "WavStreamReader"; namespace parselib { WavStreamReader::WavStreamReader(InputStream *stream) { mStream = stream; mWavChunk = 0; mFmtChunk = 0; mDataChunk = 0; mAudioDataStartPos = -1; mChunkMap = new std::map<RiffID, WavChunkHeader *>(); } int WavStreamReader::getSampleEncoding() { if (mFmtChunk->mEncodingId == WavFmtChunkHeader::ENCODING_PCM) { switch (mFmtChunk->mSampleSize) { case 8: return AudioEncoding::PCM_8; case 16: return AudioEncoding::PCM_16; case 24: // TODO - Support 24-bit WAV data return AudioEncoding::INVALID; // for now default: return AudioEncoding::INVALID; } } else if (mFmtChunk->mEncodingId == WavFmtChunkHeader::ENCODING_IEEE_FLOAT) { return AudioEncoding::PCM_IEEEFLOAT; } return AudioEncoding::INVALID; } void WavStreamReader::parse() { RiffID tag; while (true) { int numRead = mStream->peek(&tag, sizeof(tag)); if (numRead <= 0) { break; // done } // char *tagStr = (char *) &tag; // __android_log_print(ANDROID_LOG_INFO, TAG, "[%c%c%c%c]", // tagStr[0], tagStr[1], tagStr[2], tagStr[3]); WavChunkHeader *chunk = 0; if (tag == WavRIFFChunkHeader::RIFFID_RIFF) { chunk = mWavChunk = new WavRIFFChunkHeader(tag); mWavChunk->read(mStream); } else if (tag == WavFmtChunkHeader::RIFFID_FMT) { chunk = mFmtChunk = new WavFmtChunkHeader(tag); mFmtChunk->read(mStream); } else if (tag == WavChunkHeader::RIFFID_DATA) { chunk = mDataChunk = new WavChunkHeader(tag); mDataChunk->read(mStream); // We are now positioned at the start of the audio data. mAudioDataStartPos = mStream->getPos(); mStream->advance(mDataChunk->mChunkSize); } else { chunk = new WavChunkHeader(tag); chunk->read(mStream); mStream->advance(mDataChunk->mChunkSize); // skip the body } (*mChunkMap)[tag] = chunk; } if (mDataChunk != 0) { mStream->setPos(mAudioDataStartPos); } } // Data access void WavStreamReader::positionToAudio() { if (mDataChunk != 0) { mStream->setPos(mAudioDataStartPos); } } int WavStreamReader::getDataFloat(float *buff, int numFrames) { // __android_log_print(ANDROID_LOG_INFO, TAG, "getData(%d)", numFrames); if (mDataChunk == 0 || mFmtChunk == 0) { return 0; } int totalFramesRead = 0; int numChans = mFmtChunk->mNumChannels; int buffOffset = 0; // TODO - Manage other input formats if (mFmtChunk->mSampleSize == 16) { short *readBuff = new short[128 * numChans]; int framesLeft = numFrames; while (framesLeft > 0) { int framesThisRead = std::min(framesLeft, 128); //__android_log_print(ANDROID_LOG_INFO, TAG, "read(%d)", framesThisRead); int numFramesRead = mStream->read(readBuff, framesThisRead * sizeof(short) * numChans) / (sizeof(short) * numChans); totalFramesRead += numFramesRead; // convert for (int offset = 0; offset < numFramesRead * numChans; offset++) { buff[buffOffset++] = (float) readBuff[offset] / (float) 0x7FFF; } if (numFramesRead < framesThisRead) { break; // none left } framesLeft -= framesThisRead; } delete[] readBuff; // __android_log_print(ANDROID_LOG_INFO, TAG, " returns:%d", totalFramesRead); return totalFramesRead; } return 0; } } // namespace parselib
[ "sjmillard86@gmail.com" ]
sjmillard86@gmail.com
85dce39d6185ce568c7ec4426f576feac790316f
7495e64fdc16caa575e8b2822ea42df59b664e5a
/branch/1.0.2/lib/mongo/src/mongo/bson/util/builder.h
b8027e561a206589f2e3804302c0d7afcdc570de
[ "Apache-2.0" ]
permissive
patrickpclee/codfs
dda6a8668c4e157118c7f7773676d88a2d4b0ffe
f3765f148adaecc1c45b132d2453cc74f7a2712f
refs/heads/master
2021-01-01T20:06:15.538155
2015-03-31T09:45:55
2015-03-31T09:45:55
26,440,466
11
4
null
null
null
null
UTF-8
C++
false
false
11,719
h
/* builder.h */ /* Copyright 2009 10gen 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 <cfloat> #include <iostream> #include <sstream> #include <stdio.h> #include <string> #include <string.h> #include "mongo/bson/inline_decls.h" #include "mongo/bson/stringdata.h" namespace mongo { /* Accessing unaligned doubles on ARM generates an alignment trap and aborts with SIGBUS on Linux. Wrapping the double in a packed struct forces gcc to generate code that works with unaligned values too. The generated code for other architectures (which already allow unaligned accesses) is the same as if there was a direct pointer access. */ struct PackedDouble { double d; } PACKED_DECL; /* Note the limit here is rather arbitrary and is simply a standard. generally the code works with any object that fits in ram. Also note that the server has some basic checks to enforce this limit but those checks are not exhaustive for example need to check for size too big after update $push (append) operation various db.eval() type operations */ const int BSONObjMaxUserSize = 16 * 1024 * 1024; /* Sometimes we need objects slightly larger - an object in the replication local.oplog is slightly larger than a user object for example. */ const int BSONObjMaxInternalSize = BSONObjMaxUserSize + ( 16 * 1024 ); const int BufferMaxSize = 64 * 1024 * 1024; void msgasserted(int msgid, const char *msg); template <typename Allocator> class StringBuilderImpl; class TrivialAllocator { public: void* Malloc(size_t sz) { return malloc(sz); } void* Realloc(void *p, size_t sz) { return realloc(p, sz); } void Free(void *p) { free(p); } }; class StackAllocator { public: enum { SZ = 512 }; void* Malloc(size_t sz) { if( sz <= SZ ) return buf; return malloc(sz); } void* Realloc(void *p, size_t sz) { if( p == buf ) { if( sz <= SZ ) return buf; void *d = malloc(sz); if ( d == 0 ) msgasserted( 15912 , "out of memory StackAllocator::Realloc" ); memcpy(d, p, SZ); return d; } return realloc(p, sz); } void Free(void *p) { if( p != buf ) free(p); } private: char buf[SZ]; }; template< class Allocator > class _BufBuilder { // non-copyable, non-assignable _BufBuilder( const _BufBuilder& ); _BufBuilder& operator=( const _BufBuilder& ); Allocator al; public: _BufBuilder(int initsize = 512) : size(initsize) { if ( size > 0 ) { data = (char *) al.Malloc(size); if( data == 0 ) msgasserted(10000, "out of memory BufBuilder"); } else { data = 0; } l = 0; } ~_BufBuilder() { kill(); } void kill() { if ( data ) { al.Free(data); data = 0; } } void reset() { l = 0; } void reset( int maxSize ) { l = 0; if ( maxSize && size > maxSize ) { al.Free(data); data = (char*)al.Malloc(maxSize); if ( data == 0 ) msgasserted( 15913 , "out of memory BufBuilder::reset" ); size = maxSize; } } /** leave room for some stuff later @return point to region that was skipped. pointer may change later (on realloc), so for immediate use only */ char* skip(int n) { return grow(n); } /* note this may be deallocated (realloced) if you keep writing. */ char* buf() { return data; } const char* buf() const { return data; } /* assume ownership of the buffer - you must then free() it */ void decouple() { data = 0; } void appendUChar(unsigned char j) { *((unsigned char*)grow(sizeof(unsigned char))) = j; } void appendChar(char j) { *((char*)grow(sizeof(char))) = j; } void appendNum(char j) { *((char*)grow(sizeof(char))) = j; } void appendNum(short j) { *((short*)grow(sizeof(short))) = j; } void appendNum(int j) { *((int*)grow(sizeof(int))) = j; } void appendNum(unsigned j) { *((unsigned*)grow(sizeof(unsigned))) = j; } void appendNum(bool j) { *((bool*)grow(sizeof(bool))) = j; } void appendNum(double j) { (reinterpret_cast< PackedDouble* >(grow(sizeof(double))))->d = j; } void appendNum(long long j) { *((long long*)grow(sizeof(long long))) = j; } void appendNum(unsigned long long j) { *((unsigned long long*)grow(sizeof(unsigned long long))) = j; } void appendBuf(const void *src, size_t len) { memcpy(grow((int) len), src, len); } template<class T> void appendStruct(const T& s) { appendBuf(&s, sizeof(T)); } void appendStr(const StringData &str , bool includeEndingNull = true ) { const int len = str.size() + ( includeEndingNull ? 1 : 0 ); memcpy(grow(len), str.data(), len); } /** @return length of current string */ int len() const { return l; } void setlen( int newLen ) { l = newLen; } /** @return size of the buffer */ int getSize() const { return size; } /* returns the pre-grow write position */ inline char* grow(int by) { int oldlen = l; l += by; if ( l > size ) { grow_reallocate(); } return data + oldlen; } private: /* "slow" portion of 'grow()' */ void NOINLINE_DECL grow_reallocate() { int a = 64; while( a < l ) a = a * 2; if ( a > BufferMaxSize ) { std::stringstream ss; ss << "BufBuilder attempted to grow() to " << a << " bytes, past the 64MB limit."; msgasserted(13548, ss.str().c_str()); } data = (char *) al.Realloc(data, a); if ( data == NULL ) msgasserted( 16070 , "out of memory BufBuilder::grow_reallocate" ); size = a; } char *data; int l; int size; friend class StringBuilderImpl<Allocator>; }; typedef _BufBuilder<TrivialAllocator> BufBuilder; /** The StackBufBuilder builds smaller datasets on the stack instead of using malloc. this can be significantly faster for small bufs. However, you can not decouple() the buffer with StackBufBuilder. While designed to be a variable on the stack, if you were to dynamically allocate one, nothing bad would happen. In fact in some circumstances this might make sense, say, embedded in some other object. */ class StackBufBuilder : public _BufBuilder<StackAllocator> { public: StackBufBuilder() : _BufBuilder<StackAllocator>(StackAllocator::SZ) { } void decouple(); // not allowed. not implemented. }; namespace { #if defined(_WIN32) int (*mongo_snprintf)(char *str, size_t size, const char *format, ...) = &sprintf_s; #else int (*mongo_snprintf)(char *str, size_t size, const char *format, ...) = &snprintf; #endif } /** stringstream deals with locale so this is a lot faster than std::stringstream for UTF8 */ template <typename Allocator> class StringBuilderImpl { public: static const size_t MONGO_DBL_SIZE = 3 + DBL_MANT_DIG - DBL_MIN_EXP; static const size_t MONGO_S32_SIZE = 12; static const size_t MONGO_U32_SIZE = 11; static const size_t MONGO_S64_SIZE = 23; static const size_t MONGO_U64_SIZE = 22; static const size_t MONGO_S16_SIZE = 7; StringBuilderImpl() { } StringBuilderImpl& operator<<( double x ) { return SBNUM( x , MONGO_DBL_SIZE , "%g" ); } StringBuilderImpl& operator<<( int x ) { return SBNUM( x , MONGO_S32_SIZE , "%d" ); } StringBuilderImpl& operator<<( unsigned x ) { return SBNUM( x , MONGO_U32_SIZE , "%u" ); } StringBuilderImpl& operator<<( long x ) { return SBNUM( x , MONGO_S64_SIZE , "%ld" ); } StringBuilderImpl& operator<<( unsigned long x ) { return SBNUM( x , MONGO_U64_SIZE , "%lu" ); } StringBuilderImpl& operator<<( long long x ) { return SBNUM( x , MONGO_S64_SIZE , "%lld" ); } StringBuilderImpl& operator<<( unsigned long long x ) { return SBNUM( x , MONGO_U64_SIZE , "%llu" ); } StringBuilderImpl& operator<<( short x ) { return SBNUM( x , MONGO_S16_SIZE , "%hd" ); } StringBuilderImpl& operator<<( char c ) { _buf.grow( 1 )[0] = c; return *this; } void appendDoubleNice( double x ) { const int prev = _buf.l; const int maxSize = 32; char * start = _buf.grow( maxSize ); int z = mongo_snprintf( start , maxSize , "%.16g" , x ); verify( z >= 0 ); verify( z < maxSize ); _buf.l = prev + z; if( strchr(start, '.') == 0 && strchr(start, 'E') == 0 && strchr(start, 'N') == 0 ) { write( ".0" , 2 ); } } void write( const char* buf, int len) { memcpy( _buf.grow( len ) , buf , len ); } void append( const StringData& str ) { memcpy( _buf.grow( str.size() ) , str.data() , str.size() ); } StringBuilderImpl& operator<<( const StringData& str ) { append( str ); return *this; } void reset( int maxSize = 0 ) { _buf.reset( maxSize ); } std::string str() const { return std::string(_buf.data, _buf.l); } int len() const { return _buf.l; } private: _BufBuilder<Allocator> _buf; // non-copyable, non-assignable StringBuilderImpl( const StringBuilderImpl& ); StringBuilderImpl& operator=( const StringBuilderImpl& ); template <typename T> StringBuilderImpl& SBNUM(T val,int maxSize,const char *macro) { int prev = _buf.l; int z = mongo_snprintf( _buf.grow(maxSize) , maxSize , macro , (val) ); verify( z >= 0 ); verify( z < maxSize ); _buf.l = prev + z; return *this; } }; typedef StringBuilderImpl<TrivialAllocator> StringBuilder; typedef StringBuilderImpl<StackAllocator> StackStringBuilder; } // namespace mongo
[ "windkithk@gmail.com" ]
windkithk@gmail.com
2f26cea3b22de8ca32f5eeff662c0e67396dd63c
ab9703d14c27e4a5d0d0b183ff48b98fe4d2f605
/library1/bar1.hpp
b025f279e99c0903aa19a5074afe102810ed4b32
[]
no_license
Palmik/Boost-Build-Sample-Project
c2c3cba0b26643d9689cc19b59d7e9e6856d3500
fd0cff36d7c86f562e1f1f42bca18bd4caa2243d
refs/heads/master
2020-06-11T20:45:11.621089
2011-11-28T20:50:14
2011-11-28T20:50:14
2,869,688
0
0
null
null
null
null
UTF-8
C++
false
false
97
hpp
#ifndef BAR_1_HPP #define BAR_1_HPP inline int bar1(int a, int b) { return a + b; } #endif
[ "email@palmik.net" ]
email@palmik.net
022cc47d76b364d886a4e7fcbc4eeee5d8873562
9c8357e69b4257477187d679cecc907502cabb59
/gao/test/test--1.cpp
59ff2b7578f451391726f9d1b9877dca07d05b76
[]
no_license
david2du/david_training
20807bc0fd9d9c528cfaf36ade2f168fa8da6395
a569e6eb13c4d83b6645f4c892355527570220a0
refs/heads/master
2022-12-13T13:55:45.397271
2022-12-03T00:17:49
2022-12-03T00:17:49
233,592,317
0
0
null
null
null
null
UTF-8
C++
false
false
123
cpp
#include<iostream> #include <map> using namespace std; int main(int argc, char const *argv[]) { return 0; }
[ "david2du@163.com" ]
david2du@163.com
b535a82d7685cffee486b790a5fd7e99e8063d0f
1f0e52daa702a442db609766a56f99f833368a6b
/分类/动态规划复习+网络流/hdu6290(最短路).cpp
12e674f802c120be3502f9e58cdd12b8709840f1
[]
no_license
TouwaErioH/Algorithm
e0495b053e6f33353a4e526955cd269d2acc0027
a5851529168a68147ab548678c16251f6dfa017d
refs/heads/master
2022-12-07T03:46:50.674787
2020-08-20T08:45:49
2020-08-20T08:45:49
null
0
0
null
null
null
null
GB18030
C++
false
false
1,963
cpp
#include <algorithm> #include <iostream> #include <cstring> #include <cstdio> #include <cmath> #include <queue> #include <vector> using namespace std; const int maxn = 1000050; const long long INF = 1ll<<61; //这里一开始用了0x3f3f3f3f...sb了 struct qnode { int v; long long c; qnode(int v=0,long long c=0):v(v),c(c){} bool operator <(const qnode &r)const { return c>r.c; } }; struct Edge { int to; int w,MIN; Edge(int to,int w,int MIN):to(to),w(w),MIN(MIN){} }; vector<Edge>E[maxn]; bool vis[maxn]; long long dis[maxn]; void Dijstra(int n,int start) { memset(vis,false,sizeof(vis)); //nima,一开始赋值成-1了.... for(int i=1;i<=n;i++) dis[i] = INF; priority_queue<qnode> que; while(!que.empty()) que.pop(); dis[start] = true; que.push(qnode(start,1)); qnode tmp; while(!que.empty()) { tmp = que.top(); que.pop(); int u = tmp.v; if(vis[u]) continue; vis[u] = 1; for(int i=0;i<E[u].size();i++) { int v = E[u][i].to; int a = E[u][i].w; if(log2((dis[u]+a*1.0) / dis[u]*1.0)<E[u][i].MIN) //if((a/dis[u])<E[u][i].MIN) //这里不乘1.0也可以 continue; if(!vis[v]&&dis[v]>dis[u]+a) //这里的!VIS重要 { dis[v] = dis[u] + a; que.push(qnode(v,dis[v])); } } } if(dis[n]==INF) printf("-1\n"); else printf("%d\n",(int)log2(dis[n]*1.0)); } int main() { int t,m,u,v,n; int a,b; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) E[i].clear(); for(int i=0;i<m;i++) { scanf("%d%d%d%d",&u,&v,&a,&b); //b=(1ll<<b)-1; E[u].push_back(Edge(v,a,b)); } Dijstra(n,1); } return 0; }
[ "1301004462@qq.com" ]
1301004462@qq.com
bc76333fbcc9edeb8bdb3176e301eb0aa42caa8e
5e5bc15f26ded4dccef9ee36d0e4ef1a5007c755
/bachelor/year2/graphical/MUL_arcade_2021/include/Data.hpp
29dc798892e22ea955f5315726d4b821cd29b9f5
[]
no_license
raphaelemquies/EpitechBachelor
3b5edd7857d75c73d9389a079343dcb4bd0c63b7
2630f4603cb7d5e8d52ef00bce08aa247a27be1e
refs/heads/main
2023-04-12T06:39:45.687422
2021-05-09T13:26:56
2021-05-09T13:26:56
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,322
hpp
/* ** EPITECH PROJECT, 2021 ** arcade ** File description: ** data */ #ifndef DATA_HPP #define DATA_HPP #include <string> #include <iostream> #include <map> #include <vector> #include <string> class Data { public: Data(); virtual ~Data(); // const std::map<std::string, ISymbole> &getSymbole() const; const int &getInstance() const; void setInstance(int inst); const std::vector<std::string> &getMap() const; const std::vector<std::string> &getNibblerMap() const; void setMap(std::vector<std::string> _new); void setNibblerMap(std::vector<std::string> _new); const std::map<std::string, std::pair<std::size_t, std::size_t>> &getText() const; const std::map<std::string, std::pair<std::size_t, std::size_t>> &getNibblerText() const; const std::vector<std::string> initMap(); const std::vector<std::string> initNibblerMap(); const std::map<std::string, std::pair<std::size_t, std::size_t>> initText(); const std::map<std::string, std::pair<std::size_t, std::size_t>> initNibblerText(); void setgameSelected(std::string game); const std::map<int, int> &getScore() const; const int &getPacmanScore() const; const int &getNibblerScore() const; const std::string &getPlayerName() const; void setScore(int pacman, int nibbler); void setPlayerName(std::string name); void setPlayerNameC(char character); void removeLplayerName(); void resetScore(int pacman, int nibbler); void removeInstance(int inst); int index; int openW; int openS; bool firstTime; bool secondTime; bool isGameLaunched; std::string gameSelected; bool isNcurse; int rand; protected: private: int _instance; int pacmanScore; int nibblerScore; std::map<int, int> _score; std::string _playerName; std::vector<std::string> _map; std::vector<std::string> _nibblerMap; std::map<std::string, std::pair<std::size_t, std::size_t>> _text; std::map<std::string, std::pair<std::size_t, std::size_t>> _textNibbler; }; #endif /* !DATA_HPP */
[ "noe.campo@epitech.eu" ]
noe.campo@epitech.eu
0d20934563561d1b278bd46d665a3526acaaca09
f80b83c3c9a6742e3aa0ffc440e874e91dcc3b05
/CopyControl_2/src/function.cpp
79f902e87b00379936e29f62acf143a7daf182be
[]
no_license
JustinKin/CPrimer
37ca2841e8775da34ced273fd620b3eb13236148
7c956dbb2e53975edb39d02293f6a215eb6c09d6
refs/heads/master
2022-12-27T09:07:20.100740
2020-10-14T06:36:10
2020-10-14T06:36:10
301,260,461
0
0
null
null
null
null
UTF-8
C++
false
false
3,128
cpp
#include <iostream> #include <fstream> #include <sstream> #include <string> #include <vector> #include <list> #include <forward_list> #include <algorithm> #include <functional> #include <iterator> #include <map> #include <set> #include <utility> #include <memory> #include "STRVEC.H" #include "MYSTRVEC.H" using namespace std; void StrVec::push_back(const std::string& s) { chk_n_alloc(); alloc.construct(first_free++, s); } std::pair<std::string*, std::string*> StrVec::alloc_n_copy(const std::string* b, const std::string* e) { auto data = alloc.allocate( e - b ); return { data, uninitialized_copy(b, e, data) }; } void StrVec::free() { if(elements) { for(auto p = first_free; p != elements; ) { alloc.destroy(--p); } alloc.deallocate(elements,cap - elements); } } StrVec::StrVec(const StrVec& s) { auto newdata =alloc_n_copy(s.begin(),s.end()); elements = newdata.first; first_free = cap = newdata.second; } StrVec::~StrVec() { free(); } StrVec &StrVec::operator=(const StrVec& rhs) { auto data = alloc_n_copy(rhs.begin(),rhs.end()); free(); elements = data.first; first_free = cap = data.second; return *this; } void StrVec::reallocate() { auto newcapacity = size() ? 2*size() : 1; auto newdata = alloc.allocate(newcapacity); auto dest = newdata; auto elem = elements; for(size_t i=0; i!=size(); ++i) alloc.construct(dest++,std::move(*elem++)); free(); elements = newdata; first_free =dest; cap = elements + newcapacity; } void MyStrVec::mpush_back(const std::string& s_ ) { mchk_n_alloc(); malloc.construct(mtail_freehead++,s_); } std::pair<std::string*, std::string*> MyStrVec::malloc_n_copy(const std::string* b_, const std::string* e_) { auto data = malloc.allocate(e_ - b_); auto end_ = uninitialized_copy(b_,e_,data); return { data, end_ }; } void MyStrVec::mfree() { if(mhead) { for(auto p = mtail_freehead; p != mhead;) { malloc.destroy(--p); } malloc.deallocate(mhead,mcap- mhead); } /* if(mhead) { for_each(mhead,mtail_freehead,[this](string& p){ malloc.destroy(&p);}); malloc.deallocate(mhead,mcap - mhead); } */} MyStrVec::MyStrVec(const MyStrVec& msv) { auto newdata = malloc_n_copy(msv.mbegin(),msv.mend()); mhead = newdata.first; mtail_freehead = newdata.second; mcap = newdata.second; } MyStrVec &MyStrVec::operator=(const MyStrVec& msv) { auto data = malloc_n_copy(msv.mbegin(),msv.mend()); mfree(); mhead = data.first; mtail_freehead = data.second; mcap = data.second; return *this; } MyStrVec::~MyStrVec() { mfree(); } void MyStrVec::mreallocate() { auto newcapacity = msize()? 2*msize(): 1; auto newdata = malloc.allocate(newcapacity); auto dest = newdata; auto elem = mhead; for(size_t i = 0; i != msize(); ++i) malloc.construct(dest++,std::move(*elem++)); mfree(); mhead = newdata; mtail_freehead = dest; mcap = mhead + newcapacity; }
[ "justinkin2020@outlook.com" ]
justinkin2020@outlook.com
464a1d4899afd498845abe6c543d60b32a71d502
7336bcbc0344996592a0580ccf75685f5bfcd90b
/C++项目——磁盘文件管理工具/C++项目——磁盘文件管理工具/fileutil.cpp
2828a01309931a096b73c3e07d28ee6856ce81fa
[]
no_license
Jamesuhao/C-
18c82319c8df5c2894a17edbe4aa1dccd8e769d1
30e1434f4d477c25361cbcfd6086c83acc5542e5
refs/heads/master
2020-08-25T08:51:08.155105
2020-04-16T05:11:53
2020-04-16T05:11:53
205,066,942
0
0
null
null
null
null
GB18030
C++
false
false
969
cpp
#include"fileManage.h" #include"fileutil.h" #include"MD5.h" void searchDir(const std::string& path, std::unordered_set<std::string>& subFiles) { std::string matchFile = path + "\\" + "*.*"; _finddata_t fileAttr; long handle = _findfirst(matchFile.c_str(), &fileAttr); if (handle == -1) { perror("search failed!"); std::cout << matchFile << std::endl; return; } do { //当前为目录,继续搜索 if (fileAttr.attrib & _A_SUBDIR) { if (strcmp(fileAttr.name, ".") != 0 && strcmp(fileAttr.name, "..") != 0) { searchDir(path + "\\" + fileAttr.name, subFiles); } } //当前不是目录,保存文件名 else { subFiles.insert(path + "\\" + fileAttr.name); } } while (_findnext(handle, &fileAttr) == 0); _findclose(handle); } void deleteFile(const char* filename) { if (remove(filename) == 0) { std::cout << "delete file:" << filename << ":success。" << std::endl; } else { perror("delete file failed!"); } }
[ "1766727840@qq.com" ]
1766727840@qq.com
b6a6c4a0a957261314a61724bf6ea7d7a8f16f05
70ea64c522d12dad3d50443854ce869e019d2ca2
/Game/Item/WallBlock.cpp
e450434d7a0aff25940ed2d8a843b8284b1c1c1b
[]
no_license
clxhtm456/DirectX2D
ea88afabaecc81600addd8cd14924b0630327b60
4c7027cb061008e962ed8ddd3c38c1216cf72de7
refs/heads/master
2022-11-05T05:28:44.377906
2020-07-01T15:32:03
2020-07-01T15:32:03
276,414,762
0
0
null
null
null
null
UTF-8
C++
false
false
2,931
cpp
#include "stdafx.h" #include "WallBlock.h" WallBlock * WallBlock::Create() { WallBlock* pRet = new WallBlock(); if (pRet && pRet->Init()) { pRet->autorelease(); } else { delete pRet; pRet = nullptr; } return pRet; } bool WallBlock::Init() { if (!__super::Init()) return false; topcol = true; bottomcol = true; rightcol = true; leftcol = true; recentPos = D3DXVECTOR2(0, 0); return true; } WallBlock::~WallBlock() { for (auto col : collisionList) { //ExitCollisionAll(col); ExitPhysicsCollision(col); } } void WallBlock::Update() { D3DXVECTOR2 delta = NormalizedPosition() - recentPos; recentPos = NormalizedPosition(); for (auto iter = directionList.begin(); iter != directionList.end(); iter++) { if ((*iter).first->GetKinematic() == true) continue; switch ((*iter).second) { case UP: { auto position = (*iter).first->Position(); (*iter).first->Position(position+delta); } break; case RIGHT: { if (delta.x > 0) { auto position = (*iter).first->Position(); (*iter).first->Position(position.x + delta.x,position.y); } } break; case LEFT: { if (delta.x < 0) { auto position = (*iter).first->Position(); (*iter).first->Position(position.x + delta.x, position.y); } } break; } } PhysicsObject::Update(); } void WallBlock::EnterPhysicsCollision(PhysicsObject * b, ColDirection direction) { /*b->ObjBottomCollision(false); b->ObjTopCollision(false); b->ObjLeftCollision(false); b->ObjRightCollision(false);*/ switch (direction) { case UP: if(topcol) b->ObjBottomCollision(true); break; case DOWN: if(bottomcol) b->ObjTopCollision(true); break; case RIGHT: if(rightcol) b->ObjLeftCollision(true); break; case LEFT: if(leftcol) b->ObjRightCollision(true); break; default: break; } directionList.push_back(pair<PhysicsObject *, ColDirection>(b, direction)); } void WallBlock::ExitPhysicsCollision(PhysicsObject * b) { for (auto iter = directionList.begin(); iter != directionList.end(); iter++) { if ((*iter).first == b) { switch ((*iter).second) { case UP: b->ObjBottomCollision(false); break; case DOWN: b->ObjTopCollision(false); break; case RIGHT: b->ObjLeftCollision(false); break; case LEFT: b->ObjRightCollision(false); break; } iter = directionList.erase(iter); break; } } } void WallBlock::OnPhysicsCollision(PhysicsObject* b, ColDirection direction) { /*b->ObjBottomCollision(false); b->ObjTopCollision(false); b->ObjLeftCollision(false); b->ObjRightCollision(false); switch (direction) { case UP: if (topcol) b->ObjBottomCollision(true); break; case DOWN: if (bottomcol) b->ObjTopCollision(true); break; case RIGHT: if (rightcol) b->ObjLeftCollision(true); break; case LEFT: if (leftcol) b->ObjRightCollision(true); break; default: break; }*/ }
[ "gunwoo11@naver.com" ]
gunwoo11@naver.com
8061456fc7a4751eee325f7f05d6a2d0f6a282b3
d0854e5c576abc3798fd7b869d256ae026cd49de
/src/yawiel/prereqs.hpp
ed58a48ccb0e490cd9c0fdc97c95a7f69a3963ab
[ "Apache-2.0" ]
permissive
yawiel/yawiel
f7891472fda8430a231d3c7f70a008d2cc5025c4
7da5900b3ae5bb92cd2b56fd1b0f13dae205897c
refs/heads/master
2020-04-27T19:45:25.378091
2019-04-11T17:55:09
2019-04-11T17:55:09
174,632,356
0
0
null
null
null
null
UTF-8
C++
false
false
125
hpp
#ifndef YAWIEL_PREREQS_HPP #define YAWIEL_PREREQS_HPP // Add standard libraries. #include <string> #include <cmath> #endif
[ "robertohueso96@gmail.com" ]
robertohueso96@gmail.com
5e01e1ba182938d15258e465bcd08eab0e55099a
e1071cd8065ed01b8bc42f5f47f964837ec723b8
/src/ripple/protocol/impl/STInteger.cpp
adcdfefe4ddd1298f2053c11f8ab55bd38ae6758
[ "MIT-Wu", "MIT", "ISC", "BSL-1.0" ]
permissive
SAN-CHAIN/sand
07355acf0ba4607a5cb1408a1d86d87f03e3a317
1c51a7d1b215a7a2e1e06bd3b87a7e1da7239664
refs/heads/master
2020-06-22T01:27:21.168067
2016-10-15T11:22:18
2016-10-15T11:22:18
94,208,495
0
3
null
null
null
null
UTF-8
C++
false
false
4,857
cpp
//------------------------------------------------------------------------------ /* This file is part of rippled: https://github.com/ripple/rippled Copyright (c) 2012, 2013 Ripple Labs Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ //============================================================================== #include <BeastConfig.h> #include <ripple/basics/Log.h> #include <ripple/basics/StringUtilities.h> #include <ripple/protocol/LedgerFormats.h> #include <ripple/protocol/STInteger.h> #include <ripple/protocol/TxFormats.h> #include <ripple/protocol/TER.h> #include <beast/module/core/text/LexicalCast.h> namespace ripple { template<> STInteger<unsigned char>::STInteger(SerialIter& sit, SField const& name) : STInteger(name, sit.get8()) { } template <> SerializedTypeID STUInt8::getSType () const { return STI_UINT8; } template <> std::string STUInt8::getText () const { if (getFName () == sfTransactionResult) { std::string token, human; if (transResultInfo (static_cast<TER> (value_), token, human)) return human; } return beast::lexicalCastThrow <std::string> (value_); } template <> Json::Value STUInt8::getJson (int) const { if (getFName () == sfTransactionResult) { std::string token, human; if (transResultInfo (static_cast<TER> (value_), token, human)) return token; else WriteLog (lsWARNING, STBase) << "Unknown result code in metadata: " << value_; } return value_; } //------------------------------------------------------------------------------ template<> STInteger<std::uint16_t>::STInteger(SerialIter& sit, SField const& name) : STInteger(name, sit.get16()) { } template <> SerializedTypeID STUInt16::getSType () const { return STI_UINT16; } template <> std::string STUInt16::getText () const { if (getFName () == sfLedgerEntryType) { auto item = LedgerFormats::getInstance ().findByType ( static_cast <LedgerEntryType> (value_)); if (item != nullptr) return item->getName (); } if (getFName () == sfTransactionType) { auto item =TxFormats::getInstance().findByType ( static_cast <TxType> (value_)); if (item != nullptr) return item->getName (); } return beast::lexicalCastThrow <std::string> (value_); } template <> Json::Value STUInt16::getJson (int) const { if (getFName () == sfLedgerEntryType) { auto item = LedgerFormats::getInstance ().findByType ( static_cast <LedgerEntryType> (value_)); if (item != nullptr) return item->getName (); } if (getFName () == sfTransactionType) { auto item = TxFormats::getInstance().findByType ( static_cast <TxType> (value_)); if (item != nullptr) return item->getName (); } return value_; } //------------------------------------------------------------------------------ template<> STInteger<std::uint32_t>::STInteger(SerialIter& sit, SField const& name) : STInteger(name, sit.get32()) { } template <> SerializedTypeID STUInt32::getSType () const { return STI_UINT32; } template <> std::string STUInt32::getText () const { return beast::lexicalCastThrow <std::string> (value_); } template <> Json::Value STUInt32::getJson (int) const { return value_; } //------------------------------------------------------------------------------ template<> STInteger<std::uint64_t>::STInteger(SerialIter& sit, SField const& name) : STInteger(name, sit.get64()) { } template <> SerializedTypeID STUInt64::getSType () const { return STI_UINT64; } template <> std::string STUInt64::getText () const { return beast::lexicalCastThrow <std::string> (value_); } template <> Json::Value STUInt64::getJson (int) const { return strHex (value_); } } // ripple
[ "nemox1024@hotmail.com" ]
nemox1024@hotmail.com
99e2b7646834c24885bde0158ea898681a992715
2d396ff108c97978b15c1a691755d6987ab640ee
/calculadora/Project1/Project1/MyForm.cpp
df2990b7dd4a418d208de59bd3afdad710be7dde
[ "MIT" ]
permissive
amauris59/Calculadora
2d4656b7dc521f207ca1713c6f9408c1bf7370b3
f7280b08245b6eb136561425ff49c7a369f5c943
refs/heads/master
2021-08-30T00:45:40.137656
2017-12-15T12:10:54
2017-12-15T12:10:54
114,364,698
0
0
null
null
null
null
UTF-8
C++
false
false
274
cpp
#include "MyForm.h" using namespace System; using namespace System::Windows::Forms; [STAThread] void main(array<String^>^ arg) { Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); Project1::MyForm form; Application::Run(%form); }
[ "amauris59@gmail.com" ]
amauris59@gmail.com
382c84071b2c786753ac8ea5c54acc8b499732a2
70167bb550f89cb49faebc11328efd8bcda73078
/cpp/src/example_source.cpp
c91418b2a6d2ec6e19a006cf7fa96de1c67a5fe0
[]
no_license
ocean1211/deep-slam
a8ad8092646fa45e493bfd12bc6f5c2b8bd12ae7
33864e09d88003dbdfa3bb43599f47388671f440
refs/heads/master
2021-08-20T02:41:54.235251
2017-11-28T01:56:28
2017-11-28T01:56:28
null
0
0
null
null
null
null
UTF-8
C++
false
false
37
cpp
#include <deep_slam/example_header.h>
[ "slonegg@gmail.com" ]
slonegg@gmail.com
1e86ccab29904bbced6c7f076c1ed4d73f2b214f
37a8f6d531b85ba2a96007d00bee202cb5bb483e
/src/slam-dataset-generation/lib/libsimulator/obstacle/ObstacleEdge.cpp
e349c8d528b05c857d38b44aeb329865161308ee
[]
no_license
OSLL/slam-dataset-generation
0e8aa799cbeb06e49384bee541717a34a2bcbda7
46de9784553ed514cee4299c95719be1ad48db52
refs/heads/master
2020-03-19T09:42:41.139721
2018-09-13T09:01:54
2018-09-13T09:01:54
136,311,821
0
0
null
null
null
null
UTF-8
C++
false
false
2,555
cpp
#include "obstacle/ObstacleEdge.h" using std::ostream; using std::cout; using std::endl; using std::set; ObstacleEdge::ObstacleEdge(const Vec & start_point, const Vec & end_point) : start(start_point), end(end_point) { } static double closest_distance(const Vec & p, const set<Vec> & s) { if (!s.empty()) { // Obtain iterator to set (guaranteed to have at least one element) set<Vec>::iterator i = s.begin(); // Start by assuming closest distance is the first element of the set and advance iterator double result = (*i - p).mag(); i++; // Loop over rest of set (if it exists) to determine actual closest distance for (; i != s.end(); i++) { // Get distance between p and this particular intersection point double distance = (*i - p).mag(); if (distance < result) { result = distance; } } return result; } else { return -1.0; } } double ObstacleEdge::distance(const Vec & edge_offset, const ObservationPath & op) const { set<Vec> path_intersection_points = intersection_points(edge_offset, op); return closest_distance(op.start, path_intersection_points); } std::set<Vec> ObstacleEdge::intersection_points(const Vec & edge_offset, const ObservationPath & op) const { // Obtain set of intersection points as though op was a Line set<Vec> line_intersection_points = linear_intersection_points(edge_offset, op); // If op has a filtering function, then perform filtering on the set if (op.on_path != nullptr) { for (auto itr = line_intersection_points.cbegin(); itr != line_intersection_points.cend();) { if (!op.on_path(*itr, op)) { //cout << "Point " << *itr << " is not on path " << op << ". Filtering out..." << endl; itr = line_intersection_points.erase(itr); } else { itr++; } } } return line_intersection_points; } // For some edge types, the only way to find the number of intersections // is to analytically find all intersection points and count them // // If there is a faster way for a particular edge type to accomplish this, // these are virtual and can be defined in a subclass int ObstacleEdge::number_of_intersections(const Vec & edge_offset, const ObservationPath & op) const { return intersection_points(edge_offset, op).size(); } void ObstacleEdge::print(ostream & o, int tabs) const { // Print out the correct number of tabs for (int i = 0; i < tabs; i++) { cout << '\t'; } // Print edge information o << "ObstacleEdge: " << start << " -> " << end; } ostream & operator<<(ostream & o, const ObstacleEdge & e) { e.print(o); return o; }
[ "jwhitton@mit.edu" ]
jwhitton@mit.edu
4a2aba11a1b7374b4d7fdb09dfa903287259a4cc
ba845ff3a728fe80653f947ac59fd086dc0097ab
/ACM/[USACO]Twofive_记忆化搜索.cpp
b8861001a6b281328a091b333df4caad0761d8b4
[]
no_license
Legend94rz/OJCodes
0d4e81adc4e18403cdbdc5461bac2e1cb246b92c
840825c32ffec8d1043a7fb3a3319edca00c1ab8
refs/heads/master
2021-06-28T02:19:37.684824
2019-06-29T02:15:57
2019-06-29T02:15:57
153,983,815
0
0
null
null
null
null
UTF-8
C++
false
false
1,498
cpp
/* ID: rz109291 PROG: twofive LANG: C++ */ #include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <memory.h> using namespace std; char cr; int N; int f[6][6][6][6][6]; string W; char ans[26]; bool ok(int p, char c) { return (ans[p] == 0 || ans[p] == c); } int dfs(int a, int b, int c, int d, int e, char now) { if (now == 'Z')return 1; if (f[a][b][c][d][e] > 0) return f[a][b][c][d][e]; int res = f[a][b][c][d][e]; if (a < 5 && ok(a, now)) res += dfs(a + 1, b, c, d, e, now + 1); if (b < a && ok(b + 5, now)) res += dfs(a, b + 1, c, d, e, now + 1); if (c < b && ok(c + 10, now)) res += dfs(a, b, c + 1, d, e, now + 1); if (d < c && ok(d + 15, now)) res += dfs(a, b, c, d + 1, e, now + 1); if (e < d && ok(e + 20, now)) res += dfs(a, b, c, d, e + 1, now + 1); f[a][b][c][d][e] = res; return res; } int main() { freopen("twofive.in", "r", stdin); freopen("twofive.out", "w", stdout); cin >> cr; int tmp=0; if (cr == 'N') { cin >> N; //map int -> string for (int i = 0; i < 25; i++) { for (ans[i] = 'A'; ; ans[i]++) { memset(f, 0, sizeof(f)); if ((tmp = dfs(0, 0, 0, 0, 0, 'A')) < N) N -= tmp; else break; } } printf("%s\n", ans); } else { cin >> W; //map string -> int for (int i = 0; i < W.length(); i++) { for (ans[i] = 'A'; ans[i]<W[i]; ans[i]++) { memset(f, 0, sizeof(f)); tmp += dfs(0, 0, 0, 0, 0, 'A'); } } cout << tmp+1 << endl; } fclose(stdin); fclose(stdout); }
[ "Legend94rz@gmail.com" ]
Legend94rz@gmail.com
e7e0e792f71d82a202859dc7bf07ca8c4cdca96a
9a09d8be7393906a73e35bb404ba99c121c48470
/Chapter09/chapter9/cm/cm-lib/build/windows/gcc/x86/debug/.moc/moc_master-controller.cpp
adf5677c426d731afccb1cc2bcaeb56bf253a926
[ "MIT" ]
permissive
PacktPublishing/Learn-Qt-5
d3260f34473d5970f17584656044fcb68a1bdc1a
ec768c3f6503eee1c77c62319cbb130e978380ec
refs/heads/master
2023-02-10T02:30:06.844485
2023-01-30T09:16:48
2023-01-30T09:16:48
119,801,529
81
42
null
null
null
null
UTF-8
C++
false
false
9,683
cpp
/**************************************************************************** ** Meta object code from reading C++ file 'master-controller.h' ** ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.10.0) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../../../../../../source/controllers/master-controller.h" #include <QtCore/qbytearray.h> #include <QtCore/qmetatype.h> #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'master-controller.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 67 #error "This file was generated using the moc from 5.10.0. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_cm__controllers__MasterController_t { QByteArrayData data[21]; char stringdata0[418]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ qptrdiff(offsetof(qt_meta_stringdata_cm__controllers__MasterController_t, stringdata0) + ofs \ - idx * sizeof(QByteArrayData)) \ ) static const qt_meta_stringdata_cm__controllers__MasterController_t qt_meta_stringdata_cm__controllers__MasterController = { { QT_MOC_LITERAL(0, 0, 33), // "cm::controllers::MasterContro..." QT_MOC_LITERAL(1, 34, 17), // "rssChannelChanged" QT_MOC_LITERAL(2, 52, 0), // "" QT_MOC_LITERAL(3, 53, 12), // "selectClient" QT_MOC_LITERAL(4, 66, 19), // "cm::models::Client*" QT_MOC_LITERAL(5, 86, 6), // "client" QT_MOC_LITERAL(6, 93, 18), // "onRssReplyReceived" QT_MOC_LITERAL(7, 112, 10), // "statusCode" QT_MOC_LITERAL(8, 123, 4), // "body" QT_MOC_LITERAL(9, 128, 17), // "ui_welcomeMessage" QT_MOC_LITERAL(10, 146, 23), // "ui_navigationController" QT_MOC_LITERAL(11, 170, 39), // "cm::controllers::INavigationC..." QT_MOC_LITERAL(12, 210, 20), // "ui_commandController" QT_MOC_LITERAL(13, 231, 36), // "cm::controllers::ICommandCont..." QT_MOC_LITERAL(14, 268, 21), // "ui_databaseController" QT_MOC_LITERAL(15, 290, 37), // "cm::controllers::IDatabaseCon..." QT_MOC_LITERAL(16, 328, 12), // "ui_newClient" QT_MOC_LITERAL(17, 341, 15), // "ui_clientSearch" QT_MOC_LITERAL(18, 357, 25), // "cm::models::ClientSearch*" QT_MOC_LITERAL(19, 383, 13), // "ui_rssChannel" QT_MOC_LITERAL(20, 397, 20) // "cm::rss::RssChannel*" }, "cm::controllers::MasterController\0" "rssChannelChanged\0\0selectClient\0" "cm::models::Client*\0client\0" "onRssReplyReceived\0statusCode\0body\0" "ui_welcomeMessage\0ui_navigationController\0" "cm::controllers::INavigationController*\0" "ui_commandController\0" "cm::controllers::ICommandController*\0" "ui_databaseController\0" "cm::controllers::IDatabaseController*\0" "ui_newClient\0ui_clientSearch\0" "cm::models::ClientSearch*\0ui_rssChannel\0" "cm::rss::RssChannel*" }; #undef QT_MOC_LITERAL static const uint qt_meta_data_cm__controllers__MasterController[] = { // content: 7, // revision 0, // classname 0, 0, // classinfo 3, 14, // methods 7, 38, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 1, // signalCount // signals: name, argc, parameters, tag, flags 1, 0, 29, 2, 0x06 /* Public */, // slots: name, argc, parameters, tag, flags 3, 1, 30, 2, 0x0a /* Public */, 6, 2, 33, 2, 0x0a /* Public */, // signals: parameters QMetaType::Void, // slots: parameters QMetaType::Void, 0x80000000 | 4, 5, QMetaType::Void, QMetaType::Int, QMetaType::QByteArray, 7, 8, // properties: name, type, flags 9, QMetaType::QString, 0x00095401, 10, 0x80000000 | 11, 0x00095409, 12, 0x80000000 | 13, 0x00095409, 14, 0x80000000 | 15, 0x00095409, 16, 0x80000000 | 4, 0x00095409, 17, 0x80000000 | 18, 0x00095409, 19, 0x80000000 | 20, 0x00495009, // properties: notify_signal_id 0, 0, 0, 0, 0, 0, 0, 0 // eod }; void cm::controllers::MasterController::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { MasterController *_t = static_cast<MasterController *>(_o); Q_UNUSED(_t) switch (_id) { case 0: _t->rssChannelChanged(); break; case 1: _t->selectClient((*reinterpret_cast< cm::models::Client*(*)>(_a[1]))); break; case 2: _t->onRssReplyReceived((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< QByteArray(*)>(_a[2]))); break; default: ; } } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { switch (_id) { default: *reinterpret_cast<int*>(_a[0]) = -1; break; case 1: switch (*reinterpret_cast<int*>(_a[1])) { default: *reinterpret_cast<int*>(_a[0]) = -1; break; case 0: *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< cm::models::Client* >(); break; } break; } } else if (_c == QMetaObject::IndexOfMethod) { int *result = reinterpret_cast<int *>(_a[0]); { typedef void (MasterController::*_t)(); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MasterController::rssChannelChanged)) { *result = 0; return; } } } else if (_c == QMetaObject::RegisterPropertyMetaType) { switch (_id) { default: *reinterpret_cast<int*>(_a[0]) = -1; break; case 2: *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< cm::controllers::ICommandController* >(); break; case 3: *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< cm::controllers::IDatabaseController* >(); break; case 1: *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< cm::controllers::INavigationController* >(); break; case 4: *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< cm::models::Client* >(); break; case 5: *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< cm::models::ClientSearch* >(); break; case 6: *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< cm::rss::RssChannel* >(); break; } } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { MasterController *_t = static_cast<MasterController *>(_o); Q_UNUSED(_t) void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = _t->welcomeMessage(); break; case 1: *reinterpret_cast< cm::controllers::INavigationController**>(_v) = _t->navigationController(); break; case 2: *reinterpret_cast< cm::controllers::ICommandController**>(_v) = _t->commandController(); break; case 3: *reinterpret_cast< cm::controllers::IDatabaseController**>(_v) = _t->databaseController(); break; case 4: *reinterpret_cast< cm::models::Client**>(_v) = _t->newClient(); break; case 5: *reinterpret_cast< cm::models::ClientSearch**>(_v) = _t->clientSearch(); break; case 6: *reinterpret_cast< cm::rss::RssChannel**>(_v) = _t->rssChannel(); break; default: break; } } else if (_c == QMetaObject::WriteProperty) { } else if (_c == QMetaObject::ResetProperty) { } #endif // QT_NO_PROPERTIES } const QMetaObject cm::controllers::MasterController::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_cm__controllers__MasterController.data, qt_meta_data_cm__controllers__MasterController, qt_static_metacall, nullptr, nullptr} }; const QMetaObject *cm::controllers::MasterController::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *cm::controllers::MasterController::qt_metacast(const char *_clname) { if (!_clname) return nullptr; if (!strcmp(_clname, qt_meta_stringdata_cm__controllers__MasterController.stringdata0)) return static_cast<void*>(this); return QObject::qt_metacast(_clname); } int cm::controllers::MasterController::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 3) qt_static_metacall(this, _c, _id, _a); _id -= 3; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 3) qt_static_metacall(this, _c, _id, _a); _id -= 3; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty || _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) { qt_static_metacall(this, _c, _id, _a); _id -= 7; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 7; } #endif // QT_NO_PROPERTIES return _id; } // SIGNAL 0 void cm::controllers::MasterController::rssChannelChanged() { QMetaObject::activate(this, &staticMetaObject, 0, nullptr); } QT_WARNING_POP QT_END_MOC_NAMESPACE
[ "akhiln@packtpub.com" ]
akhiln@packtpub.com
d60307402e191c1d97ed6ba892adc33de43a8342
e17546794b54bb4e7f65320fda8a046ce28c7915
/tools/UsbTest/ParamParser.cpp
054cd66e2ca38cfd98306e9ead17d973f47bebed
[ "BSD-3-Clause", "OpenSSL", "MIT", "LicenseRef-scancode-openssl", "LicenseRef-scancode-ssleay-windows", "Apache-2.0" ]
permissive
smaillet-ms/netmf-interpreter
693e5dc8c9463ff0824c515e9240270c948c706f
53574a439396cc98e37b82f296920c7e83a567bf
refs/heads/dev
2021-01-17T22:21:36.617467
2016-09-05T06:29:07
2016-09-05T06:29:07
32,760,598
2
1
null
2016-04-26T02:49:52
2015-03-23T21:44:01
C#
UTF-8
C++
false
false
5,431
cpp
#include "stdafx.h" #define DOUBLE_QUOTES TEXT('"') void ParamParser::PreParseAll() { try { // we need to have a delimiter . It cannot be null if (!m_delimiter || !m_separator) throw InvalidParameterException(); size_t beg = 0; while( m_strToParse.length() > (beg = ParseNextParam(beg))); } catch(std::exception&) { throw InvalidParameterException(); } } size_t ParamParser::ParseNextParam( size_t beg) { if ( beg >= m_strToParse.length()) return m_strToParse.length(); size_t idx = beg; // exclude leading spaces if any while ( idx < m_strToParse.length() && m_strToParse.at(idx) == TEXT(' ')) idx++; if (m_strToParse.at(idx) != m_delimiter) { throw InvalidParameterException(); } // find the next occurrence of the delimiter. if we don't find any, this is the last param // first skip any escaped delimiters size_t endpos = m_strToParse.find(m_delimiter, ++idx); while( (endpos != StrType::npos) && (endpos < m_strToParse.length()-1) && (m_strToParse[endpos+1] == m_delimiter)) { endpos = m_strToParse.find(m_delimiter, endpos+2); } if (endpos == StrType::npos) { endpos = m_strToParse.length(); } StrType thisParam = m_strToParse.substr(idx, endpos - idx); // find the next occurrence of the separator size_t valPos = thisParam.find(m_separator); if (valPos == StrType::npos) { valPos = thisParam.length(); } StrType param = RightTrim(thisParam.substr(0, valPos)); StrType value; if ( valPos < thisParam.length()) { value = thisParam.substr(++valPos, thisParam.length() -valPos); } // remove escape chars //============== TCHAR escapeDelim[3] = {m_delimiter, m_delimiter, 0}; size_t escapePos = value.find(escapeDelim); while(escapePos != StrType::npos) { value.erase(escapePos, 1); escapePos = value.find(escapeDelim); } // handle switch type params if ((value = RightTrim(value)).empty()) { value = toString<BOOL>(TRUE); } if (param.empty()) { throw InvalidParameterException(); } if ( m_params.find(param) != m_params.end()) { throw InvalidParameterException(); } else { m_params.insert(std::make_pair(param,value)); } return endpos; } ParamParser::ParamParser( const TCHAR* pCmdLine, TCHAR delimiter, TCHAR separator) : m_delimiter(delimiter), m_separator(separator) { if (NULL == pCmdLine || MAX_LENGTH < _tcslen(pCmdLine)) { throw InvalidParameterException(); }; m_strToParse = pCmdLine; PreParseAll(); } size_t ParamParser::countParams() { return m_params.size(); } ParamParser::ParamParser( int count, const TCHAR* args[], TCHAR delimiter, TCHAR separator) : m_delimiter(delimiter), m_separator(separator) { if (NULL == args) { throw InvalidParameterException(); } m_strToParse = TEXT(""); for ( int i = 1; i < count; i++) { m_strToParse += StrType(args[i]) + TEXT(' '); } if(MAX_LENGTH < m_strToParse.length()) { throw InvalidParameterException(); } PreParseAll(); } StrType ParamParser::GetString(LPCTSTR name, LPCTSTR defaultVal) { // look for the param name std::map<StrType, StrType>::iterator pos = m_params.find(name); if ( pos == m_params.end()) { return defaultVal; } else { return pos->second; } } double ParamParser::GetDouble(LPCTSTR name, double defaultVal) { // look for the param name std::map<StrType, StrType>::iterator pos = m_params.find(name); // lookup the param name if (pos != m_params.end()) { // if data parsing fails this function will return deafult value ON_ERROR_CONTINUE( InvalidParameterException, return ParseData<double>(pos->second.c_str())); } return defaultVal; } DWORD ParamParser::GetDWORD(LPCTSTR name, DWORD defaultVal) { // look for the param name std::map<StrType, StrType>::iterator pos = m_params.find(name); // lookup the param name if (pos != m_params.end()) { // if data parsing fails this function will return the default value ON_ERROR_CONTINUE( InvalidParameterException, return ParseData<DWORD>(pos->second.c_str())); } return defaultVal; } BOOL ParamParser::GetFlag(LPCTSTR name, BOOL defaultVal) { // look for the param name std::map<StrType, StrType>::iterator pos = m_params.find(name); if (pos != m_params.end()) { // if data parsing fails just return the default value ON_ERROR_CONTINUE( InvalidParameterException, return ParseData<BOOL>(pos->second.c_str())); } return defaultVal; } int ParamParser::GetInteger(LPCTSTR name, int defaultVal) { // look for the param name std::map<StrType, StrType>::iterator pos = m_params.find(name); if (pos != m_params.end()) { // if data parsing fails just return the default value ON_ERROR_CONTINUE( InvalidParameterException, return ParseData<int>(pos->second.c_str())); } return defaultVal; } __int64 ParamParser::GetInt64(LPCTSTR name, __int64 defaultVal) { // look for the param name std::map<StrType, StrType>::iterator pos = m_params.find(name); if (pos != m_params.end()) { // if data parsing fails just return the default value ON_ERROR_CONTINUE( InvalidParameterException, return ParseData<__int64>(pos->second.c_str())); } return defaultVal; }
[ "morteza.ghandehari@microsoft.com" ]
morteza.ghandehari@microsoft.com
493daa3ada96ef890c2a5206869f3b89c68cfe04
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/rtorrent/gumtree/rtorrent_repos_function_364.cpp
b9b75c0ab311027248f530ad960a8f019df2ad20
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
145
cpp
void ElementPeerList::update_itr() { m_windowList->mark_dirty(); m_elementInfo->set_object(m_listItr != m_list.end() ? &*m_listItr : NULL); }
[ "993273596@qq.com" ]
993273596@qq.com
3f452735db2b42652ed15a4a067a59c67cd5d0d1
4979915833a11a0306b66a25a91fadd009e7d863
/src/media/audio/lib/clock/utils.cc
30baf78c8eee596c2eb04747fd32951682a032db
[ "BSD-2-Clause" ]
permissive
dreamboy9/fuchsia
1f39918fb8fe71d785b43b90e0b3128d440bd33f
4ec0c406a28f193fe6e7376ee7696cca0532d4ba
refs/heads/master
2023-05-08T02:11:06.045588
2021-06-03T01:59:17
2021-06-03T01:59:17
373,352,924
0
0
NOASSERTION
2021-06-03T01:59:18
2021-06-03T01:58:57
null
UTF-8
C++
false
false
8,533
cc
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/media/audio/lib/clock/utils.h" #include <lib/syslog/cpp/macros.h> #include <zircon/syscalls.h> #include <cmath> namespace media::audio::clock { zx_status_t GetAndDisplayClockDetails(const zx::clock& ref_clock) { auto result = GetClockDetails(ref_clock); if (result.is_error()) { return result.error(); } DisplayClockDetails(result.take_value()); return ZX_OK; } fit::result<zx_clock_details_v1_t, zx_status_t> GetClockDetails(const zx::clock& ref_clock) { if (!ref_clock.is_valid()) { FX_LOGS(INFO) << "Clock is invalid"; return fit::error(ZX_ERR_INVALID_ARGS); } zx_clock_details_v1_t clock_details; zx_status_t status = ref_clock.get_details(&clock_details); if (status != ZX_OK) { FX_PLOGS(ERROR, status) << "Error calling zx::clock::get_details"; return fit::error(status); } return fit::ok(clock_details); } // Only called by custom code when debugging, so can remain at INFO severity. void DisplayClockDetails(const zx_clock_details_v1_t& clock_details) { FX_LOGS(INFO) << "******************************************"; FX_LOGS(INFO) << "Clock details -"; FX_LOGS(INFO) << " options:\t\t\t\t0x" << std::hex << clock_details.options; FX_LOGS(INFO) << " backstop_time:\t\t\t" << clock_details.backstop_time; FX_LOGS(INFO) << " query_ticks:\t\t\t" << clock_details.query_ticks; FX_LOGS(INFO) << " last_value_update_ticks:\t\t" << clock_details.last_value_update_ticks; FX_LOGS(INFO) << " last_rate_adjust_update_ticks:\t" << clock_details.last_rate_adjust_update_ticks; FX_LOGS(INFO) << " generation_counter:\t\t" << clock_details.generation_counter; FX_LOGS(INFO) << " mono_to_synthetic -"; FX_LOGS(INFO) << " reference_offset:\t\t" << clock_details.mono_to_synthetic.reference_offset; FX_LOGS(INFO) << " synthetic_offset:\t\t" << clock_details.mono_to_synthetic.synthetic_offset; FX_LOGS(INFO) << " rate -"; FX_LOGS(INFO) << " synthetic_ticks:\t\t" << clock_details.mono_to_synthetic.rate.synthetic_ticks; FX_LOGS(INFO) << " reference_ticks:\t\t" << clock_details.mono_to_synthetic.rate.reference_ticks; FX_LOGS(INFO) << "******************************************"; } // Only called by custom code when debugging, so can remain at INFO severity. std::string TimelineRateToString(const TimelineRate& rate, std::string tag) { return tag + ": sub_delta " + std::to_string(rate.subject_delta()) + ", ref_delta " + std::to_string(rate.reference_delta()); } // Only called by custom code when debugging, so can remain at INFO severity. std::string TimelineFunctionToString(const TimelineFunction& func, std::string tag) { return tag + ": sub_off " + std::to_string(func.subject_time()) + ", ref_off " + std::to_string(func.reference_time()) + ", sub_delta " + std::to_string(func.subject_delta()) + ", ref_delta " + std::to_string(func.reference_delta()); } zx_koid_t GetKoid(const zx::clock& clock) { zx_info_handle_basic_t basic_info; // size_t actual, avail; auto status = clock.get_info(ZX_INFO_HANDLE_BASIC, &basic_info, sizeof(basic_info), nullptr, nullptr); if (status != ZX_OK) { return ZX_HANDLE_INVALID; } return basic_info.koid; } fit::result<zx::clock, zx_status_t> DuplicateClock(const zx::clock& original_clock) { constexpr auto rights = ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ; zx::clock dupe_clock; auto status = original_clock.duplicate(rights, &dupe_clock); if (status != ZX_OK) { return fit::error(status); } return fit::ok(std::move(dupe_clock)); } fit::result<ClockSnapshot, zx_status_t> SnapshotClock(const zx::clock& ref_clock) { ClockSnapshot snapshot; zx_clock_details_v1_t clock_details; zx_status_t status = ref_clock.get_details(&clock_details); if (status != ZX_OK) { return fit::error(status); } // The inverse of the clock_details.mono_to_synthetic affine transform. snapshot.reference_to_monotonic = TimelineFunction(clock_details.mono_to_synthetic.reference_offset, clock_details.mono_to_synthetic.synthetic_offset, clock_details.mono_to_synthetic.rate.reference_ticks, clock_details.mono_to_synthetic.rate.synthetic_ticks); snapshot.generation = clock_details.generation_counter; return fit::ok(snapshot); } // Naming is confusing here. zx::clock transforms/structs call the underlying baseline clock (ticks // or monotonic: we use monotonic) their "reference" clock. Unfortunately, in media terminology a // "reference clock" could be any continuous monotonically increasing clock -- including not only // the local system monotonic, but also custom clocks maintained outside the kernel (which zx::clock // calls "synthetic" clocks). // // Thus in these util functions that convert between clocks, a conversion that we usually call "from // monotonic to reference" is (in zx::clock terms) a conversion "from reference to synthetic", where // the baseline reference here is the monotonic clock. fit::result<zx::time, zx_status_t> ReferenceTimeFromMonotonicTime(const zx::clock& ref_clock, zx::time mono_time) { zx_clock_details_v1_t clock_details; zx_status_t status = ref_clock.get_details(&clock_details); if (status != ZX_OK) { return fit::error(status); } return fit::ok(zx::time( affine::Transform::Apply(clock_details.mono_to_synthetic.reference_offset, clock_details.mono_to_synthetic.synthetic_offset, affine::Ratio(clock_details.mono_to_synthetic.rate.synthetic_ticks, clock_details.mono_to_synthetic.rate.reference_ticks), mono_time.get()))); } fit::result<zx::time, zx_status_t> MonotonicTimeFromReferenceTime(const zx::clock& ref_clock, zx::time ref_time) { zx_clock_details_v1_t clock_details; zx_status_t status = ref_clock.get_details(&clock_details); if (status != ZX_OK) { return fit::error(status); } return fit::ok(zx::time(affine::Transform::ApplyInverse( clock_details.mono_to_synthetic.reference_offset, clock_details.mono_to_synthetic.synthetic_offset, affine::Ratio(clock_details.mono_to_synthetic.rate.synthetic_ticks, clock_details.mono_to_synthetic.rate.reference_ticks), ref_time.get()))); } fit::result<zx::time, zx_status_t> ReferenceTimeFromReferenceTime(const zx::clock& ref_clock_a, zx::time ref_time_a, const zx::clock& ref_clock_b) { zx_clock_details_v1_t clock_details_a, clock_details_b; auto status = ref_clock_a.get_details(&clock_details_a); if (status == ZX_OK) { status = ref_clock_b.get_details(&clock_details_b); } if (status != ZX_OK) { return fit::error(status); } auto mono_to_ref_a = clock_details_a.mono_to_synthetic; auto mono_to_ref_b = clock_details_b.mono_to_synthetic; auto mono_time = affine::Transform::ApplyInverse( mono_to_ref_a.reference_offset, mono_to_ref_a.synthetic_offset, affine::Ratio(mono_to_ref_a.rate.synthetic_ticks, mono_to_ref_a.rate.reference_ticks), ref_time_a.get()); auto ref_time_b = affine::Transform::Apply( mono_to_ref_b.reference_offset, mono_to_ref_b.synthetic_offset, affine::Ratio(mono_to_ref_b.rate.synthetic_ticks, mono_to_ref_b.rate.reference_ticks), mono_time); return fit::ok(zx::time(ref_time_b)); } affine::Transform ToAffineTransform(TimelineFunction& tl_function) { return affine::Transform(tl_function.reference_time(), tl_function.subject_time(), affine::Ratio(static_cast<uint32_t>(tl_function.subject_delta()), static_cast<uint32_t>(tl_function.reference_delta()))); } TimelineFunction ToTimelineFunction(affine::Transform affine_trans) { return TimelineFunction(affine_trans.b_offset(), affine_trans.a_offset(), affine_trans.numerator(), affine_trans.denominator()); } } // namespace media::audio::clock
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
28837e5112515ae7209907f729b100b887b36842
e31123784ff0ed6f37972017d3b4729c7ac83a12
/その他/AtCoder Petrozavodsk Contest 001/B - Two Arrays.cpp
37a6a41bbfacefcf9d55e03b288617fe4a4e90ca
[]
no_license
ampm2020/atcoder
a91248953febeba5ef6d74620efed3164a60763c
0f3bb841f34b5994f2be3e77e1022adf42fbe69b
refs/heads/master
2022-11-05T08:04:06.531266
2020-06-19T11:51:38
2020-06-19T11:51:38
259,792,970
0
0
null
null
null
null
UTF-8
C++
false
false
882
cpp
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<long long, long long>; constexpr char ln = '\n'; constexpr long long MOD = 1000000007LL; constexpr long long INF = 1000000009LL; #define all(x) (x).begin(),(x).end() #define rep(i,n) for(int i=0;i<(n);i++) template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } int main(){ int n; cin >> n; vector<ll> A(n), B(n); rep(i, n) cin >> A[i]; rep(i, n) cin >> B[i]; ll mana = 0, cost = 0; rep(i, n){ ll a = A[i], b = B[i]; if(a < b) mana += (b-a)/2; else if(a > b) cost += a-b; } if(mana >= cost) cout << "Yes" << ln; else cout << "No" << ln; }
[ "daigoro-chucchu2004@ezweb.ne.jp" ]
daigoro-chucchu2004@ezweb.ne.jp
469c6bd4f5a323e4315b3666ca15016abc70f0a7
aceaf048853cba0c0392ad089bea22f9e3528098
/_tutorials/code/connect-wifi-arduino-esp32s3/connect-wifi-arduino-esp32s3.ino
004b0a0ebee6d40800dab7b48ebea8734008f363
[ "MIT" ]
permissive
hutscape/hutscape.github.io
c5b640bbfda21b9bc7260b5d2f6164c60ff9158a
27c5d8a79d48025d3270fea704df7a5e5cb43f5d
refs/heads/master
2023-02-13T04:05:12.235290
2023-02-01T05:37:53
2023-02-01T05:37:53
176,517,102
40
38
MIT
2021-07-15T07:02:01
2019-03-19T13:23:46
C++
UTF-8
C++
false
false
802
ino
#include <WiFi.h> #include "Secret.h" // Secret.h // char ssid[] = "secret"; // char pass[] = "secret"; void setup() { Serial.begin(115200); while (!Serial) { } Serial.print("Attempting to connect to SSID: "); Serial.println(ssid); WiFi.useStaticBuffers(true); WiFi.mode(WIFI_STA); WiFi.begin(ssid, pass); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("Connected to WiFi"); printWifiStatus(); } void loop() {} void printWifiStatus() { Serial.print("SSID: "); Serial.println(WiFi.SSID()); IPAddress ip = WiFi.localIP(); Serial.print("IP Address: "); Serial.println(ip); long rssi = WiFi.RSSI(); Serial.print("signal strength (RSSI):"); Serial.print(rssi); Serial.println(" dBm"); }
[ "sayanee@gmail.com" ]
sayanee@gmail.com
da5f5b488ce0038e022309a376366199396377dc
39df227f8be5d00555bdd59167b529373e4f702a
/otus_task_5/Figures.h
d035f716f945b5c49465b4a142ec533e74e1d2ae
[]
no_license
vvz-otus/diff_tasks
e309d2df5752e87cea3f40883c760243dc390f16
621fa514dd17eaac804e119234f87f3f6261d94d
refs/heads/master
2020-03-17T12:17:58.020948
2018-05-15T15:57:29
2018-05-15T15:57:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
755
h
/* File contains classes for graphical primitives. */ #pragma once #include <vector> #include <utility> enum class Switcher{ FirstClick, SecondClick }; class IFigure{ public: IFigure() {} virtual ~IFigure(){} void HandClick( int x, int y ); virtual std::vector< std::pair<int, int> > GetAllPoints() = 0; private: Switcher switcher = Switcher::FirstClick; void SetCenter( int x, int y ) {} void SetTarget( int x, int y ) {} int CenterX, CenterY, TargetX, TargetY; }; class Line final : public IFigure { public: std::vector< std::pair<int, int> > GetAllPoints() override {} }; class Circle final : public IFigure { public: std::vector< std::pair<int, int> > GetAllPoints() override {} };
[ "dmitry.syr@gmail.com" ]
dmitry.syr@gmail.com
304c7279183d94a04a2f0b7383133c40ece44fe0
b32a01eefb7de3b5beee58e51bf9569cef36e69a
/Max_sum_path_in_the_array.cpp
7a087e92bb8e619f1279393b9874e12d89ec7fe4
[]
no_license
sonusajid004/GeeksForGeeks--MyCodes
e1c226a8d370883d39993ae9a00f914cdf3d259c
ea4dd4f310b093662553fc3c3781ffbad92e1a5c
refs/heads/master
2022-12-06T05:14:08.630703
2020-09-02T11:38:56
2020-09-02T11:38:56
264,711,623
0
0
null
null
null
null
UTF-8
C++
false
false
749
cpp
/*You are required to complete this method*/ int max_path_sum(int a[], int b[], int n, int m) { //Your code here int sum1=0,sum2=0,res=0; int i=0,j=0; while(i<n && j<m) { if(a[i]<b[j]) { sum1+=a[i++]; } else if(a[i]>b[j]) { sum2+=b[j++]; } else { res+=max(sum1,sum2); sum1=0;sum2=0; while(i<n && j<m && a[i]==b[j]) { res += a[i++]; j++; } } // cout<<sum1<<" "<<sum2<<" "<<res<<endl; } while(i<n) sum1+=a[i++]; while(j<m) sum2+=b[j++]; res+=max(sum1,sum2); return res; }
[ "noreply@github.com" ]
sonusajid004.noreply@github.com
145a85b7aa409a2838944d2c37aa4b514169d1bb
1f20917fea6c541060e59d36883225910fcf76ba
/src/vmiids/rpc/RpcClient.h
601cf5d01636b47b8913f881079f58deb856bcb1
[]
no_license
chenglongzheng/vmiids
2975603edfe95ac7cab30a5926bfb4e0270b7c76
2410fee71220678de7c16af21c4270d7f52006a7
refs/heads/master
2021-01-18T06:25:14.340355
2010-10-14T19:15:20
2010-10-14T19:15:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,900
h
/* * VmiIDS_rpcClient.h * * Created on: Jul 8, 2010 * Author: kittel */ #ifndef VMIIDSRPCCLIENT_H_ #define VMIIDSRPCCLIENT_H_ #include "vmiids/rpc/RpcCommon.h" #include <string> #include <list> namespace vmi { /** * @class RpcClient RpcClient.h "vmiids/rpc/RpcClient.h" * * This class provides rpc client functionality. * * Every function is mapped to the appropriate rpc request. * Currently this function only supports queries on localhost. */ class RpcClient { private: CLIENT *clnt; //!< RPC internal data structure. static RpcClient *instance; //!< Instance of the RpcClient class (Singleton) /** * Internal function to start the rpc connection. */ void startConnection(void); /** * Internal function to quit the rpc connection. */ void stopConnection(void); /** * Constructor */ RpcClient(); public: /** * Destructor */ virtual ~RpcClient(); /** * Get the RpcClient instance. */ static RpcClient *getInstance(); /** * Enqueue DetectionModule to a list of DetectionModules scheduled all timeInSeconds seconds. * * Function calls vmi::VmiIDS::enqueueDetectionModule(). * Note: The DetectionModule must be loaded in advance. Use the loadSharedObject() method to load a module. * * @param detectionModuleName Name of the DetectionModule. * @param timeInSeconds Time between two runs of the module. * @return True, if the DetectionModule was successfully enqueued. */ bool enqueueDetectionModule(std::string detectionModuleName, uint32_t timeInSeconds = 0); /** * Dequeue DetectionModule from a list of DetectionModules scheduled all timeInSeconds seconds. * * Function calls vmi::VmiIDS::dequeueDetectionModule(). * Note: The DetectionModule must be enqueued in advance. * * @param detectionModuleName Name of the DetectionModule. * @param timeInSeconds Time between two runs of the module. * @return True, if the DetectionModule was successfully dequeued. */ bool dequeueDetectionModule(std::string detectionModuleName, uint32_t timeInSeconds = 0); /** * Run single DetectionModule. * * @param module Name of the DetectionModule to run. * @return Output the DetectionModule produced while running. */ std::string runSingleDetectionModule(std::string module); /** * Stop the entire framework. It is not able to restart the framework with rpc. * @param signum Signal to stop the framework with. * @return True, if framework was stopped. */ bool stopIDS(int signum = 0); /** * Load a module from an object file (*.so). * @param path Path of the module to load. * @return True, if the object file was found, and loadable. */ bool loadSharedObject(std::string path); /** * Query a list of loaded DetectionModules. * @return List of loaded DetectionModules. */ std::list<std::string> getListOfDetectionModules(void); }; } #endif /* VMIIDSRPCCLIENT_H_ */
[ "kittel@in.tum.de" ]
kittel@in.tum.de
2e89f75fa54965856a1808e331ebf1622e51386f
a06515f4697a3dbcbae4e3c05de2f8632f8d5f46
/corpus/taken_from_cppcheck_tests/stolen_14167.cpp
8d3c0546324c8f5a5234e7cd4618022ee3808509
[]
no_license
pauldreik/fuzzcppcheck
12d9c11bcc182cc1f1bb4893e0925dc05fcaf711
794ba352af45971ff1f76d665b52adeb42dcab5f
refs/heads/master
2020-05-01T01:55:04.280076
2019-03-22T21:05:28
2019-03-22T21:05:28
177,206,313
0
0
null
null
null
null
UTF-8
C++
false
false
36
cpp
bool foo(bool x) { return x << 31; }
[ "github@pauldreik.se" ]
github@pauldreik.se
cb473ae706da14cf7247adf4372d884e5fca927d
2d105f602c6290e7aa59aead764310650a7aac78
/Lonely Numbers.cpp
e0b93d27557298a785322af45529336f12b93100
[]
no_license
piash76/cf-uva-spoj-atcoder-lightoj-4
781483bcedbcb3d26725af8aedc6611544cb768f
9f3c425b3a59e117eca1c9ede802eef08024e1cf
refs/heads/main
2023-04-25T21:40:18.996382
2021-05-21T16:55:29
2021-05-21T16:55:29
366,639,176
0
0
null
null
null
null
UTF-8
C++
false
false
8,049
cpp
///Bismillahir Rahmanir Rahim ///ALLAHU AKBAR #include<bits/stdc++.h> #define flash() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> //Datatypes #define ll long long #define ULL unsigned long long #define LD long double #define UI unsigned int #define US unsigned short #define pii pair<int,int> #define pll pair<ll,ll> #define sc1i(a) scanf("%d",&a) #define sc2i(a,b) scanf("%d %d",&a,&b) #define sc3i(a,b,c) scanf("%d %d %d",&a, &b, &c) #define p1i(a) printf("%d\n",(a)) #define p2i(a,b) printf("%d %d\n",(a), (b)) #define p3i(a,b,c) printf("%d %d %d\n",(a), (b), (c)) #define sc1l(a) scanf("%lld",&a) #define sc2l(a,b) scanf("%lld %lld",&a,&b) #define sc3l(a,b,c) scanf("%lld %lld %lld",&a, &b, &c) #define p1l(a) printf("%lld\n",(a)) #define p2l(a,b) printf("%lld %lld\n",(a), (b)) #define p3l(a,b,c) printf("%lld %lld %lld\n",(a), (b), (c)) #define c(x) cout<<x<<endl #define cy cout<<"YES"<<endl #define cn cout<<"NO"<<endl #define ci cout<<"Impossible"<<endl #define f1(i,a,b) for(ll i=a;i<b;i++) #define f2(i,a,b) for(ll i=a;i<=b;i++) #define fr(i,a,b) for(ll i=a;i>=b;i--) #define LCM(a,b) (a / __gcd(a,b) ) *b #define GCD(a,b) __gcd(a,b) #define dist(x1,y1,x2,y2) sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)) #define distl(x1,y1,x2,y2) sqrtl((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)) #define geta(a,n) for(ll i=0;i<n;i++) cin>>a[i] #define puta(a,n) for(ll i=0;i<n;i++) cout<<a[i]<<" " #define geta1(a,n) for(ll i=1;i<=n;i++) cin>>a[i] #define puta1(a,n) for(ll i=1;i<=n;i++) cout<<a[i]<<" " #define getar(a,n) for(int i=0;i<n;i++) scanf("%lld",&a[i]) #define getar1(a,n) for(int i=1;i<=n;i++) scanf("%lld",&a[i]) #define putar(a,n) for(int i=0;i<n;i++) printf("%lld ",a[i]) #define putar1(a,n) for(int i=1;i<=n;i++) printf("%lld ",a[i]) #define all(a) a.begin(),a.end() #define lla(A) A.rbegin(), A.rend() #define unique(a) sort(all(a)),a.erase(unique(all(a)),a.end()) #define pb push_back #define mk make_pair #define ff first #define ss second #define greatersrt(v) sort(v.begin(),v.end(),greater<ll>()) #define min3(a,b,c) min(a,min(b,c)) #define min4(a,b,c,d) min(a,min(b,min(c,d))) #define max3(a,b,c) max(a,max(b,c)) #define max4(a,b,c,d) max(a,max(b,max(c,d))) #define max5(a,b,c,d,e) max(max3(a,b,c),max(d,e)) #define min5(a,b,c,d,e) min(min3(a,b,c),min(d,e)) #define mem(a,x) memset(a,x,sizeof(a)) #define see_you return 0 #define sorta(a,n) sort(a,a+n) #define SORT(v) sort(v.begin(),v.end()) #define REV(v) reverse(v.begin(),v.end()) #define nl printf("\n") ll caseno=0; #define printcase printf("Case %d: ",++caseno) #define Debug cout<<endl<<"AND I AM IRONMAN"<<endl; #define binleastsigonebit(x) __builtin_ffs(x) #define binleadingzeroes(x) __builtin_clz(x) #define bintrailingzeroes(x) __builtin_ctz(x) #define bintotalones(x) __builtin_popcount(x) //Constants const int mod = 1000000007; // 998244353 //const int mod = 998244353 const ll INF = 1e18; const ll inf = 0xFFFFFFFFFFFFFFFL; const int maxn = 211111; const int maxn1 = 111111; #define BOUND 0x100000000 /// 2^32 #define PI acos(-1.0) #define EulerGamma 0.57721566490153286060651209 ///-----------------------------GRAPH MOVES----------------------------//// //const int fx[]={+1,-1,+0,+0}; //const int fy[]={+0,+0,+1,-1}; //const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1}; // Kings Move //const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1}; // Kings Move //const int fx[]={-2, -2, -1, -1, 1, 1, 2, 2}; // Knights Move //const int fy[]={-1, 1, -2, 2, -2, 2, -1, 1}; // Knights Move /*---------------------------------------------------------------------*/ ///-----------------------------VARIOUS FUNCTIONS----------------------------//// bool isPrime(long long int n) { bool flag = true; for(long long int i = 2; i*i <= n; ++i) //for(int i = 2; i <= sqrt(n); ++i) //for(int i = 2; i <= n/2; ++i) { if(n%i == 0) { flag = false; break; } } return flag; } bool ispoweroftwo (ll x) { /* First x in the below expression is for the case when x is 0 */ return x && (!(x&(x-1))); } inline void normal(ll &a) { a %= mod; (a < 0) && (a += mod); } inline ll modMul(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a * b) % mod; } inline ll modAdd(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a + b) % mod; } inline ll modSub(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); a -= b; normal(a); return a; } inline ll modPow(ll b, ll p) { ll r = 1; while (p) { if (p & 1LL) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; } inline ll modInverse(ll a) { return modPow(a, mod - 2); } inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); } ll amar_ceil(ll x,ll y) { return (x+y-1)/y; } long long binpow(long long base,long long power) { long long result=1; while (power>0) { if (power%2==1) result = (result*base); base = (base*base); power/=2; } return result; } long long binmod(long long base,long long power,long long M) { long long result=1; while (power>0) { if (power%2==1) result = (result*base)%M; base = (base*base)%M; power/=2; } return result; } ll pow2(ll power) { return 1<<power; } bool palindrome(string &s) { ll l=s.size(); bool f=true; for(ll i=0;i<l/2;i++) { if(s[i]!=s[l-i-1]) {f=false;break;} } return f; } ///comparator /*struct cmp { bool operator()(pair<int , int> &a ,pair<int , int> &b){ return a.first > b.first; } };*/ ///ITS NOT WHO I AM UNDERNEATH,BUT WHAT I DO THAT DEFINES ME. const int N = 1111111; const int SZ = 5761455 + 3; ///const int SZ=1e6; bool isprime[N+5]; ll prime[SZ+5],tot; //bitset<MAXN> isprime; void sieve() { ll sq=sqrt(N); isprime[2]=0; //as 0 indicates prime for(ll i=4;i<=N;i+=2) isprime[i]=1; for(ll i=3;i<=sq;i+=2) { if(isprime[i]==0) { for(ll j=i*i;j<=N;j+=i)isprime[j]=1; } } for(ll i=2;i<=N;i++) { if(isprime[i]==0) { prime[tot]=i; tot++; } } /* cout<<j<<endl; ///86537 for(ll i=0;i<j;i++) { cout<<prime[i]<<endl; }*/ } int main() { flash() ll i,j,t,cas=0; sieve(); //cin>>t; sc1l(t); while(t--) { ll n; //cin>>n; sc1l(n); ll x=sqrt(n); ll up=lower_bound(prime,prime+tot,n+1)-prime; //cout<<up<<endl; ll lo=lower_bound(prime,prime+tot,x+1)-prime; //cout<<lo<<endl; // cout<<up-lo+1<<endl; printf("%lld\n",up-lo+1); } see_you; }
[ "noreply@github.com" ]
piash76.noreply@github.com
2c540c9893d0a0a9169f90d4d89a6ef82febd31f
7599301731d0c6a6e9da4c4d656616125d6f52ac
/ExcelConverter/ExcelConverter/rules_yingdaqiweizhi.cpp
1b5c8b204ca80da3218d34fffee1f88076e05604
[]
no_license
zhang433/ATP
ddc43175370e3732647554ab12e688ed5db91a50
67d4eefcd491d0be1ac1e3c65d53c3b2cb90881a
refs/heads/master
2020-09-26T08:32:04.917444
2020-02-27T02:25:58
2020-02-27T02:25:58
226,217,361
0
0
null
2019-12-06T01:01:28
2019-12-06T01:01:27
null
UTF-8
C++
false
false
5,391
cpp
#include "rules_yingdaqiweizhi.h" #include <functional> #include <QDebug> #include <qalgorithms.h> Rules_YINGDAQIWEIZHI::Rules_YINGDAQIWEIZHI() { } bool Rules_YINGDAQIWEIZHI::convert(QList<QPair<FileInfo, ExcelFile>> &excelFiles, QList<QPair<QString, Sheet>>& All_ConvertSheet) { std::function<bool(QPair<FileInfo, ExcelFile>&)> rule[8]; rule[0] = [](QPair<FileInfo, ExcelFile>& sheetfile)->bool { //检查 for (auto& sheet : sheetfile.second) { for (auto& items : sheet.second) { if(!RuleCommon::check_Order(items[0])) { w->printerr("序号无法有效转换", RuleCommon::get_rowContent(items)); return false; } } } return true; }; rule[1] = [](QPair<FileInfo, ExcelFile>& sheetfile)->bool { return true; }; rule[2] = [](QPair<FileInfo, ExcelFile>& sheetfile)->bool { //检查 for (auto& sheet : sheetfile.second) { for (auto& items : sheet.second) { if (!RuleCommon::check_balishID(items[2])) { w->printerr("应答器编号无效", RuleCommon::get_rowContent(items), "示例:075-5-14-001-1"); return false; } } } return true; }; rule[3] = [](QPair<FileInfo, ExcelFile>& sheetfile)->bool { //检查 for (auto& sheet : sheetfile.second) { for (auto& items : sheet.second) { if (!RuleCommon::check_Km(items[3])) { w->printerr("里程标识不合法,无法转换为数字", RuleCommon::get_rowContent(items)); return false; } } } return true; }; rule[4] = [](QPair<FileInfo, ExcelFile>& sheetfile)->bool { //检查 for (auto& sheet : sheetfile.second) { for (auto& items : sheet.second) { if (items[4]!="有源"&&items[4]!="无源") { w->printerr("设备类型不合法", RuleCommon::get_rowContent(items), "只能为有源或者无源"); return false; } } } return true; }; rule[5] = [](QPair<FileInfo, ExcelFile>& sheetfile)->bool { static QSet<QString> s = { "CZ","DW","FCZ","FDW","FJZ","FQ","JZ","Q","ZJ1","ZJ2" }; //检查 for (auto& sheet : sheetfile.second) { for (auto& items : sheet.second) { if (items[4] != "有源"&&items[4] != "无源") { w->printerr("用途不合法", RuleCommon::get_rowContent(items), "用途为以下字段之一:CZ,DW,FCZ,FDW,FJZ,FQ,JZ,Q,ZJ1,ZJ2"); return false; } } } return true; }; rule[6] = [](QPair<FileInfo, ExcelFile>& sheetfile)->bool { return true; }; rule[7] = [](QPair<FileInfo, ExcelFile>& sheetfile)->bool { return true; }; QList<QPair<FileInfo, ExcelFile>> files; auto iter = excelFiles.begin(); //筛选文件 while (iter != excelFiles.end()) { if (iter->first.fileType == FileType::YINGDAQIWEIZHI) { files.push_back(qMove(*iter)); iter = excelFiles.erase(iter); } else iter++; } if(files.isEmpty()) w->printinfo("未检测到符合命名规范的应答器位置表"); //掐头去尾 for (auto& file : files) { w->printinfo("正在检查文件:" + file.first.fileName); if (file.second.size() != 2) { w->printerr("子表个数必须严格为2"); return false; } if (!RuleCommon::check_column(file, sizeof(rule) / sizeof(rule[0]))) { w->printerr("请检查每一张子表的列数是否严格为"+QString::number(sizeof(rule) / sizeof(rule[0]))+"(包括隐藏列)"); return false; } for (unsigned int i = 0; i < sizeof(rule) / sizeof(rule[0]); ++i) { if (!(rule[i])(file)) return false; } } for(auto& file : files) { for(auto& sheet: file.second) { for(auto& line: sheet.second) { BalisePosition baliseLocation; baliseLocation.ID = line[0]; baliseLocation.baliseName = line[1]; baliseLocation.baliseID = line[2]; baliseLocation.baliseKm = line[3]; baliseLocation.baliseType = line[4]; baliseLocation.baliseUse = line[5]; baliseLocation.remark_1 = line[6]; baliseLocation.remark_2 = line[7]; switch(sheet.first) { case SheetType::UP: DesignData::baliseLocationUpMap.insert(baliseLocation.baliseID, baliseLocation); if (DesignData::balishUseMap.find(baliseLocation.baliseID.mid(0, 12)) == DesignData::balishUseMap.end()) DesignData::balishUseMap.insert(baliseLocation.baliseID.mid(0, 12), baliseLocation.baliseUse); break; case SheetType::DOWN: DesignData::baliseLocationDownMap.insert(baliseLocation.baliseID,baliseLocation); if(DesignData::balishUseMap.find(baliseLocation.baliseID.mid(0, 12))== DesignData::balishUseMap.end()) DesignData::balishUseMap.insert(baliseLocation.baliseID.mid(0,12), baliseLocation.baliseUse); break; default: w->printerr(file.first.fileName+"子表名称不符合规范(须包含上下行信息)"); return false; } } } } return true; }
[ "546976189@qq.com" ]
546976189@qq.com
d5144633d25b1de79ef4d953ffc0a6e75886aa5d
a65c77b44164b2c69dfe4bfa2772d18ae8e0cce2
/codeforces/863D.cpp
d120fa69ed8ca653f19838f47f193de75730b6ba
[]
no_license
dl8sd11/online-judge
553422b55080e49e6bd9b38834ccf1076fb95395
5ef8e3c5390e54381683f62f88d03629e1355d1d
refs/heads/master
2021-12-22T15:13:34.279988
2021-12-13T06:45:49
2021-12-13T06:45:49
111,268,306
1
6
null
null
null
null
UTF-8
C++
false
false
2,232
cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pii; typedef pair<double,double> pdd; #define MEM(a, b) memset(a, (b), sizeof(a)) #define SZ(i) ll(i.size()) #define FOR(i, j, k, in) for (ll i=j ; i<k ; i+=in) #define RFOR(i, j, k, in) for (ll i=j ; i>=k ; i-=in) #define REP(i, j) FOR(i, 0, j, 1) #define REP1(i,j) FOR(i, 1, j+1, 1) #define RREP(i, j) RFOR(i, j, 0, 1) #define ALL(_a) _a.begin(),_a.end() #define mp make_pair #define pb push_back #define eb emplace_back #define X first #define Y second #ifdef tmd #define debug(...) do{\ fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\ _do(__VA_ARGS__);\ }while(0) template<typename T>void _do(T &&_x){cerr<<_x<<endl;} template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);} template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";} template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb) { _s<<"{"; for(It _it=_ita;_it!=_itb;_it++) { _s<<(_it==_ita?"":",")<<*_it; } _s<<"}"; return _s; } template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));} template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));} template<typename _a> ostream &operator << (ostream &_s,deque<_a> &_c){return _OUTC(_s,ALL(_c));} template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));} template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;} #define IOS() #else #define debug(...) #define pary(...) #define endl '\n' #define IOS() ios_base::sync_with_stdio(0);cin.tie(0) #endif const ll MOD = 1000000007; const ll INF = 0x3f3f3f3f3f3f3f3f; // const ll MAXN = ll n,q,m; struct Node { Node *lc,*rc; ll val,pri; bool tag; void push() { if (tag) { if (lc) { lc->tag ^= 1; } if (rc) { rc->tag ^= 1; } swap(lc,rc); } } }; /********** Good Luck :) **********/ int main() { IOS(); return 0; }
[ "tmd910607@gmail.com" ]
tmd910607@gmail.com
6f0857c6a15243f43ad5f7ab17bd0f3c8a409def
3fc543e2fe00b5632771cc8ec6326c68f1d41191
/stencil_benchmarks/tools/parallel.cpp
9398a7d37ab7780e7a7a767f005b6286a18a0393
[ "BSD-3-Clause" ]
permissive
gronerl/stencil_benchmarks
fd6f4530b96f9f80eb0eb1857bcbbfad95d23bcb
876725124f8ac253c009abad5ec71661d3e169d7
refs/heads/master
2022-12-24T05:45:38.415794
2020-09-18T15:54:58
2020-09-18T15:55:14
296,005,487
0
0
NOASSERTION
2020-09-16T10:56:04
2020-09-16T10:56:03
null
UTF-8
C++
false
false
3,302
cpp
// Stencil Benchmarks // // Copyright (c) 2017-2020, ETH Zurich and MeteoSwiss // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // 3. Neither the name of the copyright holder nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // SPDX-License-Identifier: BSD-3-Clause #include <algorithm> #include <functional> #include <random> #include <thread> #include <vector> #include <pybind11/pybind11.h> namespace py = pybind11; namespace { template <class T> void random_fill(T *first, T *last) { py::gil_scoped_release release; std::vector<std::thread> threads; std::size_t nthreads = std::thread::hardware_concurrency(); for (std::size_t i = 0; i < nthreads; ++i) { threads.emplace_back([=]() { std::random_device seed; auto rand = std::bind(std::uniform_real_distribution<T>(), std::minstd_rand(seed())); std::size_t n = std::distance(first, last); T *thread_first = first + i * n / nthreads; T *thread_last = first + (i + 1) * n / nthreads; std::generate(thread_first, thread_last, rand); }); } for (auto &thread : threads) thread.join(); } } // namespace PYBIND11_MODULE(parallel, m) { m.def("random_fill", [](py::buffer b) { py::buffer_info info = b.request(); char *first = reinterpret_cast<char *>(info.ptr); char *last = first + info.itemsize; for (int dim = 0; dim < info.ndim; ++dim) last += (info.shape[dim] - 1) * info.strides[dim]; if (info.format == py::format_descriptor<float>::format()) { random_fill<float>(reinterpret_cast<float *>(first), reinterpret_cast<float *>(last)); } else if (info.format == py::format_descriptor<double>::format()) { random_fill<double>(reinterpret_cast<double *>(first), reinterpret_cast<double *>(last)); } else { throw std::runtime_error("data type not supported"); } }); }
[ "thaler@cscs.ch" ]
thaler@cscs.ch
62912c0e2e804f70a12931239fcc729490239096
069498fa9ca6def0d6e3c34d437a53eafc2e475c
/task3/problemB1/MinWay.cpp
90986057ee734214240d8542e18245b334461d86
[]
no_license
ilyaderkatch/2sem-Algorithms
0ba749753a13f0460304e54efe7ff87f57e97df2
d5f15e9d1e2480d12dad19ce0e2f127d0979f1d5
refs/heads/master
2020-04-23T17:20:58.055667
2020-04-11T21:23:44
2020-04-11T21:23:44
171,328,526
1
0
null
2019-04-01T14:19:29
2019-02-18T17:41:52
C++
UTF-8
C++
false
false
3,544
cpp
#include "MinWay.h" double INFINITY = 1000000000000.0; vector <int> operator+(const vector <int> &a, const vector <int> &b) { vector <int> c = a; for (int i = 0; i < b.size(); ++i) { c.push_back(b[i]); } return c; } vector <int> DfsFromVertex(const ListGraph &A, int vertex, int parent) //находим эйлеров цикл на удвонном мин остове { //по факту обычный дфс по дерево с сохранением порядка обхода vector <int> Result(1, vertex); vector <Edge> Vertices; A.GetNextVertices(vertex, Vertices); for (int i = 0; i < Vertices.size(); ++i) { if (Vertices[i].to != parent) { Result = Result + DfsFromVertex(A, Vertices[i].to, vertex); } } return Result; } vector <int> Dfs(const ListGraph &A) //тот же поиск, только начало запуска { return DfsFromVertex(A, 0, -1); } double MinCycle(const MatrixGraph &A) //ищем гамильтонов цикл { ListGraph C = Prim(A); //строим мин остов vector <int> Path = Dfs(C); //строим обход приближенного гамильтонова пути double res = A.GetWeight(Path[0], Path[Path.size() - 1]); for (int i = 0; i < Path.size() - 1; ++i) { res += A.GetWeight(Path[i], Path[i + 1]); //находим вес } return res; } void swap(vector <int> &A, int i, int j) //своп элементов { int s = A[i]; A[i] = A[j]; A[j] = s; } bool NextSequence(vector <int> &A) //генерация всех перестановок { int j = A.size() - 2; while (j != -1 && A[j] >= A[j + 1]) { --j; } if (j == -1) { return false; } int k = A.size() - 1; while (A[j] >= A[k]) { --k; } swap(A, j, k); int l = j + 1, r = A.size() - 1; while (l<r) { swap(A, l++, r--); } return true; } double CorrectMinCycle(const MatrixGraph &A) //поиск корректного минимального цикла плолным перебором за факториал { vector <int> Sequence; //перестановка for (int i = 0; i < A.VerticesCount(); ++i) { Sequence.push_back(i); } double res = INFINITY; do { bool WasBroken = false; double new_res = 0; int current_vertex = 0; set <int> used_vertices; for (int i = 0; i < Sequence.size(); ++i) { if (current_vertex == Sequence[current_vertex]) //проверка на корректность, нельзя прийти в посещенную вершину слишком рано { WasBroken = true; break; } used_vertices.insert(current_vertex); new_res += A.GetWeight(current_vertex, Sequence[current_vertex]); //обновляем вес конкретного гамильтоного цикла current_vertex = Sequence[current_vertex]; } if(new_res < res && !WasBroken && used_vertices.size() == A.VerticesCount()) //проверка на минимальность и корректность перестановк { res = new_res; } } while(NextSequence(Sequence)); //обновляю перестановку return res; }
[ "noreply@github.com" ]
ilyaderkatch.noreply@github.com
4dedc92218b3a27d53a3fa43cab2e419fde6e798
31f671e589e58f7a34ddf383d6701bc04f74bfd4
/ps/week13/task2/neradovskiy/task2.cpp
158cb614863e64a54ecf6bf67421a8313e89a518
[]
no_license
Boklazhenko/itstephomework
450fbdd43c56fadb9f53573573197f2c880e832a
368f951936620332ca68d14eb444084db9bb33a4
refs/heads/master
2020-09-08T16:54:19.988831
2020-08-08T13:22:35
2020-08-08T13:22:35
221,188,173
5
10
null
2020-08-15T07:00:35
2019-11-12T10:13:14
C++
WINDOWS-1251
C++
false
false
1,016
cpp
#include <iostream> #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define SQR(num) (pow(num, 2)) #define EXP(num, exponentiation) (pow(num, exponentiation)) #define CHECK_PARITY(num) ((num) % (2) == 0 ? true : false) #define CHECK_NOT_PARITY(num) ((num) % (2) != 0 ? true : false) //поидее эта функция реализована в прежидущей но сделал т.к. есть задание int main() { int a = 5; int b = 8; int num = 441; int exponent = 3; std::cout << "a: " << a << " b: " << b << " MIN: " << (MIN(a, b)) << std::endl; std::cout << "a: " << a << " b: " << b << " MAX: " << (MAX(a, b)) << std::endl; std::cout << "SQR: " << (SQR(a)) << std::endl; std::cout << "num: " << a << " exponentiation: " << exponent << " EXP: " << (EXP(a, exponent)) << std::endl; std::cout << "Check parity: " << num << " " << CHECK_PARITY(num) << std::endl; std::cout << "Check not parity: " << num << " " << CHECK_NOT_PARITY(num) << std::endl; }
[ "bopoh143@gmail.com" ]
bopoh143@gmail.com
2e808339b4e70e58a24ed64469542d596f80a0e9
11a246743073e9d2cb550f9144f59b95afebf195
/kattis/cakeymccakeface.cpp
9ca7656564939fa49419225630fce56015c04ced
[]
no_license
ankitpriyarup/online-judge
b5b779c26439369cedc05c045af5511cbc3c980f
8a00ec141142c129bfa13a68dbf704091eae9588
refs/heads/master
2020-09-05T02:46:56.377213
2019-10-27T20:12:25
2019-10-27T20:12:25
219,959,932
0
1
null
2019-11-06T09:30:58
2019-11-06T09:30:57
null
UTF-8
C++
false
false
1,326
cpp
#include <iostream> #include <iomanip> #include <string> #include <sstream> #include <fstream> #include <cassert> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #include <numeric> #include <utility> #include <vector> #include <queue> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <bitset> #include <complex> using namespace std; using ll = long long; using ld = long double; using pii = pair<int, int>; constexpr int MAXN = 2505; int n, m; ll a[MAXN], b[MAXN]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); scanf(" %d %d", &n, &m); for (int i = 0; i < n; ++i) { scanf(" %lld", a + i); } for (int i = 0; i < m; ++i) { scanf(" %lld", b + i); } ll ans = 0; ll score = 0; map<ll, ll> freq; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { ll v = b[j] - a[i]; ++freq[v]; } } for (auto it : freq) { // printf("%lld %lld\n", it.first, it.second); if (it.first < 0) continue; if (it.second > score or (it.second == score and it.first < ans)) { ans = it.first; score = it.second; } } printf("%lld\n", ans); return 0; }
[ "arnavsastry@gmail.com" ]
arnavsastry@gmail.com
7de4eba875d5fc5ea7bdbb0c30211f217467688a
2476e036866ebf861e834eb0ddb2a8cd49104285
/leetcode/leetcode56/merge_intervals.cpp
1e975a659c036d9fc31bfed5fa2708d11e51c466
[]
no_license
xchmwang/algorithm
7deaedecb58e3925cc23239020553ffed8cc3f04
55345160b6d8ef02bc89e01247b4dbd1bc094d5e
refs/heads/master
2021-09-17T23:54:40.785962
2018-07-07T06:40:27
2018-07-07T06:40:27
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,314
cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; struct Interval { int start; int end; Interval() : start(0), end(0) {} Interval(int s, int e) : start(s), end(e) {} }; bool cmp(const Interval &i1, const Interval &i2) { if (i1.start != i2.start) return i1.start < i2.start; return i1.end > i2.end; } class Solution { public: vector<Interval> merge(vector<Interval>& intervals) { vector<Interval> ans; if (intervals.size() < 1) return ans; sort(intervals.begin(), intervals.end(), cmp); Interval interval; interval = intervals[0]; for (int i = 1; i < intervals.size(); ++i) { if (intervals[i].end<=interval.end || intervals[i].start==intervals[i-1].start) continue; if (intervals[i].start <= interval.end) interval.end = max(interval.end, intervals[i].end); else { ans.push_back(interval); interval = intervals[i]; } } ans.push_back(interval); return ans; } }; int main() { Interval a[] = {{2, 3}, {5, 5}, {2, 2}, {3, 4}, {3, 4}}; vector<Interval> v(a, a+sizeof(a)/sizeof(a[0])); Solution sol; vector<Interval> ans = sol.merge(v); for (int i = 0; i < ans.size(); ++i) cout << ans[i].start << ", " << ans[i].end << endl; return 0; }
[ "chmwang@zju.edu.cn" ]
chmwang@zju.edu.cn
c2823d762e20d9d422f8d35168646d47795afd08
383da4b7cc0e8772a227d2f20f8a6e42339af558
/MatrizLedAFO.cpp
abe175e5f2b9cfb2afb3b63b86bde1a57fc71f8e
[]
no_license
elafosoy/MarcadorPadelArduino
1d836b082b7b7be61b751662f91abd5851ada283
48713464da15196ab782fbf413e1df64a263cdb6
refs/heads/main
2023-03-27T11:54:22.189344
2021-04-01T08:41:25
2021-04-01T08:41:25
341,131,832
1
0
null
null
null
null
UTF-8
C++
false
false
10,168
cpp
/* * Basado en https://github.com/wayoda/LedControl * A library for controling Leds with a MAX7219/MAX7221 * Copyright (c) 2007 Eberhard Fahle * * 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: * * 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 "MatrizLedAFO.h" //the opcodes for the MAX7221 and MAX7219 #define OP_NOOP 0 #define OP_DIGIT0 1 #define OP_DIGIT1 2 #define OP_DIGIT2 3 #define OP_DIGIT3 4 #define OP_DIGIT4 5 #define OP_DIGIT5 6 #define OP_DIGIT6 7 #define OP_DIGIT7 8 #define OP_DECODEMODE 9 #define OP_INTENSITY 10 #define OP_SCANLIMIT 11 #define OP_SHUTDOWN 12 #define OP_DISPLAYTEST 15 MatrizLed::MatrizLed() { } void MatrizLed::begin(int dataPin, int clkPin, int csPin, int numDevices){ SPI_MOSI=dataPin; SPI_CLK=clkPin; SPI_CS=csPin; rotate = false; if(numDevices<=0 || numDevices>8 ) numDevices=8; maxDevices=numDevices; pinMode(SPI_MOSI,OUTPUT); pinMode(SPI_CLK,OUTPUT); pinMode(SPI_CS,OUTPUT); digitalWrite(SPI_CS,HIGH); SPI_MOSI=dataPin; for(int i=0;i<64;i++) status[i]=0x00; for(int i=0;i<maxDevices;i++) { spiTransfer(i,OP_DISPLAYTEST,0); //scanlimit is set to max on startup setScanLimit(i,7); //decode is done in source spiTransfer(i,OP_DECODEMODE,0); clearDisplay(i); //we go into shutdown-mode on startup shutdown(i,true); } //we have to init all devices in a loop for(int address=0; address<getDeviceCount(); address++) { /*The MAX72XX is in power-saving mode on startup*/ shutdown(address,false); /* Set the brightness to a medium values */ setIntensity(address,8); /* and clear the display */ clearDisplay(address); } } void MatrizLed::rotar(bool r){ rotate = r; } void MatrizLed::rotar_caracter(uint8_t original[8]){ uint8_t temporal[8] = {0,0,0,0,0,0,0,0}; for (int i=0; i<8; i++){ bitWrite(temporal[7], i, bitRead(original[i], 0)); bitWrite(temporal[6], i, bitRead(original[i], 1)); bitWrite(temporal[5], i, bitRead(original[i], 2)); bitWrite(temporal[4], i, bitRead(original[i], 3)); bitWrite(temporal[3], i, bitRead(original[i], 4)); bitWrite(temporal[2], i, bitRead(original[i], 5)); bitWrite(temporal[1], i, bitRead(original[i], 6)); bitWrite(temporal[0], i, bitRead(original[i], 7)); } memcpy(original, temporal, sizeof(temporal[0])*8); } int MatrizLed::getDeviceCount() { return maxDevices; } void MatrizLed::shutdown(int addr, bool b) { if(addr<0 || addr>=maxDevices) return; if(b) spiTransfer(addr, OP_SHUTDOWN,0); else spiTransfer(addr, OP_SHUTDOWN,1); } void MatrizLed::setScanLimit(int addr, int limit) { if(addr<0 || addr>=maxDevices) return; if(limit>=0 && limit<8) spiTransfer(addr, OP_SCANLIMIT,limit); } void MatrizLed::setIntensity(int addr, int intensity) { if(addr<0 || addr>=maxDevices) return; if(intensity>=0 && intensity<16) spiTransfer(addr, OP_INTENSITY,intensity); } void MatrizLed::clearDisplay(int addr) { int offset; if(addr<0 || addr>=maxDevices) return; offset=addr*8; for(int i=0;i<8;i++) { status[offset+i]=0; spiTransfer(addr, i+1,status[offset+i]); } } void MatrizLed::setLed(int addr, int row, int column, boolean state) { int offset; byte val=0x00; if(addr<0 || addr>=maxDevices) return; if(row<0 || row>7 || column<0 || column>7) return; offset=addr*8; val=B10000000 >> column; if(state) status[offset+row]=status[offset+row]|val; else { val=~val; status[offset+row]=status[offset+row]&val; } spiTransfer(addr, row+1,status[offset+row]); } void MatrizLed::setRow(int addr, int row, byte value) { int offset; if(addr<0 || addr>=maxDevices) return; if(row<0 || row>7) return; offset=addr*8; status[offset+row]=value; spiTransfer(addr, row+1,status[offset+row]); } void MatrizLed::setColumn(int addr, int col, byte value) { byte val; if(addr<0 || addr>=maxDevices) return; if(col<0 || col>7) return; for(int row=0;row<8;row++) { val=value >> (7-row); val=val & 0x01; setLed(addr,row,col,val); } } void MatrizLed::spiTransfer(int addr, volatile byte opcode, volatile byte data) { //Create an array with the data to shift out int offset=addr*2; int maxbytes=maxDevices*2; for(int i=0;i<maxbytes;i++) spidata[i]=(byte)0; //put our device data into the array spidata[offset+1]=opcode; spidata[offset]=data; //enable the line digitalWrite(SPI_CS,LOW); //Now shift out the data for(int i=maxbytes;i>0;i--) shiftOut(SPI_MOSI,SPI_CLK,MSBFIRST,spidata[i-1]); //latch the data onto the display digitalWrite(SPI_CS,HIGH); } void MatrizLed::borrar(){ for(int address=0;address<getDeviceCount();address++) { clearDisplay(address); } } void MatrizLed::escribirCaracter(char caracter, int posicion, bool mini) { int posicion_caracter; // por defecto un asterisco uint8_t codigocaracter[]= {B00000000, B00001000, B00101010, B00011100, B01110111, B00011100, B00101010, B00001000}; if (caracter >= 'A' && caracter <= 'Z'){ posicion_caracter = ((int)caracter - 'A') * 8; for(int i=0; i<8; i++){ //codigocaracter[i]=pgm_read_byte_near(tablaCaracteresMayuscula+i+posicion_caracter); codigocaracter[i]=pgm_read_byte_near(LETRAS+i+posicion_caracter); } }else if (caracter >= 'a' && caracter <= 'z'){ posicion_caracter = ((int)caracter - 'a') * 8; for(int i=0; i<8; i++){ //codigocaracter[i]=pgm_read_byte_near(tablaCaracteresMinuscula+i+posicion_caracter); codigocaracter[i]=pgm_read_byte_near(LETRAS+i+posicion_caracter); } }else if ((mini)&&(caracter >= '0' && caracter <= '9')){ posicion_caracter = ((int)caracter - '0') * 8; for(int i=0; i<8; i++){ //codigocaracter[i]=pgm_read_byte_near(tablaNumeros+i+posicion_caracter); codigocaracter[i]=pgm_read_byte_near(MINI_NUMS+i+posicion_caracter); } }else if (caracter >= '0' && caracter <= '9'){ posicion_caracter = ((int)caracter - '0') * 8; for(int i=0; i<8; i++){ //codigocaracter[i]=pgm_read_byte_near(tablaNumeros+i+posicion_caracter); codigocaracter[i]=pgm_read_byte_near(NUMS+i+posicion_caracter); } }else if (caracter == ' '){ for(int i=0; i<8; i++){ codigocaracter[i]=0; } } // if (rotate) // rotar_caracter(codigocaracter); if (!rotate){ for(int i=0; i<8; i++){ int address = 0; int posendisplay = posicion + i; while (posendisplay > 7){ address++; posendisplay -= 8; } if (address > getDeviceCount() -1 ) return; setRow(address, posendisplay, codigocaracter[i]); } } else{ posicion = ((getDeviceCount()-1)*8)-posicion-1; for(int i=7; i>=0; i--){ int address = getDeviceCount()-1; int posendisplay = posicion - i; while (posendisplay < 0){ address--; posendisplay += 8; } if (address < -1) return; setColumn(address, posendisplay, codigocaracter[i]); } } } void MatrizLed::escribirFrase(const char* frase){ escribirFrase(frase, 0); } void MatrizLed::escribirFrase(const char* frase, int posicion, bool mini){ for (size_t i=0; i < strlen(frase); i++){ escribirCaracter(frase[i], (i*8)+posicion,mini); } } void MatrizLed::escribirCifra(int cifra, int posicion){ char formateado[getDeviceCount()+1]; // Array donde se almacenará el valor formateado (un caracter por pantalla caracteres mas fin de linea) // sprintf con longitud dinamica no funciona en arduino :( // sprintf(formateado, "%.*d", getDeviceCount(), cifra); // guardamos el valor del contador, formateado con dos espacios, como cadena de texto dtostrf(cifra, getDeviceCount(), 0, formateado); escribirFrase(formateado, posicion); } void MatrizLed::escribirCifra(int cifra){ escribirCifra(cifra, 0); } void MatrizLed::escribirFraseScroll(const char* frase, unsigned long pausa){ int inicio = getDeviceCount() * 8; int npasos = strlen(frase) * 8; for(int i = inicio; i > -npasos; i--){ escribirFrase(frase, i); delay(pausa); } } void MatrizLed::setIntensidad(int intensidad){ for(int address=0; address<getDeviceCount(); address++) { setIntensity(address, intensidad); } } void MatrizLed::apagar(){ for(int address=0; address<getDeviceCount(); address++) { shutdown(address, true); } } void MatrizLed::encender(){ for(int address=0; address<getDeviceCount(); address++) { shutdown(address, false); } }
[ "alberto.fernandez@berton.es" ]
alberto.fernandez@berton.es
d94e63336aef24bf14f8002ba409b3b8517d1ee8
54825a61aebae4f1bc978c74d893dfc09fcff53a
/Code/Algorithms/Dynamic Programming/Longest Path In Matrix/main.cpp
7519eab6937478fb5ffb12e4bac561a508f69c46
[]
no_license
tudor199/C-CPP
520a2e5135db51138514e3153c34120811005667
1dd2f3e914f73bdd4f5726e592fccf35f089fca9
refs/heads/master
2021-07-23T13:36:12.064200
2020-05-23T04:52:02
2020-05-23T04:52:02
172,348,824
0
0
null
null
null
null
UTF-8
C++
false
false
1,543
cpp
#include <iostream> #include <fstream> #define nMax 103 using namespace std; ifstream fin("file.in"); int v[nMax][nMax], dp[nMax][nMax] = {}; int n, m; inline max(int d[4], int dn){ int max_d = d[0]; for(int i = 1; i < dn; i ++){ if(max_d < d[i]){ max_d = d[i]; } } return (1 + max_d); } int longestpath(int i, int j){ if(dp[i][j]){ return dp[i][j]; } int d[4] = {},dn = 0; if(i > 1 && v[i - 1][j] > v[i][j]){ d[dn ++] = longestpath(i - 1, j); } if(i < n && v[i + 1][j] > v[i][j]){ d[dn ++] = longestpath(i + 1, j); } if(j > 1 && v[i][j - 1] > v[i][j]){ d[dn ++] = longestpath(i, j - 1); } if(j < m && v[i][j + 1] > v[i][j]){ d[dn ++] = longestpath(i, j + 1); } if(!dn){ dp[i][j] = 1; } else{ dp[i][j] = max(d, dn); } return dp[i][j]; } int main(){ int rez = 1; fin>>n>>m; for(int i = 1; i <= n; i ++){ for(int j = 1; j <= m; j ++){ fin>>v[i][j]; } } for(int i = 1; i <= n; i ++){ for(int j = 1; j <= m; j ++){ if(dp[i][j]){ continue; } dp[i][j] = longestpath(i, j); rez = max(rez, dp[i][j]); } } for(int i = 1; i <= n; i ++){ for(int j = 1; j <= m; j ++){ cout<<dp[i][j]<<" "; } cout<<"\n"; } cout<<rez; return 0; }
[ "tuddor144@gmail.com" ]
tuddor144@gmail.com
3fb2fe6d85df75f456b2abfe50fcc7a270506881
0f941560b5740f790398a9862b4e4e7629aef9b7
/RunTime Polymorphism/memAccess.cpp
7cf01df3e7909700e1a5872acecc4ddbee474c45
[]
no_license
AniruddhaSadhukhan/C-Plus-Plus-Programs
0fde3ebb99e876fda20dae340ec3df7f279c808e
d7674178ba9fb93a7f583071cef60803093bae91
refs/heads/master
2021-10-24T23:14:01.670777
2019-01-02T06:30:41
2019-01-02T06:30:41
178,436,490
0
0
null
null
null
null
UTF-8
C++
false
false
492
cpp
#include<iostream> using namespace std; /*Write a C++ program to access members of base and derived classes using the pointer to objects of both the classes.*/ // by Aniruddha class Base { public: int x; Base() {} Base(int a) : x(a) {} }; class Child:public Base { public: int y; Child() {} Child(int a) : y(a) {} }; int main() { Base b(5); Child c(10); Base *bptr = &b; Child *cptr =&c; cout<<bptr->x<<endl; cout<<cptr->y<<endl; return 0; } /*Sample Output 5 10 */
[ "anisadhukhan1@gmail.com" ]
anisadhukhan1@gmail.com
0a6abf700e63dd49d3771a42cad6e2eff12b8e30
ca04a2ea63e047d29c3c55e3086a9a67dadfbff3
/Source/servers/GameServer/DataRsyncTools.cpp
2d4dbf7782ded57f1af570ce8c4145043ef1de82
[]
no_license
brucelevis/HMX-Server
0eebb7d248c578d6c930c15670927acaf4f13c3d
7b9e21c0771ee42db2842bb17d85d219c8e668d7
refs/heads/master
2020-08-03T17:37:44.209223
2016-06-13T08:49:39
2016-06-13T08:49:39
null
0
0
null
null
null
null
UTF-8
C++
false
false
485
cpp
#include "GameServer_PCH.h" #include "DataRsyncTools.h" DataRsyncTools::DataRsyncTools(ServerSession* pDbServer):m_pDbServer(pDbServer) { } void DataRsyncTools::SavaMixItemNumber(EMixItemNumberType eType,int64 nValue) { } void DataRsyncTools::SaveMixItemBinary(EMixItemBinaryType eType,const char* data,int32 nLen) { } int64 DataRsyncTools::GetMixNumber(EMixItemNumberType eType) { return 0; } void DataRsyncTools::GetMixNumber(EMixItemBinaryType eType,char* o_data) { }
[ "huangzuduan@qq.com" ]
huangzuduan@qq.com
43a1ba5dfeb4c137f954d27a3498b585e61a50a6
97478e6083db1b7ec79680cfcfd78ed6f5895c7d
/chromeos/components/tether/ble_scanner_impl.cc
10b31645dbfeeb25ccdf93bf98cc04f1e9a99c84
[ "BSD-3-Clause" ]
permissive
zeph1912/milkomeda_chromium
94e81510e1490d504b631a29af2f1fef76110733
7b29a87147c40376bcdd1742f687534bcd0e4c78
refs/heads/master
2023-03-15T11:05:27.924423
2018-12-19T07:58:08
2018-12-19T07:58:08
null
0
0
null
null
null
null
UTF-8
C++
false
false
12,505
cc
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chromeos/components/tether/ble_scanner_impl.h" #include "base/bind.h" #include "base/memory/ptr_util.h" #include "base/strings/string_util.h" #include "base/threading/thread_task_runner_handle.h" #include "chromeos/components/tether/ble_constants.h" #include "chromeos/components/tether/ble_synchronizer.h" #include "components/cryptauth/proto/cryptauth_api.pb.h" #include "components/cryptauth/remote_device.h" #include "components/proximity_auth/logging/logging.h" #include "device/bluetooth/bluetooth_device.h" #include "device/bluetooth/bluetooth_discovery_session.h" #include "device/bluetooth/bluetooth_uuid.h" namespace chromeos { namespace tether { namespace { // Valid service data must include at least 4 bytes: 2 bytes associated with the // scanning device (used as a scan filter) and 2 bytes which identify the // advertising device to the scanning device. const size_t kMinNumBytesInServiceData = 4; } // namespace // static BleScannerImpl::Factory* BleScannerImpl::Factory::factory_instance_ = nullptr; // static std::unique_ptr<BleScanner> BleScannerImpl::Factory::NewInstance( scoped_refptr<device::BluetoothAdapter> adapter, cryptauth::LocalDeviceDataProvider* local_device_data_provider, BleSynchronizerBase* ble_synchronizer) { if (!factory_instance_) factory_instance_ = new Factory(); return factory_instance_->BuildInstance(adapter, local_device_data_provider, ble_synchronizer); } // static void BleScannerImpl::Factory::SetInstanceForTesting(Factory* factory) { factory_instance_ = factory; } std::unique_ptr<BleScanner> BleScannerImpl::Factory::BuildInstance( scoped_refptr<device::BluetoothAdapter> adapter, cryptauth::LocalDeviceDataProvider* local_device_data_provider, BleSynchronizerBase* ble_synchronizer) { return base::MakeUnique<BleScannerImpl>(adapter, local_device_data_provider, ble_synchronizer); } BleScannerImpl::ServiceDataProviderImpl::ServiceDataProviderImpl() = default; BleScannerImpl::ServiceDataProviderImpl::~ServiceDataProviderImpl() = default; const std::vector<uint8_t>* BleScannerImpl::ServiceDataProviderImpl::GetServiceDataForUUID( device::BluetoothDevice* bluetooth_device) { return bluetooth_device->GetServiceDataForUUID( device::BluetoothUUID(kAdvertisingServiceUuid)); } BleScannerImpl::BleScannerImpl( scoped_refptr<device::BluetoothAdapter> adapter, cryptauth::LocalDeviceDataProvider* local_device_data_provider, BleSynchronizerBase* ble_synchronizer) : adapter_(adapter), local_device_data_provider_(local_device_data_provider), ble_synchronizer_(ble_synchronizer), service_data_provider_(base::MakeUnique<ServiceDataProviderImpl>()), eid_generator_(base::MakeUnique<cryptauth::ForegroundEidGenerator>()), task_runner_(base::ThreadTaskRunnerHandle::Get()), weak_ptr_factory_(this) { adapter_->AddObserver(this); } BleScannerImpl::~BleScannerImpl() { adapter_->RemoveObserver(this); } bool BleScannerImpl::RegisterScanFilterForDevice( const cryptauth::RemoteDevice& remote_device) { if (registered_remote_devices_.size() >= kMaxConcurrentAdvertisements) { // Each scan filter corresponds to an advertisement. Thus, the number of // concurrent advertisements cannot exceed the maximum number of concurrent // advertisements. PA_LOG(WARNING) << "Attempted to start a scan for a new device when the " << "maximum number of devices have already been " << "registered."; return false; } std::vector<cryptauth::BeaconSeed> local_device_beacon_seeds; if (!local_device_data_provider_->GetLocalDeviceData( nullptr, &local_device_beacon_seeds)) { PA_LOG(WARNING) << "Error fetching the local device's beacon seeds. Cannot " << "generate scan without beacon seeds."; return false; } std::unique_ptr<cryptauth::ForegroundEidGenerator::EidData> scan_filters = eid_generator_->GenerateBackgroundScanFilter(local_device_beacon_seeds); if (!scan_filters) { PA_LOG(WARNING) << "Error generating background scan filters. Cannot scan"; return false; } registered_remote_devices_.push_back(remote_device); UpdateDiscoveryStatus(); return true; } bool BleScannerImpl::UnregisterScanFilterForDevice( const cryptauth::RemoteDevice& remote_device) { for (auto it = registered_remote_devices_.begin(); it != registered_remote_devices_.end(); ++it) { if (it->GetDeviceId() == remote_device.GetDeviceId()) { registered_remote_devices_.erase(it); UpdateDiscoveryStatus(); return true; } } return false; } bool BleScannerImpl::ShouldDiscoverySessionBeActive() { return !registered_remote_devices_.empty(); } bool BleScannerImpl::IsDiscoverySessionActive() { ResetDiscoverySessionIfNotActive(); if (discovery_session_) { // Once the session is stopped, the pointer is cleared. DCHECK(discovery_session_->IsActive()); return true; } return false; } void BleScannerImpl::SetTestDoubles( std::unique_ptr<ServiceDataProvider> service_data_provider, std::unique_ptr<cryptauth::ForegroundEidGenerator> eid_generator, scoped_refptr<base::TaskRunner> test_task_runner) { service_data_provider_ = std::move(service_data_provider); eid_generator_ = std::move(eid_generator); task_runner_ = test_task_runner; } bool BleScannerImpl::IsDeviceRegistered(const std::string& device_id) { for (auto it = registered_remote_devices_.begin(); it != registered_remote_devices_.end(); ++it) { if (it->GetDeviceId() == device_id) { return true; } } return false; } void BleScannerImpl::DeviceAdded(device::BluetoothAdapter* adapter, device::BluetoothDevice* bluetooth_device) { DCHECK_EQ(adapter_.get(), adapter); HandleDeviceUpdated(bluetooth_device); } void BleScannerImpl::DeviceChanged(device::BluetoothAdapter* adapter, device::BluetoothDevice* bluetooth_device) { DCHECK_EQ(adapter_.get(), adapter); HandleDeviceUpdated(bluetooth_device); } void BleScannerImpl::ResetDiscoverySessionIfNotActive() { if (!discovery_session_ || discovery_session_->IsActive()) return; PA_LOG(ERROR) << "BluetoothDiscoverySession became out of sync. Session is " << "no longer active, but it was never stopped successfully. " << "Resetting session."; // |discovery_session_| should be deleted whenever the session is no longer // active. However, due to Bluetooth bugs, this does not always occur // properly. When we detect that this situation has occurred, delete the // pointer and reset discovery state. discovery_session_.reset(); discovery_session_weak_ptr_factory_.reset(); is_initializing_discovery_session_ = false; is_stopping_discovery_session_ = false; weak_ptr_factory_.InvalidateWeakPtrs(); ScheduleStatusChangeNotification(false /* discovery_session_active */); } void BleScannerImpl::UpdateDiscoveryStatus() { if (ShouldDiscoverySessionBeActive()) EnsureDiscoverySessionActive(); else EnsureDiscoverySessionNotActive(); } void BleScannerImpl::EnsureDiscoverySessionActive() { // If the session is active or is in the process of becoming active, there is // nothing to do. if (IsDiscoverySessionActive() || is_initializing_discovery_session_) return; is_initializing_discovery_session_ = true; ble_synchronizer_->StartDiscoverySession( base::Bind(&BleScannerImpl::OnDiscoverySessionStarted, weak_ptr_factory_.GetWeakPtr()), base::Bind(&BleScannerImpl::OnStartDiscoverySessionError, weak_ptr_factory_.GetWeakPtr())); } void BleScannerImpl::OnDiscoverySessionStarted( std::unique_ptr<device::BluetoothDiscoverySession> discovery_session) { is_initializing_discovery_session_ = false; PA_LOG(INFO) << "Started discovery session successfully."; discovery_session_ = std::move(discovery_session); discovery_session_weak_ptr_factory_ = base::MakeUnique<base::WeakPtrFactory<device::BluetoothDiscoverySession>>( discovery_session_.get()); ScheduleStatusChangeNotification(true /* discovery_session_active */); UpdateDiscoveryStatus(); } void BleScannerImpl::OnStartDiscoverySessionError() { PA_LOG(ERROR) << "Error starting discovery session. Initialization failed."; is_initializing_discovery_session_ = false; UpdateDiscoveryStatus(); } void BleScannerImpl::EnsureDiscoverySessionNotActive() { // If there is no session, there is nothing to do. if (!IsDiscoverySessionActive() || is_stopping_discovery_session_) return; is_stopping_discovery_session_ = true; ble_synchronizer_->StopDiscoverySession( discovery_session_weak_ptr_factory_->GetWeakPtr(), base::Bind(&BleScannerImpl::OnDiscoverySessionStopped, weak_ptr_factory_.GetWeakPtr()), base::Bind(&BleScannerImpl::OnStopDiscoverySessionError, weak_ptr_factory_.GetWeakPtr())); } void BleScannerImpl::OnDiscoverySessionStopped() { is_stopping_discovery_session_ = false; PA_LOG(INFO) << "Stopped discovery session successfully."; discovery_session_.reset(); discovery_session_weak_ptr_factory_.reset(); ScheduleStatusChangeNotification(false /* discovery_session_active */); UpdateDiscoveryStatus(); } void BleScannerImpl::OnStopDiscoverySessionError() { PA_LOG(ERROR) << "Error stopping discovery session."; is_stopping_discovery_session_ = false; UpdateDiscoveryStatus(); } void BleScannerImpl::HandleDeviceUpdated( device::BluetoothDevice* bluetooth_device) { DCHECK(bluetooth_device); const std::vector<uint8_t>* service_data = service_data_provider_->GetServiceDataForUUID(bluetooth_device); if (!service_data || service_data->size() < kMinNumBytesInServiceData) { // If there is no service data or the service data is of insufficient // length, there is not enough information to create a connection. return; } // Convert the service data from a std::vector<uint8_t> to a std::string. std::string service_data_str; char* string_contents_ptr = base::WriteInto(&service_data_str, service_data->size() + 1); memcpy(string_contents_ptr, service_data->data(), service_data->size()); CheckForMatchingScanFilters(bluetooth_device, service_data_str); } void BleScannerImpl::CheckForMatchingScanFilters( device::BluetoothDevice* bluetooth_device, std::string& service_data) { std::vector<cryptauth::BeaconSeed> beacon_seeds; if (!local_device_data_provider_->GetLocalDeviceData(nullptr, &beacon_seeds)) { // If no beacon seeds are available, the scan cannot be checked for a match. return; } const cryptauth::RemoteDevice* identified_device = eid_generator_->IdentifyRemoteDeviceByAdvertisement( service_data, registered_remote_devices_, beacon_seeds); // If the service data does not correspond to an advertisement from a device // on this account, ignore it. if (!identified_device) return; // Make a copy before notifying observers. Since |identified_device| refers // to an instance variable, it is possible that an observer could unregister // that device, which would change the value of that pointer. const cryptauth::RemoteDevice copy = *identified_device; NotifyReceivedAdvertisementFromDevice(copy, bluetooth_device); } void BleScannerImpl::ScheduleStatusChangeNotification( bool discovery_session_active) { // Schedule the task to run after the current task has completed. This is // necessary because the completion of a Bluetooth task may cause the Tether // component to be shut down; if that occurs, then we cannot reference // instance variables in this class after the object has been deleted. // Completing the current command as part of the next task ensures that this // cannot occur. See crbug.com/776241. task_runner_->PostTask( FROM_HERE, base::Bind(&BleScannerImpl::NotifyDiscoverySessionStateChanged, weak_ptr_factory_.GetWeakPtr(), discovery_session_active)); } } // namespace tether } // namespace chromeos
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
60a943e4171a04d13f2ed297731fcbb6047dbafc
6264ccde72c90774ab05d7d6acc8668429ddbc49
/Engine/gkGameObjectInstance.cpp
65b7143b9e991addf6acde738d4644a796e19b46
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
blendkit/gamekit-playground-src
184eb933d9580ff49200d889a85e5648a04cd661
457f872fd69ebd12ed3c6125ee291a61a1725f00
refs/heads/master
2021-07-12T07:52:41.744125
2017-10-08T17:24:47
2017-10-08T17:24:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
12,239
cpp
/* ------------------------------------------------------------------------------- This file is part of OgreKit. http://gamekit.googlecode.com/ Copyright (c) 2006-2010 Charlie C. Contributor(s): Thomas Trocha (dertom) ------------------------------------------------------------------------------- This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ------------------------------------------------------------------------------- */ #include "gkGameObjectInstance.h" #include "gkGameObjectGroup.h" #include "gkGameObject.h" #include "gkGameObjectManager.h" #include "gkScene.h" #include "gkUtils.h" #include "gkLogger.h" #include "gkValue.h" #include "gkSkeleton.h" #include "gkEntity.h" #include "gkBone.h" #include "gkSkeletonResource.h" #include "gkGroupManager.h" gkGameObjectInstance::gkGameObjectInstance(gkInstancedManager* creator, const gkResourceName& name, const gkResourceHandle& handle) : gkInstancedObject(creator, name, handle), m_parent(0), m_scene(0), m_owner(0), m_uidName(gkString("/UID{" + gkToString((int)handle) + "}")), m_layer(0xFFFFFFFF) { } gkGameObjectInstance::~gkGameObjectInstance() { m_owner->removeEventListener(this); if (m_owner != 0) gkGameObjectManager::getSingleton().destroy(m_owner->getResourceHandle()); m_owner = 0; Objects::Iterator iter = m_objects.iterator(); while (iter.hasMoreElements()) { gkGameObject* gobj = iter.getNext().second; m_objInitialTransformstates.remove(gobj); GK_ASSERT(!gobj->isInstanced()); delete gobj; } m_objects.clear(); } void gkGameObjectInstance::_setExternalRoot(gkGameObjectGroup* group, gkGameObject* root) { GK_ASSERT(!m_parent); if (!m_parent) { m_parent = group; m_owner = root; if (root != 0) root->addEventListener(this); } } void gkGameObjectInstance::_updateFromGroup(gkGameObjectGroup* group) { GK_ASSERT(!m_parent); if (!m_parent) { m_parent = group; // create the root object m_owner = gkGameObjectManager::getSingleton().createObject(m_name); if (m_owner != 0) m_owner->addEventListener(this); } } void gkGameObjectInstance::addObject(gkGameObject* gobj) { if (!gobj) return; const gkResourceNameString& name = gobj->getName() + m_uidName; if (m_objects.find(name) != UT_NPOS) { gkLogMessage("GameObjectInstance: Duplicate object " << name.str() << "."); return; } gkGameObject* ngobj = gobj->cloneToScene(name.str(),m_owner->getOwner()); // store the inital-transformstates gkTransformState initalTransformState = ngobj->getTransformState(); m_objInitialTransformstates.insert(ngobj,initalTransformState); // modify the parent (if there is one) to fit the group's uid gkString propParent = ngobj->getProperties().m_parent; if (!propParent.empty()) { ngobj->getProperties().m_parent = propParent + m_uidName; } // store the new object using the original name and not the uid-name // making it easier to lookup an object by name m_objects.insert(gobj->getName(), ngobj); ngobj->_setOriginalName(gobj->getName()); // Lightly attach ngobj->_makeGroupInstance(this); gkScene* instanceScene = getRoot()->getOwner(); ngobj->setActiveLayer((instanceScene->getLayer() & m_layer) != 0); ngobj->setLayer(m_layer); } void gkGameObjectInstance::addGroupInstance(const gkGameObjectGroup::GroupInstance* grpDesc) { if (!grpDesc) return; gkGroupManager* mgr = gkGroupManager::getSingletonPtr(); if (mgr->exists(grpDesc->m_groupName)) { gkGameObjectGroup* ggobj = (gkGameObjectGroup*)mgr->getByName(grpDesc->m_groupName); gkScene* toScene = m_owner->getOwner(); // clone the root with all of its properties and logicbricks gkGameObject* rootClone = grpDesc->m_root->cloneToScene(gkUtils::getUniqueName(grpDesc->m_root->getName()),toScene); gkGameObjectInstance* inst = ggobj->createGroupInstance(toScene, gkResourceName(gkUtils::getUniqueName("gi"+grpDesc->m_root->getName()), ""), rootClone, toScene->getLayer()); gkGameObject* instRoot = inst->getRoot(); // store the inital-transformstates gkTransformState initalTransformState = instRoot->getTransformState(); m_objInitialTransformstates.insert(instRoot,initalTransformState); m_groupInstances.insert(grpDesc->m_root->getName(), inst); // modify the parent (if there is one) to fit the group's uid gkString propParent = instRoot->getProperties().m_parent; if (!propParent.empty()) { instRoot->getProperties().m_parent = propParent + m_uidName; } } } gkGameObject* gkGameObjectInstance::getObject(const gkHashedString& name) { UTsize pos; if ((pos = m_objects.find(name)) == UT_NPOS) { gkLogMessage("GameObjectInstance: Missing object " << name.str() << "."); return 0; } return m_objects.at(pos); } void gkGameObjectInstance::destroyObject(gkGameObject* gobj) { if (!gobj) return; if (gobj->getGroupInstance() != this) { gkLogMessage("GameObjectInstance: Attempting to remove an object that does not belong to this instance!"); return; } const gkHashedString name = gobj->getName(); UTsize pos; if ((pos = m_objects.find(name)) == UT_NPOS) { gkLogMessage("GameObjectInstance: Missing object " << name.str() << "."); return; } m_objects.remove(name); delete gobj; } void gkGameObjectInstance::destroyObject(const gkHashedString& name) { UTsize pos; if ((pos = m_objects.find(name)) == UT_NPOS) { gkLogMessage("GameObjectInstance: Missing object " << name.str() << "."); return; } gkGameObject* gobj = m_objects.at(pos); gobj->destroyInstance(); m_objects.remove(name); delete gobj; } bool gkGameObjectInstance::hasObject(const gkHashedString& name) { return m_objects.find(name) != UT_NPOS; } void gkGameObjectInstance::applyTransform(const gkTransformState& trans) { // if (!isInstanced()) // return; const gkMatrix4 plocal = trans.toMatrix(); Objects::Iterator iter = m_objects.iterator(); while (iter.hasMoreElements()) { gkGameObject* obj = iter.getNext().second; if (obj->hasParent()) { continue; } gkTransformState* initalTransformState = m_objInitialTransformstates.get(obj); if (initalTransformState){ // Update transform relative to owner gkMatrix4 clocal; initalTransformState->toMatrix(clocal); obj->setTransform(plocal * clocal); } } GroupInstances::Iterator grpInstIter = m_groupInstances.iterator(); while (grpInstIter.hasMoreElements()) { gkGameObjectInstance* ginst = grpInstIter.getNext().second; gkGameObject* obj = ginst->getRoot(); if (obj->hasParent()) { continue; } gkTransformState* initalTransformState = m_objInitialTransformstates.get(obj); // Update transform relative to owner gkMatrix4 clocal; initalTransformState->toMatrix(clocal); obj->setTransform(plocal * clocal); } } bool gkGameObjectInstance::hasObject(gkGameObject* gobj) { return gobj && m_objects.find(gobj->getName()) && gobj->getGroupInstance() == this; } void gkGameObjectInstance::cloneObjects(gkScene* scene, const gkTransformState& from, int time, const gkVector3& linearVelocity, bool tsLinLocal, const gkVector3& angularVelocity, bool tsAngLocal) { if (!isInstanced()) return; GK_ASSERT(scene); const gkMatrix4 plocal = from.toMatrix(); Objects::Iterator iter = m_objects.iterator(); while (iter.hasMoreElements()) { gkGameObject* oobj = iter.getNext().second; gkGameObject* nobj = scene->cloneObject(oobj, time); // be sure this info was not cloned! GK_ASSERT(!nobj->isGroupInstance()); // Update transform relative to owner gkGameObjectProperties& props = nobj->getProperties(); gkMatrix4 clocal; props.m_transform.toMatrix(clocal); // merge back to transform state props.m_transform = gkTransformState(plocal * clocal); nobj->createInstance(); if (props.isRigidOrDynamic() || props.isGhost()) { if (!linearVelocity.isZeroLength()) nobj->setLinearVelocity(linearVelocity, tsLinLocal ? TRANSFORM_LOCAL : TRANSFORM_PARENT); } if (props.isRigid()) { if (!angularVelocity.isZeroLength()) nobj->setAngularVelocity(angularVelocity, tsAngLocal ? TRANSFORM_LOCAL : TRANSFORM_PARENT); } } } void gkGameObjectInstance::createInstanceImpl(void) { if (!m_owner || !m_owner->getOwner()) { m_instanceState = ST_ERROR; m_instanceError = "Root object is not in any scene!"; return; } gkScene* scene = m_owner->getOwner(); m_owner->createInstance(); gkGameObjectSet parentingPhysicsObjs; // first check for entities that are parented to a skeleton { Objects::Iterator iter = m_objects.iterator(); while (iter.hasMoreElements()) { gkGameObject* gobj = iter.getNext().second; if (gobj->getType() == GK_ENTITY) { gkString parentName = gobj->getProperties().m_parent; gkGameObject* parent = NULL; Objects::Iterator iter2 = m_objects.iterator(); while (iter2.hasMoreElements()) { gkGameObject* pobj = iter2.getNext().second; if (pobj->getName()==parentName) { parent = pobj; break; } } if (parent && parent->getType()==GK_SKELETON){ gkSkeleton* skel; skel = static_cast<gkSkeleton*>(parent); gkEntity* ent; ent = static_cast<gkEntity*>(gobj); if (!gobj->getProperties().hasBoneParent()) { ent->setSkeleton(skel); gkSkeletonResource* skelRes = skel->getInternalSkeleton(); gkBone::BoneList::Iterator roots = skelRes->getRootBoneList().iterator(); } } } } } // now instantiate the group-instance-objects { Objects::Iterator iter = m_objects.iterator(); while (iter.hasMoreElements()) { gkGameObject* gobj = iter.getNext().second; gobj->setOwner(scene); gobj->createInstance(); parentingPhysicsObjs.insert(gobj); } } // instantiate nested group-instances { GroupInstances::Iterator iter = m_groupInstances.iterator(); while (iter.hasMoreElements()){ gkGameObjectInstance* inst = iter.getNext().second; inst->createInstance(); // add the group-instances root to be checked for parenting purposes parentingPhysicsObjs.insert(inst->getRoot()); } } scene->_applyBuiltinParents(parentingPhysicsObjs); applyTransform(m_owner->getTransformState()); scene->_applyBuiltinPhysics(parentingPhysicsObjs); } void gkGameObjectInstance::postCreateInstanceImpl(void) { } void gkGameObjectInstance::destroyInstanceImpl(void) { if (!m_owner || !m_owner->getOwner()) { m_instanceState = ST_ERROR; m_instanceError = "Root object is not in any scene!"; return; } Objects::Iterator iter = m_objects.iterator(); while (iter.hasMoreElements()) { gkGameObject* gobj = iter.getNext().second; gobj->destroyInstance(); gobj->setOwner(0); gobj->setParent(0); } GroupInstances::Iterator grpInstIter = m_groupInstances.iterator(); while (grpInstIter.hasMoreElements()) { gkGameObjectInstance* gobj = grpInstIter.getNext().second; gobj->destroyInstance(); } m_owner->destroyInstance(); } void gkGameObjectInstance::postDestroyInstanceImpl() { m_owner->getOwner()->notifyGroupInstanceDestroyed(this); } void gkGameObjectInstance::notifyGameObjectEvent(gkGameObject* gobj, const gkGameObject::Notifier::Event& id) { GK_ASSERT(gobj == m_owner); if (id == gkGameObject::Notifier::UPDATED) applyTransform(gobj->getWorldTransformState()); else if (id == gkGameObject::Notifier::INSTANCE_DESTROYED) destroyInstance(); }
[ "thomas.trocha@gmail.com" ]
thomas.trocha@gmail.com
e6836346f360438aa1d00913425b669c38c1d757
7d4c5353e5d2cf21c0299ade2c7fba5c2ced0565
/Simulation.cpp
e02457c005132bafa8c36a9bf723377b12e8d63e
[]
no_license
YongonY/NBLDPC
bc39e0520e4b2fd60365e3e8f31e39e265e2ba2b
0e5011c7868103bab3f105dec77cbca30fc7c4bd
refs/heads/master
2020-04-26T08:22:47.081619
2019-03-02T08:23:58
2019-03-02T08:23:58
173,421,222
4
1
null
null
null
null
GB18030
C++
false
false
10,159
cpp
#include "Simulation.h" #include <iostream> #include <fstream> using namespace std; CSimulation::CSimulation(void) : GFq(0) , nQAM(0) , PuntureVarDegree(0) , randomMsg(0) , decodeMethod(0) , ems_nm(0) , ems_nc(0) , ems_factor(0) , ems_offset(0) , maxIter(0) , minSimCycle(0) , minErrFrame(0) , randomseed(0) , snrBegin(0) , snrStep(0) , snrStop(0) , current_time(NULL) , simCycle(0) , errFrame(0) , errBit(0) , errSym(0) , FER(0) , BER(0) , SER(0) , EbN0(0) , showSimFrameStep(0) , tems_nr(0) , tems_nc(0) , tems_factor(0) , tems_offset(0) , U_errFrame(0) , U_errBit(0) , U_errSym(0) , U_FER(0) , U_BER(0) , U_SER(0) { } CSimulation::~CSimulation(void) { } int CSimulation::Initial(string profilename) { // read profile string rub; ifstream profile(profilename); profile >> rub >> GFq; profile >> rub >> rub >> NonBinaryFileName; profile >> rub >> rub >> PuntureVarDegree; profile >> rub >> rub >> decodeMethod; profile >> rub >> rub >> maxIter; profile >> rub >> parallel; //crc profile >> rub >> crcLen; profile >> rub >> crc_correctLen; //OSD profile >> rub >> OSD_order; profile >> rub >> OSD_factor; profile >> rub >> OSD_flag; // ems profile >> rub >> rub >> ems_nm; profile >> rub >> rub >> ems_nc; profile >> rub >> rub >> ems_factor; profile >> rub >> rub >> ems_offset; // t-ems profile >> rub >> rub >> tems_nr; profile >> rub >> rub >> tems_nc; profile >> rub >> rub >> tems_factor; profile >> rub >> rub >> tems_offset; // bs-tems profile >> rub >> rub >> bs_tems_nm; profile >> rub >> rub >> bs_tems_nc; profile >> rub >> rub >> bs_tems_factor; profile >> rub >> rub >> bs_tems_offset; // channel profile >> rub >> rub >> snrBegin; profile >> rub >> rub >> snrStep; profile >> rub >> rub >> snrStop; // modulation profile >> rub >> nQAM; profile >> rub >> ConstellationFileName; profile >> rub >> rub >> randomMsg; profile >> rub >> rub >> rub >> minErrFrame; profile >> rub >> rub >> rub >> U_minErrFrame; profile >> rub >> rub >> rub >> minSimCycle; profile >> rub >> rub >> randomseed; profile >> rub >> rub >> rub >> showSimFrameStep; profile.close(); // record file fout.open("NBLDPC.Decode.Sim.Record.txt", ios::app); // record time t = time(NULL); current_time = localtime(&t); // EbN0 EbN0 = snrBegin - snrStep; return 0; } int CSimulation::Show(int mode)//Screen_开头的是用于控制台显示;File_开头是用于日志中的显示 { switch(mode) { case Screen_Logo: { cout << "******************************************************************************\n" << "******* NBLDPC Decoding Simulation editor:SXS&YX *******\n" << "******************************************************************************\n" << endl; break; } case Screen_Conf: { cout << "Configuration lists as follows:\n" << "Code: " << NonBinaryFileName << "\nGF: " << GFq << "\tPuncture Variable Degree: " << PuntureVarDegree << "\tMaximum iterations: " << maxIter << "\tparallel: " << parallel << endl; cout << "crcLen: " << crcLen << "\tcrcusedforcorrect: " << crc_correctLen << "\tOSD_order: " << OSD_order << "\tOSD_factor: " << OSD_factor << "\tOSD_flag: " << OSD_flag << endl; switch(decodeMethod) { case BP_DECODE: { cout << "Algorithm: " << "BP" << decodeMethod <<endl; break; } case EMS_DECODE: { cout << "Algorithm: " << "EMS"; cout << "\tNm: " << ems_nm << "\tNc: " << ems_nc << "\tFactor: " << ems_factor << "\tOffset: " << ems_offset << endl; break; } case MinMax_DECODE: { cout << "Algorithm: " << "Min Max" << endl; break; } case T_EMS_DECODE: { cout << "Algorithm: " << "Trellis EMS"; cout << "\tNr: " << tems_nr << "\tNc: " << tems_nc << "\tFactor: " << tems_factor << "\tOffset: " << tems_offset << endl; break; } case T_MinMax_DECODE: { cout << "Algorithm: " << "Trellis Min Max" << endl; break; } case OSD_DECODE: { cout << "Algorithm: " << "OSD" << endl; break; } case BS_TEMS_DECODE: { cout << "Algorithm: " << "BS_TEMS_DECODE" ; cout << "\tBS_TEMS_Nm: " << bs_tems_nm << "\tBS_TEMS_Nc: " << bs_tems_nc << "\tFactor: " << bs_tems_factor << "\tOffset: " << bs_tems_offset << endl; break; } } cout << "Modulation: " << nQAM << "-QAM" << "\tConf: " << ConstellationFileName << endl; cout << "SNR: " << snrBegin << ":" << snrStep << ":" << snrStop; switch(randomMsg) { case Rand_Seq: { cout << "\tRandom Sequence\n" << "Min Err Frame: " << minErrFrame << "\tMin U_Err Frame: " << U_minErrFrame << "\tMin Sim Frame: " << minSimCycle << "\tRand Seed: " << randomseed << endl; break; } case All_0_Seq: { cout << "\tALL 0 sequence\n" << "Min Err Frame: " << minErrFrame << "t\Min U_Err Frame: " << U_minErrFrame << "\tMin Sim Frame: " << minSimCycle << "\tRand Seed: " << randomseed << endl; break; } } break; } case Screen_Head: { cout << "EbN0\t" << "Error\t" <<"CRCmiss\t"<< "BER\t\t" << "SER\t\t" << "FER\t\t" << "U-FER\t\t" <<"Time" << endl; break; } case Screen_Sim_Data: { if (long(simCycle) % showSimFrameStep == 0) { cout << defaultfloat << EbN0 << '\t' << errFrame << '\t' << U_errFrame << '\t'; cout << scientific << BER << '\t' << SER << '\t' << FER << '\t' << U_FER << '\t' << simCycle << '\r'; } break; } case Screen_Sim_End_Data: { stop = clock(); cout << defaultfloat << EbN0 << '\t' << errFrame << '\t' << U_errFrame << '\t'; cout << scientific << BER << '\t' << SER << '\t' << FER << '\t' << U_FER << '\t' << 1.0 * (stop - start) / CLOCKS_PER_SEC << endl; break; } //以下是日志显示********************************************************************************************************* case File_Conf: { fout << "\n\n\nConfiguration lists as follows:\n" << "Code: " << NonBinaryFileName << "\nGF: " << GFq << "\tPuncture Variable Degree: " << PuntureVarDegree << "\tMaximum iterations: " << maxIter << endl; switch (decodeMethod) { case BP_DECODE: { fout << "Algorithm: " << "BP" << endl; break; } case EMS_DECODE: { fout << "Algorithm: " << "EMS"; fout << "\tNm: " << ems_nm << "\tNc: " << ems_nc << "\tFactor: " << ems_factor << "\tOffset: " << ems_offset << endl; break; } case MinMax_DECODE: { fout << "Algorithm: " << "Min Max" << endl; break; } case T_EMS_DECODE: { fout << "Algorithm: " << "Trellis EMS"; fout << "\tNr: " << tems_nr << "\tNc: " << tems_nc << "\tFactor: " << tems_factor << "\tOffset: " << tems_offset << endl; break; } case T_MinMax_DECODE: { fout << "Algorithm: " << "Trellis Min Max" << endl; break; } case OSD_DECODE: { fout << "Algorithm: " << "OSD" << endl; break; } case BS_TEMS_DECODE: { fout << "Algorithm: " << "BS_TEMS_DECODE"; fout << "\tBS_TEMS_Nm: " << bs_tems_nm << "\tBS_TEMS_Nc: " << bs_tems_nc << "\tFactor: " << bs_tems_factor << "\tOffset: " << bs_tems_offset << endl; break; } } fout << "Modulation: " << nQAM << "-QAM" << "\tConf: " << ConstellationFileName << endl; fout << "SNR: " << snrBegin << ":" << snrStep << ":" << snrStop; switch (randomMsg) { case Rand_Seq: { fout << "\tRandom Sequence\n" << "Min Err Frame: " << minErrFrame << "\tMin Sim Frame: " << minSimCycle << "\tRand Seed: " << randomseed << endl; break; } case All_0_Seq: { fout << "\tALL 0 sequence\n" << "Min Err Frame: " << minErrFrame << "\tMin Sim Frame: " << minSimCycle << "\tRand Seed: " << randomseed << endl; break; } } break; } case File_Head: { fout << "EbN0\t" << "Error\t" << "CRCmiss\t" << "BER\t\t" << "SER\t\t" << "FER\t\t" << "U-FER\t\t" << "Time" << endl; break; } case File_Begin_Time: { fout << "\nBegin in: " << current_time -> tm_year + 1900 << "-" << current_time -> tm_mon + 1 << "-" << current_time -> tm_mday << "," << current_time -> tm_hour << ":" << current_time -> tm_min << ":" << current_time -> tm_sec << endl; break; } case File_End_Time: { fout << "End in: " << current_time -> tm_year + 1900 << "-" << current_time -> tm_mon + 1 << "-" << current_time -> tm_mday << "," << current_time -> tm_hour << ":" << current_time -> tm_min << ":" << current_time -> tm_sec << "\n\n" << endl; break; } case File_Sim_Data: { if(long(simCycle) % (showSimFrameStep * 100000) == 0) { status = clock(); if(int(1.0 * (status - start) / CLOCKS_PER_SEC / 450) % 2 == 0) { fout << defaultfloat << EbN0 << '\t' << errFrame<< '\t'; fout << scientific << BER << '\t' << SER << '\t' << FER << '\t' << simCycle << '\t' << 1.0 * (status - start) / CLOCKS_PER_SEC << endl; } } break; } case File_Sim_End_Data: { stop = clock(); fout << defaultfloat << EbN0 << '\t' << errFrame << '\t'; fout << scientific << BER << '\t' << SER << '\t' << FER << '\t' << U_BER << '\t' << U_SER << '\t' << U_FER << '\t' << simCycle << '\t' << 1.0 * (stop - start) / CLOCKS_PER_SEC << " **** "<< endl; break; } } return 0; } int CSimulation::ClearSimuCount(void) { simCycle = 0; errFrame = errBit = errSym = 0; U_errFrame = U_errBit = U_errSym = 0; start = clock(); return 0; } bool CSimulation::NextSNR(void) { // EbN0 = Simulation.snrBegin; EbN0 <= Simulation.snrStop; EbN0 += Simulation.snrStep EbN0 += snrStep; if(EbN0 > snrStop) return false; else return true; } bool CSimulation::SimulateThisSNR(void) { return ((simCycle++)*parallel <= minSimCycle) || (errFrame <= minErrFrame) || (U_errFrame <= U_minErrFrame) ; }
[ "noreply@github.com" ]
YongonY.noreply@github.com
8a9ca27a37141b694611cc01ceccaf954208824a
92494691d9de19d64254d4a5e8c59c184773906f
/src/qt/optionsmodel.h
c4d73c5a8695b1387f2da8e1e1ce5057b0c684e1
[ "LicenseRef-scancode-proprietary-license", "MIT" ]
permissive
xagau/Placeholders-X16R
ffaad0c6b0cb24872932c6663c2d7ee4cc6c3c97
5f96720e1d7f5bd6d5b574d9f3c12485c265ef33
refs/heads/master
2022-01-24T03:58:04.558002
2022-01-13T22:21:18
2022-01-13T22:21:18
162,598,084
23
10
MIT
2021-04-23T03:09:01
2018-12-20T15:31:28
C++
UTF-8
C++
false
false
3,729
h
// Copyright (c) 2011-2016 The Bitcoin Core developers // Copyright (c) 2017 The Placeholder Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef PLACEH_QT_OPTIONSMODEL_H #define PLACEH_QT_OPTIONSMODEL_H #include "amount.h" #include <QAbstractListModel> QT_BEGIN_NAMESPACE class QNetworkProxy; QT_END_NAMESPACE /** Interface from Qt to configuration data structure for Placeh client. To Qt, the options are presented as a list with the different options laid out vertically. This can be changed to a tree once the settings become sufficiently complex. */ class OptionsModel : public QAbstractListModel { Q_OBJECT public: explicit OptionsModel(QObject *parent = 0, bool resetSettings = false); enum OptionID { StartAtStartup, // bool HideTrayIcon, // bool MinimizeToTray, // bool MapPortUPnP, // bool MinimizeOnClose, // bool ProxyUse, // bool ProxyIP, // QString ProxyPort, // int ProxyUseTor, // bool ProxyIPTor, // QString ProxyPortTor, // int DisplayUnit, // PlacehUnits::Unit ThirdPartyTxUrls, // QString Language, // QString CoinControlFeatures, // bool ThreadsScriptVerif, // int DatabaseCache, // int SpendZeroConfChange, // bool Listen, // bool CustomFeeFeatures, // bool OptionIDRowCount, }; void Init(bool resetSettings = false); void Reset(); int rowCount(const QModelIndex & parent = QModelIndex()) const; QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole); /** Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal */ void setDisplayUnit(const QVariant &value); /* Explicit getters */ bool getHideTrayIcon() const { return fHideTrayIcon; } bool getMinimizeToTray() const { return fMinimizeToTray; } bool getMinimizeOnClose() const { return fMinimizeOnClose; } int getDisplayUnit() const { return nDisplayUnit; } QString getThirdPartyTxUrls() const { return strThirdPartyTxUrls; } bool getProxySettings(QNetworkProxy& proxy) const; bool getCoinControlFeatures() const { return fCoinControlFeatures; } bool getCustomFeeFeatures() const { return fCustomFeeFeatures; } const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; } /* Restart flag helper */ void setRestartRequired(bool fRequired); bool isRestartRequired() const; private: /* Qt-only settings */ bool fHideTrayIcon; bool fMinimizeToTray; bool fMinimizeOnClose; QString language; int nDisplayUnit; QString strThirdPartyTxUrls; bool fCoinControlFeatures; /** PHL START*/ bool fCustomFeeFeatures; /** PHL END*/ /* settings that were overridden by command-line */ QString strOverriddenByCommandLine; // Add option to list of GUI options overridden through command line/config file void addOverriddenOption(const std::string &option); // Check settings version and upgrade default values if required void checkAndMigrate(); Q_SIGNALS: void displayUnitChanged(int unit); void coinControlFeaturesChanged(bool); void customFeeFeaturesChanged(bool); void hideTrayIconChanged(bool); }; #endif // PLACEH_QT_OPTIONSMODEL_H
[ "seanbeecroft@gmail.com" ]
seanbeecroft@gmail.com
7b28c17e11eb0f7bd0b529030613125e0969932e
0641d87fac176bab11c613e64050330246569e5c
/branches/eric/lodrop/source/i18n/gregocal.cpp
9d92cfd525801eb33fbeee63e1735c4b2ad4bf4a
[ "ICU", "LicenseRef-scancode-unicode" ]
permissive
svn2github/libicu_full
ecf883cedfe024efa5aeda4c8527f227a9dbf100
f1246dcb7fec5a23ebd6d36ff3515ff0395aeb29
refs/heads/master
2021-01-01T17:00:58.555108
2015-01-27T16:59:40
2015-01-27T16:59:40
9,308,333
0
2
null
null
null
null
UTF-8
C++
false
false
50,892
cpp
/* ******************************************************************************* * Copyright (C) 1997-2006, International Business Machines Corporation and * * others. All Rights Reserved. * ******************************************************************************* * * File GREGOCAL.CPP * * Modification History: * * Date Name Description * 02/05/97 clhuang Creation. * 03/28/97 aliu Made highly questionable fix to computeFields to * handle DST correctly. * 04/22/97 aliu Cleaned up code drastically. Added monthLength(). * Finished unimplemented parts of computeTime() for * week-based date determination. Removed quetionable * fix and wrote correct fix for computeFields() and * daylight time handling. Rewrote inDaylightTime() * and computeFields() to handle sensitive Daylight to * Standard time transitions correctly. * 05/08/97 aliu Added code review changes. Fixed isLeapYear() to * not cutover. * 08/12/97 aliu Added equivalentTo. Misc other fixes. Updated * add() from Java source. * 07/28/98 stephen Sync up with JDK 1.2 * 09/14/98 stephen Changed type of kOneDay, kOneWeek to double. * Fixed bug in roll() * 10/15/99 aliu Fixed j31, incorrect WEEK_OF_YEAR computation. * 10/15/99 aliu Fixed j32, cannot set date to Feb 29 2000 AD. * {JDK bug 4210209 4209272} * 11/15/99 weiv Added YEAR_WOY and DOW_LOCAL computation * to timeToFields method, updated kMinValues, kMaxValues & kLeastMaxValues * 12/09/99 aliu Fixed j81, calculation errors and roll bugs * in year of cutover. * 01/24/2000 aliu Revised computeJulianDay for YEAR YEAR_WOY WOY. ******************************************************************************** */ #include "unicode/utypes.h" #include <float.h> #if !UCONFIG_NO_FORMATTING #include "unicode/gregocal.h" #include "gregoimp.h" #include "umutex.h" #include "uassert.h" // ***************************************************************************** // class GregorianCalendar // ***************************************************************************** /** * Note that the Julian date used here is not a true Julian date, since * it is measured from midnight, not noon. This value is the Julian * day number of January 1, 1970 (Gregorian calendar) at noon UTC. [LIU] */ static const int32_t kNumDays[] = {0,31,59,90,120,151,181,212,243,273,304,334}; // 0-based, for day-in-year static const int32_t kLeapNumDays[] = {0,31,60,91,121,152,182,213,244,274,305,335}; // 0-based, for day-in-year static const int32_t kMonthLength[] = {31,28,31,30,31,30,31,31,30,31,30,31}; // 0-based static const int32_t kLeapMonthLength[] = {31,29,31,30,31,30,31,31,30,31,30,31}; // 0-based // setTimeInMillis() limits the Julian day range to +/-7F000000. // This would seem to limit the year range to: // ms=+183882168921600000 jd=7f000000 December 20, 5828963 AD // ms=-184303902528000000 jd=81000000 September 20, 5838270 BC // HOWEVER, CalendarRegressionTest/Test4167060 shows that the actual // range limit on the year field is smaller (~ +/-140000). [alan 3.0] static const int32_t kGregorianCalendarLimits[UCAL_FIELD_COUNT][4] = { // Minimum Greatest Least Maximum // Minimum Maximum { 0, 0, 1, 1 }, // ERA { 1, 1, 140742, 144683 }, // YEAR { 0, 0, 11, 11 }, // MONTH { 1, 1, 52, 53 }, // WEEK_OF_YEAR { 0, 0, 4, 6 }, // WEEK_OF_MONTH { 1, 1, 28, 31 }, // DAY_OF_MONTH { 1, 1, 365, 366 }, // DAY_OF_YEAR {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// DAY_OF_WEEK { -1, -1, 4, 6 }, // DAY_OF_WEEK_IN_MONTH {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// AM_PM {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// HOUR {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// HOUR_OF_DAY {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// MINUTE {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// SECOND {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// MILLISECOND {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// ZONE_OFFSET {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// DST_OFFSET { -140742, -140742, 140742, 144683 }, // YEAR_WOY {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// DOW_LOCAL { -140742, -140742, 140742, 144683 }, // EXTENDED_YEAR {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1},// JULIAN_DAY {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1} // MILLISECONDS_IN_DAY }; /* * <pre> * Greatest Least * Field name Minimum Minimum Maximum Maximum * ---------- ------- ------- ------- ------- * ERA 0 0 1 1 * YEAR 1 1 140742 144683 * MONTH 0 0 11 11 * WEEK_OF_YEAR 1 1 52 53 * WEEK_OF_MONTH 0 0 4 6 * DAY_OF_MONTH 1 1 28 31 * DAY_OF_YEAR 1 1 365 366 * DAY_OF_WEEK 1 1 7 7 * DAY_OF_WEEK_IN_MONTH -1 -1 4 6 * AM_PM 0 0 1 1 * HOUR 0 0 11 11 * HOUR_OF_DAY 0 0 23 23 * MINUTE 0 0 59 59 * SECOND 0 0 59 59 * MILLISECOND 0 0 999 999 * ZONE_OFFSET -12* -12* 12* 12* * DST_OFFSET 0 0 1* 1* * YEAR_WOY 1 1 140742 144683 * DOW_LOCAL 1 1 7 7 * </pre> * (*) In units of one-hour */ #if defined( U_DEBUG_CALSVC ) || defined (U_DEBUG_CAL) #include <stdio.h> #endif U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(GregorianCalendar) // 00:00:00 UTC, October 15, 1582, expressed in ms from the epoch. // Note that only Italy and other Catholic countries actually // observed this cutover. Most other countries followed in // the next few centuries, some as late as 1928. [LIU] // in Java, -12219292800000L //const UDate GregorianCalendar::kPapalCutover = -12219292800000L; static const uint32_t kCutoverJulianDay = 2299161; static const UDate kPapalCutover = (2299161.0 - kEpochStartAsJulianDay) * U_MILLIS_PER_DAY; //static const UDate kPapalCutoverJulian = (2299161.0 - kEpochStartAsJulianDay); // ------------------------------------- GregorianCalendar::GregorianCalendar(UErrorCode& status) : Calendar(TimeZone::createDefault(), Locale::getDefault(), status), fGregorianCutover(kPapalCutover), fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), fIsGregorian(TRUE), fInvertGregorian(FALSE) { setTimeInMillis(getNow(), status); } // ------------------------------------- GregorianCalendar::GregorianCalendar(TimeZone* zone, UErrorCode& status) : Calendar(zone, Locale::getDefault(), status), fGregorianCutover(kPapalCutover), fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), fIsGregorian(TRUE), fInvertGregorian(FALSE) { setTimeInMillis(getNow(), status); } // ------------------------------------- GregorianCalendar::GregorianCalendar(const TimeZone& zone, UErrorCode& status) : Calendar(zone, Locale::getDefault(), status), fGregorianCutover(kPapalCutover), fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), fIsGregorian(TRUE), fInvertGregorian(FALSE) { setTimeInMillis(getNow(), status); } // ------------------------------------- GregorianCalendar::GregorianCalendar(const Locale& aLocale, UErrorCode& status) : Calendar(TimeZone::createDefault(), aLocale, status), fGregorianCutover(kPapalCutover), fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), fIsGregorian(TRUE), fInvertGregorian(FALSE) { setTimeInMillis(getNow(), status); } // ------------------------------------- GregorianCalendar::GregorianCalendar(TimeZone* zone, const Locale& aLocale, UErrorCode& status) : Calendar(zone, aLocale, status), fGregorianCutover(kPapalCutover), fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), fIsGregorian(TRUE), fInvertGregorian(FALSE) { setTimeInMillis(getNow(), status); } // ------------------------------------- GregorianCalendar::GregorianCalendar(const TimeZone& zone, const Locale& aLocale, UErrorCode& status) : Calendar(zone, aLocale, status), fGregorianCutover(kPapalCutover), fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), fIsGregorian(TRUE), fInvertGregorian(FALSE) { setTimeInMillis(getNow(), status); } // ------------------------------------- GregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date, UErrorCode& status) : Calendar(TimeZone::createDefault(), Locale::getDefault(), status), fGregorianCutover(kPapalCutover), fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), fIsGregorian(TRUE), fInvertGregorian(FALSE) { set(UCAL_ERA, AD); set(UCAL_YEAR, year); set(UCAL_MONTH, month); set(UCAL_DATE, date); } // ------------------------------------- GregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, UErrorCode& status) : Calendar(TimeZone::createDefault(), Locale::getDefault(), status), fGregorianCutover(kPapalCutover), fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), fIsGregorian(TRUE), fInvertGregorian(FALSE) { set(UCAL_ERA, AD); set(UCAL_YEAR, year); set(UCAL_MONTH, month); set(UCAL_DATE, date); set(UCAL_HOUR_OF_DAY, hour); set(UCAL_MINUTE, minute); } // ------------------------------------- GregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second, UErrorCode& status) : Calendar(TimeZone::createDefault(), Locale::getDefault(), status), fGregorianCutover(kPapalCutover), fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), fIsGregorian(TRUE), fInvertGregorian(FALSE) { set(UCAL_ERA, AD); set(UCAL_YEAR, year); set(UCAL_MONTH, month); set(UCAL_DATE, date); set(UCAL_HOUR_OF_DAY, hour); set(UCAL_MINUTE, minute); set(UCAL_SECOND, second); } // ------------------------------------- GregorianCalendar::~GregorianCalendar() { } // ------------------------------------- GregorianCalendar::GregorianCalendar(const GregorianCalendar &source) : Calendar(source), fGregorianCutover(source.fGregorianCutover), fCutoverJulianDay(source.fCutoverJulianDay), fNormalizedGregorianCutover(source.fNormalizedGregorianCutover), fGregorianCutoverYear(source.fGregorianCutoverYear), fIsGregorian(source.fIsGregorian), fInvertGregorian(source.fInvertGregorian) { } // ------------------------------------- Calendar* GregorianCalendar::clone() const { return new GregorianCalendar(*this); } // ------------------------------------- GregorianCalendar & GregorianCalendar::operator=(const GregorianCalendar &right) { if (this != &right) { Calendar::operator=(right); fGregorianCutover = right.fGregorianCutover; fNormalizedGregorianCutover = right.fNormalizedGregorianCutover; fGregorianCutoverYear = right.fGregorianCutoverYear; fCutoverJulianDay = right.fCutoverJulianDay; } return *this; } // ------------------------------------- UBool GregorianCalendar::isEquivalentTo(const Calendar& other) const { // Calendar override. return Calendar::isEquivalentTo(other) && fGregorianCutover == ((GregorianCalendar*)&other)->fGregorianCutover; } // ------------------------------------- void GregorianCalendar::setGregorianChange(UDate date, UErrorCode& status) { if (U_FAILURE(status)) return; fGregorianCutover = date; // Precompute two internal variables which we use to do the actual // cutover computations. These are the normalized cutover, which is the // midnight at or before the cutover, and the cutover year. The // normalized cutover is in pure date milliseconds; it contains no time // of day or timezone component, and it used to compare against other // pure date values. int32_t cutoverDay = (int32_t)Math::floorDivide(fGregorianCutover, (double)kOneDay); fNormalizedGregorianCutover = cutoverDay * kOneDay; // Handle the rare case of numeric overflow. If the user specifies a // change of UDate(Long.MIN_VALUE), in order to get a pure Gregorian // calendar, then the epoch day is -106751991168, which when multiplied // by ONE_DAY gives 9223372036794351616 -- the negative value is too // large for 64 bits, and overflows into a positive value. We correct // this by using the next day, which for all intents is semantically // equivalent. if (cutoverDay < 0 && fNormalizedGregorianCutover > 0) { fNormalizedGregorianCutover = (cutoverDay + 1) * kOneDay; } // Normalize the year so BC values are represented as 0 and negative // values. GregorianCalendar *cal = new GregorianCalendar(getTimeZone(), status); /* test for NULL */ if (cal == 0) { status = U_MEMORY_ALLOCATION_ERROR; return; } if(U_FAILURE(status)) return; cal->setTime(date, status); fGregorianCutoverYear = cal->get(UCAL_YEAR, status); if (cal->get(UCAL_ERA, status) == BC) fGregorianCutoverYear = 1 - fGregorianCutoverYear; fCutoverJulianDay = cutoverDay; delete cal; } void GregorianCalendar::handleComputeFields(int32_t julianDay, UErrorCode& status) { int32_t eyear, month, dayOfMonth, dayOfYear; if(U_FAILURE(status)) { return; } #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: jd%d- (greg's %d)- [cut=%d]\n", __FILE__, __LINE__, julianDay, getGregorianDayOfYear(), fCutoverJulianDay); #endif if (julianDay >= fCutoverJulianDay) { month = getGregorianMonth(); dayOfMonth = getGregorianDayOfMonth(); dayOfYear = getGregorianDayOfYear(); eyear = getGregorianYear(); } else { // The Julian epoch day (not the same as Julian Day) // is zero on Saturday December 30, 0 (Gregorian). int32_t julianEpochDay = julianDay - (kJan1_1JulianDay - 2); eyear = (int32_t) Math::floorDivide(4*julianEpochDay + 1464, 1461); // Compute the Julian calendar day number for January 1, eyear int32_t january1 = 365*(eyear-1) + Math::floorDivide(eyear-1, (int32_t)4); dayOfYear = (julianEpochDay - january1); // 0-based // Julian leap years occurred historically every 4 years starting // with 8 AD. Before 8 AD the spacing is irregular; every 3 years // from 45 BC to 9 BC, and then none until 8 AD. However, we don't // implement this historical detail; instead, we implement the // computatinally cleaner proleptic calendar, which assumes // consistent 4-year cycles throughout time. UBool isLeap = ((eyear&0x3) == 0); // equiv. to (eyear%4 == 0) // Common Julian/Gregorian calculation int32_t correction = 0; int32_t march1 = isLeap ? 60 : 59; // zero-based DOY for March 1 if (dayOfYear >= march1) { correction = isLeap ? 1 : 2; } month = (12 * (dayOfYear + correction) + 6) / 367; // zero-based month dayOfMonth = dayOfYear - (isLeap?kLeapNumDays[month]:kNumDays[month]) + 1; // one-based DOM ++dayOfYear; #if defined (U_DEBUG_CAL) // fprintf(stderr, "%d - %d[%d] + 1\n", dayOfYear, isLeap?kLeapNumDays[month]:kNumDays[month], month ); // fprintf(stderr, "%s:%d: greg's HCF %d -> %d/%d/%d not %d/%d/%d\n", // __FILE__, __LINE__,julianDay, // eyear,month,dayOfMonth, // getGregorianYear(), getGregorianMonth(), getGregorianDayOfMonth() ); fprintf(stderr, "%s:%d: doy %d (greg's %d)- [cut=%d]\n", __FILE__, __LINE__, dayOfYear, getGregorianDayOfYear(), fCutoverJulianDay); #endif } // [j81] if we are after the cutover in its year, shift the day of the year if((eyear == fGregorianCutoverYear) && (julianDay >= fCutoverJulianDay)) { //from handleComputeMonthStart int32_t gregShift = Grego::gregorianShift(eyear); #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: gregorian shift %d ::: doy%d => %d [cut=%d]\n", __FILE__, __LINE__,gregShift, dayOfYear, dayOfYear+gregShift, fCutoverJulianDay); #endif dayOfYear += gregShift; } internalSet(UCAL_MONTH, month); internalSet(UCAL_DAY_OF_MONTH, dayOfMonth); internalSet(UCAL_DAY_OF_YEAR, dayOfYear); internalSet(UCAL_EXTENDED_YEAR, eyear); int32_t era = AD; if (eyear < 1) { era = BC; eyear = 1 - eyear; } internalSet(UCAL_ERA, era); internalSet(UCAL_YEAR, eyear); } // ------------------------------------- UDate GregorianCalendar::getGregorianChange() const { return fGregorianCutover; } // ------------------------------------- UBool GregorianCalendar::isLeapYear(int32_t year) const { // MSVC complains bitterly if we try to use Grego::isLeapYear here // NOTE: year&0x3 == year%4 return (year >= fGregorianCutoverYear ? (((year&0x3) == 0) && ((year%100 != 0) || (year%400 == 0))) : // Gregorian ((year&0x3) == 0)); // Julian } // ------------------------------------- int32_t GregorianCalendar::handleComputeJulianDay(UCalendarDateFields bestField) { fInvertGregorian = FALSE; int32_t jd = Calendar::handleComputeJulianDay(bestField); if((bestField == UCAL_WEEK_OF_YEAR) && // if we are doing WOY calculations, we are counting relative to Jan 1 *julian* (internalGet(UCAL_EXTENDED_YEAR)==fGregorianCutoverYear) && jd >= fCutoverJulianDay) { fInvertGregorian = TRUE; // So that the Julian Jan 1 will be used in handleComputeMonthStart return Calendar::handleComputeJulianDay(bestField); } // The following check handles portions of the cutover year BEFORE the // cutover itself happens. //if ((fIsGregorian==TRUE) != (jd >= fCutoverJulianDay)) { /* cutoverJulianDay)) { */ if ((fIsGregorian==TRUE) != (jd >= fCutoverJulianDay)) { /* cutoverJulianDay)) { */ #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: jd [invert] %d\n", __FILE__, __LINE__, jd); #endif fInvertGregorian = TRUE; jd = Calendar::handleComputeJulianDay(bestField); #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: fIsGregorian %s, fInvertGregorian %s - ", __FILE__, __LINE__,fIsGregorian?"T":"F", fInvertGregorian?"T":"F"); fprintf(stderr, " jd NOW %d\n", jd); #endif } else { #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: jd [==] %d - %sfIsGregorian %sfInvertGregorian, %d\n", __FILE__, __LINE__, jd, fIsGregorian?"T":"F", fInvertGregorian?"T":"F", bestField); #endif } if(fIsGregorian && (internalGet(UCAL_EXTENDED_YEAR) == fGregorianCutoverYear)) { int32_t gregShift = Grego::gregorianShift(internalGet(UCAL_EXTENDED_YEAR)); if (bestField == UCAL_DAY_OF_YEAR) { #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: [DOY%d] gregorian shift of JD %d += %d\n", __FILE__, __LINE__, fFields[bestField],jd, gregShift); #endif jd -= gregShift; } else if ( bestField == UCAL_WEEK_OF_MONTH ) { int32_t weekShift = 14; #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: [WOY/WOM] gregorian week shift of %d += %d\n", __FILE__, __LINE__, jd, weekShift); #endif jd += weekShift; // shift by weeks for week based fields. } } return jd; } int32_t GregorianCalendar::handleComputeMonthStart(int32_t eyear, int32_t month, UBool /* useMonth */) const { GregorianCalendar *nonConstThis = (GregorianCalendar*)this; // cast away const // If the month is out of range, adjust it into range, and // modify the extended year value accordingly. if (month < 0 || month > 11) { eyear += Math::floorDivide(month, 12, month); } UBool isLeap = eyear%4 == 0; int32_t y = eyear-1; int32_t julianDay = 365*y + Math::floorDivide(y, 4) + (kJan1_1JulianDay - 3); nonConstThis->fIsGregorian = (eyear >= fGregorianCutoverYear); #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: (hcms%d/%d) fIsGregorian %s, fInvertGregorian %s\n", __FILE__, __LINE__, eyear,month, fIsGregorian?"T":"F", fInvertGregorian?"T":"F"); #endif if (fInvertGregorian) { nonConstThis->fIsGregorian = !fIsGregorian; } if (fIsGregorian) { isLeap = isLeap && ((eyear%100 != 0) || (eyear%400 == 0)); // Add 2 because Gregorian calendar starts 2 days after // Julian calendar int32_t gregShift = Grego::gregorianShift(eyear); #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: (hcms%d/%d) gregorian shift of %d += %d\n", __FILE__, __LINE__, eyear, month, julianDay, gregShift); #endif julianDay += gregShift; } // At this point julianDay indicates the day BEFORE the first // day of January 1, <eyear> of either the Julian or Gregorian // calendar. if (month != 0) { julianDay += isLeap?kLeapNumDays[month]:kNumDays[month]; } return julianDay; } int32_t GregorianCalendar::handleGetMonthLength(int32_t extendedYear, int32_t month) const { return isLeapYear(extendedYear) ? kLeapMonthLength[month] : kMonthLength[month]; } int32_t GregorianCalendar::handleGetYearLength(int32_t eyear) const { return isLeapYear(eyear) ? 366 : 365; } int32_t GregorianCalendar::monthLength(int32_t month) const { int32_t year = internalGet(UCAL_EXTENDED_YEAR); return handleGetMonthLength(year, month); } // ------------------------------------- int32_t GregorianCalendar::monthLength(int32_t month, int32_t year) const { return isLeapYear(year) ? kLeapMonthLength[month] : kMonthLength[month]; } // ------------------------------------- int32_t GregorianCalendar::yearLength(int32_t year) const { return isLeapYear(year) ? 366 : 365; } // ------------------------------------- int32_t GregorianCalendar::yearLength() const { return isLeapYear(internalGet(UCAL_YEAR)) ? 366 : 365; } // ------------------------------------- /** * After adjustments such as add(MONTH), add(YEAR), we don't want the * month to jump around. E.g., we don't want Jan 31 + 1 month to go to Mar * 3, we want it to go to Feb 28. Adjustments which might run into this * problem call this method to retain the proper month. */ void GregorianCalendar::pinDayOfMonth() { int32_t monthLen = monthLength(internalGet(UCAL_MONTH)); int32_t dom = internalGet(UCAL_DATE); if(dom > monthLen) set(UCAL_DATE, monthLen); } // ------------------------------------- UBool GregorianCalendar::validateFields() const { for (int32_t field = 0; field < UCAL_FIELD_COUNT; field++) { // Ignore DATE and DAY_OF_YEAR which are handled below if (field != UCAL_DATE && field != UCAL_DAY_OF_YEAR && isSet((UCalendarDateFields)field) && ! boundsCheck(internalGet((UCalendarDateFields)field), (UCalendarDateFields)field)) return FALSE; } // Values differ in Least-Maximum and Maximum should be handled // specially. if (isSet(UCAL_DATE)) { int32_t date = internalGet(UCAL_DATE); if (date < getMinimum(UCAL_DATE) || date > monthLength(internalGet(UCAL_MONTH))) { return FALSE; } } if (isSet(UCAL_DAY_OF_YEAR)) { int32_t days = internalGet(UCAL_DAY_OF_YEAR); if (days < 1 || days > yearLength()) { return FALSE; } } // Handle DAY_OF_WEEK_IN_MONTH, which must not have the value zero. // We've checked against minimum and maximum above already. if (isSet(UCAL_DAY_OF_WEEK_IN_MONTH) && 0 == internalGet(UCAL_DAY_OF_WEEK_IN_MONTH)) { return FALSE; } return TRUE; } // ------------------------------------- UBool GregorianCalendar::boundsCheck(int32_t value, UCalendarDateFields field) const { return value >= getMinimum(field) && value <= getMaximum(field); } // ------------------------------------- UDate GregorianCalendar::getEpochDay(UErrorCode& status) { complete(status); // Divide by 1000 (convert to seconds) in order to prevent overflow when // dealing with UDate(Long.MIN_VALUE) and UDate(Long.MAX_VALUE). double wallSec = internalGetTime()/1000 + (internalGet(UCAL_ZONE_OFFSET) + internalGet(UCAL_DST_OFFSET))/1000; return Math::floorDivide(wallSec, kOneDay/1000.0); } // ------------------------------------- // ------------------------------------- /** * Compute the julian day number of the day BEFORE the first day of * January 1, year 1 of the given calendar. If julianDay == 0, it * specifies (Jan. 1, 1) - 1, in whatever calendar we are using (Julian * or Gregorian). */ double GregorianCalendar::computeJulianDayOfYear(UBool isGregorian, int32_t year, UBool& isLeap) { isLeap = year%4 == 0; int32_t y = year - 1; double julianDay = 365.0*y + Math::floorDivide(y, 4) + (kJan1_1JulianDay - 3); if (isGregorian) { isLeap = isLeap && ((year%100 != 0) || (year%400 == 0)); // Add 2 because Gregorian calendar starts 2 days after Julian calendar julianDay += Grego::gregorianShift(year); } return julianDay; } // /** // * Compute the day of week, relative to the first day of week, from // * 0..6, of the current DOW_LOCAL or DAY_OF_WEEK fields. This is // * equivalent to get(DOW_LOCAL) - 1. // */ // int32_t GregorianCalendar::computeRelativeDOW() const { // int32_t relDow = 0; // if (fStamp[UCAL_DOW_LOCAL] > fStamp[UCAL_DAY_OF_WEEK]) { // relDow = internalGet(UCAL_DOW_LOCAL) - 1; // 1-based // } else if (fStamp[UCAL_DAY_OF_WEEK] != kUnset) { // relDow = internalGet(UCAL_DAY_OF_WEEK) - getFirstDayOfWeek(); // if (relDow < 0) relDow += 7; // } // return relDow; // } // /** // * Compute the day of week, relative to the first day of week, // * from 0..6 of the given julian day. // */ // int32_t GregorianCalendar::computeRelativeDOW(double julianDay) const { // int32_t relDow = julianDayToDayOfWeek(julianDay) - getFirstDayOfWeek(); // if (relDow < 0) { // relDow += 7; // } // return relDow; // } // /** // * Compute the DOY using the WEEK_OF_YEAR field and the julian day // * of the day BEFORE January 1 of a year (a return value from // * computeJulianDayOfYear). // */ // int32_t GregorianCalendar::computeDOYfromWOY(double julianDayOfYear) const { // // Compute DOY from day of week plus week of year // // Find the day of the week for the first of this year. This // // is zero-based, with 0 being the locale-specific first day of // // the week. Add 1 to get first day of year. // int32_t fdy = computeRelativeDOW(julianDayOfYear + 1); // return // // Compute doy of first (relative) DOW of WOY 1 // (((7 - fdy) < getMinimalDaysInFirstWeek()) // ? (8 - fdy) : (1 - fdy)) // // Adjust for the week number. // + (7 * (internalGet(UCAL_WEEK_OF_YEAR) - 1)) // // Adjust for the DOW // + computeRelativeDOW(); // } // ------------------------------------- double GregorianCalendar::millisToJulianDay(UDate millis) { return (double)kEpochStartAsJulianDay + Math::floorDivide(millis, (double)kOneDay); } // ------------------------------------- UDate GregorianCalendar::julianDayToMillis(double julian) { return (UDate) ((julian - kEpochStartAsJulianDay) * (double) kOneDay); } // ------------------------------------- int32_t GregorianCalendar::aggregateStamp(int32_t stamp_a, int32_t stamp_b) { return (((stamp_a != kUnset && stamp_b != kUnset) ? uprv_max(stamp_a, stamp_b) : (int32_t)kUnset)); } // ------------------------------------- /** * Roll a field by a signed amount. * Note: This will be made public later. [LIU] */ void GregorianCalendar::roll(EDateFields field, int32_t amount, UErrorCode& status) { roll((UCalendarDateFields) field, amount, status); } void GregorianCalendar::roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) { if((amount == 0) || U_FAILURE(status)) { return; } // J81 processing. (gregorian cutover) UBool inCutoverMonth = FALSE; int32_t cMonthLen=0; // 'c' for cutover; in days int32_t cDayOfMonth=0; // no discontinuity: [0, cMonthLen) double cMonthStart=0.0; // in ms // Common code - see if we're in the cutover month of the cutover year if(get(UCAL_EXTENDED_YEAR, status) == fGregorianCutoverYear) { switch (field) { case UCAL_DAY_OF_MONTH: case UCAL_WEEK_OF_MONTH: { int32_t max = monthLength(internalGet(UCAL_MONTH)); UDate t = internalGetTime(); // We subtract 1 from the DAY_OF_MONTH to make it zero-based, and an // additional 10 if we are after the cutover. Thus the monthStart // value will be correct iff we actually are in the cutover month. cDayOfMonth = internalGet(UCAL_DAY_OF_MONTH) - ((t >= fGregorianCutover) ? 10 : 0); cMonthStart = t - ((cDayOfMonth - 1) * kOneDay); // A month containing the cutover is 10 days shorter. if ((cMonthStart < fGregorianCutover) && (cMonthStart + (cMonthLen=(max-10))*kOneDay >= fGregorianCutover)) { inCutoverMonth = TRUE; } } default: ; } } switch (field) { case UCAL_WEEK_OF_YEAR: { // Unlike WEEK_OF_MONTH, WEEK_OF_YEAR never shifts the day of the // week. Also, rolling the week of the year can have seemingly // strange effects simply because the year of the week of year // may be different from the calendar year. For example, the // date Dec 28, 1997 is the first day of week 1 of 1998 (if // weeks start on Sunday and the minimal days in first week is // <= 3). int32_t woy = get(UCAL_WEEK_OF_YEAR, status); // Get the ISO year, which matches the week of year. This // may be one year before or after the calendar year. int32_t isoYear = get(UCAL_YEAR_WOY, status); int32_t isoDoy = internalGet(UCAL_DAY_OF_YEAR); if (internalGet(UCAL_MONTH) == UCAL_JANUARY) { if (woy >= 52) { isoDoy += handleGetYearLength(isoYear); } } else { if (woy == 1) { isoDoy -= handleGetYearLength(isoYear - 1); } } woy += amount; // Do fast checks to avoid unnecessary computation: if (woy < 1 || woy > 52) { // Determine the last week of the ISO year. // We do this using the standard formula we use // everywhere in this file. If we can see that the // days at the end of the year are going to fall into // week 1 of the next year, we drop the last week by // subtracting 7 from the last day of the year. int32_t lastDoy = handleGetYearLength(isoYear); int32_t lastRelDow = (lastDoy - isoDoy + internalGet(UCAL_DAY_OF_WEEK) - getFirstDayOfWeek()) % 7; if (lastRelDow < 0) lastRelDow += 7; if ((6 - lastRelDow) >= getMinimalDaysInFirstWeek()) lastDoy -= 7; int32_t lastWoy = weekNumber(lastDoy, lastRelDow + 1); woy = ((woy + lastWoy - 1) % lastWoy) + 1; } set(UCAL_WEEK_OF_YEAR, woy); set(UCAL_YEAR_WOY,isoYear); return; } case UCAL_DAY_OF_MONTH: if( !inCutoverMonth ) { Calendar::roll(field, amount, status); return; } else { // [j81] 1582 special case for DOM // The default computation works except when the current month // contains the Gregorian cutover. We handle this special case // here. [j81 - aliu] double monthLen = cMonthLen * kOneDay; double msIntoMonth = uprv_fmod(internalGetTime() - cMonthStart + amount * kOneDay, monthLen); if (msIntoMonth < 0) { msIntoMonth += monthLen; } #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: roll DOM %d -> %.0lf ms \n", __FILE__, __LINE__,amount, cMonthLen, cMonthStart+msIntoMonth); #endif setTimeInMillis(cMonthStart + msIntoMonth, status); return; } case UCAL_WEEK_OF_MONTH: if( !inCutoverMonth ) { Calendar::roll(field, amount, status); return; } else { #if defined (U_DEBUG_CAL) fprintf(stderr, "%s:%d: roll WOM %d ??????????????????? \n", __FILE__, __LINE__,amount); #endif // NOTE: following copied from the old // GregorianCalendar::roll( WEEK_OF_MONTH ) code // This is tricky, because during the roll we may have to shift // to a different day of the week. For example: // s m t w r f s // 1 2 3 4 5 // 6 7 8 9 10 11 12 // When rolling from the 6th or 7th back one week, we go to the // 1st (assuming that the first partial week counts). The same // thing happens at the end of the month. // The other tricky thing is that we have to figure out whether // the first partial week actually counts or not, based on the // minimal first days in the week. And we have to use the // correct first day of the week to delineate the week // boundaries. // Here's our algorithm. First, we find the real boundaries of // the month. Then we discard the first partial week if it // doesn't count in this locale. Then we fill in the ends with // phantom days, so that the first partial week and the last // partial week are full weeks. We then have a nice square // block of weeks. We do the usual rolling within this block, // as is done elsewhere in this method. If we wind up on one of // the phantom days that we added, we recognize this and pin to // the first or the last day of the month. Easy, eh? // Another wrinkle: To fix jitterbug 81, we have to make all this // work in the oddball month containing the Gregorian cutover. // This month is 10 days shorter than usual, and also contains // a discontinuity in the days; e.g., the default cutover month // is Oct 1582, and goes from day of month 4 to day of month 15. // Normalize the DAY_OF_WEEK so that 0 is the first day of the week // in this locale. We have dow in 0..6. int32_t dow = internalGet(UCAL_DAY_OF_WEEK) - getFirstDayOfWeek(); if (dow < 0) dow += 7; // Find the day of month, compensating for cutover discontinuity. int32_t dom = cDayOfMonth; // Find the day of the week (normalized for locale) for the first // of the month. int32_t fdm = (dow - dom + 1) % 7; if (fdm < 0) fdm += 7; // Get the first day of the first full week of the month, // including phantom days, if any. Figure out if the first week // counts or not; if it counts, then fill in phantom days. If // not, advance to the first real full week (skip the partial week). int32_t start; if ((7 - fdm) < getMinimalDaysInFirstWeek()) start = 8 - fdm; // Skip the first partial week else start = 1 - fdm; // This may be zero or negative // Get the day of the week (normalized for locale) for the last // day of the month. int32_t monthLen = cMonthLen; int32_t ldm = (monthLen - dom + dow) % 7; // We know monthLen >= DAY_OF_MONTH so we skip the += 7 step here. // Get the limit day for the blocked-off rectangular month; that // is, the day which is one past the last day of the month, // after the month has already been filled in with phantom days // to fill out the last week. This day has a normalized DOW of 0. int32_t limit = monthLen + 7 - ldm; // Now roll between start and (limit - 1). int32_t gap = limit - start; int32_t newDom = (dom + amount*7 - start) % gap; if (newDom < 0) newDom += gap; newDom += start; // Finally, pin to the real start and end of the month. if (newDom < 1) newDom = 1; if (newDom > monthLen) newDom = monthLen; // Set the DAY_OF_MONTH. We rely on the fact that this field // takes precedence over everything else (since all other fields // are also set at this point). If this fact changes (if the // disambiguation algorithm changes) then we will have to unset // the appropriate fields here so that DAY_OF_MONTH is attended // to. // If we are in the cutover month, manipulate ms directly. Don't do // this in general because it doesn't work across DST boundaries // (details, details). This takes care of the discontinuity. setTimeInMillis(cMonthStart + (newDom-1)*kOneDay, status); return; } default: Calendar::roll(field, amount, status); return; } } // ------------------------------------- /** * Return the minimum value that this field could have, given the current date. * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum(). * @param field the time field. * @return the minimum value that this field could have, given the current date. * @deprecated ICU 2.6. Use getActualMinimum(UCalendarDateFields field) instead. */ int32_t GregorianCalendar::getActualMinimum(EDateFields field) const { return getMinimum((UCalendarDateFields)field); } int32_t GregorianCalendar::getActualMinimum(EDateFields field, UErrorCode& /* status */) const { return getMinimum((UCalendarDateFields)field); } /** * Return the minimum value that this field could have, given the current date. * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum(). * @param field the time field. * @return the minimum value that this field could have, given the current date. * @draft ICU 2.6. */ int32_t GregorianCalendar::getActualMinimum(UCalendarDateFields field, UErrorCode& /* status */) const { return getMinimum(field); } // ------------------------------------ /** * Old year limits were least max 292269054, max 292278994. */ /** * @stable ICU 2.0 */ int32_t GregorianCalendar::handleGetLimit(UCalendarDateFields field, ELimitType limitType) const { return kGregorianCalendarLimits[field][limitType]; } /** * Return the maximum value that this field could have, given the current date. * For example, with the date "Feb 3, 1997" and the DAY_OF_MONTH field, the actual * maximum would be 28; for "Feb 3, 1996" it s 29. Similarly for a Hebrew calendar, * for some years the actual maximum for MONTH is 12, and for others 13. * @stable ICU 2.0 */ int32_t GregorianCalendar::getActualMaximum(UCalendarDateFields field, UErrorCode& status) const { /* It is a known limitation that the code here (and in getActualMinimum) * won't behave properly at the extreme limits of GregorianCalendar's * representable range (except for the code that handles the YEAR * field). That's because the ends of the representable range are at * odd spots in the year. For calendars with the default Gregorian * cutover, these limits are Sun Dec 02 16:47:04 GMT 292269055 BC to Sun * Aug 17 07:12:55 GMT 292278994 AD, somewhat different for non-GMT * zones. As a result, if the calendar is set to Aug 1 292278994 AD, * the actual maximum of DAY_OF_MONTH is 17, not 30. If the date is Mar * 31 in that year, the actual maximum month might be Jul, whereas is * the date is Mar 15, the actual maximum might be Aug -- depending on * the precise semantics that are desired. Similar considerations * affect all fields. Nonetheless, this effect is sufficiently arcane * that we permit it, rather than complicating the code to handle such * intricacies. - liu 8/20/98 * UPDATE: No longer true, since we have pulled in the limit values on * the year. - Liu 11/6/00 */ switch (field) { case UCAL_YEAR: /* The year computation is no different, in principle, from the * others, however, the range of possible maxima is large. In * addition, the way we know we've exceeded the range is different. * For these reasons, we use the special case code below to handle * this field. * * The actual maxima for YEAR depend on the type of calendar: * * Gregorian = May 17, 292275056 BC - Aug 17, 292278994 AD * Julian = Dec 2, 292269055 BC - Jan 3, 292272993 AD * Hybrid = Dec 2, 292269055 BC - Aug 17, 292278994 AD * * We know we've exceeded the maximum when either the month, date, * time, or era changes in response to setting the year. We don't * check for month, date, and time here because the year and era are * sufficient to detect an invalid year setting. NOTE: If code is * added to check the month and date in the future for some reason, * Feb 29 must be allowed to shift to Mar 1 when setting the year. */ { if(U_FAILURE(status)) return 0; Calendar *cal = clone(); if(!cal) { status = U_MEMORY_ALLOCATION_ERROR; return 0; } cal->setLenient(TRUE); int32_t era = cal->get(UCAL_ERA, status); UDate d = cal->getTime(status); /* Perform a binary search, with the invariant that lowGood is a * valid year, and highBad is an out of range year. */ int32_t lowGood = kGregorianCalendarLimits[UCAL_YEAR][1]; int32_t highBad = kGregorianCalendarLimits[UCAL_YEAR][2]+1; while ((lowGood + 1) < highBad) { int32_t y = (lowGood + highBad) / 2; cal->set(UCAL_YEAR, y); if (cal->get(UCAL_YEAR, status) == y && cal->get(UCAL_ERA, status) == era) { lowGood = y; } else { highBad = y; cal->setTime(d, status); // Restore original fields } } delete cal; return lowGood; } default: return Calendar::getActualMaximum(field,status); } } int32_t GregorianCalendar::handleGetExtendedYear() { int32_t year = kEpochYear; switch(resolveFields(kYearPrecedence)) { case UCAL_EXTENDED_YEAR: year = internalGet(UCAL_EXTENDED_YEAR, kEpochYear); break; case UCAL_YEAR: { // The year defaults to the epoch start, the era to AD int32_t era = internalGet(UCAL_ERA, AD); if (era == BC) { year = 1 - internalGet(UCAL_YEAR, 1); // Convert to extended year } else { year = internalGet(UCAL_YEAR, kEpochYear); } } break; case UCAL_YEAR_WOY: year = handleGetExtendedYearFromWeekFields(internalGet(UCAL_YEAR_WOY), internalGet(UCAL_WEEK_OF_YEAR)); #if defined (U_DEBUG_CAL) // if(internalGet(UCAL_YEAR_WOY) != year) { fprintf(stderr, "%s:%d: hGEYFWF[%d,%d] -> %d\n", __FILE__, __LINE__,internalGet(UCAL_YEAR_WOY),internalGet(UCAL_WEEK_OF_YEAR),year); //} #endif break; default: year = kEpochYear; } return year; } int32_t GregorianCalendar::handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy) { // convert year to extended form int32_t era = internalGet(UCAL_ERA, AD); if(era == BC) { yearWoy = 1 - yearWoy; } return Calendar::handleGetExtendedYearFromWeekFields(yearWoy, woy); } // ------------------------------------- UBool GregorianCalendar::inDaylightTime(UErrorCode& status) const { if (U_FAILURE(status) || !getTimeZone().useDaylightTime()) return FALSE; // Force an update of the state of the Calendar. ((GregorianCalendar*)this)->complete(status); // cast away const return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : FALSE); } // ------------------------------------- /** * Return the ERA. We need a special method for this because the * default ERA is AD, but a zero (unset) ERA is BC. */ int32_t GregorianCalendar::internalGetEra() const { return isSet(UCAL_ERA) ? internalGet(UCAL_ERA) : (int32_t)AD; } const char * GregorianCalendar::getType() const { //static const char kGregorianType = "gregorian"; return "gregorian"; } const UDate GregorianCalendar::fgSystemDefaultCentury = DBL_MIN; const int32_t GregorianCalendar::fgSystemDefaultCenturyYear = -1; UDate GregorianCalendar::fgSystemDefaultCenturyStart = DBL_MIN; int32_t GregorianCalendar::fgSystemDefaultCenturyStartYear = -1; UBool GregorianCalendar::haveDefaultCentury() const { return TRUE; } UDate GregorianCalendar::defaultCenturyStart() const { return internalGetDefaultCenturyStart(); } int32_t GregorianCalendar::defaultCenturyStartYear() const { return internalGetDefaultCenturyStartYear(); } UDate GregorianCalendar::internalGetDefaultCenturyStart() const { // lazy-evaluate systemDefaultCenturyStart UBool needsUpdate; UMTX_CHECK(NULL, (fgSystemDefaultCenturyStart == fgSystemDefaultCentury), needsUpdate); if (needsUpdate) { initializeSystemDefaultCentury(); } // use defaultCenturyStart unless it's the flag value; // then use systemDefaultCenturyStart return fgSystemDefaultCenturyStart; } int32_t GregorianCalendar::internalGetDefaultCenturyStartYear() const { // lazy-evaluate systemDefaultCenturyStartYear UBool needsUpdate; UMTX_CHECK(NULL, (fgSystemDefaultCenturyStart == fgSystemDefaultCentury), needsUpdate); if (needsUpdate) { initializeSystemDefaultCentury(); } // use defaultCenturyStart unless it's the flag value; // then use systemDefaultCenturyStartYear return fgSystemDefaultCenturyStartYear; } void GregorianCalendar::initializeSystemDefaultCentury() { // initialize systemDefaultCentury and systemDefaultCenturyYear based // on the current time. They'll be set to 80 years before // the current time. // No point in locking as it should be idempotent. if (fgSystemDefaultCenturyStart == fgSystemDefaultCentury) { UErrorCode status = U_ZERO_ERROR; Calendar *calendar = new GregorianCalendar(status); if (calendar != NULL && U_SUCCESS(status)) { calendar->setTime(Calendar::getNow(), status); calendar->add(UCAL_YEAR, -80, status); UDate newStart = calendar->getTime(status); int32_t newYear = calendar->get(UCAL_YEAR, status); { umtx_lock(NULL); fgSystemDefaultCenturyStart = newStart; fgSystemDefaultCenturyStartYear = newYear; umtx_unlock(NULL); } delete calendar; } // We have no recourse upon failure unless we want to propagate the failure // out. } } U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ //eof
[ "emader@251d0590-4201-4cf1-90de-194747b24ca1" ]
emader@251d0590-4201-4cf1-90de-194747b24ca1
9dc2e64a8fdc7707ebd0cafbfdeb2cc40cf6a0d3
db97e3e6643f6d674032e6d6ae3cc03b8ceedb8d
/support/macOS/xerces-c/src/xercesc/validators/schema/XSDErrorReporter.hpp
fef8f45337a8f56349aebf2550f2e5e7f95b94b8
[ "Apache-2.0", "MIT" ]
permissive
audio-dsp/Max-Live-Environment
ddb302a1c945da7cea2cc62a17e0c5c2c7935a07
e0622c899c55ac9a73bcfce5aecdf99cc2618ed0
refs/heads/master
2020-06-12T08:32:06.458685
2019-06-07T02:15:17
2019-06-07T02:15:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,348
hpp
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id$ */ #if !defined(XERCESC_INCLUDE_GUARD_XSDERRORREPORTER_HPP) #define XERCESC_INCLUDE_GUARD_XSDERRORREPORTER_HPP #include <xercesc/util/XMemory.hpp> XERCES_CPP_NAMESPACE_BEGIN class Locator; class XMLErrorReporter; /** * This class reports schema errors */ class VALIDATORS_EXPORT XSDErrorReporter : public XMemory { public: // ----------------------------------------------------------------------- // Constructors are hidden, only the virtual destructor is exposed // ----------------------------------------------------------------------- XSDErrorReporter(XMLErrorReporter* const errorReporter = 0); virtual ~XSDErrorReporter() { } // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getExitOnFirstFatal() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setErrorReporter(XMLErrorReporter* const errorReporter); void setExitOnFirstFatal(const bool newValue); // ----------------------------------------------------------------------- // Report error methods // ----------------------------------------------------------------------- void emitError(const unsigned int toEmit, const XMLCh* const msgDomain, const Locator* const aLocator); void emitError(const unsigned int toEmit, const XMLCh* const msgDomain, const Locator* const aLocator, const XMLCh* const text1, const XMLCh* const text2 = 0, const XMLCh* const text3 = 0, const XMLCh* const text4 = 0, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); void emitError(const XMLException& except, const Locator* const aLocator); private: // ----------------------------------------------------------------------- // Unimplemented constructors and destructor // ----------------------------------------------------------------------- XSDErrorReporter(const XSDErrorReporter&); XSDErrorReporter& operator=(const XSDErrorReporter&); // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- bool fExitOnFirstFatal; XMLErrorReporter* fErrorReporter; }; // --------------------------------------------------------------------------- // XSDErrorReporter: Getter methods // --------------------------------------------------------------------------- inline bool XSDErrorReporter::getExitOnFirstFatal() const { return fExitOnFirstFatal; } // --------------------------------------------------------------------------- // XSDErrorReporter: Setter methods // --------------------------------------------------------------------------- inline void XSDErrorReporter::setExitOnFirstFatal(const bool newValue) { fExitOnFirstFatal = newValue; } inline void XSDErrorReporter::setErrorReporter(XMLErrorReporter* const errorReporter) { fErrorReporter = errorReporter; } XERCES_CPP_NAMESPACE_END #endif
[ "jdm7dv@gmail.com" ]
jdm7dv@gmail.com
9345b47966c2794067a02fe92f73a4165e7ceefe
161a19ad4b156a8cdf7304cc14c2fddafb66dbee
/Headers.h
b3ad725a1dfcf9fbb136fd4e4af3f4f72f50a413
[]
no_license
mattcrowley/Oh-No-Its-the-5-0-
6a2a24942d13943e2878235a4d6871cbb2738c36
f3639fce8d3578a7c5bc54c2d7c1a78ded579e55
refs/heads/master
2020-03-18T07:59:15.237469
2018-05-27T19:47:13
2018-05-27T19:47:13
134,482,258
0
0
null
null
null
null
UTF-8
C++
false
false
105
h
#include <iostream> #include <sstream> #include <SFML/Graphics.hpp> using std::cout; using std::string;
[ "mattcrowley123@hotmail.com" ]
mattcrowley123@hotmail.com
861e70b2e380950bfd65de407432a793f0830b4b
8f8c7f4d1a2aea6a8d6ef569b54fafd62b507386
/esp32/serialed/com.ino
03e05b7cefd52f16af83901f631cee304cc24e7f
[]
no_license
chevalvert/serialed
46b71ddbc4bd6e6bf284157eff53d2aca9cf02a8
3d1f1b1b7e6ff91f522e2a267cfcef1d46770d00
refs/heads/master
2020-04-18T14:24:59.609021
2019-01-25T17:44:57
2019-01-25T17:44:57
167,588,033
0
0
null
2019-01-25T17:42:02
2019-01-25T17:41:56
C++
UTF-8
C++
false
false
1,319
ino
#define BYTE_START_FRAME 253 #define BYTE_STOP_FRAME 254 #define BYTE_MSG_END 255 int readSize = 0; unsigned long lastPing = 0; void com_init() { Serial.begin(BAUDRATE); Serial.print("\n"); Serial.print("READY\n"); } bool com_loop() { // PING if ((millis() - lastPing) > 1000) { Serial.print("WAIT\n"); lastPing = millis(); } // RECEIVE readSize = Serial.readBytesUntil(BYTE_MSG_END, framebuffer, BUFFERSIZE); if (readSize == 0) { Serial.print("WAIT\n"); return false; } lastPing = millis(); // ECHO // Serial.print("GOT "+String(readSize)+" bytes: "); // for (int k=0; k<(readSize); k+=1) { // Serial.print(data[k]); // Serial.print(" "); // } // Serial.print("\n"); // CONFIRM INTEGRITY // Byte 0 = BYTE_START_FRAME // Byte N = BYTE_STOP_FRAME if (framebuffer[0] == BYTE_START_FRAME) { if (framebuffer[readSize-1] == BYTE_STOP_FRAME) { if (readSize-2 == FRAMESIZE) { // DRAW Serial.print("DRAW "+String(newFrame)+"\n"); return true; } else Serial.print("ERROR wrong frame length, expected "+String(FRAMESIZE)+" received "+String(readSize-2)+"\n"); } else Serial.print("ERROR frame incomplete\n"); } else Serial.print("ERROR first byte is invalid\n"); return false; }
[ "thomas.bohl@gmail.com" ]
thomas.bohl@gmail.com
fa13cd0e444c65c0583223974053fe89e3665e7d
54989a1fdafea0b1bfbc83dd80a236c3a08b934d
/src/dataPump/widget.h
eb2864e4774bfc27a5aeca55c5e2ca1b3920456d
[]
no_license
linbin823/Qt.711.2016.JJSH
cd0b16df9c910e045787b6e30fae482a2ed80ca8
f8e311cb50029747bd08aeee010f913e06f5e148
refs/heads/master
2020-06-13T14:09:36.628460
2017-05-08T03:05:32
2017-05-08T03:05:32
75,369,273
3
0
null
null
null
null
UTF-8
C++
false
false
759
h
#ifndef WIDGET_H #define WIDGET_H #include <QWidget> #include <QThread> #include <QTimer> #include <QList> #include <QHostAddress> #include <QNetworkInterface> #include <QFileDialog> #include "odbccomm.h" #include "modbustcpcomm.h" namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent = 0); ~Widget(); public slots: virtual void paintEvent(QPaintEvent * e); void stateUpdate(bool state); private slots: void on_exit_clicked(); void update(); void on_save_clicked(); void on_about_clicked(); private: Ui::Widget *ui; ModbusTCPComm* comm; odbcComm *db; QThread* dbThread; QTimer* timer; qint32 rollInterv; }; #endif // WIDGET_H
[ "13918814219@163.com" ]
13918814219@163.com
8336af704b84459dbe91e823e3dcb8673a7c0f24
3f3095dbf94522e37fe897381d9c76ceb67c8e4f
/Current/BP_Phys_GreatEggHunt_PaintedEgg.hpp
ea7f06f7dc46e439a1f93ef3b1dbc8c83ecfc68e
[]
no_license
DRG-Modding/Header-Dumps
763c7195b9fb24a108d7d933193838d736f9f494
84932dc1491811e9872b1de4f92759616f9fa565
refs/heads/main
2023-06-25T11:11:10.298500
2023-06-20T13:52:18
2023-06-20T13:52:18
399,652,576
8
7
null
null
null
null
UTF-8
C++
false
false
1,494
hpp
#ifndef UE4SS_SDK_BP_Phys_GreatEggHunt_PaintedEgg_HPP #define UE4SS_SDK_BP_Phys_GreatEggHunt_PaintedEgg_HPP class ABP_Phys_GreatEggHunt_PaintedEgg_C : public AActor { FPointerToUberGraphFrame UberGraphFrame; class UNiagaraComponent* Niagara; class UStaticMeshComponent* Mesh; class UCapsuleComponent* UseCapsule; class UGravityChangedComponent* GravityChanged; class UInstantUsable* InstantUsable; bool CanTriggerSound; FVector KickSoundLocation; class APlayerCharacter* KickedBy; int32 RandomPresentSound; TArray<class UTexture*> Textures_Eggs; int32 NumberOfImpacts; bool IsBroken; TArray<class UMaterialInterface*> Mats_Wrapper; class UMaterialInterface* UsedMaterial; class USoundCue* UsedSound; void OnRep_UsedMaterial(); void OnRep_RandomSeed(); void OnRep_NumberOfImpacts(); void OnRep_IsBroken(); void OnRep_KickSoundLocation(); void BndEvt__StaticMeshComponent0_K2Node_ComponentBoundEvent_0_ComponentHitSignature__DelegateSignature(class UPrimitiveComponent* HitComponent, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit); void BndEvt__InstantUsable_K2Node_ComponentBoundEvent_1_UsedBySignature__DelegateSignature(class APlayerCharacter* User, EInputKeys Key); void ReceiveBeginPlay(); void Play_Kick(class APlayerCharacter* Kicker); void ExecuteUbergraph_BP_Phys_GreatEggHunt_PaintedEgg(int32 EntryPoint); }; #endif
[ "bobby45900@gmail.com" ]
bobby45900@gmail.com
94073a660789dd3702fd70bd40c64858970f772a
fc79fe29914d224d9f3a1e494aff6b8937be723f
/Libraries/Rim Framework/include/rim/util/rimHashMap.h
41d690004ff3a8d7b4fa3732c0581cbaad572ec9
[]
no_license
niti1987/Quadcopter
e078d23dd1e736fda19b516a5cd5e4aca5aa3c50
6ca26b1224395c51369442f202d1b4c4b7188351
refs/heads/master
2021-01-01T18:55:55.210906
2014-12-09T23:37:09
2014-12-09T23:37:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
31,297
h
/* * rimHashMap.h * Rim Framework * * Created by Carl Schissler on 3/6/11. * Copyright 2011 Rim Software. All rights reserved. * */ #ifndef INCLUDE_RIM_HASH_MAP_H #define INCLUDE_RIM_HASH_MAP_H #include "rimUtilitiesConfig.h" #include "../math/rimPrimes.h" #include "rimAllocator.h" //########################################################################################## //*************************** Start Rim Utilities Namespace ****************************** RIM_UTILITIES_NAMESPACE_START //****************************************************************************************** //########################################################################################## //******************************************************************************** //******************************************************************************** //******************************************************************************** /// A container class which uses a hash table to map key objects to value objects. template < typename K, typename V, typename HashType = Hash > class HashMap { private: //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Private Bucket Class class Entry { public: RIM_INLINE Entry( HashType newKeyHash, const K& newKey, const V& newValue ) : next( NULL ), keyHash( newKeyHash ), key( newKey ), value( newValue ) { } Entry( const Entry& other ) : keyHash( other.keyHash ), key( other.key ), value( other.value ) { if ( other.next ) next = util::construct<Entry>(*other.next); else next = NULL; } ~Entry() { if ( next ) util::destruct(next); } Entry* next; HashType keyHash; K key; V value; }; public: //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Constructors /// Create a hash map with the default load factor and number of buckets. RIM_INLINE HashMap() : buckets( util::allocate<Entry*>(DEFAULT_NUMBER_OF_BUCKETS) ), numBuckets( DEFAULT_NUMBER_OF_BUCKETS ), numElements( 0 ), loadFactor( DEFAULT_LOAD_FACTOR ), loadThreshold( Size(DEFAULT_LOAD_FACTOR*DEFAULT_NUMBER_OF_BUCKETS) ) { nullBuckets(); } /// Create a hash map with the specified load factor and default number of buckets. RIM_INLINE HashMap( Float newLoadFactor ) : buckets( util::allocate<Entry*>(DEFAULT_NUMBER_OF_BUCKETS) ), numBuckets( DEFAULT_NUMBER_OF_BUCKETS ), numElements( 0 ), loadFactor( math::clamp( newLoadFactor, 0.1f, 2.0f ) ) { loadThreshold = Size(loadFactor*DEFAULT_NUMBER_OF_BUCKETS); nullBuckets(); } /// Create a hash map with the default load factor and specified number of buckets. RIM_INLINE HashMap( HashType newNumBuckets ) : numBuckets( math::nextPowerOf2Prime(newNumBuckets) ), numElements( 0 ), loadFactor( DEFAULT_LOAD_FACTOR ) { buckets = util::allocate<Entry*>(numBuckets); loadThreshold = Size(DEFAULT_LOAD_FACTOR*numBuckets); nullBuckets(); } /// Create a hash map with the specified load factor and number of buckets. RIM_INLINE HashMap( HashType newNumBuckets, Float newLoadFactor ) : numBuckets( math::nextPowerOf2Prime(newNumBuckets) ), numElements( 0 ), loadFactor( math::clamp( newLoadFactor, 0.1f, 2.0f ) ) { buckets = util::allocate<Entry*>(numBuckets); loadThreshold = Size(loadFactor*numBuckets); nullBuckets(); } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Copy Constructor /// Create a hash map with the specified load factor and number of buckets. RIM_INLINE HashMap( const HashMap& other ) : buckets( util::allocate<Entry*>(other.numBuckets) ), numBuckets( other.numBuckets ), numElements( other.numElements ), loadFactor( other.loadFactor ), loadThreshold( other.loadThreshold ) { // Copy the hash table buckets const Entry* const * otherBucket = other.buckets; const Entry* const * const otherBucketsEnd = otherBucket + numBuckets; Entry** bucket = buckets; while ( otherBucket != otherBucketsEnd ) { if ( *otherBucket ) *bucket = util::construct<Entry>(**otherBucket); else *bucket = NULL; otherBucket++; bucket++; } } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Assignment Operator /// Copy the contents of one hash map into another. RIM_INLINE HashMap& operator = ( const HashMap& other ) { if ( this != &other ) { deleteBuckets( buckets, numBuckets ); // Copy the parameters from the other hash map. numBuckets = other.numBuckets; numElements = other.numElements; buckets = util::allocate<Entry*>( numBuckets ); loadFactor = other.loadFactor; loadThreshold = other.loadThreshold; { // Copy the hash table buckets const Entry* const * otherBucket = other.buckets; const Entry* const * const otherBucketsEnd = otherBucket + numBuckets; Entry** bucket = buckets; while ( otherBucket != otherBucketsEnd ) { if ( *otherBucket ) *bucket = util::construct<Entry>(**otherBucket); else *bucket = NULL; otherBucket++; bucket++; } } } return *this; } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Destructor /// Destroy a hash map and it's contents, deallocating all memory used. RIM_INLINE ~HashMap() { deleteBuckets( buckets, numBuckets ); } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Add Method /// Add a new mapping to the hash map, associating the given key with the given value. /** * If the add operation was successful, it returns a pointer to the location * where the mapping's value is stored. Otherwise, a NULL pointer is returned. */ RIM_INLINE V* add( HashType keyHash, const K& key, const V& value ) { // Check the load constraint, if necessary, increase the size of the table. if ( numElements > loadThreshold ) resize( math::nextPowerOf2Prime( numBuckets + 1 ) ); // Compute the bucket for the new element. Entry** bucket = buckets + keyHash % numBuckets; numElements++; // Add the new element. if ( *bucket == NULL ) { *bucket = util::construct<Entry>( keyHash, key, value ); return &(*bucket)->value; } else { Entry* entry = *bucket; while ( entry->next ) entry = entry->next; entry->next = util::construct<Entry>( keyHash, key, value ); return &entry->next->value; } } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Set Method /// Set the mapping of a key to be the given value, regardless of it's previous state. /** * The method returns TRUE if the key did not previously exist in the HashMap. * Otherwise the method returns FALSE. */ RIM_INLINE Bool set( HashType keyHash, const K& key, const V& value ) { // Compute the bucket for the new element. Entry** bucket = buckets + keyHash % numBuckets; if ( *bucket == NULL ) *bucket = util::construct<Entry>( keyHash, key, value ); else { Entry* entry = *bucket; if ( entry->key == key ) { entry->value = value; return false; } while ( entry->next ) { entry = entry->next; if ( entry->key == key ) { entry->value = value; return false; } } entry->next = util::construct<Entry>( keyHash, key, value ); } numElements++; return true; } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Remove Methods /// Remove the first mapping of the given key and return the mapped value. /** * If the key does not exist in the hash map, then FALSE is returned, * otherwise TRUE is returned. */ RIM_INLINE Bool remove( HashType keyHash, const K& key ) { // Compute the bucket for the new element. Entry** bucket = buckets + keyHash % numBuckets; Entry** previousNext = bucket; Entry* entry = *bucket; while ( entry ) { if ( entry->key == key ) { *previousNext = entry->next; entry->next = NULL; util::destruct(entry); numElements--; return true; } previousNext = &(*previousNext)->next; entry = entry->next; } return false; } /// Remove a mapping from the hash map if it was found, returning the success. RIM_INLINE Bool remove( HashType keyHash, const K& key, const V& value ) { // Compute the bucket for the new element. Entry** bucket = buckets + keyHash % numBuckets; Entry** previousNext = bucket; Entry* entry = *bucket; while ( entry ) { if ( entry->key == key && entry->value == value ) { *previousNext = entry->next; entry->next = NULL; util::destruct(entry); numElements--; return true; } previousNext = &(*previousNext)->next; entry = entry->next; } return false; } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Clear Method /// Clear all mappings from the hash map. RIM_INLINE void clear() { // Delete all entries Entry** entry = buckets; const Entry* const * const entryEnd = entry + numBuckets; while ( entry != entryEnd ) { if ( *entry ) { util::destruct(*entry); *entry = NULL; } entry++; } numElements = 0; } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Contains Methods /// Query whether or not the specified key is contained in a hash map. RIM_INLINE Bool find( HashType keyHash, const K& key, V*& value ) { // Compute the bucket for the query. Entry* entry = *(buckets + keyHash % numBuckets); // Look for the key in the bucket. while ( entry ) { if ( entry->key == key ) { value = &entry->value; return true; } entry = entry->next; } return false; } /// Query whether or not the specified key is contained in a hash map. RIM_INLINE Bool find( HashType keyHash, const K& key, const V*& value ) const { // Compute the bucket for the query. Entry* entry = *(buckets + keyHash % numBuckets); // Look for the key in the bucket. while ( entry ) { if ( entry->key == key ) { value = &entry->value; return true; } entry = entry->next; } return false; } /// Query whether or not the specified key is contained in a hash map. RIM_INLINE Bool contains( HashType keyHash, const K& key ) const { // Compute the bucket for the query. Entry* entry = *(buckets + keyHash % numBuckets); // Look for the key in the bucket. while ( entry ) { if ( entry->key == key ) return true; entry = entry->next; } return false; } /// Query whether or not a particular mapping exists in the hash map. RIM_INLINE Bool contains( HashType keyHash, const K& key, const V& value ) const { // Compute the bucket for the query. Entry* entry = *(buckets + keyHash % numBuckets); // Look for the key in the bucket. while ( entry ) { if ( entry->key == key && entry->value == value ) return true; entry = entry->next; } return false; } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Size Accessor Methods /// Return the number of mappings in a hash map. RIM_INLINE Size getSize() const { return numElements; } /// Return whether or not a hash map is empty. RIM_INLINE Bool isEmpty() const { return numElements == Size(0); } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Get Methods /// Return a pointer to the value associated with the given key. /** * If the key does not exist in the hash map, a NULL pointer is * returned. */ RIM_INLINE V* get( HashType keyHash, const K& key ) { // Compute the bucket for the query. Entry* entry = *(buckets + keyHash % numBuckets); // Look for the key in the bucket. while ( entry ) { if ( entry->key == key ) return &entry->value; entry = entry->next; } return NULL; } /// Return a const pointer to the value associated with the given key. /** * If the key does not exist in the hash map, a NULL pointer is * returned. */ RIM_INLINE const V* get( HashType keyHash, const K& key ) const { // Compute the bucket for the query. Entry* entry = *(buckets + keyHash % numBuckets); // Look for the key in the bucket. while ( entry ) { if ( entry->key == key ) return &entry->value; entry = entry->next; } return NULL; } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Iterator Class /// A class which iterates over hash map elements. class Iterator { public: //******************************************** // Constructor /// Create a new hash map iterator for the specified hash map. RIM_INLINE Iterator( HashMap& newHashMap ) : hashMap( newHashMap ), currentBucket( newHashMap.buckets ), bucketsEnd( newHashMap.buckets + newHashMap.numBuckets ) { // advance until the first element advanceToNextFullBucket(); } //******************************************** // Public Methods /// Increment the location of a hash map iterator by one element. RIM_INLINE void operator ++ () { currentEntry = currentEntry->next; if ( currentEntry == NULL ) { currentBucket++; advanceToNextFullBucket(); } } /// Increment the location of a hash map iterator by one element. RIM_INLINE void operator ++ ( int ) { this->operator++(); } /// Test whether or not the current element is valid. /** * This will return FALSE when the last element of the hash map * has been iterated over. */ RIM_INLINE operator Bool () const { return currentEntry != NULL; } /// Return the value of the key-value pair pointed to by the iterator. RIM_INLINE V& operator * () const { return currentEntry->value; } /// Access the current iterator element value RIM_INLINE V* operator -> () const { return &currentEntry->value; } /// Get the value of the key-value pair pointed to by the iterator. RIM_INLINE V& getValue() const { return currentEntry->value; } /// Get the key of the key-value pair pointed to by the iterator. RIM_INLINE K& getKey() const { return currentEntry->key; } /// Get the key hash of the key-value pair pointed to by the iterator. RIM_INLINE HashType getKeyHash() const { return currentEntry->keyHash; } /// Remove the current element from the hash table. RIM_INLINE void remove() { // Backup in the bucket so that we can remove the current element. // This is potentially inefficient, it would be best if the buckets // would use a doublely linked list, but this might add extra overhead // elsewhere. // Handle removing from the start of a bucket separately. if ( currentEntry == *currentBucket ) { *currentBucket = currentEntry->next; if ( *currentBucket != NULL ) { currentEntry->next = NULL; util::destruct( currentEntry ); currentEntry = *currentBucket; } else { util::destruct( currentEntry ); currentBucket++; advanceToNextFullBucket(); } } else { // Otherwise, iterate through the bucket until we find the element // before this one. Entry* previousEntry = *currentBucket; while ( previousEntry && previousEntry->next != currentEntry ) previousEntry = previousEntry->next; previousEntry->next = currentEntry->next; Entry* temp = currentEntry; operator++(); temp->next = NULL; util::destruct( temp ); } hashMap.numElements--; } /// Reset the iterator to the beginning of the hash map. RIM_INLINE void reset() { currentBucket = hashMap.buckets; // advance until the first element advanceToNextFullBucket(); } private: //******************************************** // Private Methods /// Advance the iterator to the next non-empty bucket. RIM_INLINE void advanceToNextFullBucket() { while ( *currentBucket == NULL && currentBucket != bucketsEnd ) currentBucket++; if ( currentBucket == bucketsEnd ) currentEntry = NULL; else currentEntry = *currentBucket; } //******************************************** // Private Data Members /// The HashMap that is being iterated over. HashMap& hashMap; /// The current bucket in the HashMap. Entry** currentBucket; /// The last bucket in the HashMap. const Entry* const * const bucketsEnd; /// The current entry in the hash map that the iterator is pointing to. Entry* currentEntry; }; //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** ConstIterator Class /// A class which iterates over hash map elements without the ability to modify them. class ConstIterator { public: //******************************************** // Constructor /// Create a new hash map iterator for the specified hash map. RIM_INLINE ConstIterator( const HashMap& newHashMap ) : hashMap( newHashMap ), currentBucket( newHashMap.buckets ), bucketsEnd( newHashMap.buckets + newHashMap.numBuckets ) { // advance until the first element advanceToNextFullBucket(); } //******************************************** // Public Methods /// Increment the location of a hash map iterator by one element. RIM_INLINE void operator ++ () { currentEntry = currentEntry->next; if ( currentEntry == NULL ) { currentBucket++; advanceToNextFullBucket(); } } /// Increment the location of a hash map iterator by one element. RIM_INLINE void operator ++ ( int ) { this->operator++(); } /// Test whether or not the current element is valid. /** * This will return FALSE when the last element of the hash map * has been iterated over. */ RIM_INLINE operator Bool () const { return currentEntry != NULL; } /// Return the value of the key-value pair pointed to by the iterator. RIM_INLINE const V& operator * () const { return currentEntry->value; } /// Access the current iterator element value RIM_INLINE const V* operator -> () const { return &currentEntry->value; } /// Get the value of the key-value pair pointed to by the iterator. RIM_INLINE const V& getValue() const { return currentEntry->value; } /// Get the key of the key-value pair pointed to by the iterator. RIM_INLINE const K& getKey() const { return currentEntry->key; } /// Get the key hash of the key-value pair pointed to by the iterator. RIM_INLINE HashType getKeyHash() const { return currentEntry->keyHash; } /// Reset the iterator to the beginning of the hash map. RIM_INLINE void reset() { currentBucket = hashMap.buckets; // advance until the first element advanceToNextFullBucket(); } private: //******************************************** // Private Methods /// Advance the iterator to the next non-empty bucket. RIM_INLINE void advanceToNextFullBucket() { while ( *currentBucket == NULL && currentBucket != bucketsEnd ) currentBucket++; if ( currentBucket == bucketsEnd ) currentEntry = NULL; else currentEntry = *currentBucket; } //******************************************** // Private Data Members /// The HashMap that is being iterated over. const HashMap& hashMap; /// The current bucket in the HashMap. const Entry* const * currentBucket; /// The last bucket in the HashMap. const Entry* const * bucketsEnd; /// The current entry in the hash map that the iterator is pointing to. const Entry* currentEntry; }; //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Iterator Method /// Get a const-iterator for the hash map. RIM_INLINE ConstIterator getIterator() const { return ConstIterator(*this); } /// Get an iterator for the hash map that can modify the hash map. RIM_INLINE Iterator getIterator() { return Iterator(*this); } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Load Factor Accessor Methods RIM_INLINE void setLoadFactor( Float newLoadFactor ) { loadFactor = math::clamp( newLoadFactor, 0.1f, 5.0f ); loadThreshold = Size(loadFactor*numBuckets); // Check the load constraint, if necessary, increase the size of the table. if ( numElements > loadThreshold ) resize( math::nextPowerOf2Prime( numBuckets + 1 ) ); } RIM_INLINE Float getLoadFactor() const { return loadFactor; } private: //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Private Methods void resize( HashType newNumBuckets ) { Entry** oldBuckets = buckets; HashType oldNumBuckets = numBuckets; // initialize all buckets and resize the array numBuckets = newNumBuckets; loadThreshold = Size(loadFactor*numBuckets); buckets = util::allocate<Entry*>(numBuckets); nullBuckets(); // add old elements to the hash map. Entry** oldBucket = oldBuckets; const Entry* const * const oldBucketsEnd = oldBucket + oldNumBuckets; while ( oldBucket != oldBucketsEnd ) { Entry* oldEntry = *oldBucket; while ( oldEntry ) { Entry** bucket = buckets + oldEntry->keyHash % numBuckets; // Add the old element to the end of the bucket. if ( *bucket == NULL ) { *bucket = oldEntry; oldEntry = oldEntry->next; (*bucket)->next = NULL; } else { Entry* entry = *bucket; while ( entry->next ) entry = entry->next; entry->next = oldEntry; oldEntry = oldEntry->next; entry->next->next = NULL; } } oldBucket++; } // deallocate all memory currently used by the old buckets util::deallocate(oldBuckets); } RIM_INLINE void nullBuckets() { Entry** bucket = buckets; const Entry* const * const bucketsEnd = bucket + numBuckets; while ( bucket != bucketsEnd ) { *bucket = NULL; bucket++; } } RIM_INLINE static void deleteBuckets( Entry** buckets, HashType numBuckets ) { // Delete all entries Entry** entry = buckets; const Entry* const * const entryEnd = entry + numBuckets; while ( entry != entryEnd ) { if ( *entry ) util::destruct(*entry); entry++; } // Delete the bucket array. util::deallocate(buckets); } //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Private Data Members /// A pointer to an array of pointers to the buckets for this hash map. Entry** buckets; /// The total number of buckets that are part of this hash map. Size numBuckets; /// The total number of entries that are stored in this hash map. Size numElements; /// The fraction of the number of buckets that the hash map can have filled before it resizes. Float loadFactor; /// The maximum number of elements this hash map can have before it is resized. /** * This value is computed as the load factor multiplied with the number of buckets. */ Size loadThreshold; //******************************************************************************** //******************************************************************************** //******************************************************************************** //****** Private Static Data Members static const Size DEFAULT_NUMBER_OF_BUCKETS = 19; static const Float DEFAULT_LOAD_FACTOR; }; template < typename K, typename V, typename HashType > const Float HashMap<K,V,HashType>:: DEFAULT_LOAD_FACTOR = 0.5f; //########################################################################################## //*************************** End Rim Utilities Namespace ******************************** RIM_UTILITIES_NAMESPACE_END //****************************************************************************************** //########################################################################################## #endif // INCLUDE_RIM_HASH_MAP_H
[ "niti1987@gmail.com" ]
niti1987@gmail.com
c6a6920c91769f91c39de37d21b8e8dd7b250f89
05c1705e813aafcb5766edb03f0e5f2b8470cea9
/graphics-labs-and-project/Project/main.cpp
8ab6cad2dfc0c53ca74d0d963efe11c6322eec9a
[]
no_license
AniketAg/Computer-graphics
c0ca25338834bc9ed7a1b55bda6b34076635654a
196e71a7b1562388cc32175cc8cf4c4ee3dc2f45
refs/heads/master
2020-04-18T07:50:36.906633
2019-01-24T13:46:35
2019-01-24T13:46:35
167,374,445
0
0
null
null
null
null
UTF-8
C++
false
false
23,418
cpp
/*---------------------------------------------------- Headers, Include files & Namespace Declarations ----------------------------------------------------*/ #include <GL/glew.h> #include <GL/freeglut.h> #include <stdio.h> #include <iostream> #include <mmsystem.h> #include <string.h> #include <string> // For loading textures #include "SOIL.h" //for transformations #include <GL/glm/glm/glm.hpp> #include <GL/glm/glm/gtc/matrix_transform.hpp> #include <GL/glm/glm/gtc/type_ptr.hpp> //list of vertices & positions #include "cube_vertices.h" #include "ground_vertices.h" #include "object_positions.h" using namespace std; /*-------------------------------------------- Globals & Constants --------------------------------------------*/ // Window Constants int WINDOW_WIDTH = 1400; int WINDOW_HEIGHT = 800; // Shader vars const char OBJECT_VERTEX_SHADER[] = "C:/Users/Aniket Agarwal/Desktop/Tcd study/4th Year/Computer Graphics/Lab_1_2018/Lab 1 2018/Lab 1/Shaders/ObjectsVertexShader.txt"; const char OBJECT_FRAGMENT_SHADER[] = "C:/Users/Aniket Agarwal/Desktop/Tcd study/4th Year/Computer Graphics/Lab_1_2018/Lab 1 2018/Lab 1/Shaders/ObjectsFragmentShader.txt"; const char LIGHTING_VERTEX_SHADER[] = "C:/Users/Aniket Agarwal/Desktop/Tcd study/4th Year/Computer Graphics/Lab_1_2018/Lab 1 2018/Lab 1/Shaders/LightingVertexShader.txt"; const char LIGHTING_FRAGMENT_SHADER[] = "C:/Users/Aniket Agarwal/Desktop/Tcd study/4th Year/Computer Graphics/Lab_1_2018/Lab 1 2018/Lab 1/Shaders/LightingFragmentShader.txt"; GLuint vertexShader, fragmentShader; GLuint objectShaderProgramID; GLuint lightingShaderProgramID; // Vertex Objects GLuint CUBE_VAO, GROUND_VAO, LIGHT_VAO; //Textures GLuint containerSpecularMapID, containerDiffuseMapID; GLuint cubeTextID, groundTextID, lightTextID; GLuint blankTextID, wallTextID; // View & Camera Vars glm::vec3 cameraPos = glm::vec3(0.0f, 0.0f, 6.0f); glm::vec3 cameraFront = glm::vec3(0.0f, 4.0f, 0.0f); glm::vec3 cameraUp = glm::vec3(0.0f, 1.0f, 0.0f); float pitch = 0.0f, yaw = -90.0f; // Event array for Key presses bool keys[256]; bool specKeys[256]; //projection glm::mat4 projection; /*----------------------------------------- Shader Functions ------------------------------------------*/ #pragma region SHADER_FUNCTIONS // Create a NULL-terminated string by reading the provided file char* readShaderSource(const char* shaderFile) { FILE* fp; fopen_s(&fp, shaderFile, "rb"); //!->Why does binary flag "RB" work and not "R" if (fp == NULL) { return NULL; } fseek(fp, 0L, SEEK_END); long size = ftell(fp); fseek(fp, 0L, SEEK_SET); char* buf = new char[size + 1]; fread(buf, 1, size, fp); buf[size] = '\0'; fclose(fp); return buf; } static GLuint AddShader(GLuint ShaderProgram, const char* pShaderText, GLenum ShaderType) { // create a shader object, referenced by an ID GLuint ShaderObj = glCreateShader(ShaderType); //check if it was created successfully if (ShaderObj == 0) { fprintf(stderr, "Error creating shader type %d\n", ShaderType); exit(0); } //load source const char* pShaderSource = readShaderSource(pShaderText); //attach the shader source code to the shader object and compile the shader glShaderSource(ShaderObj, 1, (const GLchar**)&pShaderSource, NULL); glCompileShader(ShaderObj); GLint success; // check for shader related errors using glGetShaderiv glGetShaderiv(ShaderObj, GL_COMPILE_STATUS, &success); if (!success) { GLchar InfoLog[1024]; glGetShaderInfoLog(ShaderObj, 1024, NULL, InfoLog); fprintf(stderr, "Error compiling shader type %d: '%s'\n", ShaderType, InfoLog); exit(1); } // Attach the compiled shader object to the program object glAttachShader(ShaderProgram, ShaderObj); return ShaderObj; } GLuint CompileShaders(const char* VERTEX_SHADER, const char* FRAGMENT_SHADER) { //Note: we will link all the shaders together into this ID /*A shader program object is the final linked version of multiple shaders combined. We have to link them to a shader program object and then activate this shader program when rendering objects. When linking the shaders into a program it links the outputs of each shader to the inputs of the next shader. */ GLuint shaderProgramID = glCreateProgram(); if (shaderProgramID == 0) { fprintf(stderr, "Error creating shader program\n"); exit(1); } // Create shader objects, vertex & fragment vertexShader = AddShader(shaderProgramID, VERTEX_SHADER, GL_VERTEX_SHADER); fragmentShader = AddShader(shaderProgramID, FRAGMENT_SHADER, GL_FRAGMENT_SHADER); GLint Success = 0; GLchar ErrorLog[1024] = { 0 }; // After compiling all shader objects and attaching them to the program, we can finally link it glLinkProgram(shaderProgramID); // check for program related errors using glGetProgramiv glGetProgramiv(shaderProgramID, GL_LINK_STATUS, &Success); if (Success == 0) { glGetProgramInfoLog(shaderProgramID, sizeof(ErrorLog), NULL, ErrorLog); fprintf(stderr, "Error linking shader program: '%s'\n", ErrorLog); exit(1); } // program has been successfully linked but needs to be validated to check whether the program can execute given the current pipeline state glValidateProgram(shaderProgramID); // check for program related errors using glGetProgramiv glGetProgramiv(shaderProgramID, GL_VALIDATE_STATUS, &Success); if (!Success) { glGetProgramInfoLog(shaderProgramID, sizeof(ErrorLog), NULL, ErrorLog); fprintf(stderr, "Invalid shader program: '%s'\n", ErrorLog); exit(1); } glDetachShader(vertexShader, shaderProgramID); glDetachShader(fragmentShader, shaderProgramID); glDeleteShader(vertexShader); glDeleteShader(fragmentShader); return shaderProgramID; } #pragma endregion SHADER_FUNCTIONS /*----------------------------------------- Vertex Object Functions ------------------------------------------*/ #pragma region VBO_FUNCTIONS void generateObjectBuffers(GLuint* VAO, GLfloat vertices[], GLuint numVertices) { //A buffer object is created by binding a name returned by GenBuffers to //a buffer target.The binding is effected by calling glBindBuffers GLuint VBO; // Bind the Vertex Array Object first, then bind and set vertex buffer(s) and attribute pointer(s). glGenVertexArrays(1, VAO); glGenBuffers(1, &VBO); //glGenBuffers(1, &EBO); // Bind buffer and array objects glBindVertexArray(*VAO); glBindBuffer(GL_ARRAY_BUFFER, VBO); // After binding, we now fill our object with data, create empty buffer first // if you have more data besides vertices (e.g., colours or yextures), use glBufferSubData to //tell the buffer when the vertices array ends and when the colors start glBufferData(GL_ARRAY_BUFFER, numVertices * 8 * sizeof(GLfloat), vertices, GL_STATIC_DRAW); // Position attribute glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(GLfloat), (GLvoid*)0); // param is 0, location of position data in vertex shader //enable position attr, pointed to by attribPointer, disabled by default in opengl glEnableVertexAttribArray(0); // Normal attribute glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(GLfloat), (GLvoid*)(3 * sizeof(GLfloat))); glEnableVertexAttribArray(1); //Texture attributes glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 8 * sizeof(GLfloat), (GLvoid*)(6 * sizeof(GLfloat))); glEnableVertexAttribArray(2); glBindVertexArray(0); //.. note stride sizes above would be 0 if are tightly packed //bind element array and load indices //glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO); //glBufferData(GL_ELEMENT_ARRAY_BUFFER, 6 * sizeof(GLuint), indices, GL_STATIC_DRAW); //unbind buffers // unbind EBO after VAO otherwise EBO wont be associated with VAO glBindVertexArray(0); glBindBuffer(GL_ARRAY_BUFFER, 0); //call to glVertexAttribPointer registered VBO as the currently bound vertex buffer object so afterwards we can safely unbind //glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } void generateLightObjectBuffers(GLuint* VAO, GLfloat vertices[], GLuint numVertices) { // Then, we set the light's VAO (VBO stays the same. After all, the vertices are the same for the light object (also a 3D cube)) GLuint VBO; // Bind the Vertex Array Object first, then bind and set vertex buffer(s) and attribute pointer(s). glGenVertexArrays(1, VAO); glGenBuffers(1, &VBO); // Bind buffer objects glBindVertexArray(*VAO); glBindBuffer(GL_ARRAY_BUFFER, VBO); glBufferData(GL_ARRAY_BUFFER, numVertices * 8 * sizeof(GLfloat), vertices, GL_STATIC_DRAW); // Set the vertex attributes (only position data for the lamp)) glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(GLfloat), (GLvoid*)0); // Note that we skip over the normal vectors glEnableVertexAttribArray(0); glBindVertexArray(0); glBindBuffer(GL_ARRAY_BUFFER, 0); } #pragma endregion VBO_FUNCTIONS /*----------------------------------------- Mesh & Texture Functions ------------------------------------------*/ #pragma region MESH_TEXTURE_FUNCTIONS void generateTexture(const char* texture_loc, GLuint* texture) { // Load and create a texture glGenTextures(1, texture); glBindTexture(GL_TEXTURE_2D, *texture); // All upcoming GL_TEXTURE_2D operations now have effect on this texture object // Set the texture wrapping parameters glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); // Set texture wrapping to GL_REPEAT (usually basic wrapping method) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); // Set texture filtering parameters glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Load image, create texture and generate mipmaps int width, height; unsigned char* image = SOIL_load_image(texture_loc, &width, &height, 0, SOIL_LOAD_RGBA); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image); glGenerateMipmap(GL_TEXTURE_2D); //free the image memory and unbind texture SOIL_free_image_data(image); glBindTexture(GL_TEXTURE_2D, 0); } void generateTextureMap(const char* texture_loc, GLuint* texture) { // Load textures //GLuint diffuseMap, specularMap; glGenTextures(1, texture); //glGenTextures(1, &specularMap); int width, height; unsigned char* image; // Generate texture map image = SOIL_load_image(texture_loc, &width, &height, 0, SOIL_LOAD_RGB); glBindTexture(GL_TEXTURE_2D, *texture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, image); glGenerateMipmap(GL_TEXTURE_2D); SOIL_free_image_data(image); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST_MIPMAP_NEAREST); /* Specular map image = SOIL_load_image("container2_specular.png", &width, &height, 0, SOIL_LOAD_RGB); glBindTexture(GL_TEXTURE_2D, specularMap); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, image); glGenerateMipmap(GL_TEXTURE_2D); SOIL_free_image_data(image); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST_MIPMAP_NEAREST); glBindTexture(GL_TEXTURE_2D, 0); */ } #pragma endregion MESH_TEXTURE_FUNCTIONS /*----------------------------------------- Key Functions ------------------------------------------*/ #pragma region KEY_FUNCTIONS void keypress(unsigned char key, int x, int y) { keys[int(key)] = true; // Set the state of the current key to pressed } void keyUp(unsigned char key, int x, int y) { keys[int(key)] = false; // Set the state of the current key to not pressed } void specialKeyPress(int key, int x, int y) { specKeys[key] = true; // Set the state of the current key to pressed } void specialKeyUp(int key, int x, int y) { specKeys[key] = false; // Set the state of the current key to not pressed } void keyOperations(void) { //so we cant move up and down the y-axis, remove y value from cameraFront glm::vec3 camForward = cameraFront * glm::vec3(1.0f, 0.0f, 1.0f); GLfloat cameraSpeed = 0.1f; if (specKeys[GLUT_KEY_UP]) cameraPos += cameraSpeed * camForward; if (specKeys[GLUT_KEY_DOWN]) cameraPos -= cameraSpeed * camForward; if (specKeys[GLUT_KEY_LEFT]) cameraPos -= glm::normalize(glm::cross(cameraFront, cameraUp)) * cameraSpeed; if (specKeys[GLUT_KEY_RIGHT]) cameraPos += glm::normalize(glm::cross(cameraFront, cameraUp)) * cameraSpeed; if (keys['w']) //if(pitch <= 89.9f) pitch += 0.25; if (keys['s']) //if (pitch >= -89.9f) pitch -= 0.25; if (keys['d']) //if (yaw <= -0.1f) yaw += 0.25; if (keys['a']) //if (yaw >= -179.9f) yaw -= 0.25; // Draw the next frame glutPostRedisplay(); } #pragma endregion KEY_FUNCTIONS /*----------------------------------------- Display Functions ------------------------------------------*/ #pragma region DISPLAY_FUNCTIONS void display() { //check for key events keyOperations(); // enable depth-testing - only draw onto a pixel if the shape is closer to the viewer glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); // depth-testing interprets a smaller value as "closer" //clear last display. Clear screen color buffer & depth buffer glClearColor(0.2f, 0.2f, 0.2f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glUseProgram(objectShaderProgramID); GLint viewPosLoc = glGetUniformLocation(objectShaderProgramID, "viewPos"); glUniform3f(viewPosLoc, cameraPos.x, cameraPos.y, cameraPos.z); // Create Camera/View transformations glm::mat4 view; glm::vec3 front; front.x = cos(glm::radians(pitch)) * cos(glm::radians(yaw)); front.y = sin(glm::radians(pitch)); front.z = cos(glm::radians(pitch)) * sin(glm::radians(yaw)); cameraFront = glm::normalize(front); view = glm::lookAt(cameraPos, cameraPos + cameraFront, cameraUp); // Get their uniform location GLint modelLoc = glGetUniformLocation(objectShaderProgramID, "model"); GLint viewLoc = glGetUniformLocation(objectShaderProgramID, "view"); GLint projLoc = glGetUniformLocation(objectShaderProgramID, "projection"); // Pass the matrices to the shader glUniformMatrix4fv(viewLoc, 1, GL_FALSE, glm::value_ptr(view)); // Note: currently we set the projection matrix each frame, but since the projection matrix rarely //changes it's often best practice to set it outside the main loop only once. glUniformMatrix4fv(projLoc, 1, GL_FALSE, glm::value_ptr(projection)); // ------ draw cube objects ----------------------------------------------------------------- // Bind diffuse map glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, containerDiffuseMapID); // Bind specular map glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, containerSpecularMapID); glBindVertexArray(CUBE_VAO); for (GLuint i = 0; i < 6; i++) { //float j = i + 10.0f; glm::mat4 model; model = glm::translate(model, outsideShelvingPositions[i]); //GLfloat angle = 20.0f + j; model = glm::scale(model, glm::vec3(10.0f, 6.0f, 1.0f)); glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); glDrawArrays(GL_TRIANGLES, 0, cube_vertex_count); } // ------ draw four walls ----------------------------------------------------------------- glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, blankTextID); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, 0); glBindVertexArray(GROUND_VAO); for (GLuint i = 0; i < 4; i++) { glm::mat4 model; model = glm::translate(model, wallPositions[i]); model = glm::rotate(model, (i*90.0f), glm::vec3(0.0f, 1.0f, 0.0f)); model = glm::scale(model, glm::vec3(60.0f, 15.0f, 15.0f)); glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); glDrawArrays(GL_TRIANGLES, 0, ground_vertex_count); } // ------ draw ground --------------------------------------------------------------------- glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, groundTextID); glm::mat4 model; model = glm::translate(model, glm::vec3(0.0, -35.0, -4.0)); model = glm::rotate(model, (90.0f), glm::vec3(1.0f, 0.0f, 0.0f)); model = glm::scale(model, glm::vec3(60.0f, 60.0f, 60.0f)); glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); glDrawArrays(GL_TRIANGLES, 0, ground_vertex_count); // ------ draw ceiling --------------------------------------------------------------------- glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, blankTextID); model = glm::mat4(); model = glm::translate(model, glm::vec3(0.0, -20.0, -4.0)); model = glm::rotate(model, (90.0f), glm::vec3(1.0f, 0.0f, 0.0f)); model = glm::scale(model, glm::vec3(60.0f, 60.0f, 60.0f)); glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); glDrawArrays(GL_TRIANGLES, 0, ground_vertex_count); // ------ draw light source(s) ------------------------------------------------------------ glUseProgram(lightingShaderProgramID); glUniformMatrix4fv(viewLoc, 1, GL_FALSE, glm::value_ptr(view)); glUniformMatrix4fv(projLoc, 1, GL_FALSE, glm::value_ptr(projection)); glBindVertexArray(LIGHT_VAO); for (GLuint i = 0; i < 24; i++) { model = glm::mat4(); model = glm::translate(model, lightPositions[i]); model = glm::scale(model, glm::vec3(0.5f, 0.5f, 3.5f)); glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); glDrawArrays(GL_TRIANGLES, 0, cube_vertex_count); } // Swap the screen buffers glutSwapBuffers(); glutPostRedisplay(); } void idle() { // Draw the next frame glutPostRedisplay(); } #pragma endregion DISPLAY_FUNCTIONS void init() { //wireframe mode: //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); //set projection projection = glm::perspective(45.0f, (GLfloat)WINDOW_WIDTH / (GLfloat)WINDOW_HEIGHT, 0.1f, 100.0f); // make sure keyboard arrays are init to all false memset(keys, 0, sizeof(bool) * 256); memset(specKeys, 0, sizeof(bool) * 256); // Set up the shaders objectShaderProgramID = CompileShaders(OBJECT_VERTEX_SHADER, OBJECT_FRAGMENT_SHADER); lightingShaderProgramID = CompileShaders(LIGHTING_VERTEX_SHADER, LIGHTING_FRAGMENT_SHADER); // Generate textures // tex locations const char wall_texture[] = "C:/Users/Aniket Agarwal/Desktop/Tcd study/4th Year/Computer Graphics/Lab_1_2018/Lab 1 2018/Lab 1/wall.jpg"; const char cube_texture[] = "C:/Users/Aniket Agarwal/Desktop/Tcd study/4th Year/Computer Graphics/Lab_1_2018/Lab 1 2018/Lab 1/container.jpg"; const char ground_texture[] = "C:/Users/Aniket Agarwal/Desktop/Tcd study/4th Year/Computer Graphics/Lab_1_2018/Lab 1 2018/Lab 1/supermarket-wall-clean.jpg"; const char cube_specular[] = "C:/Users/Aniket Agarwal/Desktop/Tcd study/4th Year/Computer Graphics/Lab_1_2018/Lab 1 2018/Lab 1/container_specular.png"; const char cube_diffuse[] = "C:/Users/Aniket Agarwal/Desktop/Tcd study/4th Year/Computer Graphics/Lab_1_2018/Lab 1 2018/Lab 1/container.png"; const char blank[] = "C:/Users/Aniket Agarwal/Desktop/Tcd study/4th Year/Computer Graphics/Lab_1_2018/Lab 1 2018/Lab 1/blank.jpg"; generateTexture(wall_texture, &wallTextID); generateTexture(cube_texture, &cubeTextID); generateTexture(ground_texture, &groundTextID); generateTextureMap(cube_specular, &containerSpecularMapID); generateTextureMap(cube_diffuse, &containerDiffuseMapID); generateTexture(blank, &blankTextID); // Put the vertices and colors into a vertex buffer object generateObjectBuffers(&CUBE_VAO, cube_vertices, cube_vertex_count); generateObjectBuffers(&GROUND_VAO, ground_vertices, ground_vertex_count); generateLightObjectBuffers(&LIGHT_VAO, cube_vertices, cube_vertex_count); glUseProgram(objectShaderProgramID); // Set lights properties // set light properties in objectFragShader glUniform1f(glGetUniformLocation(objectShaderProgramID, "material.shininess"), 32.0f); glUniform1i(glGetUniformLocation(objectShaderProgramID, "material.diffuse"), 0); glUniform1i(glGetUniformLocation(objectShaderProgramID, "material.specular"), 1); //Pass point lights to fragment shader for (GLuint i = 0; i < 24; i++) { std::string string1 = "pointLights[i].position"; std::string string2 = "pointLights[i].ambient"; std::string string3 = "pointLights[i].diffuse"; std::string string4 = "pointLights[i].specular"; std::string string5 = "pointLights[i].constant"; std::string string6 = "pointLights[i].linear"; std::string string7 = "pointLights[i].quadratic"; string1.replace(12, 1, to_string(i)); string2.replace(12, 1, to_string(i)); string3.replace(12, 1, to_string(i)); string4.replace(12, 1, to_string(i)); string5.replace(12, 1, to_string(i)); string6.replace(12, 1, to_string(i)); string7.replace(12, 1, to_string(i)); glUniform3f(glGetUniformLocation(objectShaderProgramID, string1.c_str()), lightPositions[i].x, lightPositions[i].y, lightPositions[i].z); glUniform3f(glGetUniformLocation(objectShaderProgramID, string2.c_str()), 0.5f, 0.5f, 0.5f); glUniform3f(glGetUniformLocation(objectShaderProgramID, string3.c_str()), 0.8f, 0.8f, 0.8f); glUniform3f(glGetUniformLocation(objectShaderProgramID, string4.c_str()), 1.0f, 1.0f, 1.0f); glUniform1f(glGetUniformLocation(objectShaderProgramID, string5.c_str()), 1.0f); glUniform1f(glGetUniformLocation(objectShaderProgramID, string6.c_str()), 0.09); glUniform1f(glGetUniformLocation(objectShaderProgramID, string7.c_str()), 0.032); } } int main(int argc, char** argv) { // Set up the window glutInit(&argc, argv); //glut double means we are using two buffers, one is drawn to screen, //other is where we render stuff to draw glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA); glutInitWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT); //using version 3.3 glutInitContextVersion(3, 3); //let glut know we want to use core profile //we'll be notified if we try use legacy functions glutInitContextProfile(GLUT_CORE_PROFILE); //note we can't set fixed size window as with glfw //create window object glutCreateWindow("Hello Triangle"); //glew manages function pointers for openGL, //NB** need to init before calling any openGL fucntions. //setting glewExp to true ensures GLEW uses modern techniques // for managing openGL, important for core profile (default is false) glewExperimental = GL_TRUE; // A call to glewInit() must be done after glut is initialized! GLenum res = glewInit(); // Check for any errors if (res != GLEW_OK) { fprintf(stderr, "Error: '%s'\n", glewGetErrorString(res)); return 1; } // Tell glut where the display function is glutDisplayFunc(display); //glutIdleFunc(idle); glutKeyboardFunc(keypress); glutSpecialFunc(specialKeyPress); glutKeyboardUpFunc(keyUp); glutSpecialUpFunc(specialKeyUp); // Can check how many vertex attribs are supported in GPU shaders GLint nrAttributes; glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &nrAttributes); std::cout << "Maximum nr of vertex attributes supported: " << nrAttributes << std::endl; // Set up your objects and shaders init(); // Begin infinite event loop // draw/idle/callbacks etc will be called in here glutMainLoop(); // Properly de-allocate all resources once they've outlived their purpose glDeleteVertexArrays(1, &CUBE_VAO); glDeleteBuffers(1, &GROUND_VAO); return 0; }
[ "noreply@github.com" ]
AniketAg.noreply@github.com
42985d96d281e8a780887df96f0376c0b9edd219
5d83739af703fb400857cecc69aadaf02e07f8d1
/Archive/1db66dd008810649b92688cc63b333c5/main.cpp
391dfac539b6856ccaf639a76cf8ac0c0c2fbfea
[]
no_license
WhiZTiM/coliru
3a6c4c0bdac566d1aa1c21818118ba70479b0f40
2c72c048846c082f943e6c7f9fa8d94aee76979f
refs/heads/master
2021-01-01T05:10:33.812560
2015-08-24T19:09:22
2015-08-24T19:09:22
56,789,706
3
0
null
null
null
null
UTF-8
C++
false
false
288
cpp
#include <iostream> template<typename ...Arg> auto apply(Arg && ...arg) -> decltype(arg...) { std::cout << __PRETTY_FUNCTION__ << std::endl; return arg; } template<typename ...Args> void foo(Args && ...args) { apply<Args>(args)... ; } int main() { foo(1, false, 'c'); }
[ "francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df" ]
francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df
ab5fba54eea1701287edc3b122a9ec38883a7cc3
8f0df78da804589a779a8dd5590f41012a5932dc
/src/main.cpp
bf846bfb0183c7ae882e4633d65288779254fb14
[]
no_license
Light-Wizzard/CMlyst
d7fc89ec3c4f64a9cc0821d297b54b43a193be2d
c37ea76ab0f6342f27f8e9ac57cb41f3a6624173
refs/heads/master
2023-04-06T13:43:23.113771
2021-04-22T18:14:22
2021-04-22T18:14:22
151,146,914
0
0
null
2018-10-01T19:31:40
2018-10-01T19:31:39
null
UTF-8
C++
false
false
1,523
cpp
/* * Copyright (C) 2021 Daniel Nicoletti <dantti12@gmail.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <QCoreApplication> #include <Cutelyst/WSGI/wsgi.h> #include "cmlyst.h" int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName(QStringLiteral("Cutelyst")); QCoreApplication::setOrganizationDomain(QStringLiteral("cutelyst.org")); QCoreApplication::setApplicationName(QStringLiteral("cutelyst-wsgi")); QCoreApplication::setApplicationVersion(QStringLiteral("1.0.0")); CWSGI::WSGI server; server.setStaticMap({ QStringLiteral("/static=root/static") }); server.setChdir2(QStringLiteral(CMLYST_ROOT)); QCoreApplication app(argc, argv); server.parseCommandLine(app.arguments()); return server.exec(new CMlyst{}); }
[ "dantti12@gmail.com" ]
dantti12@gmail.com
1ebd9d4c4ecf8c34c2f2b2b495b63e1ee48af8ad
4aae2df13bfd53a8b16aa5f941f2cc8b8ac144b7
/aten/src/ATen/native/mkldnn/MKLDNNCommon.cpp
02ab6961d04c49f960fbca52c9cfd777a5cf69d4
[ "BSD-2-Clause", "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "BSL-1.0", "Apache-2.0" ]
permissive
computerguy2030/pytorch-rocm-amd
e9f2718c470b505325d396baf6513e71bcf0a7ca
38da53d721fcb335dedb1b52f14fd89718e90bef
refs/heads/master
2023-04-08T00:55:01.542663
2021-04-16T11:33:39
2021-04-16T11:33:39
334,288,140
3
0
NOASSERTION
2021-04-16T11:27:55
2021-01-29T23:40:06
C++
UTF-8
C++
false
false
4,053
cpp
#include <ATen/native/mkldnn/MKLDNNCommon.h> #include <ATen/OpaqueTensorImpl.h> #include <c10/core/Allocator.h> #if AT_MKLDNN_ENABLED() #include <ideep.hpp> namespace at { namespace native { /** * `IntrusivePtrTargetWrapper` wraps a custom storage handle of a tensor * (as template param) and inherits `c10::intrusive_ptr_target` so that it * can be used with `c10::intrusive_ptr`. * * It currently only supports wrapping the custom handle by: * - Constructing with an existing custom handle by copy/move constructor. * * See `OpaqueTensorImpl::opaque_handle_`. * * NOTE: if this is generally useful we may want to move this to its own header. */ template <typename T> struct TORCH_API IntrusivePtrTargetWrapper : c10::intrusive_ptr_target { private: T target_; public: IntrusivePtrTargetWrapper() = delete; IntrusivePtrTargetWrapper(const T& target): target_(target) {} IntrusivePtrTargetWrapper(T&& target): target_(std::move(target)) {} T& get_target() { return target_; } }; using IDeepTensorWrapper = IntrusivePtrTargetWrapper<ideep::tensor>; using IDeepTensorWrapperPtr = c10::intrusive_ptr<IDeepTensorWrapper>; using MKLDNNTensorImpl = OpaqueTensorImpl<IDeepTensorWrapperPtr>; using MKLDNNTensor = Tensor; ideep::tensor::data_type get_mkldnn_dtype(ScalarType type) { switch (type) { case ScalarType::Float: return ideep::tensor::data_type::f32; case ScalarType::QInt32: return ideep::tensor::data_type::s32; case ScalarType::QInt8: return ideep::tensor::data_type::s8; case ScalarType::QUInt8: case ScalarType::Byte: return ideep::tensor::data_type::u8; case ScalarType::BFloat16: return ideep::tensor::data_type::bf16; default: TORCH_CHECK(false, "get_mkldnn_dtype: unsupported data type"); } } Tensor new_with_itensor_mkldnn(ideep::tensor&& it, c10::optional<ScalarType> dtype, c10::optional<Device> device) { // NOTE: int32_t dims from ideep::tensor but sizes needs int64_t // TODO: support int64_t dims in ideep::tensor to avoid extra conversion auto dims = it.get_dims(); IDeepTensorWrapperPtr handle = c10::make_intrusive<IDeepTensorWrapper>(std::move(it)); caffe2::TypeMeta dtype_ = scalarTypeToTypeMeta(dtype_or_default(dtype)); Device device_ = device_or_default(device); return detail::make_tensor<MKLDNNTensorImpl>( DispatchKeySet(DispatchKey::MkldnnCPU), dtype_, device_, handle, std::vector<int64_t>(dims.begin(), dims.end())); } ideep::tensor& itensor_from_mkldnn(const MKLDNNTensor& mkldnn_tensor) { TORCH_CHECK(mkldnn_tensor.is_mkldnn(), "itensor_from_mkldnn expects MKL-DNN tensor input"); TORCH_INTERNAL_ASSERT(at::impl::variable_excluded_from_dispatch()); MKLDNNTensorImpl *mklimpl = static_cast<MKLDNNTensorImpl *>(mkldnn_tensor.unsafeGetTensorImpl()); return mklimpl->unsafe_opaque_handle()->get_target(); } ideep::tensor itensor_view_from_dense(const Tensor& tensor) { TORCH_CHECK( tensor.device().is_cpu(), "itensor_view_from_dense expects CPU tensor input"); TORCH_CHECK( tensor.layout() == Layout::Strided, "itensor_view_from_dense expects dense tensor input"); TORCH_CHECK(tensor.scalar_type() == ScalarType::Float, "itensor_view_from_dense expects float tensor input"); TORCH_INTERNAL_ASSERT(at::impl::variable_excluded_from_dispatch()); return {{{tensor.sizes().cbegin(), tensor.sizes().cend()}, ideep::tensor::data_type::f32}, tensor.template data_ptr<float>()}; } // Helper function for getting an ideep tensor out of an aten Tensor. // Note in case the aten Tensor is a dense tensor, the returned ideep // tensor is just a view of the storage of the aten dense tensor, so // caller needs to make sure the aten dense tensor's lifetime is // longer than the ideep tensor. ideep::tensor itensor_from_tensor(const Tensor& tensor) { if (tensor.is_mkldnn()) { return itensor_from_mkldnn(tensor); } else { return itensor_view_from_dense(tensor); } } }} #endif // AT_MKLDNN_ENABLED()
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
bf6fb23e992eef1f5acce44fe9a90be5e1704040
9c6f5fbb43a00fdd4838d78b4299cdf2c34e279b
/tdt/cvs/driver/player2_191/player/codec/codec_mme_video_theora.cpp
71b75b2445aa7425ecc7bca6a68768bccc0352ab
[]
no_license
TitanNit/tdt
90ac830771170abc96255457ef59780687ff0a47
22a09713b68c881fd1d4e4f6247b314cd52f4d7a
refs/heads/master
2021-01-17T09:50:39.729337
2016-05-06T13:26:53
2016-05-06T13:26:53
34,450,580
2
2
null
null
null
null
UTF-8
C++
false
false
34,988
cpp
/************************************************************************ Copyright (C) 2007 STMicroelectronics. All Rights Reserved. This file is part of the Player2 Library. Player2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. Player2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with player2; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The Player2 Library may alternatively be licensed under a proprietary license from ST. Source file name : codec_mme_video_theora.cpp Author : Julian Implementation of the Ogg Theora video codec class for player 2. Date Modification Name ---- ------------ -------- 10-Mar-08 Created Julian ************************************************************************/ // ///////////////////////////////////////////////////////////////////// // // Include any component headers #include "theora.h" #include "codec_mme_video_theora.h" #include "allocinline.h" // ///////////////////////////////////////////////////////////////////////// // // Locally defined constants // //{{{ Locally defined structures typedef struct TheoraCodecStreamParameterContext_s { CodecBaseStreamParameterContext_t BaseContext; } TheoraCodecStreamParameterContext_t; typedef struct TheoraCodecDecodeContext_s { CodecBaseDecodeContext_t BaseContext; THEORA_TransformParam_t DecodeParameters; THEORA_ReturnParams_t DecodeStatus; } TheoraCodecDecodeContext_t; #define BUFFER_THEORA_CODEC_STREAM_PARAMETER_CONTEXT "TheoraCodecStreamParameterContext" #define BUFFER_THEORA_CODEC_STREAM_PARAMETER_CONTEXT_TYPE {BUFFER_THEORA_CODEC_STREAM_PARAMETER_CONTEXT, BufferDataTypeBase, AllocateFromOSMemory, 32, 0, true, true, sizeof(TheoraCodecStreamParameterContext_t)} static BufferDataDescriptor_t TheoraCodecStreamParameterContextDescriptor = BUFFER_THEORA_CODEC_STREAM_PARAMETER_CONTEXT_TYPE; #define BUFFER_THEORA_CODEC_DECODE_CONTEXT "TheoraCodecDecodeContext" #define BUFFER_THEORA_CODEC_DECODE_CONTEXT_TYPE {BUFFER_THEORA_CODEC_DECODE_CONTEXT, BufferDataTypeBase, AllocateFromOSMemory, 32, 0, true, true, sizeof(TheoraCodecDecodeContext_t)} static BufferDataDescriptor_t TheoraCodecDecodeContextDescriptor = BUFFER_THEORA_CODEC_DECODE_CONTEXT_TYPE; //}}} //{{{ C Callback stub // ////////////////////////////////////////////////////////////////////////////////////////////////// // // C wrapper for the MME callback // typedef void (*MME_GenericCallback_t) (MME_Event_t Event, MME_Command_t * CallbackData, void *UserData); static void MMECallbackStub( MME_Event_t Event, MME_Command_t *CallbackData, void *UserData ) { Codec_MmeBase_c *Self = (Codec_MmeBase_c *)UserData; CODEC_DEBUG("%s\n",__FUNCTION__); Self->CallbackFromMME( Event, CallbackData ); return; } //}}} //{{{ Constructor // ///////////////////////////////////////////////////////////////////////// // // Cosntructor function, fills in the codec specific parameter values // Codec_MmeVideoTheora_c::Codec_MmeVideoTheora_c( void ) { Configuration.CodecName = "Theora video"; Configuration.DecodeOutputFormat = FormatVideo420_Planar; Configuration.StreamParameterContextCount = 1; Configuration.StreamParameterContextDescriptor = &TheoraCodecStreamParameterContextDescriptor; Configuration.DecodeContextCount = 4; Configuration.DecodeContextDescriptor = &TheoraCodecDecodeContextDescriptor; Configuration.MaxDecodeIndicesPerBuffer = 2; Configuration.SliceDecodePermitted = false; Configuration.DecimatedDecodePermitted = false; Configuration.TransformName[0] = THEORADEC_MME_TRANSFORMER_NAME "0"; Configuration.TransformName[1] = THEORADEC_MME_TRANSFORMER_NAME "1"; Configuration.AvailableTransformers = 2; Configuration.SizeOfTransformCapabilityStructure = 0; Configuration.TransformCapabilityStructurePointer = NULL; // The video firmware violates the MME spec. and passes data buffer addresses // as parametric information. For this reason it requires physical addresses // to be used. //Configuration.AddressingMode = PhysicalAddress; Configuration.AddressingMode = UnCachedAddress; // We do not need the coded data after decode is complete Configuration.ShrinkCodedDataBuffersAfterDecode = true; #if (THEORADEC_MME_VERSION < 20) TheoraInitializationParameters.CodedWidth = THEORA_DEFAULT_PICTURE_WIDTH; TheoraInitializationParameters.CodedHeight = THEORA_DEFAULT_PICTURE_HEIGHT; TheoraInitializationParameters.CodecVersion = THEORA_DEFAULT_CODEC_VERSION; TheoraInitializationParameters.theora_tables = 0; #else CodedWidth = THEORA_DEFAULT_PICTURE_WIDTH; CodedHeight = THEORA_DEFAULT_PICTURE_HEIGHT; InfoHeaderMemoryDevice = NULL; CommentHeaderMemoryDevice = NULL; SetupHeaderMemoryDevice = NULL; BufferMemoryDevice = NULL; #endif RestartTransformer = false; Reset(); } //}}} //{{{ Destructor // ///////////////////////////////////////////////////////////////////////// // // Destructor function, ensures a full halt and reset // are executed for all levels of the class. // Codec_MmeVideoTheora_c::~Codec_MmeVideoTheora_c( void ) { Halt(); Reset(); } //}}} //{{{ Reset // ///////////////////////////////////////////////////////////////////////// // // Reset function for Theora specific members. // // CodecStatus_t Codec_MmeVideoTheora_c::Reset( void ) { if (InfoHeaderMemoryDevice != NULL) { AllocatorClose (InfoHeaderMemoryDevice); InfoHeaderMemoryDevice = NULL; } if (CommentHeaderMemoryDevice != NULL) { AllocatorClose (CommentHeaderMemoryDevice); CommentHeaderMemoryDevice = NULL; } if (SetupHeaderMemoryDevice != NULL) { AllocatorClose (SetupHeaderMemoryDevice); SetupHeaderMemoryDevice = NULL; } if (BufferMemoryDevice != NULL) { AllocatorClose (BufferMemoryDevice); BufferMemoryDevice = NULL; } return Codec_MmeVideo_c::Reset(); } //}}} //{{{ HandleCapabilities // ///////////////////////////////////////////////////////////////////////// // // Function to deal with the returned capabilities // structure for an Theora mme transformer. // CodecStatus_t Codec_MmeVideoTheora_c::HandleCapabilities( void ) { CODEC_TRACE ("MME Transformer '%s' capabilities are :-\n", THEORADEC_MME_TRANSFORMER_NAME); CODEC_TRACE(" display_buffer_size %d\n", TheoraTransformCapability.display_buffer_size); CODEC_TRACE(" packed_buffer_size %d\n", TheoraTransformCapability.packed_buffer_size); CODEC_TRACE(" packed_buffer_total %d\n", TheoraTransformCapability.packed_buffer_total); return CodecNoError; } //}}} //{{{ InitializeMMETransformer /////////////////////////////////////////////////////////////////////////// /// /// Verify that the transformer exists /// CodecStatus_t Codec_MmeVideoTheora_c::InitializeMMETransformer( void ) { MME_ERROR MMEStatus; MME_TransformerCapability_t Capability; memset( &Capability, 0, sizeof(MME_TransformerCapability_t) ); memset( Configuration.TransformCapabilityStructurePointer, 0x00, Configuration.SizeOfTransformCapabilityStructure ); Capability.StructSize = sizeof(MME_TransformerCapability_t); Capability.TransformerInfoSize = Configuration.SizeOfTransformCapabilityStructure; Capability.TransformerInfo_p = Configuration.TransformCapabilityStructurePointer; MMEStatus = MME_GetTransformerCapability( Configuration.TransformName[SelectedTransformer], &Capability ); if (MMEStatus != MME_SUCCESS) { if (MMEStatus == MME_UNKNOWN_TRANSFORMER) CODEC_ERROR("(%s) - Transformer %s not found.\n", Configuration.CodecName, Configuration.TransformName[SelectedTransformer]); else CODEC_ERROR("(%s:%s) - Unable to read capabilities (%08x).\n", Configuration.CodecName, Configuration.TransformName[SelectedTransformer], MMEStatus); return CodecError; } return HandleCapabilities (); } //}}} //{{{ FillOutTransformerInitializationParameters // ///////////////////////////////////////////////////////////////////////// // // Function to deal with the returned capabilities // structure for an Theora mme transformer. // CodecStatus_t Codec_MmeVideoTheora_c::FillOutTransformerInitializationParameters( void ) { // The command parameters CODEC_TRACE ("%s\n", __FUNCTION__); CODEC_TRACE(" CodedWidth %6u\n", CodedWidth); CODEC_TRACE(" CodedHeight %6u\n", CodedHeight); #if (THEORADEC_MME_VERSION < 20) CODEC_TRACE(" CodecVersion %6x\n", TheoraInitializationParameters.CodecVersion); #endif // Fillout the actual command MMEInitializationParameters.TransformerInitParamsSize = sizeof(THEORA_InitTransformerParam_t); MMEInitializationParameters.TransformerInitParams_p = (MME_GenericParams_t)(&TheoraInitializationParameters); return CodecNoError; } //}}} //{{{ SendMMEStreamParameters CodecStatus_t Codec_MmeVideoTheora_c::SendMMEStreamParameters (void) { CodecStatus_t CodecStatus = CodecNoError; unsigned int MMEStatus = MME_SUCCESS; CODEC_TRACE("%s\n", __FUNCTION__); // There are no set stream parameters for Rmv decoder so the transformer is // terminated and restarted when required (i.e. if width or height change). if (RestartTransformer) { TerminateMMETransformer(); memset (&MMEInitializationParameters, 0x00, sizeof(MME_TransformerInitParams_t)); MMEInitializationParameters.Priority = MME_PRIORITY_NORMAL; MMEInitializationParameters.StructSize = sizeof(MME_TransformerInitParams_t); MMEInitializationParameters.Callback = &MMECallbackStub; MMEInitializationParameters.CallbackUserData = this; FillOutTransformerInitializationParameters (); CODEC_TRACE("%s: Initilising Theora transformer %s\n",__FUNCTION__, Configuration.TransformName[SelectedTransformer]); MMEStatus = MME_InitTransformer (Configuration.TransformName[SelectedTransformer], &MMEInitializationParameters, &MMEHandle); if (MMEStatus == MME_SUCCESS) { CodecStatus = CodecNoError; RestartTransformer = false; ParsedFrameParameters->NewStreamParameters = false; MMEInitialized = true; } } // // The base class has very helpfully acquired a stream // parameters context for us which we must release. // But only if everything went well, otherwise the callers // will helpfully release it as well (Nick). // if (CodecStatus == CodecNoError) StreamParameterContextBuffer->DecrementReferenceCount (); // return CodecStatus; } //}}} //{{{ FillOutSetStreamParametersCommand // ///////////////////////////////////////////////////////////////////////// // // Function to fill out the stream parameters // structure for an Theora mme transformer. // CodecStatus_t Codec_MmeVideoTheora_c::FillOutSetStreamParametersCommand( void ) { TheoraStreamParameters_t* Parsed = (TheoraStreamParameters_t*)ParsedFrameParameters->StreamParameterStructure; TheoraVideoSequence_t* SequenceHeader = &Parsed->SequenceHeader; CODEC_DEBUG("%s\n", __FUNCTION__); #if (THEORADEC_MME_VERSION < 20) CodedWidth = SequenceHeader->DecodedWidth; CodedHeight = SequenceHeader->DecodedHeight; TheoraInitializationParameters.CodedWidth = SequenceHeader->DecodedWidth; TheoraInitializationParameters.CodedHeight = SequenceHeader->DecodedHeight; TheoraInitializationParameters.CodecVersion = SequenceHeader->Version; TheoraInitializationParameters.theora_tables = 1; memcpy (TheoraInitializationParameters.filter_limit_values, SequenceHeader->LoopFilterLimit, sizeof(TheoraInitializationParameters.filter_limit_values)); memcpy (TheoraInitializationParameters.coded_ac_scale_factor, SequenceHeader->AcScale, sizeof(TheoraInitializationParameters.coded_ac_scale_factor)); memcpy (TheoraInitializationParameters.coded_dc_scale_factor, SequenceHeader->DcScale, sizeof(TheoraInitializationParameters.coded_ac_scale_factor)); memcpy (TheoraInitializationParameters.base_matrix, SequenceHeader->BaseMatrix, sizeof(TheoraInitializationParameters.base_matrix)); memcpy (TheoraInitializationParameters.qr_count, SequenceHeader->QRCount, sizeof(TheoraInitializationParameters.qr_count)); memcpy (TheoraInitializationParameters.qr_size, SequenceHeader->QRSize, sizeof(TheoraInitializationParameters.qr_size)); memcpy (TheoraInitializationParameters.qr_base, SequenceHeader->QRBase, sizeof(TheoraInitializationParameters.qr_base)); TheoraInitializationParameters.hti = SequenceHeader->hti; TheoraInitializationParameters.hbits = SequenceHeader->HBits; TheoraInitializationParameters.entries = SequenceHeader->Entries; TheoraInitializationParameters.huff_code_size = SequenceHeader->HuffmanCodeSize; memcpy (TheoraInitializationParameters.huffman_table, SequenceHeader->HuffmanTable, sizeof(TheoraInitializationParameters.huffman_table)); //{{{ Trace #if 0 { int qi, bmi, qti, pli, ci; report (severity_info, "Filter Limit values:\n"); for (qi=0; qi<64; qi++) { report (severity_info, "%02x ", TheoraInitializationParameters.filter_limit_values[qi]); if (((qi+1)&0x1f)== 0) report (severity_info, "\n"); } report (severity_info, "\nAC Scale:\n"); for (qi=0; qi<64; qi++) { report (severity_info, "%08x ", TheoraInitializationParameters.coded_ac_scale_factor[qi]); if (((qi+1)&0x07)== 0) report (severity_info, "\n"); } report (severity_info, "\nDC Scale:\n"); for (qi=0; qi<64; qi++) { report (severity_info, "%04x ", TheoraInitializationParameters.coded_dc_scale_factor[qi]); if (((qi+1)&0x0f)== 0) report (severity_info, "\n"); } report (severity_info, "\nBm Indexes %d\n", 3); for (bmi=0; bmi<3; bmi++) { report (severity_info, "%d:\n", bmi); for (ci=0; ci<64; ci++) { report (severity_info, "%02x ", TheoraInitializationParameters.base_matrix[bmi][ci]); if (((ci+1)&0x1f)== 0) report (severity_info, "\n"); } } report (severity_info, "\nQR Counts\n"); for (qti=0; qti<=1; qti++) { report (severity_info, "%d:\n", qti); for (pli=0; pli<=2; pli++) report (severity_info, "%02x ", TheoraInitializationParameters.qr_count[qti][pli]); } if (((ci+1)&0x1f)== 0) report (severity_info, "\n"); { } report (severity_info, "\nQR Size\n"); for (qti=0; qti<=1; qti++) { for (pli=0; pli<=2; pli++) { report (severity_info, "%d:%d:\n", qti, pli); for (qi=0; qi<64; qi++) { report (severity_info, "%02x ", TheoraInitializationParameters.qr_size[qti][pli][qi]); if (((qi+1)&0x1f)== 0) report (severity_info, "\n"); } } } report (severity_info, "\nQR Base\n"); for (qti=0; qti<=1; qti++) { for (pli=0; pli<=2; pli++) { report (severity_info, "%d:%d:\n", qti, pli); for (qi=0; qi<64; qi++) { report (severity_info, "%04x ", TheoraInitializationParameters.qr_base[qti][pli][qi]); if (((qi+1)&0x0f)== 0) report (severity_info, "\n"); } } } report (severity_info, "\nHuffman table hti %d, hbits %d, entries %d, huffman_code_size %d\n", TheoraInitializationParameters.hti, TheoraInitializationParameters.hbits, TheoraInitializationParameters.entries, TheoraInitializationParameters.huff_code_size); for (qti=0; qti<80; qti++) { report (severity_info, "%d:\n", qti); for (pli=0; pli<32; pli++) { report (severity_info, "(%04x %04x)", TheoraInitializationParameters.huffman_table[qti][pli][0],TheoraInitializationParameters.huffman_table[qti][pli][1]); if (((pli+1)&0x07)== 0) report (severity_info, "\n"); } report (severity_info, "\n"); } } #endif //}}} #else { allocator_status_t AStatus; CodedWidth = SequenceHeader->DecodedWidth; CodedHeight = SequenceHeader->DecodedHeight; if (SequenceHeader->PixelFormat == THEORA_PIXEL_FORMAT_422) { CODEC_TRACE("Switching to 422 planar format\n"); Configuration.DecodeOutputFormat = FormatVideo422_Planar; } else Configuration.DecodeOutputFormat = FormatVideo420_Planar; // Default to 420 for now if (InfoHeaderMemoryDevice != NULL) { AllocatorClose (InfoHeaderMemoryDevice); InfoHeaderMemoryDevice = NULL; } if (CommentHeaderMemoryDevice != NULL) { AllocatorClose (CommentHeaderMemoryDevice); CommentHeaderMemoryDevice = NULL; } if (SetupHeaderMemoryDevice != NULL) { AllocatorClose (SetupHeaderMemoryDevice); SetupHeaderMemoryDevice = NULL; } if (BufferMemoryDevice != NULL) { AllocatorClose (BufferMemoryDevice); BufferMemoryDevice = NULL; } CODEC_TRACE("Allocating %d bytes for info header:\n", SequenceHeader->InfoHeaderSize); AStatus = LmiAllocatorOpen (&InfoHeaderMemoryDevice, SequenceHeader->InfoHeaderSize, true); if( AStatus != allocator_ok ) { CODEC_ERROR ("Failed to allocate info header memory\n" ); return CodecError; } CODEC_TRACE("Allocating %d bytes for comment header\n", SequenceHeader->CommentHeaderSize); AStatus = LmiAllocatorOpen (&CommentHeaderMemoryDevice, SequenceHeader->CommentHeaderSize, true); if( AStatus != allocator_ok ) { CODEC_ERROR ("Failed to allocate comment header memory\n" ); return CodecError; } CODEC_TRACE("Allocating %d bytes for setup header\n", SequenceHeader->SetupHeaderSize); AStatus = LmiAllocatorOpen (&SetupHeaderMemoryDevice, SequenceHeader->SetupHeaderSize, true); if( AStatus != allocator_ok ) { CODEC_ERROR ("Failed to allocate setup header memory\n" ); return CodecError; } TheoraInitializationParameters.InfoHeader.Data = (U32)AllocatorPhysicalAddress (InfoHeaderMemoryDevice); TheoraInitializationParameters.InfoHeader.Size = SequenceHeader->InfoHeaderSize;; memcpy (AllocatorUncachedUserAddress (InfoHeaderMemoryDevice), SequenceHeader->InfoHeaderBuffer, SequenceHeader->InfoHeaderSize); TheoraInitializationParameters.CommentHeader.Data = (U32)AllocatorPhysicalAddress (CommentHeaderMemoryDevice); TheoraInitializationParameters.CommentHeader.Size = SequenceHeader->CommentHeaderSize;; memcpy (AllocatorUncachedUserAddress (CommentHeaderMemoryDevice), SequenceHeader->CommentHeaderBuffer, SequenceHeader->CommentHeaderSize); TheoraInitializationParameters.SetUpHeader.Data = (U32)AllocatorPhysicalAddress (SetupHeaderMemoryDevice); TheoraInitializationParameters.SetUpHeader.Size = SequenceHeader->SetupHeaderSize;; memcpy (AllocatorUncachedUserAddress (SetupHeaderMemoryDevice), SequenceHeader->SetupHeaderBuffer, SequenceHeader->SetupHeaderSize); #if (THEORADEC_MME_VERSION >= 30) { unsigned int yhfrags = CodedWidth >> 3; unsigned int yvfrags = CodedHeight >> 3; unsigned int hdec = !(SequenceHeader->PixelFormat & 1); unsigned int vdec = !(SequenceHeader->PixelFormat & 2); unsigned int chfrags = (yhfrags + hdec) >> hdec; unsigned int cvfrags = (yvfrags + vdec) >> vdec; unsigned int yfrags = yhfrags * yvfrags; unsigned int cfrags = chfrags * cvfrags; unsigned int num_8x8_blocks = yfrags + (2 * cfrags); unsigned int CoefficientBufferSize = (64 * 3 * num_8x8_blocks) + 512; CODEC_TRACE("Allocating %d bytes for buffer memory\n", CoefficientBufferSize); AStatus = LmiAllocatorOpen (&BufferMemoryDevice, CoefficientBufferSize, true); if (AStatus != allocator_ok) { CODEC_ERROR ("Failed to allocate buffer memory\n" ); return CodecError; } TheoraInitializationParameters.CoefficientBuffer = (U32)AllocatorPhysicalAddress (BufferMemoryDevice); } #else CODEC_TRACE("Allocating %d bytes for buffer memory\n", THEORA_BUFFER_SIZE); AStatus = LmiAllocatorOpen (&BufferMemoryDevice, THEORA_BUFFER_SIZE, true); if( AStatus != allocator_ok ) { CODEC_ERROR ("Failed to allocate buffer memory\n" ); return CodecError; } TheoraInitializationParameters.Buffer.Data = (U32)AllocatorPhysicalAddress (BufferMemoryDevice); TheoraInitializationParameters.Buffer.Size = THEORA_BUFFER_SIZE; #endif #if 0 unsigned char* Buff; Buff = (unsigned char*)AllocatorUncachedUserAddress (InfoHeaderMemoryDevice); for (int i=0;i<32; i++) report (severity_info, "%02x ", Buff[i]); report (severity_info, "\n"); Buff = (unsigned char*)AllocatorUncachedUserAddress (CommentHeaderMemoryDevice); for (int i=0;i<32; i++) report (severity_info, "%02x ", Buff[i]); report (severity_info, "\n"); Buff = (unsigned char*)AllocatorUncachedUserAddress (SetupHeaderMemoryDevice); for (int i=0;i<32; i++) report (severity_info, "%02x ", Buff[i]); report (severity_info, "\n"); #endif } #endif RestartTransformer = true; return CodecNoError; } //}}} //{{{ FillOutDecodeCommand // ///////////////////////////////////////////////////////////////////////// // // Function to fill out the decode parameters // structure for an Theora mme transformer. // CodecStatus_t Codec_MmeVideoTheora_c::FillOutDecodeCommand( void ) { TheoraCodecDecodeContext_t* Context = (TheoraCodecDecodeContext_t*)DecodeContext; //TheoraFrameParameters_t* Frame = (TheoraFrameParameters_t*)ParsedFrameParameters->FrameParameterStructure; //TheoraVideoSequence_t* SequenceHeader = &Stream->SequenceHeader; THEORA_TransformParam_t* Param; THEORA_ParamPicture_t* Picture; unsigned int i; CODEC_DEBUG("%s:%d (%dx%d)\n", __FUNCTION__, CodedDataLength, CodedWidth, CodedHeight); // // For Theora we do not do slice decodes. // KnownLastSliceInFieldFrame = true; // // Fillout the straight forward command parameters // Param = &Context->DecodeParameters; Picture = &Param->PictureParameters; Picture->StructSize = sizeof (THEORA_ParamPicture_t); Picture->PictureStartOffset = 0; // Picture starts at beginning of buffer Picture->PictureStopOffset = CodedDataLength; // // Fillout the actual command // memset (&DecodeContext->MMECommand, 0x00, sizeof(MME_Command_t)); DecodeContext->MMECommand.CmdStatus.AdditionalInfoSize = sizeof(THEORA_ReturnParams_t); DecodeContext->MMECommand.CmdStatus.AdditionalInfo_p = (MME_GenericParams_t*)&Context->DecodeStatus; DecodeContext->MMECommand.StructSize = sizeof (MME_Command_t); DecodeContext->MMECommand.CmdCode = MME_TRANSFORM; DecodeContext->MMECommand.CmdEnd = MME_COMMAND_END_RETURN_NOTIFY; DecodeContext->MMECommand.DueTime = (MME_Time_t)0; DecodeContext->MMECommand.NumberInputBuffers = THEORA_NUM_MME_INPUT_BUFFERS; DecodeContext->MMECommand.NumberOutputBuffers = THEORA_NUM_MME_OUTPUT_BUFFERS; DecodeContext->MMECommand.DataBuffers_p = (MME_DataBuffer_t**)DecodeContext->MMEBufferList; DecodeContext->MMECommand.ParamSize = sizeof(THEORA_TransformParam_t); DecodeContext->MMECommand.Param_p = (MME_GenericParams_t)Param; //{{{ Fill in details for all buffers for (i = 0; i < THEORA_NUM_MME_BUFFERS; i++) { DecodeContext->MMEBufferList[i] = &DecodeContext->MMEBuffers[i]; DecodeContext->MMEBuffers[i].StructSize = sizeof (MME_DataBuffer_t); DecodeContext->MMEBuffers[i].UserData_p = NULL; DecodeContext->MMEBuffers[i].Flags = 0; DecodeContext->MMEBuffers[i].StreamNumber = 0; DecodeContext->MMEBuffers[i].NumberOfScatterPages = 1; DecodeContext->MMEBuffers[i].ScatterPages_p = &DecodeContext->MMEPages[i]; DecodeContext->MMEBuffers[i].StartOffset = 0; } //}}} // Then overwrite bits specific to other buffers //{{{ Input compressed data buffer - need pointer to coded data and its length DecodeContext->MMEBuffers[THEORA_MME_CODED_DATA_BUFFER].ScatterPages_p[0].Page_p = (void*)CodedData; DecodeContext->MMEBuffers[THEORA_MME_CODED_DATA_BUFFER].TotalSize = CodedDataLength; #if 0 report (severity_info, "Picture (%d)\n", CodedDataLength); extern "C"{void flush_cache_all();}; flush_cache_all(); for (i=0; i<32; i++) report (severity_info, "%02x ", CodedData[i]); report (severity_info, "\n"); #endif //}}} //{{{ Current output decoded buffer DecodeContext->MMEBuffers[THEORA_MME_CURRENT_FRAME_BUFFER].ScatterPages_p[0].Page_p = (void*)(void*)BufferState[CurrentDecodeBufferIndex].BufferLumaPointer; DecodeContext->MMEBuffers[THEORA_MME_CURRENT_FRAME_BUFFER].TotalSize = (CodedWidth * CodedHeight * 3)/2; //}}} //{{{ Previous decoded buffer - get its planar buffer if (DecodeContext->ReferenceFrameList[0].EntryCount > 0) { unsigned int Entry = DecodeContext->ReferenceFrameList[0].EntryIndicies[0]; DecodeContext->MMEBuffers[THEORA_MME_REFERENCE_FRAME_BUFFER].ScatterPages_p[0].Page_p = (void*)(void*)BufferState[Entry].BufferLumaPointer; DecodeContext->MMEBuffers[THEORA_MME_REFERENCE_FRAME_BUFFER].TotalSize = (CodedWidth * CodedHeight * 3)/2; } //}}} //{{{ Golden frame decoded buffer - get its planar buffer if (DecodeContext->ReferenceFrameList[0].EntryCount == 2) { unsigned int Entry = DecodeContext->ReferenceFrameList[0].EntryIndicies[1]; DecodeContext->MMEBuffers[THEORA_MME_GOLDEN_FRAME_BUFFER].ScatterPages_p[0].Page_p = (void*)(void*)BufferState[Entry].BufferLumaPointer; DecodeContext->MMEBuffers[THEORA_MME_GOLDEN_FRAME_BUFFER].TotalSize = (CodedWidth * CodedHeight * 3)/2; } //}}} //{{{ Initialise remaining scatter page values for (i = 0; i < THEORA_NUM_MME_BUFFERS; i++) { // Only one scatterpage, so size = totalsize DecodeContext->MMEBuffers[i].ScatterPages_p[0].Size = DecodeContext->MMEBuffers[i].TotalSize; DecodeContext->MMEBuffers[i].ScatterPages_p[0].BytesUsed = 0; DecodeContext->MMEBuffers[i].ScatterPages_p[0].FlagsIn = 0; DecodeContext->MMEBuffers[i].ScatterPages_p[0].FlagsOut = 0; } //}}} #if 0 // Initialise decode buffers to bright pink unsigned int LumaSize = (DecodingWidth+32)*(DecodingHeight+32); unsigned char* LumaBuffer = (unsigned char*)DecodeContext->MMEBuffers[THEORA_MME_CURRENT_FRAME_BUFFER].ScatterPages_p[0].Page_p; unsigned char* ChromaBuffer = &LumaBuffer[LumaSize]; memset (LumaBuffer, 0xff, LumaSize); memset (ChromaBuffer, 0xff, LumaSize/2); #endif #if 0 for (i = 0; i < (THEORA_NUM_MME_BUFFERS); i++) { #if 0 CODEC_TRACE ("Buffer List (%d) %x\n",i,DecodeContext->MMEBufferList[i]); CODEC_TRACE ("Struct Size (%d) %x\n",i,DecodeContext->MMEBuffers[i].StructSize); CODEC_TRACE ("User Data p (%d) %x\n",i,DecodeContext->MMEBuffers[i].UserData_p); CODEC_TRACE ("Flags (%d) %x\n",i,DecodeContext->MMEBuffers[i].Flags); CODEC_TRACE ("Stream Number (%d) %x\n",i,DecodeContext->MMEBuffers[i].StreamNumber); CODEC_TRACE ("No Scatter Pages (%d) %x\n",i,DecodeContext->MMEBuffers[i].NumberOfScatterPages); #endif CODEC_TRACE ("Scatter Pages p (%d) %x\n",i,DecodeContext->MMEBuffers[i].ScatterPages_p[0].Page_p); CODEC_TRACE ("Start Offset (%d) %d\n",i,DecodeContext->MMEBuffers[i].StartOffset); CODEC_TRACE ("Size (%d) %d\n\n",i,DecodeContext->MMEBuffers[i].ScatterPages_p[0].Size); } CODEC_TRACE ("Additional Size %x\n",DecodeContext->MMECommand.CmdStatus.AdditionalInfoSize); CODEC_TRACE ("Additional p %x\n",DecodeContext->MMECommand.CmdStatus.AdditionalInfo_p); CODEC_TRACE ("Param Size %x\n",DecodeContext->MMECommand.ParamSize); CODEC_TRACE ("Param p %x\n",DecodeContext->MMECommand.Param_p); #endif return CodecNoError; } //}}} //{{{ FillOutDecodeBufferRequest // ///////////////////////////////////////////////////////////////////////// // // The specific video function used to fill out a buffer structure // request. // CodecStatus_t Codec_MmeVideoTheora_c::FillOutDecodeBufferRequest( BufferStructure_t *Request ) { CODEC_DEBUG("%s\n", __FUNCTION__); //Request->Format = Configuration.DecodeOutputFormat; Codec_MmeVideo_c::FillOutDecodeBufferRequest(Request); Request->ComponentBorder[0] = 16; Request->ComponentBorder[1] = 16; return CodecNoError; } //}}} //{{{ ValidateDecodeContext //////////////////////////////////////////////////////////////////////////// /// /// Unconditionally return success. /// /// Success and failure codes are located entirely in the generic MME structures /// allowing the super-class to determine whether the decode was successful. This /// means that we have no work to do here. /// /// \return CodecNoError /// CodecStatus_t Codec_MmeVideoTheora_c::ValidateDecodeContext( CodecBaseDecodeContext_t *Context ) { CODEC_DEBUG("%s\n", __FUNCTION__); return CodecNoError; } //}}} //{{{ DumpSetStreamParameters // ///////////////////////////////////////////////////////////////////////// // // Function to dump out the set stream // parameters from an mme command. // CodecStatus_t Codec_MmeVideoTheora_c::DumpSetStreamParameters( void *Parameters ) { CODEC_TRACE ("%s\n", __FUNCTION__); return CodecNoError; } //}}} //{{{ DumpDecodeParameters // ///////////////////////////////////////////////////////////////////////// // // Function to dump out the decode // parameters from an mme command. // unsigned int TheoraStaticPicture; CodecStatus_t Codec_MmeVideoTheora_c::DumpDecodeParameters( void *Parameters ) { THEORA_TransformParam_t* FrameParams; FrameParams = (THEORA_TransformParam_t *)Parameters; CODEC_TRACE ("********** Picture %d *********\n", TheoraStaticPicture++); return CodecNoError; } //}}}
[ "konfetti@gmx.net" ]
konfetti@gmx.net
af8d468fca41c2616786ca5cd99cb224d0915107
eec9d5b635e23a789444966a26354d5b59fcc13f
/Millionare/main.cpp
d989965e5b0a9f939c4fd589c109026fcb6a304c
[]
no_license
Mashiro009/Millionare
7564ebe430eedcaf72a6075187af6355c2875b8f
ae64e18b0fb172e6128e14c67c8d46bea62cc0db
refs/heads/master
2021-09-19T23:31:26.080956
2018-08-01T09:26:47
2018-08-01T09:26:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
754
cpp
#include "main.h" char temp; int main() { player playerInGame[5]; //std::cout << initcity[0].name; AboutGame Game(0,0); Game.init(); Game.startGame(); fflush(stdin); for (int i(1); i <= Game.nPlayer; i++) playerInGame[i].number = i; while (1) { for (int i(1); i <= Game.nPlayer; i++) { cout << "Please input enter to continue" << endl; cin >> temp; cout << "Now is the chance of player " << i<< endl; playerInGame[i].show(); cout << "Please input enter to continue"<<endl; cin >> temp; int step; step = Game.randomStep(); cout << "Your step is " << step << endl; playerInGame[i].movePlayer(step, Game.map); playerInGame[i].show(); initcity[playerInGame[i].position].show(); } } return 0; }
[ "Mashiro@example.com" ]
Mashiro@example.com
d0e20b8ff4943efb63ed60bfa0b7b6a6e68c3f8f
789b29015b3365e6271ff9a575494f008b11b80d
/moses/TranslationModel/UG/mm/ug_im_bitext.cc
9f26a181b06a89fa87156910792aa7771fa6d21c
[]
no_license
unhammer/mosesdecoder
0bf59d835c3a3713a787fea78723e62830902705
324b1a9b56471277992dfe729807946c7c7f8689
refs/heads/master
2020-12-11T05:38:13.318619
2015-04-29T19:20:54
2015-04-29T19:20:54
34,814,200
0
0
null
2015-04-29T19:35:48
2015-04-29T19:35:48
null
UTF-8
C++
false
false
2,257
cc
#include "ug_im_bitext.h" namespace Moses { namespace bitext { template<> sptr<imBitext<L2R_Token<SimpleWordId> > > imBitext<L2R_Token<SimpleWordId> >:: add(vector<string> const& s1, vector<string> const& s2, vector<string> const& aln) const { typedef L2R_Token<SimpleWordId> TKN; assert(s1.size() == s2.size() && s1.size() == aln.size()); #ifndef NDEBUG size_t first_new_snt = this->T1 ? this->T1->size() : 0; #endif sptr<imBitext<TKN> > ret; { boost::unique_lock<boost::shared_mutex> guard(m_lock); ret.reset(new imBitext<TKN>(*this)); } // we add the sentences in separate threads (so it's faster) boost::thread thread1(snt_adder<TKN>(s1,*ret->V1,ret->myT1,ret->myI1)); // thread1.join(); // for debugging boost::thread thread2(snt_adder<TKN>(s2,*ret->V2,ret->myT2,ret->myI2)); BOOST_FOREACH(string const& a, aln) { istringstream ibuf(a); ostringstream obuf; uint32_t row,col; char c; while (ibuf >> row >> c >> col) { UTIL_THROW_IF2(c != '-', "[" << HERE << "] " << "Error in alignment information:\n" << a); binwrite(obuf,row); binwrite(obuf,col); } // important: DO NOT replace the two lines below this comment by // char const* x = obuf.str().c_str(), as the memory x is pointing // to is freed immediately upon deconstruction of the string object. string foo = obuf.str(); char const* x = foo.c_str(); vector<char> v(x,x+foo.size()); ret->myTx = append(ret->myTx, v); } thread1.join(); thread2.join(); ret->Tx = ret->myTx; ret->T1 = ret->myT1; ret->T2 = ret->myT2; ret->I1 = ret->myI1; ret->I2 = ret->myI2; #ifndef NDEBUG // sanity check for (size_t i = first_new_snt; i < ret->T1->size(); ++i) { size_t slen1 = ret->T1->sntLen(i); size_t slen2 = ret->T2->sntLen(i); char const* p = ret->Tx->sntStart(i); char const* q = ret->Tx->sntEnd(i); size_t k; while (p < q) { p = binread(p,k); assert(p); assert(p < q); assert(k < slen1); p = binread(p,k); assert(p); assert(k < slen2); } } #endif return ret; } } }
[ "Ulrich.Germann@gmail.com" ]
Ulrich.Germann@gmail.com
90e9f6a90dfb867ad735ad0f73dd7b2d43451e74
e2e8d3c97155003038ea55fcb7f0247438b8aff9
/while.cpp
07dac472aedfe2307bc896ff75586acc6218a757
[]
no_license
Hyuga-Hinata/C-learning
a5f62bdfa585ee815e71ab0c0ce7f34f26faa44d
e91311e3dd5870e7a5ca93f1c27cef2c3af33141
refs/heads/master
2021-05-06T06:01:27.276058
2018-03-31T16:49:49
2018-03-31T16:49:49
115,264,606
0
0
null
null
null
null
UTF-8
C++
false
false
320
cpp
#include<stdio.h> #define ADJUST 7.64 #define SCALE 0.325 int main(void) { double shoe,foot; printf("Shoe size(men's) foot length\n"); shoe=3.0; while(shoe<18.5) { foot=SCALE*shoe+ADJUST; printf("%10.1f %15.2f inches\n",shoe,foot); shoe=shoe+1.0; } printf("If the shoe fits,wear it.\n"); return 0; }
[ "1159902606@qq.com" ]
1159902606@qq.com
c53376d930af24ebf0d24a5e0e7b014c61a1f642
cb796fe6cdd2b58782cd5bbd6b7bd29d4ea6a298
/f1000/doc/fwsdk/IQA_LIB_uBlaze_rev1_5/include/hxx/ADC1_CH7.hxx
5e506eccb3f6b17e8b807df2f68c407c92bca895
[]
no_license
IQAnalog/iqa_external
b0098d5102d8d7b462993fce081544bd2db00e52
13e2c782699f962fb19de9987933cbef66b47ce1
refs/heads/master
2023-03-23T13:46:16.550707
2021-03-24T18:03:22
2021-03-24T18:03:22
350,906,829
0
1
null
null
null
null
UTF-8
C++
false
false
2,818
hxx
//******************************************************************************* // __ __ * // / \/ \ * // \ \ * // I Q - A N A L O G * // \ \ IQ-Analog Corp * // \__/\__/ www.iqanalog.com * // * //------------------------------------------------------------------------------* // * // Copyright (C) 2018-2019 IQ-Analog Corp. All rights reserved. * // * //------------------------------------------------------------------------------* // IQ-Analog CONFIDENTIAL * //------------------------------------------------------------------------------* // * // This file is released with "Government Purpose Rights" as defined * // in DFARS SUBPART 227.71, clause 252.227-7013. * // * //******************************************************************************* // Generated by RMM 3.3 // IQ-Analog Corp. 2013-2018. #ifndef __ADC1_CH7_HXX__ #define __ADC1_CH7_HXX__ #define ADC1_CH7_TDC_LUT00 (REG_ADC1_CH7+0x0) #define ADC1_CH7_TDC_LUT01 (REG_ADC1_CH7+0x4) #define ADC1_CH7_TDC_LUT02 (REG_ADC1_CH7+0x8) #define ADC1_CH7_TDC_LUT03 (REG_ADC1_CH7+0xc) #define ADC1_CH7_TDC_LUT04 (REG_ADC1_CH7+0x10) #define ADC1_CH7_TDC_LUT05 (REG_ADC1_CH7+0x14) #define ADC1_CH7_TDC_LUT06 (REG_ADC1_CH7+0x18) #define ADC1_CH7_TDC_LUT07 (REG_ADC1_CH7+0x1c) #define ADC1_CH7_TDC_LUT08 (REG_ADC1_CH7+0x20) #define ADC1_CH7_TDC_BUS_ACCESS (REG_ADC1_CH7+0x24) #define ADC1_CH7_TDC_OFFSET_AND_GAIN (REG_ADC1_CH7+0x28) #define ADC1_CH7_TDC_TI_CAL (REG_ADC1_CH7+0x2c) #define ADC1_CH7_TDC_MISC (REG_ADC1_CH7+0x30) #define ADC1_CH7_TDC_CAL (REG_ADC1_CH7+0x34) #define ADC1_CH7_TDC_DITHER (REG_ADC1_CH7+0x38) #define ADC1_CH7_TDC_BIT_WEIGHTS0 (REG_ADC1_CH7+0x3c) #define ADC1_CH7_TDC_BIT_WEIGHTS1 (REG_ADC1_CH7+0x40) #define ADC1_CH7_TDC_STATUS (REG_ADC1_CH7+0x44) #endif /* __ADC1_CH7_HXX__ */
[ "rudyl@iqanalog.com" ]
rudyl@iqanalog.com
47e8464e71eae95192ba09f528d3dced96075334
3cf9e141cc8fee9d490224741297d3eca3f5feff
/C++ Benchmark Programs/Benchmark Files 1/classtester/autogen-sources/source-15690.cpp
edf2736bf984c3904762e839b2f1df2d2f62385a
[]
no_license
TeamVault/tauCFI
e0ac60b8106fc1bb9874adc515fc01672b775123
e677d8cc7acd0b1dd0ac0212ff8362fcd4178c10
refs/heads/master
2023-05-30T20:57:13.450360
2021-06-14T09:10:24
2021-06-14T09:10:24
154,563,655
0
1
null
null
null
null
UTF-8
C++
false
false
3,097
cpp
struct c0; void __attribute__ ((noinline)) tester0(c0* p); struct c0 { bool active0; c0() : active0(true) {} virtual ~c0() { tester0(this); active0 = false; } virtual void f0(){} }; void __attribute__ ((noinline)) tester0(c0* p) { p->f0(); } struct c1; void __attribute__ ((noinline)) tester1(c1* p); struct c1 : virtual c0 { bool active1; c1() : active1(true) {} virtual ~c1() { tester1(this); c0 *p0_0 = (c0*)(c1*)(this); tester0(p0_0); active1 = false; } virtual void f1(){} }; void __attribute__ ((noinline)) tester1(c1* p) { p->f1(); if (p->active0) p->f0(); } struct c2; void __attribute__ ((noinline)) tester2(c2* p); struct c2 : virtual c0 { bool active2; c2() : active2(true) {} virtual ~c2() { tester2(this); c0 *p0_0 = (c0*)(c2*)(this); tester0(p0_0); active2 = false; } virtual void f2(){} }; void __attribute__ ((noinline)) tester2(c2* p) { p->f2(); if (p->active0) p->f0(); } struct c3; void __attribute__ ((noinline)) tester3(c3* p); struct c3 : virtual c1, virtual c2, virtual c0 { bool active3; c3() : active3(true) {} virtual ~c3() { tester3(this); c0 *p0_0 = (c0*)(c1*)(c3*)(this); tester0(p0_0); c0 *p0_1 = (c0*)(c2*)(c3*)(this); tester0(p0_1); c0 *p0_2 = (c0*)(c3*)(this); tester0(p0_2); c1 *p1_0 = (c1*)(c3*)(this); tester1(p1_0); c2 *p2_0 = (c2*)(c3*)(this); tester2(p2_0); active3 = false; } virtual void f3(){} }; void __attribute__ ((noinline)) tester3(c3* p) { p->f3(); if (p->active0) p->f0(); if (p->active1) p->f1(); if (p->active2) p->f2(); } struct c4; void __attribute__ ((noinline)) tester4(c4* p); struct c4 : virtual c2, c1, virtual c0 { bool active4; c4() : active4(true) {} virtual ~c4() { tester4(this); c0 *p0_0 = (c0*)(c2*)(c4*)(this); tester0(p0_0); c0 *p0_1 = (c0*)(c1*)(c4*)(this); tester0(p0_1); c0 *p0_2 = (c0*)(c4*)(this); tester0(p0_2); c1 *p1_0 = (c1*)(c4*)(this); tester1(p1_0); c2 *p2_0 = (c2*)(c4*)(this); tester2(p2_0); active4 = false; } virtual void f4(){} }; void __attribute__ ((noinline)) tester4(c4* p) { p->f4(); if (p->active1) p->f1(); if (p->active0) p->f0(); if (p->active2) p->f2(); } int __attribute__ ((noinline)) inc(int v) {return ++v;} int main() { c0* ptrs0[25]; ptrs0[0] = (c0*)(new c0()); ptrs0[1] = (c0*)(c1*)(new c1()); ptrs0[2] = (c0*)(c2*)(new c2()); ptrs0[3] = (c0*)(c1*)(c3*)(new c3()); ptrs0[4] = (c0*)(c2*)(c3*)(new c3()); ptrs0[5] = (c0*)(c3*)(new c3()); ptrs0[6] = (c0*)(c2*)(c4*)(new c4()); ptrs0[7] = (c0*)(c1*)(c4*)(new c4()); ptrs0[8] = (c0*)(c4*)(new c4()); for (int i=0;i<9;i=inc(i)) { tester0(ptrs0[i]); delete ptrs0[i]; } c1* ptrs1[25]; ptrs1[0] = (c1*)(new c1()); ptrs1[1] = (c1*)(c3*)(new c3()); ptrs1[2] = (c1*)(c4*)(new c4()); for (int i=0;i<3;i=inc(i)) { tester1(ptrs1[i]); delete ptrs1[i]; } c2* ptrs2[25]; ptrs2[0] = (c2*)(new c2()); ptrs2[1] = (c2*)(c3*)(new c3()); ptrs2[2] = (c2*)(c4*)(new c4()); for (int i=0;i<3;i=inc(i)) { tester2(ptrs2[i]); delete ptrs2[i]; } c3* ptrs3[25]; ptrs3[0] = (c3*)(new c3()); for (int i=0;i<1;i=inc(i)) { tester3(ptrs3[i]); delete ptrs3[i]; } c4* ptrs4[25]; ptrs4[0] = (c4*)(new c4()); for (int i=0;i<1;i=inc(i)) { tester4(ptrs4[i]); delete ptrs4[i]; } return 0; }
[ "ga72foq@mytum.de" ]
ga72foq@mytum.de
b0a8c939ac1c433d4a4f5a9f6f3701517639977e
d1c2914c06998310e29453a8d68f36caaaf63ffa
/1078.cpp
e6043b43e4ca2e7023e8a7bb0f0fc2240ed96430
[]
no_license
LucasLaheras/URI
b717ef374d1e47dce3e76396ec7cfb90c2a2de5e
a971bb09c5f3650c706fc2d0ab123f9fe766a73c
refs/heads/master
2021-09-08T02:31:05.231438
2018-03-06T03:01:46
2018-03-06T03:01:46
null
0
0
null
null
null
null
UTF-8
C++
false
false
227
cpp
#include <stdio.h> #include <stdlib.h> int main(void) { int X, S, i; scanf("%d", &X); for (i=1; i<=10; i++) { S=X*i; printf("%d x %d = %d\n", i, X, S); } system ("pause"); return 0; }
[ "noreply@github.com" ]
LucasLaheras.noreply@github.com
182ed3b860e5c64173b1f4a077479e968aaa95d7
07c6a6592480ef3b0b52abac9b5048d0f16f7853
/Aphelion/src/Aphelion/Physics/PhysicsShape.cpp
b7ca7513a0715ee6a3f1ce0ec6e1e79542d3084a
[ "MIT" ]
permissive
antjowie/Aphelion-engine
7748b004682a1ea6e4334d90c9df090d274a3f2a
e26287d240db37f3e6df289dec760b1e4404135b
refs/heads/master
2023-05-05T15:06:17.154712
2021-05-21T15:58:57
2021-05-21T15:58:57
210,442,434
0
0
null
null
null
null
UTF-8
C++
false
false
1,698
cpp
#include "Aphelion/Physics/PhysicsShape.h" #include "Aphelion/Physics/RigidBody.h" #include "Aphelion/Physics/PhysicsGLM.h" namespace ap { PhysicsShape::PhysicsShape(PhysicsGeometry& geometry, PhysicsMaterial& material, const glm::mat4& offset) : m_handle(PxGetPhysics().createShape(geometry.GetHandle().any(), *material.GetHandle())) , m_creator(true) { } PhysicsShape::PhysicsShape(physx::PxShape* shape) : m_handle(shape) , m_creator(false) { } PhysicsShape::PhysicsShape() : m_handle(nullptr) , m_creator(false) { } PhysicsShape::~PhysicsShape() { if (m_creator) m_handle->release(); } void PhysicsShape::SetLocalTransform(const glm::mat4& transform) { m_handle->setLocalPose(physx::PxTransform(ap::MakeMat4(transform))); } glm::mat4 PhysicsShape::GetLocalTransform() const { return ap::MakeMat4(m_handle->getLocalPose()); } PhysicsGeometry PhysicsShape::GetGeometry() const { return m_handle->getGeometry(); } PhysicsMaterial PhysicsShape::GetMaterial() const { bool hasLogged = false; if (!hasLogged) { hasLogged = true; AP_CORE_WARN("PhysicsMaterial::GetMaterial only returns the first material... silencing message"); } physx::PxMaterial* material = nullptr; m_handle->getMaterials(&material, 1, 0); return PhysicsMaterial(material); } RigidBody PhysicsShape::GetRigidBody() const { return m_handle->getActor(); } physx::PxShape* PhysicsShape::GetHandle() { return m_handle; } }
[ "7332321+antjowie@users.noreply.github.com" ]
7332321+antjowie@users.noreply.github.com
d8f123fdebab9894a12c198f0117b88a9c015567
b90286114890d14038bb63e100e29cdba2e87440
/Honeycomb GE/src/render/RenderingEngine.cpp
d379bde4601d532343a0b2e9b7c747a51d47539f
[ "MIT" ]
permissive
00mjk/Honeycomb-Game-Engine
21fa3e869a1c66d7355007605e2db5b0679883ce
0ccfcf9bc57d63e948325ac89ad0de0497206f94
refs/heads/master
2021-07-15T08:09:20.360152
2017-10-19T18:39:09
2017-10-19T18:39:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
926
cpp
#include "../../include/render/RenderingEngine.h" #include "../../include/render/deferred/DeferredRenderer.h" using Honeycomb::Scene::GameScene; using Honeycomb::Render::Deferred::DeferredRenderer; namespace Honeycomb { namespace Render { RenderingEngine *RenderingEngine::renderingEngine = nullptr; RenderingEngine* RenderingEngine::getRenderingEngine() { if (renderingEngine == nullptr) renderingEngine = new RenderingEngine(); return renderingEngine; } void RenderingEngine::render(GameScene &scene) { this->renderer->render(scene); } void RenderingEngine::setRenderingType(const RenderingType &type) { switch (type) { case RenderingType::TYPE_DEFERRED_RENDERER: this->renderer = DeferredRenderer::getDeferredRenderer(); break; } } RenderingEngine::RenderingEngine() { this->setRenderingType(RenderingType::TYPE_DEFERRED_RENDERER); } RenderingEngine::~RenderingEngine() { } } }
[ "antverdovsky@gmail.com" ]
antverdovsky@gmail.com
7a88e0115d4bfffc323e392cd110ecfb1eb6a106
d9142bdff80cad8a1bf5a138f55c442a04e2674d
/TS_6.cpp
e989be66e91cba8696dbe7e3f45345d4bd1ced1b
[]
no_license
epicurean21/Algorithm
280a84d5f73db7787eb2589a3a37901983496691
d5fa2f0318d45bdd17c5ccda9e72468b4711100c
refs/heads/master
2023-07-22T05:30:47.982546
2023-07-09T06:22:09
2023-07-09T06:22:09
199,615,976
3
0
null
null
null
null
UTF-8
C++
false
false
644
cpp
#include <string> #include <vector> #include <iostream> using namespace std; long long solution(int numOfStairs) { long long answer = 0; long long dp[71]; dp[1] = 1; dp[2] = 2; dp[3] = 4; for (int i = 4; i <= numOfStairs; i++) { dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]; } answer = dp[numOfStairs]; return answer; } int main() { ios::sync_with_stdio(false); cin.tie(NULL); int N; long long dp[71]; dp[1] = 1; dp[2] = 2; dp[3] = 4; for (int i = 4; i <= 70; i++) { dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]; } cout << dp[70] << '\n'; return 0; }
[ "jm_company@naver.com" ]
jm_company@naver.com
aee54517fcacdc7c713caafc9af6e22306631809
dbdf80f064535005072598f8b0a8208243e2c61e
/Proyecto 1/.ngrest/local/build/pruebas/codegen/pruebasWrapper.h
979667c0a54beb9a77303393ab6a3ab39d03ea88
[]
no_license
erflod5/EDD
76554a680bf2a5131e04a4d741a1975fefb6f311
53141d9160f76a1b6fea51c12800ae6d6eaf441e
refs/heads/master
2021-10-20T09:11:02.947069
2019-02-27T04:12:29
2019-02-27T04:12:29
170,441,816
0
0
null
null
null
null
UTF-8
C++
false
false
776
h
// This file generated by ngrestcg // For more information, please visit: https://github.com/loentar/ngrest // DO NOT EDIT. ANY CHANGES WILL BE LOST #ifndef PRUEBASWRAPPER_H #define PRUEBASWRAPPER_H #include <string> #include <ngrest/engine/ServiceWrapper.h> #include "pruebas.h" class pruebas; //! pruebas service wrapper class pruebasWrapper: public ::ngrest::ServiceWrapper { public: pruebasWrapper(); virtual ~pruebasWrapper(); virtual ::ngrest::Service* getServiceImpl() override; virtual void invoke(const ::ngrest::OperationDescription* operation, ::ngrest::MessageContext* context) override; virtual const ::ngrest::ServiceDescription* getDescription() const override; private: pruebas* service; }; #endif // PRUEBASWRAPPER_H
[ "2883388711710@ingenieria.usac.edu.gt" ]
2883388711710@ingenieria.usac.edu.gt
7a13b9bba3bb8c3d6c3fabcea049079c93a3fdd2
f47507ff5536857b84113d5de9b949ad1b926075
/tensorflow/compiler/jit/extract_outside_compilation_pass.cc
841f98aacc599690456a79b83d51048c2ee54c4f
[ "Apache-2.0" ]
permissive
Guy-test/tensorflow
299a28dc9127b3ea7e16cd2d0d1a73fa1d0c07d2
e8d291f27241584fdb461fbc4729c9b3bd9012f2
refs/heads/master
2021-09-26T12:15:53.872392
2018-10-29T23:02:51
2018-10-29T23:15:03
155,294,181
0
1
Apache-2.0
2018-10-29T23:33:54
2018-10-29T23:19:48
C++
UTF-8
C++
false
false
27,289
cc
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/compiler/jit/extract_outside_compilation_pass.h" #include "absl/strings/match.h" #include "absl/strings/str_cat.h" #include "tensorflow/compiler/jit/encapsulate_subgraphs_pass.h" #include "tensorflow/compiler/jit/encapsulate_util.h" #include "tensorflow/compiler/tf2xla/dump_graph.h" #include "tensorflow/compiler/tf2xla/tf2xla_util.h" #include "tensorflow/core/common_runtime/function.h" #include "tensorflow/core/framework/graph_to_functiondef.h" #include "tensorflow/core/framework/node_def_builder.h" #include "tensorflow/core/framework/tensor_shape.pb.h" #include "tensorflow/core/graph/algorithm.h" #include "tensorflow/core/lib/core/errors.h" namespace tensorflow { namespace { // Add a key placeholder node to the graph. The key placeholder node will be // used as input for XlaRecvAtHost/XlaSendFromHost nodes. xla::StatusOr<Node*> AddHostComputeKeyPlaceholder( const string& xla_cluster_name, Graph* g) { NodeDef key_def; NodeDefBuilder builder(absl::StrCat(xla_cluster_name, "_key_placeholder"), "Placeholder"); builder.Attr("dtype", DT_STRING); builder.Attr("shape", PartialTensorShape({2})); builder.Attr("_host_compute_call_node", xla_cluster_name); Status s = builder.Finalize(&key_def); if (!s.ok()) return s; Node* n = g->AddNode(key_def, &s); if (!s.ok()) return s; return n; } // Returns nodes with given type. std::vector<Node*> GatherNodesWithType(const Graph& g, const string& type) { std::vector<Node*> result; for (Node* n : g.nodes()) { if (n->type_string() == type) { result.push_back(n); } } return result; } // Gets data types from `arg_nodes` and fills them into `recv_at_host_dtypes`. Status GetArgDataTypes(const std::vector<Node*>& arg_nodes, std::vector<DataType>* recv_at_host_dtypes) { recv_at_host_dtypes->resize(arg_nodes.size(), DT_INVALID); for (auto* n : arg_nodes) { int index; TF_RETURN_IF_ERROR(GetNodeAttr(n->attrs(), "index", &index)); DataType dtype; TF_RETURN_IF_ERROR(GetNodeAttr(n->attrs(), "T", &dtype)); (*recv_at_host_dtypes)[index] = dtype; } for (int i = 0; i < recv_at_host_dtypes->size(); i++) { if ((*recv_at_host_dtypes)[i] == DT_INVALID) { return errors::Internal("Cannot get datatype for input ", i); } } return Status::OK(); } // Builds XlaRecvAtHost node. xla::StatusOr<Node*> BuildRecvAtHostNode( Graph* g, const string& oc_cluster_name, const std::vector<DataType>& recv_at_host_dtypes, Node* key_placeholder) { NodeDefBuilder recv_at_host_builder( absl::StrCat("outside_compilation_", oc_cluster_name, "_recv"), "_XlaRecvAtHost"); NodeDef recv_at_host_def; recv_at_host_builder.Attr("Toutputs", recv_at_host_dtypes); // The correct device_ordinal will be inserted during replication in a // subsequent rewrite. recv_at_host_builder.Attr("device_ordinal", 0); recv_at_host_builder.Attr( "key", absl::StrCat("host_compute_channel_", oc_cluster_name)); recv_at_host_builder.Input(key_placeholder->name(), 0, DT_STRING); TF_RETURN_IF_ERROR(recv_at_host_builder.Finalize(&recv_at_host_def)); Status s; Node* recv_at_host_node = g->AddNode(recv_at_host_def, &s); TF_RETURN_IF_ERROR(s); return recv_at_host_node; } // Builds XlaRecvAtHost node, and replaces all _Arg nodes with it. xla::StatusOr<Node*> ReplaceArgNodesWithRecvAtHostNode( Graph* g, const string& oc_cluster_name, std::vector<DataType>* recv_at_host_dtypes, Node* key_placeholder) { std::vector<Node*> arg_nodes = GatherNodesWithType(*g, "_Arg"); TF_RETURN_IF_ERROR(GetArgDataTypes(arg_nodes, recv_at_host_dtypes)); TF_ASSIGN_OR_RETURN( Node * recv_at_host_node, BuildRecvAtHostNode(g, oc_cluster_name, *recv_at_host_dtypes, key_placeholder)); for (auto* n : arg_nodes) { int index; TF_RETURN_IF_ERROR(GetNodeAttr(n->attrs(), "index", &index)); // Record out edges and remove `n` before adding those edges to RecvAtHost. // This is to avoid multiple producers. std::vector<OutEdgeInfo> out_edge_info; for (auto edge : n->out_edges()) { out_edge_info.push_back( {edge->dst(), edge->src_output(), edge->dst_input()}); } g->RemoveNode(n); for (const OutEdgeInfo& edge : out_edge_info) { if (edge.dst_input == Graph::kControlSlot) { g->AddControlEdge(recv_at_host_node, edge.dst); } else { g->AddEdge(recv_at_host_node, index, edge.dst, edge.dst_input); } } // Rewrite dst nodes because their input changed. for (int i = 0; i < out_edge_info.size(); i++) { const OutEdgeInfo edge = out_edge_info[i]; if (edge.dst_input == Graph::kControlSlot) { continue; } Node* dst = edge.dst; NodeDef new_def = dst->def(); *new_def.mutable_input(edge.dst_input) = absl::StrCat(recv_at_host_node->name(), ":", index); TF_ASSIGN_OR_RETURN(Node * dst_replace, ReplaceNode(g, dst, new_def)); // Other edges might have `dst` as dst node as well. Update those edges // with `dst_replace`. for (int j = i + 1; j < out_edge_info.size(); j++) { if (out_edge_info[j].dst == dst) { out_edge_info[j].dst = dst_replace; } } } } g->AddEdge(key_placeholder, 0, recv_at_host_node, 0); return recv_at_host_node; } // Gets data types from `ret_nodes` and fills them into `send_from_host_dtypes`. Status GetRetDataTypes(const std::vector<Node*>& ret_nodes, std::vector<DataType>* send_from_host_dtypes) { send_from_host_dtypes->resize(ret_nodes.size(), DT_INVALID); for (auto* n : ret_nodes) { int index; TF_RETURN_IF_ERROR(GetNodeAttr(n->attrs(), "index", &index)); DataType dtype; TF_RETURN_IF_ERROR(GetNodeAttr(n->attrs(), "T", &dtype)); (*send_from_host_dtypes)[index] = dtype; } for (int i = 0; i < send_from_host_dtypes->size(); i++) { if ((*send_from_host_dtypes)[i] == DT_INVALID) { return errors::Internal("Cannot get datatype for output ", i); } } return Status::OK(); } // Builds XlaSendFromHost node. xla::StatusOr<Node*> BuildSendFromHostNode( Graph* g, const string& oc_cluster_name, const std::vector<Node*>& ret_nodes, const std::vector<DataType>& send_from_host_dtypes, Node* key_placeholder) { NodeDefBuilder send_from_host_builder( absl::StrCat("outside_compilation_", oc_cluster_name, "_send"), "_XlaSendFromHost"); NodeDef send_from_host_def; send_from_host_builder.Attr("Tinputs", send_from_host_dtypes); // The correct device_ordinal will be inserted during replication in a // subsequent rewrite. send_from_host_builder.Attr("device_ordinal", 0); send_from_host_builder.Attr( "key", absl::StrCat("host_compute_channel_", oc_cluster_name)); std::vector<NodeDefBuilder::NodeOut> inputs(send_from_host_dtypes.size()); for (auto* n : ret_nodes) { int index; TF_RETURN_IF_ERROR(GetNodeAttr(n->attrs(), "index", &index)); if (index < 0 || index >= send_from_host_dtypes.size()) { return errors::Internal("Invalid _Retval index: ", index); } for (auto edge : n->in_edges()) { inputs[index] = NodeDefBuilder::NodeOut{edge->src()->name(), edge->src_output(), edge->src()->output_type(edge->src_output())}; } } send_from_host_builder.Input(inputs); send_from_host_builder.Input(key_placeholder->name(), 0, DT_STRING); TF_RETURN_IF_ERROR(send_from_host_builder.Finalize(&send_from_host_def)); Status s; Node* send_from_host_node = g->AddNode(send_from_host_def, &s); TF_RETURN_IF_ERROR(s); return send_from_host_node; } // Builds XlaSendFromHost node, and replaces all _Retval nodes with it. xla::StatusOr<Node*> ReplaceRetNodesWithSendFromHostNode( Graph* g, const string& oc_cluster_name, std::vector<DataType>* send_from_host_dtypes, Node* key_placeholder) { std::vector<Node*> ret_nodes = GatherNodesWithType(*g, "_Retval"); TF_RETURN_IF_ERROR(GetRetDataTypes(ret_nodes, send_from_host_dtypes)); TF_ASSIGN_OR_RETURN( Node * send_from_host_node, BuildSendFromHostNode(g, oc_cluster_name, ret_nodes, *send_from_host_dtypes, key_placeholder)); for (auto* n : ret_nodes) { int index; TF_RETURN_IF_ERROR(GetNodeAttr(n->attrs(), "index", &index)); for (auto edge : n->in_edges()) { if (edge->src_output() == Graph::kControlSlot) { g->AddControlEdge(edge->src(), send_from_host_node); } else { g->AddEdge(edge->src(), edge->src_output(), send_from_host_node, index); } } g->RemoveNode(n); } g->AddEdge(key_placeholder, 0, send_from_host_node, send_from_host_dtypes->size()); return send_from_host_node; } // Returns input shapes (excluding key placeholder) for `send_from_host_node` // if they are all fully defined; absl::nullopt otherwise. absl::optional<std::vector<PartialTensorShape>> GetInferredInputShapes( int num_inputs, Node* send_from_host_node) { std::vector<PartialTensorShape> results(num_inputs); for (int i = 0; i < num_inputs; i++) { const Edge* e; if (!send_from_host_node->input_edge(i, &e).ok()) { return absl::nullopt; } std::vector<PartialTensorShape> shapes; if (!GetNodeAttr(e->src()->attrs(), kXlaInferredShapesAttrName, &shapes) .ok()) { return absl::nullopt; } const PartialTensorShape shape = shapes[e->dst_input()]; if (!shape.IsFullyDefined()) { return absl::nullopt; } results[e->dst_input()] = shape; } return results; } // Builds XlaHostCompute NodeDef from the outside compilation call node. xla::StatusOr<NodeDef> BuildXlaHostComputeNodeDef( const Node* call_node, const std::map<string, int>& host_compute_core) { string original_oc_name; TF_RETURN_IF_ERROR(GetNodeAttr( call_node->attrs(), "_outside_compilation_subgraph", &original_oc_name)); NodeDefBuilder host_compute_builder( absl::StrCat("outside_compilation_", original_oc_name, "_host_compute"), "XlaHostCompute"); // Copy all attributes. for (auto attr : call_node->attrs()) { host_compute_builder.Attr(attr.first, attr.second); } // Populate tpu_core assignment. const auto iter = host_compute_core.find(original_oc_name); if (iter != host_compute_core.end()) { int core = iter->second; host_compute_builder.Attr("tpu_core", core); } // Populate inputs. std::vector<DataType> input_dtypes; TF_RETURN_IF_ERROR(GetNodeAttr(call_node->attrs(), "Tinputs", &input_dtypes)); std::vector<NodeDefBuilder::NodeOut> inputs(input_dtypes.size()); for (auto e : call_node->in_edges()) { if (e->IsControlEdge()) { continue; } if (e->dst_input() < 0 || e->dst_input() >= input_dtypes.size()) { return errors::Internal("Invalid dst_input: ", e->dst_input()); } inputs[e->dst_input()] = NodeDefBuilder::NodeOut{ e->src()->name(), e->src_output(), input_dtypes[e->dst_input()]}; } host_compute_builder.Input(inputs); NodeDef new_def; TF_RETURN_IF_ERROR(host_compute_builder.Finalize(&new_def)); return new_def; } // Replace outside compilation function call node with XlaHostCompute node. // If the function call node has no input/output edges, we will just remove it // and not create a XlaHostCompute node. Status ReplaceOrRemoveOutsideCompilationCallNode( Graph* g, Node* call_node, const std::map<string, int>& host_compute_core) { // If the function call node has no input/output edges, just remove it. bool has_edge = false; for (auto e : call_node->in_edges()) { if (!e->IsControlEdge() || e->src() != g->source_node()) { has_edge = true; break; } } for (auto e : call_node->out_edges()) { if (!e->IsControlEdge() || e->dst() != g->sink_node()) { has_edge = true; break; } } if (!has_edge) { VLOG(4) << "Did not add HostCompute node for " << call_node->DebugString(); g->RemoveNode(call_node); return Status::OK(); } // Build XlaHostCompute NodeDef. TF_ASSIGN_OR_RETURN(NodeDef node_def, BuildXlaHostComputeNodeDef(call_node, host_compute_core)); TF_ASSIGN_OR_RETURN(Node * host_compute_node, ReplaceNode(g, call_node, node_def)); VLOG(4) << "Added HostCompute node: " << host_compute_node->DebugString(); return Status::OK(); } // For an XLA computation, builds host side graph given all outside compilation // graphs inside it. The host side graph contains: // 1) a "sequencer" node (we will add control edge between XlaRecvAtHost and // XlaSendFromHost to this sequencer node, so all outside compilation nodes // will be executed *before* this sequencer). // 2) a "key placeholder" node. Later in ExpandHostGraphIntoMainGraph(), we will // replace this node with compilation result node. // 3) all outside compilation graphs. Status ConstructHostGraph( const string& xla_cluster_name, const std::vector<string>& outside_compilation_host_graphs, FunctionLibraryDefinition* fld, std::unique_ptr<Graph>* host_graph) { host_graph->reset(new Graph(fld)); // Create sequencer node in host graph. NodeDefBuilder sequencer_builder(absl::StrCat(xla_cluster_name, "_sequencer"), "NoOp"); sequencer_builder.Attr("_xla_host_transfer_sequencer", xla_cluster_name); NodeDef sequencer_def; TF_RETURN_IF_ERROR(sequencer_builder.Finalize(&sequencer_def)); Status s; Node* sequencer = (*host_graph)->AddNode(sequencer_def, &s); TF_RETURN_IF_ERROR(s); // Create key placeholder in host graph. TF_ASSIGN_OR_RETURN( Node * key_placeholder, AddHostComputeKeyPlaceholder(xla_cluster_name, host_graph->get())); // For each outside compilation graph, copy them to host graph with the // following changes: // a) Use key_placeholder in host graph instead of its own. // b) Add control edge from RecvAtHost/SendFromHost to sequencer. // c) Clear node_def.device(), so device placer won't get confused. for (const string& host_func : outside_compilation_host_graphs) { VLOG(4) << "Expanding host graph " << host_func; FunctionBody* host_fbody = nullptr; TF_RETURN_IF_ERROR( FunctionDefToBodyHelper(*fld->Find(host_func), AttrSlice(), fld, [&](const string& op, const OpDef** sig) { return fld->LookUpOpDef(op, sig); }, &host_fbody)); std::unique_ptr<FunctionBody> host_fbody_deleter(host_fbody); // We use ReverseDFS() to copy nodes. Make sure all nodes are reverse // reachable from sink node so all nodes will be copied. FixupSourceAndSinkEdges(host_fbody->graph); std::map<const Node*, Node*> node_map; node_map[host_fbody->graph->source_node()] = (*host_graph)->source_node(); node_map[host_fbody->graph->sink_node()] = (*host_graph)->sink_node(); Status s; ReverseDFS(*host_fbody->graph, /*enter=*/nullptr, [&](const Node* n) { if (!s.ok()) { return; } Node* copy; if (node_map.find(n) != node_map.end()) { // Already copied this node. copy = node_map.at(n); } else if (n->type_string() == "Placeholder" && absl::EndsWith(n->name(), "_key_placeholder")) { // Change a). copy = key_placeholder; node_map[n] = copy; } else { // Copy the node. NodeDef copy_def = n->def(); // Change c). copy_def.clear_device(); copy = (*host_graph)->AddNode(copy_def, &s); if (!s.ok()) { return; } node_map[n] = copy; } // Only handle input edges. Output edges will be added later as // its output nodes' input edges. for (auto e : n->in_edges()) { if (node_map.find(e->src()) == node_map.end()) { s = errors::Internal("Cannot find node image for ", e->src()->DebugString()); return; } (*host_graph) ->AddEdge(node_map[e->src()], e->src_output(), copy, e->dst_input()); } // Change b). if (copy->type_string() == "_XlaRecvAtHost" || copy->type_string() == "_XlaSendFromHost") { (*host_graph)->AddControlEdge(copy, sequencer); } }, NodeComparatorID()); if (!s.ok()) { return s; } } // sequencer and key_placeholder might be dead nodes. Prune them if necessary. // - sequencer should be pruned iff it has no input control edges from // RecvAtHost/SendFromHost. If it has input control edge, we connect it to // sink node so it won't be pruned. // - key_placeholder should be pruned iff there's no RecvAtHost/SendFromHost. // We don't need to do anything special. if (!sequencer->in_edges().empty()) { (*host_graph)->AddControlEdge(sequencer, (*host_graph)->sink_node()); } PruneForReverseReachability( host_graph->get(), std::unordered_set<const Node*>{(*host_graph)->sink_node()}); if (VLOG_IS_ON(4)) { dump_graph::DumpGraphToFile( absl::StrCat("extract_outside_compilation_host_graph_for_", xla_cluster_name), **host_graph, fld); } return Status::OK(); } } // namespace Status RewriteOutsideCompilationSubgraphFn::operator()( const std::vector<OutputTensor>& arg_source_tensors, std::unique_ptr<Graph>* graph, std::vector<int>* input_permutation, std::vector<int>* output_permutation, NodeDef* node_def) { string old_name = node_def->op(); string new_name = absl::StrCat(xla_cluster_name_, "_", old_name); node_def->set_op(new_name); node_def->set_name(new_name); // Later we will run PruneForReverseReachability(), so make sure all original // nodes are reachable from sink node and won't be removed. FixupSourceAndSinkEdges(graph->get()); // Step 1: create a key placeholder node. TF_ASSIGN_OR_RETURN( Node * key_placeholder, AddHostComputeKeyPlaceholder(xla_cluster_name_, graph->get())); // Step 2: build RecvAtHost node, and replace all _Arg nodes with it. std::vector<DataType> recv_at_host_dtypes; TF_ASSIGN_OR_RETURN( Node * recv_at_host_node, ReplaceArgNodesWithRecvAtHostNode(graph->get(), new_name, &recv_at_host_dtypes, key_placeholder)); // Step 3: build SendFromHost node, and replace all _Retval nodes with it. std::vector<DataType> send_from_host_dtypes; TF_ASSIGN_OR_RETURN( Node * send_from_host_node, ReplaceRetNodesWithSendFromHostNode( graph->get(), new_name, &send_from_host_dtypes, key_placeholder)); // Step 4: add XLA cluster and outside compilation attr. for (Node* n : (*graph)->nodes()) { if (n->type_string() == "Placeholder" && absl::EndsWith(n->name(), "_key_placeholder")) { continue; } n->AddAttr(xla_cluster_attr_name_, xla_cluster_name_); n->AddAttr(outside_compilation_attr_name_, old_name); } // Check whether we have all input shapes for XlaSendFromHost. If we do, we // will set `shapes` attr for the call node; otherwise we will save the // shape inference graph and set `shape_inference_graph` for the call node. absl::optional<std::vector<PartialTensorShape>> shapes = GetInferredInputShapes(send_from_host_dtypes.size(), send_from_host_node); // Step 5: add control edges for originally XLA <-> outside compilation // control edges. for (Node* n : (*graph)->nodes()) { if (HasNodeAttr(n->def(), kXlaConnectedToXlaComputationAttrName)) { (*graph)->AddControlEdge(n, send_from_host_node); n->ClearAttr(kXlaConnectedToXlaComputationAttrName); } if (HasNodeAttr(n->def(), kXlaConnectedFromXlaComputationAttrName)) { (*graph)->AddControlEdge(recv_at_host_node, n); n->ClearAttr(kXlaConnectedFromXlaComputationAttrName); } } // Step 6: RecvAtHost/SendFromHost/key_placeholder might be dead nodes. Prune // them if necessary. // - RecvAtHost should be pruned iff it has no output data/control edges. If // it has any output edge, it will be reverse reachable from sink node. We // don't need to do anything special. // - SendFromHost should be pruned iff it has no input data/control edges. If // it has input edges other than key_placeholder, we connect it to sink // node so it won't be pruned. // - key_placeholder should be pruned iff RecvAtHost/SendFromHost are pruned. // We don't need to do anything special. if (send_from_host_node->in_edges().size() > 1) { (*graph)->AddControlEdge(send_from_host_node, (*graph)->sink_node()); } PruneForReverseReachability( graph->get(), std::unordered_set<const Node*>{(*graph)->sink_node()}); // Step 7: add necessary attributes to function call node, so we can replace // it with HostCompute node later. AddNodeAttr("_outside_compilation_subgraph", old_name, node_def); if (shapes) { AddNodeAttr("shape_inference_graph", "", node_def); AddNodeAttr("shapes", *shapes, node_def); } else { string shape_inference_func_name = absl::StrCat("_outside_compilation_shape_inference_", new_name); AddNodeAttr("shape_inference_graph", shape_inference_func_name, node_def); AddNodeAttr("shapes", std::vector<TensorShapeProto>{}, node_def); } AddNodeAttr("ancestors", std::vector<string>{}, node_def); AddNodeAttr("Tinputs", recv_at_host_dtypes, node_def); AddNodeAttr("Toutputs", send_from_host_dtypes, node_def); AddNodeAttr("key", absl::StrCat("host_compute_channel_", new_name), node_def); return Status::OK(); } Status ExtractOutsideCompilationForFunction( const string& xla_cluster_attr_name, const string& outside_compilation_attr_name, const string& xla_cluster_name, const NameAttrList& func_name_attrs, const string& new_func_name, const std::map<string, int>& host_compute_core, FunctionLibraryDefinition* fld, std::unique_ptr<Graph>* host_graph, std::vector<string>* shape_inference_graphs, bool* has_outside_compilation) { // Early return if function does not have any outside compilation nodes. const string& func_name = func_name_attrs.name(); const FunctionDef* fdef = fld->Find(func_name); if (!fdef) { return errors::Internal("Cannot find function ", func_name); } *has_outside_compilation = false; for (auto& node_def : fdef->node_def()) { if (HasNodeAttr(node_def, outside_compilation_attr_name)) { *has_outside_compilation = true; break; } } if (!has_outside_compilation) { return Status::OK(); } // Convert the function to graph. FunctionBody* fbody = nullptr; TF_RETURN_IF_ERROR(FunctionDefToBodyHelper( *fld->Find(func_name), AttrSlice(&func_name_attrs.attr()), fld, [&](const string& op, const OpDef** sig) { return fld->LookUpOpDef(op, sig); }, &fbody)); std::unique_ptr<FunctionBody> fbody_deleter(fbody); if (VLOG_IS_ON(4)) { dump_graph::DumpGraphToFile( absl::StrCat("extract_outside_compilation_for_func_before_", func_name), *fbody->graph, fld); } // Encapsulate outside_compilation cluster into function call node. std::unique_ptr<Graph> graph_out; RewriteOutsideCompilationSubgraphFn rewrite_fn( xla_cluster_attr_name, outside_compilation_attr_name, xla_cluster_name); TF_RETURN_IF_ERROR(EncapsulateSubgraphsInFunctions( outside_compilation_attr_name, "", *fbody->graph, rewrite_fn, /*reuse_existing_functions=*/true, &graph_out, fld)); // Replace outside_compilation function nodes with HostCompute ops. std::vector<Node*> outside_compilation_nodes; std::vector<string> outside_compilation_host_graphs; for (Node* n : graph_out->nodes()) { if (HasNodeAttr(n->def(), "_outside_compilation_subgraph")) { outside_compilation_nodes.push_back(n); outside_compilation_host_graphs.push_back(n->name()); // If we could not infer shapes for XlaSendFromHost inputs statically, we // will set the "shape_inference_graph" attribute. In that case, copy // outside compilation subgraph as shape inference graph in `fld`. string shape_inference_graph; TF_RETURN_IF_ERROR(GetNodeAttr(n->attrs(), "shape_inference_graph", &shape_inference_graph)); if (!shape_inference_graph.empty()) { shape_inference_graphs->push_back(shape_inference_graph); const FunctionDef* xla_fdef = fld->Find(n->name()); if (!xla_fdef) { return errors::Internal("Cannot find XLA function ", n->name()); } FunctionDef shape_inference_fdef = *xla_fdef; shape_inference_fdef.mutable_signature()->set_name( shape_inference_graph); TF_RETURN_IF_ERROR(fld->AddFunctionDef(shape_inference_fdef)); } } } for (Node* n : outside_compilation_nodes) { TF_RETURN_IF_ERROR(ReplaceOrRemoveOutsideCompilationCallNode( graph_out.get(), n, host_compute_core)); } if (VLOG_IS_ON(4)) { dump_graph::DumpGraphToFile( absl::StrCat("extract_outside_compilation_for_func_after_", func_name), *graph_out, fld); } // Construct host graph. if (!outside_compilation_host_graphs.empty()) { TF_RETURN_IF_ERROR(ConstructHostGraph( xla_cluster_name, outside_compilation_host_graphs, fld, host_graph)); } // Remove the outside compilation graphs from function library. for (const string& func : outside_compilation_host_graphs) { TF_RETURN_IF_ERROR(fld->RemoveFunction(func)); } // Replace original function. FunctionDef updated_fdef; TF_RETURN_IF_ERROR( GraphToFunctionDef(*graph_out, new_func_name, &updated_fdef)); if (fld->Find(new_func_name)) { TF_RETURN_IF_ERROR(fld->ReplaceFunction(new_func_name, updated_fdef)); } else { TF_RETURN_IF_ERROR(fld->AddFunctionDef(updated_fdef)); } return Status::OK(); } } // namespace tensorflow
[ "gardener@tensorflow.org" ]
gardener@tensorflow.org
ffaa4cdc122c4c57a53d0c6140c7c27275c1f3a6
cca23296b17e23f3541c505dd96862adad53a261
/shape/cubebarrel.cpp
03350f6c0c3e092e2dbb6fabe9295179a39bfb2c
[]
no_license
purvigoel/projectHug
432eaf0ef3a88a535f67fc61add3d6c76f1126f9
7b7e42f09cdf93826f3b9549b6ac27a562a0af0a
refs/heads/master
2020-04-07T06:09:20.581482
2018-12-03T18:48:53
2018-12-03T18:48:53
158,124,311
0
0
null
null
null
null
UTF-8
C++
false
false
3,305
cpp
#include "cubebarrel.h" CubeBarrel::CubeBarrel() { } CubeBarrel::~CubeBarrel() { } std::vector<float> CubeBarrel::buildShape(int numRows, int numCols){ float stripHeight = 1.0f / numRows; std::vector<float> points; float i = -0.5 + stripHeight; for(int c = 0; c < numRows; c++){ std::vector<float> rowpoints = defineHorizontalSlice(numCols, 1.0, 0.0, stripHeight, i, -0.5f, 0.5f); points.insert(points.end(), rowpoints.begin(), rowpoints.end()); i += stripHeight; } return points; } // Cube Barrels aren't defined by circles, so we create them a little differently here. Here, we // define each horizontal slice around a square shaped base. std::vector<float> CubeBarrel::defineHorizontalSlice(int numStrips, float baseTop, float baseBottom, float stripHeight, float stripY, float stripX, float stripZ) { //Left face float stripWidth = baseTop/numStrips; std::vector<float> points; //front face for(int i = 0; i < numStrips + 1; i ++){ points.push_back(float(stripX + stripWidth * i)); points.push_back(float(stripY)); points.push_back(float(stripZ)); points.push_back(float(0)); points.push_back(float(0)); points.push_back(float(1)); points.push_back(float(stripX + stripWidth * i)); points.push_back(float(stripY - stripHeight)); points.push_back(float(stripZ)); points.push_back(float(0)); points.push_back(float(0)); points.push_back(float(1)); } for(int i = 1; i < numStrips + 1; i ++){ points.push_back(stripX + baseTop); points.push_back(float(stripY)); points.push_back(float(stripZ - stripWidth * (i))); points.push_back(float(1)); points.push_back(float(0)); points.push_back(float(0)); points.push_back(float(stripX + baseTop)); points.push_back(float(stripY - stripHeight)); points.push_back(float(stripZ - stripWidth * (i))); points.push_back(float(1)); points.push_back(float(0)); points.push_back(float(0)); } for(int i = 1; i < numStrips + 1; i ++){ points.push_back(float(stripX + baseTop - stripWidth * i)); points.push_back(float(stripY)); points.push_back(stripX); points.push_back(float(0)); points.push_back(float(0)); points.push_back(float(-1)); points.push_back(float(stripX + baseTop - stripWidth * i)); points.push_back(float(stripY - stripHeight)); points.push_back(stripX); points.push_back(float(0)); points.push_back(float(0)); points.push_back(float(-1)); } for(int i = 1; i < numStrips + 1; i ++){ points.push_back(stripX); points.push_back(float(stripY)); points.push_back(float(stripZ - baseTop + stripWidth * (i))); points.push_back(float(-1)); points.push_back(float(0)); points.push_back(float(0)); points.push_back(float(stripX)); points.push_back(float(stripY - stripHeight)); points.push_back(float(stripZ - baseTop + stripWidth * (i))); points.push_back(float(-1)); points.push_back(float(0)); points.push_back(float(0)); } return points; // TODO [Task 7] }
[ "purvi_goel@brown.edu" ]
purvi_goel@brown.edu
3a103760b0518fbe552ce41c0b9e91885d033c29
e0f08f8cc9f0547a55b2263bd8b9ee17dcb6ed8c
/Contests/practice_4/twopalin.cpp
6d001cc8ee14f5c6eb8778725fd818171b28ec24
[ "MIT" ]
permissive
aqfaridi/Competitve-Programming-Codes
437756101f45d431e4b4a14f4d461e407a7df1e9
d055de2f42d3d6bc36e03e67804a1dd6b212241f
refs/heads/master
2021-01-10T13:56:04.424041
2016-02-15T08:03:51
2016-02-15T08:03:51
51,711,974
0
0
null
null
null
null
UTF-8
C++
false
false
758
cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int,int> pii; #define endl '\n' int n,result; int marked_this[26]; string s1,s2; int base(string &s1){ int a = 0; memset(marked_this,0,sizeof marked_this); for(int i=0;i<n;i++) marked_this[s1[i]-'a']++; for(int i=0;i<26;i++) if(marked_this[i]) a++; return a; } void solve(int pos){ if(pos == n){ int a = 0 , b = 0; a = base(s1); b = base(s2); result = min(result,max(a,b)); return; } swap(s1[pos],s2[pos]); solve(pos+1); swap(s1[pos],s2[pos]); solve(pos+1); } int main() { ios::sync_with_stdio(false); cin.tie(0); int t; cin>>t; while(t--) { cin>>n; cin>>s1; cin>>s2; result = INT_MAX; solve(0); cout<<result<<endl; } return 0; }
[ "aqfaridi@gmail.com" ]
aqfaridi@gmail.com
8438f951fdd9e1ecb343e677ab675827d6425230
c55dfcf26065e3f8abc4a191731e5d02acacb5f5
/src/memory/include/memory/memory.fwd.h
18c7cb9ed9a9f9cb6d9c94a429cb3b38053e4a65
[ "MIT" ]
permissive
venkat24/tvp
b2e7c9eb1df9bcab52804c10a6da06e74bf311f3
cd6636024d5e3a152b7cc0fbeaeda386ab7e6695
refs/heads/master
2020-04-01T05:33:01.025450
2020-01-21T03:45:31
2020-01-21T03:45:31
152,908,447
30
5
MIT
2020-01-25T04:20:31
2018-10-13T19:45:19
C++
UTF-8
C++
false
false
139
h
/** * @file memory.fwd.h * Forward declares the Memory Class */ #pragma once namespace memory { class Memory; } // namespace memory
[ "venkatramansrikanth@outlook.com" ]
venkatramansrikanth@outlook.com
69e2a3d8cd71b6e86dc0563fa0ba495c6ae42c7c
7d0e0c88d32875a18b41ef86e41f8c482f069e01
/Src/Kranos/GUI/Panel/PropertyPanel.cpp
afa5125392c2b6b4637154d9ad32daa184d0da2e
[ "MIT" ]
permissive
KDahir247/KranosLoader
3b762bb4c3e851d16163492b0c686798a4bbc8e3
5e55a0f1a697170020c2601c9b0d04b0da27da93
refs/heads/main
2023-01-01T17:41:46.830677
2020-10-27T16:19:56
2020-10-27T16:19:56
307,753,278
0
0
null
null
null
null
UTF-8
C++
false
false
4,669
cpp
// // Created by kdahi on 2020-09-30. // #include "PropertyPanel.h" #include <nuklear.h> PropertyPanel::PropertyPanel(struct nk_context *nkContext, int width, int height) { this->width = width; this->height = height; context = nkContext; WindowEvent::AddListener()->GetEventListener() .subscribe([&](const WindowEventArgs& windowEventArgs){ this->width = windowEventArgs.width; this->height = windowEventArgs.height; }); } void PropertyPanel::OnBeginStyle() { // struct nk_style *s = &context->style; // nk_style_push_color(context, &s->window.background, nk_rgba(45,45,45,255)); // nk_style_push_style_item(context, &s->window.fixed_background, nk_style_item_color(nk_rgba(45,45,45,255))); } void PropertyPanel::OnEndStyle() { // nk_style_pop_color(context); // nk_style_pop_style_item(context); } void PropertyPanel::OnBegin() { OnBeginStyle(); if (nk_begin(context, "Kranos Loader", nk_rect(0, 20.0f, width/ 4.0f, height - 320), NK_WINDOW_BORDER | NK_WINDOW_TITLE)){ OnDraw(); OnEnd(); } OnEndStyle(); } void PropertyPanel::OnDraw() { if (nk_tree_push(context, NK_TREE_TAB, "Object Properties", NK_MINIMIZED)){ //TODO Change to glm::vec3 or equivalent static float position[3]; static float rotation[3]; static float scale[3]; char positionBuffer[30]; char rotationBuffer[30]; char scaleBuffer[30]; nk_text(context, "Position", strlen("Position"), NK_TEXT_LEFT); sprintf(positionBuffer, "%.2f, %.2f, %.2f", position[0], position[1], position[2]); if (nk_combo_begin_label(context, positionBuffer, nk_vec2(200, 200))){ nk_layout_row_dynamic(context, 25, 1); nk_property_float(context, "#X", -INFINITY, &position[0], INFINITY, 1.0f, 0.5f); nk_property_float(context,"#Y", -1024.0f, &position[1], INFINITY, 1.0f, 0.5f); nk_property_float(context, "#Z", -INFINITY,&position[2], INFINITY, 1.0f, 0.5f); nk_combo_end(context); } nk_text(context, "Rotation", strlen("Rotation"), NK_TEXT_LEFT); sprintf(rotationBuffer, "%.2f, %.2f, %.2f", rotation[0], rotation[1], rotation[2]); if(nk_combo_begin_label(context, rotationBuffer, nk_vec2(200,200))){ nk_layout_row_dynamic(context, 25, 1); nk_property_float(context, "#Pitch", -INFINITY, &rotation[0], INFINITY, 1.0f, 0.5f); nk_property_float(context, "#Yaw", -INFINITY, &rotation[1], INFINITY, 1.0f, 0.5f); nk_property_float(context, "#Roll", -INFINITY, &rotation[2], INFINITY, 1.0f, 0.5f); nk_combo_end(context); } nk_text(context, "Scale", strlen("Scale"), NK_TEXT_LEFT); sprintf(scaleBuffer, "%.2f, %.2f, %.2f", scale[0], scale[1], scale[2]); if(nk_combo_begin_label(context, scaleBuffer, nk_vec2(200,200))){ nk_layout_row_dynamic(context, 25, 1); nk_property_float(context, "#Width", -INFINITY, &scale[0], INFINITY, 1.0f, 0.5f); nk_property_float(context, "#Height", -INFINITY, &scale[1], INFINITY, 1.0f, 0.5f); nk_property_float(context, "#Depth", -INFINITY, &scale[2], INFINITY, 1.0f, 0.5f); nk_combo_end(context); } nk_tree_pop(context); //Material } if (nk_tree_push(context, NK_TREE_TAB, "Lighting Properties", NK_MINIMIZED)){ // nk_checkbox_label(context, "Enable Lighting", &success); nk_tree_pop(context); } if (nk_tree_push(context, NK_TREE_TAB, "Environment Properties", NK_MINIMIZED)){ if (nk_tree_push(context, NK_TREE_NODE, "Skybox", NK_MINIMIZED)){ nk_layout_row_dynamic(context, 30, 3); if(nk_button_label(context, "Sunny")){ } if(nk_button_label(context, "Glorious")){ } if(nk_button_label(context, "Space")){ } if (nk_button_label(context, "Cloudy")) { } if (nk_button_label(context, "Dusk")) { } if (nk_button_label(context, "Overcast")) { } if (nk_button_label(context, "C Night")) { } if (nk_button_label(context, "C Day")){ } if (nk_button_label(context, "Night")){ } nk_tree_pop(context); } //Set Skybox setting nk_tree_pop(context); } } void PropertyPanel::OnEnd() { nk_end(context); } PropertyPanel::~PropertyPanel() { }
[ "oblitrium@gmail.com" ]
oblitrium@gmail.com
e7a8c4e2018acb7235c246c47862cc9ab2362d8a
5b708803962e4c24dffa5d5fd1c9cf9e39ca74f8
/cubs/src/Symbol.hh
054753c262979525e09d0f61974c2ee3ea0dd7cd
[]
no_license
cptpingu/Cubs
f5911499ac195e9901584353b9f537576c82e952
dbe480c0c77ecc8eb3d6c01a01db4adb7e155c2d
refs/heads/master
2020-05-03T19:07:54.851166
2009-05-19T12:23:56
2009-05-19T12:23:56
664,450
0
1
null
null
null
null
UTF-8
C++
false
false
1,229
hh
#ifndef SYMBOL_HH_ # define SYMBOL_HH_ # include <iostream> # include "Configuration.hh" # include "SharedString.hh" namespace MiniCompiler { class Symbol { friend std::ostream& operator<<(std::ostream& o, const Symbol& symbol); public: enum type { TYPE, KEYWORD, LEFT_BRACKET, RIGHT_BRACKET, SEMI_COLON, OPERATOR, SEPARATOR, VALUE, ID, COMA, ALLOCATION, COMPARATOR, STRING_EXPR, BOOLEAN, COLON }; public: Symbol(const std::string& token, const int line); Symbol(const std::string& token, const int line, const type type); Symbol(const Symbol& symb); void operator=(const Symbol& symb); ~Symbol(); private: type findType(const std::string& token) const; static std::string typeToString(const type symbolType); static const std::string stringSizeFormatter(const std::string& s, const unsigned int size); public: bool check() const; const std::string& getText() const; int getLine() const; type getType() const; private: mystd::SharedString _text; int _line; type _type; }; std::ostream& operator<<(std::ostream& o, const Symbol& symbol); } #include "Symbol.hxx" #endif /* !SYMBOL_HH_ */
[ "cptpingu@gmail.com" ]
cptpingu@gmail.com
d61798685e3a386820a402612e2b87c067326b89
cbd12e1d7a538106a0ff8c8599d55d648777ad32
/src/atlas/array/helpers/ArrayInitializer.h
1a274fa313a190316ce374241967bb08a16545c4
[ "Apache-2.0" ]
permissive
pmarguinaud/atlas
2c05bd71dc41aeb6a876a78f5d3ea8448b604362
b9360f5b4022107741b8ab71fdc7f77e98018cae
refs/heads/master
2021-07-22T16:19:13.465513
2020-04-08T18:56:45
2020-04-08T18:56:45
256,191,290
3
0
Apache-2.0
2020-04-16T11:11:13
2020-04-16T11:11:13
null
UTF-8
C++
false
false
8,927
h
/* * (C) Copyright 2013 ECMWF. * * This software is licensed under the terms of the Apache Licence Version 2.0 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. * In applying this licence, ECMWF does not waive the privileges and immunities * granted to it by virtue of its status as an intergovernmental organisation * nor does it submit to any jurisdiction. */ #pragma once #include <sstream> #include <string> #include <vector> #include "atlas/array.h" #include "atlas/array/DataType.h" #include "atlas/array_fwd.h" #include "atlas/runtime/Exception.h" //------------------------------------------------------------------------------ namespace atlas { namespace array { namespace helpers { //------------------------------------------------------------------------------ template <idx_t Rank> struct array_initializer; template <idx_t PartDim> struct array_initializer_partitioned; //------------------------------------------------------------------------------ template <typename Value, idx_t Rank, idx_t Dim> struct array_initializer_impl { static void apply( Array const& orig, Array& array_resized ) { array_initializer_impl<Value, Rank, Dim>::apply( make_view<Value, Rank>( orig ), make_view<Value, Rank>( array_resized ) ); } template <typename... DimIndex> static void apply( ArrayView<const Value, Rank> const&& orig, ArrayView<Value, Rank>&& array_resized, DimIndex... idxs ) { const idx_t N = std::min( array_resized.shape( Dim ), orig.shape( Dim ) ); for ( idx_t i = 0; i < N; ++i ) { array_initializer_impl<Value, Rank, Dim + 1>::apply( std::move( orig ), std::move( array_resized ), idxs..., i ); } } }; //------------------------------------------------------------------------------ template <typename Value, idx_t Rank> struct array_initializer_impl<Value, Rank, Rank> { template <typename... DimIndex> static void apply( ArrayView<const Value, Rank> const&& orig, ArrayView<Value, Rank>&& array_resized, DimIndex... idxs ) { array_resized( idxs... ) = orig( idxs... ); } }; //------------------------------------------------------------------------------ template <idx_t Rank> struct array_initializer { static void apply( Array const& orig, Array& array_resized ) { switch ( orig.datatype().kind() ) { case DataType::KIND_REAL64: return array_initializer_impl<double, Rank, 0>::apply( orig, array_resized ); case DataType::KIND_REAL32: return array_initializer_impl<float, Rank, 0>::apply( orig, array_resized ); case DataType::KIND_INT32: return array_initializer_impl<int, Rank, 0>::apply( orig, array_resized ); case DataType::KIND_INT64: return array_initializer_impl<long, Rank, 0>::apply( orig, array_resized ); case DataType::KIND_UINT64: return array_initializer_impl<unsigned long, Rank, 0>::apply( orig, array_resized ); default: { std::stringstream err; err << "data kind " << orig.datatype().kind() << " not recognised."; throw_NotImplemented( err.str(), Here() ); } } } }; //------------------------------------------------------------------------------ template <typename Value, idx_t Rank, idx_t Dim, idx_t PartDim> struct array_initializer_partitioned_val_impl { static void apply( Array const& orig, Array& dest, idx_t pos, idx_t offset ) { array_initializer_partitioned_val_impl<Value, Rank, Dim, PartDim>::apply( make_view<const Value, Rank>( orig ), make_view<Value, Rank>( dest ), pos, offset ); } template <typename... DimIndexPair> static void apply( ArrayView<const Value, Rank>&& orig, ArrayView<Value, Rank>&& dest, idx_t pos, idx_t offset, DimIndexPair... idxs ) { for ( idx_t i = 0; i < orig.shape( Dim ); ++i ) { idx_t displ = i; if ( Dim == PartDim && i >= pos ) { displ += offset; } std::pair<idx_t, idx_t> pair_idx{i, displ}; array_initializer_partitioned_val_impl<Value, Rank, Dim + 1, PartDim>::apply( std::move( orig ), std::move( dest ), pos, offset, idxs..., pair_idx ); } } }; // template< typename stdarray > // inline std::string print_array(const stdarray& v) // { // std::stringstream s; // s << "[ "; // for( int j=0; j<v.size(); ++ j ) { // s << v[j]; // if( j != v.size()-1 ) s << " , "; // } // s << " ]"; // return s.str(); // } //------------------------------------------------------------------------------ template <typename Value, idx_t Rank, idx_t PartDim> struct array_initializer_partitioned_val_impl<Value, Rank, Rank, PartDim> { template <typename... DimIndexPair> static void apply( ArrayView<const Value, Rank>&& orig, ArrayView<Value, Rank>&& dest, idx_t /*pos*/, idx_t /*offset*/, DimIndexPair... idxs ) { // Log::info() << print_array(std::array<int,Rank>{std::get<0>(idxs)...}) << // " --> " << print_array(std::array<int,Rank>{std::get<1>(idxs)...}) << " // " << orig(std::get<0>(idxs)...) << std::endl; dest( std::get<1>( idxs )... ) = orig( std::get<0>( idxs )... ); } }; //------------------------------------------------------------------------------ template <idx_t Rank, idx_t PartDim> struct array_initializer_partitioned_impl { static void apply( Array const& orig, Array& dest, idx_t pos, idx_t offset ) { switch ( orig.datatype().kind() ) { case DataType::KIND_REAL64: return array_initializer_partitioned_val_impl<double, Rank, 0, PartDim>::apply( orig, dest, pos, offset ); case DataType::KIND_REAL32: return array_initializer_partitioned_val_impl<float, Rank, 0, PartDim>::apply( orig, dest, pos, offset ); case DataType::KIND_INT32: return array_initializer_partitioned_val_impl<int, Rank, 0, PartDim>::apply( orig, dest, pos, offset ); case DataType::KIND_INT64: return array_initializer_partitioned_val_impl<long, Rank, 0, PartDim>::apply( orig, dest, pos, offset ); case DataType::KIND_UINT64: return array_initializer_partitioned_val_impl<unsigned long, Rank, 0, PartDim>::apply( orig, dest, pos, offset ); default: { std::stringstream err; err << "data kind " << orig.datatype().kind() << " not recognised."; throw_NotImplemented( err.str(), Here() ); } } } }; //------------------------------------------------------------------------------ template <idx_t PartDim> struct array_initializer_partitioned { static void apply( const Array& orig, Array& dest, idx_t pos, idx_t offset ) { switch ( orig.rank() ) { case 1: return array_initializer_partitioned_impl<1, PartDim>::apply( orig, dest, pos, offset ); case 2: return array_initializer_partitioned_impl<2, PartDim>::apply( orig, dest, pos, offset ); case 3: return array_initializer_partitioned_impl<3, PartDim>::apply( orig, dest, pos, offset ); case 4: return array_initializer_partitioned_impl<4, PartDim>::apply( orig, dest, pos, offset ); case 5: return array_initializer_partitioned_impl<5, PartDim>::apply( orig, dest, pos, offset ); case 6: return array_initializer_partitioned_impl<6, PartDim>::apply( orig, dest, pos, offset ); case 7: return array_initializer_partitioned_impl<7, PartDim>::apply( orig, dest, pos, offset ); case 8: return array_initializer_partitioned_impl<8, PartDim>::apply( orig, dest, pos, offset ); case 9: return array_initializer_partitioned_impl<9, PartDim>::apply( orig, dest, pos, offset ); default: { std::stringstream err; err << "too high Rank"; throw_NotImplemented( err.str(), Here() ); } } } }; //------------------------------------------------------------------------------ } // namespace helpers } // namespace array } // namespace atlas
[ "willem.deconinck@ecmwf.int" ]
willem.deconinck@ecmwf.int
b9656415e8b19f645a563e90f2395228cfe32abb
029c481b44b44c42605a8a828c358af39679300f
/automata/2558.cpp
daf7d7d57e3006991f3e6b319d3a3b11d777341d
[]
no_license
cbajs12/BOJ
93f4406c8820b834a48166f18abf89b7481cab7e
1e6ac6c98fe1336dd48db146199f8ebe7c4e216f
refs/heads/master
2020-05-29T12:23:11.757012
2019-06-08T12:14:58
2019-06-08T12:14:58
68,577,265
0
0
null
null
null
null
UTF-8
C++
false
false
259
cpp
#include <iostream> using namespace std; int main(void){ int a, b; cin>>a; cin>>b; if(a > 10 || a < 0) return 0; if(b > 10 || b < 0) return 0; int c = a+b; if(c > 10) return 0; printf("%d", c); }
[ "cbajs20@gmail.com" ]
cbajs20@gmail.com
01440e68568817c3573a8f92d428ab4b480af53b
9c8786f7a2dbc1a3af3ffed9be48e7a245be1516
/FinalRelease/软件代码/Il2CppOutputProject/Source/il2cppOutput/UnityEngine.TextRenderingModule.cpp
f5f0daffb5b1675e9d14a7e11153dad20d4e1dd3
[]
no_license
naomixie/SE_VR_Project
a7197b06cc6ad8fe003e36c47a27e9172c3a7c43
6bf1ac58f536b9c3fdd97b61a67563a3a695309d
refs/heads/master
2023-02-16T03:55:05.430786
2021-01-11T04:09:29
2021-01-11T04:09:29
295,352,170
5
1
null
2020-12-20T07:04:47
2020-09-14T08:25:57
C#
UTF-8
C++
false
false
237,522
cpp
#include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <cstring> #include <string.h> #include <stdio.h> #include <cmath> #include <limits> #include <assert.h> #include <stdint.h> #include "codegen/il2cpp-codegen.h" #include "il2cpp-object-internals.h" struct VirtActionInvoker0 { typedef void (*Action)(void*, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); ((Action)invokeData.methodPtr)(obj, invokeData.method); } }; struct GenericVirtActionInvoker0 { typedef void (*Action)(void*, const RuntimeMethod*); static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj) { VirtualInvokeData invokeData; il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData); ((Action)invokeData.methodPtr)(obj, invokeData.method); } }; struct InterfaceActionInvoker0 { typedef void (*Action)(void*, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface); ((Action)invokeData.methodPtr)(obj, invokeData.method); } }; struct GenericInterfaceActionInvoker0 { typedef void (*Action)(void*, const RuntimeMethod*); static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj) { VirtualInvokeData invokeData; il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData); ((Action)invokeData.methodPtr)(obj, invokeData.method); } }; // System.Action`1<System.Object> struct Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0; // System.Action`1<UnityEngine.Font> struct Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C; // System.AsyncCallback struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4; // System.Byte[] struct ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821; // System.Char[] struct CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2; // System.Collections.Generic.IList`1<UnityEngine.UICharInfo> struct IList_1_t32D1BB5985FCCAC1B6B14D4E41B3E3315FD87B3E; // System.Collections.Generic.IList`1<UnityEngine.UILineInfo> struct IList_1_t6F2A098B6071B1699E7DC325A6F16089FE563544; // System.Collections.Generic.IList`1<UnityEngine.UIVertex> struct IList_1_t45C308B7C2BC6D4379698668EE5E126FF141A995; // System.Collections.Generic.List`1<UnityEngine.UICharInfo> struct List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E; // System.Collections.Generic.List`1<UnityEngine.UILineInfo> struct List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0; // System.Collections.Generic.List`1<UnityEngine.UIVertex> struct List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554; // System.Delegate struct Delegate_t; // System.DelegateData struct DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE; // System.Delegate[] struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86; // System.IAsyncResult struct IAsyncResult_t8E194308510B375B42432981AE5E7488C458D598; // System.Object[] struct ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A; // System.Reflection.MethodInfo struct MethodInfo_t; // System.String struct String_t; // System.Void struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017; // UnityEngine.Font struct Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26; // UnityEngine.Font/FontTextureRebuildCallback struct FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C; // UnityEngine.GameObject struct GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F; // UnityEngine.Material struct Material_tF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598; // UnityEngine.Object struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0; // UnityEngine.TextGenerationSettings struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68; // UnityEngine.TextGenerator struct TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8; // UnityEngine.TextMesh struct TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A; // UnityEngine.UICharInfo[] struct UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482; // UnityEngine.UILineInfo[] struct UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC; // UnityEngine.UIVertex[] struct UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A; IL2CPP_EXTERN_C RuntimeClass* Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* IDisposable_t7218B22548186B208D65EA5B7870503810A2D15A_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* IntPtr_t_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Math_tFB388E53C7FDC6FCCF9A19ABF5A4E521FBD52E19_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C String_t* _stringLiteral277905A8757DB70EAE0C8B996E4FCF857783BB03; IL2CPP_EXTERN_C String_t* _stringLiteral2C79056F1CBD7CDBD214C0C0421FFC46A2BD5CBD; IL2CPP_EXTERN_C String_t* _stringLiteral6F5E75D22C09C82C4D03E8E6E9ADE44476FEE514; IL2CPP_EXTERN_C String_t* _stringLiteral8D03707CEE3275C377839D6BF944BCECDF26A00B; IL2CPP_EXTERN_C const RuntimeMethod* Action_1_Invoke_mC307FDDD4FEA6818EE9A27D962C2C512B835DAEB_RuntimeMethod_var; IL2CPP_EXTERN_C const RuntimeMethod* List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71_RuntimeMethod_var; IL2CPP_EXTERN_C const RuntimeMethod* List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8_RuntimeMethod_var; IL2CPP_EXTERN_C const RuntimeMethod* List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD_RuntimeMethod_var; IL2CPP_EXTERN_C const uint32_t CharacterInfo_get_advance_mCCD27183A01AB4F83305230D5AB39AE6F0E4779C_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t Font_InvokeTextureRebuilt_Internal_m2D4C9D99B6137EF380A19EC72D6EE8CBFF7B4062_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t Font__ctor_m0EB492A9B2082EEE21587ED01866DE1ED4C1E628_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t Font_add_textureRebuilt_m031EFCD3B164273920B133A8689C18ED87C9B18F_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t Font_remove_textureRebuilt_mBEF163DAE27CA126D400646E850AAEE4AE8DAAB4_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t TextGenerator_Finalize_m6E9076F61F7B4DD5E56207F39E8F5FD85F188D8A_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t TextGenerator_PopulateWithErrors_m1F1851B3C2B2EBEFD81C83DC124FB376C926B933_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t TextGenerator_Populate_Internal_m42F7FED165D62BFD9C006D19A0FCE5B70C1EF92B_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t TextGenerator_System_IDisposable_Dispose_m9D3291DC086282AF57A115B39D3C17BD0074FA3D_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t TextGenerator_ValidatedSettings_m167131680BB6CD53B929EF189520F9FCF71FB1D3_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t TextGenerator__ctor_m86E01E7BB9DC1B28F04961E482ED4D7065062BCE_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t UIVertex__cctor_m86F60F5BB996D3C59B19B80C4BFB5770802BFB30_MetadataUsageId; struct Delegate_t_marshaled_com; struct Delegate_t_marshaled_pinvoke; struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68;; struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com; struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com;; struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke; struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke;; struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86; struct ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A; IL2CPP_EXTERN_C_BEGIN IL2CPP_EXTERN_C_END #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // <Module> struct U3CModuleU3E_tDBB8B8FDA571F608D819B1D5558C135A3972639B { public: public: }; // System.Object struct Il2CppArrayBounds; // System.Array // System.Collections.Generic.List`1<UnityEngine.UICharInfo> struct List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E, ____items_1)); } inline UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* get__items_1() const { return ____items_1; } inline UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482** get_address_of__items_1() { return &____items_1; } inline void set__items_1(UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E_StaticFields, ____emptyArray_5)); } inline UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* get__emptyArray_5() const { return ____emptyArray_5; } inline UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<UnityEngine.UILineInfo> struct List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0, ____items_1)); } inline UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* get__items_1() const { return ____items_1; } inline UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC** get_address_of__items_1() { return &____items_1; } inline void set__items_1(UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0_StaticFields, ____emptyArray_5)); } inline UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* get__emptyArray_5() const { return ____emptyArray_5; } inline UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<UnityEngine.UIVertex> struct List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554, ____items_1)); } inline UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* get__items_1() const { return ____items_1; } inline UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A** get_address_of__items_1() { return &____items_1; } inline void set__items_1(UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554_StaticFields, ____emptyArray_5)); } inline UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* get__emptyArray_5() const { return ____emptyArray_5; } inline UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.String struct String_t : public RuntimeObject { public: // System.Int32 System.String::m_stringLength int32_t ___m_stringLength_0; // System.Char System.String::m_firstChar Il2CppChar ___m_firstChar_1; public: inline static int32_t get_offset_of_m_stringLength_0() { return static_cast<int32_t>(offsetof(String_t, ___m_stringLength_0)); } inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; } inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; } inline void set_m_stringLength_0(int32_t value) { ___m_stringLength_0 = value; } inline static int32_t get_offset_of_m_firstChar_1() { return static_cast<int32_t>(offsetof(String_t, ___m_firstChar_1)); } inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; } inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; } inline void set_m_firstChar_1(Il2CppChar value) { ___m_firstChar_1 = value; } }; struct String_t_StaticFields { public: // System.String System.String::Empty String_t* ___Empty_5; public: inline static int32_t get_offset_of_Empty_5() { return static_cast<int32_t>(offsetof(String_t_StaticFields, ___Empty_5)); } inline String_t* get_Empty_5() const { return ___Empty_5; } inline String_t** get_address_of_Empty_5() { return &___Empty_5; } inline void set_Empty_5(String_t* value) { ___Empty_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___Empty_5), (void*)value); } }; // System.ValueType struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF : public RuntimeObject { public: public: }; // Native definition for P/Invoke marshalling of System.ValueType struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_pinvoke { }; // Native definition for COM marshalling of System.ValueType struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_com { }; // System.Boolean struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C { public: // System.Boolean System.Boolean::m_value bool ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C, ___m_value_0)); } inline bool get_m_value_0() const { return ___m_value_0; } inline bool* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(bool value) { ___m_value_0 = value; } }; struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields { public: // System.String System.Boolean::TrueString String_t* ___TrueString_5; // System.String System.Boolean::FalseString String_t* ___FalseString_6; public: inline static int32_t get_offset_of_TrueString_5() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___TrueString_5)); } inline String_t* get_TrueString_5() const { return ___TrueString_5; } inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; } inline void set_TrueString_5(String_t* value) { ___TrueString_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___TrueString_5), (void*)value); } inline static int32_t get_offset_of_FalseString_6() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___FalseString_6)); } inline String_t* get_FalseString_6() const { return ___FalseString_6; } inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; } inline void set_FalseString_6(String_t* value) { ___FalseString_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___FalseString_6), (void*)value); } }; // System.Byte struct Byte_tF87C579059BD4633E6840EBBBEEF899C6E33EF07 { public: // System.Byte System.Byte::m_value uint8_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Byte_tF87C579059BD4633E6840EBBBEEF899C6E33EF07, ___m_value_0)); } inline uint8_t get_m_value_0() const { return ___m_value_0; } inline uint8_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(uint8_t value) { ___m_value_0 = value; } }; // System.Char struct Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9 { public: // System.Char System.Char::m_value Il2CppChar ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9, ___m_value_0)); } inline Il2CppChar get_m_value_0() const { return ___m_value_0; } inline Il2CppChar* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(Il2CppChar value) { ___m_value_0 = value; } }; struct Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9_StaticFields { public: // System.Byte[] System.Char::categoryForLatin1 ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ___categoryForLatin1_3; public: inline static int32_t get_offset_of_categoryForLatin1_3() { return static_cast<int32_t>(offsetof(Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9_StaticFields, ___categoryForLatin1_3)); } inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* get_categoryForLatin1_3() const { return ___categoryForLatin1_3; } inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821** get_address_of_categoryForLatin1_3() { return &___categoryForLatin1_3; } inline void set_categoryForLatin1_3(ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* value) { ___categoryForLatin1_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___categoryForLatin1_3), (void*)value); } }; // System.Double struct Double_t358B8F23BDC52A5DD700E727E204F9F7CDE12409 { public: // System.Double System.Double::m_value double ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Double_t358B8F23BDC52A5DD700E727E204F9F7CDE12409, ___m_value_0)); } inline double get_m_value_0() const { return ___m_value_0; } inline double* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(double value) { ___m_value_0 = value; } }; struct Double_t358B8F23BDC52A5DD700E727E204F9F7CDE12409_StaticFields { public: // System.Double System.Double::NegativeZero double ___NegativeZero_7; public: inline static int32_t get_offset_of_NegativeZero_7() { return static_cast<int32_t>(offsetof(Double_t358B8F23BDC52A5DD700E727E204F9F7CDE12409_StaticFields, ___NegativeZero_7)); } inline double get_NegativeZero_7() const { return ___NegativeZero_7; } inline double* get_address_of_NegativeZero_7() { return &___NegativeZero_7; } inline void set_NegativeZero_7(double value) { ___NegativeZero_7 = value; } }; // System.Enum struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521 : public ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF { public: public: }; struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields { public: // System.Char[] System.Enum::enumSeperatorCharArray CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* ___enumSeperatorCharArray_0; public: inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields, ___enumSeperatorCharArray_0)); } inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; } inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; } inline void set_enumSeperatorCharArray_0(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* value) { ___enumSeperatorCharArray_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___enumSeperatorCharArray_0), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Enum struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_pinvoke { }; // Native definition for COM marshalling of System.Enum struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_com { }; // System.Int32 struct Int32_t585191389E07734F19F3156FF88FB3EF4800D102 { public: // System.Int32 System.Int32::m_value int32_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int32_t585191389E07734F19F3156FF88FB3EF4800D102, ___m_value_0)); } inline int32_t get_m_value_0() const { return ___m_value_0; } inline int32_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(int32_t value) { ___m_value_0 = value; } }; // System.IntPtr struct IntPtr_t { public: // System.Void* System.IntPtr::m_value void* ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); } inline void* get_m_value_0() const { return ___m_value_0; } inline void** get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(void* value) { ___m_value_0 = value; } }; struct IntPtr_t_StaticFields { public: // System.IntPtr System.IntPtr::Zero intptr_t ___Zero_1; public: inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); } inline intptr_t get_Zero_1() const { return ___Zero_1; } inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; } inline void set_Zero_1(intptr_t value) { ___Zero_1 = value; } }; // System.Single struct Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1 { public: // System.Single System.Single::m_value float ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1, ___m_value_0)); } inline float get_m_value_0() const { return ___m_value_0; } inline float* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(float value) { ___m_value_0 = value; } }; // System.UInt32 struct UInt32_t4980FA09003AFAAB5A6E361BA2748EA9A005709B { public: // System.UInt32 System.UInt32::m_value uint32_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(UInt32_t4980FA09003AFAAB5A6E361BA2748EA9A005709B, ___m_value_0)); } inline uint32_t get_m_value_0() const { return ___m_value_0; } inline uint32_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(uint32_t value) { ___m_value_0 = value; } }; // System.Void struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017 { public: union { struct { }; uint8_t Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017__padding[1]; }; public: }; // UnityEngine.Color struct Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 { public: // System.Single UnityEngine.Color::r float ___r_0; // System.Single UnityEngine.Color::g float ___g_1; // System.Single UnityEngine.Color::b float ___b_2; // System.Single UnityEngine.Color::a float ___a_3; public: inline static int32_t get_offset_of_r_0() { return static_cast<int32_t>(offsetof(Color_t119BCA590009762C7223FDD3AF9706653AC84ED2, ___r_0)); } inline float get_r_0() const { return ___r_0; } inline float* get_address_of_r_0() { return &___r_0; } inline void set_r_0(float value) { ___r_0 = value; } inline static int32_t get_offset_of_g_1() { return static_cast<int32_t>(offsetof(Color_t119BCA590009762C7223FDD3AF9706653AC84ED2, ___g_1)); } inline float get_g_1() const { return ___g_1; } inline float* get_address_of_g_1() { return &___g_1; } inline void set_g_1(float value) { ___g_1 = value; } inline static int32_t get_offset_of_b_2() { return static_cast<int32_t>(offsetof(Color_t119BCA590009762C7223FDD3AF9706653AC84ED2, ___b_2)); } inline float get_b_2() const { return ___b_2; } inline float* get_address_of_b_2() { return &___b_2; } inline void set_b_2(float value) { ___b_2 = value; } inline static int32_t get_offset_of_a_3() { return static_cast<int32_t>(offsetof(Color_t119BCA590009762C7223FDD3AF9706653AC84ED2, ___a_3)); } inline float get_a_3() const { return ___a_3; } inline float* get_address_of_a_3() { return &___a_3; } inline void set_a_3(float value) { ___a_3 = value; } }; // UnityEngine.Color32 struct Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 { public: union { #pragma pack(push, tp, 1) struct { // System.Int32 UnityEngine.Color32::rgba int32_t ___rgba_0; }; #pragma pack(pop, tp) struct { int32_t ___rgba_0_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { // System.Byte UnityEngine.Color32::r uint8_t ___r_1; }; #pragma pack(pop, tp) struct { uint8_t ___r_1_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___g_2_OffsetPadding[1]; // System.Byte UnityEngine.Color32::g uint8_t ___g_2; }; #pragma pack(pop, tp) struct { char ___g_2_OffsetPadding_forAlignmentOnly[1]; uint8_t ___g_2_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___b_3_OffsetPadding[2]; // System.Byte UnityEngine.Color32::b uint8_t ___b_3; }; #pragma pack(pop, tp) struct { char ___b_3_OffsetPadding_forAlignmentOnly[2]; uint8_t ___b_3_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___a_4_OffsetPadding[3]; // System.Byte UnityEngine.Color32::a uint8_t ___a_4; }; #pragma pack(pop, tp) struct { char ___a_4_OffsetPadding_forAlignmentOnly[3]; uint8_t ___a_4_forAlignmentOnly; }; }; public: inline static int32_t get_offset_of_rgba_0() { return static_cast<int32_t>(offsetof(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23, ___rgba_0)); } inline int32_t get_rgba_0() const { return ___rgba_0; } inline int32_t* get_address_of_rgba_0() { return &___rgba_0; } inline void set_rgba_0(int32_t value) { ___rgba_0 = value; } inline static int32_t get_offset_of_r_1() { return static_cast<int32_t>(offsetof(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23, ___r_1)); } inline uint8_t get_r_1() const { return ___r_1; } inline uint8_t* get_address_of_r_1() { return &___r_1; } inline void set_r_1(uint8_t value) { ___r_1 = value; } inline static int32_t get_offset_of_g_2() { return static_cast<int32_t>(offsetof(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23, ___g_2)); } inline uint8_t get_g_2() const { return ___g_2; } inline uint8_t* get_address_of_g_2() { return &___g_2; } inline void set_g_2(uint8_t value) { ___g_2 = value; } inline static int32_t get_offset_of_b_3() { return static_cast<int32_t>(offsetof(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23, ___b_3)); } inline uint8_t get_b_3() const { return ___b_3; } inline uint8_t* get_address_of_b_3() { return &___b_3; } inline void set_b_3(uint8_t value) { ___b_3 = value; } inline static int32_t get_offset_of_a_4() { return static_cast<int32_t>(offsetof(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23, ___a_4)); } inline uint8_t get_a_4() const { return ___a_4; } inline uint8_t* get_address_of_a_4() { return &___a_4; } inline void set_a_4(uint8_t value) { ___a_4 = value; } }; // UnityEngine.Rect struct Rect_t35B976DE901B5423C11705E156938EA27AB402CE { public: // System.Single UnityEngine.Rect::m_XMin float ___m_XMin_0; // System.Single UnityEngine.Rect::m_YMin float ___m_YMin_1; // System.Single UnityEngine.Rect::m_Width float ___m_Width_2; // System.Single UnityEngine.Rect::m_Height float ___m_Height_3; public: inline static int32_t get_offset_of_m_XMin_0() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_XMin_0)); } inline float get_m_XMin_0() const { return ___m_XMin_0; } inline float* get_address_of_m_XMin_0() { return &___m_XMin_0; } inline void set_m_XMin_0(float value) { ___m_XMin_0 = value; } inline static int32_t get_offset_of_m_YMin_1() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_YMin_1)); } inline float get_m_YMin_1() const { return ___m_YMin_1; } inline float* get_address_of_m_YMin_1() { return &___m_YMin_1; } inline void set_m_YMin_1(float value) { ___m_YMin_1 = value; } inline static int32_t get_offset_of_m_Width_2() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_Width_2)); } inline float get_m_Width_2() const { return ___m_Width_2; } inline float* get_address_of_m_Width_2() { return &___m_Width_2; } inline void set_m_Width_2(float value) { ___m_Width_2 = value; } inline static int32_t get_offset_of_m_Height_3() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_Height_3)); } inline float get_m_Height_3() const { return ___m_Height_3; } inline float* get_address_of_m_Height_3() { return &___m_Height_3; } inline void set_m_Height_3(float value) { ___m_Height_3 = value; } }; // UnityEngine.UILineInfo struct UILineInfo_t0AF27251CA07CEE2BC0C1FEF752245596B8033E6 { public: // System.Int32 UnityEngine.UILineInfo::startCharIdx int32_t ___startCharIdx_0; // System.Int32 UnityEngine.UILineInfo::height int32_t ___height_1; // System.Single UnityEngine.UILineInfo::topY float ___topY_2; // System.Single UnityEngine.UILineInfo::leading float ___leading_3; public: inline static int32_t get_offset_of_startCharIdx_0() { return static_cast<int32_t>(offsetof(UILineInfo_t0AF27251CA07CEE2BC0C1FEF752245596B8033E6, ___startCharIdx_0)); } inline int32_t get_startCharIdx_0() const { return ___startCharIdx_0; } inline int32_t* get_address_of_startCharIdx_0() { return &___startCharIdx_0; } inline void set_startCharIdx_0(int32_t value) { ___startCharIdx_0 = value; } inline static int32_t get_offset_of_height_1() { return static_cast<int32_t>(offsetof(UILineInfo_t0AF27251CA07CEE2BC0C1FEF752245596B8033E6, ___height_1)); } inline int32_t get_height_1() const { return ___height_1; } inline int32_t* get_address_of_height_1() { return &___height_1; } inline void set_height_1(int32_t value) { ___height_1 = value; } inline static int32_t get_offset_of_topY_2() { return static_cast<int32_t>(offsetof(UILineInfo_t0AF27251CA07CEE2BC0C1FEF752245596B8033E6, ___topY_2)); } inline float get_topY_2() const { return ___topY_2; } inline float* get_address_of_topY_2() { return &___topY_2; } inline void set_topY_2(float value) { ___topY_2 = value; } inline static int32_t get_offset_of_leading_3() { return static_cast<int32_t>(offsetof(UILineInfo_t0AF27251CA07CEE2BC0C1FEF752245596B8033E6, ___leading_3)); } inline float get_leading_3() const { return ___leading_3; } inline float* get_address_of_leading_3() { return &___leading_3; } inline void set_leading_3(float value) { ___leading_3 = value; } }; // UnityEngine.Vector2 struct Vector2_tA85D2DD88578276CA8A8796756458277E72D073D { public: // System.Single UnityEngine.Vector2::x float ___x_0; // System.Single UnityEngine.Vector2::y float ___y_1; public: inline static int32_t get_offset_of_x_0() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D, ___x_0)); } inline float get_x_0() const { return ___x_0; } inline float* get_address_of_x_0() { return &___x_0; } inline void set_x_0(float value) { ___x_0 = value; } inline static int32_t get_offset_of_y_1() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D, ___y_1)); } inline float get_y_1() const { return ___y_1; } inline float* get_address_of_y_1() { return &___y_1; } inline void set_y_1(float value) { ___y_1 = value; } }; struct Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields { public: // UnityEngine.Vector2 UnityEngine.Vector2::zeroVector Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___zeroVector_2; // UnityEngine.Vector2 UnityEngine.Vector2::oneVector Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___oneVector_3; // UnityEngine.Vector2 UnityEngine.Vector2::upVector Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___upVector_4; // UnityEngine.Vector2 UnityEngine.Vector2::downVector Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___downVector_5; // UnityEngine.Vector2 UnityEngine.Vector2::leftVector Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___leftVector_6; // UnityEngine.Vector2 UnityEngine.Vector2::rightVector Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___rightVector_7; // UnityEngine.Vector2 UnityEngine.Vector2::positiveInfinityVector Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___positiveInfinityVector_8; // UnityEngine.Vector2 UnityEngine.Vector2::negativeInfinityVector Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___negativeInfinityVector_9; public: inline static int32_t get_offset_of_zeroVector_2() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___zeroVector_2)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_zeroVector_2() const { return ___zeroVector_2; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_zeroVector_2() { return &___zeroVector_2; } inline void set_zeroVector_2(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___zeroVector_2 = value; } inline static int32_t get_offset_of_oneVector_3() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___oneVector_3)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_oneVector_3() const { return ___oneVector_3; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_oneVector_3() { return &___oneVector_3; } inline void set_oneVector_3(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___oneVector_3 = value; } inline static int32_t get_offset_of_upVector_4() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___upVector_4)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_upVector_4() const { return ___upVector_4; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_upVector_4() { return &___upVector_4; } inline void set_upVector_4(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___upVector_4 = value; } inline static int32_t get_offset_of_downVector_5() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___downVector_5)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_downVector_5() const { return ___downVector_5; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_downVector_5() { return &___downVector_5; } inline void set_downVector_5(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___downVector_5 = value; } inline static int32_t get_offset_of_leftVector_6() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___leftVector_6)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_leftVector_6() const { return ___leftVector_6; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_leftVector_6() { return &___leftVector_6; } inline void set_leftVector_6(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___leftVector_6 = value; } inline static int32_t get_offset_of_rightVector_7() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___rightVector_7)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_rightVector_7() const { return ___rightVector_7; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_rightVector_7() { return &___rightVector_7; } inline void set_rightVector_7(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___rightVector_7 = value; } inline static int32_t get_offset_of_positiveInfinityVector_8() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___positiveInfinityVector_8)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_positiveInfinityVector_8() const { return ___positiveInfinityVector_8; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_positiveInfinityVector_8() { return &___positiveInfinityVector_8; } inline void set_positiveInfinityVector_8(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___positiveInfinityVector_8 = value; } inline static int32_t get_offset_of_negativeInfinityVector_9() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___negativeInfinityVector_9)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_negativeInfinityVector_9() const { return ___negativeInfinityVector_9; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_negativeInfinityVector_9() { return &___negativeInfinityVector_9; } inline void set_negativeInfinityVector_9(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___negativeInfinityVector_9 = value; } }; // UnityEngine.Vector3 struct Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 { public: // System.Single UnityEngine.Vector3::x float ___x_2; // System.Single UnityEngine.Vector3::y float ___y_3; // System.Single UnityEngine.Vector3::z float ___z_4; public: inline static int32_t get_offset_of_x_2() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___x_2)); } inline float get_x_2() const { return ___x_2; } inline float* get_address_of_x_2() { return &___x_2; } inline void set_x_2(float value) { ___x_2 = value; } inline static int32_t get_offset_of_y_3() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___y_3)); } inline float get_y_3() const { return ___y_3; } inline float* get_address_of_y_3() { return &___y_3; } inline void set_y_3(float value) { ___y_3 = value; } inline static int32_t get_offset_of_z_4() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___z_4)); } inline float get_z_4() const { return ___z_4; } inline float* get_address_of_z_4() { return &___z_4; } inline void set_z_4(float value) { ___z_4 = value; } }; struct Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields { public: // UnityEngine.Vector3 UnityEngine.Vector3::zeroVector Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___zeroVector_5; // UnityEngine.Vector3 UnityEngine.Vector3::oneVector Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___oneVector_6; // UnityEngine.Vector3 UnityEngine.Vector3::upVector Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___upVector_7; // UnityEngine.Vector3 UnityEngine.Vector3::downVector Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___downVector_8; // UnityEngine.Vector3 UnityEngine.Vector3::leftVector Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___leftVector_9; // UnityEngine.Vector3 UnityEngine.Vector3::rightVector Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___rightVector_10; // UnityEngine.Vector3 UnityEngine.Vector3::forwardVector Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___forwardVector_11; // UnityEngine.Vector3 UnityEngine.Vector3::backVector Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___backVector_12; // UnityEngine.Vector3 UnityEngine.Vector3::positiveInfinityVector Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___positiveInfinityVector_13; // UnityEngine.Vector3 UnityEngine.Vector3::negativeInfinityVector Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___negativeInfinityVector_14; public: inline static int32_t get_offset_of_zeroVector_5() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___zeroVector_5)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_zeroVector_5() const { return ___zeroVector_5; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_zeroVector_5() { return &___zeroVector_5; } inline void set_zeroVector_5(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___zeroVector_5 = value; } inline static int32_t get_offset_of_oneVector_6() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___oneVector_6)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_oneVector_6() const { return ___oneVector_6; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_oneVector_6() { return &___oneVector_6; } inline void set_oneVector_6(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___oneVector_6 = value; } inline static int32_t get_offset_of_upVector_7() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___upVector_7)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_upVector_7() const { return ___upVector_7; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_upVector_7() { return &___upVector_7; } inline void set_upVector_7(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___upVector_7 = value; } inline static int32_t get_offset_of_downVector_8() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___downVector_8)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_downVector_8() const { return ___downVector_8; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_downVector_8() { return &___downVector_8; } inline void set_downVector_8(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___downVector_8 = value; } inline static int32_t get_offset_of_leftVector_9() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___leftVector_9)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_leftVector_9() const { return ___leftVector_9; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_leftVector_9() { return &___leftVector_9; } inline void set_leftVector_9(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___leftVector_9 = value; } inline static int32_t get_offset_of_rightVector_10() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___rightVector_10)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_rightVector_10() const { return ___rightVector_10; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_rightVector_10() { return &___rightVector_10; } inline void set_rightVector_10(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___rightVector_10 = value; } inline static int32_t get_offset_of_forwardVector_11() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___forwardVector_11)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_forwardVector_11() const { return ___forwardVector_11; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_forwardVector_11() { return &___forwardVector_11; } inline void set_forwardVector_11(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___forwardVector_11 = value; } inline static int32_t get_offset_of_backVector_12() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___backVector_12)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_backVector_12() const { return ___backVector_12; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_backVector_12() { return &___backVector_12; } inline void set_backVector_12(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___backVector_12 = value; } inline static int32_t get_offset_of_positiveInfinityVector_13() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___positiveInfinityVector_13)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_positiveInfinityVector_13() const { return ___positiveInfinityVector_13; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_positiveInfinityVector_13() { return &___positiveInfinityVector_13; } inline void set_positiveInfinityVector_13(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___positiveInfinityVector_13 = value; } inline static int32_t get_offset_of_negativeInfinityVector_14() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___negativeInfinityVector_14)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_negativeInfinityVector_14() const { return ___negativeInfinityVector_14; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_negativeInfinityVector_14() { return &___negativeInfinityVector_14; } inline void set_negativeInfinityVector_14(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___negativeInfinityVector_14 = value; } }; // UnityEngine.Vector4 struct Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E { public: // System.Single UnityEngine.Vector4::x float ___x_1; // System.Single UnityEngine.Vector4::y float ___y_2; // System.Single UnityEngine.Vector4::z float ___z_3; // System.Single UnityEngine.Vector4::w float ___w_4; public: inline static int32_t get_offset_of_x_1() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E, ___x_1)); } inline float get_x_1() const { return ___x_1; } inline float* get_address_of_x_1() { return &___x_1; } inline void set_x_1(float value) { ___x_1 = value; } inline static int32_t get_offset_of_y_2() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E, ___y_2)); } inline float get_y_2() const { return ___y_2; } inline float* get_address_of_y_2() { return &___y_2; } inline void set_y_2(float value) { ___y_2 = value; } inline static int32_t get_offset_of_z_3() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E, ___z_3)); } inline float get_z_3() const { return ___z_3; } inline float* get_address_of_z_3() { return &___z_3; } inline void set_z_3(float value) { ___z_3 = value; } inline static int32_t get_offset_of_w_4() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E, ___w_4)); } inline float get_w_4() const { return ___w_4; } inline float* get_address_of_w_4() { return &___w_4; } inline void set_w_4(float value) { ___w_4 = value; } }; struct Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E_StaticFields { public: // UnityEngine.Vector4 UnityEngine.Vector4::zeroVector Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___zeroVector_5; // UnityEngine.Vector4 UnityEngine.Vector4::oneVector Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___oneVector_6; // UnityEngine.Vector4 UnityEngine.Vector4::positiveInfinityVector Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___positiveInfinityVector_7; // UnityEngine.Vector4 UnityEngine.Vector4::negativeInfinityVector Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___negativeInfinityVector_8; public: inline static int32_t get_offset_of_zeroVector_5() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E_StaticFields, ___zeroVector_5)); } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_zeroVector_5() const { return ___zeroVector_5; } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_zeroVector_5() { return &___zeroVector_5; } inline void set_zeroVector_5(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value) { ___zeroVector_5 = value; } inline static int32_t get_offset_of_oneVector_6() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E_StaticFields, ___oneVector_6)); } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_oneVector_6() const { return ___oneVector_6; } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_oneVector_6() { return &___oneVector_6; } inline void set_oneVector_6(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value) { ___oneVector_6 = value; } inline static int32_t get_offset_of_positiveInfinityVector_7() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E_StaticFields, ___positiveInfinityVector_7)); } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_positiveInfinityVector_7() const { return ___positiveInfinityVector_7; } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_positiveInfinityVector_7() { return &___positiveInfinityVector_7; } inline void set_positiveInfinityVector_7(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value) { ___positiveInfinityVector_7 = value; } inline static int32_t get_offset_of_negativeInfinityVector_8() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E_StaticFields, ___negativeInfinityVector_8)); } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_negativeInfinityVector_8() const { return ___negativeInfinityVector_8; } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_negativeInfinityVector_8() { return &___negativeInfinityVector_8; } inline void set_negativeInfinityVector_8(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value) { ___negativeInfinityVector_8 = value; } }; // System.Delegate struct Delegate_t : public RuntimeObject { public: // System.IntPtr System.Delegate::method_ptr Il2CppMethodPointer ___method_ptr_0; // System.IntPtr System.Delegate::invoke_impl intptr_t ___invoke_impl_1; // System.Object System.Delegate::m_target RuntimeObject * ___m_target_2; // System.IntPtr System.Delegate::method intptr_t ___method_3; // System.IntPtr System.Delegate::delegate_trampoline intptr_t ___delegate_trampoline_4; // System.IntPtr System.Delegate::extra_arg intptr_t ___extra_arg_5; // System.IntPtr System.Delegate::method_code intptr_t ___method_code_6; // System.Reflection.MethodInfo System.Delegate::method_info MethodInfo_t * ___method_info_7; // System.Reflection.MethodInfo System.Delegate::original_method_info MethodInfo_t * ___original_method_info_8; // System.DelegateData System.Delegate::data DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9; // System.Boolean System.Delegate::method_is_virtual bool ___method_is_virtual_10; public: inline static int32_t get_offset_of_method_ptr_0() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_ptr_0)); } inline Il2CppMethodPointer get_method_ptr_0() const { return ___method_ptr_0; } inline Il2CppMethodPointer* get_address_of_method_ptr_0() { return &___method_ptr_0; } inline void set_method_ptr_0(Il2CppMethodPointer value) { ___method_ptr_0 = value; } inline static int32_t get_offset_of_invoke_impl_1() { return static_cast<int32_t>(offsetof(Delegate_t, ___invoke_impl_1)); } inline intptr_t get_invoke_impl_1() const { return ___invoke_impl_1; } inline intptr_t* get_address_of_invoke_impl_1() { return &___invoke_impl_1; } inline void set_invoke_impl_1(intptr_t value) { ___invoke_impl_1 = value; } inline static int32_t get_offset_of_m_target_2() { return static_cast<int32_t>(offsetof(Delegate_t, ___m_target_2)); } inline RuntimeObject * get_m_target_2() const { return ___m_target_2; } inline RuntimeObject ** get_address_of_m_target_2() { return &___m_target_2; } inline void set_m_target_2(RuntimeObject * value) { ___m_target_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_target_2), (void*)value); } inline static int32_t get_offset_of_method_3() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_3)); } inline intptr_t get_method_3() const { return ___method_3; } inline intptr_t* get_address_of_method_3() { return &___method_3; } inline void set_method_3(intptr_t value) { ___method_3 = value; } inline static int32_t get_offset_of_delegate_trampoline_4() { return static_cast<int32_t>(offsetof(Delegate_t, ___delegate_trampoline_4)); } inline intptr_t get_delegate_trampoline_4() const { return ___delegate_trampoline_4; } inline intptr_t* get_address_of_delegate_trampoline_4() { return &___delegate_trampoline_4; } inline void set_delegate_trampoline_4(intptr_t value) { ___delegate_trampoline_4 = value; } inline static int32_t get_offset_of_extra_arg_5() { return static_cast<int32_t>(offsetof(Delegate_t, ___extra_arg_5)); } inline intptr_t get_extra_arg_5() const { return ___extra_arg_5; } inline intptr_t* get_address_of_extra_arg_5() { return &___extra_arg_5; } inline void set_extra_arg_5(intptr_t value) { ___extra_arg_5 = value; } inline static int32_t get_offset_of_method_code_6() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_code_6)); } inline intptr_t get_method_code_6() const { return ___method_code_6; } inline intptr_t* get_address_of_method_code_6() { return &___method_code_6; } inline void set_method_code_6(intptr_t value) { ___method_code_6 = value; } inline static int32_t get_offset_of_method_info_7() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_info_7)); } inline MethodInfo_t * get_method_info_7() const { return ___method_info_7; } inline MethodInfo_t ** get_address_of_method_info_7() { return &___method_info_7; } inline void set_method_info_7(MethodInfo_t * value) { ___method_info_7 = value; Il2CppCodeGenWriteBarrier((void**)(&___method_info_7), (void*)value); } inline static int32_t get_offset_of_original_method_info_8() { return static_cast<int32_t>(offsetof(Delegate_t, ___original_method_info_8)); } inline MethodInfo_t * get_original_method_info_8() const { return ___original_method_info_8; } inline MethodInfo_t ** get_address_of_original_method_info_8() { return &___original_method_info_8; } inline void set_original_method_info_8(MethodInfo_t * value) { ___original_method_info_8 = value; Il2CppCodeGenWriteBarrier((void**)(&___original_method_info_8), (void*)value); } inline static int32_t get_offset_of_data_9() { return static_cast<int32_t>(offsetof(Delegate_t, ___data_9)); } inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * get_data_9() const { return ___data_9; } inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE ** get_address_of_data_9() { return &___data_9; } inline void set_data_9(DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * value) { ___data_9 = value; Il2CppCodeGenWriteBarrier((void**)(&___data_9), (void*)value); } inline static int32_t get_offset_of_method_is_virtual_10() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_is_virtual_10)); } inline bool get_method_is_virtual_10() const { return ___method_is_virtual_10; } inline bool* get_address_of_method_is_virtual_10() { return &___method_is_virtual_10; } inline void set_method_is_virtual_10(bool value) { ___method_is_virtual_10 = value; } }; // Native definition for P/Invoke marshalling of System.Delegate struct Delegate_t_marshaled_pinvoke { intptr_t ___method_ptr_0; intptr_t ___invoke_impl_1; Il2CppIUnknown* ___m_target_2; intptr_t ___method_3; intptr_t ___delegate_trampoline_4; intptr_t ___extra_arg_5; intptr_t ___method_code_6; MethodInfo_t * ___method_info_7; MethodInfo_t * ___original_method_info_8; DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9; int32_t ___method_is_virtual_10; }; // Native definition for COM marshalling of System.Delegate struct Delegate_t_marshaled_com { intptr_t ___method_ptr_0; intptr_t ___invoke_impl_1; Il2CppIUnknown* ___m_target_2; intptr_t ___method_3; intptr_t ___delegate_trampoline_4; intptr_t ___extra_arg_5; intptr_t ___method_code_6; MethodInfo_t * ___method_info_7; MethodInfo_t * ___original_method_info_8; DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9; int32_t ___method_is_virtual_10; }; // System.MidpointRounding struct MidpointRounding_t458D56BA077AD42C4E857EB00CF6E8AC43761409 { public: // System.Int32 System.MidpointRounding::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(MidpointRounding_t458D56BA077AD42C4E857EB00CF6E8AC43761409, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // UnityEngine.FontStyle struct FontStyle_t273973EBB1F40C2381F6D60AB957149DE5720CF3 { public: // System.Int32 UnityEngine.FontStyle::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(FontStyle_t273973EBB1F40C2381F6D60AB957149DE5720CF3, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // UnityEngine.HorizontalWrapMode struct HorizontalWrapMode_t56D876281F814EC1AF0C21A34E20BBF4BEEA302C { public: // System.Int32 UnityEngine.HorizontalWrapMode::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(HorizontalWrapMode_t56D876281F814EC1AF0C21A34E20BBF4BEEA302C, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // UnityEngine.Object struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 : public RuntimeObject { public: // System.IntPtr UnityEngine.Object::m_CachedPtr intptr_t ___m_CachedPtr_0; public: inline static int32_t get_offset_of_m_CachedPtr_0() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0, ___m_CachedPtr_0)); } inline intptr_t get_m_CachedPtr_0() const { return ___m_CachedPtr_0; } inline intptr_t* get_address_of_m_CachedPtr_0() { return &___m_CachedPtr_0; } inline void set_m_CachedPtr_0(intptr_t value) { ___m_CachedPtr_0 = value; } }; struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields { public: // System.Int32 UnityEngine.Object::OffsetOfInstanceIDInCPlusPlusObject int32_t ___OffsetOfInstanceIDInCPlusPlusObject_1; public: inline static int32_t get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields, ___OffsetOfInstanceIDInCPlusPlusObject_1)); } inline int32_t get_OffsetOfInstanceIDInCPlusPlusObject_1() const { return ___OffsetOfInstanceIDInCPlusPlusObject_1; } inline int32_t* get_address_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return &___OffsetOfInstanceIDInCPlusPlusObject_1; } inline void set_OffsetOfInstanceIDInCPlusPlusObject_1(int32_t value) { ___OffsetOfInstanceIDInCPlusPlusObject_1 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.Object struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke { intptr_t ___m_CachedPtr_0; }; // Native definition for COM marshalling of UnityEngine.Object struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com { intptr_t ___m_CachedPtr_0; }; // UnityEngine.TextAnchor struct TextAnchor_tEC19034D476659A5E05366C63564F34DD30E7C57 { public: // System.Int32 UnityEngine.TextAnchor::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(TextAnchor_tEC19034D476659A5E05366C63564F34DD30E7C57, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // UnityEngine.TextGenerationError struct TextGenerationError_t7D5BA12E3120623131293E20A1120847377A2524 { public: // System.Int32 UnityEngine.TextGenerationError::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(TextGenerationError_t7D5BA12E3120623131293E20A1120847377A2524, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // UnityEngine.UICharInfo struct UICharInfo_tB4C92043A686A600D36A92E3108F173C499E318A { public: // UnityEngine.Vector2 UnityEngine.UICharInfo::cursorPos Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___cursorPos_0; // System.Single UnityEngine.UICharInfo::charWidth float ___charWidth_1; public: inline static int32_t get_offset_of_cursorPos_0() { return static_cast<int32_t>(offsetof(UICharInfo_tB4C92043A686A600D36A92E3108F173C499E318A, ___cursorPos_0)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_cursorPos_0() const { return ___cursorPos_0; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_cursorPos_0() { return &___cursorPos_0; } inline void set_cursorPos_0(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___cursorPos_0 = value; } inline static int32_t get_offset_of_charWidth_1() { return static_cast<int32_t>(offsetof(UICharInfo_tB4C92043A686A600D36A92E3108F173C499E318A, ___charWidth_1)); } inline float get_charWidth_1() const { return ___charWidth_1; } inline float* get_address_of_charWidth_1() { return &___charWidth_1; } inline void set_charWidth_1(float value) { ___charWidth_1 = value; } }; // UnityEngine.UIVertex struct UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 { public: // UnityEngine.Vector3 UnityEngine.UIVertex::position Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___position_0; // UnityEngine.Vector3 UnityEngine.UIVertex::normal Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___normal_1; // UnityEngine.Vector4 UnityEngine.UIVertex::tangent Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___tangent_2; // UnityEngine.Color32 UnityEngine.UIVertex::color Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 ___color_3; // UnityEngine.Vector2 UnityEngine.UIVertex::uv0 Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___uv0_4; // UnityEngine.Vector2 UnityEngine.UIVertex::uv1 Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___uv1_5; // UnityEngine.Vector2 UnityEngine.UIVertex::uv2 Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___uv2_6; // UnityEngine.Vector2 UnityEngine.UIVertex::uv3 Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___uv3_7; public: inline static int32_t get_offset_of_position_0() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___position_0)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_position_0() const { return ___position_0; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_position_0() { return &___position_0; } inline void set_position_0(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___position_0 = value; } inline static int32_t get_offset_of_normal_1() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___normal_1)); } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_normal_1() const { return ___normal_1; } inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_normal_1() { return &___normal_1; } inline void set_normal_1(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value) { ___normal_1 = value; } inline static int32_t get_offset_of_tangent_2() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___tangent_2)); } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_tangent_2() const { return ___tangent_2; } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_tangent_2() { return &___tangent_2; } inline void set_tangent_2(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value) { ___tangent_2 = value; } inline static int32_t get_offset_of_color_3() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___color_3)); } inline Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 get_color_3() const { return ___color_3; } inline Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 * get_address_of_color_3() { return &___color_3; } inline void set_color_3(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 value) { ___color_3 = value; } inline static int32_t get_offset_of_uv0_4() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___uv0_4)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_uv0_4() const { return ___uv0_4; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_uv0_4() { return &___uv0_4; } inline void set_uv0_4(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___uv0_4 = value; } inline static int32_t get_offset_of_uv1_5() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___uv1_5)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_uv1_5() const { return ___uv1_5; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_uv1_5() { return &___uv1_5; } inline void set_uv1_5(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___uv1_5 = value; } inline static int32_t get_offset_of_uv2_6() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___uv2_6)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_uv2_6() const { return ___uv2_6; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_uv2_6() { return &___uv2_6; } inline void set_uv2_6(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___uv2_6 = value; } inline static int32_t get_offset_of_uv3_7() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___uv3_7)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_uv3_7() const { return ___uv3_7; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_uv3_7() { return &___uv3_7; } inline void set_uv3_7(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___uv3_7 = value; } }; struct UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields { public: // UnityEngine.Color32 UnityEngine.UIVertex::s_DefaultColor Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 ___s_DefaultColor_8; // UnityEngine.Vector4 UnityEngine.UIVertex::s_DefaultTangent Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___s_DefaultTangent_9; // UnityEngine.UIVertex UnityEngine.UIVertex::simpleVert UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 ___simpleVert_10; public: inline static int32_t get_offset_of_s_DefaultColor_8() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields, ___s_DefaultColor_8)); } inline Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 get_s_DefaultColor_8() const { return ___s_DefaultColor_8; } inline Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 * get_address_of_s_DefaultColor_8() { return &___s_DefaultColor_8; } inline void set_s_DefaultColor_8(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 value) { ___s_DefaultColor_8 = value; } inline static int32_t get_offset_of_s_DefaultTangent_9() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields, ___s_DefaultTangent_9)); } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_s_DefaultTangent_9() const { return ___s_DefaultTangent_9; } inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_s_DefaultTangent_9() { return &___s_DefaultTangent_9; } inline void set_s_DefaultTangent_9(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value) { ___s_DefaultTangent_9 = value; } inline static int32_t get_offset_of_simpleVert_10() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields, ___simpleVert_10)); } inline UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 get_simpleVert_10() const { return ___simpleVert_10; } inline UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 * get_address_of_simpleVert_10() { return &___simpleVert_10; } inline void set_simpleVert_10(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 value) { ___simpleVert_10 = value; } }; // UnityEngine.VerticalWrapMode struct VerticalWrapMode_tD909C5B2F6A25AE3797BC71373196D850FC845E9 { public: // System.Int32 UnityEngine.VerticalWrapMode::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(VerticalWrapMode_tD909C5B2F6A25AE3797BC71373196D850FC845E9, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // System.MulticastDelegate struct MulticastDelegate_t : public Delegate_t { public: // System.Delegate[] System.MulticastDelegate::delegates DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* ___delegates_11; public: inline static int32_t get_offset_of_delegates_11() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___delegates_11)); } inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* get_delegates_11() const { return ___delegates_11; } inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86** get_address_of_delegates_11() { return &___delegates_11; } inline void set_delegates_11(DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* value) { ___delegates_11 = value; Il2CppCodeGenWriteBarrier((void**)(&___delegates_11), (void*)value); } }; // Native definition for P/Invoke marshalling of System.MulticastDelegate struct MulticastDelegate_t_marshaled_pinvoke : public Delegate_t_marshaled_pinvoke { Delegate_t_marshaled_pinvoke** ___delegates_11; }; // Native definition for COM marshalling of System.MulticastDelegate struct MulticastDelegate_t_marshaled_com : public Delegate_t_marshaled_com { Delegate_t_marshaled_com** ___delegates_11; }; // UnityEngine.CharacterInfo struct CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313 { public: // System.Int32 UnityEngine.CharacterInfo::index int32_t ___index_0; // UnityEngine.Rect UnityEngine.CharacterInfo::uv Rect_t35B976DE901B5423C11705E156938EA27AB402CE ___uv_1; // UnityEngine.Rect UnityEngine.CharacterInfo::vert Rect_t35B976DE901B5423C11705E156938EA27AB402CE ___vert_2; // System.Single UnityEngine.CharacterInfo::width float ___width_3; // System.Int32 UnityEngine.CharacterInfo::size int32_t ___size_4; // UnityEngine.FontStyle UnityEngine.CharacterInfo::style int32_t ___style_5; // System.Boolean UnityEngine.CharacterInfo::flipped bool ___flipped_6; public: inline static int32_t get_offset_of_index_0() { return static_cast<int32_t>(offsetof(CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313, ___index_0)); } inline int32_t get_index_0() const { return ___index_0; } inline int32_t* get_address_of_index_0() { return &___index_0; } inline void set_index_0(int32_t value) { ___index_0 = value; } inline static int32_t get_offset_of_uv_1() { return static_cast<int32_t>(offsetof(CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313, ___uv_1)); } inline Rect_t35B976DE901B5423C11705E156938EA27AB402CE get_uv_1() const { return ___uv_1; } inline Rect_t35B976DE901B5423C11705E156938EA27AB402CE * get_address_of_uv_1() { return &___uv_1; } inline void set_uv_1(Rect_t35B976DE901B5423C11705E156938EA27AB402CE value) { ___uv_1 = value; } inline static int32_t get_offset_of_vert_2() { return static_cast<int32_t>(offsetof(CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313, ___vert_2)); } inline Rect_t35B976DE901B5423C11705E156938EA27AB402CE get_vert_2() const { return ___vert_2; } inline Rect_t35B976DE901B5423C11705E156938EA27AB402CE * get_address_of_vert_2() { return &___vert_2; } inline void set_vert_2(Rect_t35B976DE901B5423C11705E156938EA27AB402CE value) { ___vert_2 = value; } inline static int32_t get_offset_of_width_3() { return static_cast<int32_t>(offsetof(CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313, ___width_3)); } inline float get_width_3() const { return ___width_3; } inline float* get_address_of_width_3() { return &___width_3; } inline void set_width_3(float value) { ___width_3 = value; } inline static int32_t get_offset_of_size_4() { return static_cast<int32_t>(offsetof(CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313, ___size_4)); } inline int32_t get_size_4() const { return ___size_4; } inline int32_t* get_address_of_size_4() { return &___size_4; } inline void set_size_4(int32_t value) { ___size_4 = value; } inline static int32_t get_offset_of_style_5() { return static_cast<int32_t>(offsetof(CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313, ___style_5)); } inline int32_t get_style_5() const { return ___style_5; } inline int32_t* get_address_of_style_5() { return &___style_5; } inline void set_style_5(int32_t value) { ___style_5 = value; } inline static int32_t get_offset_of_flipped_6() { return static_cast<int32_t>(offsetof(CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313, ___flipped_6)); } inline bool get_flipped_6() const { return ___flipped_6; } inline bool* get_address_of_flipped_6() { return &___flipped_6; } inline void set_flipped_6(bool value) { ___flipped_6 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.CharacterInfo struct CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshaled_pinvoke { int32_t ___index_0; Rect_t35B976DE901B5423C11705E156938EA27AB402CE ___uv_1; Rect_t35B976DE901B5423C11705E156938EA27AB402CE ___vert_2; float ___width_3; int32_t ___size_4; int32_t ___style_5; int32_t ___flipped_6; }; // Native definition for COM marshalling of UnityEngine.CharacterInfo struct CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshaled_com { int32_t ___index_0; Rect_t35B976DE901B5423C11705E156938EA27AB402CE ___uv_1; Rect_t35B976DE901B5423C11705E156938EA27AB402CE ___vert_2; float ___width_3; int32_t ___size_4; int32_t ___style_5; int32_t ___flipped_6; }; // UnityEngine.Component struct Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 { public: public: }; // UnityEngine.Font struct Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 { public: // UnityEngine.Font_FontTextureRebuildCallback UnityEngine.Font::m_FontTextureRebuildCallback FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * ___m_FontTextureRebuildCallback_5; public: inline static int32_t get_offset_of_m_FontTextureRebuildCallback_5() { return static_cast<int32_t>(offsetof(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26, ___m_FontTextureRebuildCallback_5)); } inline FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * get_m_FontTextureRebuildCallback_5() const { return ___m_FontTextureRebuildCallback_5; } inline FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C ** get_address_of_m_FontTextureRebuildCallback_5() { return &___m_FontTextureRebuildCallback_5; } inline void set_m_FontTextureRebuildCallback_5(FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * value) { ___m_FontTextureRebuildCallback_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_FontTextureRebuildCallback_5), (void*)value); } }; struct Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields { public: // System.Action`1<UnityEngine.Font> UnityEngine.Font::textureRebuilt Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * ___textureRebuilt_4; public: inline static int32_t get_offset_of_textureRebuilt_4() { return static_cast<int32_t>(offsetof(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields, ___textureRebuilt_4)); } inline Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * get_textureRebuilt_4() const { return ___textureRebuilt_4; } inline Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C ** get_address_of_textureRebuilt_4() { return &___textureRebuilt_4; } inline void set_textureRebuilt_4(Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * value) { ___textureRebuilt_4 = value; Il2CppCodeGenWriteBarrier((void**)(&___textureRebuilt_4), (void*)value); } }; // UnityEngine.GameObject struct GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 { public: public: }; // UnityEngine.Material struct Material_tF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 { public: public: }; // UnityEngine.TextGenerationSettings struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 { public: // UnityEngine.Font UnityEngine.TextGenerationSettings::font Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font_0; // UnityEngine.Color UnityEngine.TextGenerationSettings::color Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color_1; // System.Int32 UnityEngine.TextGenerationSettings::fontSize int32_t ___fontSize_2; // System.Single UnityEngine.TextGenerationSettings::lineSpacing float ___lineSpacing_3; // System.Boolean UnityEngine.TextGenerationSettings::richText bool ___richText_4; // System.Single UnityEngine.TextGenerationSettings::scaleFactor float ___scaleFactor_5; // UnityEngine.FontStyle UnityEngine.TextGenerationSettings::fontStyle int32_t ___fontStyle_6; // UnityEngine.TextAnchor UnityEngine.TextGenerationSettings::textAnchor int32_t ___textAnchor_7; // System.Boolean UnityEngine.TextGenerationSettings::alignByGeometry bool ___alignByGeometry_8; // System.Boolean UnityEngine.TextGenerationSettings::resizeTextForBestFit bool ___resizeTextForBestFit_9; // System.Int32 UnityEngine.TextGenerationSettings::resizeTextMinSize int32_t ___resizeTextMinSize_10; // System.Int32 UnityEngine.TextGenerationSettings::resizeTextMaxSize int32_t ___resizeTextMaxSize_11; // System.Boolean UnityEngine.TextGenerationSettings::updateBounds bool ___updateBounds_12; // UnityEngine.VerticalWrapMode UnityEngine.TextGenerationSettings::verticalOverflow int32_t ___verticalOverflow_13; // UnityEngine.HorizontalWrapMode UnityEngine.TextGenerationSettings::horizontalOverflow int32_t ___horizontalOverflow_14; // UnityEngine.Vector2 UnityEngine.TextGenerationSettings::generationExtents Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___generationExtents_15; // UnityEngine.Vector2 UnityEngine.TextGenerationSettings::pivot Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___pivot_16; // System.Boolean UnityEngine.TextGenerationSettings::generateOutOfBounds bool ___generateOutOfBounds_17; public: inline static int32_t get_offset_of_font_0() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___font_0)); } inline Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * get_font_0() const { return ___font_0; } inline Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 ** get_address_of_font_0() { return &___font_0; } inline void set_font_0(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * value) { ___font_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___font_0), (void*)value); } inline static int32_t get_offset_of_color_1() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___color_1)); } inline Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 get_color_1() const { return ___color_1; } inline Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * get_address_of_color_1() { return &___color_1; } inline void set_color_1(Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 value) { ___color_1 = value; } inline static int32_t get_offset_of_fontSize_2() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___fontSize_2)); } inline int32_t get_fontSize_2() const { return ___fontSize_2; } inline int32_t* get_address_of_fontSize_2() { return &___fontSize_2; } inline void set_fontSize_2(int32_t value) { ___fontSize_2 = value; } inline static int32_t get_offset_of_lineSpacing_3() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___lineSpacing_3)); } inline float get_lineSpacing_3() const { return ___lineSpacing_3; } inline float* get_address_of_lineSpacing_3() { return &___lineSpacing_3; } inline void set_lineSpacing_3(float value) { ___lineSpacing_3 = value; } inline static int32_t get_offset_of_richText_4() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___richText_4)); } inline bool get_richText_4() const { return ___richText_4; } inline bool* get_address_of_richText_4() { return &___richText_4; } inline void set_richText_4(bool value) { ___richText_4 = value; } inline static int32_t get_offset_of_scaleFactor_5() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___scaleFactor_5)); } inline float get_scaleFactor_5() const { return ___scaleFactor_5; } inline float* get_address_of_scaleFactor_5() { return &___scaleFactor_5; } inline void set_scaleFactor_5(float value) { ___scaleFactor_5 = value; } inline static int32_t get_offset_of_fontStyle_6() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___fontStyle_6)); } inline int32_t get_fontStyle_6() const { return ___fontStyle_6; } inline int32_t* get_address_of_fontStyle_6() { return &___fontStyle_6; } inline void set_fontStyle_6(int32_t value) { ___fontStyle_6 = value; } inline static int32_t get_offset_of_textAnchor_7() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___textAnchor_7)); } inline int32_t get_textAnchor_7() const { return ___textAnchor_7; } inline int32_t* get_address_of_textAnchor_7() { return &___textAnchor_7; } inline void set_textAnchor_7(int32_t value) { ___textAnchor_7 = value; } inline static int32_t get_offset_of_alignByGeometry_8() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___alignByGeometry_8)); } inline bool get_alignByGeometry_8() const { return ___alignByGeometry_8; } inline bool* get_address_of_alignByGeometry_8() { return &___alignByGeometry_8; } inline void set_alignByGeometry_8(bool value) { ___alignByGeometry_8 = value; } inline static int32_t get_offset_of_resizeTextForBestFit_9() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___resizeTextForBestFit_9)); } inline bool get_resizeTextForBestFit_9() const { return ___resizeTextForBestFit_9; } inline bool* get_address_of_resizeTextForBestFit_9() { return &___resizeTextForBestFit_9; } inline void set_resizeTextForBestFit_9(bool value) { ___resizeTextForBestFit_9 = value; } inline static int32_t get_offset_of_resizeTextMinSize_10() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___resizeTextMinSize_10)); } inline int32_t get_resizeTextMinSize_10() const { return ___resizeTextMinSize_10; } inline int32_t* get_address_of_resizeTextMinSize_10() { return &___resizeTextMinSize_10; } inline void set_resizeTextMinSize_10(int32_t value) { ___resizeTextMinSize_10 = value; } inline static int32_t get_offset_of_resizeTextMaxSize_11() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___resizeTextMaxSize_11)); } inline int32_t get_resizeTextMaxSize_11() const { return ___resizeTextMaxSize_11; } inline int32_t* get_address_of_resizeTextMaxSize_11() { return &___resizeTextMaxSize_11; } inline void set_resizeTextMaxSize_11(int32_t value) { ___resizeTextMaxSize_11 = value; } inline static int32_t get_offset_of_updateBounds_12() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___updateBounds_12)); } inline bool get_updateBounds_12() const { return ___updateBounds_12; } inline bool* get_address_of_updateBounds_12() { return &___updateBounds_12; } inline void set_updateBounds_12(bool value) { ___updateBounds_12 = value; } inline static int32_t get_offset_of_verticalOverflow_13() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___verticalOverflow_13)); } inline int32_t get_verticalOverflow_13() const { return ___verticalOverflow_13; } inline int32_t* get_address_of_verticalOverflow_13() { return &___verticalOverflow_13; } inline void set_verticalOverflow_13(int32_t value) { ___verticalOverflow_13 = value; } inline static int32_t get_offset_of_horizontalOverflow_14() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___horizontalOverflow_14)); } inline int32_t get_horizontalOverflow_14() const { return ___horizontalOverflow_14; } inline int32_t* get_address_of_horizontalOverflow_14() { return &___horizontalOverflow_14; } inline void set_horizontalOverflow_14(int32_t value) { ___horizontalOverflow_14 = value; } inline static int32_t get_offset_of_generationExtents_15() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___generationExtents_15)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_generationExtents_15() const { return ___generationExtents_15; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_generationExtents_15() { return &___generationExtents_15; } inline void set_generationExtents_15(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___generationExtents_15 = value; } inline static int32_t get_offset_of_pivot_16() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___pivot_16)); } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_pivot_16() const { return ___pivot_16; } inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_pivot_16() { return &___pivot_16; } inline void set_pivot_16(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value) { ___pivot_16 = value; } inline static int32_t get_offset_of_generateOutOfBounds_17() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___generateOutOfBounds_17)); } inline bool get_generateOutOfBounds_17() const { return ___generateOutOfBounds_17; } inline bool* get_address_of_generateOutOfBounds_17() { return &___generateOutOfBounds_17; } inline void set_generateOutOfBounds_17(bool value) { ___generateOutOfBounds_17 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.TextGenerationSettings struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke { Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font_0; Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color_1; int32_t ___fontSize_2; float ___lineSpacing_3; int32_t ___richText_4; float ___scaleFactor_5; int32_t ___fontStyle_6; int32_t ___textAnchor_7; int32_t ___alignByGeometry_8; int32_t ___resizeTextForBestFit_9; int32_t ___resizeTextMinSize_10; int32_t ___resizeTextMaxSize_11; int32_t ___updateBounds_12; int32_t ___verticalOverflow_13; int32_t ___horizontalOverflow_14; Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___generationExtents_15; Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___pivot_16; int32_t ___generateOutOfBounds_17; }; // Native definition for COM marshalling of UnityEngine.TextGenerationSettings struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com { Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font_0; Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color_1; int32_t ___fontSize_2; float ___lineSpacing_3; int32_t ___richText_4; float ___scaleFactor_5; int32_t ___fontStyle_6; int32_t ___textAnchor_7; int32_t ___alignByGeometry_8; int32_t ___resizeTextForBestFit_9; int32_t ___resizeTextMinSize_10; int32_t ___resizeTextMaxSize_11; int32_t ___updateBounds_12; int32_t ___verticalOverflow_13; int32_t ___horizontalOverflow_14; Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___generationExtents_15; Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___pivot_16; int32_t ___generateOutOfBounds_17; }; // System.Action`1<UnityEngine.Font> struct Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C : public MulticastDelegate_t { public: public: }; // System.AsyncCallback struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 : public MulticastDelegate_t { public: public: }; // UnityEngine.Font_FontTextureRebuildCallback struct FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C : public MulticastDelegate_t { public: public: }; // UnityEngine.TextGenerator struct TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 : public RuntimeObject { public: // System.IntPtr UnityEngine.TextGenerator::m_Ptr intptr_t ___m_Ptr_0; // System.String UnityEngine.TextGenerator::m_LastString String_t* ___m_LastString_1; // UnityEngine.TextGenerationSettings UnityEngine.TextGenerator::m_LastSettings TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___m_LastSettings_2; // System.Boolean UnityEngine.TextGenerator::m_HasGenerated bool ___m_HasGenerated_3; // UnityEngine.TextGenerationError UnityEngine.TextGenerator::m_LastValid int32_t ___m_LastValid_4; // System.Collections.Generic.List`1<UnityEngine.UIVertex> UnityEngine.TextGenerator::m_Verts List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * ___m_Verts_5; // System.Collections.Generic.List`1<UnityEngine.UICharInfo> UnityEngine.TextGenerator::m_Characters List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * ___m_Characters_6; // System.Collections.Generic.List`1<UnityEngine.UILineInfo> UnityEngine.TextGenerator::m_Lines List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * ___m_Lines_7; // System.Boolean UnityEngine.TextGenerator::m_CachedVerts bool ___m_CachedVerts_8; // System.Boolean UnityEngine.TextGenerator::m_CachedCharacters bool ___m_CachedCharacters_9; // System.Boolean UnityEngine.TextGenerator::m_CachedLines bool ___m_CachedLines_10; public: inline static int32_t get_offset_of_m_Ptr_0() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_Ptr_0)); } inline intptr_t get_m_Ptr_0() const { return ___m_Ptr_0; } inline intptr_t* get_address_of_m_Ptr_0() { return &___m_Ptr_0; } inline void set_m_Ptr_0(intptr_t value) { ___m_Ptr_0 = value; } inline static int32_t get_offset_of_m_LastString_1() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_LastString_1)); } inline String_t* get_m_LastString_1() const { return ___m_LastString_1; } inline String_t** get_address_of_m_LastString_1() { return &___m_LastString_1; } inline void set_m_LastString_1(String_t* value) { ___m_LastString_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_LastString_1), (void*)value); } inline static int32_t get_offset_of_m_LastSettings_2() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_LastSettings_2)); } inline TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 get_m_LastSettings_2() const { return ___m_LastSettings_2; } inline TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * get_address_of_m_LastSettings_2() { return &___m_LastSettings_2; } inline void set_m_LastSettings_2(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 value) { ___m_LastSettings_2 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___m_LastSettings_2))->___font_0), (void*)NULL); } inline static int32_t get_offset_of_m_HasGenerated_3() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_HasGenerated_3)); } inline bool get_m_HasGenerated_3() const { return ___m_HasGenerated_3; } inline bool* get_address_of_m_HasGenerated_3() { return &___m_HasGenerated_3; } inline void set_m_HasGenerated_3(bool value) { ___m_HasGenerated_3 = value; } inline static int32_t get_offset_of_m_LastValid_4() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_LastValid_4)); } inline int32_t get_m_LastValid_4() const { return ___m_LastValid_4; } inline int32_t* get_address_of_m_LastValid_4() { return &___m_LastValid_4; } inline void set_m_LastValid_4(int32_t value) { ___m_LastValid_4 = value; } inline static int32_t get_offset_of_m_Verts_5() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_Verts_5)); } inline List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * get_m_Verts_5() const { return ___m_Verts_5; } inline List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 ** get_address_of_m_Verts_5() { return &___m_Verts_5; } inline void set_m_Verts_5(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * value) { ___m_Verts_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Verts_5), (void*)value); } inline static int32_t get_offset_of_m_Characters_6() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_Characters_6)); } inline List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * get_m_Characters_6() const { return ___m_Characters_6; } inline List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E ** get_address_of_m_Characters_6() { return &___m_Characters_6; } inline void set_m_Characters_6(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * value) { ___m_Characters_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Characters_6), (void*)value); } inline static int32_t get_offset_of_m_Lines_7() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_Lines_7)); } inline List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * get_m_Lines_7() const { return ___m_Lines_7; } inline List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 ** get_address_of_m_Lines_7() { return &___m_Lines_7; } inline void set_m_Lines_7(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * value) { ___m_Lines_7 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Lines_7), (void*)value); } inline static int32_t get_offset_of_m_CachedVerts_8() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_CachedVerts_8)); } inline bool get_m_CachedVerts_8() const { return ___m_CachedVerts_8; } inline bool* get_address_of_m_CachedVerts_8() { return &___m_CachedVerts_8; } inline void set_m_CachedVerts_8(bool value) { ___m_CachedVerts_8 = value; } inline static int32_t get_offset_of_m_CachedCharacters_9() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_CachedCharacters_9)); } inline bool get_m_CachedCharacters_9() const { return ___m_CachedCharacters_9; } inline bool* get_address_of_m_CachedCharacters_9() { return &___m_CachedCharacters_9; } inline void set_m_CachedCharacters_9(bool value) { ___m_CachedCharacters_9 = value; } inline static int32_t get_offset_of_m_CachedLines_10() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_CachedLines_10)); } inline bool get_m_CachedLines_10() const { return ___m_CachedLines_10; } inline bool* get_address_of_m_CachedLines_10() { return &___m_CachedLines_10; } inline void set_m_CachedLines_10(bool value) { ___m_CachedLines_10 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.TextGenerator struct TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_pinvoke { intptr_t ___m_Ptr_0; char* ___m_LastString_1; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke ___m_LastSettings_2; int32_t ___m_HasGenerated_3; int32_t ___m_LastValid_4; List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * ___m_Verts_5; List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * ___m_Characters_6; List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * ___m_Lines_7; int32_t ___m_CachedVerts_8; int32_t ___m_CachedCharacters_9; int32_t ___m_CachedLines_10; }; // Native definition for COM marshalling of UnityEngine.TextGenerator struct TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_com { intptr_t ___m_Ptr_0; Il2CppChar* ___m_LastString_1; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com ___m_LastSettings_2; int32_t ___m_HasGenerated_3; int32_t ___m_LastValid_4; List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * ___m_Verts_5; List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * ___m_Characters_6; List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * ___m_Lines_7; int32_t ___m_CachedVerts_8; int32_t ___m_CachedCharacters_9; int32_t ___m_CachedLines_10; }; // UnityEngine.TextMesh struct TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A : public Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif // System.Delegate[] struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86 : public RuntimeArray { public: ALIGN_FIELD (8) Delegate_t * m_Items[1]; public: inline Delegate_t * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Delegate_t ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Delegate_t * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value); } inline Delegate_t * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Delegate_t ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Delegate_t * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value); } }; // System.Object[] struct ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A : public RuntimeArray { public: ALIGN_FIELD (8) RuntimeObject * m_Items[1]; public: inline RuntimeObject * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline RuntimeObject ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, RuntimeObject * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value); } inline RuntimeObject * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline RuntimeObject ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, RuntimeObject * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value); } }; IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled); IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke_back(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled); IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke_cleanup(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled); IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled); IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com_back(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled); IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com_cleanup(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled); // System.Void System.Action`1<System.Object>::Invoke(!0) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Action_1_Invoke_mB86FC1B303E77C41ED0E94FC3592A9CF8DA571D5_gshared (Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method); // System.Void System.Collections.Generic.List`1<UnityEngine.UIVertex>::.ctor(System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8_gshared (List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * __this, int32_t ___capacity0, const RuntimeMethod* method); // System.Void System.Collections.Generic.List`1<UnityEngine.UICharInfo>::.ctor(System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71_gshared (List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * __this, int32_t ___capacity0, const RuntimeMethod* method); // System.Void System.Collections.Generic.List`1<UnityEngine.UILineInfo>::.ctor(System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD_gshared (List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * __this, int32_t ___capacity0, const RuntimeMethod* method); // System.Double System.Math::Round(System.Double,System.MidpointRounding) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR double Math_Round_m7EE608A0B3B8C109464FF045B96657431387DC83 (double ___value0, int32_t ___mode1, const RuntimeMethod* method); // System.Int32 UnityEngine.CharacterInfo::get_advance() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t CharacterInfo_get_advance_mCCD27183A01AB4F83305230D5AB39AE6F0E4779C (CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313 * __this, const RuntimeMethod* method); // System.Delegate System.Delegate::Combine(System.Delegate,System.Delegate) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Delegate_t * Delegate_Combine_mC25D2F7DECAFBA6D9A2F9EBA8A77063F0658ECF1 (Delegate_t * ___a0, Delegate_t * ___b1, const RuntimeMethod* method); // System.Delegate System.Delegate::Remove(System.Delegate,System.Delegate) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Delegate_t * Delegate_Remove_m0B0DB7D1B3AF96B71AFAA72BA0EFE32FBBC2932D (Delegate_t * ___source0, Delegate_t * ___value1, const RuntimeMethod* method); // System.Void UnityEngine.Object::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object__ctor_m091EBAEBC7919B0391ABDAFB7389ADC12206525B (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * __this, const RuntimeMethod* method); // System.Void UnityEngine.Font::Internal_CreateFont(UnityEngine.Font,System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Font_Internal_CreateFont_m1B4B34CFCE6782196D19DB5020CB4C4CEFFFC05E (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___self0, String_t* ___name1, const RuntimeMethod* method); // System.Void System.Action`1<UnityEngine.Font>::Invoke(!0) inline void Action_1_Invoke_mC307FDDD4FEA6818EE9A27D962C2C512B835DAEB (Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * __this, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___obj0, const RuntimeMethod* method) { (( void (*) (Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *, const RuntimeMethod*))Action_1_Invoke_mB86FC1B303E77C41ED0E94FC3592A9CF8DA571D5_gshared)(__this, ___obj0, method); } // System.Void UnityEngine.Font/FontTextureRebuildCallback::Invoke() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void FontTextureRebuildCallback_Invoke_m4E6CFDE11932BA7F129C9A2C4CAE294562B07480 (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, const RuntimeMethod* method); // System.Boolean UnityEngine.Font::HasCharacter(System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51 (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, int32_t ___c0, const RuntimeMethod* method); // System.Boolean UnityEngine.Mathf::Approximately(System.Single,System.Single) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E (float ___a0, float ___b1, const RuntimeMethod* method); // System.Boolean UnityEngine.TextGenerationSettings::CompareColors(UnityEngine.Color,UnityEngine.Color) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66 (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___left0, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___right1, const RuntimeMethod* method); // System.Boolean UnityEngine.TextGenerationSettings::CompareVector2(UnityEngine.Vector2,UnityEngine.Vector2) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___left0, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___right1, const RuntimeMethod* method); // System.Boolean UnityEngine.Object::op_Equality(UnityEngine.Object,UnityEngine.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___x0, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___y1, const RuntimeMethod* method); // System.Boolean UnityEngine.TextGenerationSettings::Equals(UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___other0, const RuntimeMethod* method); // System.Void UnityEngine.TextGenerator::.ctor(System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator__ctor_m86E01E7BB9DC1B28F04961E482ED4D7065062BCE (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, int32_t ___initialCapacity0, const RuntimeMethod* method); // System.Void System.Object::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object__ctor_m925ECA5E85CA100E3FB86A4F9E15C120E9A184C0 (RuntimeObject * __this, const RuntimeMethod* method); // System.IntPtr UnityEngine.TextGenerator::Internal_Create() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR intptr_t TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994 (const RuntimeMethod* method); // System.Void System.Collections.Generic.List`1<UnityEngine.UIVertex>::.ctor(System.Int32) inline void List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8 (List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * __this, int32_t ___capacity0, const RuntimeMethod* method) { (( void (*) (List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 *, int32_t, const RuntimeMethod*))List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8_gshared)(__this, ___capacity0, method); } // System.Void System.Collections.Generic.List`1<UnityEngine.UICharInfo>::.ctor(System.Int32) inline void List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71 (List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * __this, int32_t ___capacity0, const RuntimeMethod* method) { (( void (*) (List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E *, int32_t, const RuntimeMethod*))List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71_gshared)(__this, ___capacity0, method); } // System.Void System.Collections.Generic.List`1<UnityEngine.UILineInfo>::.ctor(System.Int32) inline void List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD (List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * __this, int32_t ___capacity0, const RuntimeMethod* method) { (( void (*) (List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 *, int32_t, const RuntimeMethod*))List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD_gshared)(__this, ___capacity0, method); } // System.Void System.Object::Finalize() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object_Finalize_m4015B7D3A44DE125C5FE34D7276CD4697C06F380 (RuntimeObject * __this, const RuntimeMethod* method); // System.Boolean System.IntPtr::op_Inequality(System.IntPtr,System.IntPtr) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool IntPtr_op_Inequality_mB4886A806009EA825EFCC60CD2A7F6EB8E273A61 (intptr_t ___value10, intptr_t ___value21, const RuntimeMethod* method); // System.Void UnityEngine.TextGenerator::Internal_Destroy(System.IntPtr) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5 (intptr_t ___ptr0, const RuntimeMethod* method); // System.Int32 UnityEngine.TextGenerator::get_characterCount() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method); // System.Boolean UnityEngine.Object::op_Inequality(UnityEngine.Object,UnityEngine.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1 (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___x0, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___y1, const RuntimeMethod* method); // System.Boolean UnityEngine.Font::get_dynamic() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, const RuntimeMethod* method); // System.String UnityEngine.Object::get_name() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* Object_get_name_mA2D400141CB3C991C87A2556429781DE961A83CE (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * __this, const RuntimeMethod* method); // System.Void UnityEngine.Debug::LogWarningFormat(UnityEngine.Object,System.String,System.Object[]) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Debug_LogWarningFormat_m4A02CCF91F3A9392F4AA93576DCE2222267E5945 (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___context0, String_t* ___format1, ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ___args2, const RuntimeMethod* method); // System.Void UnityEngine.TextGenerator::GetCharactersInternal(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___characters0, const RuntimeMethod* method); // System.Void UnityEngine.TextGenerator::GetLinesInternal(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___lines0, const RuntimeMethod* method); // System.Void UnityEngine.TextGenerator::GetVerticesInternal(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___vertices0, const RuntimeMethod* method); // System.Boolean UnityEngine.TextGenerator::Populate(System.String,UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerator_Populate_m15553808C8FA017AA1AC23D2818C30DAFD654A04 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method); // UnityEngine.Rect UnityEngine.TextGenerator::get_rectExtents() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Rect_t35B976DE901B5423C11705E156938EA27AB402CE TextGenerator_get_rectExtents_m55F6A6727406C54BEFB7628751555B7C58BEC9B1 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method); // System.Single UnityEngine.Rect::get_width() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float Rect_get_width_m54FF69FC2C086E2DC349ED091FD0D6576BFB1484 (Rect_t35B976DE901B5423C11705E156938EA27AB402CE * __this, const RuntimeMethod* method); // System.Single UnityEngine.Rect::get_height() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float Rect_get_height_m088C36990E0A255C5D7DCE36575DCE23ABB364B5 (Rect_t35B976DE901B5423C11705E156938EA27AB402CE * __this, const RuntimeMethod* method); // UnityEngine.TextGenerationError UnityEngine.TextGenerator::PopulateWithError(System.String,UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TextGenerator_PopulateWithError_m24D1DA75F0563582E228C6F4982D0913C58E1D7D (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method); // System.Void UnityEngine.Debug::LogErrorFormat(UnityEngine.Object,System.String,System.Object[]) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Debug_LogErrorFormat_m994E4759C25BF0E9DD4179C10E3979558137CCF0 (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___context0, String_t* ___format1, ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ___args2, const RuntimeMethod* method); // System.Boolean System.String::op_Equality(System.String,System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE (String_t* ___a0, String_t* ___b1, const RuntimeMethod* method); // UnityEngine.TextGenerationError UnityEngine.TextGenerator::PopulateAlways(System.String,UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TextGenerator_PopulateAlways_m8DCF389A51877975F29FAB9B6E800DFDC1E0B8DF (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method); // UnityEngine.TextGenerationSettings UnityEngine.TextGenerator::ValidatedSettings(UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 TextGenerator_ValidatedSettings_m167131680BB6CD53B929EF189520F9FCF71FB1D3 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings0, const RuntimeMethod* method); // System.Boolean UnityEngine.TextGenerator::Populate_Internal(System.String,UnityEngine.Font,UnityEngine.Color,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,UnityEngine.VerticalWrapMode,UnityEngine.HorizontalWrapMode,System.Boolean,UnityEngine.TextAnchor,UnityEngine.Vector2,UnityEngine.Vector2,System.Boolean,System.Boolean,UnityEngine.TextGenerationError&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_m42F7FED165D62BFD9C006D19A0FCE5B70C1EF92B (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___extents15, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___pivot16, bool ___generateOutOfBounds17, bool ___alignByGeometry18, int32_t* ___error19, const RuntimeMethod* method); // System.Void UnityEngine.TextGenerator::GetVertices(System.Collections.Generic.List`1<UnityEngine.UIVertex>) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetVertices_m6FA34586541514ED7396990542BDAC536C10A4F2 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * ___vertices0, const RuntimeMethod* method); // System.Void UnityEngine.TextGenerator::GetCharacters(System.Collections.Generic.List`1<UnityEngine.UICharInfo>) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetCharacters_mBB7980F2FE8BE65A906A39B5559EC54B1CEF4131 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * ___characters0, const RuntimeMethod* method); // System.Void UnityEngine.TextGenerator::GetLines(System.Collections.Generic.List`1<UnityEngine.UILineInfo>) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetLines_mC31F7918A9159908EA914D01B2E32644B046E2B5 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * ___lines0, const RuntimeMethod* method); // System.Void UnityEngine.TextGenerator::get_rectExtents_Injected(UnityEngine.Rect&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, Rect_t35B976DE901B5423C11705E156938EA27AB402CE * ___ret0, const RuntimeMethod* method); // System.Boolean UnityEngine.TextGenerator::Populate_Internal_Injected(System.String,UnityEngine.Font,UnityEngine.Color&,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,UnityEngine.TextAnchor,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.UInt32&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, float ___extentsX15, float ___extentsY16, float ___pivotX17, float ___pivotY18, bool ___generateOutOfBounds19, bool ___alignByGeometry20, uint32_t* ___error21, const RuntimeMethod* method); // System.Boolean UnityEngine.TextGenerator::Populate_Internal(System.String,UnityEngine.Font,UnityEngine.Color,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,UnityEngine.TextAnchor,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.UInt32&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_mCA54081A0855AED6EC6345265603409FE330985C (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, float ___extentsX15, float ___extentsY16, float ___pivotX17, float ___pivotY18, bool ___generateOutOfBounds19, bool ___alignByGeometry20, uint32_t* ___error21, const RuntimeMethod* method); // System.Void UnityEngine.TextMesh::get_color_Injected(UnityEngine.Color&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextMesh_get_color_Injected_m22B6B96B44E685B651AEFB28DC408AB52BA05B98 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * ___ret0, const RuntimeMethod* method); // System.Void UnityEngine.TextMesh::set_color_Injected(UnityEngine.Color&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * ___value0, const RuntimeMethod* method); // System.Void UnityEngine.Color32::.ctor(System.Byte,System.Byte,System.Byte,System.Byte) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Color32__ctor_m1AEF46FBBBE4B522E6984D081A3D158198E10AA2 (Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 * __this, uint8_t ___r0, uint8_t ___g1, uint8_t ___b2, uint8_t ___a3, const RuntimeMethod* method); // System.Void UnityEngine.Vector4::.ctor(System.Single,System.Single,System.Single,System.Single) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Vector4__ctor_m545458525879607A5392A10B175D0C19B2BC715D (Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * __this, float ___x0, float ___y1, float ___z2, float ___w3, const RuntimeMethod* method); // UnityEngine.Vector3 UnityEngine.Vector3::get_zero() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 Vector3_get_zero_m3CDDCAE94581DF3BB16C4B40A100E28E9C6649C2 (const RuntimeMethod* method); // UnityEngine.Vector3 UnityEngine.Vector3::get_back() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 Vector3_get_back_mE7EF8625637E6F8B9E6B42A6AE140777C51E02F7 (const RuntimeMethod* method); // UnityEngine.Vector2 UnityEngine.Vector2::get_zero() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector2_tA85D2DD88578276CA8A8796756458277E72D073D Vector2_get_zero_mFE0C3213BB698130D6C5247AB4B887A59074D0A8 (const RuntimeMethod* method); #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Conversion methods for marshalling of: UnityEngine.CharacterInfo IL2CPP_EXTERN_C void CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshal_pinvoke(const CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313& unmarshaled, CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshaled_pinvoke& marshaled) { marshaled.___index_0 = unmarshaled.get_index_0(); marshaled.___uv_1 = unmarshaled.get_uv_1(); marshaled.___vert_2 = unmarshaled.get_vert_2(); marshaled.___width_3 = unmarshaled.get_width_3(); marshaled.___size_4 = unmarshaled.get_size_4(); marshaled.___style_5 = unmarshaled.get_style_5(); marshaled.___flipped_6 = static_cast<int32_t>(unmarshaled.get_flipped_6()); } IL2CPP_EXTERN_C void CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshal_pinvoke_back(const CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshaled_pinvoke& marshaled, CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313& unmarshaled) { int32_t unmarshaled_index_temp_0 = 0; unmarshaled_index_temp_0 = marshaled.___index_0; unmarshaled.set_index_0(unmarshaled_index_temp_0); Rect_t35B976DE901B5423C11705E156938EA27AB402CE unmarshaled_uv_temp_1; memset((&unmarshaled_uv_temp_1), 0, sizeof(unmarshaled_uv_temp_1)); unmarshaled_uv_temp_1 = marshaled.___uv_1; unmarshaled.set_uv_1(unmarshaled_uv_temp_1); Rect_t35B976DE901B5423C11705E156938EA27AB402CE unmarshaled_vert_temp_2; memset((&unmarshaled_vert_temp_2), 0, sizeof(unmarshaled_vert_temp_2)); unmarshaled_vert_temp_2 = marshaled.___vert_2; unmarshaled.set_vert_2(unmarshaled_vert_temp_2); float unmarshaled_width_temp_3 = 0.0f; unmarshaled_width_temp_3 = marshaled.___width_3; unmarshaled.set_width_3(unmarshaled_width_temp_3); int32_t unmarshaled_size_temp_4 = 0; unmarshaled_size_temp_4 = marshaled.___size_4; unmarshaled.set_size_4(unmarshaled_size_temp_4); int32_t unmarshaled_style_temp_5 = 0; unmarshaled_style_temp_5 = marshaled.___style_5; unmarshaled.set_style_5(unmarshaled_style_temp_5); bool unmarshaled_flipped_temp_6 = false; unmarshaled_flipped_temp_6 = static_cast<bool>(marshaled.___flipped_6); unmarshaled.set_flipped_6(unmarshaled_flipped_temp_6); } // Conversion method for clean up from marshalling of: UnityEngine.CharacterInfo IL2CPP_EXTERN_C void CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshal_pinvoke_cleanup(CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.CharacterInfo IL2CPP_EXTERN_C void CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshal_com(const CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313& unmarshaled, CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshaled_com& marshaled) { marshaled.___index_0 = unmarshaled.get_index_0(); marshaled.___uv_1 = unmarshaled.get_uv_1(); marshaled.___vert_2 = unmarshaled.get_vert_2(); marshaled.___width_3 = unmarshaled.get_width_3(); marshaled.___size_4 = unmarshaled.get_size_4(); marshaled.___style_5 = unmarshaled.get_style_5(); marshaled.___flipped_6 = static_cast<int32_t>(unmarshaled.get_flipped_6()); } IL2CPP_EXTERN_C void CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshal_com_back(const CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshaled_com& marshaled, CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313& unmarshaled) { int32_t unmarshaled_index_temp_0 = 0; unmarshaled_index_temp_0 = marshaled.___index_0; unmarshaled.set_index_0(unmarshaled_index_temp_0); Rect_t35B976DE901B5423C11705E156938EA27AB402CE unmarshaled_uv_temp_1; memset((&unmarshaled_uv_temp_1), 0, sizeof(unmarshaled_uv_temp_1)); unmarshaled_uv_temp_1 = marshaled.___uv_1; unmarshaled.set_uv_1(unmarshaled_uv_temp_1); Rect_t35B976DE901B5423C11705E156938EA27AB402CE unmarshaled_vert_temp_2; memset((&unmarshaled_vert_temp_2), 0, sizeof(unmarshaled_vert_temp_2)); unmarshaled_vert_temp_2 = marshaled.___vert_2; unmarshaled.set_vert_2(unmarshaled_vert_temp_2); float unmarshaled_width_temp_3 = 0.0f; unmarshaled_width_temp_3 = marshaled.___width_3; unmarshaled.set_width_3(unmarshaled_width_temp_3); int32_t unmarshaled_size_temp_4 = 0; unmarshaled_size_temp_4 = marshaled.___size_4; unmarshaled.set_size_4(unmarshaled_size_temp_4); int32_t unmarshaled_style_temp_5 = 0; unmarshaled_style_temp_5 = marshaled.___style_5; unmarshaled.set_style_5(unmarshaled_style_temp_5); bool unmarshaled_flipped_temp_6 = false; unmarshaled_flipped_temp_6 = static_cast<bool>(marshaled.___flipped_6); unmarshaled.set_flipped_6(unmarshaled_flipped_temp_6); } // Conversion method for clean up from marshalling of: UnityEngine.CharacterInfo IL2CPP_EXTERN_C void CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshal_com_cleanup(CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313_marshaled_com& marshaled) { } // System.Int32 UnityEngine.CharacterInfo::get_advance() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t CharacterInfo_get_advance_mCCD27183A01AB4F83305230D5AB39AE6F0E4779C (CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CharacterInfo_get_advance_mCCD27183A01AB4F83305230D5AB39AE6F0E4779C_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; { float L_0 = __this->get_width_3(); IL2CPP_RUNTIME_CLASS_INIT(Math_tFB388E53C7FDC6FCCF9A19ABF5A4E521FBD52E19_il2cpp_TypeInfo_var); double L_1 = Math_Round_m7EE608A0B3B8C109464FF045B96657431387DC83((((double)((double)L_0))), 1, /*hidden argument*/NULL); V_0 = (((int32_t)((int32_t)L_1))); goto IL_0012; } IL_0012: { int32_t L_2 = V_0; return L_2; } } IL2CPP_EXTERN_C int32_t CharacterInfo_get_advance_mCCD27183A01AB4F83305230D5AB39AE6F0E4779C_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313 * _thisAdjusted = reinterpret_cast<CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313 *>(__this + _offset); return CharacterInfo_get_advance_mCCD27183A01AB4F83305230D5AB39AE6F0E4779C(_thisAdjusted, method); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void UnityEngine.Font::add_textureRebuilt(System.Action`1<UnityEngine.Font>) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Font_add_textureRebuilt_m031EFCD3B164273920B133A8689C18ED87C9B18F (Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * ___value0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Font_add_textureRebuilt_m031EFCD3B164273920B133A8689C18ED87C9B18F_MetadataUsageId); s_Il2CppMethodInitialized = true; } Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * V_0 = NULL; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * V_1 = NULL; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * V_2 = NULL; { Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_0 = ((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_textureRebuilt_4(); V_0 = L_0; } IL_0006: { Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_1 = V_0; V_1 = L_1; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_2 = V_1; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_3 = ___value0; Delegate_t * L_4 = Delegate_Combine_mC25D2F7DECAFBA6D9A2F9EBA8A77063F0658ECF1(L_2, L_3, /*hidden argument*/NULL); V_2 = ((Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)CastclassSealed((RuntimeObject*)L_4, Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C_il2cpp_TypeInfo_var)); Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_5 = V_2; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_6 = V_1; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_7 = InterlockedCompareExchangeImpl<Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *>((Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C **)(((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_address_of_textureRebuilt_4()), L_5, L_6); V_0 = L_7; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_8 = V_0; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_9 = V_1; if ((!(((RuntimeObject*)(Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)L_8) == ((RuntimeObject*)(Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)L_9)))) { goto IL_0006; } } { return; } } // System.Void UnityEngine.Font::remove_textureRebuilt(System.Action`1<UnityEngine.Font>) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Font_remove_textureRebuilt_mBEF163DAE27CA126D400646E850AAEE4AE8DAAB4 (Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * ___value0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Font_remove_textureRebuilt_mBEF163DAE27CA126D400646E850AAEE4AE8DAAB4_MetadataUsageId); s_Il2CppMethodInitialized = true; } Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * V_0 = NULL; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * V_1 = NULL; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * V_2 = NULL; { Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_0 = ((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_textureRebuilt_4(); V_0 = L_0; } IL_0006: { Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_1 = V_0; V_1 = L_1; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_2 = V_1; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_3 = ___value0; Delegate_t * L_4 = Delegate_Remove_m0B0DB7D1B3AF96B71AFAA72BA0EFE32FBBC2932D(L_2, L_3, /*hidden argument*/NULL); V_2 = ((Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)CastclassSealed((RuntimeObject*)L_4, Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C_il2cpp_TypeInfo_var)); Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_5 = V_2; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_6 = V_1; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_7 = InterlockedCompareExchangeImpl<Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *>((Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C **)(((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_address_of_textureRebuilt_4()), L_5, L_6); V_0 = L_7; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_8 = V_0; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_9 = V_1; if ((!(((RuntimeObject*)(Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)L_8) == ((RuntimeObject*)(Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)L_9)))) { goto IL_0006; } } { return; } } // UnityEngine.Material UnityEngine.Font::get_material() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Material_tF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598 * Font_get_material_m92A995029540A5FACAEA3A2FE792FFDAC294827D (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, const RuntimeMethod* method) { typedef Material_tF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598 * (*Font_get_material_m92A995029540A5FACAEA3A2FE792FFDAC294827D_ftn) (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *); static Font_get_material_m92A995029540A5FACAEA3A2FE792FFDAC294827D_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Font_get_material_m92A995029540A5FACAEA3A2FE792FFDAC294827D_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Font::get_material()"); Material_tF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598 * retVal = _il2cpp_icall_func(__this); return retVal; } // System.Boolean UnityEngine.Font::get_dynamic() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, const RuntimeMethod* method) { typedef bool (*Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E_ftn) (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *); static Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Font::get_dynamic()"); bool retVal = _il2cpp_icall_func(__this); return retVal; } // System.Int32 UnityEngine.Font::get_fontSize() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Font_get_fontSize_m75A71EFC3D6483AD1A8C6F38133648BDFF1618A5 (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, const RuntimeMethod* method) { typedef int32_t (*Font_get_fontSize_m75A71EFC3D6483AD1A8C6F38133648BDFF1618A5_ftn) (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *); static Font_get_fontSize_m75A71EFC3D6483AD1A8C6F38133648BDFF1618A5_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Font_get_fontSize_m75A71EFC3D6483AD1A8C6F38133648BDFF1618A5_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Font::get_fontSize()"); int32_t retVal = _il2cpp_icall_func(__this); return retVal; } // System.Void UnityEngine.Font::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Font__ctor_m0EB492A9B2082EEE21587ED01866DE1ED4C1E628 (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Font__ctor_m0EB492A9B2082EEE21587ED01866DE1ED4C1E628_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var); Object__ctor_m091EBAEBC7919B0391ABDAFB7389ADC12206525B(__this, /*hidden argument*/NULL); Font_Internal_CreateFont_m1B4B34CFCE6782196D19DB5020CB4C4CEFFFC05E(__this, (String_t*)NULL, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Font::InvokeTextureRebuilt_Internal(UnityEngine.Font) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Font_InvokeTextureRebuilt_Internal_m2D4C9D99B6137EF380A19EC72D6EE8CBFF7B4062 (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Font_InvokeTextureRebuilt_Internal_m2D4C9D99B6137EF380A19EC72D6EE8CBFF7B4062_MetadataUsageId); s_Il2CppMethodInitialized = true; } Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * G_B2_0 = NULL; Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * G_B1_0 = NULL; FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * G_B5_0 = NULL; FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * G_B4_0 = NULL; { Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_0 = ((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_textureRebuilt_4(); Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_1 = L_0; G_B1_0 = L_1; if (L_1) { G_B2_0 = L_1; goto IL_000c; } } { goto IL_0013; } IL_000c: { Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_2 = ___font0; NullCheck(G_B2_0); Action_1_Invoke_mC307FDDD4FEA6818EE9A27D962C2C512B835DAEB(G_B2_0, L_2, /*hidden argument*/Action_1_Invoke_mC307FDDD4FEA6818EE9A27D962C2C512B835DAEB_RuntimeMethod_var); } IL_0013: { Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_3 = ___font0; NullCheck(L_3); FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * L_4 = L_3->get_m_FontTextureRebuildCallback_5(); FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * L_5 = L_4; G_B4_0 = L_5; if (L_5) { G_B5_0 = L_5; goto IL_001f; } } { goto IL_0025; } IL_001f: { NullCheck(G_B5_0); FontTextureRebuildCallback_Invoke_m4E6CFDE11932BA7F129C9A2C4CAE294562B07480(G_B5_0, /*hidden argument*/NULL); } IL_0025: { return; } } // System.Boolean UnityEngine.Font::HasCharacter(System.Char) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Font_HasCharacter_m23CC7E1E37BCA115DC130B841CF3207212E2802E (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, Il2CppChar ___c0, const RuntimeMethod* method) { bool V_0 = false; { Il2CppChar L_0 = ___c0; bool L_1 = Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51(__this, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000b; } IL_000b: { bool L_2 = V_0; return L_2; } } // System.Boolean UnityEngine.Font::HasCharacter(System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51 (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, int32_t ___c0, const RuntimeMethod* method) { typedef bool (*Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51_ftn) (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *, int32_t); static Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Font::HasCharacter(System.Int32)"); bool retVal = _il2cpp_icall_func(__this, ___c0); return retVal; } // System.Void UnityEngine.Font::Internal_CreateFont(UnityEngine.Font,System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Font_Internal_CreateFont_m1B4B34CFCE6782196D19DB5020CB4C4CEFFFC05E (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___self0, String_t* ___name1, const RuntimeMethod* method) { typedef void (*Font_Internal_CreateFont_m1B4B34CFCE6782196D19DB5020CB4C4CEFFFC05E_ftn) (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *, String_t*); static Font_Internal_CreateFont_m1B4B34CFCE6782196D19DB5020CB4C4CEFFFC05E_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Font_Internal_CreateFont_m1B4B34CFCE6782196D19DB5020CB4C4CEFFFC05E_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Font::Internal_CreateFont(UnityEngine.Font,System.String)"); _il2cpp_icall_func(___self0, ___name1); } // System.Boolean UnityEngine.Font::GetCharacterInfo(System.Char,UnityEngine.CharacterInfo&,System.Int32,UnityEngine.FontStyle) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Font_GetCharacterInfo_mFC0350FC06315C632781B0BAF05F9C4F0F0B7E12 (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, Il2CppChar ___ch0, CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313 * ___info1, int32_t ___size2, int32_t ___style3, const RuntimeMethod* method) { typedef bool (*Font_GetCharacterInfo_mFC0350FC06315C632781B0BAF05F9C4F0F0B7E12_ftn) (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *, Il2CppChar, CharacterInfo_t678D243661BB260C0841F66CB9BB85C7666D4313 *, int32_t, int32_t); static Font_GetCharacterInfo_mFC0350FC06315C632781B0BAF05F9C4F0F0B7E12_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Font_GetCharacterInfo_mFC0350FC06315C632781B0BAF05F9C4F0F0B7E12_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Font::GetCharacterInfo(System.Char,UnityEngine.CharacterInfo&,System.Int32,UnityEngine.FontStyle)"); bool retVal = _il2cpp_icall_func(__this, ___ch0, ___info1, ___size2, ___style3); return retVal; } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif IL2CPP_EXTERN_C void DelegatePInvokeWrapper_FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, const RuntimeMethod* method) { typedef void (DEFAULT_CALL *PInvokeFunc)(); PInvokeFunc il2cppPInvokeFunc = reinterpret_cast<PInvokeFunc>(il2cpp_codegen_get_method_pointer(((RuntimeDelegate*)__this)->method)); // Native function invocation il2cppPInvokeFunc(); } // System.Void UnityEngine.Font_FontTextureRebuildCallback::.ctor(System.Object,System.IntPtr) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void FontTextureRebuildCallback__ctor_m83BD4ACFF1FDA3D203ABA140B0CA2B4B0064A3A3 (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method) { __this->set_method_ptr_0(il2cpp_codegen_get_method_pointer((RuntimeMethod*)___method1)); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void UnityEngine.Font_FontTextureRebuildCallback::Invoke() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void FontTextureRebuildCallback_Invoke_m4E6CFDE11932BA7F129C9A2C4CAE294562B07480 (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, const RuntimeMethod* method) { DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* delegateArrayToInvoke = __this->get_delegates_11(); Delegate_t** delegatesToInvoke; il2cpp_array_size_t length; if (delegateArrayToInvoke != NULL) { length = delegateArrayToInvoke->max_length; delegatesToInvoke = reinterpret_cast<Delegate_t**>(delegateArrayToInvoke->GetAddressAtUnchecked(0)); } else { length = 1; delegatesToInvoke = reinterpret_cast<Delegate_t**>(&__this); } for (il2cpp_array_size_t i = 0; i < length; i++) { Delegate_t* currentDelegate = delegatesToInvoke[i]; Il2CppMethodPointer targetMethodPointer = currentDelegate->get_method_ptr_0(); RuntimeObject* targetThis = currentDelegate->get_m_target_2(); RuntimeMethod* targetMethod = (RuntimeMethod*)(currentDelegate->get_method_3()); if (!il2cpp_codegen_method_is_virtual(targetMethod)) { il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod); } bool ___methodIsStatic = MethodIsStatic(targetMethod); int ___parameterCount = il2cpp_codegen_method_parameter_count(targetMethod); if (___methodIsStatic) { if (___parameterCount == 0) { // open typedef void (*FunctionPointerType) (const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(targetMethod); } else { // closed typedef void (*FunctionPointerType) (void*, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(targetThis, targetMethod); } } else { // closed if (targetThis != NULL && il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this)) { if (il2cpp_codegen_method_is_generic_instance(targetMethod)) { if (il2cpp_codegen_method_is_interface_method(targetMethod)) GenericInterfaceActionInvoker0::Invoke(targetMethod, targetThis); else GenericVirtActionInvoker0::Invoke(targetMethod, targetThis); } else { if (il2cpp_codegen_method_is_interface_method(targetMethod)) InterfaceActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis); else VirtActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis); } } else { typedef void (*FunctionPointerType) (void*, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(targetThis, targetMethod); } } } } // System.IAsyncResult UnityEngine.Font_FontTextureRebuildCallback::BeginInvoke(System.AsyncCallback,System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* FontTextureRebuildCallback_BeginInvoke_m53EF837EFEA71B83AEA6706E2EB8F83062E43880 (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 * ___callback0, RuntimeObject * ___object1, const RuntimeMethod* method) { void *__d_args[1] = {0}; return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback0, (RuntimeObject*)___object1); } // System.Void UnityEngine.Font_FontTextureRebuildCallback::EndInvoke(System.IAsyncResult) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void FontTextureRebuildCallback_EndInvoke_m8EEDB9652F6D2358523057E1164740820D2AE93C (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, RuntimeObject* ___result0, const RuntimeMethod* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Conversion methods for marshalling of: UnityEngine.TextGenerationSettings IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled) { Exception_t* ___font_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'font' of type 'TextGenerationSettings': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___font_0Exception, NULL); } IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke_back(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled) { Exception_t* ___font_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'font' of type 'TextGenerationSettings': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___font_0Exception, NULL); } // Conversion method for clean up from marshalling of: UnityEngine.TextGenerationSettings IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke_cleanup(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.TextGenerationSettings IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled) { Exception_t* ___font_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'font' of type 'TextGenerationSettings': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___font_0Exception, NULL); } IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com_back(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled) { Exception_t* ___font_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'font' of type 'TextGenerationSettings': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___font_0Exception, NULL); } // Conversion method for clean up from marshalling of: UnityEngine.TextGenerationSettings IL2CPP_EXTERN_C void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com_cleanup(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled) { } // System.Boolean UnityEngine.TextGenerationSettings::CompareColors(UnityEngine.Color,UnityEngine.Color) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66 (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___left0, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___right1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; int32_t G_B5_0 = 0; { Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_0 = ___left0; float L_1 = L_0.get_r_0(); Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_2 = ___right1; float L_3 = L_2.get_r_0(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var); bool L_4 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_1, L_3, /*hidden argument*/NULL); if (!L_4) { goto IL_004d; } } { Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_5 = ___left0; float L_6 = L_5.get_g_1(); Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_7 = ___right1; float L_8 = L_7.get_g_1(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var); bool L_9 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_6, L_8, /*hidden argument*/NULL); if (!L_9) { goto IL_004d; } } { Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_10 = ___left0; float L_11 = L_10.get_b_2(); Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_12 = ___right1; float L_13 = L_12.get_b_2(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var); bool L_14 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_11, L_13, /*hidden argument*/NULL); if (!L_14) { goto IL_004d; } } { Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_15 = ___left0; float L_16 = L_15.get_a_3(); Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_17 = ___right1; float L_18 = L_17.get_a_3(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var); bool L_19 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_16, L_18, /*hidden argument*/NULL); G_B5_0 = ((int32_t)(L_19)); goto IL_004e; } IL_004d: { G_B5_0 = 0; } IL_004e: { V_0 = (bool)G_B5_0; goto IL_0051; } IL_0051: { bool L_20 = V_0; return L_20; } } IL2CPP_EXTERN_C bool TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66_AdjustorThunk (RuntimeObject * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___left0, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___right1, const RuntimeMethod* method) { int32_t _offset = 1; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * _thisAdjusted = reinterpret_cast<TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *>(__this + _offset); return TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66(_thisAdjusted, ___left0, ___right1, method); } // System.Boolean UnityEngine.TextGenerationSettings::CompareVector2(UnityEngine.Vector2,UnityEngine.Vector2) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___left0, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___right1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; int32_t G_B3_0 = 0; { Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_0 = ___left0; float L_1 = L_0.get_x_0(); Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_2 = ___right1; float L_3 = L_2.get_x_0(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var); bool L_4 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_1, L_3, /*hidden argument*/NULL); if (!L_4) { goto IL_0027; } } { Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_5 = ___left0; float L_6 = L_5.get_y_1(); Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_7 = ___right1; float L_8 = L_7.get_y_1(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var); bool L_9 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_6, L_8, /*hidden argument*/NULL); G_B3_0 = ((int32_t)(L_9)); goto IL_0028; } IL_0027: { G_B3_0 = 0; } IL_0028: { V_0 = (bool)G_B3_0; goto IL_002b; } IL_002b: { bool L_10 = V_0; return L_10; } } IL2CPP_EXTERN_C bool TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C_AdjustorThunk (RuntimeObject * __this, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___left0, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___right1, const RuntimeMethod* method) { int32_t _offset = 1; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * _thisAdjusted = reinterpret_cast<TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *>(__this + _offset); return TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C(_thisAdjusted, ___left0, ___right1, method); } // System.Boolean UnityEngine.TextGenerationSettings::Equals(UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___other0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; int32_t G_B21_0 = 0; { Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_0 = __this->get_color_1(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___other0; Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_2 = L_1.get_color_1(); bool L_3 = TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66((TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *)__this, L_0, L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_015e; } } { int32_t L_4 = __this->get_fontSize_2(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_5 = ___other0; int32_t L_6 = L_5.get_fontSize_2(); if ((!(((uint32_t)L_4) == ((uint32_t)L_6)))) { goto IL_015e; } } { float L_7 = __this->get_scaleFactor_5(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_8 = ___other0; float L_9 = L_8.get_scaleFactor_5(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var); bool L_10 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_7, L_9, /*hidden argument*/NULL); if (!L_10) { goto IL_015e; } } { int32_t L_11 = __this->get_resizeTextMinSize_10(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_12 = ___other0; int32_t L_13 = L_12.get_resizeTextMinSize_10(); if ((!(((uint32_t)L_11) == ((uint32_t)L_13)))) { goto IL_015e; } } { int32_t L_14 = __this->get_resizeTextMaxSize_11(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_15 = ___other0; int32_t L_16 = L_15.get_resizeTextMaxSize_11(); if ((!(((uint32_t)L_14) == ((uint32_t)L_16)))) { goto IL_015e; } } { float L_17 = __this->get_lineSpacing_3(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_18 = ___other0; float L_19 = L_18.get_lineSpacing_3(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var); bool L_20 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_17, L_19, /*hidden argument*/NULL); if (!L_20) { goto IL_015e; } } { int32_t L_21 = __this->get_fontStyle_6(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_22 = ___other0; int32_t L_23 = L_22.get_fontStyle_6(); if ((!(((uint32_t)L_21) == ((uint32_t)L_23)))) { goto IL_015e; } } { bool L_24 = __this->get_richText_4(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_25 = ___other0; bool L_26 = L_25.get_richText_4(); if ((!(((uint32_t)L_24) == ((uint32_t)L_26)))) { goto IL_015e; } } { int32_t L_27 = __this->get_textAnchor_7(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_28 = ___other0; int32_t L_29 = L_28.get_textAnchor_7(); if ((!(((uint32_t)L_27) == ((uint32_t)L_29)))) { goto IL_015e; } } { bool L_30 = __this->get_alignByGeometry_8(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_31 = ___other0; bool L_32 = L_31.get_alignByGeometry_8(); if ((!(((uint32_t)L_30) == ((uint32_t)L_32)))) { goto IL_015e; } } { bool L_33 = __this->get_resizeTextForBestFit_9(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_34 = ___other0; bool L_35 = L_34.get_resizeTextForBestFit_9(); if ((!(((uint32_t)L_33) == ((uint32_t)L_35)))) { goto IL_015e; } } { int32_t L_36 = __this->get_resizeTextMinSize_10(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_37 = ___other0; int32_t L_38 = L_37.get_resizeTextMinSize_10(); if ((!(((uint32_t)L_36) == ((uint32_t)L_38)))) { goto IL_015e; } } { int32_t L_39 = __this->get_resizeTextMaxSize_11(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_40 = ___other0; int32_t L_41 = L_40.get_resizeTextMaxSize_11(); if ((!(((uint32_t)L_39) == ((uint32_t)L_41)))) { goto IL_015e; } } { bool L_42 = __this->get_resizeTextForBestFit_9(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_43 = ___other0; bool L_44 = L_43.get_resizeTextForBestFit_9(); if ((!(((uint32_t)L_42) == ((uint32_t)L_44)))) { goto IL_015e; } } { bool L_45 = __this->get_updateBounds_12(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_46 = ___other0; bool L_47 = L_46.get_updateBounds_12(); if ((!(((uint32_t)L_45) == ((uint32_t)L_47)))) { goto IL_015e; } } { int32_t L_48 = __this->get_horizontalOverflow_14(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_49 = ___other0; int32_t L_50 = L_49.get_horizontalOverflow_14(); if ((!(((uint32_t)L_48) == ((uint32_t)L_50)))) { goto IL_015e; } } { int32_t L_51 = __this->get_verticalOverflow_13(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_52 = ___other0; int32_t L_53 = L_52.get_verticalOverflow_13(); if ((!(((uint32_t)L_51) == ((uint32_t)L_53)))) { goto IL_015e; } } { Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_54 = __this->get_generationExtents_15(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_55 = ___other0; Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_56 = L_55.get_generationExtents_15(); bool L_57 = TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C((TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *)__this, L_54, L_56, /*hidden argument*/NULL); if (!L_57) { goto IL_015e; } } { Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_58 = __this->get_pivot_16(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_59 = ___other0; Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_60 = L_59.get_pivot_16(); bool L_61 = TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C((TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *)__this, L_58, L_60, /*hidden argument*/NULL); if (!L_61) { goto IL_015e; } } { Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_62 = __this->get_font_0(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_63 = ___other0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_64 = L_63.get_font_0(); IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var); bool L_65 = Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C(L_62, L_64, /*hidden argument*/NULL); G_B21_0 = ((int32_t)(L_65)); goto IL_015f; } IL_015e: { G_B21_0 = 0; } IL_015f: { V_0 = (bool)G_B21_0; goto IL_0162; } IL_0162: { bool L_66 = V_0; return L_66; } } IL2CPP_EXTERN_C bool TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D_AdjustorThunk (RuntimeObject * __this, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___other0, const RuntimeMethod* method) { int32_t _offset = 1; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * _thisAdjusted = reinterpret_cast<TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *>(__this + _offset); return TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D(_thisAdjusted, ___other0, method); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Conversion methods for marshalling of: UnityEngine.TextGenerator IL2CPP_EXTERN_C void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_pinvoke(const TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8& unmarshaled, TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_pinvoke& marshaled) { Exception_t* ___m_LastSettings_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_LastSettings' of type 'TextGenerator'."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_LastSettings_2Exception, NULL); } IL2CPP_EXTERN_C void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_pinvoke_back(const TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_pinvoke& marshaled, TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8& unmarshaled) { Exception_t* ___m_LastSettings_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_LastSettings' of type 'TextGenerator'."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_LastSettings_2Exception, NULL); } // Conversion method for clean up from marshalling of: UnityEngine.TextGenerator IL2CPP_EXTERN_C void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_pinvoke_cleanup(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.TextGenerator IL2CPP_EXTERN_C void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_com(const TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8& unmarshaled, TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_com& marshaled) { Exception_t* ___m_LastSettings_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_LastSettings' of type 'TextGenerator'."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_LastSettings_2Exception, NULL); } IL2CPP_EXTERN_C void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_com_back(const TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_com& marshaled, TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8& unmarshaled) { Exception_t* ___m_LastSettings_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_LastSettings' of type 'TextGenerator'."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_LastSettings_2Exception, NULL); } // Conversion method for clean up from marshalling of: UnityEngine.TextGenerator IL2CPP_EXTERN_C void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_com_cleanup(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_com& marshaled) { } // System.Void UnityEngine.TextGenerator::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator__ctor_mD3956FF7D10DC470522A6363E7D6EC243415098A (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { { TextGenerator__ctor_m86E01E7BB9DC1B28F04961E482ED4D7065062BCE(__this, ((int32_t)50), /*hidden argument*/NULL); return; } } // System.Void UnityEngine.TextGenerator::.ctor(System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator__ctor_m86E01E7BB9DC1B28F04961E482ED4D7065062BCE (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, int32_t ___initialCapacity0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (TextGenerator__ctor_m86E01E7BB9DC1B28F04961E482ED4D7065062BCE_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Object__ctor_m925ECA5E85CA100E3FB86A4F9E15C120E9A184C0(__this, /*hidden argument*/NULL); intptr_t L_0 = TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994(/*hidden argument*/NULL); __this->set_m_Ptr_0((intptr_t)L_0); int32_t L_1 = ___initialCapacity0; List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * L_2 = (List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 *)il2cpp_codegen_object_new(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554_il2cpp_TypeInfo_var); List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8(L_2, ((int32_t)il2cpp_codegen_multiply((int32_t)((int32_t)il2cpp_codegen_add((int32_t)L_1, (int32_t)1)), (int32_t)4)), /*hidden argument*/List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8_RuntimeMethod_var); __this->set_m_Verts_5(L_2); int32_t L_3 = ___initialCapacity0; List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * L_4 = (List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E *)il2cpp_codegen_object_new(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E_il2cpp_TypeInfo_var); List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71(L_4, ((int32_t)il2cpp_codegen_add((int32_t)L_3, (int32_t)1)), /*hidden argument*/List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71_RuntimeMethod_var); __this->set_m_Characters_6(L_4); List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * L_5 = (List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 *)il2cpp_codegen_object_new(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0_il2cpp_TypeInfo_var); List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD(L_5, ((int32_t)20), /*hidden argument*/List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD_RuntimeMethod_var); __this->set_m_Lines_7(L_5); return; } } // System.Void UnityEngine.TextGenerator::Finalize() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_Finalize_m6E9076F61F7B4DD5E56207F39E8F5FD85F188D8A (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (TextGenerator_Finalize_m6E9076F61F7B4DD5E56207F39E8F5FD85F188D8A_MetadataUsageId); s_Il2CppMethodInitialized = true; } Exception_t * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); void* __leave_targets_storage = alloca(sizeof(int32_t) * 1); il2cpp::utils::LeaveTargetStack __leave_targets(__leave_targets_storage); NO_UNUSED_WARNING (__leave_targets); { } IL_0001: try { // begin try (depth: 1) InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t7218B22548186B208D65EA5B7870503810A2D15A_il2cpp_TypeInfo_var, __this); IL2CPP_LEAVE(0x13, FINALLY_000b); } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t *)e.ex; goto FINALLY_000b; } FINALLY_000b: { // begin finally (depth: 1) Object_Finalize_m4015B7D3A44DE125C5FE34D7276CD4697C06F380(__this, /*hidden argument*/NULL); IL2CPP_END_FINALLY(11) } // end finally (depth: 1) IL2CPP_CLEANUP(11) { IL2CPP_RETHROW_IF_UNHANDLED(Exception_t *) IL2CPP_JUMP_TBL(0x13, IL_0013) } IL_0013: { return; } } // System.Void UnityEngine.TextGenerator::System.IDisposable.Dispose() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_System_IDisposable_Dispose_m9D3291DC086282AF57A115B39D3C17BD0074FA3D (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (TextGenerator_System_IDisposable_Dispose_m9D3291DC086282AF57A115B39D3C17BD0074FA3D_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; { intptr_t L_0 = __this->get_m_Ptr_0(); bool L_1 = IntPtr_op_Inequality_mB4886A806009EA825EFCC60CD2A7F6EB8E273A61((intptr_t)L_0, (intptr_t)(0), /*hidden argument*/NULL); V_0 = L_1; bool L_2 = V_0; if (!L_2) { goto IL_002e; } } { intptr_t L_3 = __this->get_m_Ptr_0(); TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5((intptr_t)L_3, /*hidden argument*/NULL); __this->set_m_Ptr_0((intptr_t)(0)); } IL_002e: { return; } } // System.Int32 UnityEngine.TextGenerator::get_characterCountVisible() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TextGenerator_get_characterCountVisible_mD0E9AA8120947F5AED58F512C0978C2E82ED1182 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { { int32_t L_0 = TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7(__this, /*hidden argument*/NULL); return ((int32_t)il2cpp_codegen_subtract((int32_t)L_0, (int32_t)1)); } } // UnityEngine.TextGenerationSettings UnityEngine.TextGenerator::ValidatedSettings(UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 TextGenerator_ValidatedSettings_m167131680BB6CD53B929EF189520F9FCF71FB1D3 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (TextGenerator_ValidatedSettings_m167131680BB6CD53B929EF189520F9FCF71FB1D3_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 V_1; memset((&V_1), 0, sizeof(V_1)); bool V_2 = false; bool V_3 = false; bool V_4 = false; bool V_5 = false; int32_t G_B3_0 = 0; int32_t G_B8_0 = 0; { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_0 = ___settings0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_1 = L_0.get_font_0(); IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var); bool L_2 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_1, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_001c; } } { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_3 = ___settings0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_4 = L_3.get_font_0(); NullCheck(L_4); bool L_5 = Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E(L_4, /*hidden argument*/NULL); G_B3_0 = ((int32_t)(L_5)); goto IL_001d; } IL_001c: { G_B3_0 = 0; } IL_001d: { V_0 = (bool)G_B3_0; bool L_6 = V_0; if (!L_6) { goto IL_0028; } } { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_7 = ___settings0; V_1 = L_7; goto IL_00d8; } IL_0028: { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_8 = ___settings0; int32_t L_9 = L_8.get_fontSize_2(); if (L_9) { goto IL_003b; } } { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_10 = ___settings0; int32_t L_11 = L_10.get_fontStyle_6(); G_B8_0 = ((!(((uint32_t)L_11) <= ((uint32_t)0)))? 1 : 0); goto IL_003c; } IL_003b: { G_B8_0 = 1; } IL_003c: { V_2 = (bool)G_B8_0; bool L_12 = V_2; if (!L_12) { goto IL_0087; } } { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_13 = ___settings0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_14 = L_13.get_font_0(); IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var); bool L_15 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_14, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL); V_3 = L_15; bool L_16 = V_3; if (!L_16) { goto IL_0076; } } { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_17 = ___settings0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_18 = L_17.get_font_0(); ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_19 = (ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)SZArrayNew(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A_il2cpp_TypeInfo_var, (uint32_t)1); ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_20 = L_19; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_21 = ___settings0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_22 = L_21.get_font_0(); NullCheck(L_22); String_t* L_23 = Object_get_name_mA2D400141CB3C991C87A2556429781DE961A83CE(L_22, /*hidden argument*/NULL); NullCheck(L_20); ArrayElementTypeCheck (L_20, L_23); (L_20)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)L_23); IL2CPP_RUNTIME_CLASS_INIT(Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var); Debug_LogWarningFormat_m4A02CCF91F3A9392F4AA93576DCE2222267E5945(L_18, _stringLiteral2C79056F1CBD7CDBD214C0C0421FFC46A2BD5CBD, L_20, /*hidden argument*/NULL); } IL_0076: { (&___settings0)->set_fontSize_2(0); (&___settings0)->set_fontStyle_6(0); } IL_0087: { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_24 = ___settings0; bool L_25 = L_24.get_resizeTextForBestFit_9(); V_4 = L_25; bool L_26 = V_4; if (!L_26) { goto IL_00d4; } } { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_27 = ___settings0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_28 = L_27.get_font_0(); IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var); bool L_29 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_28, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL); V_5 = L_29; bool L_30 = V_5; if (!L_30) { goto IL_00cb; } } { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_31 = ___settings0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_32 = L_31.get_font_0(); ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_33 = (ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)SZArrayNew(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A_il2cpp_TypeInfo_var, (uint32_t)1); ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_34 = L_33; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_35 = ___settings0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_36 = L_35.get_font_0(); NullCheck(L_36); String_t* L_37 = Object_get_name_mA2D400141CB3C991C87A2556429781DE961A83CE(L_36, /*hidden argument*/NULL); NullCheck(L_34); ArrayElementTypeCheck (L_34, L_37); (L_34)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)L_37); IL2CPP_RUNTIME_CLASS_INIT(Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var); Debug_LogWarningFormat_m4A02CCF91F3A9392F4AA93576DCE2222267E5945(L_32, _stringLiteral277905A8757DB70EAE0C8B996E4FCF857783BB03, L_34, /*hidden argument*/NULL); } IL_00cb: { (&___settings0)->set_resizeTextForBestFit_9((bool)0); } IL_00d4: { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_38 = ___settings0; V_1 = L_38; goto IL_00d8; } IL_00d8: { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_39 = V_1; return L_39; } } // System.Void UnityEngine.TextGenerator::Invalidate() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_Invalidate_m5C360AB470CB728BAA03B34BE33C75CBB55B673E (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { { __this->set_m_HasGenerated_3((bool)0); return; } } // System.Void UnityEngine.TextGenerator::GetCharacters(System.Collections.Generic.List`1<UnityEngine.UICharInfo>) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetCharacters_mBB7980F2FE8BE65A906A39B5559EC54B1CEF4131 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * ___characters0, const RuntimeMethod* method) { { List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * L_0 = ___characters0; TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.TextGenerator::GetLines(System.Collections.Generic.List`1<UnityEngine.UILineInfo>) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetLines_mC31F7918A9159908EA914D01B2E32644B046E2B5 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * ___lines0, const RuntimeMethod* method) { { List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * L_0 = ___lines0; TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.TextGenerator::GetVertices(System.Collections.Generic.List`1<UnityEngine.UIVertex>) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetVertices_m6FA34586541514ED7396990542BDAC536C10A4F2 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * ___vertices0, const RuntimeMethod* method) { { List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * L_0 = ___vertices0; TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A(__this, L_0, /*hidden argument*/NULL); return; } } // System.Single UnityEngine.TextGenerator::GetPreferredWidth(System.String,UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float TextGenerator_GetPreferredWidth_mBF228094564195BBB66669F4ECC6EE1B0B05BAAA (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method) { Rect_t35B976DE901B5423C11705E156938EA27AB402CE V_0; memset((&V_0), 0, sizeof(V_0)); float V_1 = 0.0f; { (&___settings1)->set_horizontalOverflow_14(1); (&___settings1)->set_verticalOverflow_13(1); (&___settings1)->set_updateBounds_12((bool)1); String_t* L_0 = ___str0; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___settings1; TextGenerator_Populate_m15553808C8FA017AA1AC23D2818C30DAFD654A04(__this, L_0, L_1, /*hidden argument*/NULL); Rect_t35B976DE901B5423C11705E156938EA27AB402CE L_2 = TextGenerator_get_rectExtents_m55F6A6727406C54BEFB7628751555B7C58BEC9B1(__this, /*hidden argument*/NULL); V_0 = L_2; float L_3 = Rect_get_width_m54FF69FC2C086E2DC349ED091FD0D6576BFB1484((Rect_t35B976DE901B5423C11705E156938EA27AB402CE *)(&V_0), /*hidden argument*/NULL); V_1 = L_3; goto IL_0033; } IL_0033: { float L_4 = V_1; return L_4; } } // System.Single UnityEngine.TextGenerator::GetPreferredHeight(System.String,UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float TextGenerator_GetPreferredHeight_mC2F191D9E9CF2365545D0A3F1EBD0F105DB27963 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method) { Rect_t35B976DE901B5423C11705E156938EA27AB402CE V_0; memset((&V_0), 0, sizeof(V_0)); float V_1 = 0.0f; { (&___settings1)->set_verticalOverflow_13(1); (&___settings1)->set_updateBounds_12((bool)1); String_t* L_0 = ___str0; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___settings1; TextGenerator_Populate_m15553808C8FA017AA1AC23D2818C30DAFD654A04(__this, L_0, L_1, /*hidden argument*/NULL); Rect_t35B976DE901B5423C11705E156938EA27AB402CE L_2 = TextGenerator_get_rectExtents_m55F6A6727406C54BEFB7628751555B7C58BEC9B1(__this, /*hidden argument*/NULL); V_0 = L_2; float L_3 = Rect_get_height_m088C36990E0A255C5D7DCE36575DCE23ABB364B5((Rect_t35B976DE901B5423C11705E156938EA27AB402CE *)(&V_0), /*hidden argument*/NULL); V_1 = L_3; goto IL_002b; } IL_002b: { float L_4 = V_1; return L_4; } } // System.Boolean UnityEngine.TextGenerator::PopulateWithErrors(System.String,UnityEngine.TextGenerationSettings,UnityEngine.GameObject) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerator_PopulateWithErrors_m1F1851B3C2B2EBEFD81C83DC124FB376C926B933 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * ___context2, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (TextGenerator_PopulateWithErrors_m1F1851B3C2B2EBEFD81C83DC124FB376C926B933_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; bool V_1 = false; bool V_2 = false; bool V_3 = false; bool V_4 = false; { String_t* L_0 = ___str0; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___settings1; int32_t L_2 = TextGenerator_PopulateWithError_m24D1DA75F0563582E228C6F4982D0913C58E1D7D(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; int32_t L_3 = V_0; V_1 = (bool)((((int32_t)L_3) == ((int32_t)0))? 1 : 0); bool L_4 = V_1; if (!L_4) { goto IL_0016; } } { V_2 = (bool)1; goto IL_0066; } IL_0016: { int32_t L_5 = V_0; V_3 = (bool)((!(((uint32_t)((int32_t)((int32_t)L_5&(int32_t)1))) <= ((uint32_t)0)))? 1 : 0); bool L_6 = V_3; if (!L_6) { goto IL_003b; } } { GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_7 = ___context2; ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_8 = (ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)SZArrayNew(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A_il2cpp_TypeInfo_var, (uint32_t)1); ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_9 = L_8; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_10 = ___settings1; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_11 = L_10.get_font_0(); NullCheck(L_9); ArrayElementTypeCheck (L_9, L_11); (L_9)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)L_11); IL2CPP_RUNTIME_CLASS_INIT(Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var); Debug_LogErrorFormat_m994E4759C25BF0E9DD4179C10E3979558137CCF0(L_7, _stringLiteral6F5E75D22C09C82C4D03E8E6E9ADE44476FEE514, L_9, /*hidden argument*/NULL); } IL_003b: { int32_t L_12 = V_0; V_4 = (bool)((!(((uint32_t)((int32_t)((int32_t)L_12&(int32_t)2))) <= ((uint32_t)0)))? 1 : 0); bool L_13 = V_4; if (!L_13) { goto IL_0062; } } { GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_14 = ___context2; ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_15 = (ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)SZArrayNew(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A_il2cpp_TypeInfo_var, (uint32_t)1); ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_16 = L_15; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_17 = ___settings1; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_18 = L_17.get_font_0(); NullCheck(L_16); ArrayElementTypeCheck (L_16, L_18); (L_16)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)L_18); IL2CPP_RUNTIME_CLASS_INIT(Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var); Debug_LogErrorFormat_m994E4759C25BF0E9DD4179C10E3979558137CCF0(L_14, _stringLiteral8D03707CEE3275C377839D6BF944BCECDF26A00B, L_16, /*hidden argument*/NULL); } IL_0062: { V_2 = (bool)0; goto IL_0066; } IL_0066: { bool L_19 = V_2; return L_19; } } // System.Boolean UnityEngine.TextGenerator::Populate(System.String,UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerator_Populate_m15553808C8FA017AA1AC23D2818C30DAFD654A04 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method) { int32_t V_0 = 0; bool V_1 = false; { String_t* L_0 = ___str0; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___settings1; int32_t L_2 = TextGenerator_PopulateWithError_m24D1DA75F0563582E228C6F4982D0913C58E1D7D(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; int32_t L_3 = V_0; V_1 = (bool)((((int32_t)L_3) == ((int32_t)0))? 1 : 0); goto IL_0011; } IL_0011: { bool L_4 = V_1; return L_4; } } // UnityEngine.TextGenerationError UnityEngine.TextGenerator::PopulateWithError(System.String,UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TextGenerator_PopulateWithError_m24D1DA75F0563582E228C6F4982D0913C58E1D7D (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method) { bool V_0 = false; int32_t V_1 = 0; int32_t G_B4_0 = 0; { bool L_0 = __this->get_m_HasGenerated_3(); if (!L_0) { goto IL_0026; } } { String_t* L_1 = ___str0; String_t* L_2 = __this->get_m_LastString_1(); bool L_3 = String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE(L_1, L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_0026; } } { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_4 = __this->get_m_LastSettings_2(); bool L_5 = TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D((TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *)(&___settings1), L_4, /*hidden argument*/NULL); G_B4_0 = ((int32_t)(L_5)); goto IL_0027; } IL_0026: { G_B4_0 = 0; } IL_0027: { V_0 = (bool)G_B4_0; bool L_6 = V_0; if (!L_6) { goto IL_0034; } } { int32_t L_7 = __this->get_m_LastValid_4(); V_1 = L_7; goto IL_004b; } IL_0034: { String_t* L_8 = ___str0; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_9 = ___settings1; int32_t L_10 = TextGenerator_PopulateAlways_m8DCF389A51877975F29FAB9B6E800DFDC1E0B8DF(__this, L_8, L_9, /*hidden argument*/NULL); __this->set_m_LastValid_4(L_10); int32_t L_11 = __this->get_m_LastValid_4(); V_1 = L_11; goto IL_004b; } IL_004b: { int32_t L_12 = V_1; return L_12; } } // UnityEngine.TextGenerationError UnityEngine.TextGenerator::PopulateAlways(System.String,UnityEngine.TextGenerationSettings) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TextGenerator_PopulateAlways_m8DCF389A51877975F29FAB9B6E800DFDC1E0B8DF (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method) { TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 V_0; memset((&V_0), 0, sizeof(V_0)); int32_t V_1 = 0; int32_t V_2 = 0; { String_t* L_0 = ___str0; __this->set_m_LastString_1(L_0); __this->set_m_HasGenerated_3((bool)1); __this->set_m_CachedVerts_8((bool)0); __this->set_m_CachedCharacters_9((bool)0); __this->set_m_CachedLines_10((bool)0); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___settings1; __this->set_m_LastSettings_2(L_1); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_2 = ___settings1; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_3 = TextGenerator_ValidatedSettings_m167131680BB6CD53B929EF189520F9FCF71FB1D3(__this, L_2, /*hidden argument*/NULL); V_0 = L_3; String_t* L_4 = ___str0; TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_5 = V_0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_6 = L_5.get_font_0(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_7 = V_0; Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_8 = L_7.get_color_1(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_9 = V_0; int32_t L_10 = L_9.get_fontSize_2(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_11 = V_0; float L_12 = L_11.get_scaleFactor_5(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_13 = V_0; float L_14 = L_13.get_lineSpacing_3(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_15 = V_0; int32_t L_16 = L_15.get_fontStyle_6(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_17 = V_0; bool L_18 = L_17.get_richText_4(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_19 = V_0; bool L_20 = L_19.get_resizeTextForBestFit_9(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_21 = V_0; int32_t L_22 = L_21.get_resizeTextMinSize_10(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_23 = V_0; int32_t L_24 = L_23.get_resizeTextMaxSize_11(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_25 = V_0; int32_t L_26 = L_25.get_verticalOverflow_13(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_27 = V_0; int32_t L_28 = L_27.get_horizontalOverflow_14(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_29 = V_0; bool L_30 = L_29.get_updateBounds_12(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_31 = V_0; int32_t L_32 = L_31.get_textAnchor_7(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_33 = V_0; Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_34 = L_33.get_generationExtents_15(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_35 = V_0; Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_36 = L_35.get_pivot_16(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_37 = V_0; bool L_38 = L_37.get_generateOutOfBounds_17(); TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_39 = V_0; bool L_40 = L_39.get_alignByGeometry_8(); TextGenerator_Populate_Internal_m42F7FED165D62BFD9C006D19A0FCE5B70C1EF92B(__this, L_4, L_6, L_8, L_10, L_12, L_14, L_16, L_18, L_20, L_22, L_24, L_26, L_28, L_30, L_32, L_34, L_36, L_38, L_40, (int32_t*)(&V_1), /*hidden argument*/NULL); int32_t L_41 = V_1; __this->set_m_LastValid_4(L_41); int32_t L_42 = V_1; V_2 = L_42; goto IL_00b4; } IL_00b4: { int32_t L_43 = V_2; return L_43; } } // System.Collections.Generic.IList`1<UnityEngine.UIVertex> UnityEngine.TextGenerator::get_verts() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* TextGenerator_get_verts_mD0B3D877BE872CDE4BE3791685B8B5EF0AAC6120 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { bool V_0 = false; RuntimeObject* V_1 = NULL; { bool L_0 = __this->get_m_CachedVerts_8(); V_0 = (bool)((((int32_t)L_0) == ((int32_t)0))? 1 : 0); bool L_1 = V_0; if (!L_1) { goto IL_0024; } } { List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * L_2 = __this->get_m_Verts_5(); TextGenerator_GetVertices_m6FA34586541514ED7396990542BDAC536C10A4F2(__this, L_2, /*hidden argument*/NULL); __this->set_m_CachedVerts_8((bool)1); } IL_0024: { List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * L_3 = __this->get_m_Verts_5(); V_1 = (RuntimeObject*)L_3; goto IL_002d; } IL_002d: { RuntimeObject* L_4 = V_1; return L_4; } } // System.Collections.Generic.IList`1<UnityEngine.UICharInfo> UnityEngine.TextGenerator::get_characters() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* TextGenerator_get_characters_m716FE1EF0738A1E6B3FBF4A1DBC46244B9594C7B (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { bool V_0 = false; RuntimeObject* V_1 = NULL; { bool L_0 = __this->get_m_CachedCharacters_9(); V_0 = (bool)((((int32_t)L_0) == ((int32_t)0))? 1 : 0); bool L_1 = V_0; if (!L_1) { goto IL_0024; } } { List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * L_2 = __this->get_m_Characters_6(); TextGenerator_GetCharacters_mBB7980F2FE8BE65A906A39B5559EC54B1CEF4131(__this, L_2, /*hidden argument*/NULL); __this->set_m_CachedCharacters_9((bool)1); } IL_0024: { List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * L_3 = __this->get_m_Characters_6(); V_1 = (RuntimeObject*)L_3; goto IL_002d; } IL_002d: { RuntimeObject* L_4 = V_1; return L_4; } } // System.Collections.Generic.IList`1<UnityEngine.UILineInfo> UnityEngine.TextGenerator::get_lines() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* TextGenerator_get_lines_m40303E6BF9508DD46E04A21B5F5510F0FB9437CD (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { bool V_0 = false; RuntimeObject* V_1 = NULL; { bool L_0 = __this->get_m_CachedLines_10(); V_0 = (bool)((((int32_t)L_0) == ((int32_t)0))? 1 : 0); bool L_1 = V_0; if (!L_1) { goto IL_0024; } } { List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * L_2 = __this->get_m_Lines_7(); TextGenerator_GetLines_mC31F7918A9159908EA914D01B2E32644B046E2B5(__this, L_2, /*hidden argument*/NULL); __this->set_m_CachedLines_10((bool)1); } IL_0024: { List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * L_3 = __this->get_m_Lines_7(); V_1 = (RuntimeObject*)L_3; goto IL_002d; } IL_002d: { RuntimeObject* L_4 = V_1; return L_4; } } // UnityEngine.Rect UnityEngine.TextGenerator::get_rectExtents() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Rect_t35B976DE901B5423C11705E156938EA27AB402CE TextGenerator_get_rectExtents_m55F6A6727406C54BEFB7628751555B7C58BEC9B1 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { Rect_t35B976DE901B5423C11705E156938EA27AB402CE V_0; memset((&V_0), 0, sizeof(V_0)); { TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0(__this, (Rect_t35B976DE901B5423C11705E156938EA27AB402CE *)(&V_0), /*hidden argument*/NULL); Rect_t35B976DE901B5423C11705E156938EA27AB402CE L_0 = V_0; return L_0; } } // System.Int32 UnityEngine.TextGenerator::get_characterCount() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { typedef int32_t (*TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *); static TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::get_characterCount()"); int32_t retVal = _il2cpp_icall_func(__this); return retVal; } // System.Int32 UnityEngine.TextGenerator::get_lineCount() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TextGenerator_get_lineCount_m7A3CC9D67099CDC4723A683716BE5FBC623EE9C4 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method) { typedef int32_t (*TextGenerator_get_lineCount_m7A3CC9D67099CDC4723A683716BE5FBC623EE9C4_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *); static TextGenerator_get_lineCount_m7A3CC9D67099CDC4723A683716BE5FBC623EE9C4_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextGenerator_get_lineCount_m7A3CC9D67099CDC4723A683716BE5FBC623EE9C4_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::get_lineCount()"); int32_t retVal = _il2cpp_icall_func(__this); return retVal; } // System.IntPtr UnityEngine.TextGenerator::Internal_Create() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR intptr_t TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994 (const RuntimeMethod* method) { typedef intptr_t (*TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994_ftn) (); static TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::Internal_Create()"); intptr_t retVal = _il2cpp_icall_func(); return retVal; } // System.Void UnityEngine.TextGenerator::Internal_Destroy(System.IntPtr) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5 (intptr_t ___ptr0, const RuntimeMethod* method) { typedef void (*TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5_ftn) (intptr_t); static TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::Internal_Destroy(System.IntPtr)"); _il2cpp_icall_func(___ptr0); } // System.Boolean UnityEngine.TextGenerator::Populate_Internal(System.String,UnityEngine.Font,UnityEngine.Color,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,UnityEngine.TextAnchor,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.UInt32&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_mCA54081A0855AED6EC6345265603409FE330985C (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, float ___extentsX15, float ___extentsY16, float ___pivotX17, float ___pivotY18, bool ___generateOutOfBounds19, bool ___alignByGeometry20, uint32_t* ___error21, const RuntimeMethod* method) { { String_t* L_0 = ___str0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_1 = ___font1; int32_t L_2 = ___fontSize3; float L_3 = ___scaleFactor4; float L_4 = ___lineSpacing5; int32_t L_5 = ___style6; bool L_6 = ___richText7; bool L_7 = ___resizeTextForBestFit8; int32_t L_8 = ___resizeTextMinSize9; int32_t L_9 = ___resizeTextMaxSize10; int32_t L_10 = ___verticalOverFlow11; int32_t L_11 = ___horizontalOverflow12; bool L_12 = ___updateBounds13; int32_t L_13 = ___anchor14; float L_14 = ___extentsX15; float L_15 = ___extentsY16; float L_16 = ___pivotX17; float L_17 = ___pivotY18; bool L_18 = ___generateOutOfBounds19; bool L_19 = ___alignByGeometry20; uint32_t* L_20 = ___error21; bool L_21 = TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE(__this, L_0, L_1, (Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 *)(&___color2), L_2, L_3, L_4, L_5, L_6, L_7, L_8, L_9, L_10, L_11, L_12, L_13, L_14, L_15, L_16, L_17, L_18, L_19, (uint32_t*)L_20, /*hidden argument*/NULL); return L_21; } } // System.Boolean UnityEngine.TextGenerator::Populate_Internal(System.String,UnityEngine.Font,UnityEngine.Color,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,UnityEngine.VerticalWrapMode,UnityEngine.HorizontalWrapMode,System.Boolean,UnityEngine.TextAnchor,UnityEngine.Vector2,UnityEngine.Vector2,System.Boolean,System.Boolean,UnityEngine.TextGenerationError&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_m42F7FED165D62BFD9C006D19A0FCE5B70C1EF92B (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___extents15, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___pivot16, bool ___generateOutOfBounds17, bool ___alignByGeometry18, int32_t* ___error19, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (TextGenerator_Populate_Internal_m42F7FED165D62BFD9C006D19A0FCE5B70C1EF92B_MetadataUsageId); s_Il2CppMethodInitialized = true; } uint32_t V_0 = 0; bool V_1 = false; bool V_2 = false; bool V_3 = false; { Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_0 = ___font1; IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var); bool L_1 = Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C(L_0, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL); V_2 = L_1; bool L_2 = V_2; if (!L_2) { goto IL_0015; } } { int32_t* L_3 = ___error19; *((int32_t*)L_3) = (int32_t)4; V_3 = (bool)0; goto IL_0063; } IL_0015: { V_0 = 0; String_t* L_4 = ___str0; Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_5 = ___font1; Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_6 = ___color2; int32_t L_7 = ___fontSize3; float L_8 = ___scaleFactor4; float L_9 = ___lineSpacing5; int32_t L_10 = ___style6; bool L_11 = ___richText7; bool L_12 = ___resizeTextForBestFit8; int32_t L_13 = ___resizeTextMinSize9; int32_t L_14 = ___resizeTextMaxSize10; int32_t L_15 = ___verticalOverFlow11; int32_t L_16 = ___horizontalOverflow12; bool L_17 = ___updateBounds13; int32_t L_18 = ___anchor14; Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_19 = ___extents15; float L_20 = L_19.get_x_0(); Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_21 = ___extents15; float L_22 = L_21.get_y_1(); Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_23 = ___pivot16; float L_24 = L_23.get_x_0(); Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_25 = ___pivot16; float L_26 = L_25.get_y_1(); bool L_27 = ___generateOutOfBounds17; bool L_28 = ___alignByGeometry18; bool L_29 = TextGenerator_Populate_Internal_mCA54081A0855AED6EC6345265603409FE330985C(__this, L_4, L_5, L_6, L_7, L_8, L_9, L_10, L_11, L_12, L_13, L_14, L_15, L_16, L_17, L_18, L_20, L_22, L_24, L_26, L_27, L_28, (uint32_t*)(&V_0), /*hidden argument*/NULL); V_1 = L_29; int32_t* L_30 = ___error19; uint32_t L_31 = V_0; *((int32_t*)L_30) = (int32_t)L_31; bool L_32 = V_1; V_3 = L_32; goto IL_0063; } IL_0063: { bool L_33 = V_3; return L_33; } } // System.Void UnityEngine.TextGenerator::GetVerticesInternal(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___vertices0, const RuntimeMethod* method) { typedef void (*TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *, RuntimeObject *); static TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::GetVerticesInternal(System.Object)"); _il2cpp_icall_func(__this, ___vertices0); } // System.Void UnityEngine.TextGenerator::GetCharactersInternal(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___characters0, const RuntimeMethod* method) { typedef void (*TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *, RuntimeObject *); static TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::GetCharactersInternal(System.Object)"); _il2cpp_icall_func(__this, ___characters0); } // System.Void UnityEngine.TextGenerator::GetLinesInternal(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___lines0, const RuntimeMethod* method) { typedef void (*TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *, RuntimeObject *); static TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::GetLinesInternal(System.Object)"); _il2cpp_icall_func(__this, ___lines0); } // System.Void UnityEngine.TextGenerator::get_rectExtents_Injected(UnityEngine.Rect&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, Rect_t35B976DE901B5423C11705E156938EA27AB402CE * ___ret0, const RuntimeMethod* method) { typedef void (*TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *, Rect_t35B976DE901B5423C11705E156938EA27AB402CE *); static TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::get_rectExtents_Injected(UnityEngine.Rect&)"); _il2cpp_icall_func(__this, ___ret0); } // System.Boolean UnityEngine.TextGenerator::Populate_Internal_Injected(System.String,UnityEngine.Font,UnityEngine.Color&,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,UnityEngine.TextAnchor,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.UInt32&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, float ___extentsX15, float ___extentsY16, float ___pivotX17, float ___pivotY18, bool ___generateOutOfBounds19, bool ___alignByGeometry20, uint32_t* ___error21, const RuntimeMethod* method) { typedef bool (*TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *, String_t*, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 *, int32_t, float, float, int32_t, bool, bool, int32_t, int32_t, int32_t, int32_t, bool, int32_t, float, float, float, float, bool, bool, uint32_t*); static TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::Populate_Internal_Injected(System.String,UnityEngine.Font,UnityEngine.Color&,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,UnityEngine.TextAnchor,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.UInt32&)"); bool retVal = _il2cpp_icall_func(__this, ___str0, ___font1, ___color2, ___fontSize3, ___scaleFactor4, ___lineSpacing5, ___style6, ___richText7, ___resizeTextForBestFit8, ___resizeTextMinSize9, ___resizeTextMaxSize10, ___verticalOverFlow11, ___horizontalOverflow12, ___updateBounds13, ___anchor14, ___extentsX15, ___extentsY16, ___pivotX17, ___pivotY18, ___generateOutOfBounds19, ___alignByGeometry20, ___error21); return retVal; } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.String UnityEngine.TextMesh::get_text() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* TextMesh_get_text_m82229563FBF187061DDBCB5305CB227513B6ED83 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, const RuntimeMethod* method) { typedef String_t* (*TextMesh_get_text_m82229563FBF187061DDBCB5305CB227513B6ED83_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *); static TextMesh_get_text_m82229563FBF187061DDBCB5305CB227513B6ED83_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_get_text_m82229563FBF187061DDBCB5305CB227513B6ED83_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::get_text()"); String_t* retVal = _il2cpp_icall_func(__this); return retVal; } // System.Void UnityEngine.TextMesh::set_text(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextMesh_set_text_m64242AB987CF285F432E7AED38F24FF855E9B220 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, String_t* ___value0, const RuntimeMethod* method) { typedef void (*TextMesh_set_text_m64242AB987CF285F432E7AED38F24FF855E9B220_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *, String_t*); static TextMesh_set_text_m64242AB987CF285F432E7AED38F24FF855E9B220_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_set_text_m64242AB987CF285F432E7AED38F24FF855E9B220_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::set_text(System.String)"); _il2cpp_icall_func(__this, ___value0); } // UnityEngine.Font UnityEngine.TextMesh::get_font() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * TextMesh_get_font_m6F27BBEAB80E50B5892B4D05AAA55433147A9BA8 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, const RuntimeMethod* method) { typedef Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * (*TextMesh_get_font_m6F27BBEAB80E50B5892B4D05AAA55433147A9BA8_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *); static TextMesh_get_font_m6F27BBEAB80E50B5892B4D05AAA55433147A9BA8_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_get_font_m6F27BBEAB80E50B5892B4D05AAA55433147A9BA8_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::get_font()"); Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * retVal = _il2cpp_icall_func(__this); return retVal; } // System.Void UnityEngine.TextMesh::set_font(UnityEngine.Font) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextMesh_set_font_m88D7BE43E5C6C6649F331747C8604742829B0B25 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___value0, const RuntimeMethod* method) { typedef void (*TextMesh_set_font_m88D7BE43E5C6C6649F331747C8604742829B0B25_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *); static TextMesh_set_font_m88D7BE43E5C6C6649F331747C8604742829B0B25_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_set_font_m88D7BE43E5C6C6649F331747C8604742829B0B25_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::set_font(UnityEngine.Font)"); _il2cpp_icall_func(__this, ___value0); } // System.Int32 UnityEngine.TextMesh::get_fontSize() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TextMesh_get_fontSize_mE32BD6ABC8B2077293886D533AA9E73ABFA17528 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, const RuntimeMethod* method) { typedef int32_t (*TextMesh_get_fontSize_mE32BD6ABC8B2077293886D533AA9E73ABFA17528_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *); static TextMesh_get_fontSize_mE32BD6ABC8B2077293886D533AA9E73ABFA17528_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_get_fontSize_mE32BD6ABC8B2077293886D533AA9E73ABFA17528_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::get_fontSize()"); int32_t retVal = _il2cpp_icall_func(__this); return retVal; } // System.Void UnityEngine.TextMesh::set_fontSize(System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextMesh_set_fontSize_m6701886D6E870EF23C2462B1BE7F67903A2649BA (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, int32_t ___value0, const RuntimeMethod* method) { typedef void (*TextMesh_set_fontSize_m6701886D6E870EF23C2462B1BE7F67903A2649BA_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *, int32_t); static TextMesh_set_fontSize_m6701886D6E870EF23C2462B1BE7F67903A2649BA_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_set_fontSize_m6701886D6E870EF23C2462B1BE7F67903A2649BA_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::set_fontSize(System.Int32)"); _il2cpp_icall_func(__this, ___value0); } // UnityEngine.FontStyle UnityEngine.TextMesh::get_fontStyle() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TextMesh_get_fontStyle_mFB54E0326F711208B20AB94FC50224722F706255 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, const RuntimeMethod* method) { typedef int32_t (*TextMesh_get_fontStyle_mFB54E0326F711208B20AB94FC50224722F706255_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *); static TextMesh_get_fontStyle_mFB54E0326F711208B20AB94FC50224722F706255_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_get_fontStyle_mFB54E0326F711208B20AB94FC50224722F706255_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::get_fontStyle()"); int32_t retVal = _il2cpp_icall_func(__this); return retVal; } // System.Void UnityEngine.TextMesh::set_anchor(UnityEngine.TextAnchor) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextMesh_set_anchor_m013CFCFA46AB8478ADD1C4818FAAD90596BF4E15 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, int32_t ___value0, const RuntimeMethod* method) { typedef void (*TextMesh_set_anchor_m013CFCFA46AB8478ADD1C4818FAAD90596BF4E15_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *, int32_t); static TextMesh_set_anchor_m013CFCFA46AB8478ADD1C4818FAAD90596BF4E15_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_set_anchor_m013CFCFA46AB8478ADD1C4818FAAD90596BF4E15_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::set_anchor(UnityEngine.TextAnchor)"); _il2cpp_icall_func(__this, ___value0); } // System.Single UnityEngine.TextMesh::get_characterSize() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float TextMesh_get_characterSize_mA9E10AD8BA0E9D9AC2709FCDAEFB5F37E2C1E8BC (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, const RuntimeMethod* method) { typedef float (*TextMesh_get_characterSize_mA9E10AD8BA0E9D9AC2709FCDAEFB5F37E2C1E8BC_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *); static TextMesh_get_characterSize_mA9E10AD8BA0E9D9AC2709FCDAEFB5F37E2C1E8BC_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_get_characterSize_mA9E10AD8BA0E9D9AC2709FCDAEFB5F37E2C1E8BC_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::get_characterSize()"); float retVal = _il2cpp_icall_func(__this); return retVal; } // System.Void UnityEngine.TextMesh::set_richText(System.Boolean) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextMesh_set_richText_mEA6ACA489617BC48D2317385C92C542C5EFD15CA (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, bool ___value0, const RuntimeMethod* method) { typedef void (*TextMesh_set_richText_mEA6ACA489617BC48D2317385C92C542C5EFD15CA_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *, bool); static TextMesh_set_richText_mEA6ACA489617BC48D2317385C92C542C5EFD15CA_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_set_richText_mEA6ACA489617BC48D2317385C92C542C5EFD15CA_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::set_richText(System.Boolean)"); _il2cpp_icall_func(__this, ___value0); } // UnityEngine.Color UnityEngine.TextMesh::get_color() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 TextMesh_get_color_mA250B3D12AF6830CE95476B8939A84C26C0161E9 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, const RuntimeMethod* method) { Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 V_0; memset((&V_0), 0, sizeof(V_0)); { TextMesh_get_color_Injected_m22B6B96B44E685B651AEFB28DC408AB52BA05B98(__this, (Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 *)(&V_0), /*hidden argument*/NULL); Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_0 = V_0; return L_0; } } // System.Void UnityEngine.TextMesh::set_color(UnityEngine.Color) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextMesh_set_color_mF86B9E8CD0F9FD387AF7D543337B5C14DFE67AF0 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___value0, const RuntimeMethod* method) { { TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA(__this, (Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 *)(&___value0), /*hidden argument*/NULL); return; } } // System.Void UnityEngine.TextMesh::get_color_Injected(UnityEngine.Color&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextMesh_get_color_Injected_m22B6B96B44E685B651AEFB28DC408AB52BA05B98 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * ___ret0, const RuntimeMethod* method) { typedef void (*TextMesh_get_color_Injected_m22B6B96B44E685B651AEFB28DC408AB52BA05B98_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 *); static TextMesh_get_color_Injected_m22B6B96B44E685B651AEFB28DC408AB52BA05B98_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_get_color_Injected_m22B6B96B44E685B651AEFB28DC408AB52BA05B98_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::get_color_Injected(UnityEngine.Color&)"); _il2cpp_icall_func(__this, ___ret0); } // System.Void UnityEngine.TextMesh::set_color_Injected(UnityEngine.Color&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * ___value0, const RuntimeMethod* method) { typedef void (*TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 *); static TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::set_color_Injected(UnityEngine.Color&)"); _il2cpp_icall_func(__this, ___value0); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void UnityEngine.UIVertex::.cctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void UIVertex__cctor_m86F60F5BB996D3C59B19B80C4BFB5770802BFB30 (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UIVertex__cctor_m86F60F5BB996D3C59B19B80C4BFB5770802BFB30_MetadataUsageId); s_Il2CppMethodInitialized = true; } UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 V_0; memset((&V_0), 0, sizeof(V_0)); { Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 L_0; memset((&L_0), 0, sizeof(L_0)); Color32__ctor_m1AEF46FBBBE4B522E6984D081A3D158198E10AA2((&L_0), (uint8_t)((int32_t)255), (uint8_t)((int32_t)255), (uint8_t)((int32_t)255), (uint8_t)((int32_t)255), /*hidden argument*/NULL); ((UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields*)il2cpp_codegen_static_fields_for(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var))->set_s_DefaultColor_8(L_0); Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E L_1; memset((&L_1), 0, sizeof(L_1)); Vector4__ctor_m545458525879607A5392A10B175D0C19B2BC715D((&L_1), (1.0f), (0.0f), (0.0f), (-1.0f), /*hidden argument*/NULL); ((UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields*)il2cpp_codegen_static_fields_for(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var))->set_s_DefaultTangent_9(L_1); il2cpp_codegen_initobj((&V_0), sizeof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 )); IL2CPP_RUNTIME_CLASS_INIT(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_il2cpp_TypeInfo_var); Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_2 = Vector3_get_zero_m3CDDCAE94581DF3BB16C4B40A100E28E9C6649C2(/*hidden argument*/NULL); (&V_0)->set_position_0(L_2); Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_3 = Vector3_get_back_mE7EF8625637E6F8B9E6B42A6AE140777C51E02F7(/*hidden argument*/NULL); (&V_0)->set_normal_1(L_3); Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E L_4 = ((UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields*)il2cpp_codegen_static_fields_for(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var))->get_s_DefaultTangent_9(); (&V_0)->set_tangent_2(L_4); Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 L_5 = ((UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields*)il2cpp_codegen_static_fields_for(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var))->get_s_DefaultColor_8(); (&V_0)->set_color_3(L_5); IL2CPP_RUNTIME_CLASS_INIT(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_il2cpp_TypeInfo_var); Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_6 = Vector2_get_zero_mFE0C3213BB698130D6C5247AB4B887A59074D0A8(/*hidden argument*/NULL); (&V_0)->set_uv0_4(L_6); Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_7 = Vector2_get_zero_mFE0C3213BB698130D6C5247AB4B887A59074D0A8(/*hidden argument*/NULL); (&V_0)->set_uv1_5(L_7); Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_8 = Vector2_get_zero_mFE0C3213BB698130D6C5247AB4B887A59074D0A8(/*hidden argument*/NULL); (&V_0)->set_uv2_6(L_8); Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_9 = Vector2_get_zero_mFE0C3213BB698130D6C5247AB4B887A59074D0A8(/*hidden argument*/NULL); (&V_0)->set_uv3_7(L_9); UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 L_10 = V_0; ((UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields*)il2cpp_codegen_static_fields_for(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var))->set_simpleVert_10(L_10); return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif
[ "bluelaserpointer@yahoo.co.jp" ]
bluelaserpointer@yahoo.co.jp
91a0179224d5554623f37403ebac3d4cab6052c5
1995c9a4daf04371b1a5ffd4da93bab94f4b7d04
/src/TimeTick.cpp
dadf10a2b9ea13100b337315f8b190bd7f0e2262
[]
no_license
RomeliFeng/BWDK
06705dc713cf817d17de5cd0c567a6a00b1638cd
176eb487c7c9cefdeed4f6e26e3d84afd81a3698
refs/heads/master
2021-06-21T21:43:20.803351
2017-06-12T14:43:03
2017-06-12T14:43:03
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,431
cpp
/* * TimeTick.cpp * * Created on: 2017��1��11�� * Author: Romeli */ #include "TimeTick.h" #define TIM_Interval 100 //n*100uS TimeTickClass TimeTick; void TimeTickClass::TIMInit() { TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE); TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseStructure.TIM_Prescaler = SystemCoreClock / 10000; TIM_TimeBaseStructure.TIM_Period = TIM_Interval; TIM_TimeBaseStructure.TIM_RepetitionCounter = 0; TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure); } void TimeTickClass::NVICInit() { NVIC_InitTypeDef NVIC_InitStructure; NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1); NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 5; NVIC_Init(&NVIC_InitStructure); TIM_ITConfig(TIM3, TIM_IT_Update, ENABLE); TIM_Cmd(TIM3, ENABLE); } void __attribute__((weak)) TimeTickISR() { } extern "C" void TIM3_IRQHandler(void) { if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) { TIM_Cmd(TIM3,DISABLE); if (TimeTick.ThreadStart) { TimeTickISR(); } TIM_ClearITPendingBit(TIM3, TIM_IT_Update); TIM_Cmd(TIM3,ENABLE); } }
[ "Romeli@Romeli-LP.lan" ]
Romeli@Romeli-LP.lan
48ad09f6ec1269d78b24d4a0d5559e37be674e2c
924543e47fb5e50518bcb16392d8d102e44b9f09
/C++提高编程/06-模板-普通函数与函数模板调用规则.cpp
3f20458ba40a78213f4d4294047e83b7ee903a07
[]
no_license
LiuWenlin595/C-Study
037e5f7885b75119c8c2973bd353fb00d05769a7
4d86bd60af53c874a5119d1f737238c75737da1d
refs/heads/master
2023-06-29T13:11:11.971442
2021-08-07T16:08:12
2021-08-07T16:08:12
393,727,711
0
0
null
null
null
null
UTF-8
C++
false
false
1,543
cpp
#include <iostream> using namespace std; // 普通函数与函数模板调用规则(发生重载的情况) // 1. 如果函数模板和普通函数都可以实现, 优先调用普通函数, 即使普通函数只有声明也会调用普通函数然后报错 // 2. 可以通过空模板参数列表来强制调用函数模板 // 3. 函数模板也可以发生重载 // 4. 如果函数模板可以产生更好的匹配, 优先调用函数模板 // 既然提供了函数模板, 最好不要使用普通函数 int myPrint(int a, int b) { cout << "调用的普通函数" << endl; return 0; } template<typename T> T myPrint(T a, T b) { cout << "调用的函数模板" << endl; return 0; } template<typename T> T myPrint(T a, T b, T c) { cout << "调用的函数模板的重载" << endl; return 0; } int main() { // 函数模板注意事项 int a = 10; int b = 20; int c = 30; // 1. 如果函数模板和普通函数都可以实现, 优先调用普通函数, 即使普通函数只有声明也会调用普通函数然后报错 myPrint(a, b); // 2. 可以通过空模板参数列表来强制调用函数模板 myPrint<>(a, b); // 3. 函数模板也可以发生重载 myPrint(a, b, c); // 4. 如果函数模板可以产生更好的匹配, 优先调用函数模板 // 调用普通函数需要做隐式类型转换, 而函数模板可以直接指定T为char, 所以函数模板是一个更好的匹配 char c1 = 'a'; char c2 = 'b'; myPrint(c1, c2); return 0; }
[ "978714041@qq.com" ]
978714041@qq.com
7b3c9d9c354165200bfcae2623b28f80b37a10eb
e45b411ed064c9f4323d38cadae04b3a7b458fbc
/CIS375Project/Time.h
1e9c485dcdc33fa3a48f1e7bae7391cd056891a8
[]
no_license
oajerd/CIS375-Project
1c8e42b976d6de9f9b16c2e3faaf54f257c80944
5621d83eaa62feec504196919ca717b9bd0f0663
refs/heads/master
2020-04-29T13:39:10.613696
2019-04-22T19:27:10
2019-04-22T19:27:10
176,174,754
0
0
null
null
null
null
UTF-8
C++
false
false
494
h
#ifndef _TIME_H #define _TIME_H #include <iomanip> struct Time { public: int hours; int minutes; Time(int h = 0, int m = 0) { hours = h; minutes = m; } void setTime(int h = 0, int m = 0) { hours = h; minutes = m; } void operator =(const Time& obj) { hours = obj.hours; minutes = obj.minutes; } string displayTime() { string m = ""; if (minutes < 10) { m = "0"; } return to_string(hours) + ":" + m + to_string(minutes); } }; #endif
[ "abdelhaq642@gmail.com" ]
abdelhaq642@gmail.com
70a71f99484f45855e0345487736b55d3c1c5959
f1fd3b23ac060aeac7143e7c05d650912b83eb88
/libcef/browser/osr/browser_platform_delegate_osr.h
28871be2afcc7a2e09ee4050c720f212c1944c68
[ "BSD-3-Clause" ]
permissive
cloudscrape/cef
a8b99cedeaf3eafdc0de36701a13f3d4c84abb62
99bf1b8458b104b1bb8d2d24ce1691a248d77f37
refs/heads/master
2021-01-09T20:47:12.797880
2016-05-29T01:58:53
2016-05-29T02:00:28
60,127,479
2
0
null
null
null
null
UTF-8
C++
false
false
4,439
h
// Copyright 2015 The Chromium Embedded Framework Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CEF_LIBCEF_BROWSER_OSR_BROWSER_PLATFORM_DELEGATE_OSR_H_ #define CEF_LIBCEF_BROWSER_OSR_BROWSER_PLATFORM_DELEGATE_OSR_H_ #include "libcef/browser/browser_platform_delegate.h" #include "libcef/browser/native/browser_platform_delegate_native.h" class CefRenderWidgetHostViewOSR; class CefWebContentsViewOSR; // Base implementation of windowless browser functionality. class CefBrowserPlatformDelegateOsr : public CefBrowserPlatformDelegate, public CefBrowserPlatformDelegateNative::WindowlessHandler { public: // CefBrowserPlatformDelegate methods: void CreateViewForWebContents( content::WebContentsView** view, content::RenderViewHostDelegateView** delegate_view) override; void WebContentsCreated(content::WebContents* web_contents) override; void BrowserCreated(CefBrowserHostImpl* browser) override; void BrowserDestroyed(CefBrowserHostImpl* browser) override; void WasResized() override; void SendKeyEvent(const content::NativeWebKeyboardEvent& event) override; void SendMouseEvent(const blink::WebMouseEvent& event) override; void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event) override; void SendFocusEvent(bool setFocus) override; gfx::Point GetScreenPoint(const gfx::Point& view) const override; void ViewText(const std::string& text) override; void HandleKeyboardEvent( const content::NativeWebKeyboardEvent& event) override; void HandleExternalProtocol(const GURL& url) override; void TranslateKeyEvent(content::NativeWebKeyboardEvent& result, const CefKeyEvent& key_event) const override; void TranslateClickEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, bool mouseUp, int clickCount) const override; void TranslateMoveEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, bool mouseLeave) const override; void TranslateWheelEvent(blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, int deltaX, int deltaY) const override; CefEventHandle GetEventHandle( const content::NativeWebKeyboardEvent& event) const override; std::unique_ptr<CefFileDialogRunner> CreateFileDialogRunner() override; std::unique_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner() override; std::unique_ptr<CefMenuRunner> CreateMenuRunner() override; bool IsWindowless() const override; bool IsViewsHosted() const override; void WasHidden(bool hidden) override; void NotifyScreenInfoChanged() override; void Invalidate(cef_paint_element_type_t type) override; void SetWindowlessFrameRate(int frame_rate) override; void DragTargetDragEnter(CefRefPtr<CefDragData> drag_data, const CefMouseEvent& event, cef_drag_operations_mask_t allowed_ops) override; void DragTargetDragOver(const CefMouseEvent& event, cef_drag_operations_mask_t allowed_ops) override; void DragTargetDragLeave() override; void DragTargetDrop(const CefMouseEvent& event) override; void DragSourceEndedAt(int x, int y, cef_drag_operations_mask_t op) override; void DragSourceSystemDragEnded() override; // CefBrowserPlatformDelegateNative::WindowlessHandler methods: CefWindowHandle GetParentWindowHandle() const override; gfx::Point GetParentScreenPoint(const gfx::Point& view) const override; protected: // Platform-specific behaviors will be delegated to |native_delegate|. explicit CefBrowserPlatformDelegateOsr( std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate); // Returns the primary OSR host view for the underlying browser. If a // full-screen host view currently exists then it will be returned. Otherwise, // the main host view will be returned. CefRenderWidgetHostViewOSR* GetOSRHostView() const; std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate_; CefWebContentsViewOSR* view_osr_; // Not owned by this class. }; #endif // CEF_LIBCEF_BROWSER_OSR_BROWSER_PLATFORM_DELEGATE_OSR_H_
[ "magreenblatt@gmail.com" ]
magreenblatt@gmail.com
db83c24da968ef3b47ac284902f069a36540b25f
a70643053d6f8bc8de2864f75381b36d749d45f7
/MODUL 4/4.5/main.cpp
e44993be9f6bb4270055d4d5ef083ef18de76489
[]
no_license
AyuDwi/AyuDwi-GK-160411100132
44a2f7ee5e8a6076aab76542055e9af3c52f5926
04b4b1dc2ec5b7275bf938486f1678e05ec12549
refs/heads/master
2021-04-12T02:05:41.612218
2018-06-07T14:43:41
2018-06-07T14:43:41
125,691,213
0
0
null
null
null
null
UTF-8
C++
false
false
2,096
cpp
#include <windows.h> #ifdef __APPLE__ #include <GLUT/glut.h> #else #include <GL/glut.h> #endif #include <math.h> void lingkaran(){ glColor3f (1, 1, 0); float t = 0.0; glBegin(GL_POINTS); for(t = 0.0; t<2*3.14; t+=0.01){ glVertex2f(7*cos(t),7*sin(t)); } glEnd(); } void lima(){ //persegi besar for (int i=0; i<2; i++){ glRotated(180,0,0,1.0); glColor3f(0,0,1); glRectf(-1,6,1,8); } for (int i=0; i<2; i++){ glRotated(180,0,0,1.0); glColor3f(0,0,1); glRectf(-7,-4.5,-5,-2.5); } for (int i=0; i<2; i++){ glRotated(180,0,0,1.0); glColor3f(0,0,1); glRectf(-7,2.5,-5,4.5); } for (int i=0; i<2; i++){ glRotated(180,0,0,1.0); glColor3f(0,0,1); glRectf(-1,6,1,8); } //persegi kecil for (int i=0; i<6; i++){ glRotated(180,0,0,1.0); glColor3f(0,0,1); glRectf(-7.7,-0.7,-6.2,0.7); } for (int i=0; i<6; i++){ glRotated(180,0,0,1.0); glColor3f(0,0,1); glRectf(-4.2,-6.8,-2.7,-5.4); } for (int i=0; i<6; i++){ glRotated(180,0,0,1.0); glColor3f(0,0,1); glRectf(-4.2,6.8,-2.7,5.4); } } void lines(){ glEnd(); glColor3f(1,1,0); glBegin(GL_LINES); glVertex2f(0,10); glVertex2f(0,-10); glVertex2f(10,0); glVertex2f(-10,0); glEnd(); } void display(void){ /* bersihkan layar */ glClear (GL_COLOR_BUFFER_BIT); lines(); lima(); lingkaran(); glLoadIdentity(); glFlush (); } void myinit(){ glClearColor(0, 0, 0, 0); glMatrixMode(GL_PROJECTION); gluOrtho2D(-10.0, 10.0, -10.0, 10.0); glMatrixMode(GL_MODELVIEW); } int main(int argc, char *argv[]){ glutInit(&argc,argv); glutInitWindowSize(800,800); glutInitWindowPosition(100,100); glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE); glutCreateWindow("Transformasi Geometri"); glutDisplayFunc(display); myinit(); glutMainLoop(); return 0; }
[ "noreply@github.com" ]
AyuDwi.noreply@github.com
2101f6e3c1b459db06947448888e805eecef543f
5d7739bd360a447ee1c7285483d2f37d521fa99e
/Volume 107 (10700-10799)/10715.cpp
8bc895ed359e0b32fed8a22b40417bff98460226
[]
no_license
aaafwd/Online-Judge
c4b23272d95a1c1f73cc3da2c95be8087a3d523c
b264f445db2787c5fc40ddef8eb3139adae72608
refs/heads/main
2023-04-02T01:01:26.303389
2021-04-11T14:17:58
2021-04-11T14:17:58
356,840,772
1
0
null
null
null
null
UTF-8
C++
false
false
2,170
cpp
/* @JUDGE_ID: 19899RK 10715 C++ "By Anadan" */ // Cat // Accepted (0.037 seconds with low memory spent) #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int N; struct Number { double x; int i; } arr[128]; double sum, res; char mask[128]; int sort_function(const void *a, const void *b) { if (((Number*)a)->x > ((Number*)b)->x) return -1; return 1; } inline int isGood(double curr) { if (fabs(sum-curr-curr) <= 0.02 * curr) { return 1; } return 0; } int localSearch(double curr) { int i, j; double tmp; for (i = N-1; i >= 0; --i) if (!mask[i]) break; for (j = 0; j < N; ++j) { if (mask[j]) { tmp = curr - arr[j].x + arr[i].x; if (isGood(tmp)) { mask[j] = 0; mask[i] = 1; return 1; } } } return 0; } int generate(int i, double curr) { double tmp; if (isGood(curr)) return 1; if (i >= N) return 0; tmp = curr + (N-i)*arr[N-1].x; if (tmp < curr-tmp && !isGood(tmp)) return 0; if ((curr)*2 > sum+1e-12) { // if ((curr + arr[N-1].x)*2 > sum+1e-12) { if (localSearch(curr)) return 1; return 0; } if (i == 0) { mask[i] = 1; return generate(i+1, curr+arr[i].x); } if (rand() & 1) { if (generate(i+1, curr)) return 1; mask[i] = 1; if (generate(i+1, curr+arr[i].x)) return 1; } else { mask[i] = 1; if (generate(i+1, curr+arr[i].x)) return 1; mask[i] = 0; if (generate(i+1, curr)) return 1; } mask[i] = 0; return 0; } int main() { int i; while (scanf("%d", &N) == 1 && N) { // Accepted (0.281 seconds using as much as 392 kbytes) // srand(321); // Accepted (0.037 seconds with low memory spent) srand(2003); sum = 0; for (i = 0; i < N; ++i) { scanf("%lf", &arr[i].x); arr[i].i = i; sum += arr[i].x; } qsort(arr, N, sizeof(arr[0]), sort_function); res = -1; memset(mask, 0, sizeof(mask)); generate(0, 0); int out = 0; for (i = 0; i < N; ++i) { if (mask[i]) { if (out) putchar(' '); printf("%d", arr[i].i + 1); out = 1; } } putchar('\n'); } return 0; } /* @END_OF_SOURCE_CODE */
[ "noreply@github.com" ]
aaafwd.noreply@github.com
f4035d054718196f0cc5da10ba5d8a2d1fbe4962
943dd54918355e8028fdd759bae6d9dd837e11e0
/tests/hosted/test_modules.cpp
a93ebfac388a48d6292caf145990f55b3117d5b6
[ "BSD-3-Clause" ]
permissive
fieldkit/firmware
06e920ad01c2f48142413d3a3447188bc9753004
45c51ce8dc51df886875e97de17980c839882adf
refs/heads/main
2023-08-23T22:29:02.022772
2023-07-24T22:18:01
2023-07-24T22:18:01
183,808,180
11
1
BSD-3-Clause
2023-04-04T20:42:38
2019-04-27T18:27:51
C++
UTF-8
C++
false
false
4,919
cpp
#include <hal/hal.h> #include "test_modules.h" #include "modules/shared/modules.h" namespace fk { static ModuleSensors fk_module_fake_empty_sensors = { .nsensors = 0, .sensors = nullptr, }; class FakeModuleEmpty : public FakeModule { public: ModuleReturn initialize(ModuleContext mc, Pool &pool) override { return { ModuleStatus::Ok }; } ModuleReturn api(ModuleContext mc, HttpServerConnection *connection, Pool &pool) { return { ModuleStatus::Ok }; } ModuleReturn service(ModuleContext mc, Pool &pool) { return { ModuleStatus::Ok }; } ModuleSensors const *get_sensors(Pool &pool) override { return &fk_module_fake_empty_sensors; } ModuleConfiguration const get_configuration(Pool &pool) override { return { "modules.fake.empty" }; } ModuleReadings *take_readings(ReadingsContext mc, Pool &pool) override { return nullptr; } }; static Module *fk_test_module_create_empty(Pool &pool) { return new (pool) FakeModuleEmpty(); } ModuleMetadata const fk_test_module_fake_empty = { .manufacturer = FK_MODULES_MANUFACTURER, .kind = FK_MODULES_KIND_RANDOM, .version = 0x03, .name = "fake-empty", .flags = 0, .ctor = fk_test_module_create_empty, }; static SensorMetadata const fk_module_fake_1_sensor_metas[] = { { .name = "sensor", .unitOfMeasure = "", .flags = 0 }, }; static ModuleSensors fk_module_fake_1_sensors = { .nsensors = sizeof(fk_module_fake_1_sensor_metas) / sizeof(SensorMetadata), .sensors = fk_module_fake_1_sensor_metas, }; ModuleSensors const *FakeModule1::get_sensors(Pool &pool) { return &fk_module_fake_1_sensors; } ModuleReadings *FakeModule1::take_readings(ReadingsContext mc, Pool &pool) { if (return_none_) { return nullptr; } auto mr = new (pool) NModuleReadings<1>(); mr->set(0, SensorReading{ mc.now(), (float)fk_random_i32(20, 100) }); return mr; } static Module *fk_test_module_create_1(Pool &pool) { return new (pool) FakeModule1(); } ModuleMetadata const fk_test_module_fake_1 = { .manufacturer = FK_MODULES_MANUFACTURER, .kind = FK_MODULES_KIND_RANDOM, .version = 0x02, .name = "fake-1", .flags = 0, .ctor = fk_test_module_create_1, }; static SensorMetadata const fk_module_fake_2_sensor_metas[] = { { .name = "sensor-0", .unitOfMeasure = "", .flags = 0 }, { .name = "sensor-1", .unitOfMeasure = "", .flags = 0 }, { .name = "sensor-2", .unitOfMeasure = "", .flags = 0 }, { .name = "sensor-3", .unitOfMeasure = "", .flags = 0 }, { .name = "sensor-4", .unitOfMeasure = "", .flags = 0 }, { .name = "sensor-5", .unitOfMeasure = "", .flags = 0 }, { .name = "sensor-6", .unitOfMeasure = "", .flags = 0 }, { .name = "sensor-7", .unitOfMeasure = "", .flags = 0 }, { .name = "sensor-8", .unitOfMeasure = "", .flags = 0 }, { .name = "sensor-9", .unitOfMeasure = "", .flags = 0 }, }; static ModuleSensors fk_module_fake_2_sensors = { .nsensors = sizeof(fk_module_fake_2_sensor_metas) / sizeof(SensorMetadata), .sensors = fk_module_fake_2_sensor_metas, }; class FakeModule2 : public FakeModule { public: ModuleReturn initialize(ModuleContext mc, Pool &pool) override { return { ModuleStatus::Ok }; } ModuleReturn api(ModuleContext mc, HttpServerConnection *connection, Pool &pool) { return { ModuleStatus::Ok }; } ModuleReturn service(ModuleContext mc, Pool &pool) { return { ModuleStatus::Ok }; } ModuleSensors const *get_sensors(Pool &pool) override { return &fk_module_fake_2_sensors; } ModuleConfiguration const get_configuration(Pool &pool) override { return { "modules.fake.2" }; } ModuleReadings *take_readings(ReadingsContext mc, Pool &pool) override { auto mr = new (pool) NModuleReadings<10>(); for (size_t i = 0; i < mr->size(); i++) { mr->set(i, SensorReading{ mc.now(), (float)fk_random_i32(20, 100) }); } return mr; } }; static Module *fk_test_module_create_2(Pool &pool) { return new (pool) FakeModule2(); } ModuleMetadata const fk_test_module_fake_2 = { .manufacturer = FK_MODULES_MANUFACTURER, .kind = FK_MODULES_KIND_RANDOM, .version = 0x03, .name = "fake-2", .flags = FK_MODULES_FLAG_NONE, .ctor = fk_test_module_create_2, }; ModuleMetadata const fk_test_module_fake_random = { .manufacturer = FK_MODULES_MANUFACTURER, .kind = FK_MODULES_KIND_RANDOM, .version = 0x01, .name = "fake-random", .flags = FK_MODULES_FLAG_NONE, .ctor = fk_test_module_create_2, }; ModuleMetadata const fk_test_module_fake_diagnostics = { .manufacturer = FK_MODULES_MANUFACTURER, .kind = FK_MODULES_KIND_DIAGNOSTICS, .version = 0x01, .name = "fake-random", .flags = FK_MODULES_FLAG_NONE, .ctor = fk_test_module_create_2, }; } // namespace fk
[ "jlewallen@gmail.com" ]
jlewallen@gmail.com
3865ec6b7d449add51f0804b648398eb69c73f62
04b1803adb6653ecb7cb827c4f4aa616afacf629
/chrome/services/file_util/public/cpp/zip_file_creator.h
64f98e4573dd7697f56c5963df5745e430135083
[ "BSD-3-Clause" ]
permissive
Samsung/Castanets
240d9338e097b75b3f669604315b06f7cf129d64
4896f732fc747dfdcfcbac3d442f2d2d42df264a
refs/heads/castanets_76_dev
2023-08-31T09:01:04.744346
2021-07-30T04:56:25
2021-08-11T05:45:21
125,484,161
58
49
BSD-3-Clause
2022-10-16T19:31:26
2018-03-16T08:07:37
null
UTF-8
C++
false
false
2,601
h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_SERVICES_FILE_UTIL_PUBLIC_CPP_ZIP_FILE_CREATOR_H_ #define CHROME_SERVICES_FILE_UTIL_PUBLIC_CPP_ZIP_FILE_CREATOR_H_ #include <memory> #include "base/callback.h" #include "base/files/file.h" #include "base/files/file_path.h" #include "base/task/post_task.h" #include "chrome/services/file_util/public/mojom/zip_file_creator.mojom.h" namespace service_manager { class Connector; } // ZipFileCreator creates a ZIP file from a specified list of files and // directories under a common parent directory. This is done in a sandboxed // utility process to protect the browser process from handling arbitrary // input data from untrusted sources. // Note that this class deletes itself after calling the ResultCallback // specified in the constructor (and should be heap allocated). class ZipFileCreator { public: typedef base::Callback<void(bool)> ResultCallback; // Creates a zip file from the specified list of files and directories. ZipFileCreator(const ResultCallback& callback, const base::FilePath& src_dir, const std::vector<base::FilePath>& src_relative_paths, const base::FilePath& dest_file); // Starts creating the zip file. Must be called from the UI thread. // The result will be passed to |callback|. After the task is finished // and |callback| is run, ZipFileCreator instance is deleted. void Start(service_manager::Connector* connector); private: ~ZipFileCreator(); // Called after the dest_file |file| is opened on the blocking pool to // create the zip file in it using a sandboxed utility process. void CreateZipFile(service_manager::Connector* connector, base::File file); // Notifies by calling |callback| specified in the constructor the end of the // ZIP operation. Deletes this. void ReportDone(bool success); // The callback. ResultCallback callback_; // The source directory for input files. base::FilePath src_dir_; // The list of source files paths to be included in the zip file. // Entries are relative paths under directory |src_dir_|. std::vector<base::FilePath> src_relative_paths_; scoped_refptr<base::SequencedTaskRunner> directory_task_runner_; // The output zip file. base::FilePath dest_file_; chrome::mojom::ZipFileCreatorPtr zip_file_creator_ptr_; DISALLOW_COPY_AND_ASSIGN(ZipFileCreator); }; #endif // CHROME_SERVICES_FILE_UTIL_PUBLIC_CPP_ZIP_FILE_CREATOR_H_
[ "sunny.nam@samsung.com" ]
sunny.nam@samsung.com
e8fec2843bb183e99d4033bb6534e756201b015e
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/httpd/gumtree/httpd_new_hunk_420.cpp
0f79242cd6e00e21c707f56edc80936ba2c2122d
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,292
cpp
"<td><font size='-1' face='Arial,Helvetica' color='#ffffff'><b>Attribute</b></font></td>" "<td><font size='-1' face='Arial,Helvetica' color='#ffffff'><b>Value</b></font></td>" "<td><font size='-1' face='Arial,Helvetica' color='#ffffff'><b>Last Compare</b></font></td>" "<td><font size='-1' face='Arial,Helvetica' color='#ffffff'><b>Result</b></font></td>" "</tr>\n", r ); if (n) { for (i=0; i < n->compare_cache->size; ++i) { for (p = n->compare_cache->nodes[i]; p != NULL; p = p->next) { (*n->compare_cache->display)(r, n->compare_cache, p->payload); } } } ap_rputs("</table>\n</p>\n", r); break; case 'd': ap_rputs("<p>\n" "<table border='0'>\n" "<tr bgcolor='#000000'>\n" "<td><font size='-1' face='Arial,Helvetica' color='#ffffff'><b>Require DN</b></font></td>" "<td><font size='-1' face='Arial,Helvetica' color='#ffffff'><b>Actual DN</b></font></td>" "</tr>\n", r ); if (n) { for (i=0; i < n->dn_compare_cache->size; ++i) { for (p = n->dn_compare_cache->nodes[i]; p != NULL; p = p->next) { (*n->dn_compare_cache->display)(r, n->dn_compare_cache, p->payload); } } } ap_rputs("</table>\n</p>\n", r); break; default: break; } } else { buf = ""; } } else { ap_rputs("<p>\n" "<table border='0'>\n" "<tr bgcolor='#000000'>\n" "<td><font size='-1' face='Arial,Helvetica' color='#ffffff'><b>Cache Name</b></font></td>"
[ "993273596@qq.com" ]
993273596@qq.com
82bafda00457ee173d87bde40fe7cfae0c168418
46153c4d0d3457af0f055a0e3218f0ffb9a216e3
/Codechef/CC November 2018 PRDRG.cpp
4d071e2cb5339285f58b2e74708175bedde94858
[]
no_license
iamsaquib2508/Competitive-Programminng
c494e245b88d6e0cc366a331e8adf07f541f5576
02ddc436b9b3b8da8aac2544c3047bb4376087dc
refs/heads/master
2023-05-30T19:59:33.625016
2021-07-03T21:28:54
2021-07-03T21:28:54
274,222,778
0
0
null
null
null
null
UTF-8
C++
false
false
1,092
cpp
/* *************************** DONATE BLOOD, SAVE LIFE! ******************************** */ #include<bits/stdc++.h> #define ffr(i,a,b) for(i=a;i<b;i++) #define ffrr(i,a,b) for(i=a;i<=b;i++) #define ll long long int #define ld long double #define pb push_back #define pii pair<int,int> #define plolo pair<ll,ll> #define mm(a,b) memset(a,b,sizeof(a)) #define pf printf #define xx first #define yy second #define PI acos(-1.0) #define mp make_pair using namespace std; /* *************************** DONATE BLOOD, SAVE LIFE! ******************************** */ int main() { //ios_base::sync_with_stdio(0); //cin.tie(NULL); int T, n; cin >> T; while(T--) { cin >> n; int times=n/2; int mulfour=1, up=0, i; ffr(i,0,times) { up+=mulfour; mulfour*=4; } if(n&1) { mulfour+=mulfour; up+=up; up++; } cout << up << " " << mulfour << endl; } return 0; return 0; }
[ "1505018.mmi@ugrad.cse.buet.ac.bd" ]
1505018.mmi@ugrad.cse.buet.ac.bd
b6d970af59142bbad01f0937729bd005bbc06b19
d74424a1594ee2665c5d4e4f445ac0327a465ef7
/include/terminal.h
c2e13c7419c1618d682563e4a1707eef2dd74cb1
[]
no_license
miloshcurcic/uniEmulator
35383054076b58565323d47fd6b30c11c7004e25
6dbde4ac30ec2a248998fb458d745e701cad8c3f
refs/heads/master
2022-12-05T20:43:53.002697
2020-08-23T03:07:45
2020-08-23T03:07:45
285,934,394
0
0
null
null
null
null
UTF-8
C++
false
false
567
h
#ifndef _TERMINAL_H_ #define _TERMINAL_H_ #include "includes.h" #include <thread> #include <semaphore.h> struct termios; class Terminal { public: static void input_run(); static void start_terminal(); static void terminate(); static void initialize_terminal(); static void cleanup_terminal(); static void continue_input(); static void write_output(); static bool input_interrupt; private: static struct termios orig_termios; static bool running; static std::thread* input_thread; static sem_t input_lock; }; #endif
[ "miloshcurcic@gmail.com" ]
miloshcurcic@gmail.com
cbefd37ed732bc4bf3525f2c4fe6cd49e9c336bb
be4a072e7a476c0fac8013cd67223ed78c2ef727
/src/util/executor.cc
50e11cc778e2b834cf893a6fe0d8bfabc9153a56
[ "MIT" ]
permissive
agata-borkowska-clark/context-game-engine
269a9faada9269441ecd011ffc30cf21523c733b
6fd4c3a89472a7922032c2a45da42d107f75cf9c
refs/heads/main
2023-01-20T20:50:52.567677
2020-11-11T19:09:05
2020-11-11T19:09:05
307,088,723
0
0
null
null
null
null
UTF-8
C++
false
false
963
cc
#include "executor.h" #include <thread> namespace util { // Order time points in *descending* order so that they are put in *ascending* // order in a heap. static constexpr auto by_time = [](auto& l, auto& r) { return l.time > r.time; }; void executor::schedule(std::function<void()> f) noexcept { schedule_at(clock::now(), std::move(f)); } void executor::schedule_in(duration d, std::function<void()> f) noexcept { schedule_at(clock::now() + d, std::move(f)); } void serial_executor::schedule_at(time_point t, std::function<void()> f) noexcept { work_.push_back({t, std::move(f)}); std::push_heap(work_.begin(), work_.end(), by_time); } void serial_executor::run() { while (!work_.empty()) { std::pop_heap(work_.begin(), work_.end(), by_time); work_item work = std::move(work_.back()); work_.pop_back(); std::this_thread::sleep_until(work.time); work.resume(); } } } // namespace util
[ "scrumplesplunge@gmail.com" ]
scrumplesplunge@gmail.com
aec4607fc136e964cd1042aeaee2bfd5cff5fa45
3f932c56ba06bec3841986563a8d8dcf31b5d791
/src/grasp.cpp
6599585343c63a05b78aebce9b1f6213b6067014
[]
no_license
luishpmendes/MO824-atividade3
1a7a22c16b7dec14a38b75e122adc3f486dda926
5ba5e3cfcce1eda5d30fe409899e5a1586eb0aa5
refs/heads/master
2021-01-19T06:20:44.242107
2017-04-10T14:49:51
2017-04-10T14:49:51
87,455,084
0
0
null
null
null
null
UTF-8
C++
false
false
11,012
cpp
#include <iostream> #include <vector> #include <algorithm> #include <chrono> #include <iterator> #include <set> using namespace std; typedef unsigned int uint; typedef long int lint; typedef unsigned long int ulint; typedef vector < vector <double> > matrix; typedef pair < vector <uint>, double > tSolution; double evaluateUtility (matrix A, vector <uint> solution) { double result = 0.0; for (uint i = 0; i < A.size(); i++) { for (uint j = 0; j < A[i].size(); j++) { result += solution[i] * A[i][j] * solution[j]; } } return result; } double evaluatecontribuition (matrix A, vector <uint> solution, uint i) { double result = A[i][i]; for (uint j = 0; j < A[i].size(); j++) { if (i != j) { result += solution[j] * (A[i][j] + A[j][i]); } } return result; } tSolution greedyRandomizedConstruction (matrix A, double alpha, default_random_engine generator) { tSolution result = make_pair(vector <uint> (A.size(), 0), 0.0); bool flag = true; while (flag) { double minUtility = 0, maxUtility = 0; bool flag2 = true; vector < pair <uint, double> > candidateList; for (uint i = 0; i < A.size(); i++) { tSolution solution; solution.first = vector <uint> (result.first); solution.second = result.second; if (solution.first[i] == 0) { // if 'i' is not in solution solution.first[i] = 1; double contribuition = evaluatecontribuition(A, solution.first, i); solution.second += contribuition; if (solution.second >= result.second) { // if 'i' can improve solution candidateList.push_back(make_pair(i, contribuition)); if (flag2) { flag2 = false; minUtility = contribuition; maxUtility = contribuition; } if (minUtility > contribuition) { minUtility = contribuition; } if (maxUtility < contribuition) { maxUtility = contribuition; } } } } // compute restriction double restriction = maxUtility - alpha * (maxUtility - minUtility); // populate RCL vector < pair <uint, double> > restrictedCandidateList; for (vector < pair <uint, double> > :: iterator it = candidateList.begin(); it != candidateList.end(); it++) { pair <uint, double> candidate = *it; if (candidate.second >= restriction) { restrictedCandidateList.push_back(candidate); } } if (restrictedCandidateList.size() > 0) { uniform_int_distribution <uint> distribution (0, restrictedCandidateList.size() - 1); uint s = distribution(generator); pair <uint, double> candidate = restrictedCandidateList[s]; uint i = candidate.first; uint deltaUtility = candidate.second; result.first[i] = 1; result.second += deltaUtility; } else { // if there is no candidate, break out of the loop flag = false; } } return result; } bool isFeasible (tSolution solution) { for (uint i = 0; i < solution.first.size(); i++) { if (solution.first[i] == 1) { if (i > 0 && solution.first[i - 1] == 1) { return false; } if (i < solution.first.size() - 1 && solution.first[i + 1] == 1) { return false; } } } return true; } void repair (matrix A, tSolution * solution) { // desligar bits até se tornar factível // dar preferencia pros bits que violam mais restricões // em caso de empate, dar preferencia pros que diminuem menos a utilidade vector <uint> restrictionsViolatedCounter (A.size(), 0); set <uint> invalidBits; for (uint i = 0; i < A.size(); i++) { if ((*solution).first[i] == 1) { if (i >= 1) { if ((*solution).first[i - 1] == 1) { restrictionsViolatedCounter[i]++; invalidBits.insert(i); } } if (i < A.size() - 1) { if ((*solution).first[i + 1] == 1) { restrictionsViolatedCounter[i]++; invalidBits.insert(i); } } } } while (!isFeasible(*solution) && invalidBits.size() > 0) { uint chosenBit = *(invalidBits.begin()); for (set <uint> :: iterator it = invalidBits.begin(); it != invalidBits.end(); it++) { uint i = *it; if (restrictionsViolatedCounter[chosenBit] < restrictionsViolatedCounter[i]) { chosenBit = i; } else if (restrictionsViolatedCounter[chosenBit] == restrictionsViolatedCounter[i]) { tSolution chosenNewSolution; chosenNewSolution.first = vector <uint> ((*solution).first); chosenNewSolution.second = (*solution).second; double chosenContribution = evaluatecontribuition(A, chosenNewSolution.first, chosenBit); chosenNewSolution.first[chosenBit] = 0; chosenNewSolution.second -= chosenContribution; tSolution newSolution; newSolution.first = vector <uint> ((*solution).first); newSolution.second = (*solution).second; double newContribution = evaluatecontribuition(A, newSolution.first, i); newSolution.first[i] = 0; newSolution.second -= newContribution; if (chosenNewSolution.second < newSolution.second) { chosenBit = i; } } } double contribuition = evaluatecontribuition(A, (*solution).first, chosenBit); (*solution).first[chosenBit] = 0; (*solution).second -= contribuition; invalidBits.erase(chosenBit); } } void localSearch (matrix A, int searchMethod, default_random_engine generator, tSolution * solution) { vector < vector <uint> > neighborhood; // 1Flip neighborhood for (uint i = 0; i < A.size(); i++) { vector <uint> neighbor; neighbor.push_back(i); neighborhood.push_back(neighbor); } // 2Flip neighborhood for (uint i = 0; i < A.size(); i++) { for (uint j = i + 1; j < A.size(); j++) { vector <uint> neighbor; neighbor.push_back(i); neighbor.push_back(j); neighborhood.push_back(neighbor); } } // 3Flip neighborhood /* for (uint i = 0; i < A.size(); i++) { for (uint j = i + 1; j < A.size(); j++) { for (uint k = j + 1; k < A.size(); k++) { vector <uint> neighbor; neighbor.push_back(i); neighbor.push_back(j); neighbor.push_back(k); neighborhood.push_back(neighbor); } } } */ shuffle (neighborhood.begin(), neighborhood.end(), generator); bool flag = true; for (vector < vector <uint> > :: iterator it = neighborhood.begin(); flag && it != neighborhood.end(); it++) { vector <uint> neighbor = *it; tSolution newSolution = make_pair(vector <uint> ((*solution).first), (*solution).second); for (vector <uint> :: iterator it2 = neighbor.begin(); it2 != neighbor.end(); it2++) { uint i = *it2; double contribuition = evaluatecontribuition(A, newSolution.first, i); if (newSolution.first[i] == 0) { newSolution.first[i] = 1; newSolution.second += contribuition; } else { newSolution.first[i] = 0; newSolution.second -= contribuition; } } /* if (!isFeasible(newSolution)) { repair (A, &newSolution); } */ if (isFeasible(newSolution) && newSolution.second > (*solution).second) { (*solution).first = vector <uint> (newSolution.first); (*solution).second = newSolution.second; if (searchMethod == 0) { flag = false; } } } } bool termination (chrono :: high_resolution_clock :: time_point tBegin, ulint timeLimit) { chrono :: high_resolution_clock :: time_point tCurrent = chrono :: high_resolution_clock :: now(); chrono :: seconds elapsedTime = chrono :: duration_cast <chrono :: seconds> (tCurrent - tBegin); if ((ulint) elapsedTime.count() >= timeLimit) { return true; } return false; } tSolution grasp (matrix A, ulint seed, ulint timeLimit, int searchMethod, double alpha, chrono :: high_resolution_clock :: time_point tBegin) { tSolution result; default_random_engine generator (seed); bool flag = true; while (termination (tBegin, timeLimit) != true) { tSolution solution = greedyRandomizedConstruction(A, alpha, generator); localSearch(A, searchMethod, generator, &solution); if (!isFeasible(solution)) { repair(A, &solution); } if (flag || result.second < solution.second) { flag = false; result = solution; } } return result; } int main (int argc, char * argv[]) { chrono :: high_resolution_clock :: time_point tBegin = chrono :: high_resolution_clock :: now(); ulint seed = 0; ulint timeLimit = 10; int searchMethod; // 0 = first-improving; 1 = best-improving double alpha = 0.5; if (argc >= 2) { seed = atoi(argv[1]); } if (argc >= 3) { timeLimit = atoi(argv[2]); } if (argc >= 4) { searchMethod = atoi(argv[3]); } if (argc >= 5) { alpha = atof(argv[4]); } if (seed == 0) { seed = tBegin.time_since_epoch().count(); } if (searchMethod < 0) { searchMethod = 0; } else if (searchMethod > 1) { searchMethod = 1; } if (alpha < 0.0) { alpha = 0.0; } else if (alpha > 1.0) { alpha = 1.0; } uint n; cin >> n; matrix A (n, vector <double> (n, 0.0)); for (uint i = 0; i < n; i++) { for (uint j = i; j < n; j++) { cin >> A[i][j]; } } tSolution solution = grasp(A, seed, timeLimit, searchMethod, alpha, tBegin); cout << "maxVal = " << solution.second << endl; chrono :: high_resolution_clock :: time_point tEnd = chrono :: high_resolution_clock :: now(); chrono :: seconds elapsedTime = chrono :: duration_cast <chrono :: seconds> (tEnd - tBegin); cout << "Time = " << elapsedTime.count() << " seg" << endl; cout << "Solution: " << endl; for (uint i = 0; i < n; i++) { cout << solution.first[i] << endl; } return 0; }
[ "luishpmendes@gmail.com" ]
luishpmendes@gmail.com
0aa1f7972fbe7e50fdfe1df49640f284d22ed10d
dfc25f262ddcf558d3f565f59fc650aa5cb67b59
/src/common/utils/MetaKeyUtils.cpp
7d9882c9acf5f707b069417bbef0b8f5bc824c8c
[ "Apache-2.0" ]
permissive
jievince/nebula
0e3acf91a2e8f87d05288a36705fd9c27bded64a
d3ef4412f9d4ee6872d0dbe94694875132fbb3ee
refs/heads/master
2023-04-10T08:23:58.096075
2022-08-09T06:07:57
2022-08-09T06:07:57
394,878,675
2
0
Apache-2.0
2021-08-11T05:56:47
2021-08-11T05:56:46
null
UTF-8
C++
false
false
58,156
cpp
/* Copyright (c) 2018 vesoft inc. All rights reserved. * * This source code is licensed under Apache 2.0 License. */ #include "common/utils/MetaKeyUtils.h" #include <thrift/lib/cpp/util/EnumUtils.h> #include <thrift/lib/cpp2/protocol/CompactProtocol.h> #include <thrift/lib/cpp2/protocol/Serializer.h> #include <boost/stacktrace.hpp> #include "common/network/NetworkUtils.h" namespace nebula { // Systemtable means that it does not contain any space information(id).false // means that the backup should be skipped. static const std::unordered_map<std::string, std::pair<std::string, bool>> systemTableMaps = { {"users", {"__users__", true}}, {"hosts", {"__hosts__", false}}, {"versions", {"__versions__", false}}, {"machines", {"__machines__", true}}, {"host_dirs", {"__host_dirs__", false}}, {"snapshots", {"__snapshots__", false}}, {"configs", {"__configs__", true}}, {"groups", {"__groups__", true}}, {"zones", {"__zones__", true}}, {"services", {"__services__", false}}, {"sessions", {"__sessions__", true}}}; // SystemInfo will always be backed up static const std::unordered_map<std::string, std::pair<std::string, bool>> systemInfoMaps{ {"autoIncrementId", {"__id__", true}}, {"lastUpdateTime", {"__last_update_time__", true}}}; // name => {prefix, parseSpaceid}, nullptr means that the backup should be skipped. static const std::unordered_map< std::string, std::pair<std::string, std::function<decltype(MetaKeyUtils::spaceId)>>> tableMaps = {{"spaces", {"__spaces__", MetaKeyUtils::spaceId}}, {"parts", {"__parts__", MetaKeyUtils::parsePartKeySpaceId}}, {"tags", {"__tags__", MetaKeyUtils::parseTagsKeySpaceID}}, {"edges", {"__edges__", MetaKeyUtils::parseEdgesKeySpaceID}}, {"indexes", {"__indexes__", MetaKeyUtils::parseIndexesKeySpaceID}}, // Index tables are handled separately. {"index", {"__index__", nullptr}}, {"index_status", {"__index_status__", MetaKeyUtils::parseIndexStatusKeySpaceID}}, {"roles", {"__roles__", MetaKeyUtils::parseRoleSpace}}, {"leaders", {"__leaders__", nullptr}}, {"leader_terms", {"__leader_terms__", nullptr}}, {"listener", {"__listener__", nullptr}}, {"stats", {"__stats__", MetaKeyUtils::parseStatsSpace}}, {"balance_task", {"__balance_task__", nullptr}}, {"balance_plan", {"__balance_plan__", nullptr}}, {"ft_index", {"__ft_index__", nullptr}}, {"local_id", {"__local_id__", MetaKeyUtils::parseLocalIdSpace}}, {"disk_parts", {"__disk_parts__", MetaKeyUtils::parseDiskPartsSpace}}, {"job_manager", {"__job_mgr__", nullptr}}}; // clang-format off static const std::string kSpacesTable = tableMaps.at("spaces").first; // NOLINT static const std::string kPartsTable = tableMaps.at("parts").first; // NOLINT static const std::string kVersionsTable = systemTableMaps.at("versions").first; // NOLINT static const std::string kHostsTable = systemTableMaps.at("hosts").first; // NOLINT static const std::string kMachinesTable = systemTableMaps.at("machines").first; // NOLINT static const std::string kHostDirsTable = systemTableMaps.at("host_dirs").first;// NOLINT static const std::string kTagsTable = tableMaps.at("tags").first; // NOLINT static const std::string kEdgesTable = tableMaps.at("edges").first; // NOLINT static const std::string kIndexesTable = tableMaps.at("indexes").first; // NOLINT static const std::string kIndexTable = tableMaps.at("index").first; // NOLINT static const std::string kIndexStatusTable = tableMaps.at("index_status").first; // NOLINT static const std::string kUsersTable = systemTableMaps.at("users").first; // NOLINT static const std::string kRolesTable = tableMaps.at("roles").first; // NOLINT static const std::string kConfigsTable = systemTableMaps.at("configs").first; // NOLINT static const std::string kSnapshotsTable = systemTableMaps.at("snapshots").first;// NOLINT static const std::string kLeadersTable = tableMaps.at("leaders").first; // NOLINT static const std::string kLeaderTermsTable = tableMaps.at("leader_terms").first; // NOLINT static const std::string kGroupsTable = systemTableMaps.at("groups").first; // NOLINT static const std::string kZonesTable = systemTableMaps.at("zones").first; // NOLINT static const std::string kListenerTable = tableMaps.at("listener").first; // NOLINT static const std::string kDiskPartsTable = tableMaps.at("disk_parts").first; // NOLINT /* * There will be one job, and a bunch of tasks use this prefix. * If there are 1 job(let say 65536) which has 4 sub tasks, there will 5 records * in kvstore which are * __job_mgr_<65536> * __job_mgr_<65536><0> * __job_mgr_<65536><1> * __job_mgr_<65536><2> * __job_mgr_<65536><3> * */ static const std::string kJobTable = tableMaps.at("job_manager").first; // NOLINT // Used to record the number of vertices and edges in the space // The number of vertices of each tag in the space // The number of edges of each edgetype in the space static const std::string kStatsTable = tableMaps.at("stats").first; // NOLINT static const std::string kBalanceTaskTable = tableMaps.at("balance_task").first; // NOLINT static const std::string kBalancePlanTable = tableMaps.at("balance_plan").first; // NOLINT static const std::string kLocalIdTable = tableMaps.at("local_id").first; // NOLINT const std::string kFTIndexTable = tableMaps.at("ft_index").first; // NOLINT const std::string kServicesTable = systemTableMaps.at("services").first; // NOLINT const std::string kSessionsTable = systemTableMaps.at("sessions").first; // NOLINT const std::string kIdKey = systemInfoMaps.at("autoIncrementId").first; // NOLINT const std::string kLastUpdateTimeTable = systemInfoMaps.at("lastUpdateTime").first; // NOLINT // clang-format on const int kMaxIpAddrLen = 15; // '255.255.255.255' std::string MetaKeyUtils::getIndexTable() { return kIndexTable; } std::unordered_map<std::string, std::pair<std::string, std::function<decltype(MetaKeyUtils::spaceId)>>> MetaKeyUtils::getTableMaps() { return tableMaps; } std::unordered_map<std::string, std::pair<std::string, bool>> MetaKeyUtils::getSystemInfoMaps() { return systemInfoMaps; } std::unordered_map<std::string, std::pair<std::string, bool>> MetaKeyUtils::getSystemTableMaps() { return systemTableMaps; } std::string MetaKeyUtils::lastUpdateTimeKey() { std::string key; key.reserve(kLastUpdateTimeTable.size()); key.append(kLastUpdateTimeTable.data(), kLastUpdateTimeTable.size()); return key; } std::string MetaKeyUtils::lastUpdateTimeVal(const int64_t timeInMilliSec) { std::string val; val.reserve(sizeof(int64_t)); val.append(reinterpret_cast<const char*>(&timeInMilliSec), sizeof(int64_t)); return val; } std::string MetaKeyUtils::spaceKey(GraphSpaceID spaceId) { std::string key; key.reserve(kSpacesTable.size() + sizeof(GraphSpaceID)); key.append(kSpacesTable.data(), kSpacesTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } std::string MetaKeyUtils::spaceVal(const meta::cpp2::SpaceDesc& spaceDesc) { std::string val; apache::thrift::CompactSerializer::serialize(spaceDesc, &val); return val; } meta::cpp2::SpaceDesc MetaKeyUtils::parseSpace(folly::StringPiece rawData) { meta::cpp2::SpaceDesc spaceDesc; apache::thrift::CompactSerializer::deserialize(rawData, spaceDesc); return spaceDesc; } const std::string& MetaKeyUtils::spacePrefix() { return kSpacesTable; } GraphSpaceID MetaKeyUtils::spaceId(folly::StringPiece rawKey) { return *reinterpret_cast<const GraphSpaceID*>(rawKey.data() + kSpacesTable.size()); } std::string MetaKeyUtils::spaceName(folly::StringPiece rawVal) { return parseSpace(rawVal).get_space_name(); } std::string MetaKeyUtils::partKey(GraphSpaceID spaceId, PartitionID partId) { std::string key; key.reserve(kPartsTable.size() + sizeof(GraphSpaceID) + sizeof(PartitionID)); key.append(kPartsTable.data(), kPartsTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&partId), sizeof(PartitionID)); return key; } GraphSpaceID MetaKeyUtils::parsePartKeySpaceId(folly::StringPiece key) { return *reinterpret_cast<const GraphSpaceID*>(key.data() + kPartsTable.size()); } PartitionID MetaKeyUtils::parsePartKeyPartId(folly::StringPiece key) { return *reinterpret_cast<const PartitionID*>(key.data() + kPartsTable.size() + sizeof(GraphSpaceID)); } std::string MetaKeyUtils::partVal(const std::vector<HostAddr>& hosts) { return partValV2(hosts); } // dataVer(int) + vectorSize(size_t) + vector of (strIp(string) + port(int)) std::string MetaKeyUtils::partValV2(const std::vector<HostAddr>& hosts) { std::string encodedVal; int dataVersion = 2; encodedVal.append(reinterpret_cast<const char*>(&dataVersion), sizeof(int)) .append(network::NetworkUtils::toHostsStr(hosts)); return encodedVal; } std::string MetaKeyUtils::partPrefix() { std::string prefix; prefix.reserve(kPartsTable.size() + sizeof(GraphSpaceID)); prefix.append(kPartsTable.data(), kPartsTable.size()); return prefix; } std::string MetaKeyUtils::partPrefix(GraphSpaceID spaceId) { std::string prefix; prefix.reserve(kPartsTable.size() + sizeof(GraphSpaceID)); prefix.append(kPartsTable.data(), kPartsTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return prefix; } std::vector<HostAddr> MetaKeyUtils::parsePartVal(folly::StringPiece val, int partNum) { static const size_t unitSizeV1 = sizeof(int64_t); if (unitSizeV1 * partNum == val.size()) { return parsePartValV1(val); } int dataVer = *reinterpret_cast<const int32_t*>(val.data()); UNUSED(dataVer); // currently if not ver1, it must be v2 val.advance(sizeof(int)); return parsePartValV2(val); } // partition val is ip(int) + port(int) std::vector<HostAddr> MetaKeyUtils::parsePartValV1(folly::StringPiece val) { std::vector<HostAddr> hosts; static const size_t unitSize = sizeof(int32_t) * 2; auto hostsNum = val.size() / unitSize; hosts.reserve(hostsNum); VLOG(3) << "Total size:" << val.size() << ", host size:" << unitSize << ", host num:" << hostsNum; for (decltype(hostsNum) i = 0; i < hostsNum; i++) { HostAddr h; uint32_t ip = *reinterpret_cast<const int32_t*>(val.data() + i * unitSize); h.host = network::NetworkUtils::intToIPv4(ip); h.port = *reinterpret_cast<const int32_t*>(val.data() + i * unitSize + sizeof(int32_t)); hosts.emplace_back(std::move(h)); } return hosts; } // dataVer(int) + vectorSize(size_t) + vector of (strIpV4(string) + port(int)) std::vector<HostAddr> MetaKeyUtils::parsePartValV2(folly::StringPiece val) { std::vector<HostAddr> ret; auto hostsOrErr = network::NetworkUtils::toHosts(val.str()); if (hostsOrErr.ok()) { ret = std::move(hostsOrErr.value()); } else { LOG(ERROR) << "invalid input for parsePartValV2()"; } return ret; } std::string MetaKeyUtils::machineKey(std::string addr, Port port) { std::string key; HostAddr h(addr, port); key.append(kMachinesTable.data(), kMachinesTable.size()) .append(MetaKeyUtils::serializeHostAddr(h)); return key; } const std::string& MetaKeyUtils::machinePrefix() { return kMachinesTable; } HostAddr MetaKeyUtils::parseMachineKey(folly::StringPiece key) { key.advance(kMachinesTable.size()); return MetaKeyUtils::deserializeHostAddr(key); } const std::string& MetaKeyUtils::hostDirPrefix() { return kHostDirsTable; } const std::string MetaKeyUtils::hostDirHostPrefix(std::string host) { return kHostDirsTable + host; } std::string MetaKeyUtils::hostDirKey(std::string host, Port port) { std::string key; key.reserve(kHostDirsTable.size() + host.size() + sizeof(port)); key.append(kHostDirsTable.data(), kHostDirsTable.size()).append(host); key.append(reinterpret_cast<const char*>(&port), sizeof(Port)); return key; } HostAddr MetaKeyUtils::parseHostDirKey(folly::StringPiece key) { HostAddr addr; auto hostSize = key.size() - kHostDirsTable.size() - sizeof(Port); addr.host = key.subpiece(kHostDirsTable.size(), hostSize).toString(); key.advance(kHostDirsTable.size() + hostSize); addr.port = *reinterpret_cast<const Port*>(key.begin()); return addr; } std::string MetaKeyUtils::hostDirVal(cpp2::DirInfo dir) { std::string val; apache::thrift::CompactSerializer::serialize(dir, &val); return val; } cpp2::DirInfo MetaKeyUtils::parseHostDir(folly::StringPiece val) { cpp2::DirInfo dir; apache::thrift::CompactSerializer::deserialize(val, dir); return dir; } std::string MetaKeyUtils::hostKey(std::string addr, Port port) { return hostKeyV2(addr, port); } std::string MetaKeyUtils::hostKeyV2(std::string addr, Port port) { std::string key; HostAddr h(addr, port); key.append(kHostsTable.data(), kHostsTable.size()).append(MetaKeyUtils::serializeHostAddr(h)); return key; } const std::string& MetaKeyUtils::hostPrefix() { return kHostsTable; } HostAddr MetaKeyUtils::parseHostKey(folly::StringPiece key) { if (key.size() == kHostsTable.size() + sizeof(int64_t)) { return parseHostKeyV1(key); } return parseHostKeyV2(key); } HostAddr MetaKeyUtils::parseHostKeyV1(folly::StringPiece key) { HostAddr host; key.advance(kHostsTable.size()); uint32_t ip = *reinterpret_cast<const uint32_t*>(key.begin()); host.host = network::NetworkUtils::intToIPv4(ip); host.port = *reinterpret_cast<const int32_t*>(key.begin() + sizeof(uint32_t)); return host; } HostAddr MetaKeyUtils::parseHostKeyV2(folly::StringPiece key) { key.advance(kHostsTable.size()); return MetaKeyUtils::deserializeHostAddr(key); } std::string MetaKeyUtils::versionKey(const HostAddr& h) { std::string key; key.append(kVersionsTable.data(), kVersionsTable.size()) .append(MetaKeyUtils::serializeHostAddr(h)); return key; } std::string MetaKeyUtils::versionVal(const std::string& version) { std::string val; auto versionLen = version.size(); val.reserve(sizeof(int64_t) + versionLen); val.append(reinterpret_cast<const char*>(&version), sizeof(int64_t)).append(version); return val; } std::string MetaKeyUtils::parseVersion(folly::StringPiece val) { auto len = *reinterpret_cast<const size_t*>(val.data()); return val.subpiece(sizeof(size_t), len).str(); } std::string MetaKeyUtils::leaderKey(std::string addr, Port port) { LOG(ERROR) << "deprecated function\n" << boost::stacktrace::stacktrace(); return leaderKeyV2(addr, port); } std::string MetaKeyUtils::leaderKeyV2(std::string addr, Port port) { LOG(ERROR) << "deprecated function\n" << boost::stacktrace::stacktrace(); std::string key; HostAddr h(addr, port); key.reserve(kLeadersTable.size() + kMaxIpAddrLen + sizeof(Port)); key.append(kLeadersTable.data(), kLeadersTable.size()).append(MetaKeyUtils::serializeHostAddr(h)); return key; } std::string MetaKeyUtils::leaderKey(GraphSpaceID spaceId, PartitionID partId) { std::string key; key.reserve(kLeaderTermsTable.size() + sizeof(GraphSpaceID) + sizeof(PartitionID)); key.append(kLeaderTermsTable.data(), kLeaderTermsTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&partId), sizeof(PartitionID)); return key; } std::string MetaKeyUtils::leaderVal(const LeaderParts& leaderParts) { LOG(ERROR) << "deprecated function\n" << boost::stacktrace::stacktrace(); std::string value; value.reserve(512); for (const auto& spaceEntry : leaderParts) { GraphSpaceID spaceId = spaceEntry.first; value.append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); size_t leaderCount = spaceEntry.second.size(); value.append(reinterpret_cast<const char*>(&leaderCount), sizeof(size_t)); for (const auto& partId : spaceEntry.second) { value.append(reinterpret_cast<const char*>(&partId), sizeof(PartitionID)); } } return value; } // v3: dataVer(int) + lenOfHost(8) + HostAddr(varchar) + term(int64_t) std::string MetaKeyUtils::leaderValV3(const HostAddr& h, int64_t term) { std::string leaderVal; leaderVal.reserve(256); int dataVersion = 3; auto sHost = serializeHostAddr(h); auto lenOfHost = sHost.size(); leaderVal.append(reinterpret_cast<const char*>(&dataVersion), sizeof(dataVersion)) .append(reinterpret_cast<const char*>(&lenOfHost), sizeof(lenOfHost)) .append(sHost) .append(reinterpret_cast<const char*>(&term), sizeof(term)); return leaderVal; } // v3: dataVer(int) + lenOfHost(8) + HostAddr(varchar) + term(int64_t) std::tuple<HostAddr, TermID, nebula::cpp2::ErrorCode> MetaKeyUtils::parseLeaderValV3( folly::StringPiece val) { std::tuple<HostAddr, TermID, nebula::cpp2::ErrorCode> ret; std::get<2>(ret) = nebula::cpp2::ErrorCode::SUCCEEDED; int dataVer = *reinterpret_cast<const int*>(val.data()); if (dataVer != 3) { std::get<2>(ret) = nebula::cpp2::ErrorCode::E_INVALID_PARM; return ret; } CHECK_GE(val.size(), sizeof(int)); val.advance(sizeof(int)); auto lenOfHost = *reinterpret_cast<const size_t*>(val.data()); val.advance(sizeof(size_t)); CHECK_GE(val.size(), lenOfHost); std::get<0>(ret) = MetaKeyUtils::deserializeHostAddr(val.subpiece(0, lenOfHost)); val.advance(lenOfHost); std::get<1>(ret) = *reinterpret_cast<const TermID*>(val.data()); return ret; } const std::string& MetaKeyUtils::leaderPrefix() { return kLeaderTermsTable; } std::string MetaKeyUtils::leaderPrefix(GraphSpaceID spaceId) { std::string key; key.reserve(kLeaderTermsTable.size() + sizeof(GraphSpaceID)); key.append(kLeaderTermsTable.data(), kLeaderTermsTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } HostAddr MetaKeyUtils::parseLeaderKey(folly::StringPiece key) { LOG(ERROR) << "deprecated function\n" << boost::stacktrace::stacktrace(); if (key.size() == kLeadersTable.size() + sizeof(int64_t)) { return parseLeaderKeyV1(key); } return parseLeaderKeyV2(key); } // input should be a pair of int32_t HostAddr MetaKeyUtils::parseLeaderKeyV1(folly::StringPiece key) { LOG(ERROR) << "deprecated function\n" << boost::stacktrace::stacktrace(); HostAddr host; CHECK_EQ(key.size(), kLeadersTable.size() + sizeof(int64_t)); key.advance(kLeadersTable.size()); auto ip = *reinterpret_cast<const uint32_t*>(key.begin()); host.host = network::NetworkUtils::intToIPv4(ip); host.port = *reinterpret_cast<const uint32_t*>(key.begin() + sizeof(ip)); return host; } HostAddr MetaKeyUtils::parseLeaderKeyV2(folly::StringPiece key) { LOG(ERROR) << "deprecated function\n" << boost::stacktrace::stacktrace(); key.advance(kLeadersTable.size()); return MetaKeyUtils::deserializeHostAddr(key); } std::pair<GraphSpaceID, PartitionID> MetaKeyUtils::parseLeaderKeyV3(folly::StringPiece key) { std::pair<GraphSpaceID, PartitionID> ret; ret.first = *reinterpret_cast<const GraphSpaceID*>(key.data() + kLeaderTermsTable.size()); ret.second = *reinterpret_cast<const PartitionID*>(key.data() + kLeaderTermsTable.size() + sizeof(GraphSpaceID)); return ret; } LeaderParts MetaKeyUtils::parseLeaderValV1(folly::StringPiece val) { LOG(ERROR) << "deprecated function\n" << boost::stacktrace::stacktrace(); LeaderParts leaderParts; size_t size = val.size(); // decode leader info size_t offset = 0; while (offset + sizeof(GraphSpaceID) + sizeof(size_t) < size) { GraphSpaceID spaceId = *reinterpret_cast<const GraphSpaceID*>(val.data() + offset); offset += sizeof(GraphSpaceID); size_t leaderCount = *reinterpret_cast<const size_t*>(val.data() + offset); offset += sizeof(size_t); std::vector<PartitionID> partIds; for (size_t i = 0; i < leaderCount && offset < size; i++) { partIds.emplace_back(*reinterpret_cast<const PartitionID*>(val.data() + offset)); offset += sizeof(PartitionID); } leaderParts.emplace(spaceId, std::move(partIds)); } return leaderParts; } std::string MetaKeyUtils::schemaEdgePrefix(GraphSpaceID spaceId, EdgeType edgeType) { std::string key; key.reserve(kEdgesTable.size() + sizeof(GraphSpaceID) + sizeof(edgeType)); key.append(kEdgesTable.data(), kEdgesTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&edgeType), sizeof(edgeType)); return key; } std::string MetaKeyUtils::schemaEdgesPrefix(GraphSpaceID spaceId) { std::string key; key.reserve(kEdgesTable.size() + sizeof(GraphSpaceID)); key.append(kEdgesTable.data(), kEdgesTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } const std::string& MetaKeyUtils::schemaEdgesPrefix() { return kEdgesTable; } std::string MetaKeyUtils::schemaEdgeKey(GraphSpaceID spaceId, EdgeType edgeType, SchemaVer version) { auto storageVer = std::numeric_limits<SchemaVer>::max() - version; std::string key; key.reserve(kEdgesTable.size() + sizeof(GraphSpaceID) + sizeof(EdgeType) + sizeof(SchemaVer)); key.append(kEdgesTable.data(), kEdgesTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&edgeType), sizeof(EdgeType)) .append(reinterpret_cast<const char*>(&storageVer), sizeof(SchemaVer)); return key; } std::string MetaKeyUtils::schemaVal(const std::string& name, const meta::cpp2::Schema& schema) { auto len = name.size(); std::string val, sval; apache::thrift::CompactSerializer::serialize(schema, &sval); val.reserve(sizeof(int32_t) + name.size() + sval.size()); val.append(reinterpret_cast<const char*>(&len), sizeof(int32_t)).append(name).append(sval); return val; } EdgeType MetaKeyUtils::parseEdgeType(folly::StringPiece key) { return *reinterpret_cast<const EdgeType*>(key.data() + kEdgesTable.size() + sizeof(GraphSpaceID)); } SchemaVer MetaKeyUtils::parseEdgeVersion(folly::StringPiece key) { auto offset = kEdgesTable.size() + sizeof(GraphSpaceID) + sizeof(EdgeType); return std::numeric_limits<SchemaVer>::max() - *reinterpret_cast<const SchemaVer*>(key.begin() + offset); } SchemaVer MetaKeyUtils::getLatestEdgeScheInfo(kvstore::KVIterator* iter, folly::StringPiece& val) { SchemaVer maxVer = MetaKeyUtils::parseEdgeVersion(iter->key()); val = iter->val(); iter->next(); while (iter->valid()) { SchemaVer curVer = MetaKeyUtils::parseEdgeVersion(iter->key()); if (curVer > maxVer) { maxVer = curVer; val = iter->val(); } iter->next(); } return maxVer; } GraphSpaceID MetaKeyUtils::parseEdgesKeySpaceID(folly::StringPiece key) { return *reinterpret_cast<const GraphSpaceID*>(key.data() + kEdgesTable.size()); } std::string MetaKeyUtils::schemaTagKey(GraphSpaceID spaceId, TagID tagId, SchemaVer version) { auto storageVer = std::numeric_limits<SchemaVer>::max() - version; std::string key; key.reserve(kTagsTable.size() + sizeof(GraphSpaceID) + sizeof(TagID) + sizeof(SchemaVer)); key.append(kTagsTable.data(), kTagsTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&tagId), sizeof(TagID)) .append(reinterpret_cast<const char*>(&storageVer), sizeof(SchemaVer)); return key; } TagID MetaKeyUtils::parseTagId(folly::StringPiece key) { return *reinterpret_cast<const TagID*>(key.data() + kTagsTable.size() + sizeof(GraphSpaceID)); } SchemaVer MetaKeyUtils::parseTagVersion(folly::StringPiece key) { auto offset = kTagsTable.size() + sizeof(GraphSpaceID) + sizeof(TagID); return std::numeric_limits<SchemaVer>::max() - *reinterpret_cast<const SchemaVer*>(key.begin() + offset); } SchemaVer MetaKeyUtils::getLatestTagScheInfo(kvstore::KVIterator* iter, folly::StringPiece& val) { SchemaVer maxVer = MetaKeyUtils::parseTagVersion(iter->key()); val = iter->val(); iter->next(); while (iter->valid()) { SchemaVer curVer = MetaKeyUtils::parseTagVersion(iter->key()); if (curVer > maxVer) { maxVer = curVer; val = iter->val(); } iter->next(); } return maxVer; } std::string MetaKeyUtils::schemaTagPrefix(GraphSpaceID spaceId, TagID tagId) { std::string key; key.reserve(kTagsTable.size() + sizeof(GraphSpaceID) + sizeof(TagID)); key.append(kTagsTable.data(), kTagsTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&tagId), sizeof(TagID)); return key; } const std::string& MetaKeyUtils::schemaTagsPrefix() { return kTagsTable; } std::string MetaKeyUtils::schemaTagsPrefix(GraphSpaceID spaceId) { std::string key; key.reserve(kTagsTable.size() + sizeof(GraphSpaceID)); key.append(kTagsTable.data(), kTagsTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } GraphSpaceID MetaKeyUtils::parseTagsKeySpaceID(folly::StringPiece key) { return *reinterpret_cast<const GraphSpaceID*>(key.data() + kTagsTable.size()); } meta::cpp2::Schema MetaKeyUtils::parseSchema(folly::StringPiece rawData) { meta::cpp2::Schema schema; int32_t offset = sizeof(int32_t) + *reinterpret_cast<const int32_t*>(rawData.begin()); auto schval = rawData.subpiece(offset, rawData.size() - offset); apache::thrift::CompactSerializer::deserialize(schval, schema); return schema; } std::string MetaKeyUtils::indexKey(GraphSpaceID spaceID, IndexID indexID) { std::string key; key.reserve(kIndexesTable.size() + sizeof(GraphSpaceID) + sizeof(IndexID)); key.append(kIndexesTable.data(), kIndexesTable.size()) .append(reinterpret_cast<const char*>(&spaceID), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&indexID), sizeof(IndexID)); return key; } std::string MetaKeyUtils::indexVal(const nebula::meta::cpp2::IndexItem& item) { std::string value; apache::thrift::CompactSerializer::serialize(item, &value); return value; } const std::string& MetaKeyUtils::indexPrefix() { return kIndexesTable; } std::string MetaKeyUtils::indexPrefix(GraphSpaceID spaceId) { std::string key; key.reserve(kIndexesTable.size() + sizeof(GraphSpaceID)); key.append(kIndexesTable.data(), kIndexesTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } GraphSpaceID MetaKeyUtils::parseIndexesKeySpaceID(folly::StringPiece key) { return *reinterpret_cast<const GraphSpaceID*>(key.data() + kIndexesTable.size()); } IndexID MetaKeyUtils::parseIndexesKeyIndexID(folly::StringPiece key) { return *reinterpret_cast<const IndexID*>(key.data() + kIndexesTable.size() + sizeof(GraphSpaceID)); } nebula::meta::cpp2::IndexItem MetaKeyUtils::parseIndex(const folly::StringPiece& rawData) { nebula::meta::cpp2::IndexItem item; apache::thrift::CompactSerializer::deserialize(rawData, item); return item; } // This method should replace with JobManager when it ready. std::string MetaKeyUtils::rebuildIndexStatus(GraphSpaceID space, char type, const std::string& indexName) { std::string key; key.reserve(64); key.append(kIndexStatusTable.data(), kIndexStatusTable.size()) .append(reinterpret_cast<const char*>(&space), sizeof(GraphSpaceID)) .append(1, type) .append(indexName); return key; } // This method should replace with JobManager when it ready. std::string MetaKeyUtils::rebuildIndexStatusPrefix(GraphSpaceID space, char type) { std::string key; key.reserve(kIndexStatusTable.size() + sizeof(GraphSpaceID) + sizeof(char)); key.append(kIndexStatusTable.data(), kIndexStatusTable.size()) .append(reinterpret_cast<const char*>(&space), sizeof(GraphSpaceID)) .append(1, type); return key; } std::string MetaKeyUtils::rebuildIndexStatusPrefix() { std::string key; key.reserve(kIndexStatusTable.size()); key.append(kIndexStatusTable.data(), kIndexStatusTable.size()); return key; } GraphSpaceID MetaKeyUtils::parseIndexStatusKeySpaceID(folly::StringPiece key) { return *reinterpret_cast<const GraphSpaceID*>(key.data() + kIndexStatusTable.size()); } std::string MetaKeyUtils::indexSpaceKey(const std::string& name) { EntryType type = EntryType::SPACE; std::string key; key.reserve(64); key.append(kIndexTable.data(), kIndexTable.size()) .append(reinterpret_cast<const char*>(&type), sizeof(type)) .append(name); return key; } std::string MetaKeyUtils::parseIndexSpaceKey(folly::StringPiece key) { auto nameSize = key.size() - kIndexTable.size() - sizeof(EntryType); return key.subpiece(kIndexTable.size() + sizeof(EntryType), nameSize).str(); } EntryType MetaKeyUtils::parseIndexType(folly::StringPiece key) { auto type = *reinterpret_cast<const EntryType*>(key.data() + kIndexTable.size()); return type; } std::string MetaKeyUtils::indexTagKey(GraphSpaceID spaceId, const std::string& name) { EntryType type = EntryType::TAG; std::string key; key.reserve(128); key.append(kIndexTable.data(), kIndexTable.size()) .append(reinterpret_cast<const char*>(&type), sizeof(type)) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(name); return key; } std::string MetaKeyUtils::indexEdgeKey(GraphSpaceID spaceId, const std::string& name) { EntryType type = EntryType::EDGE; std::string key; key.reserve(128); key.append(kIndexTable.data(), kIndexTable.size()) .append(reinterpret_cast<const char*>(&type), sizeof(type)) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(name); return key; } GraphSpaceID MetaKeyUtils::parseIndexKeySpaceID(folly::StringPiece key) { return *reinterpret_cast<const GraphSpaceID*>(key.data() + kIndexTable.size() + sizeof(EntryType)); } std::string MetaKeyUtils::indexIndexKey(GraphSpaceID spaceID, const std::string& indexName) { EntryType type = EntryType::INDEX; std::string key; key.reserve(128); key.append(kIndexTable.data(), kIndexTable.size()) .append(reinterpret_cast<const char*>(&type), sizeof(type)) .append(reinterpret_cast<const char*>(&spaceID), sizeof(GraphSpaceID)) .append(indexName); return key; } std::string MetaKeyUtils::indexZoneKey(const std::string& name) { EntryType type = EntryType::ZONE; std::string key; key.reserve(128); key.append(kIndexTable.data(), kIndexTable.size()) .append(reinterpret_cast<const char*>(&type), sizeof(type)) .append(name); return key; } std::string MetaKeyUtils::userPrefix() { return kUsersTable; } std::string MetaKeyUtils::userKey(const std::string& account) { std::string key; key.reserve(kUsersTable.size() + account.size()); key.append(kUsersTable.data(), kUsersTable.size()).append(account); return key; } std::string MetaKeyUtils::userVal(const std::string& val) { std::string key; auto pwdLen = val.size(); key.reserve(sizeof(int64_t) + pwdLen); key.append(reinterpret_cast<const char*>(&pwdLen), sizeof(size_t)).append(val); return key; } std::string MetaKeyUtils::parseUser(folly::StringPiece key) { return key.subpiece(kUsersTable.size(), key.size() - kUsersTable.size()).str(); } std::string MetaKeyUtils::parseUserPwd(folly::StringPiece val) { auto len = *reinterpret_cast<const size_t*>(val.data()); return val.subpiece(sizeof(size_t), len).str(); } std::string MetaKeyUtils::roleKey(GraphSpaceID spaceId, const std::string& account) { std::string key; key.reserve(kRolesTable.size() + sizeof(GraphSpaceID) + account.size()); key.append(kRolesTable.data(), kRolesTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(account); return key; } std::string MetaKeyUtils::roleVal(meta::cpp2::RoleType roleType) { std::string val; val.reserve(sizeof(meta::cpp2::RoleType)); val.append(reinterpret_cast<const char*>(&roleType), sizeof(meta::cpp2::RoleType)); return val; } std::string MetaKeyUtils::parseRoleUser(folly::StringPiece key) { auto offset = kRolesTable.size() + sizeof(GraphSpaceID); return key.subpiece(offset, key.size() - offset).str(); } GraphSpaceID MetaKeyUtils::parseRoleSpace(folly::StringPiece key) { return *reinterpret_cast<const GraphSpaceID*>(key.data() + kRolesTable.size()); } std::string MetaKeyUtils::rolesPrefix() { return kRolesTable; } std::string MetaKeyUtils::roleSpacePrefix(GraphSpaceID spaceId) { std::string key; key.reserve(kRolesTable.size() + sizeof(GraphSpaceID)); key.append(kRolesTable.data(), kRolesTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } std::string MetaKeyUtils::parseRoleStr(folly::StringPiece key) { auto* c = reinterpret_cast<const char*>(&key); auto type = *reinterpret_cast<const meta::cpp2::RoleType*>(c); std::string role; switch (type) { case meta::cpp2::RoleType::GOD: { role = "GOD"; break; } case meta::cpp2::RoleType::ADMIN: { role = "ADMIN"; break; } case meta::cpp2::RoleType::DBA: { role = "DBA"; break; } case meta::cpp2::RoleType::USER: { role = "USER"; break; } case meta::cpp2::RoleType::GUEST: { role = "GUEST"; break; } } return role; } std::string MetaKeyUtils::configKey(const meta::cpp2::ConfigModule& module, const std::string& name) { int32_t nSize = name.size(); std::string key; key.reserve(128); key.append(kConfigsTable.data(), kConfigsTable.size()) .append(reinterpret_cast<const char*>(&module), sizeof(meta::cpp2::ConfigModule)) .append(reinterpret_cast<const char*>(&nSize), sizeof(int32_t)) .append(name); return key; } std::string MetaKeyUtils::configKeyPrefix(const meta::cpp2::ConfigModule& module) { std::string key; key.reserve(128); key.append(kConfigsTable.data(), kConfigsTable.size()); if (module != meta::cpp2::ConfigModule::ALL) { key.append(reinterpret_cast<const char*>(&module), sizeof(meta::cpp2::ConfigModule)); } return key; } std::string MetaKeyUtils::configValue(const meta::cpp2::ConfigMode& valueMode, const Value& value) { std::string val, cVal; apache::thrift::CompactSerializer::serialize(value, &cVal); val.reserve(sizeof(meta::cpp2::ConfigMode) + cVal.size()); val.append(reinterpret_cast<const char*>(&valueMode), sizeof(meta::cpp2::ConfigMode)) .append(cVal); return val; } ConfigName MetaKeyUtils::parseConfigKey(folly::StringPiece rawKey) { std::string key; auto offset = kConfigsTable.size(); auto module = *reinterpret_cast<const meta::cpp2::ConfigModule*>(rawKey.data() + offset); offset += sizeof(meta::cpp2::ConfigModule); int32_t nSize = *reinterpret_cast<const int32_t*>(rawKey.data() + offset); offset += sizeof(int32_t); auto name = rawKey.subpiece(offset, nSize); return {module, name.str()}; } meta::cpp2::ConfigItem MetaKeyUtils::parseConfigValue(folly::StringPiece rawData) { int32_t offset = 0; meta::cpp2::ConfigMode mode = *reinterpret_cast<const meta::cpp2::ConfigMode*>(rawData.data() + offset); offset += sizeof(meta::cpp2::ConfigMode); Value value; apache::thrift::CompactSerializer::deserialize(rawData.subpiece(offset, rawData.size() - offset), value); meta::cpp2::ConfigItem item; item.mode_ref() = mode; item.value_ref() = value; return item; } std::string MetaKeyUtils::snapshotKey(const std::string& name) { std::string key; key.reserve(kSnapshotsTable.size() + name.size()); key.append(kSnapshotsTable.data(), kSnapshotsTable.size()).append(name); return key; } std::string MetaKeyUtils::snapshotVal(const meta::cpp2::SnapshotStatus& status, const std::string& hosts) { std::string val; val.reserve(sizeof(meta::cpp2::SnapshotStatus) + sizeof(hosts)); val.append(reinterpret_cast<const char*>(&status), sizeof(meta::cpp2::SnapshotStatus)) .append(hosts); return val; } meta::cpp2::SnapshotStatus MetaKeyUtils::parseSnapshotStatus(folly::StringPiece rawData) { return *reinterpret_cast<const meta::cpp2::SnapshotStatus*>(rawData.data()); } std::string MetaKeyUtils::parseSnapshotHosts(folly::StringPiece rawData) { return rawData .subpiece(sizeof(meta::cpp2::SnapshotStatus), rawData.size() - sizeof(meta::cpp2::SnapshotStatus)) .str(); } std::string MetaKeyUtils::parseSnapshotName(folly::StringPiece rawData) { int32_t offset = kSnapshotsTable.size(); return rawData.subpiece(offset, rawData.size() - offset).str(); } const std::string& MetaKeyUtils::snapshotPrefix() { return kSnapshotsTable; } std::string MetaKeyUtils::serializeHostAddr(const HostAddr& host) { std::string ret; ret.reserve(sizeof(size_t) + 15 + sizeof(Port)); // 255.255.255.255 size_t len = host.host.size(); ret.append(reinterpret_cast<char*>(&len), sizeof(size_t)) .append(host.host.data(), len) .append(reinterpret_cast<const char*>(&host.port), sizeof(Port)); return ret; } HostAddr MetaKeyUtils::deserializeHostAddr(folly::StringPiece raw) { HostAddr addr; CHECK_GE(raw.size(), sizeof(size_t) + sizeof(Port)); // host may be "" size_t offset = 0; size_t len = *reinterpret_cast<const size_t*>(raw.begin() + offset); offset += sizeof(size_t); addr.host = std::string(raw.begin() + offset, len); offset += len; addr.port = *reinterpret_cast<const Port*>(raw.begin() + offset); return addr; } std::string MetaKeyUtils::genTimestampStr() { char ch[60]; std::time_t t = std::time(nullptr); std::strftime(ch, sizeof(ch), "%Y_%m_%d_%H_%M_%S", localtime(&t)); return ch; } std::string MetaKeyUtils::idKey() { return kIdKey; } std::string MetaKeyUtils::balanceTaskKey( JobID jobId, GraphSpaceID spaceId, PartitionID partId, HostAddr src, HostAddr dst) { std::string key; key.reserve(64); key.append(reinterpret_cast<const char*>(kBalanceTaskTable.data()), kBalanceTaskTable.size()) .append(reinterpret_cast<const char*>(&jobId), sizeof(JobID)) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&partId), sizeof(PartitionID)) .append(serializeHostAddr(src)) .append(serializeHostAddr(dst)); return key; } std::string MetaKeyUtils::balanceTaskVal(BalanceTaskStatus status, BalanceTaskResult result, int64_t startTime, int64_t endTime) { std::string val; val.reserve(32); val.append(reinterpret_cast<const char*>(&status), sizeof(BalanceTaskStatus)) .append(reinterpret_cast<const char*>(&result), sizeof(BalanceTaskResult)) .append(reinterpret_cast<const char*>(&startTime), sizeof(int64_t)) .append(reinterpret_cast<const char*>(&endTime), sizeof(int64_t)); return val; } std::string MetaKeyUtils::balanceTaskPrefix(JobID jobId) { std::string prefix; prefix.reserve(32); prefix.append(reinterpret_cast<const char*>(kBalanceTaskTable.data()), kBalanceTaskTable.size()) .append(reinterpret_cast<const char*>(&jobId), sizeof(JobID)); return prefix; } std::tuple<BalanceID, GraphSpaceID, PartitionID, HostAddr, HostAddr> MetaKeyUtils::parseBalanceTaskKey(const folly::StringPiece& rawKey) { uint32_t offset = kBalanceTaskTable.size(); auto jobId = *reinterpret_cast<const JobID*>(rawKey.begin() + offset); offset += sizeof(jobId); auto spaceId = *reinterpret_cast<const GraphSpaceID*>(rawKey.begin() + offset); offset += sizeof(GraphSpaceID); auto partId = *reinterpret_cast<const PartitionID*>(rawKey.begin() + offset); offset += sizeof(PartitionID); auto src = MetaKeyUtils::deserializeHostAddr({rawKey, offset}); offset += src.host.size() + sizeof(size_t) + sizeof(uint32_t); auto dst = MetaKeyUtils::deserializeHostAddr({rawKey, offset}); return std::make_tuple(jobId, spaceId, partId, src, dst); } std::tuple<BalanceTaskStatus, BalanceTaskResult, int64_t, int64_t> MetaKeyUtils::parseBalanceTaskVal(const folly::StringPiece& rawVal) { int32_t offset = 0; auto status = *reinterpret_cast<const BalanceTaskStatus*>(rawVal.begin() + offset); offset += sizeof(BalanceTaskStatus); auto ret = *reinterpret_cast<const BalanceTaskResult*>(rawVal.begin() + offset); offset += sizeof(BalanceTaskResult); auto start = *reinterpret_cast<const int64_t*>(rawVal.begin() + offset); offset += sizeof(int64_t); auto end = *reinterpret_cast<const int64_t*>(rawVal.begin() + offset); return std::make_tuple(status, ret, start, end); } std::string MetaKeyUtils::zoneKey(const std::string& zone) { std::string key; key.reserve(kZonesTable.size() + zone.size()); key.append(kZonesTable.data(), kZonesTable.size()).append(zone); return key; } std::string MetaKeyUtils::zoneVal(const std::vector<HostAddr>& hosts) { std::string value; value.append(network::NetworkUtils::toHostsStr(hosts)); return value; } const std::string& MetaKeyUtils::zonePrefix() { return kZonesTable; } std::string MetaKeyUtils::parseZoneName(folly::StringPiece rawData) { return rawData.subpiece(kZonesTable.size(), rawData.size()).toString(); } std::vector<HostAddr> MetaKeyUtils::parseZoneHosts(folly::StringPiece rawData) { std::vector<HostAddr> addresses; auto hostsOrErr = network::NetworkUtils::toHosts(rawData.str()); if (hostsOrErr.ok()) { addresses = std::move(hostsOrErr.value()); } else { LOG(ERROR) << "invalid input for parseZoneHosts()"; } return addresses; } std::string MetaKeyUtils::listenerKey(GraphSpaceID spaceId, PartitionID partId, meta::cpp2::ListenerType type) { std::string key; key.reserve(kListenerTable.size() + sizeof(GraphSpaceID) + sizeof(meta::cpp2::ListenerType) + sizeof(PartitionID)); key.append(kListenerTable.data(), kListenerTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&type), sizeof(meta::cpp2::ListenerType)) .append(reinterpret_cast<const char*>(&partId), sizeof(PartitionID)); return key; } std::string MetaKeyUtils::listenerPrefix(GraphSpaceID spaceId) { std::string key; key.reserve(kListenerTable.size() + sizeof(GraphSpaceID)); key.append(kListenerTable.data(), kListenerTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } std::string MetaKeyUtils::listenerPrefix(GraphSpaceID spaceId, meta::cpp2::ListenerType type) { std::string key; key.reserve(kListenerTable.size() + sizeof(GraphSpaceID) + sizeof(meta::cpp2::ListenerType)); key.append(kListenerTable.data(), kListenerTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&type), sizeof(meta::cpp2::ListenerType)); return key; } meta::cpp2::ListenerType MetaKeyUtils::parseListenerType(folly::StringPiece rawData) { auto offset = kListenerTable.size() + sizeof(GraphSpaceID); return *reinterpret_cast<const meta::cpp2::ListenerType*>(rawData.data() + offset); } GraphSpaceID MetaKeyUtils::parseListenerSpace(folly::StringPiece rawData) { auto offset = kListenerTable.size(); return *reinterpret_cast<const GraphSpaceID*>(rawData.data() + offset); } PartitionID MetaKeyUtils::parseListenerPart(folly::StringPiece rawData) { auto offset = kListenerTable.size() + sizeof(meta::cpp2::ListenerType) + sizeof(GraphSpaceID); return *reinterpret_cast<const PartitionID*>(rawData.data() + offset); } std::string MetaKeyUtils::statsKey(GraphSpaceID spaceId) { std::string key; key.reserve(kStatsTable.size() + sizeof(GraphSpaceID)); key.append(kStatsTable.data(), kStatsTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } std::string MetaKeyUtils::statsVal(const meta::cpp2::StatsItem& statsItem) { std::string val; apache::thrift::CompactSerializer::serialize(statsItem, &val); return val; } meta::cpp2::StatsItem MetaKeyUtils::parseStatsVal(folly::StringPiece rawData) { meta::cpp2::StatsItem statsItem; apache::thrift::CompactSerializer::deserialize(rawData, statsItem); return statsItem; } GraphSpaceID MetaKeyUtils::parseStatsSpace(folly::StringPiece rawData) { auto offset = kStatsTable.size(); return *reinterpret_cast<const GraphSpaceID*>(rawData.data() + offset); } const std::string& MetaKeyUtils::statsKeyPrefix() { return kStatsTable; } std::string MetaKeyUtils::serviceKey(const meta::cpp2::ExternalServiceType& type) { std::string key; key.reserve(kServicesTable.size() + sizeof(meta::cpp2::ExternalServiceType)); key.append(kServicesTable.data(), kServicesTable.size()) .append(reinterpret_cast<const char*>(&type), sizeof(meta::cpp2::ExternalServiceType)); return key; } const std::string& MetaKeyUtils::servicePrefix() { return kServicesTable; } meta::cpp2::ExternalServiceType MetaKeyUtils::parseServiceType(folly::StringPiece rawData) { auto offset = kServicesTable.size(); return *reinterpret_cast<const meta::cpp2::ExternalServiceType*>(rawData.data() + offset); } std::string MetaKeyUtils::serviceVal(const std::vector<meta::cpp2::ServiceClient>& clients) { std::string val; apache::thrift::CompactSerializer::serialize(clients, &val); return val; } std::vector<meta::cpp2::ServiceClient> MetaKeyUtils::parseServiceClients( folly::StringPiece rawData) { std::vector<meta::cpp2::ServiceClient> clients; apache::thrift::CompactSerializer::deserialize(rawData, clients); return clients; } const std::string& MetaKeyUtils::sessionPrefix() { return kSessionsTable; } std::string MetaKeyUtils::sessionKey(SessionID sessionId) { std::string key; key.reserve(kSessionsTable.size() + sizeof(sessionId)); key.append(kSessionsTable.data(), kSessionsTable.size()) .append(reinterpret_cast<const char*>(&sessionId), sizeof(SessionID)); return key; } std::string MetaKeyUtils::sessionVal(const meta::cpp2::Session& session) { std::string val; apache::thrift::CompactSerializer::serialize(session, &val); return val; } SessionID MetaKeyUtils::getSessionId(const folly::StringPiece& key) { return *reinterpret_cast<const SessionID*>(key.data() + kSessionsTable.size()); } meta::cpp2::Session MetaKeyUtils::parseSessionVal(const folly::StringPiece& val) { meta::cpp2::Session session; apache::thrift::CompactSerializer::deserialize(val, session); return session; } std::string MetaKeyUtils::fulltextIndexKey(const std::string& indexName) { std::string key; key.reserve(kFTIndexTable.size() + indexName.size()); key.append(kFTIndexTable.data(), kFTIndexTable.size()).append(indexName); return key; } std::string MetaKeyUtils::fulltextIndexVal(const meta::cpp2::FTIndex& index) { std::string val; apache::thrift::CompactSerializer::serialize(index, &val); return val; } std::string MetaKeyUtils::parsefulltextIndexName(folly::StringPiece key) { return key.subpiece(kFTIndexTable.size(), key.size()).toString(); } meta::cpp2::FTIndex MetaKeyUtils::parsefulltextIndex(folly::StringPiece val) { meta::cpp2::FTIndex ftIndex; apache::thrift::CompactSerializer::deserialize(val, ftIndex); return ftIndex; } std::string MetaKeyUtils::fulltextIndexPrefix() { return kFTIndexTable; } std::string MetaKeyUtils::localIdKey(GraphSpaceID spaceId) { std::string key; key.reserve(kLocalIdTable.size() + sizeof(GraphSpaceID)); key.append(kLocalIdTable.data(), kLocalIdTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } GraphSpaceID MetaKeyUtils::parseLocalIdSpace(folly::StringPiece rawData) { auto offset = kLocalIdTable.size(); return *reinterpret_cast<const GraphSpaceID*>(rawData.data() + offset); } /** * diskPartsKey = kDiskPartsTable + * len(serialized(hostAddr)) + serialized(hostAddr) + * space id + * disk path */ HostAddr MetaKeyUtils::parseDiskPartsHost(const folly::StringPiece& rawData) { auto offset = kDiskPartsTable.size(); auto hostAddrLen = *reinterpret_cast<const size_t*>(rawData.begin() + offset); offset += sizeof(size_t); std::string hostAddrStr(rawData.data() + offset, hostAddrLen); return deserializeHostAddr(hostAddrStr); } GraphSpaceID MetaKeyUtils::parseDiskPartsSpace(const folly::StringPiece& rawData) { auto offset = kDiskPartsTable.size(); size_t hostAddrLen = *reinterpret_cast<const size_t*>(rawData.begin() + offset); offset += sizeof(size_t) + hostAddrLen; return *reinterpret_cast<const GraphSpaceID*>(rawData.begin() + offset); } std::string MetaKeyUtils::parseDiskPartsPath(const folly::StringPiece& rawData) { auto offset = kDiskPartsTable.size(); size_t hostAddrLen = *reinterpret_cast<const size_t*>(rawData.begin() + offset); offset += sizeof(size_t) + hostAddrLen + sizeof(GraphSpaceID); std::string path(rawData.begin() + offset, rawData.size() - offset); return path; } std::string MetaKeyUtils::diskPartsPrefix() { return kDiskPartsTable; } std::string MetaKeyUtils::diskPartsPrefix(HostAddr addr) { std::string key; std::string hostStr = serializeHostAddr(addr); size_t hostAddrLen = hostStr.size(); key.reserve(kDiskPartsTable.size() + sizeof(size_t) + hostStr.size()); key.append(kDiskPartsTable.data(), kDiskPartsTable.size()) .append(reinterpret_cast<const char*>(&hostAddrLen), sizeof(size_t)) .append(hostStr.data(), hostStr.size()); return key; } std::string MetaKeyUtils::diskPartsPrefix(HostAddr addr, GraphSpaceID spaceId) { std::string key; std::string prefix = diskPartsPrefix(addr); key.reserve(prefix.size() + sizeof(GraphSpaceID)); key.append(prefix.data(), prefix.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } std::string MetaKeyUtils::diskPartsKey(HostAddr addr, GraphSpaceID spaceId, const std::string& path) { std::string key; std::string prefix = diskPartsPrefix(addr, spaceId); key.reserve(prefix.size() + path.size()); key.append(prefix.data(), prefix.size()).append(path.data(), path.size()); return key; } std::string MetaKeyUtils::diskPartsVal(const meta::cpp2::PartitionList& partList) { std::string val; apache::thrift::CompactSerializer::serialize(partList, &val); return val; } meta::cpp2::PartitionList MetaKeyUtils::parseDiskPartsVal(const folly::StringPiece& rawData) { meta::cpp2::PartitionList partList; apache::thrift::CompactSerializer::deserialize(rawData, partList); return partList; } const std::string& MetaKeyUtils::jobPrefix() { return kJobTable; } std::string MetaKeyUtils::jobPrefix(GraphSpaceID spaceId) { std::string key; key.reserve(kJobTable.size() + sizeof(GraphSpaceID)); key.append(kJobTable.data(), kJobTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)); return key; } std::string MetaKeyUtils::jobKey(GraphSpaceID spaceID, JobID jobId) { std::string key; key.reserve(kJobTable.size() + sizeof(GraphSpaceID) + sizeof(JobID)); key.append(kJobTable.data(), kJobTable.size()) .append(reinterpret_cast<const char*>(&spaceID), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&jobId), sizeof(JobID)); return key; } bool MetaKeyUtils::isJobKey(const folly::StringPiece& rawKey) { if (!rawKey.startsWith(kJobTable)) { return false; } return rawKey.size() == kJobTable.size() + sizeof(GraphSpaceID) + sizeof(JobID); } std::string MetaKeyUtils::jobVal(const meta::cpp2::JobType& type, std::vector<std::string> paras, meta::cpp2::JobStatus jobStatus, int64_t startTime, int64_t stopTime, nebula::cpp2::ErrorCode errCode) { std::string val; val.reserve(256); val.append(reinterpret_cast<const char*>(&type), sizeof(meta::cpp2::JobType)); auto paraSize = paras.size(); val.append(reinterpret_cast<const char*>(&paraSize), sizeof(size_t)); for (auto& para : paras) { auto len = para.length(); val.append(reinterpret_cast<const char*>(&len), sizeof(len)) .append(reinterpret_cast<const char*>(&para[0]), len); } val.append(reinterpret_cast<const char*>(&jobStatus), sizeof(meta::cpp2::JobStatus)) .append(reinterpret_cast<const char*>(&startTime), sizeof(int64_t)) .append(reinterpret_cast<const char*>(&stopTime), sizeof(int64_t)) .append(reinterpret_cast<const char*>(&errCode), sizeof(nebula::cpp2::ErrorCode)); return val; } std::tuple<meta::cpp2::JobType, std::vector<std::string>, meta::cpp2::JobStatus, int64_t, int64_t, nebula::cpp2::ErrorCode> MetaKeyUtils::parseJobVal(folly::StringPiece rawVal) { CHECK_GE(rawVal.size(), sizeof(meta::cpp2::JobType) + sizeof(size_t) + sizeof(meta::cpp2::JobStatus) + sizeof(int64_t) * 2); auto type = *reinterpret_cast<const meta::cpp2::JobType*>(rawVal.data()); auto offset = sizeof(const meta::cpp2::JobType); std::vector<std::string> paras; auto vec_size = *reinterpret_cast<const size_t*>(rawVal.data() + offset); offset += sizeof(size_t); for (size_t i = 0; i < vec_size; ++i) { auto len = *reinterpret_cast<const size_t*>(rawVal.data() + offset); offset += sizeof(size_t); paras.emplace_back(rawVal.data() + offset, len); offset += len; } auto status = *reinterpret_cast<const meta::cpp2::JobStatus*>(rawVal.data() + offset); offset += sizeof(meta::cpp2::JobStatus); auto tStart = *reinterpret_cast<const int64_t*>(rawVal.data() + offset); offset += sizeof(int64_t); auto tStop = *reinterpret_cast<const int64_t*>(rawVal.data() + offset); offset += sizeof(int64_t); auto errCode = *reinterpret_cast<const nebula::cpp2::ErrorCode*>(rawVal.data() + offset); return std::make_tuple(type, paras, status, tStart, tStop, errCode); } std::pair<GraphSpaceID, JobID> MetaKeyUtils::parseJobKey(folly::StringPiece key) { auto offset = kJobTable.size(); auto spaceId = *reinterpret_cast<const GraphSpaceID*>(key.data() + offset); offset += sizeof(GraphSpaceID); auto jobId = *reinterpret_cast<const JobID*>(key.data() + offset); return std::make_pair(spaceId, jobId); } std::string MetaKeyUtils::taskKey(GraphSpaceID spaceId, JobID jobId, TaskID taskId) { std::string key; key.reserve(kJobTable.size() + sizeof(GraphSpaceID) + sizeof(JobID) + sizeof(TaskID)); key.append(kJobTable.data(), kJobTable.size()) .append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID)) .append(reinterpret_cast<const char*>(&jobId), sizeof(JobID)) .append(reinterpret_cast<const char*>(&taskId), sizeof(TaskID)); return key; } std::tuple<GraphSpaceID, JobID, TaskID> MetaKeyUtils::parseTaskKey(folly::StringPiece key) { auto offset = kJobTable.size(); auto spaceId = *reinterpret_cast<const GraphSpaceID*>(key.data() + offset); offset += sizeof(GraphSpaceID); auto jobId = *reinterpret_cast<const JobID*>(key.data() + offset); offset += sizeof(JobID); auto taskId = *reinterpret_cast<const TaskID*>(key.data() + offset); return std::make_tuple(spaceId, jobId, taskId); } std::string MetaKeyUtils::taskVal(HostAddr host, meta::cpp2::JobStatus jobStatus, int64_t startTime, int64_t stopTime, nebula::cpp2::ErrorCode errCode) { std::string val; val.reserve(128); val.append(MetaKeyUtils::serializeHostAddr(host)) .append(reinterpret_cast<const char*>(&jobStatus), sizeof(meta::cpp2::JobStatus)) .append(reinterpret_cast<const char*>(&startTime), sizeof(int64_t)) .append(reinterpret_cast<const char*>(&stopTime), sizeof(int64_t)) .append(reinterpret_cast<const char*>(&errCode), sizeof(nebula::cpp2::ErrorCode)); return val; } std::tuple<HostAddr, meta::cpp2::JobStatus, int64_t, int64_t, nebula::cpp2::ErrorCode> MetaKeyUtils::parseTaskVal(folly::StringPiece rawVal) { CHECK_GE(rawVal.size(), sizeof(size_t) + sizeof(Port) + sizeof(meta::cpp2::JobStatus) + sizeof(int64_t) * 2 + sizeof(nebula::cpp2::ErrorCode)); size_t offset = 0; HostAddr host = MetaKeyUtils::deserializeHostAddr(rawVal); offset += sizeof(size_t); offset += host.host.size(); offset += sizeof(uint32_t); auto status = *reinterpret_cast<const meta::cpp2::JobStatus*>(rawVal.data() + offset); offset += sizeof(meta::cpp2::JobStatus); auto tStart = *reinterpret_cast<const int64_t*>(rawVal.data() + offset); offset += sizeof(int64_t); auto tStop = *reinterpret_cast<const int64_t*>(rawVal.data() + offset); offset += sizeof(int64_t); auto errCode = *reinterpret_cast<const nebula::cpp2::ErrorCode*>(rawVal.data() + offset); return std::make_tuple(host, status, tStart, tStop, errCode); } } // namespace nebula
[ "noreply@github.com" ]
jievince.noreply@github.com
094c7cecdf97da2fa0c5e419166b40f66f0554e6
921952daf1ab83922a7a622c086ba87788a3b84e
/include/server/model/usermodel.hpp
d6a5ea0073e119878b80710844d232a09dc6f14f
[]
no_license
linzeyu599/chatserver
effab46ce8320b14fb621fb9d697bd31a7971b48
795e2b981136e9c41fecd7d49326dabe201c1079
refs/heads/main
2023-06-29T21:32:35.150793
2021-08-08T14:11:07
2021-08-08T14:11:07
393,975,603
1
0
null
null
null
null
UTF-8
C++
false
false
378
hpp
#ifndef USERMODEL_H #define USERMODEL_H #include "user.hpp" //User表的数据操作类 class UserModel { public: //User表的增加方法 bool insert(User &user); //根据用户号码查询用户信息 User query(int id); //更新用户的状态信息 bool updateState(User user); //重置用户的状态信息 void resetState(); }; #endif
[ "linzeyu599@163.com" ]
linzeyu599@163.com
99b132e6b4ce7b529321626e3de40ae94047e81e
dec4ef167e1ce49062645cbf036be324ea677b5e
/SDK/PUBG_Carapackage_RedBox_classes.hpp
9231bc80974469ebc9b912d49f50d789ca8f3c5c
[]
no_license
qrluc/pubg-sdk-3.7.19.5
519746887fa2204f27f5c16354049a8527367bfb
583559ee1fb428e8ba76398486c281099e92e011
refs/heads/master
2021-04-15T06:40:38.144620
2018-03-26T00:55:36
2018-03-26T00:55:36
126,754,368
1
0
null
null
null
null
UTF-8
C++
false
false
686
hpp
#pragma once // PlayerUnknown's Battlegrounds (3.5.7.7) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "PUBG_Carapackage_RedBox_structs.hpp" namespace PUBG { //--------------------------------------------------------------------------- //Classes //--------------------------------------------------------------------------- // BlueprintGeneratedClass Carapackage_RedBox.Carapackage_RedBox_C // 0x0000 (0x05E8 - 0x05E8) class ACarapackage_RedBox_C : public ACarePackageItem { public: static UClass* StaticClass() { static UClass* ptr = nullptr; if (!ptr) ptr = UObject::FindClass(0x4131d65d); return ptr; } }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "qrl@uc.com" ]
qrl@uc.com