hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
109
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
int64
1
48.5k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
330k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
0.99
author_id
stringlengths
2
40
6cadad9b78fad614e28d86902cbf036e988a5e63
355
hpp
C++
src/ECS/Systems/levers.hpp
MirrasHue/PopHead
f6bfe51059723bc6567a057028b7a83fabf7a015
[ "MIT" ]
null
null
null
src/ECS/Systems/levers.hpp
MirrasHue/PopHead
f6bfe51059723bc6567a057028b7a83fabf7a015
[ "MIT" ]
null
null
null
src/ECS/Systems/levers.hpp
MirrasHue/PopHead
f6bfe51059723bc6567a057028b7a83fabf7a015
[ "MIT" ]
null
null
null
#pragma once #include "ECS/system.hpp" #include "Utilities/rect.hpp" namespace ph::system { class Levers : public System { public: using System::System; void update(float dt) override; void onEvent(const ActionEvent& event) override; private: void handleUsedLevers() const; void handleListeners(bool isActivated, unsigned leverId) const; }; }
15.434783
64
0.749296
MirrasHue
6caef0f93004327e022dfd7c4e178511007be40e
499
cpp
C++
src/Broker.cpp
lmussier/ServiceProvider
9a011379b8bd54423b19d62de7ca508b52068c4b
[ "MIT" ]
null
null
null
src/Broker.cpp
lmussier/ServiceProvider
9a011379b8bd54423b19d62de7ca508b52068c4b
[ "MIT" ]
null
null
null
src/Broker.cpp
lmussier/ServiceProvider
9a011379b8bd54423b19d62de7ca508b52068c4b
[ "MIT" ]
null
null
null
#include <QCoreApplication> #include "Broker.hpp" void Broker::sub(QObject* p_subscriber, const QEvent& p_event){ subecribers[p_event.type()].push_back(p_subscriber); } void Broker::pub(QEvent* p_event){ for (std::pair<QEvent::Type, std::vector<QObject*>>item : this->subecribers) { if(item.first == p_event->type()) { for(auto subscriber : item.second) { QCoreApplication::postEvent(subscriber, p_event); } } } }
27.722222
85
0.609218
lmussier
6cb95630d4792ce5477ebb16f5b34c2ab0b7b637
3,074
hpp
C++
src/VremanSGS.hpp
emathew1/MPI_3DCompact
1945eabdc240e8754c9ea356ba954683dee0149f
[ "MIT" ]
2
2021-01-14T21:13:53.000Z
2022-01-16T23:03:43.000Z
src/VremanSGS.hpp
emathew1/MPI_3DCompact
1945eabdc240e8754c9ea356ba954683dee0149f
[ "MIT" ]
null
null
null
src/VremanSGS.hpp
emathew1/MPI_3DCompact
1945eabdc240e8754c9ea356ba954683dee0149f
[ "MIT" ]
3
2018-11-17T21:24:57.000Z
2020-08-02T03:19:42.000Z
#ifndef _CVREMANSGSH_ #define _CVREMANSGSH_ #include "Macros.hpp" #include "AbstractFilter.hpp" #include "AbstractDerivatives.hpp" #include "Compact10Filter.hpp" class VremanSGS: public AbstractSGS{ public: double c; VremanSGS(AbstractCSolver *cs){ this->mpiRank = cs->mpiRank; this->cs = cs; Nx = cs->dom->gNx; Ny = cs->dom->gNy; Nz = cs->dom->gNz; N = cs->dom->gN; cs->dom->getPencilDecompInfo(pxSize, pySize, pzSize, pxStart, pyStart, pzStart, pxEnd, pyEnd, pzEnd); musgsAvgType = cs->opt->musgsAvgType; //Vreman SGS Coefficient... //Smag constant... double csma = 0.17; c = 2.5*csma*csma; //initialize mu_sgs cs->c2d->allocY(mu_sgs); //Do some explicit filtering, just need to do something to smooth out the mu_sgs field //Could probably do some less complicated filtering or averaging if need be filtX = new Compact10Filter(-0.49, cs->dom, cs->bc, cs->bc->bcXType, AbstractDerivatives::DIRX); filtY = new Compact10Filter(-0.49, cs->dom, cs->bc, cs->bc->bcYType, AbstractDerivatives::DIRY); filtZ = new Compact10Filter(-0.49, cs->dom, cs->bc, cs->bc->bcZType, AbstractDerivatives::DIRZ); } void getSGSViscosity(double *gradU[3][3], double *rho, double *rhoU, double *rhoV, double *rhoW, double *rhoE){ //From Vreman (2004) FOR_XYZ_YPEN{ //There's also an anisotropic form, may need some love to work correctly with curvilinear mesh... double vol = cs->dom->dx*cs->dom->dy*cs->dom->dz/cs->msh->J[ip]; double del = pow(vol, 1.0/3.0); double d1 = del*del; double d2 = d1; double d3 = d1; double d1v1 = gradU[0][0][ip]; double d2v1 = gradU[0][1][ip]; double d3v1 = gradU[0][2][ip]; double d1v2 = gradU[1][0][ip]; double d2v2 = gradU[1][1][ip]; double d3v2 = gradU[1][2][ip]; double d1v3 = gradU[2][0][ip]; double d2v3 = gradU[2][1][ip]; double d3v3 = gradU[2][2][ip]; double b11 = d1*d1v1*d1v1+d2*d2v1*d2v1+d3*d3v1*d3v1; double b12 = d1*d1v1*d1v2+d2*d2v1*d2v2+d3*d3v1*d3v2; double b13 = d1*d1v1*d1v3+d2*d2v1*d2v3+d3*d3v1*d3v3; double b22 = d1*d1v2*d1v2+d2*d2v2*d2v2+d3*d3v2*d3v2; double b23 = d1*d1v2*d1v3+d2*d2v2*d2v3+d3*d3v2*d3v3; double b33 = d1*d1v3*d1v3+d2*d2v3*d2v3+d3*d3v3*d3v3; double abeta = d1v1*d1v1 + d1v2*d1v2 + d1v3*d1v3 + d2v1*d2v1 + d2v2*d2v2 + d2v3*d2v3 + d3v1*d3v1 + d2v3*d2v3 + d3v3*d3v3; double bbeta = b11*b22-(b12*b12)+b11*b33-(b13*b13)+b22*b33-(b23*b23); double eps = 1e-12; if(bbeta < eps){ bbeta = eps; } double ss = sqrt(bbeta/(abeta+eps)); mu_sgs[ip] = c*rho[ip]*ss; //Should we clip mu_sgs at the high end too? mu_sgs[ip] = min(mu_sgs[ip], 0.05*d1*sqrt(2.0*abeta)); } //Do some averaging of the mu_sgs if we want to... doAveraging(); } void calcKSGS(double *gradT[3], double *rho, double *rhoU, double *rhoV, double *rhoW, double *T){}; void calcMuSGSTaukk(double *gradU[3][3], double *rho, double *rhoU, double *rhoV, double *rhoW, double *rhoE){}; }; #endif
29
116
0.635329
emathew1
6cba7b0a6f81a93b55f0e0a4ec3bbfe4912f6e05
2,444
hpp
C++
src/impl/ProcessImpl.hpp
eshenhu/ProcessBase
78dedc0ba338e147f97d35b732e7e01dfff81b90
[ "MIT" ]
null
null
null
src/impl/ProcessImpl.hpp
eshenhu/ProcessBase
78dedc0ba338e147f97d35b732e7e01dfff81b90
[ "MIT" ]
null
null
null
src/impl/ProcessImpl.hpp
eshenhu/ProcessBase
78dedc0ba338e147f97d35b732e7e01dfff81b90
[ "MIT" ]
null
null
null
/* * $Id:$ * * Header file for the processimpl class. * */ /** \file This file provides definitions and functions for the processimpl class. */ #ifndef PROCESSIMPL_HPP #define PROCESSIMPL_HPP #include <string> #include <pthread.h> #include <boost/asio.hpp> #include <boost/program_options.hpp> #include "fwkLogStream.hpp" namespace Process { class Process; class ProcessImpl { public: ProcessImpl( Process &parent, int argc, char *argv[], FwkUint32_t flags, const boost::program_options::options_description &options); ~ProcessImpl(); bool isGood() const; void exit(); bool exiting(); int system( const char *const cmdStr ); FwkInt8_t instanceNum() const; const std::string& name() const; const std::string& baseName() const; int run(); const boost::program_options::variables_map& programOptions() const; /// Add threads that will be cleanedup (cancel/join) upon process exit void addThreadForCleanup( pthread_t tid); /// Remove thread from the cleanup list void removeThreadForCleanup( pthread_t tid); private: void processConnClose( int sig); void processDoNothing( int sig); int ProcessSingletonCheck( void); void makeBasePlusInstanceName(void); static int timedJoinWrapper( pthread_t tid); void performThreadOperation( const char *opName, int (*threadOp)(pthread_t)); void cleanupThreads( void); pthread_t mainPthreadId(void) const; boost::asio::io_service& get_io_service(void); void processUnixSignal( const boost::system::error_code &code, int sig_num); Process &parent_; FwkUint32_t flags_; bool isGood_; bool exit_ = false; boost::program_options::options_description options_; boost::program_options::variables_map variablesMap_; FwkUint32_t instanceNum_; std::string baseName_; std::string basePlusInstanceName_; boost::asio::io_service io_service_; int pid_; pthread_t mainPthreadId_; std::string lockFile_; Fwk::FwkLogStream logStream_; int fdLock_; std::vector<pthread_t> threadsToCleanup_; mutable std::recursive_mutex mutex_; static const size_t MAX_LEN_LOCK_FILE_PATH; }; } #endif
18.238806
75
0.644845
eshenhu
6cbc90e445e7202a31fbbffa69fb14896c669434
2,977
hpp
C++
src/ControlSystem/Tags.hpp
GAcuna001/spectre
645a7f203b2ced1b1205e346d3abaf2adaf0e6ba
[ "MIT" ]
null
null
null
src/ControlSystem/Tags.hpp
GAcuna001/spectre
645a7f203b2ced1b1205e346d3abaf2adaf0e6ba
[ "MIT" ]
null
null
null
src/ControlSystem/Tags.hpp
GAcuna001/spectre
645a7f203b2ced1b1205e346d3abaf2adaf0e6ba
[ "MIT" ]
null
null
null
// Distributed under the MIT License. // See LICENSE.txt for details. #pragma once #include <array> #include <limits> #include <memory> #include <string> #include <unordered_map> #include <utility> #include "DataStructures/DataBox/Tag.hpp" #include "DataStructures/DataVector.hpp" #include "Domain/Creators/DomainCreator.hpp" #include "Domain/FunctionsOfTime/FunctionOfTime.hpp" #include "Domain/FunctionsOfTime/PiecewisePolynomial.hpp" #include "Domain/OptionTags.hpp" #include "Time/Tags.hpp" #include "Utilities/ErrorHandling/Error.hpp" #include "Utilities/MakeWithValue.hpp" #include "Utilities/TMPL.hpp" namespace control_system::Tags { /// The measurement timescales associated with /// domain::Tags::FunctionsOfTime. Each function of time associated /// with a control system has a corresponding set of timescales here, /// represented as `PiecewisePolynomial<0>` with the same components /// as the function itself. struct MeasurementTimescales : db::SimpleTag { using type = std::unordered_map< std::string, std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>; static constexpr bool pass_metavariables = true; template <typename Metavariables> using option_tags = tmpl::list<domain::OptionTags::DomainCreator<Metavariables::volume_dim>, OptionTags::InitialTimeStep>; template <typename Metavariables> static type create_from_options( const std::unique_ptr<::DomainCreator<Metavariables::volume_dim>>& domain_creator, const double initial_time_step) noexcept { std::unordered_map<std::string, std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>> timescales; for (const auto& function_of_time : domain_creator->functions_of_time()) { if (function_of_time.second->time_bounds()[1] == std::numeric_limits<double>::infinity()) { // This function of time is not controlled by a control // system. It is an analytic function or similar. continue; } const double function_initial_time = function_of_time.second->time_bounds()[0]; const DataVector used_for_size = function_of_time.second->func(function_initial_time)[0]; // This check is intentionally inside the loop over the // functions of time so that it will not trigger for domains // without control systems. if (initial_time_step <= 0.0) { ERROR( "Control systems can only be used in forward-in-time evolutions."); } auto initial_timescale = make_with_value<DataVector>(used_for_size, initial_time_step); timescales.emplace( function_of_time.first, std::make_unique<domain::FunctionsOfTime::PiecewisePolynomial<0>>( function_initial_time, std::array{std::move(initial_timescale)}, std::numeric_limits<double>::infinity())); } return timescales; } }; } // namespace control_system::Tags
36.753086
80
0.707424
GAcuna001
6cc0c35f8e93bd7749b1b7de16a4840288b52739
3,733
cpp
C++
algospot/luckynum/main.cpp
seirion/code
3b8bf79764107255185061cec33decbc2235d03a
[ "Apache-2.0" ]
13
2015-06-07T09:26:26.000Z
2019-05-01T13:23:38.000Z
algospot/luckynum/main.cpp
seirion/code
3b8bf79764107255185061cec33decbc2235d03a
[ "Apache-2.0" ]
null
null
null
algospot/luckynum/main.cpp
seirion/code
3b8bf79764107255185061cec33decbc2235d03a
[ "Apache-2.0" ]
4
2016-03-05T06:21:05.000Z
2017-02-17T15:34:18.000Z
// http://algospot.com/judge/problem/read/LUCKYNUM #include <cstdio> #include <cstring> #include <cstdlib> #include <deque> #include <iterator> using namespace std; class BigNum { public: BigNum() {} BigNum(const char* in) { set(in); } BigNum &set(const char* in) { int size = strlen(in); for (int i = 0; i < size; i++) { v.push_back(in[i]); } return *this; } void push(int i) { v.push_back(i); } void clear() { v.clear(); } deque<char> v; BigNum operator -(const BigNum &bn) const { if (*this < bn) { return bn - *this; } BigNum ss; ss.v = v; if (bn.v.empty()) return ss; int aa(ss.v.size()-1), bb(bn.v.size()-1); for (; bb >= 0; aa--, bb--) { if (ss.v[aa] < bn.v[bb]) { ss.v[aa-1]--; ss.v[aa] += 10; } ss.v[aa] -= bn.v[bb]; } while (!ss.v.empty() && ss.v.front() == 0) ss.v.pop_front(); return ss; } bool operator <(const BigNum &bn) const { if (v.size() < bn.v.size()) return true; if (v.size() > bn.v.size()) return false; for (int i = 0; i < v.size(); i++) { if (v[i] != bn.v[i]) return v[i] < bn.v[i]; } return false; } void print() const { for (int i = 0; i < v.size(); i++) printf("%d", v[i]); printf("\n"); } }; int k, size; int in[10]; BigNum b; void input() { b.clear(); char buffer[204]; gets(buffer); size = strlen(buffer) - 2; // space, k k = buffer[size + 1] - '0'; for (int i = 0; i < size; i++) { b.push(buffer[i] - '0'); } } void reset() { memset(in, 0, sizeof(int) * 10); for (int i = 0; i < size; i++) in[b.v[i]]++; } int get_min(int from) { for (int i = from + 1; i <= 9; i++) { if (in[i] > 0) { in[i]--; return i; } } return -1; } int get_max(int from) { for (int i = from - 1; i >= 0; i--) { if (in[i] > 0) { in[i]--; return i; } } return -1; } BigNum make_greater() { reset(); BigNum ss; int remain = size; while (remain > 0) { if (in[k] > 0) { ss.push(k); in[k]--; remain--; } else { int temp = get_min(k); if (temp == -1) { ss.v.clear(); return ss; } ss.push(temp); remain--; break; } } for (int i = 0; i <= 9; i++) { while (in[i] > 0) { ss.push(i); in[i]--; } } return ss; } BigNum make_less() { reset(); BigNum ss; int remain = size; while (remain > 0) { if (in[k] > 0) { ss.push(k); in[k]--; remain--; } else { int temp = get_max(k); if (temp == -1) { ss.v.clear(); return ss; } ss.push(temp); remain--; break; } } for (int i = 9; i >= 0; i--) { while (in[i] > 0) { ss.push(i); in[i]--; } } return ss; } void solve() { BigNum gg = make_greater(); BigNum ll = make_less(); BigNum lucky; for (int i = 0; i < size; i++) lucky.v.push_back(k); BigNum xx = gg-lucky; BigNum yy = ll-lucky; if (yy < xx) { ll.print(); } else { gg.print(); } } int main() { int num; scanf("%d\n", &num); for (int i = 0; i < num; i++) {input(); solve();} return 0; }
19.962567
68
0.396732
seirion
6cc0f0dee5e4c625b110ca879bf9ac2f88b07ffd
164
cpp
C++
worker/fuzzer/src/RTC/RTCP/FuzzerFeedbackRtpSrReq.cpp
kcking/mediasoup
f385349d0f06fe14a4e38d50f0212b48d588fa32
[ "ISC" ]
4,465
2017-04-05T20:00:24.000Z
2022-03-31T13:27:43.000Z
worker/fuzzer/src/RTC/RTCP/FuzzerFeedbackRtpSrReq.cpp
kcking/mediasoup
f385349d0f06fe14a4e38d50f0212b48d588fa32
[ "ISC" ]
617
2017-04-05T21:24:27.000Z
2022-03-31T06:17:25.000Z
worker/fuzzer/src/RTC/RTCP/FuzzerFeedbackRtpSrReq.cpp
kcking/mediasoup
f385349d0f06fe14a4e38d50f0212b48d588fa32
[ "ISC" ]
900
2017-04-11T09:25:27.000Z
2022-03-30T21:37:00.000Z
#include "RTC/RTCP/FuzzerFeedbackRtpSrReq.hpp" void Fuzzer::RTC::RTCP::FeedbackRtpSrReq::Fuzz(::RTC::RTCP::FeedbackRtpSrReqPacket* packet) { // packet->Dump(); }
23.428571
91
0.737805
kcking
6cc68530567a432ab0f16680cdce678b3077c1eb
1,169
cpp
C++
Stack/RemoveAllAdjacentDuplicatesInString_1047.cpp
obviouskkk/leetcode
5d25c3080fdc9f68ae79e0f4655a474a51ff01fc
[ "BSD-3-Clause" ]
null
null
null
Stack/RemoveAllAdjacentDuplicatesInString_1047.cpp
obviouskkk/leetcode
5d25c3080fdc9f68ae79e0f4655a474a51ff01fc
[ "BSD-3-Clause" ]
null
null
null
Stack/RemoveAllAdjacentDuplicatesInString_1047.cpp
obviouskkk/leetcode
5d25c3080fdc9f68ae79e0f4655a474a51ff01fc
[ "BSD-3-Clause" ]
null
null
null
/* *********************************************************************** > File Name: RemoveAllAdjacentDuplicatesInString_1047.cpp > Author: zzy > Mail: 942744575@qq.com > Created Time: Fri 05 Jul 2019 12:00:20 PM CST ********************************************************************** */ #include <stdio.h> #include <vector> #include <string> #include <stdio.h> #include <climits> #include <stack> #include <gtest/gtest.h> using std::vector; using std::string; using std::stack; /* * * 给出由小写字母组成的字符串 S,重复项删除操作会选择两个相邻且相同的字母,并删除它们。 * * 在 S 上反复执行重复项删除操作,直到无法继续删除。 * * 在完成所有重复项删除操作后返回最终的字符串。答案保证唯一。 * */ class Solution { public: string removeDuplicates(string S) { string ret; int len = S.length(); for (int i = 0; i < len ; ++i) { if (ret.empty() || ret.back() != S[i]) { ret.push_back(S[i]); } else { if (ret.back() == S[i]) { ret.pop_back(); } } } return ret; } }; TEST(testCase,test0) { string s1 {"aabbc"}; string s1_out = "c"; Solution s; EXPECT_EQ(s.removeDuplicates(s1), s1_out); } int main(int argc, char* argv[]) { testing::InitGoogleTest(&argc,argv); return RUN_ALL_TESTS(); }
18.265625
74
0.550898
obviouskkk
6cca7c924f43aa57e6bf5b807202dbf47113b72c
8,232
cpp
C++
src/nc/core/ir/liveness/LivenessAnalyzer.cpp
treadstoneproject/tracethreat_nrml
bcf666b01c20f7da4234fed018dad3b2cf4d3d28
[ "Apache-2.0" ]
6
2016-09-06T02:10:08.000Z
2021-01-19T09:02:04.000Z
src/nc/core/ir/liveness/LivenessAnalyzer.cpp
treadstoneproject/tracethreat_nrml
bcf666b01c20f7da4234fed018dad3b2cf4d3d28
[ "Apache-2.0" ]
null
null
null
src/nc/core/ir/liveness/LivenessAnalyzer.cpp
treadstoneproject/tracethreat_nrml
bcf666b01c20f7da4234fed018dad3b2cf4d3d28
[ "Apache-2.0" ]
6
2015-10-02T14:11:45.000Z
2021-01-19T09:02:07.000Z
/* The file is part of Snowman decompiler. */ /* See doc/licenses.asciidoc for the licensing information. */ // // SmartDec decompiler - SmartDec is a native code to C/C++ decompiler // Copyright (C) 2015 Alexander Chernov, Katerina Troshina, Yegor Derevenets, // Alexander Fokin, Sergey Levin, Leonid Tsvetkov // // This file is part of SmartDec decompiler. // // SmartDec decompiler 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 3 of the License, or // (at your option) any later version. // // SmartDec decompiler 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 SmartDec decompiler. If not, see <http://www.gnu.org/licenses/>. // #include "LivenessAnalyzer.h" #include <cassert> #include <nc/common/Foreach.h> #include <nc/core/arch/Architecture.h> #include <nc/core/ir/BasicBlock.h> #include <nc/core/ir/Function.h> #include <nc/core/ir/Jump.h> #include <nc/core/ir/Statements.h> #include <nc/core/ir/Terms.h> #include <nc/core/ir/calling/CallHook.h> #include <nc/core/ir/calling/Hooks.h> #include <nc/core/ir/calling/ReturnHook.h> #include <nc/core/ir/calling/Signatures.h> #include <nc/core/ir/cflow/BasicNode.h> #include <nc/core/ir/cflow/Graph.h> #include <nc/core/ir/cflow/Switch.h> #include <nc/core/ir/dflow/Dataflow.h> #include <nc/core/ir/dflow/Utils.h> #include <nc/core/ir/dflow/Value.h> #include "Liveness.h" namespace nc { namespace core { namespace ir { namespace liveness { LivenessAnalyzer::LivenessAnalyzer(Liveness &liveness, const Function *function, const dflow::Dataflow &dataflow, const arch::Architecture *architecture, const cflow::Graph *regionGraph, const calling::Hooks &hooks, const calling::Signatures *signatures, const LogToken &log ): liveness_(liveness), function_(function), dataflow_(dataflow), architecture_(architecture), regionGraph_(regionGraph), hooks_(hooks), signatures_(signatures), log_(log) {} void LivenessAnalyzer::analyze() { computeInvisibleJumps(); foreach (const BasicBlock *basicBlock, function_->basicBlocks()) { foreach (const Statement *statement, basicBlock->statements()) { computeLiveness(statement); } } } void LivenessAnalyzer::computeInvisibleJumps() { if (!regionGraph_) { return; } invisibleJumps_.clear(); foreach (auto node, regionGraph_->nodes()) { if (auto region = node->as<cflow::Region>()) { if (auto witch = region->as<cflow::Switch>()) { if (witch->boundsCheckNode()) { invisibleJumps_.push_back(witch->boundsCheckNode()->basicBlock()->getJump()); } invisibleJumps_.push_back(witch->switchNode()->basicBlock()->getJump()); makeLive(witch->switchTerm()); } } } std::sort(invisibleJumps_.begin(), invisibleJumps_.end()); } void LivenessAnalyzer::computeLiveness(const Statement *statement) { switch (statement->kind()) { case Statement::INLINE_ASSEMBLY: break; case Statement::ASSIGNMENT: { auto assignment = statement->asAssignment(); auto memoryLocation = dataflow_.getMemoryLocation(assignment->left()); if (!memoryLocation || architecture_->isGlobalMemory(memoryLocation)) { makeLive(assignment->left()); } break; } case Statement::JUMP: { const Jump *jump = statement->asJump(); if (!std::binary_search(invisibleJumps_.begin(), invisibleJumps_.end(), jump)) { if (jump->condition()) { makeLive(jump->condition()); } if (jump->thenTarget().address() && !dflow::isReturnAddress(jump->thenTarget(), dataflow_)) { makeLive(jump->thenTarget().address()); } if (jump->elseTarget().address() && !dflow::isReturnAddress(jump->elseTarget(), dataflow_)) { makeLive(jump->elseTarget().address()); } if (signatures_ && dflow::isReturn(jump, dataflow_)) { if (auto signature = signatures_->getSignature(function_)) { if (signature->returnValue()) { if (auto returnHook = hooks_.getReturnHook(jump)) { makeLive(returnHook->getReturnValueTerm(signature->returnValue().get())); } } } } } break; } case Statement::CALL: { const Call *call = statement->asCall(); makeLive(call->target()); if (signatures_) { if (auto signature = signatures_->getSignature(call)) { if (auto callHook = hooks_.getCallHook(call)) { foreach (const auto &argument, signature->arguments()) { makeLive(callHook->getArgumentTerm(argument.get())); } } } } break; } case Statement::HALT: break; case Statement::TOUCH: break; case Statement::CALLBACK: break; case Statement::REMEMBER_REACHING_DEFINITIONS: break; default: log_.warning(tr("%1: Unknown statement kind: %2.").arg(Q_FUNC_INFO).arg(statement->kind())); break; } } void LivenessAnalyzer::propagateLiveness(const Term *term) { assert(term != nullptr); #ifdef NC_PREFER_CONSTANTS_TO_EXPRESSIONS if (term->isRead() && dataflow_.getValue(term)->abstractValue().isConcrete()) { return; } #endif switch (term->kind()) { case Term::INT_CONST: break; case Term::INTRINSIC: break; case Term::MEMORY_LOCATION_ACCESS: { if (term->isRead()) { foreach (auto &chunk, dataflow_.getDefinitions(term).chunks()) { foreach (const Term *definition, chunk.definitions()) { makeLive(definition); } } } else if (term->isWrite()) { if (auto source = term->source()) { makeLive(source); } } break; } case Term::DEREFERENCE: { if (term->isRead()) { foreach (auto &chunk, dataflow_.getDefinitions(term).chunks()) { foreach (const Term *definition, chunk.definitions()) { makeLive(definition); } } } else if (term->isWrite()) { if (auto source = term->source()) { makeLive(source); } } if (!dataflow_.getMemoryLocation(term)) { makeLive(term->asDereference()->address()); } break; } case Term::UNARY_OPERATOR: { const UnaryOperator *unary = term->asUnaryOperator(); makeLive(unary->operand()); break; } case Term::BINARY_OPERATOR: { const BinaryOperator *binary = term->asBinaryOperator(); makeLive(binary->left()); makeLive(binary->right()); break; } default: log_.warning(tr("%1: Unknown term kind: %2.").arg(Q_FUNC_INFO).arg(term->kind())); break; } } void LivenessAnalyzer::makeLive(const Term *term) { assert(term != nullptr); if (!liveness_.isLive(term)) { liveness_.makeLive(term); propagateLiveness(term); } } } // namespace liveness } // namespace ir } // namespace core } // namespace nc /* vim:set et sts=4 sw=4: */
33.737705
109
0.570821
treadstoneproject
6ccdebc8f68de35135e38c17be74ec3f0b04d810
1,104
hpp
C++
source/ashes/renderer/GlRenderer/Pipeline/GlPipelineCache.hpp
DragonJoker/Ashes
a6ed950b3fd8fb9626c60b4291fbd52ea75ac66e
[ "MIT" ]
227
2018-09-17T16:03:35.000Z
2022-03-19T02:02:45.000Z
source/ashes/renderer/GlRenderer/Pipeline/GlPipelineCache.hpp
DragonJoker/RendererLib
0f8ad8edec1b0929ebd10247d3dd0a9ee8f8c91a
[ "MIT" ]
39
2018-02-06T22:22:24.000Z
2018-08-29T07:11:06.000Z
source/ashes/renderer/GlRenderer/Pipeline/GlPipelineCache.hpp
DragonJoker/Ashes
a6ed950b3fd8fb9626c60b4291fbd52ea75ac66e
[ "MIT" ]
8
2019-05-04T10:33:32.000Z
2021-04-05T13:19:27.000Z
/** *\file * Image.h *\author * Sylvain Doremus */ #ifndef ___GlRenderer_PipelineCache_HPP___ #define ___GlRenderer_PipelineCache_HPP___ #pragma once #include "renderer/GlRenderer/GlRendererPrerequisites.hpp" #include <common/ArrayView.hpp> namespace ashes::gl { /** *\brief * Un pipeline de rendu. */ class PipelineCache : public AutoIdIcdObject< PipelineCache > { public: /** *name * Construction / Destruction. */ /**@{*/ PipelineCache( VkAllocationCallbacks const * allocInfo , VkDevice device , VkPipelineCacheCreateInfo createInfo ); ~PipelineCache(); /**@}*/ VkResult merge( ArrayView< VkPipelineCache const > pipelines ); inline ByteArray const & getData()const { return m_data; } inline VkDevice getDevice()const { return m_device; } private: struct Header { uint32_t headerLength; uint32_t headerVersion; uint32_t vendorID; uint32_t deviceID; uint8_t pipelineCacheUUID[VK_UUID_SIZE]; }; private: Header m_header; VkDevice m_device; VkPipelineCacheCreateInfo m_createInfo; ByteArray m_data; }; } #endif
16.477612
65
0.713768
DragonJoker
6cd13a901a317d0353b622bc64ad8511ef5e319a
662
cpp
C++
1267/b.cpp
shioju/codeforces
ac0f72596298a15cfdbedc3fea18e637a8734a68
[ "MIT" ]
null
null
null
1267/b.cpp
shioju/codeforces
ac0f72596298a15cfdbedc3fea18e637a8734a68
[ "MIT" ]
null
null
null
1267/b.cpp
shioju/codeforces
ac0f72596298a15cfdbedc3fea18e637a8734a68
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int left = 0, right = s.size()-1; int count = 0; char color = s[0]; int lastLeft = left, lastRight = right; while (left<=right) { if (s[left] == color) { left++; count++; } else if (s[right] == color) { right--; count++; } else { if (count>2 && lastLeft < left && right < lastRight) { color = s[left]; count = 0; lastLeft = left; lastRight = right; } else { cout << 0; return 0; } } } if (count>1) { cout << (count + 1); } else { cout << 0; } }
17.891892
60
0.459215
shioju
6cd149663eb89e167c4c2ecde9683c11823dfac7
1,365
hpp
C++
DNS with Benefits/DBMatchSystem.hpp
SFaghihi/DNSWithBenefits
2553866c0a634313eab00f1a6eb485fa3eb7ab14
[ "Apache-2.0" ]
null
null
null
DNS with Benefits/DBMatchSystem.hpp
SFaghihi/DNSWithBenefits
2553866c0a634313eab00f1a6eb485fa3eb7ab14
[ "Apache-2.0" ]
null
null
null
DNS with Benefits/DBMatchSystem.hpp
SFaghihi/DNSWithBenefits
2553866c0a634313eab00f1a6eb485fa3eb7ab14
[ "Apache-2.0" ]
null
null
null
// // DBMatchSystem.hpp // DNS with Benefits // // Created by Soroush Faghihi on 5/27/18. // Copyright © 2018 sorco. All rights reserved. // #ifndef DBMatchSystem_hpp #define DBMatchSystem_hpp #include <pthread.h> #include <semaphore.h> #include "DBRadixTrie.hpp" /* * The Multithreaded version of DBRadixTree. * Model: * init -> read -> c */ template <int R, class V> class DBMatchSystem { public: typedef void (*match_system_init_fnc_t) (DBRadixTrie<R, std::vector<V>> &, void *); private: DBRadixTrie<R, std::vector<V>> radix_trie; mutable pthread_rwlock_t rw_lock; sem_t *reinit_sem; char *sem_name; const char *sem_template = "/sem.DBMatch.XXXXXXXX"; pthread_t reinit_thread; match_system_init_fnc_t reinit_fnc; void *init_fnc_arg; static void *reinit_routine(void *self_void); public: DBMatchSystem<R, V> (match_system_init_fnc_t init_fnc, void *init_fnc_arg); ~DBMatchSystem<R, V> (); /* * This method is safe to use inside signal handlers! * * This is intentionaly implemented that way to provide for graceful * reset of filtering without restarting the server. */ void signal_reinit(); void insert(const std::string &key, V value); std::vector<V> lookup(const std::string &key) const; }; #endif /* DBMatchSystem_hpp */
23.534483
87
0.675458
SFaghihi
6cd724a070289e4da21e2d0faaa2c225f7d36f60
2,644
cpp
C++
tests/src/kernel/hipGridLaunch.cpp
scchan/HIP
2db70fe5fdc701e1eedc73bea1d247cda855ef05
[ "MIT" ]
1
2021-01-10T09:04:33.000Z
2021-01-10T09:04:33.000Z
tests/src/kernel/hipGridLaunch.cpp
ttsvetanov/HIP
44587f7b070b692a0d5770a55f0a0d788d992806
[ "MIT" ]
1
2019-04-26T12:23:00.000Z
2019-05-15T14:49:19.000Z
tests/src/kernel/hipGridLaunch.cpp
ttsvetanov/HIP
44587f7b070b692a0d5770a55f0a0d788d992806
[ "MIT" ]
null
null
null
/* Copyright (c) 2015-2017 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Test the Grid_Launch syntax. /* HIT_START * BUILD: %t %s ../test_common.cpp * RUN: %t * HIT_END */ #include "hip/hip_runtime.h" #include "test_common.h" // __device__ maps to __attribute__((hc)) __device__ int foo(int i) { return i+1; } //--- //Syntax we would like to support with GRID_LAUNCH enabled: template <typename T> __global__ void vectorADD2( hipLaunchParm lp, T *A_d, T *B_d, T *C_d, size_t N) { size_t offset = (hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x); size_t stride = hipBlockDim_x * hipGridDim_x ; for (size_t i=offset; i<N; i+=stride) { C_d[i] = A_d[i] + B_d[i] ; } } int test_gl2(size_t N) { size_t Nbytes = N*sizeof(int); int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; HipTest::initArrays (&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N); unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); // Full vadd in one large chunk, to get things started: HIPCHECK ( hipMemcpy(A_d, A_h, Nbytes, hipMemcpyHostToDevice)); HIPCHECK ( hipMemcpy(B_d, B_h, Nbytes, hipMemcpyHostToDevice)); hipLaunchKernel(vectorADD2, dim3(blocks), dim3(threadsPerBlock), 0, 0, A_d, B_d, C_d, N); HIPCHECK ( hipMemcpy(C_h, C_d, Nbytes, hipMemcpyDeviceToHost)); HIPCHECK (hipDeviceSynchronize()); HipTest::checkVectorADD(A_h, B_h, C_h, N); return 0; } int main(int argc, char *argv[]) { HipTest::parseStandardArguments(argc, argv, true); test_gl2(N); passed(); }
26.707071
93
0.703101
scchan
6cdef39354526dc35704fc56af11cefa7ec9696b
21,586
cpp
C++
src/xtd.drawing.native.wxwidgets/src/xtd/drawing/native/wxwidgets/graphics.cpp
leanid/xtd
2e1ea6537218788ca08901faf8915d4100990b53
[ "MIT" ]
1
2022-02-25T16:53:06.000Z
2022-02-25T16:53:06.000Z
src/xtd.drawing.native.wxwidgets/src/xtd/drawing/native/wxwidgets/graphics.cpp
leanid/xtd
2e1ea6537218788ca08901faf8915d4100990b53
[ "MIT" ]
null
null
null
src/xtd.drawing.native.wxwidgets/src/xtd/drawing/native/wxwidgets/graphics.cpp
leanid/xtd
2e1ea6537218788ca08901faf8915d4100990b53
[ "MIT" ]
null
null
null
#include <cmath> #include <vector> #include <xtd/argument_exception.h> #include <xtd/convert_string.h> #include <xtd/ustring.h> #define __XTD_DRAWING_NATIVE_LIBRARY__ #include <xtd/drawing/native/graphics.h> #include "../../../../../include/xtd/drawing/native/hdc_wrapper.h" #include "../../../../../include/xtd/drawing/native/wx_brush.h" #include "../../../../../include/xtd/drawing/native/wx_pen.h" #undef __XTD_DRAWING_NATIVE_LIBRARY__ #include <wx/app.h> #include <wx/dcgraph.h> #include <wx/dcmemory.h> #include "wxConicalGradient.h" using namespace xtd; using namespace xtd::drawing::native; namespace { class graphics_context { public: explicit graphics_context(intptr_t hdc) : hdc_(reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->hdc()) { brush_ = hdc_.GetBrush(); pen_ = hdc_.GetPen(); back_color_ = hdc_.GetTextBackground(); fore_color_ = hdc_.GetTextForeground(); font_ = hdc_.GetFont(); } ~graphics_context() { hdc_.SetBrush(brush_); hdc_.SetPen(pen_); hdc_.SetTextBackground(back_color_); hdc_.SetTextForeground(fore_color_); hdc_.SetFont(font_); } private: wxDC& hdc_; wxBrush brush_; wxColour back_color_; wxColour fore_color_; wxPen pen_; wxFont font_; }; wxBrush to_brush(const wx_brush& brush) { if (brush.is_solid_brush()) return wxBrush(brush.get_solid_brush().color); if (brush.is_texture_brush()) return wxBrush(brush.get_texture_brush().texture); throw xtd::argument_exception("brush not defined"_t, current_stack_frame_); } wxGraphicsBrush to_graphics_brush(wxGraphicsContext& graphics, const wx_brush& brush) { if (brush.is_conical_gradiant_brush()) return graphics.CreateBrush(wxBrush(brush.get_conical_gradiant_brush().colors.Item(0).GetColour())); if (brush.is_linear_gradiant_brush()) return graphics.CreateLinearGradientBrush(static_cast<double>(brush.get_linear_gradiant_brush().point1.x), static_cast<double>(brush.get_linear_gradiant_brush().point1.y), static_cast<double>(brush.get_linear_gradiant_brush().point2.x), static_cast<double>(brush.get_linear_gradiant_brush().point2.y), brush.get_linear_gradiant_brush().colors); if (brush.is_radial_gradiant_brush()) return graphics.CreateRadialGradientBrush(static_cast<double>(brush.get_radial_gradiant_brush().focal_point.x), static_cast<double>(brush.get_radial_gradiant_brush().focal_point.y), static_cast<double>(brush.get_radial_gradiant_brush().center_point.x), static_cast<double>(brush.get_radial_gradiant_brush().center_point.y), static_cast<double>(brush.get_radial_gradiant_brush().radius), brush.get_radial_gradiant_brush().colors); if (brush.is_solid_brush()) return graphics.CreateBrush(wxBrush(brush.get_solid_brush().color)); if (brush.is_texture_brush()) return graphics.CreateBrush(wxBrush(brush.get_texture_brush().texture)); throw xtd::argument_exception("brush not defined"_t, current_stack_frame_); } wxPen to_pen(const wx_pen& pen) { if (pen.is_solid_color_pen()) { wxPen wxpen(pen.get_solid_color_pen().color, pen.get_solid_color_pen().width); wxpen.SetStyle(wxPenStyle::wxPENSTYLE_USER_DASH); wxpen.SetCap(wxPenCap::wxCAP_BUTT); wxpen.SetDashes(pen.get_solid_color_pen().dashes.size(), pen.get_solid_color_pen().dashes.data()); return wxpen; } throw xtd::argument_exception("brush not defined"_t, current_stack_frame_); } wxGraphicsPen to_graphics_pen(wxGraphicsContext& graphics, const wx_pen& pen) { if (pen.is_solid_color_pen()) { wxGraphicsPenInfo pen_info; pen_info.Cap(wxPenCap::wxCAP_BUTT); pen_info.Colour(pen.get_solid_color_pen().color); pen_info.Style(wxPenStyle::wxPENSTYLE_USER_DASH); pen_info.Dashes(pen.get_solid_color_pen().dashes.size(), pen.get_solid_color_pen().dashes.data()); pen_info.Width(pen.get_solid_color_pen().width); return graphics.CreatePen(pen_info); } if (pen.is_hatch_fill_pen()) { wxGraphicsPenInfo pen_info; pen_info.Cap(wxPenCap::wxCAP_BUTT); pen_info.Colour({0, 0, 0, 0}); pen_info.Stipple(wxBitmap(pen.get_hatch_fill_pen().brush.get_texture_brush().texture)); pen_info.Width(pen.get_hatch_fill_pen().width); return graphics.CreatePen(pen_info); } if (pen.is_linear_gradiant_pen()) { wxGraphicsPenInfo pen_info; pen_info.Cap(wxPenCap::wxCAP_BUTT); pen_info.Colour({0, 0, 0, 0}); pen_info.LinearGradient(pen.get_linear_gradiant_pen().brush.get_linear_gradiant_brush().point1.x, pen.get_linear_gradiant_pen().brush.get_linear_gradiant_brush().point1.y, pen.get_linear_gradiant_pen().brush.get_linear_gradiant_brush().point2.x, pen.get_linear_gradiant_pen().brush.get_linear_gradiant_brush().point2.y, pen.get_linear_gradiant_pen().brush.get_linear_gradiant_brush().colors); pen_info.Width(pen.get_linear_gradiant_pen().width); return graphics.CreatePen(pen_info); } if (pen.is_radial_gradiant_pen()) { wxGraphicsPenInfo pen_info; pen_info.Cap(wxPenCap::wxCAP_BUTT); pen_info.Colour({0, 0, 0, 0}); pen_info.RadialGradient(pen.get_radial_gradiant_pen().brush.get_radial_gradiant_brush().focal_point.x, pen.get_radial_gradiant_pen().brush.get_radial_gradiant_brush().focal_point.y, pen.get_radial_gradiant_pen().brush.get_radial_gradiant_brush().center_point.x, pen.get_radial_gradiant_pen().brush.get_radial_gradiant_brush().center_point.y, pen.get_radial_gradiant_pen().brush.get_radial_gradiant_brush().radius, pen.get_radial_gradiant_pen().brush.get_radial_gradiant_brush().colors); pen_info.Width(pen.get_radial_gradiant_pen().width); return graphics.CreatePen(pen_info); } if (pen.is_texture_fill_pen()) { wxGraphicsPenInfo pen_info; pen_info.Cap(wxPenCap::wxCAP_BUTT); pen_info.Colour({0, 0, 0, 0}); pen_info.Stipple(wxBitmap(pen.get_texture_fill_pen().brush.get_texture_brush().texture)); pen_info.Width(pen.get_texture_fill_pen().width); return graphics.CreatePen(pen_info); } if (pen.is_conical_gradiant_pen()) { wxGraphicsPenInfo pen_info; pen_info.Cap(wxPenCap::wxCAP_BUTT); pen_info.Colour(pen.get_conical_gradiant_pen().brush.get_conical_gradiant_brush().colors.Item(0).GetColour()); pen_info.Width(pen.get_conical_gradiant_pen().width); return graphics.CreatePen(pen_info); } throw xtd::argument_exception("brush not defined"_t, current_stack_frame_); } } void graphics::clear(intptr_t hdc, uint8_t a, uint8_t r, uint8_t g, uint8_t b) { if (hdc == 0) return; wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); auto path = graphics.CreatePath(); double width = 0.0, height = 0.0; graphics.GetSize(&width, &height); path.AddRectangle(0, 0, width, height); graphics.SetBrush(wxBrush({r, g, b, a})); graphics.FillPath(path); reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::destroy(intptr_t hdc) { if (!hdc) return; xtd::drawing::native::hdc_wrapper* hdc_wrapper = reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc); delete hdc_wrapper; } void graphics::draw_arc(intptr_t hdc, intptr_t pen, int32_t x, int32_t y, int32_t width, int32_t height, int32_t start_angle, int32_t sweep_angle) { if (!hdc) return; graphics_context gc(hdc); wxDC& dc = reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->hdc(); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.SetPen(to_pen(*reinterpret_cast<wx_pen*>(pen))); dc.DrawEllipticArc(x, y, width, height, 360 - start_angle - sweep_angle, 360 - start_angle); reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::draw_bezier(intptr_t hdc, intptr_t pen, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x3, int32_t y3, int32_t x4, int32_t y4) { if (!hdc) return; graphics_context gc(hdc); wxDC& dc = reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->hdc(); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.SetPen(to_pen(*reinterpret_cast<wx_pen*>(pen))); std::vector<wxPoint> points {wxPoint(x1, y1), wxPoint(x2, y2), wxPoint(x3, y3), wxPoint(x4, y4)}; dc.DrawSpline(4, points.data()); reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::draw_ellipse(intptr_t hdc, intptr_t pen, int32_t x, int32_t y, int32_t width, int32_t height) { if (!hdc) return; wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); auto path = graphics.CreatePath(); path.AddEllipse(x, y, width, height); graphics.SetPen(to_graphics_pen(graphics, *reinterpret_cast<wx_pen*>(pen))); graphics.DrawPath(path); reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::draw_image(intptr_t hdc, intptr_t image, int32_t x, int32_t y) { if (!hdc) return; wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); wxBitmap bitmap = wxBitmap(*reinterpret_cast<wxImage*>(image)); graphics.DrawBitmap(bitmap, x, y, bitmap.GetWidth(), bitmap.GetHeight()); reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::draw_image_disabled(intptr_t hdc, intptr_t image, int32_t x, int32_t y, float brightness) { if (!hdc) return; wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); wxBitmap bitmap = wxBitmap(*reinterpret_cast<wxImage*>(image)).ConvertToDisabled(static_cast<uint8_t>(255 * brightness)); graphics.DrawBitmap(bitmap, x, y, bitmap.GetWidth(), bitmap.GetHeight()); reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::draw_line(intptr_t hdc, intptr_t pen, int32_t x1, int32_t y1, int32_t x2, int32_t y2) { if (!hdc) return; wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); graphics.SetPen(to_graphics_pen(graphics, *reinterpret_cast<wx_pen*>(pen))); graphics.StrokeLine(x1, y1, x2, y2); reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::draw_rectangle(intptr_t hdc, intptr_t pen, int32_t x, int32_t y, int32_t width, int32_t height) { if (!hdc) return; wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); graphics.SetPen(to_graphics_pen(graphics, *reinterpret_cast<wx_pen*>(pen))); graphics.DrawRectangle(x, y, width, height); reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::draw_rounded_rectangle(intptr_t hdc, intptr_t pen, int32_t x, int32_t y, int32_t width, int32_t height, int32_t radius) { if (!hdc) return; wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); graphics.SetPen(to_graphics_pen(graphics, *reinterpret_cast<wx_pen*>(pen))); graphics.DrawRoundedRectangle(x, y, width, height, radius); reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::draw_string(intptr_t hdc, const ustring& text, intptr_t font, int32_t x, int32_t y, uint8_t a, uint8_t r, uint8_t g, uint8_t b) { if (!hdc) return; // Workaround : with wxWidgets version <= 3.1.4 wxGraphicsContext::DrawText doesn't work with unicode on Windows. if (wxPlatformInfo::Get().GetOperatingSystemFamilyName() == "Windows") { wxDC& dc = reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->hdc(); dc.SetFont(*reinterpret_cast<wxFont*>(font)); dc.SetTextForeground({ r, g, b, a }); dc.DrawText(wxString(convert_string::to_wstring(text)), x, y); } else { wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); graphics.SetFont(*reinterpret_cast<wxFont*>(font), { r, g, b, a }); graphics.DrawText(wxString(convert_string::to_wstring(text)), x, y); } reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::draw_string(intptr_t hdc, const ustring& text, intptr_t font, int32_t x, int32_t y, int32_t w, int32_t h, uint8_t a, uint8_t r, uint8_t g, uint8_t b) { if (!hdc) return; // Workaround : with wxWidgets version <= 3.1.4 wxGraphicsContext::DrawText doesn't work with unicode on Windows. if (wxPlatformInfo::Get().GetOperatingSystemFamilyName() == "Windows") { wxDC& dc = reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->hdc(); dc.SetClippingRegion({ x, y }, { w, h }); dc.SetFont(*reinterpret_cast<wxFont*>(font)); dc.SetTextForeground({ r, g, b, a }); dc.DrawText(wxString(convert_string::to_wstring(text)), x, y); dc.DestroyClippingRegion(); } else { wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); graphics.Clip(x, y, w, h); graphics.SetFont(*reinterpret_cast<wxFont*>(font), { r, g, b, a }); graphics.DrawText(wxString(convert_string::to_wstring(text)), x, y); graphics.ResetClip(); } reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::fill_ellipse(intptr_t hdc, intptr_t brush, int32_t x, int32_t y, int32_t width, int32_t height) { if (!hdc) return; wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); if (reinterpret_cast<wx_brush*>(brush)->is_conical_gradiant_brush()) { wxBitmap conical_gradient_bitmap = wxConicalGradient::CreateBitmap(wxSize(width, height), reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().colors, reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().center_point - wxPoint(x, y), reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().angle); wxImage conical_gradient_image = conical_gradient_bitmap.ConvertToImage(); wxBitmap conical_gradient_bitmap_mask(width, height); auto conical_gradient_mask_graphics = wxGraphicsContext::Create(wxMemoryDC(conical_gradient_bitmap_mask)); conical_gradient_mask_graphics->SetBrush(conical_gradient_mask_graphics->CreateBrush(wxBrush(wxColour(255, 255, 255)))); conical_gradient_mask_graphics->DrawEllipse(0, 0, width, height); conical_gradient_image.SetMaskFromImage(conical_gradient_bitmap_mask.ConvertToImage(), 0, 0, 0); conical_gradient_bitmap = conical_gradient_image; graphics.DrawBitmap(conical_gradient_bitmap, x, y, width, height); } else { graphics.SetPen(wxNullPen); graphics.SetBrush(to_graphics_brush(graphics, *reinterpret_cast<wx_brush*>(brush))); graphics.DrawEllipse(static_cast<double>(x), static_cast<double>(y), static_cast<double>(width), static_cast<double>(height)); } reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::fill_pie(intptr_t hdc, intptr_t brush, int32_t x, int32_t y, int32_t width, int32_t height, int32_t start_angle, int32_t sweep_angle) { if (!hdc) return; graphics_context gc(hdc); wxDC& dc = reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->hdc(); if (reinterpret_cast<wx_brush*>(brush)->is_conical_gradiant_brush()) { wxBitmap conical_gradient_bitmap = wxConicalGradient::CreateBitmap(wxSize(width, height), reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().colors, reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().center_point - wxPoint(x, y), reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().angle); wxImage conical_gradient_image = conical_gradient_bitmap.ConvertToImage(); wxBitmap conical_gradient_bitmap_mask(width, height); auto conical_gradient_bitmap_mask_dc = wxMemoryDC(conical_gradient_bitmap_mask); conical_gradient_bitmap_mask_dc.SetBrush(wxBrush(wxColour(255, 255, 255))); conical_gradient_bitmap_mask_dc.DrawEllipticArc(0, y, width, height, 360 - start_angle - sweep_angle, 360 - start_angle); conical_gradient_image.SetMaskFromImage(conical_gradient_bitmap_mask.ConvertToImage(), 0, 0, 0); conical_gradient_bitmap = conical_gradient_image; dc.DrawBitmap(conical_gradient_bitmap, x, y); } else { dc.SetBrush(to_brush(*reinterpret_cast<wx_brush*>(brush))); dc.SetPen(wxNullPen); dc.DrawEllipticArc(x, y, width, height, 360 - start_angle - sweep_angle, 360 - start_angle); } reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::fill_rectangle(intptr_t hdc, intptr_t brush, int32_t x, int32_t y, int32_t width, int32_t height) { if (!hdc) return; wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); if (reinterpret_cast<wx_brush*>(brush)->is_conical_gradiant_brush()) { graphics.DrawBitmap(wxConicalGradient::CreateBitmap(wxSize(width, height), reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().colors, reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().center_point - wxPoint(x, y), reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().angle), x, y, width, height); } else { graphics.SetPen(wxNullPen); graphics.SetBrush(to_graphics_brush(graphics, *reinterpret_cast<wx_brush*>(brush))); graphics.DrawRectangle(static_cast<double>(x), static_cast<double>(y), static_cast<double>(width), static_cast<double>(height)); } reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } void graphics::fill_rounded_rectangle(intptr_t hdc, intptr_t brush, int32_t x, int32_t y, int32_t width, int32_t height, int32_t radius) { if (!hdc) return; wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); if (reinterpret_cast<wx_brush*>(brush)->is_conical_gradiant_brush()) { wxBitmap conical_gradient_bitmap = wxConicalGradient::CreateBitmap(wxSize(width, height), reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().colors, reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().center_point - wxPoint(x, y), reinterpret_cast<wx_brush*>(brush)->get_conical_gradiant_brush().angle); wxImage conical_gradient_image = conical_gradient_bitmap.ConvertToImage(); wxBitmap conical_gradient_bitmap_mask(width, height); auto conical_gradient_mask_graphics = wxGraphicsContext::Create(wxMemoryDC(conical_gradient_bitmap_mask)); conical_gradient_mask_graphics->SetBrush(conical_gradient_mask_graphics->CreateBrush(wxBrush(wxColour(255, 255, 255)))); conical_gradient_mask_graphics->DrawRoundedRectangle(0, 0, width, height, radius); conical_gradient_image.SetMaskFromImage(conical_gradient_bitmap_mask.ConvertToImage(), 0, 0, 0); conical_gradient_bitmap = conical_gradient_image; graphics.DrawBitmap(conical_gradient_bitmap, x, y, width, height); } else { graphics.SetPen(wxNullPen); graphics.SetBrush(to_graphics_brush(graphics, *reinterpret_cast<wx_brush*>(brush))); graphics.DrawRoundedRectangle(static_cast<double>(x), static_cast<double>(y), static_cast<double>(width), static_cast<double>(height), static_cast<double>(radius)); } reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->apply_update(); } intptr_t graphics::from_image(intptr_t image) { xtd::drawing::native::hdc_wrapper* hdc_wrapper = new xtd::drawing::native::hdc_wrapper; if (image == 0) hdc_wrapper->create<wxScreenDC>(); else hdc_wrapper->create_memory_hdc(new wxBitmap(*reinterpret_cast<wxImage*>(image)), reinterpret_cast<wxImage*>(image)); return reinterpret_cast<intptr_t>(hdc_wrapper); } void graphics::measure_string(intptr_t hdc, const ustring& text, intptr_t font, int32_t& width, int32_t& height) { if (!hdc) return; width = 0; height = 0; auto strings = text.split({ '\n' }); for (auto string : strings) { double line_width = 0, line_height = 0; // Workaround : with wxWidgets version <= 3.1.4 wxGraphicsContext::GetTextExtent doesn't work with unicode on Windows. if (wxPlatformInfo::Get().GetOperatingSystemFamilyName() == "Windows") { reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->hdc().SetFont(*reinterpret_cast<wxFont*>(font)); wxSize line_size = reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->hdc().GetTextExtent(wxString(convert_string::to_wstring(string))); line_width = line_size.GetWidth(); line_height = line_size.GetHeight(); } else { wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); graphics.SetFont(*reinterpret_cast<wxFont*>(font), { 0, 0, 0 }); graphics.GetTextExtent(wxString(convert_string::to_wstring(string)), &line_width, &line_height); } width = std::max(width, static_cast<int32_t>(line_width)); height += static_cast<int32_t>(line_height); // Workaround : with wxWidgets version <= 3.1.4 width size text is too small on macOS and linux. if (wxPlatformInfo::Get().GetOperatingSystemFamilyName() != "Windows" && reinterpret_cast<wxFont*>(font)->GetStyle() > wxFontStyle::wxFONTSTYLE_NORMAL) width += std::ceil(reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->hdc().GetFontMetrics().averageWidth / 2.3f); } } void graphics::rotate_transform(intptr_t hdc, float angle) { wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); graphics.Rotate(angle); } void graphics::translate_clip(intptr_t hdc, int32_t dx, int32_t dy) { wxGraphicsContext& graphics = *reinterpret_cast<xtd::drawing::native::hdc_wrapper*>(hdc)->graphics(); graphics.Translate(dx, dy); }
57.716578
492
0.746734
leanid
6ce108784810885839354ee1f039fba82cb10995
3,102
cpp
C++
Course codes/HCSR04 Exercise/hcsr04.cpp
MUDAL/Practical-Embedded-Systems-Course
df1026ae6898cfd25a721aa0239bceb2ed6a9404
[ "MIT" ]
null
null
null
Course codes/HCSR04 Exercise/hcsr04.cpp
MUDAL/Practical-Embedded-Systems-Course
df1026ae6898cfd25a721aa0239bceb2ed6a9404
[ "MIT" ]
null
null
null
Course codes/HCSR04 Exercise/hcsr04.cpp
MUDAL/Practical-Embedded-Systems-Course
df1026ae6898cfd25a721aa0239bceb2ed6a9404
[ "MIT" ]
null
null
null
#include "hcsr04.h" void HCSR04_TrigPinPWMInit(pinStruct_t& trigPin, TIM_TypeDef* TIMx, uint8_t gpioAFSelTIMx, uint8_t pwmChannel) { //GPIO config GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitStruct.Pin = trigPin.selectedPin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = gpioAFSelTIMx; HAL_GPIO_Init(trigPin.port,&GPIO_InitStruct); //TIM config TIM_HandleTypeDef htim; TIM_OC_InitTypeDef sConfigOC = {0}; htim.Instance = TIMx; htim.Init.Prescaler = 10 - 1; htim.Init.CounterMode = TIM_COUNTERMODE_UP; htim.Init.Period = 32000 - 1; htim.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; HAL_TIM_PWM_Init(&htim); sConfigOC.OCMode = TIM_OCMODE_PWM1; sConfigOC.Pulse = 24; //15uS trigger pulse sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; HAL_TIM_PWM_ConfigChannel(&htim,&sConfigOC,pwmChannel); //Start PWM signal HAL_TIM_PWM_Start(&htim,pwmChannel); } HCSR04::HCSR04(pinStruct_t& echoPin, TIM_TypeDef* TIMx, uint8_t gpioAFSelTIMx) { pulseWidth = 0; distanceCM = 0; //GPIO config GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitStruct.Pin = echoPin.selectedPin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = gpioAFSelTIMx; HAL_GPIO_Init(echoPin.port,&GPIO_InitStruct); //PWM Input mode config TIM_SlaveConfigTypeDef sSlaveConfig = {0}; TIM_IC_InitTypeDef sConfigIC = {0}; htim.Instance = TIMx; htim.Init.Prescaler = 200 - 1; htim.Init.CounterMode = TIM_COUNTERMODE_UP; htim.Init.Period = 16000 - 1; htim.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim.Init.RepetitionCounter = 0; htim.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; HAL_TIM_IC_Init(&htim); sSlaveConfig.SlaveMode = TIM_SLAVEMODE_RESET; sSlaveConfig.InputTrigger = TIM_TS_TI1FP1; sSlaveConfig.TriggerPolarity = TIM_INPUTCHANNELPOLARITY_RISING; sSlaveConfig.TriggerPrescaler = TIM_ICPSC_DIV1; sSlaveConfig.TriggerFilter = 0; HAL_TIM_SlaveConfigSynchro(&htim, &sSlaveConfig); sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING; sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI; sConfigIC.ICPrescaler = TIM_ICPSC_DIV1; sConfigIC.ICFilter = 0x0F; HAL_TIM_IC_ConfigChannel(&htim, &sConfigIC, TIM_CHANNEL_1); sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING; sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI; HAL_TIM_IC_ConfigChannel(&htim, &sConfigIC, TIM_CHANNEL_2); HAL_TIM_IC_Start(&htim,TIM_CHANNEL_1); HAL_TIM_IC_Start(&htim,TIM_CHANNEL_2); } uint32_t HCSR04::GetDistance(void) { const uint32_t sysClockFreq = 16000000; if((htim.Instance->SR & TIM_SR_CC2IF) == TIM_SR_CC2IF) { pulseWidth = htim.Instance->CCR2; distanceCM = (float)pulseWidth * htim.Init.Prescaler * 1000000 / (58 * sysClockFreq); } return distanceCM; }
32.3125
87
0.770148
MUDAL
6ce4ec6c84b9a3f5bc143fb5ea9483f13b593606
5,449
cpp
C++
src/util/newlib_functions.cpp
0x2152Yet/yet_another_motor_drive
4987d2c48b2594c83a1075f374ef45e1037c68ef
[ "BSD-3-Clause" ]
8
2021-04-19T18:39:30.000Z
2022-03-16T15:16:44.000Z
src/util/newlib_functions.cpp
0x2152Yet/yet_another_motor_drive
4987d2c48b2594c83a1075f374ef45e1037c68ef
[ "BSD-3-Clause" ]
null
null
null
src/util/newlib_functions.cpp
0x2152Yet/yet_another_motor_drive
4987d2c48b2594c83a1075f374ef45e1037c68ef
[ "BSD-3-Clause" ]
2
2021-07-16T04:19:27.000Z
2021-11-07T03:13:54.000Z
//////////////////////////////////////////////////////////////////////////////// // // Yet Another Motor Drive // // MIT License // // Copyright (c) 2021 Michael F. Kaufman // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // //////////////////////////////////////////////////////////////////////////////// // // Provides functions required by the compiler's "newlib". // // Most of these are stubs (items for file I/O, etc.) However support // does exist for printf and a very basic malloc, // //////////////////////////////////////////////////////////////////////////////// #include <errno.h> #include <sys/stat.h> #include <sys/unistd.h> #include <stdint.h> #include "global_definitions.h" #include "uart_interface.h" #ifdef __cplusplus extern "C" { #endif // // These are linker defined symbols that provide the location of the heap // in the processor's memory space. // extern uint32_t _heap_start; extern uint32_t _heap_end; // // These are the prototypes for the items newlib requires. These must be // defined in order for the build to link. // // // _sbrk is required by malloc. // caddr_t _sbrk(const int32_t Increment); // // _write, _isatty, _close, and _fstat are required by printf. // int _write(int file, char *ptr, int len); int _isatty(int file); int _close(int file); int _fstat(int file, struct stat *st); // // The rest are stubs. // int _getpid(); int _kill(int pid, int sig); int _read(int file, char *ptr, int len); int _lseek(int file, int ptr, int dir); //////////////////////////////////////////////////////////////////////////////// // // Memory pool manager for malloc // // This function provides memory to malloc from a pool created by the linker. // We do not support freeing memory in this application. // //////////////////////////////////////////////////////////////////////////////// caddr_t _sbrk(const int32_t Increment) { static caddr_t theHeap = reinterpret_cast<caddr_t>(&_heap_start); static bool outOfHeap = false; caddr_t returnHeap; if (outOfHeap) { returnHeap = NULL; } else { // // "theHeap" always points to the next free block; // returnHeap = theHeap; // // We move the free-heap pointer to the next 8 byte boundary past // the desired increment. // theHeap = reinterpret_cast<caddr_t>( (reinterpret_cast<uint32_t>(theHeap + Increment) + 7U) & ~7U); // // We check to see if we've run out of heap. // if (theHeap >= reinterpret_cast<caddr_t>(&_heap_end)) { outOfHeap = true; returnHeap = NULL; } } return reinterpret_cast<caddr_t>(returnHeap); } //////////////////////////////////////////////////////////////////////////////// // // Outputs characters for printf // // This is called by printf once it has formatted its output string. We // pass the data to the USART driver. // //////////////////////////////////////////////////////////////////////////////// int _write(int file, char *ptr, int len) { theUARTInterface.sendToUART( reinterpret_cast<uint8_t *const>(ptr), static_cast<uint32_t>(len)); return len; } //////////////////////////////////////////////////////////////////////////////// // // Stub functions for printf // // These must be present for printf to link, but we do not require their // functionality. // //////////////////////////////////////////////////////////////////////////////// int _isatty(int file) { return 1; } int _fstat(int file, struct stat *st) { st->st_mode = S_IFCHR; return 0; } //////////////////////////////////////////////////////////////////////////////// // // Stubs for other functions required by the newlib. // All of these that return, return an "error" status. // //////////////////////////////////////////////////////////////////////////////// int _lseek(int file, int ptr, int dir) { return -1; } void _exit(int status) { // // There is no exit... // while(true) { } } int _close(int file) { return -1; } int _getpid() { return -1; } int _kill(int pid, int sig) { return -1; } int _read(int file, char *ptr, int len) { return -1; } #ifdef __cplusplus } #endif /* extern "C" */
25.226852
82
0.543953
0x2152Yet
6ce75c38ff82b9d3df0bca02ec885da3b298e875
500
cpp
C++
arrays/ArrayTraversalRec.cpp
Mohitmauryagit/datastructures
df61f3f5b592dc4fe0b9d6a966b87f3348328e0a
[ "MIT" ]
8
2021-08-12T08:09:37.000Z
2021-12-30T10:45:54.000Z
arrays/ArrayTraversalRec.cpp
Mohitmauryagit/datastructures
df61f3f5b592dc4fe0b9d6a966b87f3348328e0a
[ "MIT" ]
7
2021-06-09T05:13:23.000Z
2022-01-24T04:47:59.000Z
arrays/ArrayTraversalRec.cpp
Mohitmauryagit/datastructures
df61f3f5b592dc4fe0b9d6a966b87f3348328e0a
[ "MIT" ]
4
2021-11-07T07:09:58.000Z
2022-02-08T11:43:56.000Z
#include<iostream> using namespace std; void H(int a[],int i,int size) { if(i>size-1) { cout<<endl; return; } cout<<a[i]<<","; H(a,i+1,size); } void S(int a[],int k,int size) { if(k<0) { cout<<endl; return; } cout<<a[k]<<","; k--; S(a,k,size); } int main() { int a[]={2,7,3,6,4,5,8,9}; int size=sizeof(a)/sizeof(int); int i=0; H(a,i,size); int k=size-1; S(a,k,size); return 0; }
12.820513
35
0.434
Mohitmauryagit
6cf1c785792de12969edf8c8cf3721b725041a69
1,891
cpp
C++
old/src/frontend/qt5/Qt5Locals.cpp
fungosforks/ProDBG
43d8b43660e852b1efd34350af5c7f2ba2ccdae5
[ "MIT" ]
1
2016-03-15T19:03:38.000Z
2016-03-15T19:03:38.000Z
old/src/frontend/qt5/Qt5Locals.cpp
fungosforks/ProDBG
43d8b43660e852b1efd34350af5c7f2ba2ccdae5
[ "MIT" ]
null
null
null
old/src/frontend/qt5/Qt5Locals.cpp
fungosforks/ProDBG
43d8b43660e852b1efd34350af5c7f2ba2ccdae5
[ "MIT" ]
null
null
null
#include "Qt5Locals.h" #include "ProDBGAPI.h" #include "Qt5DebugSession.h" #include "core/log.h" /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// namespace prodbg { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Qt5Locals::Qt5Locals(QWidget* parent) : QTreeWidget(parent) { setColumnCount(4); QStringList headers; headers << "Name" << "Value" << "Type" << "Address"; setHeaderLabels(headers); g_debugSession->addLocals(this); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Qt5Locals::~Qt5Locals() { g_debugSession->delLocals(this); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void Qt5Locals::update(PDReader* reader) { PDReaderIterator it; QList<QTreeWidgetItem*> items; PDRead_findArray(reader, &it, "locals", 0); if (!it) { log_info("Unable to find locals array from reader\n"); return; } while (PDRead_getNextEntry(reader, &it)) { const char* name = ""; const char* value = ""; const char* type = ""; uint64_t address; QStringList temp; PDRead_findString(reader, &name, "name", it); PDRead_findString(reader, &value, "value", it); PDRead_findString(reader, &type, "type", it); PDRead_findU64(reader, &address, "address", it); temp << name << value << type << QString::number(address); items.append(new QTreeWidgetItem((QTreeWidget*)0, temp)); } insertTopLevelItems(0, items); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// }
25.554054
119
0.419884
fungosforks
6cf504e308c5c4b586c26ac153dc748153ba0eb6
737
cpp
C++
0728-Three Distinct Factors/0728-Three Distinct Factors.cpp
lightwindy/LintCode-1
316fa395c9a6de9bfac1d9c9cf58acb5ffb384a6
[ "MIT" ]
77
2017-12-30T13:33:37.000Z
2022-01-16T23:47:08.000Z
0701-0800/0728-Three Distinct Factors/0728-Three Distinct Factors.cpp
jxhangithub/LintCode-1
a8aecc65c47a944e9debad1971a7bc6b8776e48b
[ "MIT" ]
1
2018-05-14T14:15:40.000Z
2018-05-14T14:15:40.000Z
0701-0800/0728-Three Distinct Factors/0728-Three Distinct Factors.cpp
jxhangithub/LintCode-1
a8aecc65c47a944e9debad1971a7bc6b8776e48b
[ "MIT" ]
39
2017-12-07T14:36:25.000Z
2022-03-10T23:05:37.000Z
class Solution { public: /* * @param : the given number * @return: return true if it has exactly three distinct factors, otherwise false */ bool isThreeDisctFactors(long long n) { // write your code here long long sqrtn = sqrt(n); if (sqrtn * sqrtn != n) return false; return isPrime(sqrtn); } private: bool isPrime(long long n) { if (n <= 1) return false; if (n <= 3) return true; if (n % 2 == 0 || n % 3 == 0) return false; for (int i = 5; i * i <= n; i += 6) if (n % i == 0 || n % (i + 2) == 0) return false; return true; } };
23.03125
86
0.446404
lightwindy
6cf527b4c1672831c6d3153232dbb8dbddba0c43
470
hpp
C++
test/utils/typeTraits.hpp
Tradias/contiguous
91d0e3cd150cb3515723a5b70ef030158d37e63f
[ "MIT" ]
3
2021-05-20T16:42:37.000Z
2022-03-15T22:23:23.000Z
test/utils/typeTraits.hpp
Tradias/contiguous
91d0e3cd150cb3515723a5b70ef030158d37e63f
[ "MIT" ]
1
2021-05-22T16:00:46.000Z
2021-05-22T17:50:25.000Z
test/utils/typeTraits.hpp
Tradias/contiguous
91d0e3cd150cb3515723a5b70ef030158d37e63f
[ "MIT" ]
null
null
null
// Copyright (c) 2021 Dennis Hezel // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #ifndef CNTGS_UTILS_TYPETRAITS_HPP #define CNTGS_UTILS_TYPETRAITS_HPP namespace cntgs::test { template <class T> struct RemoveCvref { using Type = std::remove_cv_t<std::remove_reference_t<T>>; }; template <class T> using RemoveCvrefT = typename RemoveCvref<T>::Type; } // namespace cntgs::test #endif // CNTGS_UTILS_TYPETRAITS_HPP
21.363636
62
0.757447
Tradias
6cf9a80d28702ec7db96cfb60afb711ee87d7e2d
634
cpp
C++
SystemResource/Source/Image/PNG/Chunk/PNGInterlaceMethod.cpp
BitPaw/BitFireEngine
2c02a4eae19276bf60ac925e4393966cec605112
[ "MIT" ]
5
2021-10-19T18:30:43.000Z
2022-03-19T22:02:02.000Z
SystemResource/Source/Image/PNG/Chunk/PNGInterlaceMethod.cpp
BitPaw/BitFireEngine
2c02a4eae19276bf60ac925e4393966cec605112
[ "MIT" ]
12
2022-03-09T13:40:21.000Z
2022-03-31T12:47:48.000Z
SystemResource/Source/Image/PNG/Chunk/PNGInterlaceMethod.cpp
BitPaw/BitFireEngine
2c02a4eae19276bf60ac925e4393966cec605112
[ "MIT" ]
null
null
null
#include "PNGInterlaceMethod.h" BF::PNGInterlaceMethod BF::ConvertPNGInterlaceMethod(unsigned char interlaceMethod) { switch (interlaceMethod) { case 0u: return PNGInterlaceMethod::NoInterlace; case 1u: return PNGInterlaceMethod::ADAM7Interlace; default: return PNGInterlaceMethod::Invalid; } } unsigned char BF::ConvertPNGInterlaceMethod(PNGInterlaceMethod interlaceMethod) { switch (interlaceMethod) { default: case BF::PNGInterlaceMethod::Invalid: return (unsigned char)-1; case BF::PNGInterlaceMethod::NoInterlace: return 0u; case BF::PNGInterlaceMethod::ADAM7Interlace: return 1u; } }
19.8125
83
0.76183
BitPaw
9f03fd6bb217568fe30ca36e27ab870eaacdbc7e
7,849
cpp
C++
sm/lib/math.cpp
rimuz/smudge
bd7777b62da97b187d65c2dbcd2d28c420ae0878
[ "Apache-2.0" ]
4
2018-01-17T14:56:00.000Z
2018-12-14T06:48:40.000Z
sm/lib/math.cpp
rimuz/smudge
bd7777b62da97b187d65c2dbcd2d28c420ae0878
[ "Apache-2.0" ]
null
null
null
sm/lib/math.cpp
rimuz/smudge
bd7777b62da97b187d65c2dbcd2d28c420ae0878
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2016-2017 Riccardo Musso * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * File lib/math.cpp * */ #include <random> #include <limits> #include "sm/lib/stdlib.h" namespace sm{ constexpr float_t PI = 3.141592653589793; constexpr float_t DOUBLE_PI = 3.141592653589793*2; constexpr float_t E = 2.718281828459045; namespace lib{ namespace random { std::random_device random_device; std::mt19937 mt(random_device()); std::uniform_real_distribution<> urd(0, 1); } smLibDecl(math){ smInitBox smVar(PI, makeFloat(PI)); smVar(DOUBLE_PI, makeFloat(DOUBLE_PI)); smVar(E, makeFloat(E)); smVar(NAN, makeFloat(NAN)); smVar(INF, makeFloat(INFINITY)) smVar(MAX_INT, makeInteger(std::numeric_limits<integer_t>::max())); smVar(MIN_INT, makeInteger(std::numeric_limits<integer_t>::min())); smFunc(rand, smLambda { return makeFloat(random::urd(random::mt)); }) smFunc(rand_int, smLambda { if(args.size() < 2 || args[0]->type != ObjectType::INTEGER || args[1]->type != ObjectType::INTEGER) return Object(); integer_t min = args[0]->i, max = args[1]->i; if(max < min) return Object(); else if(max == min) return makeInteger(max); integer_t distance = max - min; return makeInteger(min + static_cast<integer_t>(random::urd(random::mt) * distance)); }) #define __SmBind(fnName, realName) \ smFunc(fnName, smLambda { \ if(args.empty()) \ return Object(); \ else if(args[0]->type == ObjectType::INTEGER) \ return makeFloat(std::realName(static_cast<float_t>(args[0]->i))); \ else if(args[0]->type == ObjectType::FLOAT) \ return makeFloat(std::realName(args[0]->f)); \ return Object(); \ }) #define __SmSnBind(fnName) __SmBind(fnName, fnName) __SmSnBind(cos); __SmSnBind(sin); __SmSnBind(tan); __SmSnBind(acos); __SmSnBind(asin); __SmSnBind(atan); __SmSnBind(cosh); __SmSnBind(sinh); __SmSnBind(tanh); __SmSnBind(acosh); __SmSnBind(asinh); __SmSnBind(atanh); __SmSnBind(exp); __SmSnBind(exp2); __SmSnBind(log); __SmSnBind(log2); __SmSnBind(log10); __SmSnBind(sqrt); __SmSnBind(cbrt); __SmSnBind(ceil); __SmSnBind(floor); __SmSnBind(round); __SmSnBind(trunc); #undef __SmBind #undef __SmSnBind smFunc(atan2, smLambda { if(args.empty()) return Object(); float_t x, y; if(args[0]->type == ObjectType::INTEGER) x = args[0]->i; else if(args[0]->type == ObjectType::FLOAT) x = args[0]->f; else return Object(); if(args[1]->type == ObjectType::INTEGER) y = args[1]->i; else if(args[1]->type == ObjectType::FLOAT) y = args[1]->f; else return Object(); return makeFloat(std::atan2(x, y)); }) smFunc(frexp, smLambda { if(args.empty()) return Object(); float_t signif; int exp; if(args[0]->type == ObjectType::INTEGER) signif = std::frexp(static_cast<float_t>(args[0]->i), &exp); else if(args[0]->type == ObjectType::FLOAT) signif = std::frexp(args[0]->f, &exp); else return Object(); return makeList(intp, RootObjectVec_t {makeFloat(signif), makeInteger(exp)}); }) smFunc(pow, smLambda { if(args.empty()) return Object(); float_t x, y; if(args[0]->type == ObjectType::INTEGER) x = args[0]->i; else if(args[0]->type == ObjectType::FLOAT) x = args[0]->f; else return Object(); if(args[1]->type == ObjectType::INTEGER) y = args[1]->i; else if(args[1]->type == ObjectType::FLOAT) y = args[1]->f; else return Object(); return makeFloat(std::pow(x, y)); }) smFunc(hypot, smLambda { if(args.empty()) return Object(); float_t x, y; if(args[0]->type == ObjectType::INTEGER) x = args[0]->i; else if(args[0]->type == ObjectType::FLOAT) x = args[0]->f; else return Object(); if(args[1]->type == ObjectType::INTEGER) y = args[1]->i; else if(args[1]->type == ObjectType::FLOAT) y = args[1]->f; else return Object(); return makeFloat(std::hypot(x, y)); }) smFunc(round_int, smLambda { if(args.empty()) return Object(); else if(args[0]->type == ObjectType::INTEGER) return makeInteger(std::lround(static_cast<float_t>(args[0]->i))); else if(args[0]->type == ObjectType::FLOAT) return makeInteger(std::lround(args[0]->f)); return Object(); }) smFunc(is_nan, smLambda { if(args.empty() || args[0]->type != ObjectType::FLOAT) return makeFalse(); return makeBool(std::isnan(args[0]->f)); }) smFunc(is_inf, smLambda { if(args.empty() || args[0]->type != ObjectType::FLOAT) return makeFalse(); return makeBool(std::isinf(args[0]->f)); }) smFunc(deg, smLambda { if(args[0]->type == ObjectType::FLOAT) return makeFloat(args[0]->f / DOUBLE_PI * 360.f); else if(args[0]->type == ObjectType::INTEGER) return makeFloat(args[0]->i / DOUBLE_PI * 360.f); return Object(); }) smFunc(rad, smLambda { if(args[0]->type == ObjectType::FLOAT) return makeFloat(args[0]->f / 360.f * DOUBLE_PI); else if(args[0]->type == ObjectType::INTEGER) return makeFloat(args[0]->i / 360.f * DOUBLE_PI); return Object(); }) smReturnBox } } }
35.515837
101
0.464136
rimuz
2f69330424389358a648e06eda0b865082abdc9c
674
cpp
C++
sttcl_tests/src/sttcl_tests.cpp
makulik/sttcl
b1be1969b705e9b6a42fadd8581ab678b8485aa4
[ "Unlicense", "BSD-3-Clause" ]
16
2015-05-10T03:52:31.000Z
2020-09-06T20:32:20.000Z
sttcl_tests/src/sttcl_tests.cpp
gnihtemoSgnihtemos/sttcl
b1be1969b705e9b6a42fadd8581ab678b8485aa4
[ "Unlicense", "BSD-3-Clause" ]
2
2015-02-01T17:35:07.000Z
2019-03-08T18:05:53.000Z
sttcl_tests/src/sttcl_tests.cpp
gnihtemoSgnihtemos/sttcl
b1be1969b705e9b6a42fadd8581ab678b8485aa4
[ "Unlicense", "BSD-3-Clause" ]
7
2015-01-27T21:41:55.000Z
2021-03-25T13:41:20.000Z
//============================================================================ // Name : sttcl_tests.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <gtest/gtest.h> #include <gmock/gmock.h> #include "SttclTestLog.h" int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); ::testing::FLAGS_gmock_verbose = "error"; SttclTestLogManager::instance().logFilename("sttcl_tests_debug.log"); SttclTestLogManager::logLevelEnabled(SttclTestLogLevel::All); return RUN_ALL_TESTS(); }
28.083333
78
0.535608
makulik
2f72a4d39ce29a50e23462270bfb55be3547cf62
429
hpp
C++
include/zmf/ModuleState.hpp
zeroSDN/ZeroModuleFramework
a2262a77891b9c6b34d33dc6ff1b9734175fdcce
[ "Apache-2.0" ]
null
null
null
include/zmf/ModuleState.hpp
zeroSDN/ZeroModuleFramework
a2262a77891b9c6b34d33dc6ff1b9734175fdcce
[ "Apache-2.0" ]
null
null
null
include/zmf/ModuleState.hpp
zeroSDN/ZeroModuleFramework
a2262a77891b9c6b34d33dc6ff1b9734175fdcce
[ "Apache-2.0" ]
null
null
null
#ifndef ZMF_MODULESTATE_HPP #define ZMF_MODULESTATE_HPP namespace zmf { namespace data { /** * @details Lifecycle state of a module, dead (shut down), inactive (standby) or active * @author Jonas Grunert * @date created on 8/8/15. */ enum ModuleState { Dead = 0, Inactive = 1, Active = 2, }; } } #endif //ZMF_MODULESTATE_HPP
22.578947
95
0.547786
zeroSDN
2f7d41c4b4b63bf1f0cc902a4df86407a046a7cb
543
cpp
C++
Graph/Adjcency-List.cpp
Shiv-sharma-111/jubilant-sniffle
4cd1ce6fe08f8749f16e569b3a78f3b5576ebe17
[ "MIT" ]
null
null
null
Graph/Adjcency-List.cpp
Shiv-sharma-111/jubilant-sniffle
4cd1ce6fe08f8749f16e569b3a78f3b5576ebe17
[ "MIT" ]
null
null
null
Graph/Adjcency-List.cpp
Shiv-sharma-111/jubilant-sniffle
4cd1ce6fe08f8749f16e569b3a78f3b5576ebe17
[ "MIT" ]
null
null
null
#include<bits/stdc++.h> using namespace std; void addEdge(vector<int> vec[],int u,int v) { vec[u].push_back(v); vec[v].push_back(u); } void display(vector<int> vec[],int V) { for(int i=0;i<V;i++) { cout<<i<<"-->>"; for(auto node : vec[i]) { cout<<node<<" "; } cout<<endl; } } int main() { int V=5; vector<int>vec[V]; addEdge(vec, 0, 1); addEdge(vec, 0, 4); addEdge(vec, 1, 2); addEdge(vec, 1, 3); addEdge(vec, 1, 4); addEdge(vec, 2, 3); addEdge(vec, 3, 4); display(vec,V); return 0; }
15.970588
43
0.539595
Shiv-sharma-111
2f7fb9099bc93a7cead2e83914a1bc388996e3f8
2,551
cpp
C++
src/modules/osgFX/generated_code/Registry.pypp.cpp
cmbruns/osgpyplusplus
f8bfca2cf841e15f6ddb41c958f3ad0d0b9e4b75
[ "BSD-3-Clause" ]
3
2017-04-20T09:11:47.000Z
2021-04-29T19:24:03.000Z
src/modules/osgFX/generated_code/Registry.pypp.cpp
cmbruns/osgpyplusplus
f8bfca2cf841e15f6ddb41c958f3ad0d0b9e4b75
[ "BSD-3-Clause" ]
null
null
null
src/modules/osgFX/generated_code/Registry.pypp.cpp
cmbruns/osgpyplusplus
f8bfca2cf841e15f6ddb41c958f3ad0d0b9e4b75
[ "BSD-3-Clause" ]
null
null
null
// This file has been generated by Py++. #include "boost/python.hpp" #include "wrap_osgFX.h" #include "wrap_referenced.h" #include "Registry.pypp.hpp" namespace bp = boost::python; void register_Registry_class(){ { //::osgFX::Registry typedef bp::class_< osgFX::Registry, bp::bases< ::osg::Referenced >, osg::ref_ptr< osgFX::Registry >, boost::noncopyable > Registry_exposer_t; Registry_exposer_t Registry_exposer = Registry_exposer_t( "Registry", bp::no_init ); bp::scope Registry_scope( Registry_exposer ); { //::osgFX::Registry::Proxy typedef bp::class_< osgFX::Registry::Proxy > Proxy_exposer_t; Proxy_exposer_t Proxy_exposer = Proxy_exposer_t( "Proxy", bp::init< osgFX::Effect const * >(( bp::arg("effect") )) ); bp::scope Proxy_scope( Proxy_exposer ); bp::implicitly_convertible< osgFX::Effect const *, osgFX::Registry::Proxy >(); } { //::osgFX::Registry::getEffectMap typedef ::std::map< std::string, osg::ref_ptr<osgFX::Effect const> > const & ( ::osgFX::Registry::*getEffectMap_function_type )( ) const; Registry_exposer.def( "getEffectMap" , getEffectMap_function_type( &::osgFX::Registry::getEffectMap ) , bp::return_internal_reference< >() ); } { //::osgFX::Registry::instance typedef ::osgFX::Registry * ( *instance_function_type )( ); Registry_exposer.def( "instance" , instance_function_type( &::osgFX::Registry::instance ) , bp::return_internal_reference< >() ); } { //::osgFX::Registry::registerEffect typedef void ( ::osgFX::Registry::*registerEffect_function_type )( ::osgFX::Effect const * ) ; Registry_exposer.def( "registerEffect" , registerEffect_function_type( &::osgFX::Registry::registerEffect ) , ( bp::arg("effect") ) ); } { //::osgFX::Registry::removeEffect typedef void ( ::osgFX::Registry::*removeEffect_function_type )( ::osgFX::Effect const * ) ; Registry_exposer.def( "removeEffect" , removeEffect_function_type( &::osgFX::Registry::removeEffect ) , ( bp::arg("effect") ) ); } Registry_exposer.staticmethod( "instance" ); } }
38.651515
150
0.558996
cmbruns
2f83701ee3b82b1df8757dc39741086f3ee53bbe
6,518
hxx
C++
OCC/opencascade-7.2.0/x64/debug/inc/OpenGl_AspectMarker.hxx
jiaguobing/FastCAE
2348ab87e83fe5c704e4c998cf391229c25ac5d5
[ "BSD-3-Clause" ]
2
2020-02-21T01:04:35.000Z
2020-02-21T03:35:37.000Z
OCC/opencascade-7.2.0/x64/debug/inc/OpenGl_AspectMarker.hxx
Sunqia/FastCAE
cbc023fe07b6e306ceefae8b8bd7c12bc1562acb
[ "BSD-3-Clause" ]
1
2020-03-06T04:49:42.000Z
2020-03-06T04:49:42.000Z
OCC/opencascade-7.2.0/x64/debug/inc/OpenGl_AspectMarker.hxx
Sunqia/FastCAE
cbc023fe07b6e306ceefae8b8bd7c12bc1562acb
[ "BSD-3-Clause" ]
1
2021-11-21T13:03:26.000Z
2021-11-21T13:03:26.000Z
// Created on: 2011-07-13 // Created by: Sergey ZERCHANINOV // Copyright (c) 2011-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef OpenGl_AspectMarker_Header #define OpenGl_AspectMarker_Header #include <Aspect_TypeOfMarker.hxx> #include <Graphic3d_AspectMarker3d.hxx> #include <TCollection_AsciiString.hxx> #include <OpenGl_Element.hxx> #include <OpenGl_TextureSet.hxx> class OpenGl_PointSprite; class OpenGl_ShaderProgram; //! The element holding Graphic3d_AspectMarker3d. class OpenGl_AspectMarker : public OpenGl_Element { public: //! Empty constructor. Standard_EXPORT OpenGl_AspectMarker(); //! Create and assign parameters. Standard_EXPORT OpenGl_AspectMarker (const Handle(Graphic3d_AspectMarker3d)& theAspect); //! Return the aspect. const Handle(Graphic3d_AspectMarker3d)& Aspect() const { return myAspect; } //! Assign new aspect. Standard_EXPORT void SetAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect); //! @return marker size Standard_ShortReal MarkerSize() const { return myMarkerSize; } //! Init and return OpenGl point sprite resource. //! @return point sprite texture. const Handle(OpenGl_TextureSet)& SpriteRes (const Handle(OpenGl_Context)& theCtx) const { if (!myResources.IsSpriteReady()) { myResources.BuildSprites (theCtx, myAspect->GetMarkerImage(), myAspect->Type(), myAspect->Scale(), myAspect->ColorRGBA(), myMarkerSize); myResources.SetSpriteReady(); } return myResources.Sprite(); } //! Init and return OpenGl highlight point sprite resource. //! @return point sprite texture for highlight. const Handle(OpenGl_TextureSet)& SpriteHighlightRes (const Handle(OpenGl_Context)& theCtx) const { if (!myResources.IsSpriteReady()) { myResources.BuildSprites (theCtx, myAspect->GetMarkerImage(), myAspect->Type(), myAspect->Scale(), myAspect->ColorRGBA(), myMarkerSize); myResources.SetSpriteReady(); } return myResources.SpriteA(); } //! Init and return OpenGl shader program resource. //! @return shader program resource. const Handle(OpenGl_ShaderProgram)& ShaderProgramRes (const Handle(OpenGl_Context)& theCtx) const { if (!myResources.IsShaderReady()) { myResources.BuildShader (theCtx, myAspect->ShaderProgram()); myResources.SetShaderReady(); } return myResources.ShaderProgram(); } Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const; Standard_EXPORT virtual void Release (OpenGl_Context* theContext); protected: //! OpenGl resources mutable struct Resources { public: //! Empty constructor. Resources() : myIsSpriteReady (Standard_False), myIsShaderReady (Standard_False) {} const Handle(OpenGl_TextureSet)& Sprite() const { return mySprite; } const Handle(OpenGl_TextureSet)& SpriteA() const { return mySpriteA; } const Handle(OpenGl_ShaderProgram)& ShaderProgram() const { return myShaderProgram; } Standard_Boolean IsSpriteReady() const { return myIsSpriteReady; } Standard_Boolean IsShaderReady() const { return myIsShaderReady; } void SetSpriteReady() { myIsSpriteReady = Standard_True; } void SetShaderReady() { myIsShaderReady = Standard_True; } //! Update texture resource up-to-date state. Standard_EXPORT void UpdateTexturesRediness (const Handle(Graphic3d_AspectMarker3d)& theAspect, Standard_ShortReal& theMarkerSize); //! Update shader resource up-to-date state. Standard_EXPORT void UpdateShaderRediness (const Handle(Graphic3d_AspectMarker3d)& theAspect); //! Release texture resource. Standard_EXPORT void ReleaseTextures (OpenGl_Context* theCtx); //! Release shader resource. Standard_EXPORT void ReleaseShaders (OpenGl_Context* theCtx); //! Build texture resources. Standard_EXPORT void BuildSprites (const Handle(OpenGl_Context)& theCtx, const Handle(Graphic3d_MarkerImage)& theMarkerImage, const Aspect_TypeOfMarker theType, const Standard_ShortReal theScale, const Graphic3d_Vec4& theColor, Standard_ShortReal& theMarkerSize); //! Build shader resources. Standard_EXPORT void BuildShader (const Handle(OpenGl_Context)& theCtx, const Handle(Graphic3d_ShaderProgram)& theShader); private: //! Generate resource keys for a sprite. static void spriteKeys (const Handle(Graphic3d_MarkerImage)& theMarkerImage, const Aspect_TypeOfMarker theType, const Standard_ShortReal theScale, const Graphic3d_Vec4& theColor, TCollection_AsciiString& theKey, TCollection_AsciiString& theKeyA); private: Handle(OpenGl_TextureSet) mySprite; Handle(OpenGl_TextureSet) mySpriteA; Handle(OpenGl_ShaderProgram) myShaderProgram; TCollection_AsciiString myShaderProgramId; Standard_Boolean myIsSpriteReady; Standard_Boolean myIsShaderReady; } myResources; Handle(Graphic3d_AspectMarker3d) myAspect; mutable Standard_ShortReal myMarkerSize; public: DEFINE_STANDARD_ALLOC }; #endif // OpenGl_AspectMarker_Header
36.617978
99
0.653421
jiaguobing
2f8db47bddee6e9a2a0e5701cc7bad34a5e526f8
2,672
cpp
C++
lectures/lecture9/pointers.cpp
clnznr/advancedprogramming
46d1826ab7aca155835e4212050f573382913638
[ "Apache-2.0" ]
1
2017-02-23T23:12:29.000Z
2017-02-23T23:12:29.000Z
lectures/lecture9/pointers.cpp
cleongh/advancedprogramming
46d1826ab7aca155835e4212050f573382913638
[ "Apache-2.0" ]
null
null
null
lectures/lecture9/pointers.cpp
cleongh/advancedprogramming
46d1826ab7aca155835e4212050f573382913638
[ "Apache-2.0" ]
1
2017-07-21T10:38:53.000Z
2017-07-21T10:38:53.000Z
#include <iostream> #include <memory> // pointer to pointer to modify a pointer int c = 9; void modify_pointer(int ** p) { *p = &c; } int d = 15; // note that the order is "*&" void reference_to_pointer(int *& p) { p = &d; } // Pointers and references void pointers_and_references() { int a = 4; int * b = &a; std::cout << "this should print " << a << ": " << *b << std::endl; modify_pointer(&b); std::cout << "this should print " << c << ": " << *b << std::endl; reference_to_pointer(b); std::cout << "this should print " << d << ": " << *b << std::endl; // pointer aritmetic struct test { int x; int y; }; test t[3]; t[0].x = 50; t[0].y = 500; t[1].x = 50; t[1].y = 500; t[2].x = 10; t[2].y = 100; test * tp = t; // pointer can be used as "memory positions", the compiler translates this // as offsets std::cout << (tp + 2)->x << ", " << (tp + 2)->y << std::endl; // tp == 0, we modify it ++tp; std::cout << tp->x << ", " << tp->y << std::endl; } // Smart pointers void smart_pointers() { //////////////////////////////////////////////////////////////////////////// unique // unique pointers are used to have a single pointer. this means that the // owner of the pointer is the only responsible for deleting it (or doing // whatever he wants). Since move semantics are enforced, the user can be // sure no other part of the program can mess with a `unique_ptr` std::unique_ptr<int> u1(new int(5)); //std::unique_ptr<int> u2 = u1; // doesn't compile std::unique_ptr<int> u3 = std::move(u1); //Transfers ownership. p3 now owns the memory and p1 is rendered invalid. u3.reset(); // Deletes the memory. u1.reset(); // Does nothing. // shared pointer // reference counted pointers. only really destroyed when there's no one using them std::shared_ptr<int> s1(new int(5)); std::shared_ptr<int> s2 = s1; //Both now own the memory. // non inmediate initialization std::shared_ptr<int> s3 = std::make_shared<int>(5); s1.reset(); //Memory still exists, due to p2. s2.reset(); //Deletes the memory, since no one else owns the memory. // circular references are a problem (A has a pointer to B and B has a // pointer to A. If A is deleted, should B be deleted too?) // s1 still owns the memory. w1 does not increment reference counting. s1 // might be destroyed and w1 would be pointing to a non-existent object std::weak_ptr<int> w1 = s1; } int main() { pointers_and_references(); smart_pointers(); return 0; }
26.196078
118
0.57485
clnznr
2f92ca5b5ff3b3ebf8eb8ac7cf0af1c877b877a1
468
cc
C++
src/tests/unit/common/test_3Dpoint.cc
ViBOT-Erasmus/BSCVDemoCpp
856e655171115498c9d5ccd2bb8e89ed95726e77
[ "BSD-3-Clause" ]
2
2018-03-20T09:22:27.000Z
2018-04-29T15:17:20.000Z
src/tests/unit/common/test_3Dpoint.cc
ViBOT-Erasmus/BSCVDemoCpp1718
856e655171115498c9d5ccd2bb8e89ed95726e77
[ "BSD-3-Clause" ]
25
2018-02-20T19:20:23.000Z
2019-04-12T10:04:44.000Z
src/tests/unit/common/test_3Dpoint.cc
ViBOT-Erasmus/BSCVDemoCpp1718
856e655171115498c9d5ccd2bb8e89ed95726e77
[ "BSD-3-Clause" ]
14
2018-02-20T19:15:20.000Z
2019-04-12T09:37:11.000Z
// "Copyright [2018] Sadiq" #include <gtest/gtest.h> #include <common/3Dpoint.hpp> // Create our own test to check the different function of our class // This function will take two arguments: // * The test case name // * The test name TEST(first_coordinates_values, second_coordinate_values) { Geometry coordinates(20.0, 45.5, 90.0); ASSERT_FLOAT_EQ(coordinates.x, 20.0); ASSERT_FLOAT_EQ(coordinates.y, 45.5); ASSERT_FLOAT_EQ(coordinates.z, 90.0); }
31.2
67
0.726496
ViBOT-Erasmus
2f9b3d717e3caa78911f78082bf3e0cb13769dc9
2,234
cpp
C++
数据结构/AC自动机/acwing_1285.cpp
tempure/algorithm-advance
38c4504f64cd3fd15fc32cf20a541ad5ba2ad82b
[ "MIT" ]
3
2020-11-16T08:58:30.000Z
2020-11-16T08:58:33.000Z
数据结构/AC自动机/acwing_1285.cpp
tempure/algorithm-advance
38c4504f64cd3fd15fc32cf20a541ad5ba2ad82b
[ "MIT" ]
null
null
null
数据结构/AC自动机/acwing_1285.cpp
tempure/algorithm-advance
38c4504f64cd3fd15fc32cf20a541ad5ba2ad82b
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; #define pb push_back #define all(x) (x).begin(), (x).end() #define sz(x) ((int)(x).size()) typedef vector<int> vi; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; mt19937 mrand(random_device{}()); const ll mod = 1000000007; int rnd(int x) { return mrand() % x;} ll mulmod(ll a, ll b) {ll res = 0; a %= mod; assert(b >= 0); for (; b; b >>= 1) {if (b & 1)res = (res + a) % mod; a = 2 * a % mod;} return res;} ll powmod(ll a, ll b) {ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) {if (b & 1)res = res * a % mod; a = a * a % mod;} return res;} ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;} //snippet-head //注意这题的题意是每个单词在所有单词出现的次数 不是一个长串进行匹配 /* 一个单词如果不是其他单词的字串 那么就是一次 如果是其他串的子串,那就统计后缀 总共的次数就是 所有的 “前缀的后缀就是原串”的后缀总数 + 原来串 计算方法:逆向来算,对于每个后缀 求出与之对应的前缀 也就是ne数组处理 ne[i], ne[ne[i]], ne[ne[ne[i]]]....这样就会处理一个串的所有 与后缀匹配的前缀 假设f[i]表示i结尾的单词的出现的次数 那直接把f[i]加到f[ne[i]]上去 因为单词都是在trie的树根连接的 也就是trie的前缀,一个后缀出现了n次,与之对应的前缀就出现了n次 与后缀匹配的前缀在ne数组已经预处理好了,由fail指针的定义,i向ne[i]连边,图中不会出现环 直接按照拓扑序从下往上树根处递推,最后枚举一下所有单词,也就是和树根连接的这些,求和即可 */ const int N = 1000010; int n; int tr[N][26], idx; int f[N]; //每个单词出现的次数 int q[N], ne[N]; char str[N]; int id[210]; //每个单词对应的节点下标 void insert(int x) { int p = 0; for (int i = 0; str[i] ; i++) { int t = str[i] - 'a'; if (!tr[p][t]) tr[p][t] = ++idx; p = tr[p][t]; f[p] ++; //这里统计的是前缀而不是每个单词的结尾,因为单词会出现 其他单词中 每个字母都算 } id[x] = p; //这里id记录的是每个单词结尾的节点号 } void build() { int hh = 0, tt = -1; for (int i = 0; i < 26; i++) if (tr[0][i]) q[++tt] = tr[0][i]; while (hh <= tt) { int t = q[hh++]; for (int i = 0; i < 26; i++) { int &p = tr[t][i]; if (!p) p = tr[ne[t]][i]; else { ne[p] = tr[ne[t]][i]; q[++tt] = p; } } } } int main() { scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%s", str); insert(i); } build(); //从树底部网上拓扑序遍历 那么bfs的倒序就是拓扑序 for (int i = idx - 1; i >= 0; i--) f[ne[q[i]]] += f[q[i]]; for (int i = 0; i < n; i++) printf("%d\n", f[id[i]]); return 0; }
25.678161
144
0.519248
tempure
2fa7897be464a8fe49df5edcb13522bc878650a2
2,262
cc
C++
1-Simulation/source/src/WindowHit.cc
surfound/CXPD
788a125048cc3d79244a0562d94263e48ca22a6a
[ "Apache-2.0" ]
1
2019-08-01T03:48:26.000Z
2019-08-01T03:48:26.000Z
1-Simulation/source/src/WindowHit.cc
surfound/CXPD
788a125048cc3d79244a0562d94263e48ca22a6a
[ "Apache-2.0" ]
null
null
null
1-Simulation/source/src/WindowHit.cc
surfound/CXPD
788a125048cc3d79244a0562d94263e48ca22a6a
[ "Apache-2.0" ]
null
null
null
//********************************************* // This is auto generated by G4gen 0.6 // author:Qian #include "WindowHit.hh" G4ThreadLocal G4Allocator<WindowHit> *WindowHitAllocator = 0; //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... WindowHit::WindowHit() { this->Init(); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... WindowHit::WindowHit(const WindowHit &right) : G4VHit(right) { this->Init(); pdgID = right.pdgID; prodID = right.prodID; trackID = right.trackID; Edep = right.Edep; stepL = right.stepL; prePos = right.prePos; postPos = right.postPos; isFirstDeposit = right.isFirstDeposit; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... WindowHit::WindowHit(const G4Step *right) { this->Init(); pdgID = right->GetTrack()->GetParticleDefinition()->GetPDGEncoding(); prodID = right->GetTrack()->GetParentID(); trackID = right->GetTrack()->GetTrackID(); Edep = right->GetTotalEnergyDeposit(); stepL = right->GetStepLength(); prePos = right->GetPostStepPoint()->GetPosition(); postPos = right->GetPreStepPoint()->GetPosition(); isFirstDeposit = right->IsFirstStepInVolume(); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... WindowHit::~WindowHit() { } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... const WindowHit &WindowHit::operator=(const WindowHit &right) { this->Init(); pdgID = right.pdgID; prodID = right.prodID; trackID = right.trackID; Edep = right.Edep; stepL = right.stepL; prePos = right.prePos; postPos = right.postPos; isFirstDeposit = right.isFirstDeposit; return *this; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... int WindowHit::operator==(const WindowHit &) const { return 0; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... void WindowHit::Init() { pdgID = 0; prodID = 0; trackID = 0; Edep = 0.; stepL = 0.; prePos = G4ThreeVector(0., 0., 0.); postPos = G4ThreeVector(0., 0., 0.); isFirstDeposit = false; }
25.41573
78
0.60168
surfound
2fa89fda606deb339cd9c9c854ec09d8a2cb8384
22,678
cxx
C++
osprey/be/lno/ff_pragmas.cxx
sharugupta/OpenUH
daddd76858a53035f5d713f648d13373c22506e8
[ "BSD-2-Clause" ]
null
null
null
osprey/be/lno/ff_pragmas.cxx
sharugupta/OpenUH
daddd76858a53035f5d713f648d13373c22506e8
[ "BSD-2-Clause" ]
null
null
null
osprey/be/lno/ff_pragmas.cxx
sharugupta/OpenUH
daddd76858a53035f5d713f648d13373c22506e8
[ "BSD-2-Clause" ]
null
null
null
/* * Copyright 2004, 2005, 2006 PathScale, Inc. All Rights Reserved. */ /* Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it would be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Further, this software is distributed without any warranty that it is free of the rightful claim of any third person regarding infringement or the like. Any license provided herein, whether implied or otherwise, applies only to this software file. Patent licenses, if any, provided herein do not apply to combinations of this program with other software, or any other product whatsoever. You should have received a copy of the GNU General Public License along with this program; if not, write the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, Mountain View, CA 94043, or: http://www.sgi.com For further information regarding this notice, see: http://oss.sgi.com/projects/GenInfo/NoticeExplan */ //-*-c++-*- #ifdef USE_PCH #include "lno_pch.h" #endif // USE_PCH #pragma hdrstop #include "defs.h" #include "wn.h" #include "wn_pragmas.h" #include "cxx_memory.h" #include "lnopt_main.h" #include "lwn_util.h" #include "fission.h" #include "fusion.h" #include "errors.h" #include "erbe.h" #include "erglob.h" #include "lnoutils.h" static MEM_POOL FF_PRAGMA_default_pool; // BOOL FF_Pragma_Seen_Before(WN* pragma) // // If the pragma id and line of this WN has been used as a parameter to // this routine *ever* in this compilation (e.g. in this or another PU), // then return TRUE. Otherwise, return FALSE but store in a database // this pragma id and line pair, so that the next time this routine is // called with that pair, it can return TRUE. // // Purpose: Pragmas that apply to a global scope get replicated, one per PU. // For example, suppose we have C$ UNROLL at the global scope. Then // each PU will have one of these. If we wish to warn that we are ignoring // this pragma, say, then we will print such a warning the first time we // see it, but don't want to print it subsequent times. class FF_PRAGMA_WARNING_INFO { mUINT64 _entry; public: operator UINT64() {return _entry;} // so HASH_TABLE hashing works FF_PRAGMA_WARNING_INFO(INT32 line, WN_PRAGMA_ID pragma) : _entry((UINT64(line) << 32) | UINT64(pragma&0xFFFFFFFF)) {} INT32 Line() const {return _entry >> 32;} }; typedef HASH_TABLE<FF_PRAGMA_WARNING_INFO,BOOL> FF_PRAGMA_WARNING_TABLE; BOOL FF_Pragma_Seen_Before(WN* wn) { INT32 line = WN_Get_Linenum(wn); if (line == 0) return FALSE; static FF_PRAGMA_WARNING_TABLE* FF_Pragma_Warning_Table = NULL; WN_PRAGMA_ID pragma = (WN_PRAGMA_ID)WN_pragma(wn); FF_PRAGMA_WARNING_INFO info(line, pragma); if (FF_Pragma_Warning_Table == NULL) FF_Pragma_Warning_Table = CXX_NEW(FF_PRAGMA_WARNING_TABLE(71, Malloc_Mem_Pool), Malloc_Mem_Pool); if (FF_Pragma_Warning_Table->Find(info)) return TRUE; FF_Pragma_Warning_Table->Enter(info,1); return FALSE; } //----------------------------------------------------------------------- // NAME: Pragma_Set_No_Interchange // FUNCTION: Set 'Cannot_Interchange' on all DO LOOPs in the tree rooted // at 'wn_ref'. //----------------------------------------------------------------------- static void Pragma_Set_No_Interchange(WN* wn_ref) { if (WN_opcode(wn_ref) == OPC_DO_LOOP) { DO_LOOP_INFO* dli = Get_Do_Loop_Info(wn_ref); dli->Cannot_Interchange = TRUE; if (dli->Is_Inner) return; } if (WN_opcode(wn_ref) == OPC_BLOCK) { for (WN* wn = WN_first(wn_ref); wn != NULL; wn = WN_next(wn)) Pragma_Set_No_Interchange(wn); } else { for (INT i = 0; i < WN_kid_count(wn_ref); i++) Pragma_Set_No_Interchange(WN_kid(wn_ref, i)); } } // Scan statements before 'wn' to see if a pragma with 'pragma_id' exists static BOOL Find_Preceeding_Pragma(WN* wn, WN_PRAGMA_ID pragma_id) { WN* prev_pragma=WN_prev(wn); while (prev_pragma && (WN_opcode(prev_pragma)==OPC_PRAGMA || WN_opcode(prev_pragma)==OPC_XPRAGMA)) { if (WN_pragma(prev_pragma)==pragma_id) return TRUE; prev_pragma=WN_prev(prev_pragma); } return FALSE; } static WN* Find_Loop_N_Inside(INT n, WN* wn) { INT count=1; LWN_ITER* itr = LWN_WALK_SCFIter(wn); for ( ; itr; itr = LWN_WALK_SCFNext(itr)) { WN* w = itr->wn; if (WN_opcode(w) == OPC_DO_LOOP && count++ == n) { LWN_WALK_Abort(itr); return w; } } return NULL; } static void LWN_Process_FF_Pragmas_Walk_r(WN* wn) { static BOOL ignoring_interchange = FALSE; static BOOL ignoring_blockable = FALSE; OPCODE opc=WN_opcode(wn); if (opc == OPC_DO_LOOP) { ignoring_interchange = FALSE; ignoring_blockable = FALSE; } if (opc==OPC_PRAGMA || opc==OPC_XPRAGMA) { BOOL remove = FALSE; WN_PRAGMA_ID pragma_id=(WN_PRAGMA_ID)WN_pragma(wn); INT64 pragma_value=WN_const_val(wn); INT32 prag_arg1=WN_pragma_arg1(wn); INT32 prag_arg2=WN_pragma_arg2(wn); DO_LOOP_INFO* dli; DO_LOOP_INFO* dli1; WN* next_non_prag_stid = WN_next(wn); while (next_non_prag_stid) { OPCODE op = WN_opcode(next_non_prag_stid); if (op != OPC_PRAGMA && op != OPC_XPRAGMA && OPCODE_operator(op) != OPR_STID) break; next_non_prag_stid = WN_next(next_non_prag_stid); } switch (pragma_id) { case WN_PRAGMA_INLINE_BODY_START: case WN_PRAGMA_INLINE_BODY_END: remove = TRUE; break; // code for interchange and blocking almost the same: combine them case WN_PRAGMA_BLOCKABLE: case WN_PRAGMA_INTERCHANGE: remove = TRUE; if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } { BOOL ipragma = pragma_id == WN_PRAGMA_INTERCHANGE; if ((!ignoring_interchange && ipragma) || (!ignoring_blockable && !ipragma)) { INT interchange_vector[LNO_MAX_DO_LOOP_DEPTH]; INT count = 0; BOOL error = FALSE; if (ipragma) ignoring_interchange = TRUE; else ignoring_blockable = TRUE; for (INT i = 0; i < LNO_MAX_DO_LOOP_DEPTH; i++) interchange_vector[i] = -1; WN* p = 0; for (p = wn; WN_opcode(p) == OPC_PRAGMA || WN_opcode(p) == OPC_XPRAGMA; p = WN_next(p)) { WN_PRAGMA_ID pragma_id = (WN_PRAGMA_ID)WN_pragma(p); if ((ipragma && (pragma_id == WN_PRAGMA_INTERCHANGE)) || (!ipragma && (pragma_id == WN_PRAGMA_BLOCKABLE))) { WN* sdo = Find_Loop_N_Inside(WN_pragma_arg1(p), next_non_prag_stid); if (sdo) { INT sdo_no = Do_Depth(sdo) - Do_Depth(next_non_prag_stid); interchange_vector[count++] = sdo_no; } else { ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(p), WN_pragmas[pragma_id].name,"loop must follow"); error = TRUE; break; } } } if (error == FALSE) { if (!Is_Permutation_Vector(interchange_vector, count)) { ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(p), WN_pragmas[pragma_id].name, "incomplete index specification"); } else { dli = Get_Do_Loop_Info(next_non_prag_stid); if (ipragma) { dli->Permutation_Spec_Count = count; dli->Permutation_Spec_Array= CXX_NEW_ARRAY(INT, count, dli->Pool()); for (INT i = 0; i < count; i++) dli->Permutation_Spec_Array[i] = interchange_vector[i]; } else dli->Blockable_Specification = count; } } } } break; case WN_PRAGMA_NO_INTERCHANGE: remove = TRUE; if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } Pragma_Set_No_Interchange(next_non_prag_stid); break; case WN_PRAGMA_BLOCKING_SIZE: remove = TRUE; if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } dli=Get_Do_Loop_Info(next_non_prag_stid); if (prag_arg1 >= -1) dli->Required_Blocksize[0] = prag_arg1; else if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_Int, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, prag_arg1); if (prag_arg1 >= -1) dli->Required_Blocksize[1] = prag_arg2; else if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_Int, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, prag_arg2); break; case WN_PRAGMA_NO_BLOCKING: remove = TRUE; if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } dli=Get_Do_Loop_Info(next_non_prag_stid); dli->Cannot_Block = TRUE; break; case WN_PRAGMA_UNROLL: remove = TRUE; if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } if (prag_arg1 > 0) Get_Do_Loop_Info(next_non_prag_stid)->Required_Unroll = prag_arg1; else if (prag_arg1 == 0) ; // no warning. the meaning is to use the default unrolling else if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_Int, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, prag_arg1); break; case WN_PRAGMA_AGGRESSIVE_INNER_LOOP_FISSION: if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } remove = TRUE; dli=Get_Do_Loop_Info(next_non_prag_stid); dli->Aggressive_Inner_Fission=TRUE; break; case WN_PRAGMA_FISSION: /* fission the surrounding l loops here */ { INT level=prag_arg1; // TODO: may need to be changed remove = TRUE; if (Good_Do_Depth(wn)+1 < level) { ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "does not have enough enclosing loops"); break; } WN* parent_loop=Enclosing_Do_Loop(wn); // see if FISISONABLE pragma exists which eliminates the // legality test BOOL fissionable= Find_Preceeding_Pragma(next_non_prag_stid,WN_PRAGMA_FISSIONABLE); FISSION_FUSION_STATUS fission_status=Failed; if (fissionable) { // no fission legality check is needed MEM_POOL_Push(&FF_PRAGMA_default_pool); DYN_ARRAY<FF_STMT_LIST> loops(&FF_PRAGMA_default_pool); loops.Newidx(); loops.Newidx(); // create two stmt lists loops[0].Clear(); loops[1].Clear(); // the first list consists of stmts up to the current pragma WN* stmt=WN_first(WN_do_body(parent_loop)); while (stmt!=wn) { loops[0].Append(stmt,&FF_PRAGMA_default_pool); stmt=WN_next(stmt); } loops[0].Append(wn,&FF_PRAGMA_default_pool); // the second list consists of stmts after the current pragma stmt=WN_next(wn); while (stmt) { loops[1].Append(stmt,&FF_PRAGMA_default_pool); stmt=WN_next(stmt); } // separate the loop and update the dependences info Separate_And_Update(parent_loop, loops, level); fission_status=Succeeded; MEM_POOL_Pop(&FF_PRAGMA_default_pool); } else if (WN_prev(wn)!=NULL) { // fission legality check is needed fission_status=Fission(parent_loop, WN_prev(wn), level); } dli=Get_Do_Loop_Info(parent_loop); dli->No_Fusion=TRUE; // do not fuse these two fissioned loops if (fission_status==Succeeded) { dli1=Get_Do_Loop_Info(WN_next(parent_loop)); dli1->No_Fusion=TRUE; } } break; case WN_PRAGMA_FISSIONABLE: /* fission the surrounding l loops here */ remove = TRUE; break; case WN_PRAGMA_FUSE: /* fuse the next n loops for l levels */ { remove = TRUE; UINT number_of_loops=prag_arg1; // TODO: may have to be changed UINT number_of_levels=prag_arg2; // see if FUSEABLE pragma exists which implies that no legality // check is needed BOOL fuseable= Find_Preceeding_Pragma(next_non_prag_stid,WN_PRAGMA_FUSEABLE); WN* first_loop=next_non_prag_stid; if (number_of_levels==0) { INT max_level=LNO_MAX_DO_LOOP_DEPTH; WN* loop=first_loop; for (INT i=0; i<number_of_loops; i++) { #ifdef KEY if (!loop) break; #endif if (WN_opcode(loop)!=OPC_DO_LOOP) { max_level=0; break; } INT level=1; WN* inner_loop=loop; while (inner_loop=Get_Only_Loop_Inside(inner_loop,FALSE)) level++; if (level<max_level) max_level=level; loop=WN_next(loop); } number_of_levels=max_level; } // the strategy is to look at one level at a time // we fuse all 'n' loops at the same level before we dive into // nest to fuse 'n' inner loops for (INT j=0; j<number_of_levels; j++) { BOOL failed=FALSE; FmtAssert(WN_opcode(first_loop)==OPC_DO_LOOP, ("FUSION pragma has to be followed by loops with sufficient nesting")); WN* next_first_loop=Get_Only_Loop_Inside(first_loop,FALSE); WN* block=LWN_Get_Parent(first_loop); WN* stmt=WN_next(first_loop); for (INT i=1; i<number_of_loops; i++) { do { if (stmt && (WN_opcode(stmt)==OPC_PRAGMA || WN_opcode(stmt)==OPC_XPRAGMA)) { // move pragmas in between loops to before the first loop LWN_Extract_From_Block(wn, block); LWN_Insert_Block_Before(wn, block, first_loop); } else break; stmt=WN_next(stmt); } while (1); WN* next_stmt=WN_next(stmt); // remembers next stmt FmtAssert(WN_opcode(stmt)==OPC_DO_LOOP, ("Not enough loops following a FUSION pragma")); FISSION_FUSION_STATUS status; if (failed) { // if fusion had failed before reaching this loop, do nothing } if (fuseable) { // if FUSEABLE pragma is set then all we check is if the // bounds and steps match dli=Get_Do_Loop_Info(first_loop); dli1=Get_Do_Loop_Info(stmt); FmtAssert(!dli->LB->Too_Messy, ("FUSIONABLE pragma requires lower bounds to be simple")); FmtAssert(!dli->UB->Too_Messy, ("FUSIONABLE pragma requires upper bounds to be simple")); FmtAssert(dli->LB==dli1->LB, ("FUSIONABLE pragma requires lower bounds to be the same")); FmtAssert(dli->UB==dli1->UB, ("FUSIONABLE pragma requires upper bounds to be the same")); FmtAssert(dli->Step==dli1->Step, ("FUSIONABLE pragma requires steps to be the same")); // ask fusion routine to fuse two loops with no peeling // and no alignment, therefore no prolog and epilog UINT64 prolog=0; UINT64 epilog=0; WN* epilog_loop=NULL; mINT32 offset[1]; offset[0]=0; status=Fuse(first_loop, stmt, 1, 0, TRUE, &prolog, &epilog, &epilog_loop, offset); if (status!=Succeeded && status!=Succeeded_and_Inner_Loop_Removed) failed=TRUE; } else { status=Fuse(first_loop, stmt, 1, LNO_Fusion_Peeling_Limit, TRUE); if (status!=Succeeded && status!=Succeeded_and_Inner_Loop_Removed) failed=TRUE; } stmt=next_stmt; } //if (failed) //break; //else { // successfully fused 'n' loops at this level // mark the fused loop un-fissionable ((DO_LOOP_INFO*)Get_Do_Loop_Info(first_loop))->No_Fission=TRUE; first_loop=next_first_loop; //} } } break; case WN_PRAGMA_FUSEABLE: /* fuse the next n loops for l levels */ remove = TRUE; break; case WN_PRAGMA_NO_FISSION: /* do not fission the next n loops */ remove = TRUE; if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } dli=Get_Do_Loop_Info(next_non_prag_stid); dli->No_Fission=TRUE; break; case WN_PRAGMA_NO_FUSION: /* do not fuse the next n loops */ remove = TRUE; if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } dli=Get_Do_Loop_Info(next_non_prag_stid); dli->No_Fusion=TRUE; break; case WN_PRAGMA_NEXT_SCALAR: remove = TRUE; if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } dli = Get_Do_Loop_Info(next_non_prag_stid); dli->Pragma_Cannot_Concurrentize = TRUE; break; case WN_PRAGMA_KAP_ASSERT_DO: if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } if (WN_pragma_arg1(wn) == ASSERT_DO_CONCURRENT) { remove = TRUE; dli = Get_Do_Loop_Info(next_non_prag_stid); dli->Pragma_Prefer_Concurrentize = TRUE; } else if (WN_pragma_arg1(wn) == ASSERT_DO_SERIAL) { remove = TRUE; dli = Get_Do_Loop_Info(next_non_prag_stid); dli->Pragma_Cannot_Concurrentize = TRUE; } break; case WN_PRAGMA_KAP_ASSERT_DOPREFER: if (next_non_prag_stid == NULL || WN_opcode(next_non_prag_stid) != OPC_DO_LOOP) { if (!FF_Pragma_Seen_Before(wn)) ErrMsgSrcpos(EC_LNO_Bad_Pragma_String, WN_Get_Linenum(wn), WN_pragmas[pragma_id].name, "not followed by a loop, ignored"); break; } if (WN_pragma_arg1(wn) == ASSERT_DO_CONCURRENT) { remove = TRUE; dli = Get_Do_Loop_Info(next_non_prag_stid); dli->Pragma_Prefer_Concurrentize = TRUE; } else if (WN_pragma_arg1(wn) == ASSERT_DO_SERIAL) { remove = TRUE; dli = Get_Do_Loop_Info(next_non_prag_stid); dli->Pragma_Cannot_Concurrentize = TRUE; } break; } if (remove) { LWN_Delete_From_Block(LWN_Get_Parent(wn), wn); } return; } WN* kid; WN* nkid = NULL; if (opc==OPC_BLOCK) { for (kid=WN_first(wn); kid; ) { WN* this_kid = kid; kid = WN_next(kid); // so that the walk routine can remove it LWN_Process_FF_Pragmas_Walk_r(this_kid); } return; } for (UINT kidno=0; kidno<WN_kid_count(wn); kidno++) { kid=WN_kid(wn,kidno); if (!OPCODE_is_expression(WN_opcode(kid))) LWN_Process_FF_Pragmas_Walk_r(kid); } } extern void LWN_Process_FF_Pragmas(WN* func_nd) { MEM_POOL_Initialize(&FF_PRAGMA_default_pool,"FF_PRAGMA_default_pool",FALSE); LWN_Process_FF_Pragmas_Walk_r(func_nd); MEM_POOL_Delete(&FF_PRAGMA_default_pool); } extern void LNO_Insert_Pragmas(WN* wn) { OPCODE opc = WN_opcode(wn); if (opc == OPC_DO_LOOP) { DO_LOOP_INFO* dli = Get_Do_Loop_Info(wn); if (dli->Is_Inner) { if (dli->Required_Unroll > 0) { WN* pragma = WN_CreatePragma(WN_PRAGMA_UNROLL, (ST_IDX) NULL, dli->Required_Unroll, 0); WN_set_pragma_compiler_generated(pragma); LWN_Insert_Block_Before(LWN_Get_Parent(wn), wn, pragma); } return; // no need to go inside } } if (opc==OPC_BLOCK) { for (WN* kid = WN_first(wn); kid; kid = WN_next(kid)) { LNO_Insert_Pragmas(kid); } return; } for (UINT kidno = 0; kidno < WN_kid_count(wn); kidno++) { WN* kid=WN_kid(wn,kidno); if (!OPCODE_is_expression(WN_opcode(kid))) LNO_Insert_Pragmas(kid); } }
32.304843
79
0.621263
sharugupta
2faef50ed5b847ae7cf39e086f546acfa8aee177
1,042
cc
C++
qtclient/valuespresenter.cc
chrisandreae/keyboard-firmware
91e71bf6e46b9d0ef4880c023afcd32131c49ff4
[ "Ruby" ]
111
2015-01-06T21:14:49.000Z
2022-02-06T14:29:27.000Z
qtclient/valuespresenter.cc
chrisandreae/keyboard-firmware
91e71bf6e46b9d0ef4880c023afcd32131c49ff4
[ "Ruby" ]
18
2015-01-31T15:16:54.000Z
2022-02-26T10:18:39.000Z
qtclient/valuespresenter.cc
chrisandreae/keyboard-firmware
91e71bf6e46b9d0ef4880c023afcd32131c49ff4
[ "Ruby" ]
22
2015-05-13T00:29:46.000Z
2019-03-09T10:07:38.000Z
#include <QDebug> #include "valuespresenter.h" #include "device.h" #include "keyboardvalues.h" #include "keyboardmodel.h" ValuesPresenter::ValuesPresenter() { mView = new KeyboardValues(this); } ValuesPresenter::~ValuesPresenter() { if (!mView->parent()) { delete mView; } } void ValuesPresenter::setModel(QSharedPointer<KeyboardModel> model) { mModel = model; mView->showValues(mModel->getLayoutID(), mModel->getMappingSize(), mModel->getNumPrograms(), mModel->getProgramSpaceRaw(), mModel->getProgramSpace(), mModel->getMacroIndexSize(), mModel->getMacroStorageSize()); } void ValuesPresenter::setDevice(QSharedPointer<Device> device) { mDevice = device; } void ValuesPresenter::resetFully() { if (!mDevice) return; try { QSharedPointer<DeviceSession> session = mDevice->newSession(); session->resetFully(); } catch (DeviceError& e) { qDebug() << "DeviceError resetting: " << e.what(); } }
21.708333
69
0.641075
chrisandreae
2fb0bc54dacf0e815b8e1bef99c3d1eab1c32c36
2,061
cc
C++
buffer/buffered_reader.cc
eaugeas/crossroads
9dc1ea074a9bf59e4b6aa61ce75f93ee953ee05d
[ "MIT" ]
null
null
null
buffer/buffered_reader.cc
eaugeas/crossroads
9dc1ea074a9bf59e4b6aa61ce75f93ee953ee05d
[ "MIT" ]
null
null
null
buffer/buffered_reader.cc
eaugeas/crossroads
9dc1ea074a9bf59e4b6aa61ce75f93ee953ee05d
[ "MIT" ]
null
null
null
// Copyright (c) 2019, tlblanc <tlblanc1490 at gmail dot com> #include "buffered_reader.hpp" #include "io/copy.hpp" static inline Status load_buffer(Source *source, Buffer *buffer) { size_t cpbytes; return copy(source, buffer, &cpbytes); } static inline Status _read( Buffer *buffer, Source *source, uint8_t *dst, const size_t len, size_t *rbytes) { if (buffer->readable() < len) { auto status = load_buffer(source, buffer); if (status->error()) { return status; } } return buffer->read(dst, len, rbytes); } static inline Status _peek( Buffer *buffer, Source *source, const uint8_t **dst, const size_t intent, size_t *pbytes) { if (buffer->readable() == 0 || buffer->readable() < intent || intent == 0) { auto status = load_buffer(source, buffer); if (status->error()) { return status; } } return buffer->peek(dst, intent, pbytes); } Status BufferedReader::read( uint8_t *dst, const size_t len, size_t *rbytes) noexcept { return _read(m_buffer.get(), m_source.get(), dst, len, rbytes); } Status BufferedReader::peek( const uint8_t **dst, const size_t intent, size_t *pbytes) noexcept { return _peek(m_buffer.get(), m_source.get(), dst, intent, pbytes); } size_t BufferedReader::consume(const size_t len) noexcept { return m_buffer->consume(len); } Status RecovererBufferedReader::read( uint8_t *dst, const size_t len, size_t *rbytes) noexcept { return _read(m_buffer.get(), m_source.get(), dst, len, rbytes); } Status RecovererBufferedReader::peek( const uint8_t **dst, const size_t intent, size_t *pbytes) noexcept { return _peek(m_buffer.get(), m_source.get(), dst, intent, pbytes); } size_t RecovererBufferedReader::recover(size_t len) noexcept { return m_buffer->recover(len); }; size_t RecovererBufferedReader::recoverable() const noexcept { return m_buffer->recoverable(); }; size_t RecovererBufferedReader::consume(size_t len) noexcept { return m_buffer->consume(len); }
23.157303
68
0.67443
eaugeas
2fb3c1238b73311b6f1a708103c325f7c7e7929e
787
cpp
C++
SFMLWindow/SFMLWindow/main.cpp
coltonhurst/learning-sfml
7c358d9542728847bed9066eb92c686093a5c1f4
[ "MIT" ]
null
null
null
SFMLWindow/SFMLWindow/main.cpp
coltonhurst/learning-sfml
7c358d9542728847bed9066eb92c686093a5c1f4
[ "MIT" ]
null
null
null
SFMLWindow/SFMLWindow/main.cpp
coltonhurst/learning-sfml
7c358d9542728847bed9066eb92c686093a5c1f4
[ "MIT" ]
null
null
null
/* SFML Window Example Based on: https://www.sfml-dev.org/tutorials/2.5/window-window.php */ #include <SFML/Window.hpp> int main(int, char const**) { // Create the window sf::Window window; window.create(sf::VideoMode(800, 600), "My window"); // Prevents tearing window.setVerticalSyncEnabled(true); // Run the program as long as the window is open while (window.isOpen()) { // check all the window's events that were triggered since the last iteration of the loop sf::Event event; while (window.pollEvent(event)) { // "close requested" event: we close the window if (event.type == sf::Event::Closed) window.close(); } } return 0; }
23.848485
97
0.581957
coltonhurst
2fb4278919d22d8a45b32b9ea3606b29b0825286
1,782
hpp
C++
Sokoban/src/Engine/Scene/Scene_Templates.hpp
Elysia-ff/Sokoban_Win
3899c2d20c65959152669b52ba215777977c08e1
[ "MIT" ]
null
null
null
Sokoban/src/Engine/Scene/Scene_Templates.hpp
Elysia-ff/Sokoban_Win
3899c2d20c65959152669b52ba215777977c08e1
[ "MIT" ]
null
null
null
Sokoban/src/Engine/Scene/Scene_Templates.hpp
Elysia-ff/Sokoban_Win
3899c2d20c65959152669b52ba215777977c08e1
[ "MIT" ]
null
null
null
#pragma once #include "Scene.h" #include <cassert> #include <type_traits> template <typename T> T& Elysia::Engine::Scene::AddGameObject(const tstring& objectName) { static_assert(std::is_base_of_v<GameObject, T>, "Type T must be inherited from GameObject"); assert(components.find(newInstanceID) == components.end()); components.insert({ newInstanceID, std::vector<Component*>() }); T* newObject = new T(objectName, newInstanceID, *this); gameObjects.push_back(static_cast<GameObject*>(newObject)); newInstanceID++; return *newObject; } template <typename T> T& Elysia::Engine::Scene::FindGameObject(const tstring& objectName) const { static_assert(std::is_base_of_v<GameObject, T>, "Type T must be inherited from GameObject"); for (GameObject* g : gameObjects) { if (g->GetName() == objectName) { return *dynamic_cast<T*>(g); } } assert(false); // unreachable std::terminate(); } template <typename T> T& Elysia::Engine::Scene::AddComponent(unsigned int instanceID, const tstring& componentName) { static_assert(std::is_base_of_v<Component, T>, "Type T must be inherited from Component"); assert(components.find(instanceID) != components.end()); assert(findComponent(instanceID, componentName) == nullptr); std::vector<Component*>& list = components[instanceID]; T* newComponent = new T(componentName); list.push_back(static_cast<Component*>(newComponent)); return *newComponent; } template <typename T> T* Elysia::Engine::Scene::GetComponent(unsigned int instanceID, const tstring& componentName) const { static_assert(std::is_base_of_v<Component, T>, "Type T must be inherited from Component"); Component* component = findComponent(instanceID, componentName); return component != nullptr ? dynamic_cast<T*>(component) : nullptr; }
28.285714
99
0.742424
Elysia-ff
2fb7494bd1755775e8665020b86abac262fe6796
20,606
cpp
C++
src/OctTree.cpp
aslatas/render
79b239e8d9f92309d643049fab44216eb4f24449
[ "MIT" ]
null
null
null
src/OctTree.cpp
aslatas/render
79b239e8d9f92309d643049fab44216eb4f24449
[ "MIT" ]
9
2019-05-09T02:26:55.000Z
2019-05-10T15:26:39.000Z
src/OctTree.cpp
aslatas/render
79b239e8d9f92309d643049fab44216eb4f24449
[ "MIT" ]
null
null
null
#include "OctTree.h" /* TODOs for the QuadTree -> Free your memory!!! -> Play with Bin growth heuristic -> Convert the Bin contents to a void* so the tree can be used for other objects -> Memory Allocator for OctTree Essentailly the total size of the array containing the octtree is limited by the depth of the tree. This is due to the array representation of the tree, which can cause an integer overflow should the array become too large. To solve this problem, a memory allocator can be used. Allocate a portion of memory that gets filled up as the tree expands. Now there is a potential problem where bins are freed, creating internal fragmentation. It is like this block of memory will have to occasionally grow, so during this expansion implement a hueristic that tightens the memory gaps produced from freeing Bins. This solves the integer overflow at index, I now longer index into the tree based on an int, but rather a pointer. Still maintain as much cache coherence as an array based list with less internal fragmentation. */ #define TREE_CHILDREN 8 #define INITIAL_BIN_SIZE 10 #define BIN_DEPTH(x) ((x) * 1.4) //-------------------------------------------------------------------// // Helper Functions //-------------------------------------------------------------------// Node* OctTree::create_node(AABB_3D* aabb, Node *parent) { Node *n = (Node *)malloc(sizeof(Node)); n->bounding_box = aabb; n->parent = parent; // Not quite a double, but a slow growth based on depth n->bin_size = (parent == nullptr) ? INITIAL_BIN_SIZE : ((u32)(BIN_DEPTH(parent->bin_size))); n->isLeaf = true; n->isVisible = true; n->bin = (Bin *)malloc(sizeof(Bin)); n->bin->count = 0; n->bin->model = nullptr; return n; } bool OctTree::helper_add(int position, SpatialModel *model) { Node *node = tree[position]; if (!node->isLeaf) // this node has children, need to go further down the tree { bool at_least_one_node_intersection_found = false; for (int i = 0; i < TREE_CHILDREN; ++i) { assert((position * TREE_CHILDREN) + (i + 1) < arrlen(tree)); // the child node should be within bounds of the tree if (CheckBoundingBoxCollision3D(model->aabb, *tree[(position * TREE_CHILDREN) + (i + 1)]->bounding_box)) { at_least_one_node_intersection_found = true; helper_add((position * TREE_CHILDREN) + (i + 1), model); } } return at_least_one_node_intersection_found; } else // we are at a leaf { assert(node->bin); // the bin should be allocated if ((u32)node->bin->count + 1 > node->bin_size) { // split and then re-add to this node, which is not a leaf split(position); helper_add(position, model); } else { arrput(node->bin->model, model); ++node->bin->count; } return true; } } void OctTree::split(int position) { printf("SPLITTT\n"); Node *node = tree[position]; AABB_3D *aabb = node->bounding_box; glm::vec3 min = aabb->min; glm::vec3 max = aabb->max; glm::vec3 center = aabb->center; // half the distance between min and max // float ext[3] = {(max[0] - min[0]) / 2, (max[1] - min[1]) / 2, (max[2] - min[2]) / 2}; // Create the AABBs of the children of this node // front top left float ftl_min[3] = {min[0], center[1], center[2]}; float ftl_max[3] = {center[0], max[1], max[2]}; AABB_3D *ftl = Create3DAxisAlignedBoundingBox(ftl_min, ftl_max); // front bottom left float fbl_min[3] = {min[0], min[1], center[2]}; float fbl_max[3] = {center[0], center[1], max[2]}; AABB_3D *fbl = Create3DAxisAlignedBoundingBox(fbl_min, fbl_max); // front top right float ftr_min[3] = {center[0], center[1], center[2]}; float ftr_max[3] = {max[0], max[1], max[2]}; AABB_3D *ftr = Create3DAxisAlignedBoundingBox(ftr_min, ftr_max); // front bottom right float fbr_min[3] = {center[0], min[0], center[2]}; float fbr_max[3] = {max[0], center[1], max[2]}; AABB_3D *fbr = Create3DAxisAlignedBoundingBox(fbr_min, fbr_max); // back top left float btl_min[3] = {min[0], center[1], min[2]}; float btl_max[3] = {center[0], max[1], center[2]}; AABB_3D *btl = Create3DAxisAlignedBoundingBox(btl_min, btl_max); // back bottom left float bbl_min[3] = {min[0], min[1], min[2]}; float bbl_max[3] = {center[0], center[1], center[2]}; AABB_3D *bbl = Create3DAxisAlignedBoundingBox(bbl_min, bbl_max); // back top right float btr_min[3] = {center[0], center[1], min[2]}; float btr_max[3] = {max[0], max[1], center[2]}; AABB_3D *btr = Create3DAxisAlignedBoundingBox(btr_min, btr_max); // back bottom right float bbr_min[3] = {center[0], min[1], min[2]}; float bbr_max[3] = {max[0], center[1], center[2]}; AABB_3D *bbr = Create3DAxisAlignedBoundingBox(bbr_min, bbr_max); // grow if necessary if ((position * TREE_CHILDREN) + TREE_CHILDREN >= arrlen(tree)) { arrsetlen(tree, ((u32)arrlen(tree) + 1) * TREE_CHILDREN); } // Create nodes for childre tree[(position * TREE_CHILDREN) + 1] = create_node(ftl, node); tree[(position * TREE_CHILDREN) + 2] = create_node(fbl, node); tree[(position * TREE_CHILDREN) + 3] = create_node(ftr, node); tree[(position * TREE_CHILDREN) + 4] = create_node(fbr, node); tree[(position * TREE_CHILDREN) + 5] = create_node(btl, node); tree[(position * TREE_CHILDREN) + 6] = create_node(bbl, node); tree[(position * TREE_CHILDREN) + 7] = create_node(btr, node); tree[(position * TREE_CHILDREN) + 8] = create_node(bbr, node); // Now an internal node node->isLeaf = false; // Re-add the contents of this Bin to the node so they are added to the approppriate child for (int i = 0; i < node->bin->count; ++i) { SpatialModel *model = node->bin->model[i]; helper_add(position, model); } // No longer should have a bin attached to the node arrfree(node->bin->model); free(node->bin); node->bin = nullptr; } void OctTree::helper_print_quad_tree(int position) { Node *node = tree[position]; printf("Node %d at level %d.\n", position, position / 4); printf("This node has this bounding box.\n"); printf(" Bounding Box:\n Minimum: (%f, %f, %f)\n Maximum: (%f, %f, %f)\n Center: (%f, %f, %f)\n Extent: (%f, %f, %f)\n", node->bounding_box->min[0], node->bounding_box->min[1], node->bounding_box->min[2], node->bounding_box->max[0], node->bounding_box->max[1], node->bounding_box->max[2], node->bounding_box->center[0], node->bounding_box->center[1], node->bounding_box->center[2], node->bounding_box->ext[0], node->bounding_box->ext[1], node->bounding_box->ext[2]); if (!node->parent) { printf(" This node is the root.\n"); } if (!node->isLeaf) { printf(" This node has the following children at the indices:\n"); for (int i = 1; i <= TREE_CHILDREN; ++i) { helper_print_quad_tree((position * TREE_CHILDREN) + i); } } else { printf(" This node has no children.\n"); } if (!node->bin) { printf(" This node does not have a bin.\n"); } else { if (node->bin->count == 0) { printf(" This node has a bin, but contains no models.\n"); } else { printf(" Bin Size: %d\n", node->bin_size); printf(" This node's bin contains %d models:\n", node->bin->count); for (int j = 0; j < node->bin->count; ++j) { SpatialModel *m = node->bin->model[j]; printf(" Bounding Box:\n Minimum: (%f, %f, %f)\n Maximum: (%f, %f, %f)\n Center: (%f, %f, %f)\n Extent: (%f, %f, %f)\n", m->aabb.min[0], m->aabb.min[1], m->aabb.min[2], m->aabb.max[0], m->aabb.max[1], m->aabb.max[2], m->aabb.center[0], m->aabb.center[1], m->aabb.center[2], m->aabb.ext[0], m->aabb.ext[1], m->aabb.ext[2]); // printf(" Data: %d\n", m->val); } //printf(" "); } } printf("\n"); } void OctTree::helper_frustum_visibility(int position, Camera::Frustum *frustum) { Node *node = tree[position]; node->isVisible = AABBFrustumIntersection(frustum, node->bounding_box); if (node->isVisible) { if (!node->isLeaf) { // recursively search for a leaf for (int i = 1; i <= TREE_CHILDREN; ++i) { OctTree::helper_frustum_visibility((position * TREE_CHILDREN) + i, frustum); } } else { for (int j = 0; j < node->bin->count; ++j) { node->bin->model[j]->isVisible = AABBFrustumIntersection(frustum, &node->bin->model[j]->aabb); } } } } void OctTree::helper_lazy_occlusion_culling(int position, OcclusionList *list, Camera::Camera *camera, glm::vec3 *occluder_size) { Node *node = tree[position]; // don't evaluate a branch that is not visible if (!node->isVisible) return; // don't care about non-branches if (!node->isLeaf) { // recursively search for a leaf for (int i = 1; i <= TREE_CHILDREN; ++i) { OctTree::helper_lazy_occlusion_culling((position * TREE_CHILDREN) + i, list, camera, occluder_size); } } else { for (int j = 0; j < node->bin->count; ++j) { SpatialModel sm = *node->bin->model[j]; if (!sm.isVisible) continue; // determine screen size glm::mat4 cam = GetViewTransform(camera); glm::mat4 proj = GetProjectionTransform(camera); glm::vec4 min_screen = cam * glm::vec4(sm.aabb.min, 1.0f); glm::vec4 max_screen = cam * glm::vec4(sm.aabb.max, 1.0f); min_screen /= min_screen.w; max_screen /= max_screen.w; min_screen = proj * min_screen; max_screen = proj * max_screen; min_screen /= min_screen.w; max_screen /= max_screen.w; min_screen[0] = (fmin(fmax(-1.0f, min_screen[0]), 1.0f)); min_screen[1] = (fmin(fmax(-1.0f, min_screen[1]), 1.0f)); min_screen[2] = (fmin(fmax(-1.0f, min_screen[2]), 1.0f)); max_screen[0] = (fmin(fmax(-1.0f, max_screen[0]), 1.0f)); max_screen[1] = (fmin(fmax(-1.0f, max_screen[1]), 1.0f)); max_screen[2] = (fmin(fmax(-1.0f, max_screen[2]), 1.0f)); float distx = abs(max_screen[0] - min_screen[0]); float disty = abs(max_screen[1] - min_screen[1]); float distz = abs(max_screen[2] - min_screen[2]); float ext = distx * disty; if (ext >= -0.00001 && ext <= 0.00001) continue; glm::vec3 loc = camera->location; float dist = distance(loc, sm.aabb.max); dist = fmin(dist, distance(loc, sm.aabb.max)); if (ext > 1.0f) { arrput(list->occludee, sm); } else { arrput(list->occluder, sm); } } } } SpatialModel* OctTree::helper_get_all_visible_data(SpatialModel* list, int position) { Node *node = tree[position]; if (!node->isVisible) { return list; } else if (!node->isLeaf) { // recursively search for a leaf for (int i = 1; i <= TREE_CHILDREN; ++i) { list = helper_get_all_visible_data(list, (position * TREE_CHILDREN) + i); } return list; } else { // put each SpatialModel from the Bin into the list for (int j = 0; j < node->bin->count; ++j) { if (node->bin->model[j]->isVisible) { arrput(list, *node->bin->model[j]); } } return list; } } //-------------------------------------------------------------------// // Main Functions //-------------------------------------------------------------------// OctTree::OctTree(float* min, float* max) { // First set defaults // size_element_per_bin = 0; // keep? Helps to determine the required space for a bin element // current_max_depth = 0; // depth of the tree, default is 0 // bin_size = INITIAL_BIN_SIZE; // array representation of the tree. Must be set to null to the stb library tree = nullptr; arrsetlen(tree, 1); tree[0] = create_node(Create3DAxisAlignedBoundingBox(min, max), nullptr); } OctTree::~OctTree() { } void OctTree::Shutdown() { } void OctTree::Print() { helper_print_quad_tree(0); } bool OctTree::Add(SpatialModel* model) { if (tree == nullptr) { printf("Attempted to add, but tree was null!\n"); printf(" Bounding Box:\n Minimum: (%f, %f, %f)\n Maximum: (%f, %f, %f)\n Center: (%f, %f, %f)\n Extent: (%f, %f, %f)\n", model->aabb.min[0], model->aabb.min[1], model->aabb.min[2], model->aabb.max[0], model->aabb.max[1], model->aabb.max[2], model->aabb.center[0], model->aabb.center[1], model->aabb.center[2], model->aabb.ext[0], model->aabb.ext[1], model->aabb.ext[2]); return false; } else if (!CheckBoundingBoxCollision3D(*tree[0]->bounding_box, model->aabb)) { printf("Attempted to add, but model was out of bounds!\n"); return false; } else { bool ret = helper_add(0, model); if (!ret) { printf("failed to add model!\n"); } return ret; } } void OctTree::UpdateFrustumVisibility(Camera::Frustum *frustum) { if (arrlen(tree) < 0) return; OctTree::helper_frustum_visibility(0, frustum); } SpatialModel* OctTree::UpdateOcclusionVisibility( glm::vec3 *camera_position, Camera::Camera *camera, glm::vec3 *occluder_size, ECullingSettings type) { if (arrlen(tree) < 0) return nullptr; OcclusionList *ol = (OcclusionList*)malloc(sizeof(OcclusionList)); ol->occluder = nullptr; ol->occludee = nullptr; OctTree::helper_lazy_occlusion_culling(0, ol, camera, occluder_size); // Check for occlusion SpatialModel *visible_models = nullptr; printf("There are %td occluders\n", arrlen(ol->occluder)); printf("There are %td occludees\n", arrlen(ol->occludee)); for (int i = 0; i < arrlen(ol->occludee); ++i) { SpatialModel occludee = ol->occludee[i]; glm::vec3 min = occludee.aabb.min; glm::vec3 max = occludee.aabb.max; glm::vec3 loc = camera->location; glm::vec3 ftl = glm::vec3(occludee.aabb.center.x - occludee.aabb.ext.x, occludee.aabb.center.y + occludee.aabb.ext.y, occludee.aabb.center.z + occludee.aabb.ext.z); glm::vec3 ftr = glm::vec3(occludee.aabb.center.x + occludee.aabb.ext.x, occludee.aabb.center.y + occludee.aabb.ext.y, occludee.aabb.center.z + occludee.aabb.ext.z); glm::vec3 fbl = glm::vec3(occludee.aabb.center.x - occludee.aabb.ext.x, occludee.aabb.center.y + occludee.aabb.ext.y, occludee.aabb.center.z - occludee.aabb.ext.z); glm::vec3 fbr = glm::vec3(occludee.aabb.center.x + occludee.aabb.ext.x, occludee.aabb.center.y + occludee.aabb.ext.y, occludee.aabb.center.z - occludee.aabb.ext.z); glm::vec3 btl = glm::vec3(occludee.aabb.center.x - occludee.aabb.ext.x, occludee.aabb.center.y - occludee.aabb.ext.y, occludee.aabb.center.z + occludee.aabb.ext.z); glm::vec3 btr = glm::vec3(occludee.aabb.center.x + occludee.aabb.ext.x, occludee.aabb.center.y - occludee.aabb.ext.y, occludee.aabb.center.z + occludee.aabb.ext.z); glm::vec3 bbl = glm::vec3(occludee.aabb.center.x - occludee.aabb.ext.x, occludee.aabb.center.y - occludee.aabb.ext.y, occludee.aabb.center.z - occludee.aabb.ext.z); glm::vec3 bbr = glm::vec3(occludee.aabb.center.x + occludee.aabb.ext.x, occludee.aabb.center.y - occludee.aabb.ext.y, occludee.aabb.center.z - occludee.aabb.ext.z); Ray rftl = CreateRay(loc, ftl - loc, 1000.0f); Ray rftr = CreateRay(loc, ftr - loc, 1000.0f); Ray rfbl = CreateRay(loc, fbl - loc, 1000.0f); Ray rfbr = CreateRay(loc, fbr - loc, 1000.0f); Ray rbtl = CreateRay(loc, btl - loc, 1000.0f); Ray rbtr = CreateRay(loc, btr - loc, 1000.0f); Ray rbbl = CreateRay(loc, bbl - loc, 1000.0f); Ray rbbr = CreateRay(loc, bbr - loc, 1000.0f); Ray rcenter = CreateRay(loc, occludee.aabb.center - loc, 1000.0f); bool is_occ[9] = { false }; int count = 0; bool isOccluded = false; for (int j = 0; j < arrlen(ol->occluder); ++j) { SpatialModel occluder = ol->occluder[j]; // used for the other two types of occlusion: mild and aggressive only check if there // is a full overlap between AABBs. bool isFullOverlap = false; // if (type == OCCLUSION_LAZY) // { // glm::vec3 i; // bool ret = false; // if (!is_occ[0]) is_occ[0] = RayIntersectAxisAlignedBox(rftl, occluder.aabb, &i); if (is_occ[0]) ++count; // if (!is_occ[1]) is_occ[1] = RayIntersectAxisAlignedBox(rftr, occluder.aabb, &i); if (is_occ[1]) ++count; // if (!is_occ[2]) is_occ[2] = RayIntersectAxisAlignedBox(rfbl, occluder.aabb, &i); if (is_occ[2]) ++count; // if (!is_occ[3]) is_occ[3] = RayIntersectAxisAlignedBox(rfbr, occluder.aabb, &i); if (is_occ[3]) ++count; // if (!is_occ[4]) is_occ[4] = RayIntersectAxisAlignedBox(rbtl, occluder.aabb, &i); if (is_occ[4]) ++count; // if (!is_occ[5]) is_occ[5] = RayIntersectAxisAlignedBox(rbtr, occluder.aabb, &i); if (is_occ[5]) ++count; // if (!is_occ[6]) is_occ[6] = RayIntersectAxisAlignedBox(rbbl, occluder.aabb, &i); if (is_occ[6]) ++count; // if (!is_occ[7]) is_occ[7] = RayIntersectAxisAlignedBox(rbbr, occluder.aabb, &i); if (is_occ[7]) ++count; // if (!is_occ[8]) is_occ[8] = RayIntersectAxisAlignedBox(rcenter, occluder.aabb, &i); if (is_occ[8]) ++count; // if (count == 9) // { // occludee.aabb.min[0], occludee.aabb.min[1], occludee.aabb.min[2], // occludee.aabb.max[0], occludee.aabb.max[1], occludee.aabb.max[2], // occludee.aabb.center[0], occludee.aabb.center[1], occludee.aabb.center[2], // occludee.aabb.ext[0], occludee.aabb.ext[1], occludee.aabb.ext[2]); // occluder.aabb.min[0], occluder.aabb.min[1], occluder.aabb.min[2], // occluder.aabb.max[0], occluder.aabb.max[1], occluder.aabb.max[2], // occluder.aabb.center[0], occluder.aabb.center[1], occluder.aabb.center[2], // occluder.aabb.ext[0], occluder.aabb.ext[1], occluder.aabb.ext[2]); // isOccluded = true; // break; // } // } // it is the responsibility of these two functions to change isOccluded // back to false if (type == OCCLUSION_MILD && isFullOverlap) { } if (type == OCCLUSION_AGGRESSIVE && isFullOverlap) { } if (isOccluded) break; } if (!isOccluded) { arrput(visible_models, occludee); } } for (int i = 0; i < arrlen(ol->occluder); ++i) { arrput(visible_models, ol->occluder[i]); } return visible_models; } SpatialModel* OctTree::GetAllVisibleData() { SpatialModel* list = nullptr; if (arrlen(tree) > 0) { return helper_get_all_visible_data(list, 0); } return list; }
38.230056
180
0.557605
aslatas
2fb9fa8a500a98d7dc62ab1abfb740a51de99e1d
1,758
hpp
C++
src/include/Backbone/State.hpp
grigorievich/Viy
c78cfb55e548ce40b9fe3756e4ce2a923b84a552
[ "Apache-2.0" ]
14
2017-09-08T09:20:37.000Z
2020-09-20T10:56:22.000Z
src/include/Backbone/State.hpp
grigorievich/Viy
c78cfb55e548ce40b9fe3756e4ce2a923b84a552
[ "Apache-2.0" ]
null
null
null
src/include/Backbone/State.hpp
grigorievich/Viy
c78cfb55e548ce40b9fe3756e4ce2a923b84a552
[ "Apache-2.0" ]
2
2018-02-14T16:52:33.000Z
2018-06-20T22:16:02.000Z
#ifndef STATE_HPP #define STATE_HPP #include <StateIdentifiers.hpp> #include <ResourceIdentifiers.hpp> #include <SFML/System/Time.hpp> #include <SFML/Window/Event.hpp> #include <SFML/Graphics/RenderTarget.hpp> #include <memory> namespace sf { class RenderWindow; } class StateStack; class Player; class State { public: typedef std::unique_ptr<State> Ptr; struct Signals { struct { bool status = false; } enterFullscreen; struct { bool status = false; } restoreScreenState; //that is previous screen state struct { bool status = false; } switchToSnapper; struct { bool status = false; } switchWindowType; }; struct Context { Context(sf::RenderWindow& window, TextureHolder& textures, FontHolder& fonts, Signals &signals); sf::RenderWindow *window; TextureHolder *textures; FontHolder *fonts; Signals *signals; }; public: State(StateStack& stack, Context context); virtual ~State(); virtual void draw(sf::RenderTarget &target, const sf::RenderStates &states) = 0; virtual bool update(sf::Time dt) = 0; virtual bool handleEvent(const sf::Event& event) = 0; protected: void requestStackPush(States::ID stateID); void requestStackPop(); void requestStateClear(); Context getContext() const; private: StateStack* mStack; Context mContext; }; #endif // STATE_HPP
19.533333
83
0.547213
grigorievich
2fbc09d57afec89af71c2eb59c22063c6d469704
2,716
hpp
C++
apps/test_suite/apps/Core/CoreTest.hpp
Koncord/YAPE
9def79c493bc50b41a371c6e80174d47f795b8f1
[ "Apache-2.0" ]
3
2015-10-29T16:11:49.000Z
2021-08-28T08:53:09.000Z
apps/test_suite/apps/Core/CoreTest.hpp
Koncord/YAPE
9def79c493bc50b41a371c6e80174d47f795b8f1
[ "Apache-2.0" ]
13
2015-10-29T05:39:16.000Z
2017-06-11T19:10:07.000Z
apps/test_suite/apps/Core/CoreTest.hpp
Koncord/YAPE
9def79c493bc50b41a371c6e80174d47f795b8f1
[ "Apache-2.0" ]
1
2022-03-01T18:47:58.000Z
2022-03-01T18:47:58.000Z
/* * * Copyright (c) 2015-2017 Stanislav Zhukov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef YAPE_CORETEST_HPP #define YAPE_CORETEST_HPP #include <gtest/gtest.h> #include "opcodes.hpp" #include <components/Memory/Memory.hpp> #include <apps/Core/RegisterController.hpp> #include <apps/Core/ControlUnit.hpp> #include <apps/Core/Environment.hpp> #include <apps/Core/BaseInstructions.hpp> class CoreTest : public ::testing::Test { protected: CoreTest() { InstructionSet_base(); } ~CoreTest() { ControlUnit::FreeOps(); } virtual void SetUp() { Environment::get().SetMemory(new Memory); Environment::get().SetReg(new RegisterController); Environment::get().SetCU(new ControlUnit); machine = Environment::get().GetCU(); reg = Environment::get().GetReg(); mem = Environment::get().GetMemory(); // default segment initialize reg->Set(Register::SS, 0); reg->Set(Register::ES, 0); reg->Set(Register::CS, 0); reg->Set(Register::DS, 0); reg->Set(Register::IP, 0); // instruction pointer reg->Set(Register::BP, 0); // base pointer reg->Set(Register::SP, 0xFFFE); // stack pointer pos = machine->GetNextInstructionAddr(); } virtual void TearDown() { delete environment; environment = 0; machine = 0; reg = 0; mem = 0; } void DoProgram() { while (!DoStep()) { // empty while } } bool DoStep() { if(machine->isHalted()) return true; const uint32_t cur_pos = machine->GetNextInstructionAddr(); const uint16_t cmd_len = LexicalInterpreter::length(mem->GetByte(cur_pos)); if(reg->Get(Register::IP) + cmd_len >= mem->GetSize()) throw; std::vector<uint8_t> cmd(cmd_len); mem->GetPart(cur_pos, &cmd[0], cur_pos + cmd_len); machine->Step(cmd); return false; } Environment *environment; ControlUnit *machine; RegisterController *reg; Memory *mem; uint16_t pos; }; #endif // YAPE_CORETEST_HPP
25.148148
83
0.616348
Koncord
2fc4d6bf0c10f0fee3cce4d7120ba59296d5fefd
5,022
cpp
C++
src/miner.cpp
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
src/miner.cpp
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
src/miner.cpp
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
#include "miner.hpp" #include "generator.hpp" #include "interpreter.hpp" #include "mutator.hpp" #include "oeis_manager.hpp" #include "optimizer.hpp" #include "parser.hpp" #include "program_util.hpp" #include <chrono> #include <fstream> #include <random> #include <sstream> #include <unordered_set> #define METRIC_PUBLISH_INTERVAL 120 Miner::Miner( const Settings &settings ) : settings( settings ), oeis( settings ), interpreter( settings ) { } bool Miner::updateSpecialSequences( const Program &p, const Sequence &seq ) const { std::string kind; if ( isCollatzValuation( seq ) ) { kind = "collatz"; } if ( isPrimeSequence( seq ) ) { kind = "primes"; } if ( !kind.empty() ) { Log::get().alert( "Found possible " + kind + " sequence: " + seq.to_string() ); std::string file_name = "programs/special/" + kind + "_" + std::to_string( ProgramUtil::hash( p ) % 1000000 ) + ".asm"; ensureDir( file_name ); std::ofstream out( file_name ); out << "; " << seq << std::endl; out << std::endl; ProgramUtil::print( p, out ); out.close(); return true; } return false; } bool Miner::isCollatzValuation( const Sequence &seq ) { if ( seq.size() < 10 ) { return false; } for ( size_t i = 1; i < seq.size() - 1; i++ ) { int n = i + 1; if ( n % 2 == 0 ) // even { size_t j = (n / 2) - 1; if ( seq[j] >= seq[i] ) { return false; } } else // odd { size_t j = (((3 * n) + 1) / 2) - 1; if ( j < seq.size() && seq[j] >= seq[i] ) { return false; } } } return true; } bool Miner::isPrimeSequence( const Sequence &seq ) const { if ( seq.size() < 10 ) { return false; } if ( primes_cache.empty() ) { Log::get().debug( "Loading prime numbers" ); auto &primes = oeis.getSequences().at( 40 ); if ( primes.getFull().at( 10 ) != 31 ) { Log::get().error( "Expected 10th value of primes (A000040) to be 31, but found " + std::to_string( primes.getFull().at( 10 ) ), false ); } primes_cache.insert( primes.norm.begin(), primes.norm.end() ); } std::unordered_set<number_t> found; for ( auto n : seq ) { if ( primes_cache.count( n ) == 0 ) { return false; } if ( found.count( n ) > 0 ) { return false; } found.insert( n ); } return true; } void Miner::mine( volatile sig_atomic_t &exit_flag ) { oeis.load( exit_flag ); Log::get().info( "Mining programs for OEIS sequences" ); auto &finder = oeis.getFinder(); std::random_device rand; MultiGenerator multi_generator( settings, rand() ); Mutator mutator( rand() ); std::stack<Program> progs; Sequence norm_seq; auto time = std::chrono::steady_clock::now(); Generator *generator = multi_generator.getGenerator(); while ( !exit_flag ) { if ( progs.empty() ) { multi_generator.next(); // need to call "next" *before* generating the problems generator = multi_generator.getGenerator(); progs.push( generator->generateProgram() ); } Program program = progs.top(); progs.pop(); auto seq_programs = finder.findSequence( program, norm_seq, oeis.getSequences() ); for ( auto s : seq_programs ) { auto r = oeis.updateProgram( s.first, s.second ); if ( r.first ) { // update stats and increase priority of successful generator if ( r.second ) { generator->stats.fresh++; } else { generator->stats.updated++; } auto replicas = multi_generator.configs[multi_generator.generator_index].replicas; replicas = replicas + 20; // magic number multi_generator.configs[multi_generator.generator_index].replicas = replicas; // mutate successful program if ( progs.size() < 1000 || settings.hasMemory() ) { mutator.mutateConstants( s.second, 100, progs ); } } } if ( updateSpecialSequences( program, norm_seq ) ) { generator->stats.fresh++; } generator->stats.generated++; auto time2 = std::chrono::steady_clock::now(); auto duration = std::chrono::duration_cast<std::chrono::seconds>( time2 - time ); if ( duration.count() >= METRIC_PUBLISH_INTERVAL ) { time = time2; int64_t total_generated = 0; for ( size_t i = 0; i < multi_generator.generators.size(); i++ ) { auto gen = multi_generator.generators[i].get(); Metrics::get().write( "generated", gen->metric_labels, gen->stats.generated ); Metrics::get().write( "fresh", gen->metric_labels, gen->stats.fresh ); Metrics::get().write( "updated", gen->metric_labels, gen->stats.updated ); total_generated += gen->stats.generated; gen->stats = Generator::GStats(); } Log::get().info( "Generated " + std::to_string( total_generated ) + " programs" ); finder.publishMetrics(); } } }
26.15625
119
0.585225
karttu
2fc7d32b9516b6506d0f5c81e694d03d1f72d988
1,508
cpp
C++
source/Ch11/drill/drill_11.cpp
mategordos/UDProg-Introduction
7d522141f3c4b84ee2d19335fef7db9af9ad74bf
[ "CC0-1.0" ]
null
null
null
source/Ch11/drill/drill_11.cpp
mategordos/UDProg-Introduction
7d522141f3c4b84ee2d19335fef7db9af9ad74bf
[ "CC0-1.0" ]
null
null
null
source/Ch11/drill/drill_11.cpp
mategordos/UDProg-Introduction
7d522141f3c4b84ee2d19335fef7db9af9ad74bf
[ "CC0-1.0" ]
null
null
null
#include "../../std_lib_facilities.h" int main() { int birth_year = 2001; int a, b, c, d = 0; cout << birth_year << "\t(Decimal)\n" << hex << birth_year << "\t(Hexadecimal)\n" << oct << birth_year << "\t(Octal)\n" << dec << endl; cout << showbase << endl; cout << birth_year << "\t(Decimal)\n" << hex << birth_year << "\t(Hexadecimal)\n" // 0x base << oct << birth_year << "\t(Octal)\n"; // 0 base cout << noshowbase << dec; /* cout << "Enter 1234 4 times!" cin >> a >> oct >> b >> hex >> c >> d; cout << a << '\t' << b << '\t' << c << '\t' << d << '\n'; */ cout << defaultfloat << 1234567.89 << "\t(Defaultfloat)\n" << fixed << 1234567.89 << "\t(Fixed)\n" << scientific << 1234567.89 << "\t(Scientific)\n"; //table cout << "\n\nTáblázat: \n\n"; cout << setw(6) << "Gordos" << setw(14) << "Máté" << setw(15) << "4343432" << setw(25) << "mate@email.hu" << endl; cout << setw(6) << "Pál" << setw(14) << "Iván" << setw(15) << "4544432" << setw(25) << "ivanka@email.hu" << endl; cout << setw(6) << "József" << setw(14) << "Máté" << setw(15) << "4424032" << setw(25) << "belaww@email.hu" << endl; cout << setw(6) << "János" << setw(14) << "Balázs" << setw(15) << "4111432" << setw(25) << "balazska@email.hu" << endl; cout << setw(6) << "Jeremi" << setw(14) << "Máté" << setw(15) << "4343432" << setw(25) << "mate@email.hu" << endl; cout << setw(6) << "János" << setw(14) << "Tyler1" << setw(15) << "4544432" << setw(25) << "lolt1@email.hu" << endl; return 0; }
30.16
120
0.511936
mategordos
2fd003ef65b1ebdb50b35021b08dd928b4a92d0b
1,606
hh
C++
fields/address.hh
45G/libsocks6msg
73b778bfe8efb2c311520617debdfbadf10b6d88
[ "MIT" ]
2
2020-08-18T11:20:21.000Z
2022-03-08T23:49:02.000Z
fields/address.hh
45G/libsocks6msg
73b778bfe8efb2c311520617debdfbadf10b6d88
[ "MIT" ]
null
null
null
fields/address.hh
45G/libsocks6msg
73b778bfe8efb2c311520617debdfbadf10b6d88
[ "MIT" ]
null
null
null
#ifndef SOCKS6MSG_ADDRESS_HH #define SOCKS6MSG_ADDRESS_HH #include <assert.h> #include <netinet/ip.h> #include <netinet/ip6.h> #include <vector> #include <optional> #include <variant> #include "socks6.h" #include "bytebuffer.hh" #include "string.hh" #include "padded.hh" #include "exceptions.hh" namespace S6M { class Address { SOCKS6AddressType type = SOCKS6_ADDR_IPV4; std::variant<in_addr, in6_addr, Padded<String>> u = in_addr({ 0 }); public: size_t packedSize() const { switch (type) { case SOCKS6_ADDR_IPV4: return sizeof(in_addr); case SOCKS6_ADDR_IPV6: return sizeof(in6_addr); case SOCKS6_ADDR_DOMAIN: return std::get<Padded<String>>(u).packedSize(); } /* never happens */ assert(false); return 0; } void pack(ByteBuffer *bb) const; Address() = default; Address(in_addr ipv4) : type(SOCKS6_ADDR_IPV4), u(ipv4) {} Address(in6_addr ipv6) : type(SOCKS6_ADDR_IPV6), u(ipv6) {} Address(const std::string_view &domain) : type(SOCKS6_ADDR_DOMAIN), u(domain) {} Address(SOCKS6AddressType type, ByteBuffer *bb); SOCKS6AddressType getType() const { return type; } in_addr getIPv4() const { return std::get<in_addr>(u); } in6_addr getIPv6() const { return std::get<in6_addr>(u); } std::string_view getDomain() const { return std::get<Padded<String>>(u).getStr(); } bool isZero() const { return ( type == SOCKS6_ADDR_IPV4 && std::get<in_addr>(u).s_addr == INADDR_ANY) || (type == SOCKS6_ADDR_IPV6 && std::get<in6_addr>(u).s6_addr == in6addr_any.s6_addr); } }; } #endif // SOCKS6MSG_ADDRESS_HH
17.844444
86
0.682441
45G
2fd42d25dacb80ea5165c716c94b719bb35c05fc
228,802
cpp
C++
HCTC-PARS-FINAL/360 Panorama PARS FINAL/Temp/StagingArea/Data/il2cppOutput/Il2CppCompilerCalculateTypeValues_6Table.cpp
Eiris/HCTC-PARS-FINAL
d90e11d4bb09a9ab6ab94e1808e6607847cd5150
[ "MIT" ]
null
null
null
HCTC-PARS-FINAL/360 Panorama PARS FINAL/Temp/StagingArea/Data/il2cppOutput/Il2CppCompilerCalculateTypeValues_6Table.cpp
Eiris/HCTC-PARS-FINAL
d90e11d4bb09a9ab6ab94e1808e6607847cd5150
[ "MIT" ]
null
null
null
HCTC-PARS-FINAL/360 Panorama PARS FINAL/Temp/StagingArea/Data/il2cppOutput/Il2CppCompilerCalculateTypeValues_6Table.cpp
Eiris/HCTC-PARS-FINAL
d90e11d4bb09a9ab6ab94e1808e6607847cd5150
[ "MIT" ]
null
null
null
#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 "il2cpp-class-internals.h" #include "codegen/il2cpp-codegen.h" #include "il2cpp-object-internals.h" // System.String struct String_t; // System.Collections.ArrayList struct ArrayList_t2718874744; // System.Collections.Hashtable struct Hashtable_t1853889766; // System.Runtime.Remoting.Contexts.CrossContextChannel struct CrossContextChannel_t4063984580; // System.Collections.IList struct IList_t2094931216; // System.Object[] struct ObjectU5BU5D_t2843939325; // System.Runtime.Remoting.Messaging.MethodDictionary struct MethodDictionary_t207894204; // System.Collections.IDictionaryEnumerator struct IDictionaryEnumerator_t1693217257; // System.Runtime.Remoting.Activation.IActivator struct IActivator_t485815189; // System.Collections.IDictionary struct IDictionary_t1363984059; // System.Runtime.Remoting.Messaging.IMethodMessage struct IMethodMessage_t3120117683; // System.String[] struct StringU5BU5D_t1281789340; // System.Collections.Generic.Dictionary`2<System.String,System.Int32> struct Dictionary_2_t2736202052; // System.Int32[] struct Int32U5BU5D_t385246372; // System.Reflection.MethodBase struct MethodBase_t; // System.Runtime.Remoting.Messaging.IMessageSink struct IMessageSink_t2514424906; // System.Runtime.Remoting.Contexts.SynchronizationAttribute struct SynchronizationAttribute_t3946661254; // System.Threading.Timer struct Timer_t716671026; // System.Runtime.Remoting.Contexts.IDynamicProperty struct IDynamicProperty_t3462122824; // System.Runtime.Remoting.Contexts.IDynamicMessageSink struct IDynamicMessageSink_t625731443; // System.Runtime.Remoting.ServerIdentity struct ServerIdentity_t2342208608; // System.Reflection.MethodInfo struct MethodInfo_t; // System.Type[] struct TypeU5BU5D_t3940880105; // System.Runtime.Remoting.Messaging.LogicalCallContext struct LogicalCallContext_t3342013719; // System.Runtime.Remoting.ChannelData struct ChannelData_t3353629972; // System.Collections.Stack struct Stack_t2329662280; // System.Runtime.Remoting.IChannelInfo struct IChannelInfo_t3866172133; // System.Runtime.Remoting.IRemotingTypeInfo struct IRemotingTypeInfo_t2222593263; // System.Runtime.Remoting.IEnvoyInfo struct IEnvoyInfo_t2180778907; // System.Type struct Type_t; // System.Runtime.Remoting.Contexts.DynamicPropertyCollection struct DynamicPropertyCollection_t652373272; // System.Runtime.Remoting.ObjRef struct ObjRef_t2141158884; // System.Runtime.Remoting.Messaging.CallContextRemotingData struct CallContextRemotingData_t2260963392; // System.Runtime.Remoting.Contexts.Context struct Context_t3285446944; // System.IntPtr[] struct IntPtrU5BU5D_t4013366056; // System.Char[] struct CharU5BU5D_t3528271667; // System.Void struct Void_t1185182177; // System.MarshalByRefObject struct MarshalByRefObject_t2760389100; // System.Runtime.Remoting.Lifetime.Lease struct Lease_t4051722892; // System.WeakReference struct WeakReference_t1334886716; // System.Runtime.Remoting.Contexts.ContextCallbackObject struct ContextCallbackObject_t2292721408; // System.Threading.WaitHandle struct WaitHandle_t1743403487; // System.Threading.ExecutionContext struct ExecutionContext_t1748372627; // System.Runtime.Remoting.Messaging.MonoMethodMessage struct MonoMethodMessage_t2807636944; // System.Runtime.Remoting.Messaging.IMessageCtrl struct IMessageCtrl_t317049502; // System.Runtime.Remoting.Messaging.IMessage struct IMessage_t3593512748; // System.Runtime.Remoting.Lifetime.LeaseManager struct LeaseManager_t3648745595; // System.DelegateData struct DelegateData_t1677132599; // System.Threading.Mutex struct Mutex_t3066672582; // System.Threading.Thread struct Thread_t2300836069; // System.Runtime.Serialization.Formatters.Binary.BinaryFormatter struct BinaryFormatter_t3197753202; // System.Collections.Queue struct Queue_t3637523393; // System.Runtime.Remoting.Lifetime.Lease/RenewalDelegate struct RenewalDelegate_t3744801856; // System.Runtime.Remoting.Lifetime.ILease struct ILease_t2998816618; // System.IAsyncResult struct IAsyncResult_t767004451; // System.AsyncCallback struct AsyncCallback_t3962456242; #ifndef RUNTIMEOBJECT_H #define RUNTIMEOBJECT_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Object #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RUNTIMEOBJECT_H #ifndef SINKPROVIDERDATA_T4151372974_H #define SINKPROVIDERDATA_T4151372974_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Channels.SinkProviderData struct SinkProviderData_t4151372974 : public RuntimeObject { public: // System.String System.Runtime.Remoting.Channels.SinkProviderData::sinkName String_t* ___sinkName_0; // System.Collections.ArrayList System.Runtime.Remoting.Channels.SinkProviderData::children ArrayList_t2718874744 * ___children_1; // System.Collections.Hashtable System.Runtime.Remoting.Channels.SinkProviderData::properties Hashtable_t1853889766 * ___properties_2; public: inline static int32_t get_offset_of_sinkName_0() { return static_cast<int32_t>(offsetof(SinkProviderData_t4151372974, ___sinkName_0)); } inline String_t* get_sinkName_0() const { return ___sinkName_0; } inline String_t** get_address_of_sinkName_0() { return &___sinkName_0; } inline void set_sinkName_0(String_t* value) { ___sinkName_0 = value; Il2CppCodeGenWriteBarrier((&___sinkName_0), value); } inline static int32_t get_offset_of_children_1() { return static_cast<int32_t>(offsetof(SinkProviderData_t4151372974, ___children_1)); } inline ArrayList_t2718874744 * get_children_1() const { return ___children_1; } inline ArrayList_t2718874744 ** get_address_of_children_1() { return &___children_1; } inline void set_children_1(ArrayList_t2718874744 * value) { ___children_1 = value; Il2CppCodeGenWriteBarrier((&___children_1), value); } inline static int32_t get_offset_of_properties_2() { return static_cast<int32_t>(offsetof(SinkProviderData_t4151372974, ___properties_2)); } inline Hashtable_t1853889766 * get_properties_2() const { return ___properties_2; } inline Hashtable_t1853889766 ** get_address_of_properties_2() { return &___properties_2; } inline void set_properties_2(Hashtable_t1853889766 * value) { ___properties_2 = value; Il2CppCodeGenWriteBarrier((&___properties_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SINKPROVIDERDATA_T4151372974_H #ifndef CHANNELSERVICES_T3942013484_H #define CHANNELSERVICES_T3942013484_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Channels.ChannelServices struct ChannelServices_t3942013484 : public RuntimeObject { public: public: }; struct ChannelServices_t3942013484_StaticFields { public: // System.Collections.ArrayList System.Runtime.Remoting.Channels.ChannelServices::registeredChannels ArrayList_t2718874744 * ___registeredChannels_0; // System.Collections.ArrayList System.Runtime.Remoting.Channels.ChannelServices::delayedClientChannels ArrayList_t2718874744 * ___delayedClientChannels_1; // System.Runtime.Remoting.Contexts.CrossContextChannel System.Runtime.Remoting.Channels.ChannelServices::_crossContextSink CrossContextChannel_t4063984580 * ____crossContextSink_2; // System.String System.Runtime.Remoting.Channels.ChannelServices::CrossContextUrl String_t* ___CrossContextUrl_3; // System.Collections.IList System.Runtime.Remoting.Channels.ChannelServices::oldStartModeTypes RuntimeObject* ___oldStartModeTypes_4; public: inline static int32_t get_offset_of_registeredChannels_0() { return static_cast<int32_t>(offsetof(ChannelServices_t3942013484_StaticFields, ___registeredChannels_0)); } inline ArrayList_t2718874744 * get_registeredChannels_0() const { return ___registeredChannels_0; } inline ArrayList_t2718874744 ** get_address_of_registeredChannels_0() { return &___registeredChannels_0; } inline void set_registeredChannels_0(ArrayList_t2718874744 * value) { ___registeredChannels_0 = value; Il2CppCodeGenWriteBarrier((&___registeredChannels_0), value); } inline static int32_t get_offset_of_delayedClientChannels_1() { return static_cast<int32_t>(offsetof(ChannelServices_t3942013484_StaticFields, ___delayedClientChannels_1)); } inline ArrayList_t2718874744 * get_delayedClientChannels_1() const { return ___delayedClientChannels_1; } inline ArrayList_t2718874744 ** get_address_of_delayedClientChannels_1() { return &___delayedClientChannels_1; } inline void set_delayedClientChannels_1(ArrayList_t2718874744 * value) { ___delayedClientChannels_1 = value; Il2CppCodeGenWriteBarrier((&___delayedClientChannels_1), value); } inline static int32_t get_offset_of__crossContextSink_2() { return static_cast<int32_t>(offsetof(ChannelServices_t3942013484_StaticFields, ____crossContextSink_2)); } inline CrossContextChannel_t4063984580 * get__crossContextSink_2() const { return ____crossContextSink_2; } inline CrossContextChannel_t4063984580 ** get_address_of__crossContextSink_2() { return &____crossContextSink_2; } inline void set__crossContextSink_2(CrossContextChannel_t4063984580 * value) { ____crossContextSink_2 = value; Il2CppCodeGenWriteBarrier((&____crossContextSink_2), value); } inline static int32_t get_offset_of_CrossContextUrl_3() { return static_cast<int32_t>(offsetof(ChannelServices_t3942013484_StaticFields, ___CrossContextUrl_3)); } inline String_t* get_CrossContextUrl_3() const { return ___CrossContextUrl_3; } inline String_t** get_address_of_CrossContextUrl_3() { return &___CrossContextUrl_3; } inline void set_CrossContextUrl_3(String_t* value) { ___CrossContextUrl_3 = value; Il2CppCodeGenWriteBarrier((&___CrossContextUrl_3), value); } inline static int32_t get_offset_of_oldStartModeTypes_4() { return static_cast<int32_t>(offsetof(ChannelServices_t3942013484_StaticFields, ___oldStartModeTypes_4)); } inline RuntimeObject* get_oldStartModeTypes_4() const { return ___oldStartModeTypes_4; } inline RuntimeObject** get_address_of_oldStartModeTypes_4() { return &___oldStartModeTypes_4; } inline void set_oldStartModeTypes_4(RuntimeObject* value) { ___oldStartModeTypes_4 = value; Il2CppCodeGenWriteBarrier((&___oldStartModeTypes_4), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CHANNELSERVICES_T3942013484_H #ifndef CHANNELINFO_T2064577689_H #define CHANNELINFO_T2064577689_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.ChannelInfo struct ChannelInfo_t2064577689 : public RuntimeObject { public: // System.Object[] System.Runtime.Remoting.ChannelInfo::channelData ObjectU5BU5D_t2843939325* ___channelData_0; public: inline static int32_t get_offset_of_channelData_0() { return static_cast<int32_t>(offsetof(ChannelInfo_t2064577689, ___channelData_0)); } inline ObjectU5BU5D_t2843939325* get_channelData_0() const { return ___channelData_0; } inline ObjectU5BU5D_t2843939325** get_address_of_channelData_0() { return &___channelData_0; } inline void set_channelData_0(ObjectU5BU5D_t2843939325* value) { ___channelData_0 = value; Il2CppCodeGenWriteBarrier((&___channelData_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CHANNELINFO_T2064577689_H #ifndef DICTIONARYENUMERATOR_T2516729552_H #define DICTIONARYENUMERATOR_T2516729552_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.MethodDictionary/DictionaryEnumerator struct DictionaryEnumerator_t2516729552 : public RuntimeObject { public: // System.Runtime.Remoting.Messaging.MethodDictionary System.Runtime.Remoting.Messaging.MethodDictionary/DictionaryEnumerator::_methodDictionary MethodDictionary_t207894204 * ____methodDictionary_0; // System.Collections.IDictionaryEnumerator System.Runtime.Remoting.Messaging.MethodDictionary/DictionaryEnumerator::_hashtableEnum RuntimeObject* ____hashtableEnum_1; // System.Int32 System.Runtime.Remoting.Messaging.MethodDictionary/DictionaryEnumerator::_posMethod int32_t ____posMethod_2; public: inline static int32_t get_offset_of__methodDictionary_0() { return static_cast<int32_t>(offsetof(DictionaryEnumerator_t2516729552, ____methodDictionary_0)); } inline MethodDictionary_t207894204 * get__methodDictionary_0() const { return ____methodDictionary_0; } inline MethodDictionary_t207894204 ** get_address_of__methodDictionary_0() { return &____methodDictionary_0; } inline void set__methodDictionary_0(MethodDictionary_t207894204 * value) { ____methodDictionary_0 = value; Il2CppCodeGenWriteBarrier((&____methodDictionary_0), value); } inline static int32_t get_offset_of__hashtableEnum_1() { return static_cast<int32_t>(offsetof(DictionaryEnumerator_t2516729552, ____hashtableEnum_1)); } inline RuntimeObject* get__hashtableEnum_1() const { return ____hashtableEnum_1; } inline RuntimeObject** get_address_of__hashtableEnum_1() { return &____hashtableEnum_1; } inline void set__hashtableEnum_1(RuntimeObject* value) { ____hashtableEnum_1 = value; Il2CppCodeGenWriteBarrier((&____hashtableEnum_1), value); } inline static int32_t get_offset_of__posMethod_2() { return static_cast<int32_t>(offsetof(DictionaryEnumerator_t2516729552, ____posMethod_2)); } inline int32_t get__posMethod_2() const { return ____posMethod_2; } inline int32_t* get_address_of__posMethod_2() { return &____posMethod_2; } inline void set__posMethod_2(int32_t value) { ____posMethod_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DICTIONARYENUMERATOR_T2516729552_H #ifndef CONTEXTLEVELACTIVATOR_T975223365_H #define CONTEXTLEVELACTIVATOR_T975223365_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Activation.ContextLevelActivator struct ContextLevelActivator_t975223365 : public RuntimeObject { public: // System.Runtime.Remoting.Activation.IActivator System.Runtime.Remoting.Activation.ContextLevelActivator::m_NextActivator RuntimeObject* ___m_NextActivator_0; public: inline static int32_t get_offset_of_m_NextActivator_0() { return static_cast<int32_t>(offsetof(ContextLevelActivator_t975223365, ___m_NextActivator_0)); } inline RuntimeObject* get_m_NextActivator_0() const { return ___m_NextActivator_0; } inline RuntimeObject** get_address_of_m_NextActivator_0() { return &___m_NextActivator_0; } inline void set_m_NextActivator_0(RuntimeObject* value) { ___m_NextActivator_0 = value; Il2CppCodeGenWriteBarrier((&___m_NextActivator_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONTEXTLEVELACTIVATOR_T975223365_H #ifndef CONSTRUCTIONLEVELACTIVATOR_T842337821_H #define CONSTRUCTIONLEVELACTIVATOR_T842337821_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Activation.ConstructionLevelActivator struct ConstructionLevelActivator_t842337821 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONSTRUCTIONLEVELACTIVATOR_T842337821_H #ifndef APPDOMAINLEVELACTIVATOR_T643114572_H #define APPDOMAINLEVELACTIVATOR_T643114572_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Activation.AppDomainLevelActivator struct AppDomainLevelActivator_t643114572 : public RuntimeObject { public: // System.String System.Runtime.Remoting.Activation.AppDomainLevelActivator::_activationUrl String_t* ____activationUrl_0; // System.Runtime.Remoting.Activation.IActivator System.Runtime.Remoting.Activation.AppDomainLevelActivator::_next RuntimeObject* ____next_1; public: inline static int32_t get_offset_of__activationUrl_0() { return static_cast<int32_t>(offsetof(AppDomainLevelActivator_t643114572, ____activationUrl_0)); } inline String_t* get__activationUrl_0() const { return ____activationUrl_0; } inline String_t** get_address_of__activationUrl_0() { return &____activationUrl_0; } inline void set__activationUrl_0(String_t* value) { ____activationUrl_0 = value; Il2CppCodeGenWriteBarrier((&____activationUrl_0), value); } inline static int32_t get_offset_of__next_1() { return static_cast<int32_t>(offsetof(AppDomainLevelActivator_t643114572, ____next_1)); } inline RuntimeObject* get__next_1() const { return ____next_1; } inline RuntimeObject** get_address_of__next_1() { return &____next_1; } inline void set__next_1(RuntimeObject* value) { ____next_1 = value; Il2CppCodeGenWriteBarrier((&____next_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // APPDOMAINLEVELACTIVATOR_T643114572_H #ifndef ACTIVATIONSERVICES_T4161385317_H #define ACTIVATIONSERVICES_T4161385317_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Activation.ActivationServices struct ActivationServices_t4161385317 : public RuntimeObject { public: public: }; struct ActivationServices_t4161385317_StaticFields { public: // System.Runtime.Remoting.Activation.IActivator System.Runtime.Remoting.Activation.ActivationServices::_constructionActivator RuntimeObject* ____constructionActivator_0; public: inline static int32_t get_offset_of__constructionActivator_0() { return static_cast<int32_t>(offsetof(ActivationServices_t4161385317_StaticFields, ____constructionActivator_0)); } inline RuntimeObject* get__constructionActivator_0() const { return ____constructionActivator_0; } inline RuntimeObject** get_address_of__constructionActivator_0() { return &____constructionActivator_0; } inline void set__constructionActivator_0(RuntimeObject* value) { ____constructionActivator_0 = value; Il2CppCodeGenWriteBarrier((&____constructionActivator_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ACTIVATIONSERVICES_T4161385317_H #ifndef METHODDICTIONARY_T207894204_H #define METHODDICTIONARY_T207894204_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.MethodDictionary struct MethodDictionary_t207894204 : public RuntimeObject { public: // System.Collections.IDictionary System.Runtime.Remoting.Messaging.MethodDictionary::_internalProperties RuntimeObject* ____internalProperties_0; // System.Runtime.Remoting.Messaging.IMethodMessage System.Runtime.Remoting.Messaging.MethodDictionary::_message RuntimeObject* ____message_1; // System.String[] System.Runtime.Remoting.Messaging.MethodDictionary::_methodKeys StringU5BU5D_t1281789340* ____methodKeys_2; // System.Boolean System.Runtime.Remoting.Messaging.MethodDictionary::_ownProperties bool ____ownProperties_3; public: inline static int32_t get_offset_of__internalProperties_0() { return static_cast<int32_t>(offsetof(MethodDictionary_t207894204, ____internalProperties_0)); } inline RuntimeObject* get__internalProperties_0() const { return ____internalProperties_0; } inline RuntimeObject** get_address_of__internalProperties_0() { return &____internalProperties_0; } inline void set__internalProperties_0(RuntimeObject* value) { ____internalProperties_0 = value; Il2CppCodeGenWriteBarrier((&____internalProperties_0), value); } inline static int32_t get_offset_of__message_1() { return static_cast<int32_t>(offsetof(MethodDictionary_t207894204, ____message_1)); } inline RuntimeObject* get__message_1() const { return ____message_1; } inline RuntimeObject** get_address_of__message_1() { return &____message_1; } inline void set__message_1(RuntimeObject* value) { ____message_1 = value; Il2CppCodeGenWriteBarrier((&____message_1), value); } inline static int32_t get_offset_of__methodKeys_2() { return static_cast<int32_t>(offsetof(MethodDictionary_t207894204, ____methodKeys_2)); } inline StringU5BU5D_t1281789340* get__methodKeys_2() const { return ____methodKeys_2; } inline StringU5BU5D_t1281789340** get_address_of__methodKeys_2() { return &____methodKeys_2; } inline void set__methodKeys_2(StringU5BU5D_t1281789340* value) { ____methodKeys_2 = value; Il2CppCodeGenWriteBarrier((&____methodKeys_2), value); } inline static int32_t get_offset_of__ownProperties_3() { return static_cast<int32_t>(offsetof(MethodDictionary_t207894204, ____ownProperties_3)); } inline bool get__ownProperties_3() const { return ____ownProperties_3; } inline bool* get_address_of__ownProperties_3() { return &____ownProperties_3; } inline void set__ownProperties_3(bool value) { ____ownProperties_3 = value; } }; struct MethodDictionary_t207894204_StaticFields { public: // System.Collections.Generic.Dictionary`2<System.String,System.Int32> System.Runtime.Remoting.Messaging.MethodDictionary::<>f__switch$map26 Dictionary_2_t2736202052 * ___U3CU3Ef__switchU24map26_4; // System.Collections.Generic.Dictionary`2<System.String,System.Int32> System.Runtime.Remoting.Messaging.MethodDictionary::<>f__switch$map27 Dictionary_2_t2736202052 * ___U3CU3Ef__switchU24map27_5; public: inline static int32_t get_offset_of_U3CU3Ef__switchU24map26_4() { return static_cast<int32_t>(offsetof(MethodDictionary_t207894204_StaticFields, ___U3CU3Ef__switchU24map26_4)); } inline Dictionary_2_t2736202052 * get_U3CU3Ef__switchU24map26_4() const { return ___U3CU3Ef__switchU24map26_4; } inline Dictionary_2_t2736202052 ** get_address_of_U3CU3Ef__switchU24map26_4() { return &___U3CU3Ef__switchU24map26_4; } inline void set_U3CU3Ef__switchU24map26_4(Dictionary_2_t2736202052 * value) { ___U3CU3Ef__switchU24map26_4 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__switchU24map26_4), value); } inline static int32_t get_offset_of_U3CU3Ef__switchU24map27_5() { return static_cast<int32_t>(offsetof(MethodDictionary_t207894204_StaticFields, ___U3CU3Ef__switchU24map27_5)); } inline Dictionary_2_t2736202052 * get_U3CU3Ef__switchU24map27_5() const { return ___U3CU3Ef__switchU24map27_5; } inline Dictionary_2_t2736202052 ** get_address_of_U3CU3Ef__switchU24map27_5() { return &___U3CU3Ef__switchU24map27_5; } inline void set_U3CU3Ef__switchU24map27_5(Dictionary_2_t2736202052 * value) { ___U3CU3Ef__switchU24map27_5 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__switchU24map27_5), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // METHODDICTIONARY_T207894204_H #ifndef ARGINFO_T3261134217_H #define ARGINFO_T3261134217_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.ArgInfo struct ArgInfo_t3261134217 : public RuntimeObject { public: // System.Int32[] System.Runtime.Remoting.Messaging.ArgInfo::_paramMap Int32U5BU5D_t385246372* ____paramMap_0; // System.Int32 System.Runtime.Remoting.Messaging.ArgInfo::_inoutArgCount int32_t ____inoutArgCount_1; // System.Reflection.MethodBase System.Runtime.Remoting.Messaging.ArgInfo::_method MethodBase_t * ____method_2; public: inline static int32_t get_offset_of__paramMap_0() { return static_cast<int32_t>(offsetof(ArgInfo_t3261134217, ____paramMap_0)); } inline Int32U5BU5D_t385246372* get__paramMap_0() const { return ____paramMap_0; } inline Int32U5BU5D_t385246372** get_address_of__paramMap_0() { return &____paramMap_0; } inline void set__paramMap_0(Int32U5BU5D_t385246372* value) { ____paramMap_0 = value; Il2CppCodeGenWriteBarrier((&____paramMap_0), value); } inline static int32_t get_offset_of__inoutArgCount_1() { return static_cast<int32_t>(offsetof(ArgInfo_t3261134217, ____inoutArgCount_1)); } inline int32_t get__inoutArgCount_1() const { return ____inoutArgCount_1; } inline int32_t* get_address_of__inoutArgCount_1() { return &____inoutArgCount_1; } inline void set__inoutArgCount_1(int32_t value) { ____inoutArgCount_1 = value; } inline static int32_t get_offset_of__method_2() { return static_cast<int32_t>(offsetof(ArgInfo_t3261134217, ____method_2)); } inline MethodBase_t * get__method_2() const { return ____method_2; } inline MethodBase_t ** get_address_of__method_2() { return &____method_2; } inline void set__method_2(MethodBase_t * value) { ____method_2 = value; Il2CppCodeGenWriteBarrier((&____method_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ARGINFO_T3261134217_H #ifndef CROSSAPPDOMAINDATA_T2130208023_H #define CROSSAPPDOMAINDATA_T2130208023_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Channels.CrossAppDomainData struct CrossAppDomainData_t2130208023 : public RuntimeObject { public: // System.Object System.Runtime.Remoting.Channels.CrossAppDomainData::_ContextID RuntimeObject * ____ContextID_0; // System.Int32 System.Runtime.Remoting.Channels.CrossAppDomainData::_DomainID int32_t ____DomainID_1; // System.String System.Runtime.Remoting.Channels.CrossAppDomainData::_processGuid String_t* ____processGuid_2; public: inline static int32_t get_offset_of__ContextID_0() { return static_cast<int32_t>(offsetof(CrossAppDomainData_t2130208023, ____ContextID_0)); } inline RuntimeObject * get__ContextID_0() const { return ____ContextID_0; } inline RuntimeObject ** get_address_of__ContextID_0() { return &____ContextID_0; } inline void set__ContextID_0(RuntimeObject * value) { ____ContextID_0 = value; Il2CppCodeGenWriteBarrier((&____ContextID_0), value); } inline static int32_t get_offset_of__DomainID_1() { return static_cast<int32_t>(offsetof(CrossAppDomainData_t2130208023, ____DomainID_1)); } inline int32_t get__DomainID_1() const { return ____DomainID_1; } inline int32_t* get_address_of__DomainID_1() { return &____DomainID_1; } inline void set__DomainID_1(int32_t value) { ____DomainID_1 = value; } inline static int32_t get_offset_of__processGuid_2() { return static_cast<int32_t>(offsetof(CrossAppDomainData_t2130208023, ____processGuid_2)); } inline String_t* get__processGuid_2() const { return ____processGuid_2; } inline String_t** get_address_of__processGuid_2() { return &____processGuid_2; } inline void set__processGuid_2(String_t* value) { ____processGuid_2 = value; Il2CppCodeGenWriteBarrier((&____processGuid_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CROSSAPPDOMAINDATA_T2130208023_H #ifndef SYNCHRONIZEDSERVERCONTEXTSINK_T2776015682_H #define SYNCHRONIZEDSERVERCONTEXTSINK_T2776015682_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Contexts.SynchronizedServerContextSink struct SynchronizedServerContextSink_t2776015682 : public RuntimeObject { public: // System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Contexts.SynchronizedServerContextSink::_next RuntimeObject* ____next_0; // System.Runtime.Remoting.Contexts.SynchronizationAttribute System.Runtime.Remoting.Contexts.SynchronizedServerContextSink::_att SynchronizationAttribute_t3946661254 * ____att_1; public: inline static int32_t get_offset_of__next_0() { return static_cast<int32_t>(offsetof(SynchronizedServerContextSink_t2776015682, ____next_0)); } inline RuntimeObject* get__next_0() const { return ____next_0; } inline RuntimeObject** get_address_of__next_0() { return &____next_0; } inline void set__next_0(RuntimeObject* value) { ____next_0 = value; Il2CppCodeGenWriteBarrier((&____next_0), value); } inline static int32_t get_offset_of__att_1() { return static_cast<int32_t>(offsetof(SynchronizedServerContextSink_t2776015682, ____att_1)); } inline SynchronizationAttribute_t3946661254 * get__att_1() const { return ____att_1; } inline SynchronizationAttribute_t3946661254 ** get_address_of__att_1() { return &____att_1; } inline void set__att_1(SynchronizationAttribute_t3946661254 * value) { ____att_1 = value; Il2CppCodeGenWriteBarrier((&____att_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SYNCHRONIZEDSERVERCONTEXTSINK_T2776015682_H #ifndef SYNCHRONIZEDCLIENTCONTEXTSINK_T1886771601_H #define SYNCHRONIZEDCLIENTCONTEXTSINK_T1886771601_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Contexts.SynchronizedClientContextSink struct SynchronizedClientContextSink_t1886771601 : public RuntimeObject { public: // System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Contexts.SynchronizedClientContextSink::_next RuntimeObject* ____next_0; // System.Runtime.Remoting.Contexts.SynchronizationAttribute System.Runtime.Remoting.Contexts.SynchronizedClientContextSink::_att SynchronizationAttribute_t3946661254 * ____att_1; public: inline static int32_t get_offset_of__next_0() { return static_cast<int32_t>(offsetof(SynchronizedClientContextSink_t1886771601, ____next_0)); } inline RuntimeObject* get__next_0() const { return ____next_0; } inline RuntimeObject** get_address_of__next_0() { return &____next_0; } inline void set__next_0(RuntimeObject* value) { ____next_0 = value; Il2CppCodeGenWriteBarrier((&____next_0), value); } inline static int32_t get_offset_of__att_1() { return static_cast<int32_t>(offsetof(SynchronizedClientContextSink_t1886771601, ____att_1)); } inline SynchronizationAttribute_t3946661254 * get__att_1() const { return ____att_1; } inline SynchronizationAttribute_t3946661254 ** get_address_of__att_1() { return &____att_1; } inline void set__att_1(SynchronizationAttribute_t3946661254 * value) { ____att_1 = value; Il2CppCodeGenWriteBarrier((&____att_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SYNCHRONIZEDCLIENTCONTEXTSINK_T1886771601_H #ifndef CROSSCONTEXTCHANNEL_T4063984580_H #define CROSSCONTEXTCHANNEL_T4063984580_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Contexts.CrossContextChannel struct CrossContextChannel_t4063984580 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CROSSCONTEXTCHANNEL_T4063984580_H #ifndef LEASEMANAGER_T3648745595_H #define LEASEMANAGER_T3648745595_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Lifetime.LeaseManager struct LeaseManager_t3648745595 : public RuntimeObject { public: // System.Collections.ArrayList System.Runtime.Remoting.Lifetime.LeaseManager::_objects ArrayList_t2718874744 * ____objects_0; // System.Threading.Timer System.Runtime.Remoting.Lifetime.LeaseManager::_timer Timer_t716671026 * ____timer_1; public: inline static int32_t get_offset_of__objects_0() { return static_cast<int32_t>(offsetof(LeaseManager_t3648745595, ____objects_0)); } inline ArrayList_t2718874744 * get__objects_0() const { return ____objects_0; } inline ArrayList_t2718874744 ** get_address_of__objects_0() { return &____objects_0; } inline void set__objects_0(ArrayList_t2718874744 * value) { ____objects_0 = value; Il2CppCodeGenWriteBarrier((&____objects_0), value); } inline static int32_t get_offset_of__timer_1() { return static_cast<int32_t>(offsetof(LeaseManager_t3648745595, ____timer_1)); } inline Timer_t716671026 * get__timer_1() const { return ____timer_1; } inline Timer_t716671026 ** get_address_of__timer_1() { return &____timer_1; } inline void set__timer_1(Timer_t716671026 * value) { ____timer_1 = value; Il2CppCodeGenWriteBarrier((&____timer_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LEASEMANAGER_T3648745595_H #ifndef LEASESINK_T3666380219_H #define LEASESINK_T3666380219_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Lifetime.LeaseSink struct LeaseSink_t3666380219 : public RuntimeObject { public: // System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Lifetime.LeaseSink::_nextSink RuntimeObject* ____nextSink_0; public: inline static int32_t get_offset_of__nextSink_0() { return static_cast<int32_t>(offsetof(LeaseSink_t3666380219, ____nextSink_0)); } inline RuntimeObject* get__nextSink_0() const { return ____nextSink_0; } inline RuntimeObject** get_address_of__nextSink_0() { return &____nextSink_0; } inline void set__nextSink_0(RuntimeObject* value) { ____nextSink_0 = value; Il2CppCodeGenWriteBarrier((&____nextSink_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LEASESINK_T3666380219_H #ifndef DYNAMICPROPERTYREG_T4086779412_H #define DYNAMICPROPERTYREG_T4086779412_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Contexts.DynamicPropertyCollection/DynamicPropertyReg struct DynamicPropertyReg_t4086779412 : public RuntimeObject { public: // System.Runtime.Remoting.Contexts.IDynamicProperty System.Runtime.Remoting.Contexts.DynamicPropertyCollection/DynamicPropertyReg::Property RuntimeObject* ___Property_0; // System.Runtime.Remoting.Contexts.IDynamicMessageSink System.Runtime.Remoting.Contexts.DynamicPropertyCollection/DynamicPropertyReg::Sink RuntimeObject* ___Sink_1; public: inline static int32_t get_offset_of_Property_0() { return static_cast<int32_t>(offsetof(DynamicPropertyReg_t4086779412, ___Property_0)); } inline RuntimeObject* get_Property_0() const { return ___Property_0; } inline RuntimeObject** get_address_of_Property_0() { return &___Property_0; } inline void set_Property_0(RuntimeObject* value) { ___Property_0 = value; Il2CppCodeGenWriteBarrier((&___Property_0), value); } inline static int32_t get_offset_of_Sink_1() { return static_cast<int32_t>(offsetof(DynamicPropertyReg_t4086779412, ___Sink_1)); } inline RuntimeObject* get_Sink_1() const { return ___Sink_1; } inline RuntimeObject** get_address_of_Sink_1() { return &___Sink_1; } inline void set_Sink_1(RuntimeObject* value) { ___Sink_1 = value; Il2CppCodeGenWriteBarrier((&___Sink_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DYNAMICPROPERTYREG_T4086779412_H #ifndef DYNAMICPROPERTYCOLLECTION_T652373272_H #define DYNAMICPROPERTYCOLLECTION_T652373272_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Contexts.DynamicPropertyCollection struct DynamicPropertyCollection_t652373272 : public RuntimeObject { public: // System.Collections.ArrayList System.Runtime.Remoting.Contexts.DynamicPropertyCollection::_properties ArrayList_t2718874744 * ____properties_0; public: inline static int32_t get_offset_of__properties_0() { return static_cast<int32_t>(offsetof(DynamicPropertyCollection_t652373272, ____properties_0)); } inline ArrayList_t2718874744 * get__properties_0() const { return ____properties_0; } inline ArrayList_t2718874744 ** get_address_of__properties_0() { return &____properties_0; } inline void set__properties_0(ArrayList_t2718874744 * value) { ____properties_0 = value; Il2CppCodeGenWriteBarrier((&____properties_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DYNAMICPROPERTYCOLLECTION_T652373272_H #ifndef MARSHALBYREFOBJECT_T2760389100_H #define MARSHALBYREFOBJECT_T2760389100_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.MarshalByRefObject struct MarshalByRefObject_t2760389100 : public RuntimeObject { public: // System.Runtime.Remoting.ServerIdentity System.MarshalByRefObject::_identity ServerIdentity_t2342208608 * ____identity_0; public: inline static int32_t get_offset_of__identity_0() { return static_cast<int32_t>(offsetof(MarshalByRefObject_t2760389100, ____identity_0)); } inline ServerIdentity_t2342208608 * get__identity_0() const { return ____identity_0; } inline ServerIdentity_t2342208608 ** get_address_of__identity_0() { return &____identity_0; } inline void set__identity_0(ServerIdentity_t2342208608 * value) { ____identity_0 = value; Il2CppCodeGenWriteBarrier((&____identity_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MARSHALBYREFOBJECT_T2760389100_H #ifndef CROSSAPPDOMAINSINK_T2177102621_H #define CROSSAPPDOMAINSINK_T2177102621_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Channels.CrossAppDomainSink struct CrossAppDomainSink_t2177102621 : public RuntimeObject { public: // System.Int32 System.Runtime.Remoting.Channels.CrossAppDomainSink::_domainID int32_t ____domainID_2; public: inline static int32_t get_offset_of__domainID_2() { return static_cast<int32_t>(offsetof(CrossAppDomainSink_t2177102621, ____domainID_2)); } inline int32_t get__domainID_2() const { return ____domainID_2; } inline int32_t* get_address_of__domainID_2() { return &____domainID_2; } inline void set__domainID_2(int32_t value) { ____domainID_2 = value; } }; struct CrossAppDomainSink_t2177102621_StaticFields { public: // System.Collections.Hashtable System.Runtime.Remoting.Channels.CrossAppDomainSink::s_sinks Hashtable_t1853889766 * ___s_sinks_0; // System.Reflection.MethodInfo System.Runtime.Remoting.Channels.CrossAppDomainSink::processMessageMethod MethodInfo_t * ___processMessageMethod_1; public: inline static int32_t get_offset_of_s_sinks_0() { return static_cast<int32_t>(offsetof(CrossAppDomainSink_t2177102621_StaticFields, ___s_sinks_0)); } inline Hashtable_t1853889766 * get_s_sinks_0() const { return ___s_sinks_0; } inline Hashtable_t1853889766 ** get_address_of_s_sinks_0() { return &___s_sinks_0; } inline void set_s_sinks_0(Hashtable_t1853889766 * value) { ___s_sinks_0 = value; Il2CppCodeGenWriteBarrier((&___s_sinks_0), value); } inline static int32_t get_offset_of_processMessageMethod_1() { return static_cast<int32_t>(offsetof(CrossAppDomainSink_t2177102621_StaticFields, ___processMessageMethod_1)); } inline MethodInfo_t * get_processMessageMethod_1() const { return ___processMessageMethod_1; } inline MethodInfo_t ** get_address_of_processMessageMethod_1() { return &___processMessageMethod_1; } inline void set_processMessageMethod_1(MethodInfo_t * value) { ___processMessageMethod_1 = value; Il2CppCodeGenWriteBarrier((&___processMessageMethod_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CROSSAPPDOMAINSINK_T2177102621_H #ifndef CROSSAPPDOMAINCHANNEL_T1606809047_H #define CROSSAPPDOMAINCHANNEL_T1606809047_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Channels.CrossAppDomainChannel struct CrossAppDomainChannel_t1606809047 : public RuntimeObject { public: public: }; struct CrossAppDomainChannel_t1606809047_StaticFields { public: // System.Object System.Runtime.Remoting.Channels.CrossAppDomainChannel::s_lock RuntimeObject * ___s_lock_0; public: inline static int32_t get_offset_of_s_lock_0() { return static_cast<int32_t>(offsetof(CrossAppDomainChannel_t1606809047_StaticFields, ___s_lock_0)); } inline RuntimeObject * get_s_lock_0() const { return ___s_lock_0; } inline RuntimeObject ** get_address_of_s_lock_0() { return &___s_lock_0; } inline void set_s_lock_0(RuntimeObject * value) { ___s_lock_0 = value; Il2CppCodeGenWriteBarrier((&___s_lock_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CROSSAPPDOMAINCHANNEL_T1606809047_H #ifndef METHODCALL_T861078140_H #define METHODCALL_T861078140_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.MethodCall struct MethodCall_t861078140 : public RuntimeObject { public: // System.String System.Runtime.Remoting.Messaging.MethodCall::_uri String_t* ____uri_0; // System.String System.Runtime.Remoting.Messaging.MethodCall::_typeName String_t* ____typeName_1; // System.String System.Runtime.Remoting.Messaging.MethodCall::_methodName String_t* ____methodName_2; // System.Object[] System.Runtime.Remoting.Messaging.MethodCall::_args ObjectU5BU5D_t2843939325* ____args_3; // System.Type[] System.Runtime.Remoting.Messaging.MethodCall::_methodSignature TypeU5BU5D_t3940880105* ____methodSignature_4; // System.Reflection.MethodBase System.Runtime.Remoting.Messaging.MethodCall::_methodBase MethodBase_t * ____methodBase_5; // System.Runtime.Remoting.Messaging.LogicalCallContext System.Runtime.Remoting.Messaging.MethodCall::_callContext LogicalCallContext_t3342013719 * ____callContext_6; // System.Type[] System.Runtime.Remoting.Messaging.MethodCall::_genericArguments TypeU5BU5D_t3940880105* ____genericArguments_7; // System.Collections.IDictionary System.Runtime.Remoting.Messaging.MethodCall::ExternalProperties RuntimeObject* ___ExternalProperties_8; // System.Collections.IDictionary System.Runtime.Remoting.Messaging.MethodCall::InternalProperties RuntimeObject* ___InternalProperties_9; public: inline static int32_t get_offset_of__uri_0() { return static_cast<int32_t>(offsetof(MethodCall_t861078140, ____uri_0)); } inline String_t* get__uri_0() const { return ____uri_0; } inline String_t** get_address_of__uri_0() { return &____uri_0; } inline void set__uri_0(String_t* value) { ____uri_0 = value; Il2CppCodeGenWriteBarrier((&____uri_0), value); } inline static int32_t get_offset_of__typeName_1() { return static_cast<int32_t>(offsetof(MethodCall_t861078140, ____typeName_1)); } inline String_t* get__typeName_1() const { return ____typeName_1; } inline String_t** get_address_of__typeName_1() { return &____typeName_1; } inline void set__typeName_1(String_t* value) { ____typeName_1 = value; Il2CppCodeGenWriteBarrier((&____typeName_1), value); } inline static int32_t get_offset_of__methodName_2() { return static_cast<int32_t>(offsetof(MethodCall_t861078140, ____methodName_2)); } inline String_t* get__methodName_2() const { return ____methodName_2; } inline String_t** get_address_of__methodName_2() { return &____methodName_2; } inline void set__methodName_2(String_t* value) { ____methodName_2 = value; Il2CppCodeGenWriteBarrier((&____methodName_2), value); } inline static int32_t get_offset_of__args_3() { return static_cast<int32_t>(offsetof(MethodCall_t861078140, ____args_3)); } inline ObjectU5BU5D_t2843939325* get__args_3() const { return ____args_3; } inline ObjectU5BU5D_t2843939325** get_address_of__args_3() { return &____args_3; } inline void set__args_3(ObjectU5BU5D_t2843939325* value) { ____args_3 = value; Il2CppCodeGenWriteBarrier((&____args_3), value); } inline static int32_t get_offset_of__methodSignature_4() { return static_cast<int32_t>(offsetof(MethodCall_t861078140, ____methodSignature_4)); } inline TypeU5BU5D_t3940880105* get__methodSignature_4() const { return ____methodSignature_4; } inline TypeU5BU5D_t3940880105** get_address_of__methodSignature_4() { return &____methodSignature_4; } inline void set__methodSignature_4(TypeU5BU5D_t3940880105* value) { ____methodSignature_4 = value; Il2CppCodeGenWriteBarrier((&____methodSignature_4), value); } inline static int32_t get_offset_of__methodBase_5() { return static_cast<int32_t>(offsetof(MethodCall_t861078140, ____methodBase_5)); } inline MethodBase_t * get__methodBase_5() const { return ____methodBase_5; } inline MethodBase_t ** get_address_of__methodBase_5() { return &____methodBase_5; } inline void set__methodBase_5(MethodBase_t * value) { ____methodBase_5 = value; Il2CppCodeGenWriteBarrier((&____methodBase_5), value); } inline static int32_t get_offset_of__callContext_6() { return static_cast<int32_t>(offsetof(MethodCall_t861078140, ____callContext_6)); } inline LogicalCallContext_t3342013719 * get__callContext_6() const { return ____callContext_6; } inline LogicalCallContext_t3342013719 ** get_address_of__callContext_6() { return &____callContext_6; } inline void set__callContext_6(LogicalCallContext_t3342013719 * value) { ____callContext_6 = value; Il2CppCodeGenWriteBarrier((&____callContext_6), value); } inline static int32_t get_offset_of__genericArguments_7() { return static_cast<int32_t>(offsetof(MethodCall_t861078140, ____genericArguments_7)); } inline TypeU5BU5D_t3940880105* get__genericArguments_7() const { return ____genericArguments_7; } inline TypeU5BU5D_t3940880105** get_address_of__genericArguments_7() { return &____genericArguments_7; } inline void set__genericArguments_7(TypeU5BU5D_t3940880105* value) { ____genericArguments_7 = value; Il2CppCodeGenWriteBarrier((&____genericArguments_7), value); } inline static int32_t get_offset_of_ExternalProperties_8() { return static_cast<int32_t>(offsetof(MethodCall_t861078140, ___ExternalProperties_8)); } inline RuntimeObject* get_ExternalProperties_8() const { return ___ExternalProperties_8; } inline RuntimeObject** get_address_of_ExternalProperties_8() { return &___ExternalProperties_8; } inline void set_ExternalProperties_8(RuntimeObject* value) { ___ExternalProperties_8 = value; Il2CppCodeGenWriteBarrier((&___ExternalProperties_8), value); } inline static int32_t get_offset_of_InternalProperties_9() { return static_cast<int32_t>(offsetof(MethodCall_t861078140, ___InternalProperties_9)); } inline RuntimeObject* get_InternalProperties_9() const { return ___InternalProperties_9; } inline RuntimeObject** get_address_of_InternalProperties_9() { return &___InternalProperties_9; } inline void set_InternalProperties_9(RuntimeObject* value) { ___InternalProperties_9 = value; Il2CppCodeGenWriteBarrier((&___InternalProperties_9), value); } }; struct MethodCall_t861078140_StaticFields { public: // System.Collections.Generic.Dictionary`2<System.String,System.Int32> System.Runtime.Remoting.Messaging.MethodCall::<>f__switch$map24 Dictionary_2_t2736202052 * ___U3CU3Ef__switchU24map24_10; public: inline static int32_t get_offset_of_U3CU3Ef__switchU24map24_10() { return static_cast<int32_t>(offsetof(MethodCall_t861078140_StaticFields, ___U3CU3Ef__switchU24map24_10)); } inline Dictionary_2_t2736202052 * get_U3CU3Ef__switchU24map24_10() const { return ___U3CU3Ef__switchU24map24_10; } inline Dictionary_2_t2736202052 ** get_address_of_U3CU3Ef__switchU24map24_10() { return &___U3CU3Ef__switchU24map24_10; } inline void set_U3CU3Ef__switchU24map24_10(Dictionary_2_t2736202052 * value) { ___U3CU3Ef__switchU24map24_10 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__switchU24map24_10), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // METHODCALL_T861078140_H #ifndef PROVIDERDATA_T3272123318_H #define PROVIDERDATA_T3272123318_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.ProviderData struct ProviderData_t3272123318 : public RuntimeObject { public: // System.String System.Runtime.Remoting.ProviderData::Ref String_t* ___Ref_0; // System.String System.Runtime.Remoting.ProviderData::Type String_t* ___Type_1; // System.String System.Runtime.Remoting.ProviderData::Id String_t* ___Id_2; // System.Collections.Hashtable System.Runtime.Remoting.ProviderData::CustomProperties Hashtable_t1853889766 * ___CustomProperties_3; // System.Collections.IList System.Runtime.Remoting.ProviderData::CustomData RuntimeObject* ___CustomData_4; public: inline static int32_t get_offset_of_Ref_0() { return static_cast<int32_t>(offsetof(ProviderData_t3272123318, ___Ref_0)); } inline String_t* get_Ref_0() const { return ___Ref_0; } inline String_t** get_address_of_Ref_0() { return &___Ref_0; } inline void set_Ref_0(String_t* value) { ___Ref_0 = value; Il2CppCodeGenWriteBarrier((&___Ref_0), value); } inline static int32_t get_offset_of_Type_1() { return static_cast<int32_t>(offsetof(ProviderData_t3272123318, ___Type_1)); } inline String_t* get_Type_1() const { return ___Type_1; } inline String_t** get_address_of_Type_1() { return &___Type_1; } inline void set_Type_1(String_t* value) { ___Type_1 = value; Il2CppCodeGenWriteBarrier((&___Type_1), value); } inline static int32_t get_offset_of_Id_2() { return static_cast<int32_t>(offsetof(ProviderData_t3272123318, ___Id_2)); } inline String_t* get_Id_2() const { return ___Id_2; } inline String_t** get_address_of_Id_2() { return &___Id_2; } inline void set_Id_2(String_t* value) { ___Id_2 = value; Il2CppCodeGenWriteBarrier((&___Id_2), value); } inline static int32_t get_offset_of_CustomProperties_3() { return static_cast<int32_t>(offsetof(ProviderData_t3272123318, ___CustomProperties_3)); } inline Hashtable_t1853889766 * get_CustomProperties_3() const { return ___CustomProperties_3; } inline Hashtable_t1853889766 ** get_address_of_CustomProperties_3() { return &___CustomProperties_3; } inline void set_CustomProperties_3(Hashtable_t1853889766 * value) { ___CustomProperties_3 = value; Il2CppCodeGenWriteBarrier((&___CustomProperties_3), value); } inline static int32_t get_offset_of_CustomData_4() { return static_cast<int32_t>(offsetof(ProviderData_t3272123318, ___CustomData_4)); } inline RuntimeObject* get_CustomData_4() const { return ___CustomData_4; } inline RuntimeObject** get_address_of_CustomData_4() { return &___CustomData_4; } inline void set_CustomData_4(RuntimeObject* value) { ___CustomData_4 = value; Il2CppCodeGenWriteBarrier((&___CustomData_4), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // PROVIDERDATA_T3272123318_H #ifndef CHANNELDATA_T3353629972_H #define CHANNELDATA_T3353629972_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.ChannelData struct ChannelData_t3353629972 : public RuntimeObject { public: // System.String System.Runtime.Remoting.ChannelData::Ref String_t* ___Ref_0; // System.String System.Runtime.Remoting.ChannelData::Type String_t* ___Type_1; // System.String System.Runtime.Remoting.ChannelData::Id String_t* ___Id_2; // System.String System.Runtime.Remoting.ChannelData::DelayLoadAsClientChannel String_t* ___DelayLoadAsClientChannel_3; // System.Collections.ArrayList System.Runtime.Remoting.ChannelData::_serverProviders ArrayList_t2718874744 * ____serverProviders_4; // System.Collections.ArrayList System.Runtime.Remoting.ChannelData::_clientProviders ArrayList_t2718874744 * ____clientProviders_5; // System.Collections.Hashtable System.Runtime.Remoting.ChannelData::_customProperties Hashtable_t1853889766 * ____customProperties_6; public: inline static int32_t get_offset_of_Ref_0() { return static_cast<int32_t>(offsetof(ChannelData_t3353629972, ___Ref_0)); } inline String_t* get_Ref_0() const { return ___Ref_0; } inline String_t** get_address_of_Ref_0() { return &___Ref_0; } inline void set_Ref_0(String_t* value) { ___Ref_0 = value; Il2CppCodeGenWriteBarrier((&___Ref_0), value); } inline static int32_t get_offset_of_Type_1() { return static_cast<int32_t>(offsetof(ChannelData_t3353629972, ___Type_1)); } inline String_t* get_Type_1() const { return ___Type_1; } inline String_t** get_address_of_Type_1() { return &___Type_1; } inline void set_Type_1(String_t* value) { ___Type_1 = value; Il2CppCodeGenWriteBarrier((&___Type_1), value); } inline static int32_t get_offset_of_Id_2() { return static_cast<int32_t>(offsetof(ChannelData_t3353629972, ___Id_2)); } inline String_t* get_Id_2() const { return ___Id_2; } inline String_t** get_address_of_Id_2() { return &___Id_2; } inline void set_Id_2(String_t* value) { ___Id_2 = value; Il2CppCodeGenWriteBarrier((&___Id_2), value); } inline static int32_t get_offset_of_DelayLoadAsClientChannel_3() { return static_cast<int32_t>(offsetof(ChannelData_t3353629972, ___DelayLoadAsClientChannel_3)); } inline String_t* get_DelayLoadAsClientChannel_3() const { return ___DelayLoadAsClientChannel_3; } inline String_t** get_address_of_DelayLoadAsClientChannel_3() { return &___DelayLoadAsClientChannel_3; } inline void set_DelayLoadAsClientChannel_3(String_t* value) { ___DelayLoadAsClientChannel_3 = value; Il2CppCodeGenWriteBarrier((&___DelayLoadAsClientChannel_3), value); } inline static int32_t get_offset_of__serverProviders_4() { return static_cast<int32_t>(offsetof(ChannelData_t3353629972, ____serverProviders_4)); } inline ArrayList_t2718874744 * get__serverProviders_4() const { return ____serverProviders_4; } inline ArrayList_t2718874744 ** get_address_of__serverProviders_4() { return &____serverProviders_4; } inline void set__serverProviders_4(ArrayList_t2718874744 * value) { ____serverProviders_4 = value; Il2CppCodeGenWriteBarrier((&____serverProviders_4), value); } inline static int32_t get_offset_of__clientProviders_5() { return static_cast<int32_t>(offsetof(ChannelData_t3353629972, ____clientProviders_5)); } inline ArrayList_t2718874744 * get__clientProviders_5() const { return ____clientProviders_5; } inline ArrayList_t2718874744 ** get_address_of__clientProviders_5() { return &____clientProviders_5; } inline void set__clientProviders_5(ArrayList_t2718874744 * value) { ____clientProviders_5 = value; Il2CppCodeGenWriteBarrier((&____clientProviders_5), value); } inline static int32_t get_offset_of__customProperties_6() { return static_cast<int32_t>(offsetof(ChannelData_t3353629972, ____customProperties_6)); } inline Hashtable_t1853889766 * get__customProperties_6() const { return ____customProperties_6; } inline Hashtable_t1853889766 ** get_address_of__customProperties_6() { return &____customProperties_6; } inline void set__customProperties_6(Hashtable_t1853889766 * value) { ____customProperties_6 = value; Il2CppCodeGenWriteBarrier((&____customProperties_6), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CHANNELDATA_T3353629972_H #ifndef CONFIGHANDLER_T4192437216_H #define CONFIGHANDLER_T4192437216_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.ConfigHandler struct ConfigHandler_t4192437216 : public RuntimeObject { public: // System.Collections.ArrayList System.Runtime.Remoting.ConfigHandler::typeEntries ArrayList_t2718874744 * ___typeEntries_0; // System.Collections.ArrayList System.Runtime.Remoting.ConfigHandler::channelInstances ArrayList_t2718874744 * ___channelInstances_1; // System.Runtime.Remoting.ChannelData System.Runtime.Remoting.ConfigHandler::currentChannel ChannelData_t3353629972 * ___currentChannel_2; // System.Collections.Stack System.Runtime.Remoting.ConfigHandler::currentProviderData Stack_t2329662280 * ___currentProviderData_3; // System.String System.Runtime.Remoting.ConfigHandler::currentClientUrl String_t* ___currentClientUrl_4; // System.String System.Runtime.Remoting.ConfigHandler::appName String_t* ___appName_5; // System.String System.Runtime.Remoting.ConfigHandler::currentXmlPath String_t* ___currentXmlPath_6; // System.Boolean System.Runtime.Remoting.ConfigHandler::onlyDelayedChannels bool ___onlyDelayedChannels_7; public: inline static int32_t get_offset_of_typeEntries_0() { return static_cast<int32_t>(offsetof(ConfigHandler_t4192437216, ___typeEntries_0)); } inline ArrayList_t2718874744 * get_typeEntries_0() const { return ___typeEntries_0; } inline ArrayList_t2718874744 ** get_address_of_typeEntries_0() { return &___typeEntries_0; } inline void set_typeEntries_0(ArrayList_t2718874744 * value) { ___typeEntries_0 = value; Il2CppCodeGenWriteBarrier((&___typeEntries_0), value); } inline static int32_t get_offset_of_channelInstances_1() { return static_cast<int32_t>(offsetof(ConfigHandler_t4192437216, ___channelInstances_1)); } inline ArrayList_t2718874744 * get_channelInstances_1() const { return ___channelInstances_1; } inline ArrayList_t2718874744 ** get_address_of_channelInstances_1() { return &___channelInstances_1; } inline void set_channelInstances_1(ArrayList_t2718874744 * value) { ___channelInstances_1 = value; Il2CppCodeGenWriteBarrier((&___channelInstances_1), value); } inline static int32_t get_offset_of_currentChannel_2() { return static_cast<int32_t>(offsetof(ConfigHandler_t4192437216, ___currentChannel_2)); } inline ChannelData_t3353629972 * get_currentChannel_2() const { return ___currentChannel_2; } inline ChannelData_t3353629972 ** get_address_of_currentChannel_2() { return &___currentChannel_2; } inline void set_currentChannel_2(ChannelData_t3353629972 * value) { ___currentChannel_2 = value; Il2CppCodeGenWriteBarrier((&___currentChannel_2), value); } inline static int32_t get_offset_of_currentProviderData_3() { return static_cast<int32_t>(offsetof(ConfigHandler_t4192437216, ___currentProviderData_3)); } inline Stack_t2329662280 * get_currentProviderData_3() const { return ___currentProviderData_3; } inline Stack_t2329662280 ** get_address_of_currentProviderData_3() { return &___currentProviderData_3; } inline void set_currentProviderData_3(Stack_t2329662280 * value) { ___currentProviderData_3 = value; Il2CppCodeGenWriteBarrier((&___currentProviderData_3), value); } inline static int32_t get_offset_of_currentClientUrl_4() { return static_cast<int32_t>(offsetof(ConfigHandler_t4192437216, ___currentClientUrl_4)); } inline String_t* get_currentClientUrl_4() const { return ___currentClientUrl_4; } inline String_t** get_address_of_currentClientUrl_4() { return &___currentClientUrl_4; } inline void set_currentClientUrl_4(String_t* value) { ___currentClientUrl_4 = value; Il2CppCodeGenWriteBarrier((&___currentClientUrl_4), value); } inline static int32_t get_offset_of_appName_5() { return static_cast<int32_t>(offsetof(ConfigHandler_t4192437216, ___appName_5)); } inline String_t* get_appName_5() const { return ___appName_5; } inline String_t** get_address_of_appName_5() { return &___appName_5; } inline void set_appName_5(String_t* value) { ___appName_5 = value; Il2CppCodeGenWriteBarrier((&___appName_5), value); } inline static int32_t get_offset_of_currentXmlPath_6() { return static_cast<int32_t>(offsetof(ConfigHandler_t4192437216, ___currentXmlPath_6)); } inline String_t* get_currentXmlPath_6() const { return ___currentXmlPath_6; } inline String_t** get_address_of_currentXmlPath_6() { return &___currentXmlPath_6; } inline void set_currentXmlPath_6(String_t* value) { ___currentXmlPath_6 = value; Il2CppCodeGenWriteBarrier((&___currentXmlPath_6), value); } inline static int32_t get_offset_of_onlyDelayedChannels_7() { return static_cast<int32_t>(offsetof(ConfigHandler_t4192437216, ___onlyDelayedChannels_7)); } inline bool get_onlyDelayedChannels_7() const { return ___onlyDelayedChannels_7; } inline bool* get_address_of_onlyDelayedChannels_7() { return &___onlyDelayedChannels_7; } inline void set_onlyDelayedChannels_7(bool value) { ___onlyDelayedChannels_7 = value; } }; struct ConfigHandler_t4192437216_StaticFields { public: // System.Collections.Generic.Dictionary`2<System.String,System.Int32> System.Runtime.Remoting.ConfigHandler::<>f__switch$map22 Dictionary_2_t2736202052 * ___U3CU3Ef__switchU24map22_8; // System.Collections.Generic.Dictionary`2<System.String,System.Int32> System.Runtime.Remoting.ConfigHandler::<>f__switch$map23 Dictionary_2_t2736202052 * ___U3CU3Ef__switchU24map23_9; public: inline static int32_t get_offset_of_U3CU3Ef__switchU24map22_8() { return static_cast<int32_t>(offsetof(ConfigHandler_t4192437216_StaticFields, ___U3CU3Ef__switchU24map22_8)); } inline Dictionary_2_t2736202052 * get_U3CU3Ef__switchU24map22_8() const { return ___U3CU3Ef__switchU24map22_8; } inline Dictionary_2_t2736202052 ** get_address_of_U3CU3Ef__switchU24map22_8() { return &___U3CU3Ef__switchU24map22_8; } inline void set_U3CU3Ef__switchU24map22_8(Dictionary_2_t2736202052 * value) { ___U3CU3Ef__switchU24map22_8 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__switchU24map22_8), value); } inline static int32_t get_offset_of_U3CU3Ef__switchU24map23_9() { return static_cast<int32_t>(offsetof(ConfigHandler_t4192437216_StaticFields, ___U3CU3Ef__switchU24map23_9)); } inline Dictionary_2_t2736202052 * get_U3CU3Ef__switchU24map23_9() const { return ___U3CU3Ef__switchU24map23_9; } inline Dictionary_2_t2736202052 ** get_address_of_U3CU3Ef__switchU24map23_9() { return &___U3CU3Ef__switchU24map23_9; } inline void set_U3CU3Ef__switchU24map23_9(Dictionary_2_t2736202052 * value) { ___U3CU3Ef__switchU24map23_9 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__switchU24map23_9), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONFIGHANDLER_T4192437216_H #ifndef REMOTINGCONFIGURATION_T4113740665_H #define REMOTINGCONFIGURATION_T4113740665_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.RemotingConfiguration struct RemotingConfiguration_t4113740665 : public RuntimeObject { public: public: }; struct RemotingConfiguration_t4113740665_StaticFields { public: // System.String System.Runtime.Remoting.RemotingConfiguration::applicationID String_t* ___applicationID_0; // System.String System.Runtime.Remoting.RemotingConfiguration::applicationName String_t* ___applicationName_1; // System.String System.Runtime.Remoting.RemotingConfiguration::processGuid String_t* ___processGuid_2; // System.Boolean System.Runtime.Remoting.RemotingConfiguration::defaultConfigRead bool ___defaultConfigRead_3; // System.Boolean System.Runtime.Remoting.RemotingConfiguration::defaultDelayedConfigRead bool ___defaultDelayedConfigRead_4; // System.String System.Runtime.Remoting.RemotingConfiguration::_errorMode String_t* ____errorMode_5; // System.Collections.Hashtable System.Runtime.Remoting.RemotingConfiguration::wellKnownClientEntries Hashtable_t1853889766 * ___wellKnownClientEntries_6; // System.Collections.Hashtable System.Runtime.Remoting.RemotingConfiguration::activatedClientEntries Hashtable_t1853889766 * ___activatedClientEntries_7; // System.Collections.Hashtable System.Runtime.Remoting.RemotingConfiguration::wellKnownServiceEntries Hashtable_t1853889766 * ___wellKnownServiceEntries_8; // System.Collections.Hashtable System.Runtime.Remoting.RemotingConfiguration::activatedServiceEntries Hashtable_t1853889766 * ___activatedServiceEntries_9; // System.Collections.Hashtable System.Runtime.Remoting.RemotingConfiguration::channelTemplates Hashtable_t1853889766 * ___channelTemplates_10; // System.Collections.Hashtable System.Runtime.Remoting.RemotingConfiguration::clientProviderTemplates Hashtable_t1853889766 * ___clientProviderTemplates_11; // System.Collections.Hashtable System.Runtime.Remoting.RemotingConfiguration::serverProviderTemplates Hashtable_t1853889766 * ___serverProviderTemplates_12; public: inline static int32_t get_offset_of_applicationID_0() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___applicationID_0)); } inline String_t* get_applicationID_0() const { return ___applicationID_0; } inline String_t** get_address_of_applicationID_0() { return &___applicationID_0; } inline void set_applicationID_0(String_t* value) { ___applicationID_0 = value; Il2CppCodeGenWriteBarrier((&___applicationID_0), value); } inline static int32_t get_offset_of_applicationName_1() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___applicationName_1)); } inline String_t* get_applicationName_1() const { return ___applicationName_1; } inline String_t** get_address_of_applicationName_1() { return &___applicationName_1; } inline void set_applicationName_1(String_t* value) { ___applicationName_1 = value; Il2CppCodeGenWriteBarrier((&___applicationName_1), value); } inline static int32_t get_offset_of_processGuid_2() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___processGuid_2)); } inline String_t* get_processGuid_2() const { return ___processGuid_2; } inline String_t** get_address_of_processGuid_2() { return &___processGuid_2; } inline void set_processGuid_2(String_t* value) { ___processGuid_2 = value; Il2CppCodeGenWriteBarrier((&___processGuid_2), value); } inline static int32_t get_offset_of_defaultConfigRead_3() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___defaultConfigRead_3)); } inline bool get_defaultConfigRead_3() const { return ___defaultConfigRead_3; } inline bool* get_address_of_defaultConfigRead_3() { return &___defaultConfigRead_3; } inline void set_defaultConfigRead_3(bool value) { ___defaultConfigRead_3 = value; } inline static int32_t get_offset_of_defaultDelayedConfigRead_4() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___defaultDelayedConfigRead_4)); } inline bool get_defaultDelayedConfigRead_4() const { return ___defaultDelayedConfigRead_4; } inline bool* get_address_of_defaultDelayedConfigRead_4() { return &___defaultDelayedConfigRead_4; } inline void set_defaultDelayedConfigRead_4(bool value) { ___defaultDelayedConfigRead_4 = value; } inline static int32_t get_offset_of__errorMode_5() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ____errorMode_5)); } inline String_t* get__errorMode_5() const { return ____errorMode_5; } inline String_t** get_address_of__errorMode_5() { return &____errorMode_5; } inline void set__errorMode_5(String_t* value) { ____errorMode_5 = value; Il2CppCodeGenWriteBarrier((&____errorMode_5), value); } inline static int32_t get_offset_of_wellKnownClientEntries_6() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___wellKnownClientEntries_6)); } inline Hashtable_t1853889766 * get_wellKnownClientEntries_6() const { return ___wellKnownClientEntries_6; } inline Hashtable_t1853889766 ** get_address_of_wellKnownClientEntries_6() { return &___wellKnownClientEntries_6; } inline void set_wellKnownClientEntries_6(Hashtable_t1853889766 * value) { ___wellKnownClientEntries_6 = value; Il2CppCodeGenWriteBarrier((&___wellKnownClientEntries_6), value); } inline static int32_t get_offset_of_activatedClientEntries_7() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___activatedClientEntries_7)); } inline Hashtable_t1853889766 * get_activatedClientEntries_7() const { return ___activatedClientEntries_7; } inline Hashtable_t1853889766 ** get_address_of_activatedClientEntries_7() { return &___activatedClientEntries_7; } inline void set_activatedClientEntries_7(Hashtable_t1853889766 * value) { ___activatedClientEntries_7 = value; Il2CppCodeGenWriteBarrier((&___activatedClientEntries_7), value); } inline static int32_t get_offset_of_wellKnownServiceEntries_8() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___wellKnownServiceEntries_8)); } inline Hashtable_t1853889766 * get_wellKnownServiceEntries_8() const { return ___wellKnownServiceEntries_8; } inline Hashtable_t1853889766 ** get_address_of_wellKnownServiceEntries_8() { return &___wellKnownServiceEntries_8; } inline void set_wellKnownServiceEntries_8(Hashtable_t1853889766 * value) { ___wellKnownServiceEntries_8 = value; Il2CppCodeGenWriteBarrier((&___wellKnownServiceEntries_8), value); } inline static int32_t get_offset_of_activatedServiceEntries_9() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___activatedServiceEntries_9)); } inline Hashtable_t1853889766 * get_activatedServiceEntries_9() const { return ___activatedServiceEntries_9; } inline Hashtable_t1853889766 ** get_address_of_activatedServiceEntries_9() { return &___activatedServiceEntries_9; } inline void set_activatedServiceEntries_9(Hashtable_t1853889766 * value) { ___activatedServiceEntries_9 = value; Il2CppCodeGenWriteBarrier((&___activatedServiceEntries_9), value); } inline static int32_t get_offset_of_channelTemplates_10() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___channelTemplates_10)); } inline Hashtable_t1853889766 * get_channelTemplates_10() const { return ___channelTemplates_10; } inline Hashtable_t1853889766 ** get_address_of_channelTemplates_10() { return &___channelTemplates_10; } inline void set_channelTemplates_10(Hashtable_t1853889766 * value) { ___channelTemplates_10 = value; Il2CppCodeGenWriteBarrier((&___channelTemplates_10), value); } inline static int32_t get_offset_of_clientProviderTemplates_11() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___clientProviderTemplates_11)); } inline Hashtable_t1853889766 * get_clientProviderTemplates_11() const { return ___clientProviderTemplates_11; } inline Hashtable_t1853889766 ** get_address_of_clientProviderTemplates_11() { return &___clientProviderTemplates_11; } inline void set_clientProviderTemplates_11(Hashtable_t1853889766 * value) { ___clientProviderTemplates_11 = value; Il2CppCodeGenWriteBarrier((&___clientProviderTemplates_11), value); } inline static int32_t get_offset_of_serverProviderTemplates_12() { return static_cast<int32_t>(offsetof(RemotingConfiguration_t4113740665_StaticFields, ___serverProviderTemplates_12)); } inline Hashtable_t1853889766 * get_serverProviderTemplates_12() const { return ___serverProviderTemplates_12; } inline Hashtable_t1853889766 ** get_address_of_serverProviderTemplates_12() { return &___serverProviderTemplates_12; } inline void set_serverProviderTemplates_12(Hashtable_t1853889766 * value) { ___serverProviderTemplates_12 = value; Il2CppCodeGenWriteBarrier((&___serverProviderTemplates_12), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // REMOTINGCONFIGURATION_T4113740665_H #ifndef OBJREF_T2141158884_H #define OBJREF_T2141158884_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.ObjRef struct ObjRef_t2141158884 : public RuntimeObject { public: // System.Runtime.Remoting.IChannelInfo System.Runtime.Remoting.ObjRef::channel_info RuntimeObject* ___channel_info_0; // System.String System.Runtime.Remoting.ObjRef::uri String_t* ___uri_1; // System.Runtime.Remoting.IRemotingTypeInfo System.Runtime.Remoting.ObjRef::typeInfo RuntimeObject* ___typeInfo_2; // System.Runtime.Remoting.IEnvoyInfo System.Runtime.Remoting.ObjRef::envoyInfo RuntimeObject* ___envoyInfo_3; // System.Int32 System.Runtime.Remoting.ObjRef::flags int32_t ___flags_4; // System.Type System.Runtime.Remoting.ObjRef::_serverType Type_t * ____serverType_5; public: inline static int32_t get_offset_of_channel_info_0() { return static_cast<int32_t>(offsetof(ObjRef_t2141158884, ___channel_info_0)); } inline RuntimeObject* get_channel_info_0() const { return ___channel_info_0; } inline RuntimeObject** get_address_of_channel_info_0() { return &___channel_info_0; } inline void set_channel_info_0(RuntimeObject* value) { ___channel_info_0 = value; Il2CppCodeGenWriteBarrier((&___channel_info_0), value); } inline static int32_t get_offset_of_uri_1() { return static_cast<int32_t>(offsetof(ObjRef_t2141158884, ___uri_1)); } inline String_t* get_uri_1() const { return ___uri_1; } inline String_t** get_address_of_uri_1() { return &___uri_1; } inline void set_uri_1(String_t* value) { ___uri_1 = value; Il2CppCodeGenWriteBarrier((&___uri_1), value); } inline static int32_t get_offset_of_typeInfo_2() { return static_cast<int32_t>(offsetof(ObjRef_t2141158884, ___typeInfo_2)); } inline RuntimeObject* get_typeInfo_2() const { return ___typeInfo_2; } inline RuntimeObject** get_address_of_typeInfo_2() { return &___typeInfo_2; } inline void set_typeInfo_2(RuntimeObject* value) { ___typeInfo_2 = value; Il2CppCodeGenWriteBarrier((&___typeInfo_2), value); } inline static int32_t get_offset_of_envoyInfo_3() { return static_cast<int32_t>(offsetof(ObjRef_t2141158884, ___envoyInfo_3)); } inline RuntimeObject* get_envoyInfo_3() const { return ___envoyInfo_3; } inline RuntimeObject** get_address_of_envoyInfo_3() { return &___envoyInfo_3; } inline void set_envoyInfo_3(RuntimeObject* value) { ___envoyInfo_3 = value; Il2CppCodeGenWriteBarrier((&___envoyInfo_3), value); } inline static int32_t get_offset_of_flags_4() { return static_cast<int32_t>(offsetof(ObjRef_t2141158884, ___flags_4)); } inline int32_t get_flags_4() const { return ___flags_4; } inline int32_t* get_address_of_flags_4() { return &___flags_4; } inline void set_flags_4(int32_t value) { ___flags_4 = value; } inline static int32_t get_offset_of__serverType_5() { return static_cast<int32_t>(offsetof(ObjRef_t2141158884, ____serverType_5)); } inline Type_t * get__serverType_5() const { return ____serverType_5; } inline Type_t ** get_address_of__serverType_5() { return &____serverType_5; } inline void set__serverType_5(Type_t * value) { ____serverType_5 = value; Il2CppCodeGenWriteBarrier((&____serverType_5), value); } }; struct ObjRef_t2141158884_StaticFields { public: // System.Int32 System.Runtime.Remoting.ObjRef::MarshalledObjectRef int32_t ___MarshalledObjectRef_6; // System.Int32 System.Runtime.Remoting.ObjRef::WellKnowObjectRef int32_t ___WellKnowObjectRef_7; // System.Collections.Generic.Dictionary`2<System.String,System.Int32> System.Runtime.Remoting.ObjRef::<>f__switch$map21 Dictionary_2_t2736202052 * ___U3CU3Ef__switchU24map21_8; public: inline static int32_t get_offset_of_MarshalledObjectRef_6() { return static_cast<int32_t>(offsetof(ObjRef_t2141158884_StaticFields, ___MarshalledObjectRef_6)); } inline int32_t get_MarshalledObjectRef_6() const { return ___MarshalledObjectRef_6; } inline int32_t* get_address_of_MarshalledObjectRef_6() { return &___MarshalledObjectRef_6; } inline void set_MarshalledObjectRef_6(int32_t value) { ___MarshalledObjectRef_6 = value; } inline static int32_t get_offset_of_WellKnowObjectRef_7() { return static_cast<int32_t>(offsetof(ObjRef_t2141158884_StaticFields, ___WellKnowObjectRef_7)); } inline int32_t get_WellKnowObjectRef_7() const { return ___WellKnowObjectRef_7; } inline int32_t* get_address_of_WellKnowObjectRef_7() { return &___WellKnowObjectRef_7; } inline void set_WellKnowObjectRef_7(int32_t value) { ___WellKnowObjectRef_7 = value; } inline static int32_t get_offset_of_U3CU3Ef__switchU24map21_8() { return static_cast<int32_t>(offsetof(ObjRef_t2141158884_StaticFields, ___U3CU3Ef__switchU24map21_8)); } inline Dictionary_2_t2736202052 * get_U3CU3Ef__switchU24map21_8() const { return ___U3CU3Ef__switchU24map21_8; } inline Dictionary_2_t2736202052 ** get_address_of_U3CU3Ef__switchU24map21_8() { return &___U3CU3Ef__switchU24map21_8; } inline void set_U3CU3Ef__switchU24map21_8(Dictionary_2_t2736202052 * value) { ___U3CU3Ef__switchU24map21_8 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__switchU24map21_8), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // OBJREF_T2141158884_H #ifndef INTERNALREMOTINGSERVICES_T949022444_H #define INTERNALREMOTINGSERVICES_T949022444_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.InternalRemotingServices struct InternalRemotingServices_t949022444 : public RuntimeObject { public: public: }; struct InternalRemotingServices_t949022444_StaticFields { public: // System.Collections.Hashtable System.Runtime.Remoting.InternalRemotingServices::_soapAttributes Hashtable_t1853889766 * ____soapAttributes_0; public: inline static int32_t get_offset_of__soapAttributes_0() { return static_cast<int32_t>(offsetof(InternalRemotingServices_t949022444_StaticFields, ____soapAttributes_0)); } inline Hashtable_t1853889766 * get__soapAttributes_0() const { return ____soapAttributes_0; } inline Hashtable_t1853889766 ** get_address_of__soapAttributes_0() { return &____soapAttributes_0; } inline void set__soapAttributes_0(Hashtable_t1853889766 * value) { ____soapAttributes_0 = value; Il2CppCodeGenWriteBarrier((&____soapAttributes_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INTERNALREMOTINGSERVICES_T949022444_H #ifndef HEADER_T549724581_H #define HEADER_T549724581_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.Header struct Header_t549724581 : public RuntimeObject { public: // System.String System.Runtime.Remoting.Messaging.Header::HeaderNamespace String_t* ___HeaderNamespace_0; // System.Boolean System.Runtime.Remoting.Messaging.Header::MustUnderstand bool ___MustUnderstand_1; // System.String System.Runtime.Remoting.Messaging.Header::Name String_t* ___Name_2; // System.Object System.Runtime.Remoting.Messaging.Header::Value RuntimeObject * ___Value_3; public: inline static int32_t get_offset_of_HeaderNamespace_0() { return static_cast<int32_t>(offsetof(Header_t549724581, ___HeaderNamespace_0)); } inline String_t* get_HeaderNamespace_0() const { return ___HeaderNamespace_0; } inline String_t** get_address_of_HeaderNamespace_0() { return &___HeaderNamespace_0; } inline void set_HeaderNamespace_0(String_t* value) { ___HeaderNamespace_0 = value; Il2CppCodeGenWriteBarrier((&___HeaderNamespace_0), value); } inline static int32_t get_offset_of_MustUnderstand_1() { return static_cast<int32_t>(offsetof(Header_t549724581, ___MustUnderstand_1)); } inline bool get_MustUnderstand_1() const { return ___MustUnderstand_1; } inline bool* get_address_of_MustUnderstand_1() { return &___MustUnderstand_1; } inline void set_MustUnderstand_1(bool value) { ___MustUnderstand_1 = value; } inline static int32_t get_offset_of_Name_2() { return static_cast<int32_t>(offsetof(Header_t549724581, ___Name_2)); } inline String_t* get_Name_2() const { return ___Name_2; } inline String_t** get_address_of_Name_2() { return &___Name_2; } inline void set_Name_2(String_t* value) { ___Name_2 = value; Il2CppCodeGenWriteBarrier((&___Name_2), value); } inline static int32_t get_offset_of_Value_3() { return static_cast<int32_t>(offsetof(Header_t549724581, ___Value_3)); } inline RuntimeObject * get_Value_3() const { return ___Value_3; } inline RuntimeObject ** get_address_of_Value_3() { return &___Value_3; } inline void set_Value_3(RuntimeObject * value) { ___Value_3 = value; Il2CppCodeGenWriteBarrier((&___Value_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // HEADER_T549724581_H #ifndef IDENTITY_T1873279371_H #define IDENTITY_T1873279371_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Identity struct Identity_t1873279371 : public RuntimeObject { public: // System.String System.Runtime.Remoting.Identity::_objectUri String_t* ____objectUri_0; // System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Identity::_channelSink RuntimeObject* ____channelSink_1; // System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Identity::_envoySink RuntimeObject* ____envoySink_2; // System.Runtime.Remoting.Contexts.DynamicPropertyCollection System.Runtime.Remoting.Identity::_clientDynamicProperties DynamicPropertyCollection_t652373272 * ____clientDynamicProperties_3; // System.Runtime.Remoting.Contexts.DynamicPropertyCollection System.Runtime.Remoting.Identity::_serverDynamicProperties DynamicPropertyCollection_t652373272 * ____serverDynamicProperties_4; // System.Runtime.Remoting.ObjRef System.Runtime.Remoting.Identity::_objRef ObjRef_t2141158884 * ____objRef_5; // System.Boolean System.Runtime.Remoting.Identity::_disposed bool ____disposed_6; public: inline static int32_t get_offset_of__objectUri_0() { return static_cast<int32_t>(offsetof(Identity_t1873279371, ____objectUri_0)); } inline String_t* get__objectUri_0() const { return ____objectUri_0; } inline String_t** get_address_of__objectUri_0() { return &____objectUri_0; } inline void set__objectUri_0(String_t* value) { ____objectUri_0 = value; Il2CppCodeGenWriteBarrier((&____objectUri_0), value); } inline static int32_t get_offset_of__channelSink_1() { return static_cast<int32_t>(offsetof(Identity_t1873279371, ____channelSink_1)); } inline RuntimeObject* get__channelSink_1() const { return ____channelSink_1; } inline RuntimeObject** get_address_of__channelSink_1() { return &____channelSink_1; } inline void set__channelSink_1(RuntimeObject* value) { ____channelSink_1 = value; Il2CppCodeGenWriteBarrier((&____channelSink_1), value); } inline static int32_t get_offset_of__envoySink_2() { return static_cast<int32_t>(offsetof(Identity_t1873279371, ____envoySink_2)); } inline RuntimeObject* get__envoySink_2() const { return ____envoySink_2; } inline RuntimeObject** get_address_of__envoySink_2() { return &____envoySink_2; } inline void set__envoySink_2(RuntimeObject* value) { ____envoySink_2 = value; Il2CppCodeGenWriteBarrier((&____envoySink_2), value); } inline static int32_t get_offset_of__clientDynamicProperties_3() { return static_cast<int32_t>(offsetof(Identity_t1873279371, ____clientDynamicProperties_3)); } inline DynamicPropertyCollection_t652373272 * get__clientDynamicProperties_3() const { return ____clientDynamicProperties_3; } inline DynamicPropertyCollection_t652373272 ** get_address_of__clientDynamicProperties_3() { return &____clientDynamicProperties_3; } inline void set__clientDynamicProperties_3(DynamicPropertyCollection_t652373272 * value) { ____clientDynamicProperties_3 = value; Il2CppCodeGenWriteBarrier((&____clientDynamicProperties_3), value); } inline static int32_t get_offset_of__serverDynamicProperties_4() { return static_cast<int32_t>(offsetof(Identity_t1873279371, ____serverDynamicProperties_4)); } inline DynamicPropertyCollection_t652373272 * get__serverDynamicProperties_4() const { return ____serverDynamicProperties_4; } inline DynamicPropertyCollection_t652373272 ** get_address_of__serverDynamicProperties_4() { return &____serverDynamicProperties_4; } inline void set__serverDynamicProperties_4(DynamicPropertyCollection_t652373272 * value) { ____serverDynamicProperties_4 = value; Il2CppCodeGenWriteBarrier((&____serverDynamicProperties_4), value); } inline static int32_t get_offset_of__objRef_5() { return static_cast<int32_t>(offsetof(Identity_t1873279371, ____objRef_5)); } inline ObjRef_t2141158884 * get__objRef_5() const { return ____objRef_5; } inline ObjRef_t2141158884 ** get_address_of__objRef_5() { return &____objRef_5; } inline void set__objRef_5(ObjRef_t2141158884 * value) { ____objRef_5 = value; Il2CppCodeGenWriteBarrier((&____objRef_5), value); } inline static int32_t get_offset_of__disposed_6() { return static_cast<int32_t>(offsetof(Identity_t1873279371, ____disposed_6)); } inline bool get__disposed_6() const { return ____disposed_6; } inline bool* get_address_of__disposed_6() { return &____disposed_6; } inline void set__disposed_6(bool value) { ____disposed_6 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // IDENTITY_T1873279371_H #ifndef ENVOYINFO_T22149680_H #define ENVOYINFO_T22149680_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.EnvoyInfo struct EnvoyInfo_t22149680 : public RuntimeObject { public: // System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.EnvoyInfo::envoySinks RuntimeObject* ___envoySinks_0; public: inline static int32_t get_offset_of_envoySinks_0() { return static_cast<int32_t>(offsetof(EnvoyInfo_t22149680, ___envoySinks_0)); } inline RuntimeObject* get_envoySinks_0() const { return ___envoySinks_0; } inline RuntimeObject** get_address_of_envoySinks_0() { return &___envoySinks_0; } inline void set_envoySinks_0(RuntimeObject* value) { ___envoySinks_0 = value; Il2CppCodeGenWriteBarrier((&___envoySinks_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ENVOYINFO_T22149680_H #ifndef LOGICALCALLCONTEXT_T3342013719_H #define LOGICALCALLCONTEXT_T3342013719_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.LogicalCallContext struct LogicalCallContext_t3342013719 : public RuntimeObject { public: // System.Collections.Hashtable System.Runtime.Remoting.Messaging.LogicalCallContext::_data Hashtable_t1853889766 * ____data_0; // System.Runtime.Remoting.Messaging.CallContextRemotingData System.Runtime.Remoting.Messaging.LogicalCallContext::_remotingData CallContextRemotingData_t2260963392 * ____remotingData_1; public: inline static int32_t get_offset_of__data_0() { return static_cast<int32_t>(offsetof(LogicalCallContext_t3342013719, ____data_0)); } inline Hashtable_t1853889766 * get__data_0() const { return ____data_0; } inline Hashtable_t1853889766 ** get_address_of__data_0() { return &____data_0; } inline void set__data_0(Hashtable_t1853889766 * value) { ____data_0 = value; Il2CppCodeGenWriteBarrier((&____data_0), value); } inline static int32_t get_offset_of__remotingData_1() { return static_cast<int32_t>(offsetof(LogicalCallContext_t3342013719, ____remotingData_1)); } inline CallContextRemotingData_t2260963392 * get__remotingData_1() const { return ____remotingData_1; } inline CallContextRemotingData_t2260963392 ** get_address_of__remotingData_1() { return &____remotingData_1; } inline void set__remotingData_1(CallContextRemotingData_t2260963392 * value) { ____remotingData_1 = value; Il2CppCodeGenWriteBarrier((&____remotingData_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LOGICALCALLCONTEXT_T3342013719_H #ifndef CALLCONTEXTREMOTINGDATA_T2260963392_H #define CALLCONTEXTREMOTINGDATA_T2260963392_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.CallContextRemotingData struct CallContextRemotingData_t2260963392 : public RuntimeObject { public: // System.String System.Runtime.Remoting.Messaging.CallContextRemotingData::_logicalCallID String_t* ____logicalCallID_0; public: inline static int32_t get_offset_of__logicalCallID_0() { return static_cast<int32_t>(offsetof(CallContextRemotingData_t2260963392, ____logicalCallID_0)); } inline String_t* get__logicalCallID_0() const { return ____logicalCallID_0; } inline String_t** get_address_of__logicalCallID_0() { return &____logicalCallID_0; } inline void set__logicalCallID_0(String_t* value) { ____logicalCallID_0 = value; Il2CppCodeGenWriteBarrier((&____logicalCallID_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CALLCONTEXTREMOTINGDATA_T2260963392_H #ifndef ENVOYTERMINATORSINK_T3654193516_H #define ENVOYTERMINATORSINK_T3654193516_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.EnvoyTerminatorSink struct EnvoyTerminatorSink_t3654193516 : public RuntimeObject { public: public: }; struct EnvoyTerminatorSink_t3654193516_StaticFields { public: // System.Runtime.Remoting.Messaging.EnvoyTerminatorSink System.Runtime.Remoting.Messaging.EnvoyTerminatorSink::Instance EnvoyTerminatorSink_t3654193516 * ___Instance_0; public: inline static int32_t get_offset_of_Instance_0() { return static_cast<int32_t>(offsetof(EnvoyTerminatorSink_t3654193516_StaticFields, ___Instance_0)); } inline EnvoyTerminatorSink_t3654193516 * get_Instance_0() const { return ___Instance_0; } inline EnvoyTerminatorSink_t3654193516 ** get_address_of_Instance_0() { return &___Instance_0; } inline void set_Instance_0(EnvoyTerminatorSink_t3654193516 * value) { ___Instance_0 = value; Il2CppCodeGenWriteBarrier((&___Instance_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ENVOYTERMINATORSINK_T3654193516_H #ifndef TYPEINFO_T3108865556_H #define TYPEINFO_T3108865556_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.TypeInfo struct TypeInfo_t3108865556 : public RuntimeObject { public: // System.String System.Runtime.Remoting.TypeInfo::serverType String_t* ___serverType_0; // System.String[] System.Runtime.Remoting.TypeInfo::serverHierarchy StringU5BU5D_t1281789340* ___serverHierarchy_1; // System.String[] System.Runtime.Remoting.TypeInfo::interfacesImplemented StringU5BU5D_t1281789340* ___interfacesImplemented_2; public: inline static int32_t get_offset_of_serverType_0() { return static_cast<int32_t>(offsetof(TypeInfo_t3108865556, ___serverType_0)); } inline String_t* get_serverType_0() const { return ___serverType_0; } inline String_t** get_address_of_serverType_0() { return &___serverType_0; } inline void set_serverType_0(String_t* value) { ___serverType_0 = value; Il2CppCodeGenWriteBarrier((&___serverType_0), value); } inline static int32_t get_offset_of_serverHierarchy_1() { return static_cast<int32_t>(offsetof(TypeInfo_t3108865556, ___serverHierarchy_1)); } inline StringU5BU5D_t1281789340* get_serverHierarchy_1() const { return ___serverHierarchy_1; } inline StringU5BU5D_t1281789340** get_address_of_serverHierarchy_1() { return &___serverHierarchy_1; } inline void set_serverHierarchy_1(StringU5BU5D_t1281789340* value) { ___serverHierarchy_1 = value; Il2CppCodeGenWriteBarrier((&___serverHierarchy_1), value); } inline static int32_t get_offset_of_interfacesImplemented_2() { return static_cast<int32_t>(offsetof(TypeInfo_t3108865556, ___interfacesImplemented_2)); } inline StringU5BU5D_t1281789340* get_interfacesImplemented_2() const { return ___interfacesImplemented_2; } inline StringU5BU5D_t1281789340** get_address_of_interfacesImplemented_2() { return &___interfacesImplemented_2; } inline void set_interfacesImplemented_2(StringU5BU5D_t1281789340* value) { ___interfacesImplemented_2 = value; Il2CppCodeGenWriteBarrier((&___interfacesImplemented_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // TYPEINFO_T3108865556_H #ifndef TYPEENTRY_T3903395172_H #define TYPEENTRY_T3903395172_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.TypeEntry struct TypeEntry_t3903395172 : public RuntimeObject { public: // System.String System.Runtime.Remoting.TypeEntry::assembly_name String_t* ___assembly_name_0; // System.String System.Runtime.Remoting.TypeEntry::type_name String_t* ___type_name_1; public: inline static int32_t get_offset_of_assembly_name_0() { return static_cast<int32_t>(offsetof(TypeEntry_t3903395172, ___assembly_name_0)); } inline String_t* get_assembly_name_0() const { return ___assembly_name_0; } inline String_t** get_address_of_assembly_name_0() { return &___assembly_name_0; } inline void set_assembly_name_0(String_t* value) { ___assembly_name_0 = value; Il2CppCodeGenWriteBarrier((&___assembly_name_0), value); } inline static int32_t get_offset_of_type_name_1() { return static_cast<int32_t>(offsetof(TypeEntry_t3903395172, ___type_name_1)); } inline String_t* get_type_name_1() const { return ___type_name_1; } inline String_t** get_address_of_type_name_1() { return &___type_name_1; } inline void set_type_name_1(String_t* value) { ___type_name_1 = value; Il2CppCodeGenWriteBarrier((&___type_name_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // TYPEENTRY_T3903395172_H #ifndef TYPEINFO_T3204178358_H #define TYPEINFO_T3204178358_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.SoapServices/TypeInfo struct TypeInfo_t3204178358 : public RuntimeObject { public: // System.Collections.Hashtable System.Runtime.Remoting.SoapServices/TypeInfo::Attributes Hashtable_t1853889766 * ___Attributes_0; // System.Collections.Hashtable System.Runtime.Remoting.SoapServices/TypeInfo::Elements Hashtable_t1853889766 * ___Elements_1; public: inline static int32_t get_offset_of_Attributes_0() { return static_cast<int32_t>(offsetof(TypeInfo_t3204178358, ___Attributes_0)); } inline Hashtable_t1853889766 * get_Attributes_0() const { return ___Attributes_0; } inline Hashtable_t1853889766 ** get_address_of_Attributes_0() { return &___Attributes_0; } inline void set_Attributes_0(Hashtable_t1853889766 * value) { ___Attributes_0 = value; Il2CppCodeGenWriteBarrier((&___Attributes_0), value); } inline static int32_t get_offset_of_Elements_1() { return static_cast<int32_t>(offsetof(TypeInfo_t3204178358, ___Elements_1)); } inline Hashtable_t1853889766 * get_Elements_1() const { return ___Elements_1; } inline Hashtable_t1853889766 ** get_address_of_Elements_1() { return &___Elements_1; } inline void set_Elements_1(Hashtable_t1853889766 * value) { ___Elements_1 = value; Il2CppCodeGenWriteBarrier((&___Elements_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // TYPEINFO_T3204178358_H #ifndef SOAPSERVICES_T133988723_H #define SOAPSERVICES_T133988723_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.SoapServices struct SoapServices_t133988723 : public RuntimeObject { public: public: }; struct SoapServices_t133988723_StaticFields { public: // System.Collections.Hashtable System.Runtime.Remoting.SoapServices::_xmlTypes Hashtable_t1853889766 * ____xmlTypes_0; // System.Collections.Hashtable System.Runtime.Remoting.SoapServices::_xmlElements Hashtable_t1853889766 * ____xmlElements_1; // System.Collections.Hashtable System.Runtime.Remoting.SoapServices::_soapActions Hashtable_t1853889766 * ____soapActions_2; // System.Collections.Hashtable System.Runtime.Remoting.SoapServices::_soapActionsMethods Hashtable_t1853889766 * ____soapActionsMethods_3; // System.Collections.Hashtable System.Runtime.Remoting.SoapServices::_typeInfos Hashtable_t1853889766 * ____typeInfos_4; public: inline static int32_t get_offset_of__xmlTypes_0() { return static_cast<int32_t>(offsetof(SoapServices_t133988723_StaticFields, ____xmlTypes_0)); } inline Hashtable_t1853889766 * get__xmlTypes_0() const { return ____xmlTypes_0; } inline Hashtable_t1853889766 ** get_address_of__xmlTypes_0() { return &____xmlTypes_0; } inline void set__xmlTypes_0(Hashtable_t1853889766 * value) { ____xmlTypes_0 = value; Il2CppCodeGenWriteBarrier((&____xmlTypes_0), value); } inline static int32_t get_offset_of__xmlElements_1() { return static_cast<int32_t>(offsetof(SoapServices_t133988723_StaticFields, ____xmlElements_1)); } inline Hashtable_t1853889766 * get__xmlElements_1() const { return ____xmlElements_1; } inline Hashtable_t1853889766 ** get_address_of__xmlElements_1() { return &____xmlElements_1; } inline void set__xmlElements_1(Hashtable_t1853889766 * value) { ____xmlElements_1 = value; Il2CppCodeGenWriteBarrier((&____xmlElements_1), value); } inline static int32_t get_offset_of__soapActions_2() { return static_cast<int32_t>(offsetof(SoapServices_t133988723_StaticFields, ____soapActions_2)); } inline Hashtable_t1853889766 * get__soapActions_2() const { return ____soapActions_2; } inline Hashtable_t1853889766 ** get_address_of__soapActions_2() { return &____soapActions_2; } inline void set__soapActions_2(Hashtable_t1853889766 * value) { ____soapActions_2 = value; Il2CppCodeGenWriteBarrier((&____soapActions_2), value); } inline static int32_t get_offset_of__soapActionsMethods_3() { return static_cast<int32_t>(offsetof(SoapServices_t133988723_StaticFields, ____soapActionsMethods_3)); } inline Hashtable_t1853889766 * get__soapActionsMethods_3() const { return ____soapActionsMethods_3; } inline Hashtable_t1853889766 ** get_address_of__soapActionsMethods_3() { return &____soapActionsMethods_3; } inline void set__soapActionsMethods_3(Hashtable_t1853889766 * value) { ____soapActionsMethods_3 = value; Il2CppCodeGenWriteBarrier((&____soapActionsMethods_3), value); } inline static int32_t get_offset_of__typeInfos_4() { return static_cast<int32_t>(offsetof(SoapServices_t133988723_StaticFields, ____typeInfos_4)); } inline Hashtable_t1853889766 * get__typeInfos_4() const { return ____typeInfos_4; } inline Hashtable_t1853889766 ** get_address_of__typeInfos_4() { return &____typeInfos_4; } inline void set__typeInfos_4(Hashtable_t1853889766 * value) { ____typeInfos_4 = value; Il2CppCodeGenWriteBarrier((&____typeInfos_4), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SOAPSERVICES_T133988723_H #ifndef CLIENTCONTEXTTERMINATORSINK_T4064115021_H #define CLIENTCONTEXTTERMINATORSINK_T4064115021_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.ClientContextTerminatorSink struct ClientContextTerminatorSink_t4064115021 : public RuntimeObject { public: // System.Runtime.Remoting.Contexts.Context System.Runtime.Remoting.Messaging.ClientContextTerminatorSink::_context Context_t3285446944 * ____context_0; public: inline static int32_t get_offset_of__context_0() { return static_cast<int32_t>(offsetof(ClientContextTerminatorSink_t4064115021, ____context_0)); } inline Context_t3285446944 * get__context_0() const { return ____context_0; } inline Context_t3285446944 ** get_address_of__context_0() { return &____context_0; } inline void set__context_0(Context_t3285446944 * value) { ____context_0 = value; Il2CppCodeGenWriteBarrier((&____context_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CLIENTCONTEXTTERMINATORSINK_T4064115021_H #ifndef EXCEPTION_T_H #define EXCEPTION_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Exception struct Exception_t : public RuntimeObject { public: // System.IntPtr[] System.Exception::trace_ips IntPtrU5BU5D_t4013366056* ___trace_ips_0; // System.Exception System.Exception::inner_exception Exception_t * ___inner_exception_1; // System.String System.Exception::message String_t* ___message_2; // System.String System.Exception::help_link String_t* ___help_link_3; // System.String System.Exception::class_name String_t* ___class_name_4; // System.String System.Exception::stack_trace String_t* ___stack_trace_5; // System.String System.Exception::_remoteStackTraceString String_t* ____remoteStackTraceString_6; // System.Int32 System.Exception::remote_stack_index int32_t ___remote_stack_index_7; // System.Int32 System.Exception::hresult int32_t ___hresult_8; // System.String System.Exception::source String_t* ___source_9; // System.Collections.IDictionary System.Exception::_data RuntimeObject* ____data_10; public: inline static int32_t get_offset_of_trace_ips_0() { return static_cast<int32_t>(offsetof(Exception_t, ___trace_ips_0)); } inline IntPtrU5BU5D_t4013366056* get_trace_ips_0() const { return ___trace_ips_0; } inline IntPtrU5BU5D_t4013366056** get_address_of_trace_ips_0() { return &___trace_ips_0; } inline void set_trace_ips_0(IntPtrU5BU5D_t4013366056* value) { ___trace_ips_0 = value; Il2CppCodeGenWriteBarrier((&___trace_ips_0), value); } inline static int32_t get_offset_of_inner_exception_1() { return static_cast<int32_t>(offsetof(Exception_t, ___inner_exception_1)); } inline Exception_t * get_inner_exception_1() const { return ___inner_exception_1; } inline Exception_t ** get_address_of_inner_exception_1() { return &___inner_exception_1; } inline void set_inner_exception_1(Exception_t * value) { ___inner_exception_1 = value; Il2CppCodeGenWriteBarrier((&___inner_exception_1), value); } inline static int32_t get_offset_of_message_2() { return static_cast<int32_t>(offsetof(Exception_t, ___message_2)); } inline String_t* get_message_2() const { return ___message_2; } inline String_t** get_address_of_message_2() { return &___message_2; } inline void set_message_2(String_t* value) { ___message_2 = value; Il2CppCodeGenWriteBarrier((&___message_2), value); } inline static int32_t get_offset_of_help_link_3() { return static_cast<int32_t>(offsetof(Exception_t, ___help_link_3)); } inline String_t* get_help_link_3() const { return ___help_link_3; } inline String_t** get_address_of_help_link_3() { return &___help_link_3; } inline void set_help_link_3(String_t* value) { ___help_link_3 = value; Il2CppCodeGenWriteBarrier((&___help_link_3), value); } inline static int32_t get_offset_of_class_name_4() { return static_cast<int32_t>(offsetof(Exception_t, ___class_name_4)); } inline String_t* get_class_name_4() const { return ___class_name_4; } inline String_t** get_address_of_class_name_4() { return &___class_name_4; } inline void set_class_name_4(String_t* value) { ___class_name_4 = value; Il2CppCodeGenWriteBarrier((&___class_name_4), value); } inline static int32_t get_offset_of_stack_trace_5() { return static_cast<int32_t>(offsetof(Exception_t, ___stack_trace_5)); } inline String_t* get_stack_trace_5() const { return ___stack_trace_5; } inline String_t** get_address_of_stack_trace_5() { return &___stack_trace_5; } inline void set_stack_trace_5(String_t* value) { ___stack_trace_5 = value; Il2CppCodeGenWriteBarrier((&___stack_trace_5), value); } inline static int32_t get_offset_of__remoteStackTraceString_6() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackTraceString_6)); } inline String_t* get__remoteStackTraceString_6() const { return ____remoteStackTraceString_6; } inline String_t** get_address_of__remoteStackTraceString_6() { return &____remoteStackTraceString_6; } inline void set__remoteStackTraceString_6(String_t* value) { ____remoteStackTraceString_6 = value; Il2CppCodeGenWriteBarrier((&____remoteStackTraceString_6), value); } inline static int32_t get_offset_of_remote_stack_index_7() { return static_cast<int32_t>(offsetof(Exception_t, ___remote_stack_index_7)); } inline int32_t get_remote_stack_index_7() const { return ___remote_stack_index_7; } inline int32_t* get_address_of_remote_stack_index_7() { return &___remote_stack_index_7; } inline void set_remote_stack_index_7(int32_t value) { ___remote_stack_index_7 = value; } inline static int32_t get_offset_of_hresult_8() { return static_cast<int32_t>(offsetof(Exception_t, ___hresult_8)); } inline int32_t get_hresult_8() const { return ___hresult_8; } inline int32_t* get_address_of_hresult_8() { return &___hresult_8; } inline void set_hresult_8(int32_t value) { ___hresult_8 = value; } inline static int32_t get_offset_of_source_9() { return static_cast<int32_t>(offsetof(Exception_t, ___source_9)); } inline String_t* get_source_9() const { return ___source_9; } inline String_t** get_address_of_source_9() { return &___source_9; } inline void set_source_9(String_t* value) { ___source_9 = value; Il2CppCodeGenWriteBarrier((&___source_9), value); } inline static int32_t get_offset_of__data_10() { return static_cast<int32_t>(offsetof(Exception_t, ____data_10)); } inline RuntimeObject* get__data_10() const { return ____data_10; } inline RuntimeObject** get_address_of__data_10() { return &____data_10; } inline void set__data_10(RuntimeObject* value) { ____data_10 = value; Il2CppCodeGenWriteBarrier((&____data_10), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // EXCEPTION_T_H #ifndef ATTRIBUTE_T861562559_H #define ATTRIBUTE_T861562559_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Attribute struct Attribute_t861562559 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ATTRIBUTE_T861562559_H #ifndef VALUETYPE_T3640485471_H #define VALUETYPE_T3640485471_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ValueType struct ValueType_t3640485471 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.ValueType struct ValueType_t3640485471_marshaled_pinvoke { }; // Native definition for COM marshalling of System.ValueType struct ValueType_t3640485471_marshaled_com { }; #endif // VALUETYPE_T3640485471_H #ifndef CONSTRUCTIONCALL_T4011594745_H #define CONSTRUCTIONCALL_T4011594745_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.ConstructionCall struct ConstructionCall_t4011594745 : public MethodCall_t861078140 { public: // System.Runtime.Remoting.Activation.IActivator System.Runtime.Remoting.Messaging.ConstructionCall::_activator RuntimeObject* ____activator_11; // System.Object[] System.Runtime.Remoting.Messaging.ConstructionCall::_activationAttributes ObjectU5BU5D_t2843939325* ____activationAttributes_12; // System.Collections.IList System.Runtime.Remoting.Messaging.ConstructionCall::_contextProperties RuntimeObject* ____contextProperties_13; // System.Type System.Runtime.Remoting.Messaging.ConstructionCall::_activationType Type_t * ____activationType_14; // System.String System.Runtime.Remoting.Messaging.ConstructionCall::_activationTypeName String_t* ____activationTypeName_15; // System.Boolean System.Runtime.Remoting.Messaging.ConstructionCall::_isContextOk bool ____isContextOk_16; public: inline static int32_t get_offset_of__activator_11() { return static_cast<int32_t>(offsetof(ConstructionCall_t4011594745, ____activator_11)); } inline RuntimeObject* get__activator_11() const { return ____activator_11; } inline RuntimeObject** get_address_of__activator_11() { return &____activator_11; } inline void set__activator_11(RuntimeObject* value) { ____activator_11 = value; Il2CppCodeGenWriteBarrier((&____activator_11), value); } inline static int32_t get_offset_of__activationAttributes_12() { return static_cast<int32_t>(offsetof(ConstructionCall_t4011594745, ____activationAttributes_12)); } inline ObjectU5BU5D_t2843939325* get__activationAttributes_12() const { return ____activationAttributes_12; } inline ObjectU5BU5D_t2843939325** get_address_of__activationAttributes_12() { return &____activationAttributes_12; } inline void set__activationAttributes_12(ObjectU5BU5D_t2843939325* value) { ____activationAttributes_12 = value; Il2CppCodeGenWriteBarrier((&____activationAttributes_12), value); } inline static int32_t get_offset_of__contextProperties_13() { return static_cast<int32_t>(offsetof(ConstructionCall_t4011594745, ____contextProperties_13)); } inline RuntimeObject* get__contextProperties_13() const { return ____contextProperties_13; } inline RuntimeObject** get_address_of__contextProperties_13() { return &____contextProperties_13; } inline void set__contextProperties_13(RuntimeObject* value) { ____contextProperties_13 = value; Il2CppCodeGenWriteBarrier((&____contextProperties_13), value); } inline static int32_t get_offset_of__activationType_14() { return static_cast<int32_t>(offsetof(ConstructionCall_t4011594745, ____activationType_14)); } inline Type_t * get__activationType_14() const { return ____activationType_14; } inline Type_t ** get_address_of__activationType_14() { return &____activationType_14; } inline void set__activationType_14(Type_t * value) { ____activationType_14 = value; Il2CppCodeGenWriteBarrier((&____activationType_14), value); } inline static int32_t get_offset_of__activationTypeName_15() { return static_cast<int32_t>(offsetof(ConstructionCall_t4011594745, ____activationTypeName_15)); } inline String_t* get__activationTypeName_15() const { return ____activationTypeName_15; } inline String_t** get_address_of__activationTypeName_15() { return &____activationTypeName_15; } inline void set__activationTypeName_15(String_t* value) { ____activationTypeName_15 = value; Il2CppCodeGenWriteBarrier((&____activationTypeName_15), value); } inline static int32_t get_offset_of__isContextOk_16() { return static_cast<int32_t>(offsetof(ConstructionCall_t4011594745, ____isContextOk_16)); } inline bool get__isContextOk_16() const { return ____isContextOk_16; } inline bool* get_address_of__isContextOk_16() { return &____isContextOk_16; } inline void set__isContextOk_16(bool value) { ____isContextOk_16 = value; } }; struct ConstructionCall_t4011594745_StaticFields { public: // System.Collections.Generic.Dictionary`2<System.String,System.Int32> System.Runtime.Remoting.Messaging.ConstructionCall::<>f__switch$map25 Dictionary_2_t2736202052 * ___U3CU3Ef__switchU24map25_17; public: inline static int32_t get_offset_of_U3CU3Ef__switchU24map25_17() { return static_cast<int32_t>(offsetof(ConstructionCall_t4011594745_StaticFields, ___U3CU3Ef__switchU24map25_17)); } inline Dictionary_2_t2736202052 * get_U3CU3Ef__switchU24map25_17() const { return ___U3CU3Ef__switchU24map25_17; } inline Dictionary_2_t2736202052 ** get_address_of_U3CU3Ef__switchU24map25_17() { return &___U3CU3Ef__switchU24map25_17; } inline void set_U3CU3Ef__switchU24map25_17(Dictionary_2_t2736202052 * value) { ___U3CU3Ef__switchU24map25_17 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__switchU24map25_17), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONSTRUCTIONCALL_T4011594745_H #ifndef METHODCALLDICTIONARY_T605791082_H #define METHODCALLDICTIONARY_T605791082_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.MethodCallDictionary struct MethodCallDictionary_t605791082 : public MethodDictionary_t207894204 { public: public: }; struct MethodCallDictionary_t605791082_StaticFields { public: // System.String[] System.Runtime.Remoting.Messaging.MethodCallDictionary::InternalKeys StringU5BU5D_t1281789340* ___InternalKeys_6; public: inline static int32_t get_offset_of_InternalKeys_6() { return static_cast<int32_t>(offsetof(MethodCallDictionary_t605791082_StaticFields, ___InternalKeys_6)); } inline StringU5BU5D_t1281789340* get_InternalKeys_6() const { return ___InternalKeys_6; } inline StringU5BU5D_t1281789340** get_address_of_InternalKeys_6() { return &___InternalKeys_6; } inline void set_InternalKeys_6(StringU5BU5D_t1281789340* value) { ___InternalKeys_6 = value; Il2CppCodeGenWriteBarrier((&___InternalKeys_6), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // METHODCALLDICTIONARY_T605791082_H #ifndef ENUM_T4135868527_H #define ENUM_T4135868527_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Enum struct Enum_t4135868527 : public ValueType_t3640485471 { public: public: }; struct Enum_t4135868527_StaticFields { public: // System.Char[] System.Enum::split_char CharU5BU5D_t3528271667* ___split_char_0; public: inline static int32_t get_offset_of_split_char_0() { return static_cast<int32_t>(offsetof(Enum_t4135868527_StaticFields, ___split_char_0)); } inline CharU5BU5D_t3528271667* get_split_char_0() const { return ___split_char_0; } inline CharU5BU5D_t3528271667** get_address_of_split_char_0() { return &___split_char_0; } inline void set_split_char_0(CharU5BU5D_t3528271667* value) { ___split_char_0 = value; Il2CppCodeGenWriteBarrier((&___split_char_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.Enum struct Enum_t4135868527_marshaled_pinvoke { }; // Native definition for COM marshalling of System.Enum struct Enum_t4135868527_marshaled_com { }; #endif // ENUM_T4135868527_H #ifndef CONSTRUCTIONCALLDICTIONARY_T686578562_H #define CONSTRUCTIONCALLDICTIONARY_T686578562_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.ConstructionCallDictionary struct ConstructionCallDictionary_t686578562 : public MethodDictionary_t207894204 { public: public: }; struct ConstructionCallDictionary_t686578562_StaticFields { public: // System.String[] System.Runtime.Remoting.Messaging.ConstructionCallDictionary::InternalKeys StringU5BU5D_t1281789340* ___InternalKeys_6; // System.Collections.Generic.Dictionary`2<System.String,System.Int32> System.Runtime.Remoting.Messaging.ConstructionCallDictionary::<>f__switch$map28 Dictionary_2_t2736202052 * ___U3CU3Ef__switchU24map28_7; // System.Collections.Generic.Dictionary`2<System.String,System.Int32> System.Runtime.Remoting.Messaging.ConstructionCallDictionary::<>f__switch$map29 Dictionary_2_t2736202052 * ___U3CU3Ef__switchU24map29_8; public: inline static int32_t get_offset_of_InternalKeys_6() { return static_cast<int32_t>(offsetof(ConstructionCallDictionary_t686578562_StaticFields, ___InternalKeys_6)); } inline StringU5BU5D_t1281789340* get_InternalKeys_6() const { return ___InternalKeys_6; } inline StringU5BU5D_t1281789340** get_address_of_InternalKeys_6() { return &___InternalKeys_6; } inline void set_InternalKeys_6(StringU5BU5D_t1281789340* value) { ___InternalKeys_6 = value; Il2CppCodeGenWriteBarrier((&___InternalKeys_6), value); } inline static int32_t get_offset_of_U3CU3Ef__switchU24map28_7() { return static_cast<int32_t>(offsetof(ConstructionCallDictionary_t686578562_StaticFields, ___U3CU3Ef__switchU24map28_7)); } inline Dictionary_2_t2736202052 * get_U3CU3Ef__switchU24map28_7() const { return ___U3CU3Ef__switchU24map28_7; } inline Dictionary_2_t2736202052 ** get_address_of_U3CU3Ef__switchU24map28_7() { return &___U3CU3Ef__switchU24map28_7; } inline void set_U3CU3Ef__switchU24map28_7(Dictionary_2_t2736202052 * value) { ___U3CU3Ef__switchU24map28_7 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__switchU24map28_7), value); } inline static int32_t get_offset_of_U3CU3Ef__switchU24map29_8() { return static_cast<int32_t>(offsetof(ConstructionCallDictionary_t686578562_StaticFields, ___U3CU3Ef__switchU24map29_8)); } inline Dictionary_2_t2736202052 * get_U3CU3Ef__switchU24map29_8() const { return ___U3CU3Ef__switchU24map29_8; } inline Dictionary_2_t2736202052 ** get_address_of_U3CU3Ef__switchU24map29_8() { return &___U3CU3Ef__switchU24map29_8; } inline void set_U3CU3Ef__switchU24map29_8(Dictionary_2_t2736202052 * value) { ___U3CU3Ef__switchU24map29_8 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__switchU24map29_8), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONSTRUCTIONCALLDICTIONARY_T686578562_H #ifndef METHODRETURNDICTIONARY_T2551046119_H #define METHODRETURNDICTIONARY_T2551046119_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.MethodReturnDictionary struct MethodReturnDictionary_t2551046119 : public MethodDictionary_t207894204 { public: public: }; struct MethodReturnDictionary_t2551046119_StaticFields { public: // System.String[] System.Runtime.Remoting.Messaging.MethodReturnDictionary::InternalReturnKeys StringU5BU5D_t1281789340* ___InternalReturnKeys_6; // System.String[] System.Runtime.Remoting.Messaging.MethodReturnDictionary::InternalExceptionKeys StringU5BU5D_t1281789340* ___InternalExceptionKeys_7; public: inline static int32_t get_offset_of_InternalReturnKeys_6() { return static_cast<int32_t>(offsetof(MethodReturnDictionary_t2551046119_StaticFields, ___InternalReturnKeys_6)); } inline StringU5BU5D_t1281789340* get_InternalReturnKeys_6() const { return ___InternalReturnKeys_6; } inline StringU5BU5D_t1281789340** get_address_of_InternalReturnKeys_6() { return &___InternalReturnKeys_6; } inline void set_InternalReturnKeys_6(StringU5BU5D_t1281789340* value) { ___InternalReturnKeys_6 = value; Il2CppCodeGenWriteBarrier((&___InternalReturnKeys_6), value); } inline static int32_t get_offset_of_InternalExceptionKeys_7() { return static_cast<int32_t>(offsetof(MethodReturnDictionary_t2551046119_StaticFields, ___InternalExceptionKeys_7)); } inline StringU5BU5D_t1281789340* get_InternalExceptionKeys_7() const { return ___InternalExceptionKeys_7; } inline StringU5BU5D_t1281789340** get_address_of_InternalExceptionKeys_7() { return &___InternalExceptionKeys_7; } inline void set_InternalExceptionKeys_7(StringU5BU5D_t1281789340* value) { ___InternalExceptionKeys_7 = value; Il2CppCodeGenWriteBarrier((&___InternalExceptionKeys_7), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // METHODRETURNDICTIONARY_T2551046119_H #ifndef INTPTR_T_H #define INTPTR_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // 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; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INTPTR_T_H #ifndef SERVERIDENTITY_T2342208608_H #define SERVERIDENTITY_T2342208608_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.ServerIdentity struct ServerIdentity_t2342208608 : public Identity_t1873279371 { public: // System.Type System.Runtime.Remoting.ServerIdentity::_objectType Type_t * ____objectType_7; // System.MarshalByRefObject System.Runtime.Remoting.ServerIdentity::_serverObject MarshalByRefObject_t2760389100 * ____serverObject_8; // System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.ServerIdentity::_serverSink RuntimeObject* ____serverSink_9; // System.Runtime.Remoting.Contexts.Context System.Runtime.Remoting.ServerIdentity::_context Context_t3285446944 * ____context_10; // System.Runtime.Remoting.Lifetime.Lease System.Runtime.Remoting.ServerIdentity::_lease Lease_t4051722892 * ____lease_11; public: inline static int32_t get_offset_of__objectType_7() { return static_cast<int32_t>(offsetof(ServerIdentity_t2342208608, ____objectType_7)); } inline Type_t * get__objectType_7() const { return ____objectType_7; } inline Type_t ** get_address_of__objectType_7() { return &____objectType_7; } inline void set__objectType_7(Type_t * value) { ____objectType_7 = value; Il2CppCodeGenWriteBarrier((&____objectType_7), value); } inline static int32_t get_offset_of__serverObject_8() { return static_cast<int32_t>(offsetof(ServerIdentity_t2342208608, ____serverObject_8)); } inline MarshalByRefObject_t2760389100 * get__serverObject_8() const { return ____serverObject_8; } inline MarshalByRefObject_t2760389100 ** get_address_of__serverObject_8() { return &____serverObject_8; } inline void set__serverObject_8(MarshalByRefObject_t2760389100 * value) { ____serverObject_8 = value; Il2CppCodeGenWriteBarrier((&____serverObject_8), value); } inline static int32_t get_offset_of__serverSink_9() { return static_cast<int32_t>(offsetof(ServerIdentity_t2342208608, ____serverSink_9)); } inline RuntimeObject* get__serverSink_9() const { return ____serverSink_9; } inline RuntimeObject** get_address_of__serverSink_9() { return &____serverSink_9; } inline void set__serverSink_9(RuntimeObject* value) { ____serverSink_9 = value; Il2CppCodeGenWriteBarrier((&____serverSink_9), value); } inline static int32_t get_offset_of__context_10() { return static_cast<int32_t>(offsetof(ServerIdentity_t2342208608, ____context_10)); } inline Context_t3285446944 * get__context_10() const { return ____context_10; } inline Context_t3285446944 ** get_address_of__context_10() { return &____context_10; } inline void set__context_10(Context_t3285446944 * value) { ____context_10 = value; Il2CppCodeGenWriteBarrier((&____context_10), value); } inline static int32_t get_offset_of__lease_11() { return static_cast<int32_t>(offsetof(ServerIdentity_t2342208608, ____lease_11)); } inline Lease_t4051722892 * get__lease_11() const { return ____lease_11; } inline Lease_t4051722892 ** get_address_of__lease_11() { return &____lease_11; } inline void set__lease_11(Lease_t4051722892 * value) { ____lease_11 = value; Il2CppCodeGenWriteBarrier((&____lease_11), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SERVERIDENTITY_T2342208608_H #ifndef FORMATTERDATA_T100315018_H #define FORMATTERDATA_T100315018_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.FormatterData struct FormatterData_t100315018 : public ProviderData_t3272123318 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // FORMATTERDATA_T100315018_H #ifndef CLIENTIDENTITY_T1428046844_H #define CLIENTIDENTITY_T1428046844_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.ClientIdentity struct ClientIdentity_t1428046844 : public Identity_t1873279371 { public: // System.WeakReference System.Runtime.Remoting.ClientIdentity::_proxyReference WeakReference_t1334886716 * ____proxyReference_7; public: inline static int32_t get_offset_of__proxyReference_7() { return static_cast<int32_t>(offsetof(ClientIdentity_t1428046844, ____proxyReference_7)); } inline WeakReference_t1334886716 * get__proxyReference_7() const { return ____proxyReference_7; } inline WeakReference_t1334886716 ** get_address_of__proxyReference_7() { return &____proxyReference_7; } inline void set__proxyReference_7(WeakReference_t1334886716 * value) { ____proxyReference_7 = value; Il2CppCodeGenWriteBarrier((&____proxyReference_7), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CLIENTIDENTITY_T1428046844_H #ifndef ACTIVATEDSERVICETYPEENTRY_T3761108592_H #define ACTIVATEDSERVICETYPEENTRY_T3761108592_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.ActivatedServiceTypeEntry struct ActivatedServiceTypeEntry_t3761108592 : public TypeEntry_t3903395172 { public: // System.Type System.Runtime.Remoting.ActivatedServiceTypeEntry::obj_type Type_t * ___obj_type_2; public: inline static int32_t get_offset_of_obj_type_2() { return static_cast<int32_t>(offsetof(ActivatedServiceTypeEntry_t3761108592, ___obj_type_2)); } inline Type_t * get_obj_type_2() const { return ___obj_type_2; } inline Type_t ** get_address_of_obj_type_2() { return &___obj_type_2; } inline void set_obj_type_2(Type_t * value) { ___obj_type_2 = value; Il2CppCodeGenWriteBarrier((&___obj_type_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ACTIVATEDSERVICETYPEENTRY_T3761108592_H #ifndef ACTIVATEDCLIENTTYPEENTRY_T761233661_H #define ACTIVATEDCLIENTTYPEENTRY_T761233661_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.ActivatedClientTypeEntry struct ActivatedClientTypeEntry_t761233661 : public TypeEntry_t3903395172 { public: // System.String System.Runtime.Remoting.ActivatedClientTypeEntry::applicationUrl String_t* ___applicationUrl_2; // System.Type System.Runtime.Remoting.ActivatedClientTypeEntry::obj_type Type_t * ___obj_type_3; public: inline static int32_t get_offset_of_applicationUrl_2() { return static_cast<int32_t>(offsetof(ActivatedClientTypeEntry_t761233661, ___applicationUrl_2)); } inline String_t* get_applicationUrl_2() const { return ___applicationUrl_2; } inline String_t** get_address_of_applicationUrl_2() { return &___applicationUrl_2; } inline void set_applicationUrl_2(String_t* value) { ___applicationUrl_2 = value; Il2CppCodeGenWriteBarrier((&___applicationUrl_2), value); } inline static int32_t get_offset_of_obj_type_3() { return static_cast<int32_t>(offsetof(ActivatedClientTypeEntry_t761233661, ___obj_type_3)); } inline Type_t * get_obj_type_3() const { return ___obj_type_3; } inline Type_t ** get_address_of_obj_type_3() { return &___obj_type_3; } inline void set_obj_type_3(Type_t * value) { ___obj_type_3 = value; Il2CppCodeGenWriteBarrier((&___obj_type_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ACTIVATEDCLIENTTYPEENTRY_T761233661_H #ifndef TIMESPAN_T881159249_H #define TIMESPAN_T881159249_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.TimeSpan struct TimeSpan_t881159249 { public: // System.Int64 System.TimeSpan::_ticks int64_t ____ticks_8; public: inline static int32_t get_offset_of__ticks_8() { return static_cast<int32_t>(offsetof(TimeSpan_t881159249, ____ticks_8)); } inline int64_t get__ticks_8() const { return ____ticks_8; } inline int64_t* get_address_of__ticks_8() { return &____ticks_8; } inline void set__ticks_8(int64_t value) { ____ticks_8 = value; } }; struct TimeSpan_t881159249_StaticFields { public: // System.TimeSpan System.TimeSpan::MaxValue TimeSpan_t881159249 ___MaxValue_5; // System.TimeSpan System.TimeSpan::MinValue TimeSpan_t881159249 ___MinValue_6; // System.TimeSpan System.TimeSpan::Zero TimeSpan_t881159249 ___Zero_7; public: inline static int32_t get_offset_of_MaxValue_5() { return static_cast<int32_t>(offsetof(TimeSpan_t881159249_StaticFields, ___MaxValue_5)); } inline TimeSpan_t881159249 get_MaxValue_5() const { return ___MaxValue_5; } inline TimeSpan_t881159249 * get_address_of_MaxValue_5() { return &___MaxValue_5; } inline void set_MaxValue_5(TimeSpan_t881159249 value) { ___MaxValue_5 = value; } inline static int32_t get_offset_of_MinValue_6() { return static_cast<int32_t>(offsetof(TimeSpan_t881159249_StaticFields, ___MinValue_6)); } inline TimeSpan_t881159249 get_MinValue_6() const { return ___MinValue_6; } inline TimeSpan_t881159249 * get_address_of_MinValue_6() { return &___MinValue_6; } inline void set_MinValue_6(TimeSpan_t881159249 value) { ___MinValue_6 = value; } inline static int32_t get_offset_of_Zero_7() { return static_cast<int32_t>(offsetof(TimeSpan_t881159249_StaticFields, ___Zero_7)); } inline TimeSpan_t881159249 get_Zero_7() const { return ___Zero_7; } inline TimeSpan_t881159249 * get_address_of_Zero_7() { return &___Zero_7; } inline void set_Zero_7(TimeSpan_t881159249 value) { ___Zero_7 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // TIMESPAN_T881159249_H #ifndef WELLKNOWNCLIENTTYPEENTRY_T1333916391_H #define WELLKNOWNCLIENTTYPEENTRY_T1333916391_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.WellKnownClientTypeEntry struct WellKnownClientTypeEntry_t1333916391 : public TypeEntry_t3903395172 { public: // System.Type System.Runtime.Remoting.WellKnownClientTypeEntry::obj_type Type_t * ___obj_type_2; // System.String System.Runtime.Remoting.WellKnownClientTypeEntry::obj_url String_t* ___obj_url_3; // System.String System.Runtime.Remoting.WellKnownClientTypeEntry::app_url String_t* ___app_url_4; public: inline static int32_t get_offset_of_obj_type_2() { return static_cast<int32_t>(offsetof(WellKnownClientTypeEntry_t1333916391, ___obj_type_2)); } inline Type_t * get_obj_type_2() const { return ___obj_type_2; } inline Type_t ** get_address_of_obj_type_2() { return &___obj_type_2; } inline void set_obj_type_2(Type_t * value) { ___obj_type_2 = value; Il2CppCodeGenWriteBarrier((&___obj_type_2), value); } inline static int32_t get_offset_of_obj_url_3() { return static_cast<int32_t>(offsetof(WellKnownClientTypeEntry_t1333916391, ___obj_url_3)); } inline String_t* get_obj_url_3() const { return ___obj_url_3; } inline String_t** get_address_of_obj_url_3() { return &___obj_url_3; } inline void set_obj_url_3(String_t* value) { ___obj_url_3 = value; Il2CppCodeGenWriteBarrier((&___obj_url_3), value); } inline static int32_t get_offset_of_app_url_4() { return static_cast<int32_t>(offsetof(WellKnownClientTypeEntry_t1333916391, ___app_url_4)); } inline String_t* get_app_url_4() const { return ___app_url_4; } inline String_t** get_address_of_app_url_4() { return &___app_url_4; } inline void set_app_url_4(String_t* value) { ___app_url_4 = value; Il2CppCodeGenWriteBarrier((&___app_url_4), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // WELLKNOWNCLIENTTYPEENTRY_T1333916391_H #ifndef CONTEXTBOUNDOBJECT_T1394786030_H #define CONTEXTBOUNDOBJECT_T1394786030_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ContextBoundObject struct ContextBoundObject_t1394786030 : public MarshalByRefObject_t2760389100 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONTEXTBOUNDOBJECT_T1394786030_H #ifndef REMOTEACTIVATOR_T2150046731_H #define REMOTEACTIVATOR_T2150046731_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Activation.RemoteActivator struct RemoteActivator_t2150046731 : public MarshalByRefObject_t2760389100 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // REMOTEACTIVATOR_T2150046731_H #ifndef SYSTEMEXCEPTION_T176217640_H #define SYSTEMEXCEPTION_T176217640_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.SystemException struct SystemException_t176217640 : public Exception_t { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SYSTEMEXCEPTION_T176217640_H #ifndef UINTPTR_T_H #define UINTPTR_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.UIntPtr struct UIntPtr_t { public: // System.Void* System.UIntPtr::_pointer void* ____pointer_1; public: inline static int32_t get_offset_of__pointer_1() { return static_cast<int32_t>(offsetof(UIntPtr_t, ____pointer_1)); } inline void* get__pointer_1() const { return ____pointer_1; } inline void** get_address_of__pointer_1() { return &____pointer_1; } inline void set__pointer_1(void* value) { ____pointer_1 = value; } }; struct UIntPtr_t_StaticFields { public: // System.UIntPtr System.UIntPtr::Zero uintptr_t ___Zero_0; public: inline static int32_t get_offset_of_Zero_0() { return static_cast<int32_t>(offsetof(UIntPtr_t_StaticFields, ___Zero_0)); } inline uintptr_t get_Zero_0() const { return ___Zero_0; } inline uintptr_t* get_address_of_Zero_0() { return &___Zero_0; } inline void set_Zero_0(uintptr_t value) { ___Zero_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UINTPTR_T_H #ifndef CONTEXTATTRIBUTE_T1328788465_H #define CONTEXTATTRIBUTE_T1328788465_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Contexts.ContextAttribute struct ContextAttribute_t1328788465 : public Attribute_t861562559 { public: // System.String System.Runtime.Remoting.Contexts.ContextAttribute::AttributeName String_t* ___AttributeName_0; public: inline static int32_t get_offset_of_AttributeName_0() { return static_cast<int32_t>(offsetof(ContextAttribute_t1328788465, ___AttributeName_0)); } inline String_t* get_AttributeName_0() const { return ___AttributeName_0; } inline String_t** get_address_of_AttributeName_0() { return &___AttributeName_0; } inline void set_AttributeName_0(String_t* value) { ___AttributeName_0 = value; Il2CppCodeGenWriteBarrier((&___AttributeName_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONTEXTATTRIBUTE_T1328788465_H #ifndef BINDINGFLAGS_T2721792723_H #define BINDINGFLAGS_T2721792723_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Reflection.BindingFlags struct BindingFlags_t2721792723 { public: // System.Int32 System.Reflection.BindingFlags::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(BindingFlags_t2721792723, ___value___1)); } inline int32_t get_value___1() const { return ___value___1; } inline int32_t* get_address_of_value___1() { return &___value___1; } inline void set_value___1(int32_t value) { ___value___1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // BINDINGFLAGS_T2721792723_H #ifndef DATETIMEKIND_T3468814247_H #define DATETIMEKIND_T3468814247_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.DateTimeKind struct DateTimeKind_t3468814247 { public: // System.Int32 System.DateTimeKind::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(DateTimeKind_t3468814247, ___value___1)); } inline int32_t get_value___1() const { return ___value___1; } inline int32_t* get_address_of_value___1() { return &___value___1; } inline void set_value___1(int32_t value) { ___value___1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DATETIMEKIND_T3468814247_H #ifndef UNMANAGEDTYPE_T523127242_H #define UNMANAGEDTYPE_T523127242_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.InteropServices.UnmanagedType struct UnmanagedType_t523127242 { public: // System.Int32 System.Runtime.InteropServices.UnmanagedType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(UnmanagedType_t523127242, ___value___1)); } inline int32_t get_value___1() const { return ___value___1; } inline int32_t* get_address_of_value___1() { return &___value___1; } inline void set_value___1(int32_t value) { ___value___1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UNMANAGEDTYPE_T523127242_H #ifndef CONTEXT_T3285446944_H #define CONTEXT_T3285446944_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Contexts.Context struct Context_t3285446944 : public RuntimeObject { public: // System.Int32 System.Runtime.Remoting.Contexts.Context::domain_id int32_t ___domain_id_0; // System.Int32 System.Runtime.Remoting.Contexts.Context::context_id int32_t ___context_id_1; // System.UIntPtr System.Runtime.Remoting.Contexts.Context::static_data uintptr_t ___static_data_2; // System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Contexts.Context::server_context_sink_chain RuntimeObject* ___server_context_sink_chain_4; // System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Contexts.Context::client_context_sink_chain RuntimeObject* ___client_context_sink_chain_5; // System.Object[] System.Runtime.Remoting.Contexts.Context::datastore ObjectU5BU5D_t2843939325* ___datastore_6; // System.Collections.ArrayList System.Runtime.Remoting.Contexts.Context::context_properties ArrayList_t2718874744 * ___context_properties_7; // System.Boolean System.Runtime.Remoting.Contexts.Context::frozen bool ___frozen_8; // System.Runtime.Remoting.Contexts.DynamicPropertyCollection System.Runtime.Remoting.Contexts.Context::context_dynamic_properties DynamicPropertyCollection_t652373272 * ___context_dynamic_properties_12; // System.Runtime.Remoting.Contexts.ContextCallbackObject System.Runtime.Remoting.Contexts.Context::callback_object ContextCallbackObject_t2292721408 * ___callback_object_13; public: inline static int32_t get_offset_of_domain_id_0() { return static_cast<int32_t>(offsetof(Context_t3285446944, ___domain_id_0)); } inline int32_t get_domain_id_0() const { return ___domain_id_0; } inline int32_t* get_address_of_domain_id_0() { return &___domain_id_0; } inline void set_domain_id_0(int32_t value) { ___domain_id_0 = value; } inline static int32_t get_offset_of_context_id_1() { return static_cast<int32_t>(offsetof(Context_t3285446944, ___context_id_1)); } inline int32_t get_context_id_1() const { return ___context_id_1; } inline int32_t* get_address_of_context_id_1() { return &___context_id_1; } inline void set_context_id_1(int32_t value) { ___context_id_1 = value; } inline static int32_t get_offset_of_static_data_2() { return static_cast<int32_t>(offsetof(Context_t3285446944, ___static_data_2)); } inline uintptr_t get_static_data_2() const { return ___static_data_2; } inline uintptr_t* get_address_of_static_data_2() { return &___static_data_2; } inline void set_static_data_2(uintptr_t value) { ___static_data_2 = value; } inline static int32_t get_offset_of_server_context_sink_chain_4() { return static_cast<int32_t>(offsetof(Context_t3285446944, ___server_context_sink_chain_4)); } inline RuntimeObject* get_server_context_sink_chain_4() const { return ___server_context_sink_chain_4; } inline RuntimeObject** get_address_of_server_context_sink_chain_4() { return &___server_context_sink_chain_4; } inline void set_server_context_sink_chain_4(RuntimeObject* value) { ___server_context_sink_chain_4 = value; Il2CppCodeGenWriteBarrier((&___server_context_sink_chain_4), value); } inline static int32_t get_offset_of_client_context_sink_chain_5() { return static_cast<int32_t>(offsetof(Context_t3285446944, ___client_context_sink_chain_5)); } inline RuntimeObject* get_client_context_sink_chain_5() const { return ___client_context_sink_chain_5; } inline RuntimeObject** get_address_of_client_context_sink_chain_5() { return &___client_context_sink_chain_5; } inline void set_client_context_sink_chain_5(RuntimeObject* value) { ___client_context_sink_chain_5 = value; Il2CppCodeGenWriteBarrier((&___client_context_sink_chain_5), value); } inline static int32_t get_offset_of_datastore_6() { return static_cast<int32_t>(offsetof(Context_t3285446944, ___datastore_6)); } inline ObjectU5BU5D_t2843939325* get_datastore_6() const { return ___datastore_6; } inline ObjectU5BU5D_t2843939325** get_address_of_datastore_6() { return &___datastore_6; } inline void set_datastore_6(ObjectU5BU5D_t2843939325* value) { ___datastore_6 = value; Il2CppCodeGenWriteBarrier((&___datastore_6), value); } inline static int32_t get_offset_of_context_properties_7() { return static_cast<int32_t>(offsetof(Context_t3285446944, ___context_properties_7)); } inline ArrayList_t2718874744 * get_context_properties_7() const { return ___context_properties_7; } inline ArrayList_t2718874744 ** get_address_of_context_properties_7() { return &___context_properties_7; } inline void set_context_properties_7(ArrayList_t2718874744 * value) { ___context_properties_7 = value; Il2CppCodeGenWriteBarrier((&___context_properties_7), value); } inline static int32_t get_offset_of_frozen_8() { return static_cast<int32_t>(offsetof(Context_t3285446944, ___frozen_8)); } inline bool get_frozen_8() const { return ___frozen_8; } inline bool* get_address_of_frozen_8() { return &___frozen_8; } inline void set_frozen_8(bool value) { ___frozen_8 = value; } inline static int32_t get_offset_of_context_dynamic_properties_12() { return static_cast<int32_t>(offsetof(Context_t3285446944, ___context_dynamic_properties_12)); } inline DynamicPropertyCollection_t652373272 * get_context_dynamic_properties_12() const { return ___context_dynamic_properties_12; } inline DynamicPropertyCollection_t652373272 ** get_address_of_context_dynamic_properties_12() { return &___context_dynamic_properties_12; } inline void set_context_dynamic_properties_12(DynamicPropertyCollection_t652373272 * value) { ___context_dynamic_properties_12 = value; Il2CppCodeGenWriteBarrier((&___context_dynamic_properties_12), value); } inline static int32_t get_offset_of_callback_object_13() { return static_cast<int32_t>(offsetof(Context_t3285446944, ___callback_object_13)); } inline ContextCallbackObject_t2292721408 * get_callback_object_13() const { return ___callback_object_13; } inline ContextCallbackObject_t2292721408 ** get_address_of_callback_object_13() { return &___callback_object_13; } inline void set_callback_object_13(ContextCallbackObject_t2292721408 * value) { ___callback_object_13 = value; Il2CppCodeGenWriteBarrier((&___callback_object_13), value); } }; struct Context_t3285446944_StaticFields { public: // System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Contexts.Context::default_server_context_sink RuntimeObject* ___default_server_context_sink_3; // System.Int32 System.Runtime.Remoting.Contexts.Context::global_count int32_t ___global_count_9; // System.Collections.Hashtable System.Runtime.Remoting.Contexts.Context::namedSlots Hashtable_t1853889766 * ___namedSlots_10; // System.Runtime.Remoting.Contexts.DynamicPropertyCollection System.Runtime.Remoting.Contexts.Context::global_dynamic_properties DynamicPropertyCollection_t652373272 * ___global_dynamic_properties_11; public: inline static int32_t get_offset_of_default_server_context_sink_3() { return static_cast<int32_t>(offsetof(Context_t3285446944_StaticFields, ___default_server_context_sink_3)); } inline RuntimeObject* get_default_server_context_sink_3() const { return ___default_server_context_sink_3; } inline RuntimeObject** get_address_of_default_server_context_sink_3() { return &___default_server_context_sink_3; } inline void set_default_server_context_sink_3(RuntimeObject* value) { ___default_server_context_sink_3 = value; Il2CppCodeGenWriteBarrier((&___default_server_context_sink_3), value); } inline static int32_t get_offset_of_global_count_9() { return static_cast<int32_t>(offsetof(Context_t3285446944_StaticFields, ___global_count_9)); } inline int32_t get_global_count_9() const { return ___global_count_9; } inline int32_t* get_address_of_global_count_9() { return &___global_count_9; } inline void set_global_count_9(int32_t value) { ___global_count_9 = value; } inline static int32_t get_offset_of_namedSlots_10() { return static_cast<int32_t>(offsetof(Context_t3285446944_StaticFields, ___namedSlots_10)); } inline Hashtable_t1853889766 * get_namedSlots_10() const { return ___namedSlots_10; } inline Hashtable_t1853889766 ** get_address_of_namedSlots_10() { return &___namedSlots_10; } inline void set_namedSlots_10(Hashtable_t1853889766 * value) { ___namedSlots_10 = value; Il2CppCodeGenWriteBarrier((&___namedSlots_10), value); } inline static int32_t get_offset_of_global_dynamic_properties_11() { return static_cast<int32_t>(offsetof(Context_t3285446944_StaticFields, ___global_dynamic_properties_11)); } inline DynamicPropertyCollection_t652373272 * get_global_dynamic_properties_11() const { return ___global_dynamic_properties_11; } inline DynamicPropertyCollection_t652373272 ** get_address_of_global_dynamic_properties_11() { return &___global_dynamic_properties_11; } inline void set_global_dynamic_properties_11(DynamicPropertyCollection_t652373272 * value) { ___global_dynamic_properties_11 = value; Il2CppCodeGenWriteBarrier((&___global_dynamic_properties_11), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONTEXT_T3285446944_H #ifndef URLATTRIBUTE_T221584584_H #define URLATTRIBUTE_T221584584_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Activation.UrlAttribute struct UrlAttribute_t221584584 : public ContextAttribute_t1328788465 { public: // System.String System.Runtime.Remoting.Activation.UrlAttribute::url String_t* ___url_1; public: inline static int32_t get_offset_of_url_1() { return static_cast<int32_t>(offsetof(UrlAttribute_t221584584, ___url_1)); } inline String_t* get_url_1() const { return ___url_1; } inline String_t** get_address_of_url_1() { return &___url_1; } inline void set_url_1(String_t* value) { ___url_1 = value; Il2CppCodeGenWriteBarrier((&___url_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // URLATTRIBUTE_T221584584_H #ifndef WELLKNOWNOBJECTMODE_T3489814916_H #define WELLKNOWNOBJECTMODE_T3489814916_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.WellKnownObjectMode struct WellKnownObjectMode_t3489814916 { public: // System.Int32 System.Runtime.Remoting.WellKnownObjectMode::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(WellKnownObjectMode_t3489814916, ___value___1)); } inline int32_t get_value___1() const { return ___value___1; } inline int32_t* get_address_of_value___1() { return &___value___1; } inline void set_value___1(int32_t value) { ___value___1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // WELLKNOWNOBJECTMODE_T3489814916_H #ifndef SINGLECALLIDENTITY_T1525242393_H #define SINGLECALLIDENTITY_T1525242393_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.SingleCallIdentity struct SingleCallIdentity_t1525242393 : public ServerIdentity_t2342208608 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SINGLECALLIDENTITY_T1525242393_H #ifndef SINGLETONIDENTITY_T2425810587_H #define SINGLETONIDENTITY_T2425810587_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.SingletonIdentity struct SingletonIdentity_t2425810587 : public ServerIdentity_t2342208608 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SINGLETONIDENTITY_T2425810587_H #ifndef CLIENTACTIVATEDIDENTITY_T3849543081_H #define CLIENTACTIVATEDIDENTITY_T3849543081_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.ClientActivatedIdentity struct ClientActivatedIdentity_t3849543081 : public ServerIdentity_t2342208608 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CLIENTACTIVATEDIDENTITY_T3849543081_H #ifndef REMOTINGEXCEPTION_T2290474311_H #define REMOTINGEXCEPTION_T2290474311_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.RemotingException struct RemotingException_t2290474311 : public SystemException_t176217640 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // REMOTINGEXCEPTION_T2290474311_H #ifndef CONTEXTCALLBACKOBJECT_T2292721408_H #define CONTEXTCALLBACKOBJECT_T2292721408_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Contexts.ContextCallbackObject struct ContextCallbackObject_t2292721408 : public ContextBoundObject_t1394786030 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONTEXTCALLBACKOBJECT_T2292721408_H #ifndef ASYNCRESULT_T4194309572_H #define ASYNCRESULT_T4194309572_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.AsyncResult struct AsyncResult_t4194309572 : public RuntimeObject { public: // System.Object System.Runtime.Remoting.Messaging.AsyncResult::async_state RuntimeObject * ___async_state_0; // System.Threading.WaitHandle System.Runtime.Remoting.Messaging.AsyncResult::handle WaitHandle_t1743403487 * ___handle_1; // System.Object System.Runtime.Remoting.Messaging.AsyncResult::async_delegate RuntimeObject * ___async_delegate_2; // System.IntPtr System.Runtime.Remoting.Messaging.AsyncResult::data intptr_t ___data_3; // System.Object System.Runtime.Remoting.Messaging.AsyncResult::object_data RuntimeObject * ___object_data_4; // System.Boolean System.Runtime.Remoting.Messaging.AsyncResult::sync_completed bool ___sync_completed_5; // System.Boolean System.Runtime.Remoting.Messaging.AsyncResult::completed bool ___completed_6; // System.Boolean System.Runtime.Remoting.Messaging.AsyncResult::endinvoke_called bool ___endinvoke_called_7; // System.Object System.Runtime.Remoting.Messaging.AsyncResult::async_callback RuntimeObject * ___async_callback_8; // System.Threading.ExecutionContext System.Runtime.Remoting.Messaging.AsyncResult::current ExecutionContext_t1748372627 * ___current_9; // System.Threading.ExecutionContext System.Runtime.Remoting.Messaging.AsyncResult::original ExecutionContext_t1748372627 * ___original_10; // System.Int32 System.Runtime.Remoting.Messaging.AsyncResult::gchandle int32_t ___gchandle_11; // System.Runtime.Remoting.Messaging.MonoMethodMessage System.Runtime.Remoting.Messaging.AsyncResult::call_message MonoMethodMessage_t2807636944 * ___call_message_12; // System.Runtime.Remoting.Messaging.IMessageCtrl System.Runtime.Remoting.Messaging.AsyncResult::message_ctrl RuntimeObject* ___message_ctrl_13; // System.Runtime.Remoting.Messaging.IMessage System.Runtime.Remoting.Messaging.AsyncResult::reply_message RuntimeObject* ___reply_message_14; public: inline static int32_t get_offset_of_async_state_0() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___async_state_0)); } inline RuntimeObject * get_async_state_0() const { return ___async_state_0; } inline RuntimeObject ** get_address_of_async_state_0() { return &___async_state_0; } inline void set_async_state_0(RuntimeObject * value) { ___async_state_0 = value; Il2CppCodeGenWriteBarrier((&___async_state_0), value); } inline static int32_t get_offset_of_handle_1() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___handle_1)); } inline WaitHandle_t1743403487 * get_handle_1() const { return ___handle_1; } inline WaitHandle_t1743403487 ** get_address_of_handle_1() { return &___handle_1; } inline void set_handle_1(WaitHandle_t1743403487 * value) { ___handle_1 = value; Il2CppCodeGenWriteBarrier((&___handle_1), value); } inline static int32_t get_offset_of_async_delegate_2() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___async_delegate_2)); } inline RuntimeObject * get_async_delegate_2() const { return ___async_delegate_2; } inline RuntimeObject ** get_address_of_async_delegate_2() { return &___async_delegate_2; } inline void set_async_delegate_2(RuntimeObject * value) { ___async_delegate_2 = value; Il2CppCodeGenWriteBarrier((&___async_delegate_2), value); } inline static int32_t get_offset_of_data_3() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___data_3)); } inline intptr_t get_data_3() const { return ___data_3; } inline intptr_t* get_address_of_data_3() { return &___data_3; } inline void set_data_3(intptr_t value) { ___data_3 = value; } inline static int32_t get_offset_of_object_data_4() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___object_data_4)); } inline RuntimeObject * get_object_data_4() const { return ___object_data_4; } inline RuntimeObject ** get_address_of_object_data_4() { return &___object_data_4; } inline void set_object_data_4(RuntimeObject * value) { ___object_data_4 = value; Il2CppCodeGenWriteBarrier((&___object_data_4), value); } inline static int32_t get_offset_of_sync_completed_5() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___sync_completed_5)); } inline bool get_sync_completed_5() const { return ___sync_completed_5; } inline bool* get_address_of_sync_completed_5() { return &___sync_completed_5; } inline void set_sync_completed_5(bool value) { ___sync_completed_5 = value; } inline static int32_t get_offset_of_completed_6() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___completed_6)); } inline bool get_completed_6() const { return ___completed_6; } inline bool* get_address_of_completed_6() { return &___completed_6; } inline void set_completed_6(bool value) { ___completed_6 = value; } inline static int32_t get_offset_of_endinvoke_called_7() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___endinvoke_called_7)); } inline bool get_endinvoke_called_7() const { return ___endinvoke_called_7; } inline bool* get_address_of_endinvoke_called_7() { return &___endinvoke_called_7; } inline void set_endinvoke_called_7(bool value) { ___endinvoke_called_7 = value; } inline static int32_t get_offset_of_async_callback_8() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___async_callback_8)); } inline RuntimeObject * get_async_callback_8() const { return ___async_callback_8; } inline RuntimeObject ** get_address_of_async_callback_8() { return &___async_callback_8; } inline void set_async_callback_8(RuntimeObject * value) { ___async_callback_8 = value; Il2CppCodeGenWriteBarrier((&___async_callback_8), value); } inline static int32_t get_offset_of_current_9() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___current_9)); } inline ExecutionContext_t1748372627 * get_current_9() const { return ___current_9; } inline ExecutionContext_t1748372627 ** get_address_of_current_9() { return &___current_9; } inline void set_current_9(ExecutionContext_t1748372627 * value) { ___current_9 = value; Il2CppCodeGenWriteBarrier((&___current_9), value); } inline static int32_t get_offset_of_original_10() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___original_10)); } inline ExecutionContext_t1748372627 * get_original_10() const { return ___original_10; } inline ExecutionContext_t1748372627 ** get_address_of_original_10() { return &___original_10; } inline void set_original_10(ExecutionContext_t1748372627 * value) { ___original_10 = value; Il2CppCodeGenWriteBarrier((&___original_10), value); } inline static int32_t get_offset_of_gchandle_11() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___gchandle_11)); } inline int32_t get_gchandle_11() const { return ___gchandle_11; } inline int32_t* get_address_of_gchandle_11() { return &___gchandle_11; } inline void set_gchandle_11(int32_t value) { ___gchandle_11 = value; } inline static int32_t get_offset_of_call_message_12() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___call_message_12)); } inline MonoMethodMessage_t2807636944 * get_call_message_12() const { return ___call_message_12; } inline MonoMethodMessage_t2807636944 ** get_address_of_call_message_12() { return &___call_message_12; } inline void set_call_message_12(MonoMethodMessage_t2807636944 * value) { ___call_message_12 = value; Il2CppCodeGenWriteBarrier((&___call_message_12), value); } inline static int32_t get_offset_of_message_ctrl_13() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___message_ctrl_13)); } inline RuntimeObject* get_message_ctrl_13() const { return ___message_ctrl_13; } inline RuntimeObject** get_address_of_message_ctrl_13() { return &___message_ctrl_13; } inline void set_message_ctrl_13(RuntimeObject* value) { ___message_ctrl_13 = value; Il2CppCodeGenWriteBarrier((&___message_ctrl_13), value); } inline static int32_t get_offset_of_reply_message_14() { return static_cast<int32_t>(offsetof(AsyncResult_t4194309572, ___reply_message_14)); } inline RuntimeObject* get_reply_message_14() const { return ___reply_message_14; } inline RuntimeObject** get_address_of_reply_message_14() { return &___reply_message_14; } inline void set_reply_message_14(RuntimeObject* value) { ___reply_message_14 = value; Il2CppCodeGenWriteBarrier((&___reply_message_14), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ASYNCRESULT_T4194309572_H #ifndef ARGINFOTYPE_T1035054221_H #define ARGINFOTYPE_T1035054221_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Messaging.ArgInfoType struct ArgInfoType_t1035054221 { public: // System.Byte System.Runtime.Remoting.Messaging.ArgInfoType::value__ uint8_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(ArgInfoType_t1035054221, ___value___1)); } inline uint8_t get_value___1() const { return ___value___1; } inline uint8_t* get_address_of_value___1() { return &___value___1; } inline void set_value___1(uint8_t value) { ___value___1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ARGINFOTYPE_T1035054221_H #ifndef LIFETIMESERVICES_T3061370510_H #define LIFETIMESERVICES_T3061370510_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Lifetime.LifetimeServices struct LifetimeServices_t3061370510 : public RuntimeObject { public: public: }; struct LifetimeServices_t3061370510_StaticFields { public: // System.TimeSpan System.Runtime.Remoting.Lifetime.LifetimeServices::_leaseManagerPollTime TimeSpan_t881159249 ____leaseManagerPollTime_0; // System.TimeSpan System.Runtime.Remoting.Lifetime.LifetimeServices::_leaseTime TimeSpan_t881159249 ____leaseTime_1; // System.TimeSpan System.Runtime.Remoting.Lifetime.LifetimeServices::_renewOnCallTime TimeSpan_t881159249 ____renewOnCallTime_2; // System.TimeSpan System.Runtime.Remoting.Lifetime.LifetimeServices::_sponsorshipTimeout TimeSpan_t881159249 ____sponsorshipTimeout_3; // System.Runtime.Remoting.Lifetime.LeaseManager System.Runtime.Remoting.Lifetime.LifetimeServices::_leaseManager LeaseManager_t3648745595 * ____leaseManager_4; public: inline static int32_t get_offset_of__leaseManagerPollTime_0() { return static_cast<int32_t>(offsetof(LifetimeServices_t3061370510_StaticFields, ____leaseManagerPollTime_0)); } inline TimeSpan_t881159249 get__leaseManagerPollTime_0() const { return ____leaseManagerPollTime_0; } inline TimeSpan_t881159249 * get_address_of__leaseManagerPollTime_0() { return &____leaseManagerPollTime_0; } inline void set__leaseManagerPollTime_0(TimeSpan_t881159249 value) { ____leaseManagerPollTime_0 = value; } inline static int32_t get_offset_of__leaseTime_1() { return static_cast<int32_t>(offsetof(LifetimeServices_t3061370510_StaticFields, ____leaseTime_1)); } inline TimeSpan_t881159249 get__leaseTime_1() const { return ____leaseTime_1; } inline TimeSpan_t881159249 * get_address_of__leaseTime_1() { return &____leaseTime_1; } inline void set__leaseTime_1(TimeSpan_t881159249 value) { ____leaseTime_1 = value; } inline static int32_t get_offset_of__renewOnCallTime_2() { return static_cast<int32_t>(offsetof(LifetimeServices_t3061370510_StaticFields, ____renewOnCallTime_2)); } inline TimeSpan_t881159249 get__renewOnCallTime_2() const { return ____renewOnCallTime_2; } inline TimeSpan_t881159249 * get_address_of__renewOnCallTime_2() { return &____renewOnCallTime_2; } inline void set__renewOnCallTime_2(TimeSpan_t881159249 value) { ____renewOnCallTime_2 = value; } inline static int32_t get_offset_of__sponsorshipTimeout_3() { return static_cast<int32_t>(offsetof(LifetimeServices_t3061370510_StaticFields, ____sponsorshipTimeout_3)); } inline TimeSpan_t881159249 get__sponsorshipTimeout_3() const { return ____sponsorshipTimeout_3; } inline TimeSpan_t881159249 * get_address_of__sponsorshipTimeout_3() { return &____sponsorshipTimeout_3; } inline void set__sponsorshipTimeout_3(TimeSpan_t881159249 value) { ____sponsorshipTimeout_3 = value; } inline static int32_t get_offset_of__leaseManager_4() { return static_cast<int32_t>(offsetof(LifetimeServices_t3061370510_StaticFields, ____leaseManager_4)); } inline LeaseManager_t3648745595 * get__leaseManager_4() const { return ____leaseManager_4; } inline LeaseManager_t3648745595 ** get_address_of__leaseManager_4() { return &____leaseManager_4; } inline void set__leaseManager_4(LeaseManager_t3648745595 * value) { ____leaseManager_4 = value; Il2CppCodeGenWriteBarrier((&____leaseManager_4), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LIFETIMESERVICES_T3061370510_H #ifndef LEASESTATE_T747101024_H #define LEASESTATE_T747101024_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Lifetime.LeaseState struct LeaseState_t747101024 { public: // System.Int32 System.Runtime.Remoting.Lifetime.LeaseState::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(LeaseState_t747101024, ___value___1)); } inline int32_t get_value___1() const { return ___value___1; } inline int32_t* get_address_of_value___1() { return &___value___1; } inline void set_value___1(int32_t value) { ___value___1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LEASESTATE_T747101024_H #ifndef DELEGATE_T1188392813_H #define DELEGATE_T1188392813_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Delegate struct Delegate_t1188392813 : 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::method_code intptr_t ___method_code_5; // System.Reflection.MethodInfo System.Delegate::method_info MethodInfo_t * ___method_info_6; // System.Reflection.MethodInfo System.Delegate::original_method_info MethodInfo_t * ___original_method_info_7; // System.DelegateData System.Delegate::data DelegateData_t1677132599 * ___data_8; public: inline static int32_t get_offset_of_method_ptr_0() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___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_t1188392813, ___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_t1188392813, ___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((&___m_target_2), value); } inline static int32_t get_offset_of_method_3() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___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_t1188392813, ___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_method_code_5() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___method_code_5)); } inline intptr_t get_method_code_5() const { return ___method_code_5; } inline intptr_t* get_address_of_method_code_5() { return &___method_code_5; } inline void set_method_code_5(intptr_t value) { ___method_code_5 = value; } inline static int32_t get_offset_of_method_info_6() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___method_info_6)); } inline MethodInfo_t * get_method_info_6() const { return ___method_info_6; } inline MethodInfo_t ** get_address_of_method_info_6() { return &___method_info_6; } inline void set_method_info_6(MethodInfo_t * value) { ___method_info_6 = value; Il2CppCodeGenWriteBarrier((&___method_info_6), value); } inline static int32_t get_offset_of_original_method_info_7() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___original_method_info_7)); } inline MethodInfo_t * get_original_method_info_7() const { return ___original_method_info_7; } inline MethodInfo_t ** get_address_of_original_method_info_7() { return &___original_method_info_7; } inline void set_original_method_info_7(MethodInfo_t * value) { ___original_method_info_7 = value; Il2CppCodeGenWriteBarrier((&___original_method_info_7), value); } inline static int32_t get_offset_of_data_8() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___data_8)); } inline DelegateData_t1677132599 * get_data_8() const { return ___data_8; } inline DelegateData_t1677132599 ** get_address_of_data_8() { return &___data_8; } inline void set_data_8(DelegateData_t1677132599 * value) { ___data_8 = value; Il2CppCodeGenWriteBarrier((&___data_8), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DELEGATE_T1188392813_H #ifndef SYNCHRONIZATIONATTRIBUTE_T3946661254_H #define SYNCHRONIZATIONATTRIBUTE_T3946661254_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Contexts.SynchronizationAttribute struct SynchronizationAttribute_t3946661254 : public ContextAttribute_t1328788465 { public: // System.Boolean System.Runtime.Remoting.Contexts.SynchronizationAttribute::_bReEntrant bool ____bReEntrant_1; // System.Int32 System.Runtime.Remoting.Contexts.SynchronizationAttribute::_flavor int32_t ____flavor_2; // System.Int32 System.Runtime.Remoting.Contexts.SynchronizationAttribute::_lockCount int32_t ____lockCount_3; // System.Threading.Mutex System.Runtime.Remoting.Contexts.SynchronizationAttribute::_mutex Mutex_t3066672582 * ____mutex_4; // System.Threading.Thread System.Runtime.Remoting.Contexts.SynchronizationAttribute::_ownerThread Thread_t2300836069 * ____ownerThread_5; public: inline static int32_t get_offset_of__bReEntrant_1() { return static_cast<int32_t>(offsetof(SynchronizationAttribute_t3946661254, ____bReEntrant_1)); } inline bool get__bReEntrant_1() const { return ____bReEntrant_1; } inline bool* get_address_of__bReEntrant_1() { return &____bReEntrant_1; } inline void set__bReEntrant_1(bool value) { ____bReEntrant_1 = value; } inline static int32_t get_offset_of__flavor_2() { return static_cast<int32_t>(offsetof(SynchronizationAttribute_t3946661254, ____flavor_2)); } inline int32_t get__flavor_2() const { return ____flavor_2; } inline int32_t* get_address_of__flavor_2() { return &____flavor_2; } inline void set__flavor_2(int32_t value) { ____flavor_2 = value; } inline static int32_t get_offset_of__lockCount_3() { return static_cast<int32_t>(offsetof(SynchronizationAttribute_t3946661254, ____lockCount_3)); } inline int32_t get__lockCount_3() const { return ____lockCount_3; } inline int32_t* get_address_of__lockCount_3() { return &____lockCount_3; } inline void set__lockCount_3(int32_t value) { ____lockCount_3 = value; } inline static int32_t get_offset_of__mutex_4() { return static_cast<int32_t>(offsetof(SynchronizationAttribute_t3946661254, ____mutex_4)); } inline Mutex_t3066672582 * get__mutex_4() const { return ____mutex_4; } inline Mutex_t3066672582 ** get_address_of__mutex_4() { return &____mutex_4; } inline void set__mutex_4(Mutex_t3066672582 * value) { ____mutex_4 = value; Il2CppCodeGenWriteBarrier((&____mutex_4), value); } inline static int32_t get_offset_of__ownerThread_5() { return static_cast<int32_t>(offsetof(SynchronizationAttribute_t3946661254, ____ownerThread_5)); } inline Thread_t2300836069 * get__ownerThread_5() const { return ____ownerThread_5; } inline Thread_t2300836069 ** get_address_of__ownerThread_5() { return &____ownerThread_5; } inline void set__ownerThread_5(Thread_t2300836069 * value) { ____ownerThread_5 = value; Il2CppCodeGenWriteBarrier((&____ownerThread_5), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SYNCHRONIZATIONATTRIBUTE_T3946661254_H #ifndef REMOTINGSERVICES_T1401195504_H #define REMOTINGSERVICES_T1401195504_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.RemotingServices struct RemotingServices_t1401195504 : public RuntimeObject { public: public: }; struct RemotingServices_t1401195504_StaticFields { public: // System.Collections.Hashtable System.Runtime.Remoting.RemotingServices::uri_hash Hashtable_t1853889766 * ___uri_hash_0; // System.Runtime.Serialization.Formatters.Binary.BinaryFormatter System.Runtime.Remoting.RemotingServices::_serializationFormatter BinaryFormatter_t3197753202 * ____serializationFormatter_1; // System.Runtime.Serialization.Formatters.Binary.BinaryFormatter System.Runtime.Remoting.RemotingServices::_deserializationFormatter BinaryFormatter_t3197753202 * ____deserializationFormatter_2; // System.String System.Runtime.Remoting.RemotingServices::app_id String_t* ___app_id_3; // System.Int32 System.Runtime.Remoting.RemotingServices::next_id int32_t ___next_id_4; // System.Reflection.BindingFlags System.Runtime.Remoting.RemotingServices::methodBindings int32_t ___methodBindings_5; // System.Reflection.MethodInfo System.Runtime.Remoting.RemotingServices::FieldSetterMethod MethodInfo_t * ___FieldSetterMethod_6; // System.Reflection.MethodInfo System.Runtime.Remoting.RemotingServices::FieldGetterMethod MethodInfo_t * ___FieldGetterMethod_7; public: inline static int32_t get_offset_of_uri_hash_0() { return static_cast<int32_t>(offsetof(RemotingServices_t1401195504_StaticFields, ___uri_hash_0)); } inline Hashtable_t1853889766 * get_uri_hash_0() const { return ___uri_hash_0; } inline Hashtable_t1853889766 ** get_address_of_uri_hash_0() { return &___uri_hash_0; } inline void set_uri_hash_0(Hashtable_t1853889766 * value) { ___uri_hash_0 = value; Il2CppCodeGenWriteBarrier((&___uri_hash_0), value); } inline static int32_t get_offset_of__serializationFormatter_1() { return static_cast<int32_t>(offsetof(RemotingServices_t1401195504_StaticFields, ____serializationFormatter_1)); } inline BinaryFormatter_t3197753202 * get__serializationFormatter_1() const { return ____serializationFormatter_1; } inline BinaryFormatter_t3197753202 ** get_address_of__serializationFormatter_1() { return &____serializationFormatter_1; } inline void set__serializationFormatter_1(BinaryFormatter_t3197753202 * value) { ____serializationFormatter_1 = value; Il2CppCodeGenWriteBarrier((&____serializationFormatter_1), value); } inline static int32_t get_offset_of__deserializationFormatter_2() { return static_cast<int32_t>(offsetof(RemotingServices_t1401195504_StaticFields, ____deserializationFormatter_2)); } inline BinaryFormatter_t3197753202 * get__deserializationFormatter_2() const { return ____deserializationFormatter_2; } inline BinaryFormatter_t3197753202 ** get_address_of__deserializationFormatter_2() { return &____deserializationFormatter_2; } inline void set__deserializationFormatter_2(BinaryFormatter_t3197753202 * value) { ____deserializationFormatter_2 = value; Il2CppCodeGenWriteBarrier((&____deserializationFormatter_2), value); } inline static int32_t get_offset_of_app_id_3() { return static_cast<int32_t>(offsetof(RemotingServices_t1401195504_StaticFields, ___app_id_3)); } inline String_t* get_app_id_3() const { return ___app_id_3; } inline String_t** get_address_of_app_id_3() { return &___app_id_3; } inline void set_app_id_3(String_t* value) { ___app_id_3 = value; Il2CppCodeGenWriteBarrier((&___app_id_3), value); } inline static int32_t get_offset_of_next_id_4() { return static_cast<int32_t>(offsetof(RemotingServices_t1401195504_StaticFields, ___next_id_4)); } inline int32_t get_next_id_4() const { return ___next_id_4; } inline int32_t* get_address_of_next_id_4() { return &___next_id_4; } inline void set_next_id_4(int32_t value) { ___next_id_4 = value; } inline static int32_t get_offset_of_methodBindings_5() { return static_cast<int32_t>(offsetof(RemotingServices_t1401195504_StaticFields, ___methodBindings_5)); } inline int32_t get_methodBindings_5() const { return ___methodBindings_5; } inline int32_t* get_address_of_methodBindings_5() { return &___methodBindings_5; } inline void set_methodBindings_5(int32_t value) { ___methodBindings_5 = value; } inline static int32_t get_offset_of_FieldSetterMethod_6() { return static_cast<int32_t>(offsetof(RemotingServices_t1401195504_StaticFields, ___FieldSetterMethod_6)); } inline MethodInfo_t * get_FieldSetterMethod_6() const { return ___FieldSetterMethod_6; } inline MethodInfo_t ** get_address_of_FieldSetterMethod_6() { return &___FieldSetterMethod_6; } inline void set_FieldSetterMethod_6(MethodInfo_t * value) { ___FieldSetterMethod_6 = value; Il2CppCodeGenWriteBarrier((&___FieldSetterMethod_6), value); } inline static int32_t get_offset_of_FieldGetterMethod_7() { return static_cast<int32_t>(offsetof(RemotingServices_t1401195504_StaticFields, ___FieldGetterMethod_7)); } inline MethodInfo_t * get_FieldGetterMethod_7() const { return ___FieldGetterMethod_7; } inline MethodInfo_t ** get_address_of_FieldGetterMethod_7() { return &___FieldGetterMethod_7; } inline void set_FieldGetterMethod_7(MethodInfo_t * value) { ___FieldGetterMethod_7 = value; Il2CppCodeGenWriteBarrier((&___FieldGetterMethod_7), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // REMOTINGSERVICES_T1401195504_H #ifndef DATETIME_T3738529785_H #define DATETIME_T3738529785_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.DateTime struct DateTime_t3738529785 { public: // System.TimeSpan System.DateTime::ticks TimeSpan_t881159249 ___ticks_10; // System.DateTimeKind System.DateTime::kind int32_t ___kind_11; public: inline static int32_t get_offset_of_ticks_10() { return static_cast<int32_t>(offsetof(DateTime_t3738529785, ___ticks_10)); } inline TimeSpan_t881159249 get_ticks_10() const { return ___ticks_10; } inline TimeSpan_t881159249 * get_address_of_ticks_10() { return &___ticks_10; } inline void set_ticks_10(TimeSpan_t881159249 value) { ___ticks_10 = value; } inline static int32_t get_offset_of_kind_11() { return static_cast<int32_t>(offsetof(DateTime_t3738529785, ___kind_11)); } inline int32_t get_kind_11() const { return ___kind_11; } inline int32_t* get_address_of_kind_11() { return &___kind_11; } inline void set_kind_11(int32_t value) { ___kind_11 = value; } }; struct DateTime_t3738529785_StaticFields { public: // System.DateTime System.DateTime::MaxValue DateTime_t3738529785 ___MaxValue_12; // System.DateTime System.DateTime::MinValue DateTime_t3738529785 ___MinValue_13; // System.String[] System.DateTime::ParseTimeFormats StringU5BU5D_t1281789340* ___ParseTimeFormats_14; // System.String[] System.DateTime::ParseYearDayMonthFormats StringU5BU5D_t1281789340* ___ParseYearDayMonthFormats_15; // System.String[] System.DateTime::ParseYearMonthDayFormats StringU5BU5D_t1281789340* ___ParseYearMonthDayFormats_16; // System.String[] System.DateTime::ParseDayMonthYearFormats StringU5BU5D_t1281789340* ___ParseDayMonthYearFormats_17; // System.String[] System.DateTime::ParseMonthDayYearFormats StringU5BU5D_t1281789340* ___ParseMonthDayYearFormats_18; // System.String[] System.DateTime::MonthDayShortFormats StringU5BU5D_t1281789340* ___MonthDayShortFormats_19; // System.String[] System.DateTime::DayMonthShortFormats StringU5BU5D_t1281789340* ___DayMonthShortFormats_20; // System.Int32[] System.DateTime::daysmonth Int32U5BU5D_t385246372* ___daysmonth_21; // System.Int32[] System.DateTime::daysmonthleap Int32U5BU5D_t385246372* ___daysmonthleap_22; // System.Object System.DateTime::to_local_time_span_object RuntimeObject * ___to_local_time_span_object_23; // System.Int64 System.DateTime::last_now int64_t ___last_now_24; public: inline static int32_t get_offset_of_MaxValue_12() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___MaxValue_12)); } inline DateTime_t3738529785 get_MaxValue_12() const { return ___MaxValue_12; } inline DateTime_t3738529785 * get_address_of_MaxValue_12() { return &___MaxValue_12; } inline void set_MaxValue_12(DateTime_t3738529785 value) { ___MaxValue_12 = value; } inline static int32_t get_offset_of_MinValue_13() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___MinValue_13)); } inline DateTime_t3738529785 get_MinValue_13() const { return ___MinValue_13; } inline DateTime_t3738529785 * get_address_of_MinValue_13() { return &___MinValue_13; } inline void set_MinValue_13(DateTime_t3738529785 value) { ___MinValue_13 = value; } inline static int32_t get_offset_of_ParseTimeFormats_14() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___ParseTimeFormats_14)); } inline StringU5BU5D_t1281789340* get_ParseTimeFormats_14() const { return ___ParseTimeFormats_14; } inline StringU5BU5D_t1281789340** get_address_of_ParseTimeFormats_14() { return &___ParseTimeFormats_14; } inline void set_ParseTimeFormats_14(StringU5BU5D_t1281789340* value) { ___ParseTimeFormats_14 = value; Il2CppCodeGenWriteBarrier((&___ParseTimeFormats_14), value); } inline static int32_t get_offset_of_ParseYearDayMonthFormats_15() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___ParseYearDayMonthFormats_15)); } inline StringU5BU5D_t1281789340* get_ParseYearDayMonthFormats_15() const { return ___ParseYearDayMonthFormats_15; } inline StringU5BU5D_t1281789340** get_address_of_ParseYearDayMonthFormats_15() { return &___ParseYearDayMonthFormats_15; } inline void set_ParseYearDayMonthFormats_15(StringU5BU5D_t1281789340* value) { ___ParseYearDayMonthFormats_15 = value; Il2CppCodeGenWriteBarrier((&___ParseYearDayMonthFormats_15), value); } inline static int32_t get_offset_of_ParseYearMonthDayFormats_16() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___ParseYearMonthDayFormats_16)); } inline StringU5BU5D_t1281789340* get_ParseYearMonthDayFormats_16() const { return ___ParseYearMonthDayFormats_16; } inline StringU5BU5D_t1281789340** get_address_of_ParseYearMonthDayFormats_16() { return &___ParseYearMonthDayFormats_16; } inline void set_ParseYearMonthDayFormats_16(StringU5BU5D_t1281789340* value) { ___ParseYearMonthDayFormats_16 = value; Il2CppCodeGenWriteBarrier((&___ParseYearMonthDayFormats_16), value); } inline static int32_t get_offset_of_ParseDayMonthYearFormats_17() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___ParseDayMonthYearFormats_17)); } inline StringU5BU5D_t1281789340* get_ParseDayMonthYearFormats_17() const { return ___ParseDayMonthYearFormats_17; } inline StringU5BU5D_t1281789340** get_address_of_ParseDayMonthYearFormats_17() { return &___ParseDayMonthYearFormats_17; } inline void set_ParseDayMonthYearFormats_17(StringU5BU5D_t1281789340* value) { ___ParseDayMonthYearFormats_17 = value; Il2CppCodeGenWriteBarrier((&___ParseDayMonthYearFormats_17), value); } inline static int32_t get_offset_of_ParseMonthDayYearFormats_18() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___ParseMonthDayYearFormats_18)); } inline StringU5BU5D_t1281789340* get_ParseMonthDayYearFormats_18() const { return ___ParseMonthDayYearFormats_18; } inline StringU5BU5D_t1281789340** get_address_of_ParseMonthDayYearFormats_18() { return &___ParseMonthDayYearFormats_18; } inline void set_ParseMonthDayYearFormats_18(StringU5BU5D_t1281789340* value) { ___ParseMonthDayYearFormats_18 = value; Il2CppCodeGenWriteBarrier((&___ParseMonthDayYearFormats_18), value); } inline static int32_t get_offset_of_MonthDayShortFormats_19() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___MonthDayShortFormats_19)); } inline StringU5BU5D_t1281789340* get_MonthDayShortFormats_19() const { return ___MonthDayShortFormats_19; } inline StringU5BU5D_t1281789340** get_address_of_MonthDayShortFormats_19() { return &___MonthDayShortFormats_19; } inline void set_MonthDayShortFormats_19(StringU5BU5D_t1281789340* value) { ___MonthDayShortFormats_19 = value; Il2CppCodeGenWriteBarrier((&___MonthDayShortFormats_19), value); } inline static int32_t get_offset_of_DayMonthShortFormats_20() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___DayMonthShortFormats_20)); } inline StringU5BU5D_t1281789340* get_DayMonthShortFormats_20() const { return ___DayMonthShortFormats_20; } inline StringU5BU5D_t1281789340** get_address_of_DayMonthShortFormats_20() { return &___DayMonthShortFormats_20; } inline void set_DayMonthShortFormats_20(StringU5BU5D_t1281789340* value) { ___DayMonthShortFormats_20 = value; Il2CppCodeGenWriteBarrier((&___DayMonthShortFormats_20), value); } inline static int32_t get_offset_of_daysmonth_21() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___daysmonth_21)); } inline Int32U5BU5D_t385246372* get_daysmonth_21() const { return ___daysmonth_21; } inline Int32U5BU5D_t385246372** get_address_of_daysmonth_21() { return &___daysmonth_21; } inline void set_daysmonth_21(Int32U5BU5D_t385246372* value) { ___daysmonth_21 = value; Il2CppCodeGenWriteBarrier((&___daysmonth_21), value); } inline static int32_t get_offset_of_daysmonthleap_22() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___daysmonthleap_22)); } inline Int32U5BU5D_t385246372* get_daysmonthleap_22() const { return ___daysmonthleap_22; } inline Int32U5BU5D_t385246372** get_address_of_daysmonthleap_22() { return &___daysmonthleap_22; } inline void set_daysmonthleap_22(Int32U5BU5D_t385246372* value) { ___daysmonthleap_22 = value; Il2CppCodeGenWriteBarrier((&___daysmonthleap_22), value); } inline static int32_t get_offset_of_to_local_time_span_object_23() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___to_local_time_span_object_23)); } inline RuntimeObject * get_to_local_time_span_object_23() const { return ___to_local_time_span_object_23; } inline RuntimeObject ** get_address_of_to_local_time_span_object_23() { return &___to_local_time_span_object_23; } inline void set_to_local_time_span_object_23(RuntimeObject * value) { ___to_local_time_span_object_23 = value; Il2CppCodeGenWriteBarrier((&___to_local_time_span_object_23), value); } inline static int32_t get_offset_of_last_now_24() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___last_now_24)); } inline int64_t get_last_now_24() const { return ___last_now_24; } inline int64_t* get_address_of_last_now_24() { return &___last_now_24; } inline void set_last_now_24(int64_t value) { ___last_now_24 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DATETIME_T3738529785_H #ifndef MULTICASTDELEGATE_T_H #define MULTICASTDELEGATE_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.MulticastDelegate struct MulticastDelegate_t : public Delegate_t1188392813 { public: // System.MulticastDelegate System.MulticastDelegate::prev MulticastDelegate_t * ___prev_9; // System.MulticastDelegate System.MulticastDelegate::kpm_next MulticastDelegate_t * ___kpm_next_10; public: inline static int32_t get_offset_of_prev_9() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___prev_9)); } inline MulticastDelegate_t * get_prev_9() const { return ___prev_9; } inline MulticastDelegate_t ** get_address_of_prev_9() { return &___prev_9; } inline void set_prev_9(MulticastDelegate_t * value) { ___prev_9 = value; Il2CppCodeGenWriteBarrier((&___prev_9), value); } inline static int32_t get_offset_of_kpm_next_10() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___kpm_next_10)); } inline MulticastDelegate_t * get_kpm_next_10() const { return ___kpm_next_10; } inline MulticastDelegate_t ** get_address_of_kpm_next_10() { return &___kpm_next_10; } inline void set_kpm_next_10(MulticastDelegate_t * value) { ___kpm_next_10 = value; Il2CppCodeGenWriteBarrier((&___kpm_next_10), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MULTICASTDELEGATE_T_H #ifndef WELLKNOWNSERVICETYPEENTRY_T2561527180_H #define WELLKNOWNSERVICETYPEENTRY_T2561527180_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.WellKnownServiceTypeEntry struct WellKnownServiceTypeEntry_t2561527180 : public TypeEntry_t3903395172 { public: // System.Type System.Runtime.Remoting.WellKnownServiceTypeEntry::obj_type Type_t * ___obj_type_2; // System.String System.Runtime.Remoting.WellKnownServiceTypeEntry::obj_uri String_t* ___obj_uri_3; // System.Runtime.Remoting.WellKnownObjectMode System.Runtime.Remoting.WellKnownServiceTypeEntry::obj_mode int32_t ___obj_mode_4; public: inline static int32_t get_offset_of_obj_type_2() { return static_cast<int32_t>(offsetof(WellKnownServiceTypeEntry_t2561527180, ___obj_type_2)); } inline Type_t * get_obj_type_2() const { return ___obj_type_2; } inline Type_t ** get_address_of_obj_type_2() { return &___obj_type_2; } inline void set_obj_type_2(Type_t * value) { ___obj_type_2 = value; Il2CppCodeGenWriteBarrier((&___obj_type_2), value); } inline static int32_t get_offset_of_obj_uri_3() { return static_cast<int32_t>(offsetof(WellKnownServiceTypeEntry_t2561527180, ___obj_uri_3)); } inline String_t* get_obj_uri_3() const { return ___obj_uri_3; } inline String_t** get_address_of_obj_uri_3() { return &___obj_uri_3; } inline void set_obj_uri_3(String_t* value) { ___obj_uri_3 = value; Il2CppCodeGenWriteBarrier((&___obj_uri_3), value); } inline static int32_t get_offset_of_obj_mode_4() { return static_cast<int32_t>(offsetof(WellKnownServiceTypeEntry_t2561527180, ___obj_mode_4)); } inline int32_t get_obj_mode_4() const { return ___obj_mode_4; } inline int32_t* get_address_of_obj_mode_4() { return &___obj_mode_4; } inline void set_obj_mode_4(int32_t value) { ___obj_mode_4 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // WELLKNOWNSERVICETYPEENTRY_T2561527180_H #ifndef LEASE_T4051722892_H #define LEASE_T4051722892_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Lifetime.Lease struct Lease_t4051722892 : public MarshalByRefObject_t2760389100 { public: // System.DateTime System.Runtime.Remoting.Lifetime.Lease::_leaseExpireTime DateTime_t3738529785 ____leaseExpireTime_1; // System.Runtime.Remoting.Lifetime.LeaseState System.Runtime.Remoting.Lifetime.Lease::_currentState int32_t ____currentState_2; // System.TimeSpan System.Runtime.Remoting.Lifetime.Lease::_initialLeaseTime TimeSpan_t881159249 ____initialLeaseTime_3; // System.TimeSpan System.Runtime.Remoting.Lifetime.Lease::_renewOnCallTime TimeSpan_t881159249 ____renewOnCallTime_4; // System.TimeSpan System.Runtime.Remoting.Lifetime.Lease::_sponsorshipTimeout TimeSpan_t881159249 ____sponsorshipTimeout_5; // System.Collections.ArrayList System.Runtime.Remoting.Lifetime.Lease::_sponsors ArrayList_t2718874744 * ____sponsors_6; // System.Collections.Queue System.Runtime.Remoting.Lifetime.Lease::_renewingSponsors Queue_t3637523393 * ____renewingSponsors_7; // System.Runtime.Remoting.Lifetime.Lease/RenewalDelegate System.Runtime.Remoting.Lifetime.Lease::_renewalDelegate RenewalDelegate_t3744801856 * ____renewalDelegate_8; public: inline static int32_t get_offset_of__leaseExpireTime_1() { return static_cast<int32_t>(offsetof(Lease_t4051722892, ____leaseExpireTime_1)); } inline DateTime_t3738529785 get__leaseExpireTime_1() const { return ____leaseExpireTime_1; } inline DateTime_t3738529785 * get_address_of__leaseExpireTime_1() { return &____leaseExpireTime_1; } inline void set__leaseExpireTime_1(DateTime_t3738529785 value) { ____leaseExpireTime_1 = value; } inline static int32_t get_offset_of__currentState_2() { return static_cast<int32_t>(offsetof(Lease_t4051722892, ____currentState_2)); } inline int32_t get__currentState_2() const { return ____currentState_2; } inline int32_t* get_address_of__currentState_2() { return &____currentState_2; } inline void set__currentState_2(int32_t value) { ____currentState_2 = value; } inline static int32_t get_offset_of__initialLeaseTime_3() { return static_cast<int32_t>(offsetof(Lease_t4051722892, ____initialLeaseTime_3)); } inline TimeSpan_t881159249 get__initialLeaseTime_3() const { return ____initialLeaseTime_3; } inline TimeSpan_t881159249 * get_address_of__initialLeaseTime_3() { return &____initialLeaseTime_3; } inline void set__initialLeaseTime_3(TimeSpan_t881159249 value) { ____initialLeaseTime_3 = value; } inline static int32_t get_offset_of__renewOnCallTime_4() { return static_cast<int32_t>(offsetof(Lease_t4051722892, ____renewOnCallTime_4)); } inline TimeSpan_t881159249 get__renewOnCallTime_4() const { return ____renewOnCallTime_4; } inline TimeSpan_t881159249 * get_address_of__renewOnCallTime_4() { return &____renewOnCallTime_4; } inline void set__renewOnCallTime_4(TimeSpan_t881159249 value) { ____renewOnCallTime_4 = value; } inline static int32_t get_offset_of__sponsorshipTimeout_5() { return static_cast<int32_t>(offsetof(Lease_t4051722892, ____sponsorshipTimeout_5)); } inline TimeSpan_t881159249 get__sponsorshipTimeout_5() const { return ____sponsorshipTimeout_5; } inline TimeSpan_t881159249 * get_address_of__sponsorshipTimeout_5() { return &____sponsorshipTimeout_5; } inline void set__sponsorshipTimeout_5(TimeSpan_t881159249 value) { ____sponsorshipTimeout_5 = value; } inline static int32_t get_offset_of__sponsors_6() { return static_cast<int32_t>(offsetof(Lease_t4051722892, ____sponsors_6)); } inline ArrayList_t2718874744 * get__sponsors_6() const { return ____sponsors_6; } inline ArrayList_t2718874744 ** get_address_of__sponsors_6() { return &____sponsors_6; } inline void set__sponsors_6(ArrayList_t2718874744 * value) { ____sponsors_6 = value; Il2CppCodeGenWriteBarrier((&____sponsors_6), value); } inline static int32_t get_offset_of__renewingSponsors_7() { return static_cast<int32_t>(offsetof(Lease_t4051722892, ____renewingSponsors_7)); } inline Queue_t3637523393 * get__renewingSponsors_7() const { return ____renewingSponsors_7; } inline Queue_t3637523393 ** get_address_of__renewingSponsors_7() { return &____renewingSponsors_7; } inline void set__renewingSponsors_7(Queue_t3637523393 * value) { ____renewingSponsors_7 = value; Il2CppCodeGenWriteBarrier((&____renewingSponsors_7), value); } inline static int32_t get_offset_of__renewalDelegate_8() { return static_cast<int32_t>(offsetof(Lease_t4051722892, ____renewalDelegate_8)); } inline RenewalDelegate_t3744801856 * get__renewalDelegate_8() const { return ____renewalDelegate_8; } inline RenewalDelegate_t3744801856 ** get_address_of__renewalDelegate_8() { return &____renewalDelegate_8; } inline void set__renewalDelegate_8(RenewalDelegate_t3744801856 * value) { ____renewalDelegate_8 = value; Il2CppCodeGenWriteBarrier((&____renewalDelegate_8), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LEASE_T4051722892_H #ifndef RENEWALDELEGATE_T3744801856_H #define RENEWALDELEGATE_T3744801856_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Remoting.Lifetime.Lease/RenewalDelegate struct RenewalDelegate_t3744801856 : public MulticastDelegate_t { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RENEWALDELEGATE_T3744801856_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize600 = { sizeof (UnmanagedType_t523127242)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable600[36] = { UnmanagedType_t523127242::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize601 = { sizeof (ActivatedClientTypeEntry_t761233661), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable601[2] = { ActivatedClientTypeEntry_t761233661::get_offset_of_applicationUrl_2(), ActivatedClientTypeEntry_t761233661::get_offset_of_obj_type_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize602 = { sizeof (ActivatedServiceTypeEntry_t3761108592), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable602[1] = { ActivatedServiceTypeEntry_t3761108592::get_offset_of_obj_type_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize603 = { sizeof (EnvoyInfo_t22149680), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable603[1] = { EnvoyInfo_t22149680::get_offset_of_envoySinks_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize604 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize605 = { sizeof (Identity_t1873279371), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable605[7] = { Identity_t1873279371::get_offset_of__objectUri_0(), Identity_t1873279371::get_offset_of__channelSink_1(), Identity_t1873279371::get_offset_of__envoySink_2(), Identity_t1873279371::get_offset_of__clientDynamicProperties_3(), Identity_t1873279371::get_offset_of__serverDynamicProperties_4(), Identity_t1873279371::get_offset_of__objRef_5(), Identity_t1873279371::get_offset_of__disposed_6(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize606 = { sizeof (ClientIdentity_t1428046844), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable606[1] = { ClientIdentity_t1428046844::get_offset_of__proxyReference_7(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize607 = { sizeof (InternalRemotingServices_t949022444), -1, sizeof(InternalRemotingServices_t949022444_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable607[1] = { InternalRemotingServices_t949022444_StaticFields::get_offset_of__soapAttributes_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize608 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize609 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize610 = { sizeof (ObjRef_t2141158884), -1, sizeof(ObjRef_t2141158884_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable610[9] = { ObjRef_t2141158884::get_offset_of_channel_info_0(), ObjRef_t2141158884::get_offset_of_uri_1(), ObjRef_t2141158884::get_offset_of_typeInfo_2(), ObjRef_t2141158884::get_offset_of_envoyInfo_3(), ObjRef_t2141158884::get_offset_of_flags_4(), ObjRef_t2141158884::get_offset_of__serverType_5(), ObjRef_t2141158884_StaticFields::get_offset_of_MarshalledObjectRef_6(), ObjRef_t2141158884_StaticFields::get_offset_of_WellKnowObjectRef_7(), ObjRef_t2141158884_StaticFields::get_offset_of_U3CU3Ef__switchU24map21_8(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize611 = { sizeof (RemotingConfiguration_t4113740665), -1, sizeof(RemotingConfiguration_t4113740665_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable611[13] = { RemotingConfiguration_t4113740665_StaticFields::get_offset_of_applicationID_0(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_applicationName_1(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_processGuid_2(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_defaultConfigRead_3(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_defaultDelayedConfigRead_4(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of__errorMode_5(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_wellKnownClientEntries_6(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_activatedClientEntries_7(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_wellKnownServiceEntries_8(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_activatedServiceEntries_9(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_channelTemplates_10(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_clientProviderTemplates_11(), RemotingConfiguration_t4113740665_StaticFields::get_offset_of_serverProviderTemplates_12(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize612 = { sizeof (ConfigHandler_t4192437216), -1, sizeof(ConfigHandler_t4192437216_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable612[10] = { ConfigHandler_t4192437216::get_offset_of_typeEntries_0(), ConfigHandler_t4192437216::get_offset_of_channelInstances_1(), ConfigHandler_t4192437216::get_offset_of_currentChannel_2(), ConfigHandler_t4192437216::get_offset_of_currentProviderData_3(), ConfigHandler_t4192437216::get_offset_of_currentClientUrl_4(), ConfigHandler_t4192437216::get_offset_of_appName_5(), ConfigHandler_t4192437216::get_offset_of_currentXmlPath_6(), ConfigHandler_t4192437216::get_offset_of_onlyDelayedChannels_7(), ConfigHandler_t4192437216_StaticFields::get_offset_of_U3CU3Ef__switchU24map22_8(), ConfigHandler_t4192437216_StaticFields::get_offset_of_U3CU3Ef__switchU24map23_9(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize613 = { sizeof (ChannelData_t3353629972), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable613[7] = { ChannelData_t3353629972::get_offset_of_Ref_0(), ChannelData_t3353629972::get_offset_of_Type_1(), ChannelData_t3353629972::get_offset_of_Id_2(), ChannelData_t3353629972::get_offset_of_DelayLoadAsClientChannel_3(), ChannelData_t3353629972::get_offset_of__serverProviders_4(), ChannelData_t3353629972::get_offset_of__clientProviders_5(), ChannelData_t3353629972::get_offset_of__customProperties_6(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize614 = { sizeof (ProviderData_t3272123318), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable614[5] = { ProviderData_t3272123318::get_offset_of_Ref_0(), ProviderData_t3272123318::get_offset_of_Type_1(), ProviderData_t3272123318::get_offset_of_Id_2(), ProviderData_t3272123318::get_offset_of_CustomProperties_3(), ProviderData_t3272123318::get_offset_of_CustomData_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize615 = { sizeof (FormatterData_t100315018), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize616 = { sizeof (RemotingException_t2290474311), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize617 = { sizeof (RemotingServices_t1401195504), -1, sizeof(RemotingServices_t1401195504_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable617[8] = { RemotingServices_t1401195504_StaticFields::get_offset_of_uri_hash_0(), RemotingServices_t1401195504_StaticFields::get_offset_of__serializationFormatter_1(), RemotingServices_t1401195504_StaticFields::get_offset_of__deserializationFormatter_2(), RemotingServices_t1401195504_StaticFields::get_offset_of_app_id_3(), RemotingServices_t1401195504_StaticFields::get_offset_of_next_id_4(), RemotingServices_t1401195504_StaticFields::get_offset_of_methodBindings_5(), RemotingServices_t1401195504_StaticFields::get_offset_of_FieldSetterMethod_6(), RemotingServices_t1401195504_StaticFields::get_offset_of_FieldGetterMethod_7(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize618 = { sizeof (ServerIdentity_t2342208608), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable618[5] = { ServerIdentity_t2342208608::get_offset_of__objectType_7(), ServerIdentity_t2342208608::get_offset_of__serverObject_8(), ServerIdentity_t2342208608::get_offset_of__serverSink_9(), ServerIdentity_t2342208608::get_offset_of__context_10(), ServerIdentity_t2342208608::get_offset_of__lease_11(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize619 = { sizeof (ClientActivatedIdentity_t3849543081), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize620 = { sizeof (SingletonIdentity_t2425810587), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize621 = { sizeof (SingleCallIdentity_t1525242393), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize622 = { sizeof (SoapServices_t133988723), -1, sizeof(SoapServices_t133988723_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable622[5] = { SoapServices_t133988723_StaticFields::get_offset_of__xmlTypes_0(), SoapServices_t133988723_StaticFields::get_offset_of__xmlElements_1(), SoapServices_t133988723_StaticFields::get_offset_of__soapActions_2(), SoapServices_t133988723_StaticFields::get_offset_of__soapActionsMethods_3(), SoapServices_t133988723_StaticFields::get_offset_of__typeInfos_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize623 = { sizeof (TypeInfo_t3204178358), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable623[2] = { TypeInfo_t3204178358::get_offset_of_Attributes_0(), TypeInfo_t3204178358::get_offset_of_Elements_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize624 = { sizeof (TypeEntry_t3903395172), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable624[2] = { TypeEntry_t3903395172::get_offset_of_assembly_name_0(), TypeEntry_t3903395172::get_offset_of_type_name_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize625 = { sizeof (TypeInfo_t3108865556), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable625[3] = { TypeInfo_t3108865556::get_offset_of_serverType_0(), TypeInfo_t3108865556::get_offset_of_serverHierarchy_1(), TypeInfo_t3108865556::get_offset_of_interfacesImplemented_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize626 = { sizeof (WellKnownObjectMode_t3489814916)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable626[3] = { WellKnownObjectMode_t3489814916::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize627 = { sizeof (WellKnownClientTypeEntry_t1333916391), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable627[3] = { WellKnownClientTypeEntry_t1333916391::get_offset_of_obj_type_2(), WellKnownClientTypeEntry_t1333916391::get_offset_of_obj_url_3(), WellKnownClientTypeEntry_t1333916391::get_offset_of_app_url_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize628 = { sizeof (WellKnownServiceTypeEntry_t2561527180), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable628[3] = { WellKnownServiceTypeEntry_t2561527180::get_offset_of_obj_type_2(), WellKnownServiceTypeEntry_t2561527180::get_offset_of_obj_uri_3(), WellKnownServiceTypeEntry_t2561527180::get_offset_of_obj_mode_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize629 = { sizeof (ActivationServices_t4161385317), -1, sizeof(ActivationServices_t4161385317_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable629[1] = { ActivationServices_t4161385317_StaticFields::get_offset_of__constructionActivator_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize630 = { sizeof (AppDomainLevelActivator_t643114572), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable630[2] = { AppDomainLevelActivator_t643114572::get_offset_of__activationUrl_0(), AppDomainLevelActivator_t643114572::get_offset_of__next_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize631 = { sizeof (ConstructionLevelActivator_t842337821), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize632 = { sizeof (ContextLevelActivator_t975223365), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable632[1] = { ContextLevelActivator_t975223365::get_offset_of_m_NextActivator_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize633 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize634 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize635 = { sizeof (RemoteActivator_t2150046731), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize636 = { sizeof (UrlAttribute_t221584584), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable636[1] = { UrlAttribute_t221584584::get_offset_of_url_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize637 = { sizeof (ChannelInfo_t2064577689), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable637[1] = { ChannelInfo_t2064577689::get_offset_of_channelData_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize638 = { sizeof (ChannelServices_t3942013484), -1, sizeof(ChannelServices_t3942013484_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable638[5] = { ChannelServices_t3942013484_StaticFields::get_offset_of_registeredChannels_0(), ChannelServices_t3942013484_StaticFields::get_offset_of_delayedClientChannels_1(), ChannelServices_t3942013484_StaticFields::get_offset_of__crossContextSink_2(), ChannelServices_t3942013484_StaticFields::get_offset_of_CrossContextUrl_3(), ChannelServices_t3942013484_StaticFields::get_offset_of_oldStartModeTypes_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize639 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize640 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize641 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize642 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize643 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize644 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize645 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize646 = { sizeof (SinkProviderData_t4151372974), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable646[3] = { SinkProviderData_t4151372974::get_offset_of_sinkName_0(), SinkProviderData_t4151372974::get_offset_of_children_1(), SinkProviderData_t4151372974::get_offset_of_properties_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize647 = { sizeof (CrossAppDomainData_t2130208023), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable647[3] = { CrossAppDomainData_t2130208023::get_offset_of__ContextID_0(), CrossAppDomainData_t2130208023::get_offset_of__DomainID_1(), CrossAppDomainData_t2130208023::get_offset_of__processGuid_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize648 = { sizeof (CrossAppDomainChannel_t1606809047), -1, sizeof(CrossAppDomainChannel_t1606809047_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable648[1] = { CrossAppDomainChannel_t1606809047_StaticFields::get_offset_of_s_lock_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize649 = { sizeof (CrossAppDomainSink_t2177102621), -1, sizeof(CrossAppDomainSink_t2177102621_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable649[3] = { CrossAppDomainSink_t2177102621_StaticFields::get_offset_of_s_sinks_0(), CrossAppDomainSink_t2177102621_StaticFields::get_offset_of_processMessageMethod_1(), CrossAppDomainSink_t2177102621::get_offset_of__domainID_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize650 = { sizeof (Context_t3285446944), -1, sizeof(Context_t3285446944_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable650[14] = { Context_t3285446944::get_offset_of_domain_id_0(), Context_t3285446944::get_offset_of_context_id_1(), Context_t3285446944::get_offset_of_static_data_2(), Context_t3285446944_StaticFields::get_offset_of_default_server_context_sink_3(), Context_t3285446944::get_offset_of_server_context_sink_chain_4(), Context_t3285446944::get_offset_of_client_context_sink_chain_5(), Context_t3285446944::get_offset_of_datastore_6(), Context_t3285446944::get_offset_of_context_properties_7(), Context_t3285446944::get_offset_of_frozen_8(), Context_t3285446944_StaticFields::get_offset_of_global_count_9(), Context_t3285446944_StaticFields::get_offset_of_namedSlots_10(), Context_t3285446944_StaticFields::get_offset_of_global_dynamic_properties_11(), Context_t3285446944::get_offset_of_context_dynamic_properties_12(), Context_t3285446944::get_offset_of_callback_object_13(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize651 = { sizeof (DynamicPropertyCollection_t652373272), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable651[1] = { DynamicPropertyCollection_t652373272::get_offset_of__properties_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize652 = { sizeof (DynamicPropertyReg_t4086779412), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable652[2] = { DynamicPropertyReg_t4086779412::get_offset_of_Property_0(), DynamicPropertyReg_t4086779412::get_offset_of_Sink_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize653 = { sizeof (ContextCallbackObject_t2292721408), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize654 = { sizeof (ContextAttribute_t1328788465), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable654[1] = { ContextAttribute_t1328788465::get_offset_of_AttributeName_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize655 = { sizeof (CrossContextChannel_t4063984580), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize656 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize657 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize658 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize659 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize660 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize661 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize662 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize663 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize664 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize665 = { sizeof (SynchronizationAttribute_t3946661254), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable665[5] = { SynchronizationAttribute_t3946661254::get_offset_of__bReEntrant_1(), SynchronizationAttribute_t3946661254::get_offset_of__flavor_2(), SynchronizationAttribute_t3946661254::get_offset_of__lockCount_3(), SynchronizationAttribute_t3946661254::get_offset_of__mutex_4(), SynchronizationAttribute_t3946661254::get_offset_of__ownerThread_5(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize666 = { sizeof (SynchronizedClientContextSink_t1886771601), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable666[2] = { SynchronizedClientContextSink_t1886771601::get_offset_of__next_0(), SynchronizedClientContextSink_t1886771601::get_offset_of__att_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize667 = { sizeof (SynchronizedServerContextSink_t2776015682), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable667[2] = { SynchronizedServerContextSink_t2776015682::get_offset_of__next_0(), SynchronizedServerContextSink_t2776015682::get_offset_of__att_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize668 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize669 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize670 = { sizeof (Lease_t4051722892), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable670[8] = { Lease_t4051722892::get_offset_of__leaseExpireTime_1(), Lease_t4051722892::get_offset_of__currentState_2(), Lease_t4051722892::get_offset_of__initialLeaseTime_3(), Lease_t4051722892::get_offset_of__renewOnCallTime_4(), Lease_t4051722892::get_offset_of__sponsorshipTimeout_5(), Lease_t4051722892::get_offset_of__sponsors_6(), Lease_t4051722892::get_offset_of__renewingSponsors_7(), Lease_t4051722892::get_offset_of__renewalDelegate_8(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize671 = { sizeof (RenewalDelegate_t3744801856), sizeof(Il2CppMethodPointer), 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize672 = { sizeof (LeaseManager_t3648745595), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable672[2] = { LeaseManager_t3648745595::get_offset_of__objects_0(), LeaseManager_t3648745595::get_offset_of__timer_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize673 = { sizeof (LeaseSink_t3666380219), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable673[1] = { LeaseSink_t3666380219::get_offset_of__nextSink_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize674 = { sizeof (LeaseState_t747101024)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable674[6] = { LeaseState_t747101024::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize675 = { sizeof (LifetimeServices_t3061370510), -1, sizeof(LifetimeServices_t3061370510_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable675[5] = { LifetimeServices_t3061370510_StaticFields::get_offset_of__leaseManagerPollTime_0(), LifetimeServices_t3061370510_StaticFields::get_offset_of__leaseTime_1(), LifetimeServices_t3061370510_StaticFields::get_offset_of__renewOnCallTime_2(), LifetimeServices_t3061370510_StaticFields::get_offset_of__sponsorshipTimeout_3(), LifetimeServices_t3061370510_StaticFields::get_offset_of__leaseManager_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize676 = { sizeof (ArgInfoType_t1035054221)+ sizeof (RuntimeObject), sizeof(uint8_t), 0, 0 }; extern const int32_t g_FieldOffsetTable676[3] = { ArgInfoType_t1035054221::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize677 = { sizeof (ArgInfo_t3261134217), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable677[3] = { ArgInfo_t3261134217::get_offset_of__paramMap_0(), ArgInfo_t3261134217::get_offset_of__inoutArgCount_1(), ArgInfo_t3261134217::get_offset_of__method_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize678 = { sizeof (AsyncResult_t4194309572), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable678[15] = { AsyncResult_t4194309572::get_offset_of_async_state_0(), AsyncResult_t4194309572::get_offset_of_handle_1(), AsyncResult_t4194309572::get_offset_of_async_delegate_2(), AsyncResult_t4194309572::get_offset_of_data_3(), AsyncResult_t4194309572::get_offset_of_object_data_4(), AsyncResult_t4194309572::get_offset_of_sync_completed_5(), AsyncResult_t4194309572::get_offset_of_completed_6(), AsyncResult_t4194309572::get_offset_of_endinvoke_called_7(), AsyncResult_t4194309572::get_offset_of_async_callback_8(), AsyncResult_t4194309572::get_offset_of_current_9(), AsyncResult_t4194309572::get_offset_of_original_10(), AsyncResult_t4194309572::get_offset_of_gchandle_11(), AsyncResult_t4194309572::get_offset_of_call_message_12(), AsyncResult_t4194309572::get_offset_of_message_ctrl_13(), AsyncResult_t4194309572::get_offset_of_reply_message_14(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize679 = { sizeof (ClientContextTerminatorSink_t4064115021), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable679[1] = { ClientContextTerminatorSink_t4064115021::get_offset_of__context_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize680 = { sizeof (ConstructionCall_t4011594745), -1, sizeof(ConstructionCall_t4011594745_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable680[7] = { ConstructionCall_t4011594745::get_offset_of__activator_11(), ConstructionCall_t4011594745::get_offset_of__activationAttributes_12(), ConstructionCall_t4011594745::get_offset_of__contextProperties_13(), ConstructionCall_t4011594745::get_offset_of__activationType_14(), ConstructionCall_t4011594745::get_offset_of__activationTypeName_15(), ConstructionCall_t4011594745::get_offset_of__isContextOk_16(), ConstructionCall_t4011594745_StaticFields::get_offset_of_U3CU3Ef__switchU24map25_17(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize681 = { sizeof (ConstructionCallDictionary_t686578562), -1, sizeof(ConstructionCallDictionary_t686578562_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable681[3] = { ConstructionCallDictionary_t686578562_StaticFields::get_offset_of_InternalKeys_6(), ConstructionCallDictionary_t686578562_StaticFields::get_offset_of_U3CU3Ef__switchU24map28_7(), ConstructionCallDictionary_t686578562_StaticFields::get_offset_of_U3CU3Ef__switchU24map29_8(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize682 = { sizeof (EnvoyTerminatorSink_t3654193516), -1, sizeof(EnvoyTerminatorSink_t3654193516_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable682[1] = { EnvoyTerminatorSink_t3654193516_StaticFields::get_offset_of_Instance_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize683 = { sizeof (Header_t549724581), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable683[4] = { Header_t549724581::get_offset_of_HeaderNamespace_0(), Header_t549724581::get_offset_of_MustUnderstand_1(), Header_t549724581::get_offset_of_Name_2(), Header_t549724581::get_offset_of_Value_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize684 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize685 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize686 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize687 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize688 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize689 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize690 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize691 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize692 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize693 = { sizeof (LogicalCallContext_t3342013719), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable693[2] = { LogicalCallContext_t3342013719::get_offset_of__data_0(), LogicalCallContext_t3342013719::get_offset_of__remotingData_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize694 = { sizeof (CallContextRemotingData_t2260963392), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable694[1] = { CallContextRemotingData_t2260963392::get_offset_of__logicalCallID_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize695 = { sizeof (MethodCall_t861078140), -1, sizeof(MethodCall_t861078140_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable695[11] = { MethodCall_t861078140::get_offset_of__uri_0(), MethodCall_t861078140::get_offset_of__typeName_1(), MethodCall_t861078140::get_offset_of__methodName_2(), MethodCall_t861078140::get_offset_of__args_3(), MethodCall_t861078140::get_offset_of__methodSignature_4(), MethodCall_t861078140::get_offset_of__methodBase_5(), MethodCall_t861078140::get_offset_of__callContext_6(), MethodCall_t861078140::get_offset_of__genericArguments_7(), MethodCall_t861078140::get_offset_of_ExternalProperties_8(), MethodCall_t861078140::get_offset_of_InternalProperties_9(), MethodCall_t861078140_StaticFields::get_offset_of_U3CU3Ef__switchU24map24_10(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize696 = { sizeof (MethodCallDictionary_t605791082), -1, sizeof(MethodCallDictionary_t605791082_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable696[1] = { MethodCallDictionary_t605791082_StaticFields::get_offset_of_InternalKeys_6(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize697 = { sizeof (MethodDictionary_t207894204), -1, sizeof(MethodDictionary_t207894204_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable697[6] = { MethodDictionary_t207894204::get_offset_of__internalProperties_0(), MethodDictionary_t207894204::get_offset_of__message_1(), MethodDictionary_t207894204::get_offset_of__methodKeys_2(), MethodDictionary_t207894204::get_offset_of__ownProperties_3(), MethodDictionary_t207894204_StaticFields::get_offset_of_U3CU3Ef__switchU24map26_4(), MethodDictionary_t207894204_StaticFields::get_offset_of_U3CU3Ef__switchU24map27_5(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize698 = { sizeof (DictionaryEnumerator_t2516729552), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable698[3] = { DictionaryEnumerator_t2516729552::get_offset_of__methodDictionary_0(), DictionaryEnumerator_t2516729552::get_offset_of__hashtableEnum_1(), DictionaryEnumerator_t2516729552::get_offset_of__posMethod_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize699 = { sizeof (MethodReturnDictionary_t2551046119), -1, sizeof(MethodReturnDictionary_t2551046119_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable699[2] = { MethodReturnDictionary_t2551046119_StaticFields::get_offset_of_InternalReturnKeys_6(), MethodReturnDictionary_t2551046119_StaticFields::get_offset_of_InternalExceptionKeys_7(), }; #ifdef __clang__ #pragma clang diagnostic pop #endif
43.064559
189
0.82765
Eiris
2fd4c8d17f85ba02e4d3189526c846d4cd314961
338
cpp
C++
Cpp/657.robot-return-origin.cpp
zszyellow/leetcode
2ef6be04c3008068f8116bf28d70586e613a48c2
[ "MIT" ]
1
2015-12-19T23:05:35.000Z
2015-12-19T23:05:35.000Z
Cpp/657.robot-return-origin.cpp
zszyellow/leetcode
2ef6be04c3008068f8116bf28d70586e613a48c2
[ "MIT" ]
null
null
null
Cpp/657.robot-return-origin.cpp
zszyellow/leetcode
2ef6be04c3008068f8116bf28d70586e613a48c2
[ "MIT" ]
null
null
null
class Solution { public: bool judgeCircle(string moves) { map<char, int> move_counts{{'U', 0}, {'D', 0}, {'L', 0}, {'R', 0}}; for (char &move : moves) { move_counts[move] ++; } return move_counts['U'] - move_counts['D'] == 0 && move_counts['L'] - move_counts['R'] == 0; } };
30.727273
75
0.476331
zszyellow
7c7d2dd37f0dbbb0619720940a7f4111d0afb4e9
1,196
hpp
C++
projects/entity_store/include/EntityStore/Internal/Entity.hpp
antaljanosbenjamin/miscellaneous
56d2f0030d1d8ff0dd6dd077c3d1ec981f6c2747
[ "MIT" ]
2
2021-06-24T21:46:56.000Z
2021-09-24T07:51:04.000Z
projects/entity_store/include/EntityStore/Internal/Entity.hpp
antaljanosbenjamin/miscellaneous
56d2f0030d1d8ff0dd6dd077c3d1ec981f6c2747
[ "MIT" ]
null
null
null
projects/entity_store/include/EntityStore/Internal/Entity.hpp
antaljanosbenjamin/miscellaneous
56d2f0030d1d8ff0dd6dd077c3d1ec981f6c2747
[ "MIT" ]
null
null
null
#pragma once #include "EntityStore/Properties.hpp" #include "EntityStore/Property.hpp" // Design principle: The more compile time check you do, the less runtime error you get! // // I. Every property of an Entity has a fixed type (the title is std::string, the // timestamp is double, etc.). // II. The id property is special, every Entity has an id which cannot be changed. // III. Every modification on Entity objects should be done through the store, but the properties of an Entity should be // readable throught the Entity object itself. namespace EntityStore { using EntityId = uint64_t; class Entity final { public: explicit Entity(const EntityId id_); Entity(const EntityId id_, Properties properties_); Entity(const Entity &) = default; Entity(Entity &&) = default; Entity &operator=(const Entity &) = default; Entity &operator=(Entity &&) = default; ~Entity() = default; const EntityId &id() const; const Properties &properties() const &; Properties &&properties() &&; void update(const Properties &properties_); void update(Properties &&properties_); private: EntityId m_id; Properties m_properties; }; } // namespace EntityStore
28.47619
120
0.7199
antaljanosbenjamin
7c817312ada6fafeb90141cbddac215e20860881
806
cpp
C++
src/wnd.cpp
tstih/nice
a242dc78ec446dadaa3f275b15acda92922c39bf
[ "MIT" ]
null
null
null
src/wnd.cpp
tstih/nice
a242dc78ec446dadaa3f275b15acda92922c39bf
[ "MIT" ]
null
null
null
src/wnd.cpp
tstih/nice
a242dc78ec446dadaa3f275b15acda92922c39bf
[ "MIT" ]
2
2020-11-26T16:49:43.000Z
2021-08-17T12:17:13.000Z
// // wnd.cpp // // Window class implementation. // // (c) 2021 Tomaz Stih // This code is licensed under MIT license (see LICENSE.txt for details). // // 09.05.2021 tstih // #include "nice.hpp" namespace nice { //{{BEGIN.DEF}} void wnd::repaint(void) { native()->repaint(); } std::string wnd::get_title() { return native()->get_title(); } void wnd::set_title(std::string s) { native()->set_title(s); } size wnd::get_wsize() { return native()->get_wsize(); } void wnd::set_wsize(size sz) { native()->set_wsize(sz); } pt wnd::get_location() { return native()->get_location(); } void wnd::set_location(pt location) { native()->set_location(location); } rct wnd::get_paint_area() { return native()->get_paint_area(); }; //{{END.DEF}} }
26
78
0.605459
tstih
7c92a621d2594672a145aade59f5fc113fd8da6d
1,641
cpp
C++
apps/cc/PrintVisitor.cpp
lemoniac/arca
f21953a95711a1b194cc0da81f9d6d108b25868b
[ "MIT" ]
null
null
null
apps/cc/PrintVisitor.cpp
lemoniac/arca
f21953a95711a1b194cc0da81f9d6d108b25868b
[ "MIT" ]
null
null
null
apps/cc/PrintVisitor.cpp
lemoniac/arca
f21953a95711a1b194cc0da81f9d6d108b25868b
[ "MIT" ]
null
null
null
#include <iostream> #include "PrintVisitor.h" #include "Expression.h" #include "Function.h" #include "TranslationUnit.h" int PrintVisitor::visit(Function &f) { std::cout << "Function: " << f.name << std::endl; for(auto &p : f.parameters) std::cout << " Parameter: " << p->name << std::endl; visit(*f.statements.get()); return 0; } int PrintVisitor::visit(StatementBlock &block) { for(const auto &l : block.locals) std::cout << " local " << int(l->declSpec.type) << " " << l->name << std::endl; for(const auto &s : block.statements) s->visit(this); return 0; } int PrintVisitor::visit(If &ifStatement) { return 0; } int PrintVisitor::visit(While &statement) { return 0; } int PrintVisitor::visit(ReturnStatement &ret) { return 0; } int PrintVisitor::visit(TranslationUnit &unit) { for(auto &g : unit.globals) std::cout << " global " << int(g->declSpec.type) << " " << g->name << std::endl; for(auto &f : unit.functions) f->visit(this); return 0; } int PrintVisitor::visit(Assignment &assignment) { return 0; } int PrintVisitor::visit(GotoStatement &gotoStatement) { return 0; } int PrintVisitor::visit(LabelStatement &label) { return 0; } int PrintVisitor::visit(IntConstant &constant) { return 0; } int PrintVisitor::visit(IdentifierExpr &identifier) { return 0; } int PrintVisitor::visit(BinaryOpExpr &op) { return 0; } int PrintVisitor::visit(FunctionCallExpr &call) { IdentifierExpr *function = dynamic_cast<IdentifierExpr *>(call.function.get()); std::cout << " " << function->name << "()" << std::endl; }
23.112676
91
0.636807
lemoniac
7c9acee4cf2fb78520667585be4b3c2f8f51d22e
9,517
cpp
C++
testbench/test.cpp
Golui/jpet-online-compress
bb992a7c68c64ba8139114e50aeaa41ae2f023fd
[ "MIT" ]
null
null
null
testbench/test.cpp
Golui/jpet-online-compress
bb992a7c68c64ba8139114e50aeaa41ae2f023fd
[ "MIT" ]
null
null
null
testbench/test.cpp
Golui/jpet-online-compress
bb992a7c68c64ba8139114e50aeaa41ae2f023fd
[ "MIT" ]
null
null
null
#include "ansu_fpga.hpp" #include "driver.hpp" #include "ansu.hpp" #include "ansu/io/archive.hpp" #include "ansu/io/table_archive.hpp" #include "ansu/util.hpp" #include "CLI11.hpp" #include "cereal/types/array.hpp" #include <array> #include <chrono> #include <cstdlib> #include <iomanip> #include <iostream> #include <stdexcept> #include <stdio.h> struct SpecialValidator : public CLI::Validator { SpecialValidator() { name_ = "ANSUSPECIAL"; func_ = [](const std::string& str) { if(str != "" && str != "static") return std::string("Not a special table type."); return std::string(""); }; } }; template <typename T> std::streamsize getFileSize(T& file) { file.clear(); // Since ignore will have set eof. file.seekg(0, std::ios_base::beg); file.ignore(std::numeric_limits<std::streamsize>::max()); std::streamsize length = file.gcount(); file.clear(); // Since ignore will have set eof. file.seekg(0, std::ios_base::beg); return length; } u32 filter(ANS::backend::side_stream<typename ContextT::SymbolT>& in, ANS::backend::side_stream<typename ContextT::ReducedSymbolT>& out) { using SideSymbolT = ANS::backend::side<typename ContextT::SymbolT>; using SideReducedSymbolT = ANS::backend::side<typename ContextT::ReducedSymbolT>; bool hadAny = false; bool hadLast = false; SideReducedSymbolT buffer[4]; SideSymbolT cur[4]; u32 count = 0; while(!in.empty()) { for(u32 i = 0; i < 4; i++) { in >> cur[i]; if(cur[i].last) hadLast = true; } bool skip = false; for(u32 i = 0; i < 4; i++) { skip |= !mainCtxPtr->ansTable.hasSymbolInAlphabet(cur[i].data); } if(!skip) { if(hadAny) { for(u32 i = 0; i < 4; i++) out << buffer[i]; count += 4; } for(u32 i = 0; i < 4; i++) { SideReducedSymbolT& rcur = buffer[i]; rcur.data = mainCtxPtr->ansTable.reverseAlphabet(cur[i].data); rcur.last = false; } hadAny = true; } } if(hadAny) { if(hadLast) buffer[3].last = true; for(u32 i = 0; i < 4; i++) out << buffer[i]; count += 4; } return count; } template <typename SymbolT> int compressTask(ANS::driver::compress::OptionsP opts, std::istream& in) { using StateT = typename ContextT::StateT; using ReducedSymbolT = typename ContextT::ReducedSymbolT; using Meta = typename ContextT::Meta; using InDataT = ANS::backend::side<SymbolT>; using CharT = std::istream::char_type; constexpr auto streamCharSize = sizeof(CharT); auto& mainCtx = *mainCtxPtr; mainCtx.setCheckpointFrequency(opts->checkpoint); mainCtx.setChunkSize(opts->chunkSize); ANS::io::ArchiveWriter<ContextT> writer(opts->outFilePath); writer.bindContext(mainCtxPtr); auto begin = std::chrono::steady_clock::now(); const auto symbolWidth = (ANS::integer::nextPowerOfTwo(mainCtx.ansTable.symbolWidth()) >> 3); const auto chunkByteSize = opts->chunkSize * symbolWidth; std::array<u64, 256> counts = {0}; SymbolT* msgbuf = new SymbolT[opts->chunkSize]; StateT* statebuf = new StateT[opts->checkpoint]; ANS::backend::side_stream<SymbolT> msg("Message"); ANS::backend::side_stream<ReducedSymbolT> fmsg("FilteredMessage"); ANS::backend::stream<StateT> out("Output"); ANS::backend::stream<Meta> ometa("Meta"); // TODO we only support types with power of 2 widths u32 j = 0; u64 dataWritten = 0; u64 inSize = 0; while(in.peek() != EOF) { u32 i = 0; in.read((CharT*) msgbuf, chunkByteSize / streamCharSize); u64 read = in.gcount(); u64 readSymbols = read / symbolWidth; for(decltype(read) k = 0; k < read; k++) { counts[((u8*) msgbuf)[k]]++; } u32 validSymbols = 0; if(read != chunkByteSize || in.peek() == EOF) { for(; i < readSymbols - 1; i++) { auto data = InDataT(); data.data = msgbuf[i]; msg << data; } auto data = InDataT(); data.data = msgbuf[i]; data.last = true; msg << data; } else { for(; i < readSymbols; i++) { auto data = InDataT(); data.data = msgbuf[i]; msg << data; } } validSymbols = filter(msg, fmsg); fpga_compress(fmsg, out, ometa); inSize += validSymbols * symbolWidth; while(!out.empty()) { for(; !out.empty() && j < opts->checkpoint; j++) statebuf[j] = out.read(); if(!ometa.empty()) { Meta meta = ometa.read(); auto result = writer.writeBlock(j, statebuf, meta); dataWritten += result; j = 0; } } } if(!ometa.empty()) { Meta meta = ometa.read(); auto result = writer.writeBlock(0, statebuf, meta); dataWritten += result; if(!ometa.empty()) { std::cerr << "Too many meta objects! Aborting." << std::endl; return EXIT_FAILURE; } } inSize *= sizeof(std::istream::char_type); // TODO encapsualte header, think of a better way to track inputSize writer.header.inputSize = inSize; if(inSize % symbolWidth != 0) { std::cerr << "The given data does not evenly divide into symbols of width " << mainCtx.ansTable.symbolWidth() << " bits. Aborting." << std::endl; return EXIT_FAILURE; } if(opts->printSummary != ANS::driver::SummaryType::None) { auto end = std::chrono::steady_clock::now(); auto timeS = std::chrono::duration_cast<std::chrono::microseconds>(end - begin) .count() / 1.0e6; auto outSize = getFileSize(writer.fileHandle); double entropy = 0.0; u64 sum = 0; for(u16 k = 0; k < 256; k++) sum += counts[k]; for(u16 k = 0; k < 256; k++) { u32 count = counts[k]; if(count != 0) entropy -= count / double(sum) * (log2(count / double(sum))); } auto entropy2percent = 100 / (symbolWidth << 3); auto dataWrittenBytes = dataWritten * sizeof(std::fstream::char_type); auto percentageFull = 100.0 * outSize / ((double) inSize); auto percentageData = 100.0 * dataWrittenBytes / ((double) inSize); auto percentageTheory = entropy * entropy2percent; auto entropyFull = percentageFull / entropy2percent; auto entropyData = percentageData / entropy2percent; auto entrUnit = " bits/byte"; switch(opts->printSummary) { case ANS::driver::SummaryType::Human: { std::cout << std::setprecision(6); std::cout << "Done! Took " << timeS << "s \n"; std::cout << "Stats:" << "\n"; std::cout << "\t" << "Input size: " << inSize << "\n"; std::cout << "\t" << "Output size: " << outSize << "\n"; std::cout << "\t\t" << "Header size: " << writer.getHeader().totalHeaderSize << "\n"; std::cout << "\t\t" << "Data size: " << dataWrittenBytes << "\n"; std::cout << "\t" << "Ratio:\n" << "\t\t Full file: " << percentageFull << "%\n" << "\t\t Without Header: " << percentageData << "%\n" << "\t\t Theoretical best: " << percentageTheory << "%\n"; std::cout << "\t" << "Entropy:\n" << "\t\t Full file: " << entropyFull << entrUnit << "\n" << "\t\t Without Header: " << entropyData << entrUnit << "\n" << "\t\t Theoretical best: " << entropy << entrUnit << "\n"; break; } case ANS::driver::SummaryType::CSV: { std::cout << std::setprecision(6); std::cout << timeS << ", " << inSize << ", " << outSize << ", " << writer.getHeader().totalHeaderSize << ", " << dataWrittenBytes << ", " << percentageFull << ", " << percentageData << ", " << percentageTheory << ", " << entropyFull << ", " << entropyData << ", " << entropy << "\n"; break; } default: break; } } delete[] msgbuf; delete[] statebuf; return 0; } int run(ANS::driver::compress::OptionsP opts) { std::ifstream inFile = std::ifstream(opts->inFilePath, std::ios::binary); return compressTask<message_t>(opts, inFile); } void ANS::driver::compress::subRegister(CLI::App& app) { CLI::App* sub = app.add_subcommand("compress"); auto opts = std::make_shared<Options>(); sub->add_option("-f,--infile", opts->inFilePath, "the file to compress.") ->check(CLI::ExistingFile); sub->add_option("-o,--outfile", opts->outFilePath, "the resulting archive"); sub->add_option("-s", opts->printSummary, "Whether to print no, a human readable, or csv formatted " "summary after compressing or not.") ->transform( CLI::CheckedTransformer(SUMMARY_STR_TO_ENUM, CLI::ignore_case)); sub->add_flag("--warn-unknown-symbol", opts->warnUnknownSymbol, "Warn if an unknown symbol is encountered in the file."); sub->add_option( "-c", opts->checkpoint, "NYI"); // "Specfy how often a checkpoint should be emitted. This is used to " // "verify data integrity, but increases the file size."); sub->add_option( "-n", opts->channels, "NYI"); // "Specify how many channels (parallel coders) should be used."); sub->add_option( "-l", opts->chunkSize, "NYI"); //"How much data to consume per function call."); sub->add_option( "-a", opts->alphabet, "NYI") // "The length of the alphabet when generating") ->transform( CLI::CheckedTransformer(ALPHABET_STR_TO_ENUM, CLI::ignore_case)); sub->add_option("-k", opts->tableSizeLog, "NYI"); // "Logarithm of the table size."); sub->final_callback([opts]() { run(opts); }); } int main(int argc, const char** argv) { CLI::App app {"ansu - a tANS implementation targeting FPGAs."}; ANS::driver::compress::subRegister(app); app.require_subcommand(1); try { app.parse(argc, argv); } catch(const CLI::ParseError& e) { return app.exit(e); } return 0; }
24.591731
86
0.613954
Golui
7ca818d649bc46c05d71da2a840fe141d1f2d4c1
966
hpp
C++
stats.hpp
TomGlint/ANSim
f02edc65a80fbbcf3bc812f4f6841658571c2024
[ "MIT" ]
null
null
null
stats.hpp
TomGlint/ANSim
f02edc65a80fbbcf3bc812f4f6841658571c2024
[ "MIT" ]
null
null
null
stats.hpp
TomGlint/ANSim
f02edc65a80fbbcf3bc812f4f6841658571c2024
[ "MIT" ]
null
null
null
// $Id$ #ifndef _STATS_HPP_ #define _STATS_HPP_ #include "module.hpp" class Stats : public Module { long long int _num_samples; double _sample_sum; double _sample_squared_sum; //bool _reset; double _min; double _max; long long int _num_bins; double _bin_size; vector<long long int> _hist; public: Stats(Module *parent, const string &name, double bin_size = 1.0, long long int num_bins = 10); void Clear(); double Average() const; double Variance() const; double Max() const; double Min() const; double Sum() const; double SquaredSum() const; long long int NumSamples() const; void AddSample(double val); inline void AddSample(long long int val) { AddSample((double)val); } long long int GetBin(long long int b) { return _hist[b]; } void Display(ostream &os = cout) const; friend ostream &operator<<(ostream &os, const Stats &s); }; ostream &operator<<(ostream &os, const Stats &s); #endif
18.226415
60
0.68323
TomGlint
7cb0462b627f151d0d6f62ae63baead8a3f8c689
588
cpp
C++
die-tk/ControlParams.cpp
thinlizzy/die-tk
eba597d9453318b03e44f15753323be80ecb3a4e
[ "Artistic-2.0" ]
11
2015-11-06T01:35:35.000Z
2021-05-01T18:34:50.000Z
die-tk/ControlParams.cpp
thinlizzy/die-tk
eba597d9453318b03e44f15753323be80ecb3a4e
[ "Artistic-2.0" ]
null
null
null
die-tk/ControlParams.cpp
thinlizzy/die-tk
eba597d9453318b03e44f15753323be80ecb3a4e
[ "Artistic-2.0" ]
2
2017-07-06T16:05:51.000Z
2019-07-04T01:17:15.000Z
#include "ControlParams.h" #include <ostream> namespace tk { std::ostream & operator<<(std::ostream & os, ControlParams const & cp) { os << "start " << cp.start_ << " dims " << cp.dims_; if( ! cp.visible_ ) os << " invisible"; if( cp.backgroundColor_ ) os << " background " << *cp.backgroundColor_; if( cp.cursor_ != tk::Cursor::defaultCursor ) os << " cursor " << int(cp.cursor_); if( cp.scrollbar_ != tk::Scrollbar::none ) os << " scrollbar " << int(cp.scrollbar_); if( cp.autosize_ ) os << " autosize"; if( ! cp.text_.empty() ) os << " '" << cp.text_ << "'"; return os; } }
30.947368
86
0.605442
thinlizzy
7cb18e843f09ac0fee9880d37b1c4621b1725b7b
6,714
cpp
C++
Editor/Sources/o2Editor/AnimationWindow/TrackControls/KeyFramesTrackControl.cpp
zenkovich/o2
cdbf10271f1bf0f3198c8005b13b66e6ca13a9db
[ "MIT" ]
181
2015-12-09T08:53:36.000Z
2022-03-26T20:48:39.000Z
Editor/Sources/o2Editor/AnimationWindow/TrackControls/KeyFramesTrackControl.cpp
zenkovich/o2
cdbf10271f1bf0f3198c8005b13b66e6ca13a9db
[ "MIT" ]
29
2016-04-22T08:24:04.000Z
2022-03-06T07:06:28.000Z
Editor/Sources/o2Editor/AnimationWindow/TrackControls/KeyFramesTrackControl.cpp
zenkovich/o2
cdbf10271f1bf0f3198c8005b13b66e6ca13a9db
[ "MIT" ]
13
2018-04-24T17:12:04.000Z
2021-11-12T23:49:53.000Z
#include "o2Editor/stdafx.h" #include "KeyFramesTrackControl.h" template<> DECLARE_CLASS_MANUAL(Editor::KeyFramesTrackControl<AnimationTrack<float>>); template<> DECLARE_CLASS_MANUAL(Editor::KeyFramesTrackControl<AnimationTrack<bool>>); template<> DECLARE_CLASS_MANUAL(Editor::KeyFramesTrackControl<AnimationTrack<Color4>>); template<> DECLARE_CLASS_MANUAL(Editor::KeyFramesTrackControl<AnimationTrack<Vec2F>>); namespace Editor { void DrawCurveInCoords(const ApproximationValue* points, int pointsCount, const RectF& pointsBounds, const Basis& drawBasis, const Color4& color) { const int bufferSize = 50; static Vertex2 buffer[bufferSize]; if (pointsBounds.Height() < 0.001f) { o2Render.DrawAALine(Vec2F(0.0f, 0.5f)*drawBasis, Vec2F(1.0f, 0.5f)*drawBasis, color); return; } Basis boundsBasis(pointsBounds); Basis transform = boundsBasis.Inverted() * drawBasis; for (int j = 0; j < pointsCount; j++) buffer[j].Set(Vec2F(points[j].position, points[j].value)*transform, color.ABGR(), 0, 0); o2Render.DrawAAPolyLine(buffer, pointsCount, 1.0f, LineType::Solid, false); } void DrawCenterCurveInCoords(const Vec2F* points, int pointsCount, const RectF& pointsBounds, const Basis& drawBasis, const Color4& color) { const int bufferSize = 50; static Vertex2 buffer[bufferSize]; Basis boundsBasis(pointsBounds); Basis boundsBasisInv = boundsBasis.Inverted(); Basis newDrawBasis(drawBasis.origin + drawBasis.yv*0.5f, drawBasis.xv, drawBasis.yv); for (int j = 0; j < pointsCount; j++) { Vec2F p = points[j] * boundsBasisInv; p.y -= p.x; buffer[j].Set(p * newDrawBasis, color.ABGR(), 0, 0); } o2Render.DrawAAPolyLine(buffer, pointsCount, 1.0f, LineType::Solid, false); } template<> void KeyFramesTrackControl<AnimationTrack<float>>::SetCurveViewEnabled(bool enabled) { mAddKeyDotButton->enabled = enabled; mAddKeyButton->enabled = !enabled; } template<> void KeyFramesTrackControl<AnimationTrack<float>>::Draw() { if (!mResEnabledInHierarchy) return; if (!mHandlesSheet->enabled) return; OnDrawn(); o2Render.EnableScissorTest(mTimeline->layout->GetWorldRect()); for (int i = 1; i < mTrack->GetKeys().Count(); i++) { auto& key = mTrack->GetKeys()[i]; auto& prevKey = mTrack->GetKeys()[i - 1]; Basis drawCoords(RectF(mTimeline->LocalToWorld(prevKey.position) - 3, layout->GetWorldTop() - 5, mTimeline->LocalToWorld(key.position) - 3, layout->GetWorldBottom() + 5)); DrawCurveInCoords(key.GetApproximatedPoints(), key.GetApproximatedPointsCount(), key.GetGetApproximatedPointsBounds(), drawCoords, Color4(44, 62, 80)); } for (auto handle : mHandles) handle->handle->Draw(); o2Render.DisableScissorTest(); DrawDebugFrame(); } template<> void KeyFramesTrackControl<AnimationTrack<Color4>>::Draw() { if (!mResEnabledInHierarchy) return; if (!mHandlesSheet->enabled) return; OnDrawn(); if (!mTrack->GetKeys().IsEmpty()) { static TextureRef chessBackTexture; static Sprite chessBackSprite; if (!chessBackTexture) { Color4 color1(1.0f, 1.0f, 1.0f, 1.0f), color2(0.7f, 0.7f, 0.7f, 1.0f); Bitmap backLayerBitmap(PixelFormat::R8G8B8A8, Vec2I(16, 16)); backLayerBitmap.Fill(color1); backLayerBitmap.FillRect(0, 8, 8, 0, color2); backLayerBitmap.FillRect(8, 16, 16, 8, color2); chessBackTexture = TextureRef(&backLayerBitmap); chessBackSprite = Sprite(chessBackTexture, RectI(0, 0, 16, 16)); chessBackSprite.mode = SpriteMode::Tiled; } chessBackSprite.SetRect(RectF(mTimeline->LocalToWorld(mTrack->GetKeys()[0].position), layout->GetWorldTop() - 5, mTimeline->LocalToWorld(mTrack->GetKeys().Last().position), layout->GetWorldBottom() + 4)); chessBackSprite.Draw(); static Mesh mesh; int verticies = mTrack->GetKeys().Count()*2; int polygons = (mTrack->GetKeys().Count() - 1)*2; if (mesh.GetMaxVertexCount() < verticies) mesh.Resize(verticies, polygons); mesh.vertexCount = verticies; mesh.polyCount = polygons; o2Render.EnableScissorTest(mTimeline->layout->GetWorldRect()); for (int i = 0; i < mTrack->GetKeys().Count(); i++) { auto& key = mTrack->GetKeys()[i]; float keyPos = mTimeline->LocalToWorld(key.position); int nv = i*2; mesh.vertices[nv] = Vertex2(keyPos, layout->GetWorldTop() - 5, key.value.ABGR(), 0, 0); mesh.vertices[nv + 1] = Vertex2(keyPos, layout->GetWorldBottom() + 4, key.value.ABGR(), 0, 0); if (i > 0) { int np = (i - 1)*2; mesh.indexes[np*3] = nv - 2; mesh.indexes[np*3 + 1] = nv; mesh.indexes[np*3 + 2] = nv - 1; mesh.indexes[np*3 + 3] = nv; mesh.indexes[np*3 + 4] = nv + 1; mesh.indexes[np*3 + 5] = nv - 1; } } mesh.Draw(); } for (auto handle : mHandles) handle->handle->Draw(); o2Render.DisableScissorTest(); DrawDebugFrame(); } template<> void KeyFramesTrackControl<AnimationTrack<bool>>::Draw() { if (!mResEnabledInHierarchy) return; if (!mHandlesSheet->enabled) return; OnDrawn(); if (!mTrack->GetKeys().IsEmpty()) { float lineOffset = 11; static Mesh mesh; int verticies = (mTrack->GetKeys().Count() - 1)*4; int polygons = (mTrack->GetKeys().Count() - 1)*2; if (mesh.GetMaxVertexCount() < verticies) mesh.Resize(verticies, polygons); mesh.vertexCount = verticies; mesh.polyCount = polygons; o2Render.EnableScissorTest(mTimeline->layout->GetWorldRect()); Color4 trueColor(44, 62, 80); Color4 falseColor(0, 0, 0, 0); for (int i = 1; i < mTrack->GetKeys().Count(); i++) { auto& key = mTrack->GetKeys()[i]; auto& prevKey = mTrack->GetKeys()[i - 1]; float keyPos = mTimeline->LocalToWorld(key.position); float prevKeyPos = mTimeline->LocalToWorld(prevKey.position); int nv = (i - 1)*4; int np = (i - 1)*2; auto color = (prevKey.value ? trueColor : falseColor).ABGR(); mesh.vertices[nv] = Vertex2(prevKeyPos, layout->GetWorldTop() - lineOffset, color, 0, 0); mesh.vertices[nv + 1] = Vertex2(keyPos, layout->GetWorldTop() - lineOffset, color, 0, 0); mesh.vertices[nv + 2] = Vertex2(keyPos, layout->GetWorldBottom() + lineOffset, color, 0, 0); mesh.vertices[nv + 3] = Vertex2(prevKeyPos, layout->GetWorldBottom() + lineOffset, color, 0, 0); mesh.indexes[np*3] = nv; mesh.indexes[np*3 + 1] = nv + 1; mesh.indexes[np*3 + 2] = nv + 2; mesh.indexes[np*3 + 3] = nv; mesh.indexes[np*3 + 4] = nv + 2; mesh.indexes[np*3 + 5] = nv + 3; } mesh.Draw(); } for (auto handle : mHandles) handle->handle->Draw(); o2Render.DisableScissorTest(); DrawDebugFrame(); } }
27.292683
125
0.665773
zenkovich
7cb1bdbe4f70949d38f6d450721f644f55d31869
899
cpp
C++
tests/util/test_multivec.cpp
ajoudaki/Project2020-seq-tensor-sketching
20b19ddd19751840d33af97abe314d29b34dc0d4
[ "MIT" ]
7
2020-12-07T11:33:17.000Z
2022-01-02T07:30:52.000Z
tests/util/test_multivec.cpp
ajoudaki/Project2020-seq-tensor-sketching
20b19ddd19751840d33af97abe314d29b34dc0d4
[ "MIT" ]
26
2021-01-13T18:15:23.000Z
2022-02-27T05:52:59.000Z
tests/util/test_multivec.cpp
ajoudaki/Project2020-seq-tensor-sketching
20b19ddd19751840d33af97abe314d29b34dc0d4
[ "MIT" ]
2
2021-01-06T15:03:10.000Z
2022-01-02T07:18:45.000Z
#include "util/utils.hpp" #include <gtest/gtest.h> #include <random> namespace { template <typename T> class Pow : public ::testing::Test {}; typedef ::testing::Types<uint64_t, uint32_t> PowTypes; TYPED_TEST_SUITE(Pow, PowTypes); TYPED_TEST(Pow, Zero) { std::mt19937 rng(123457); std::uniform_int_distribution<std::mt19937::result_type> dist(0, 10000); for (uint32_t i = 0; i < 10; ++i) { EXPECT_EQ(1, ts::int_pow<TypeParam>(dist(rng), 0)); } } TYPED_TEST(Pow, Random) { std::mt19937 rng(123457); std::uniform_int_distribution<std::mt19937::result_type> dist(0, 10); std::uniform_int_distribution<std::mt19937::result_type> pow_dist(0, 5); for (uint32_t i = 0; i < 10; ++i) { TypeParam base = pow_dist(rng); TypeParam exp = dist(rng); EXPECT_EQ(std::pow(base, exp), ts::int_pow<TypeParam>(base, exp)); } } } // namespace
24.297297
76
0.650723
ajoudaki
7cb32a1975e693bd4564cbfe8082ae870cc8007b
4,591
cpp
C++
Source/Tools/ShaderCompiler/ShaderCompiler.cpp
amerkoleci/alimer
f47b80e0790a42a65366c88c3024a0dfdafb1e1b
[ "MIT" ]
291
2017-09-30T09:07:49.000Z
2022-03-22T13:09:21.000Z
Source/Tools/ShaderCompiler/ShaderCompiler.cpp
amerkoleci/alimer
f47b80e0790a42a65366c88c3024a0dfdafb1e1b
[ "MIT" ]
12
2018-01-14T01:54:53.000Z
2021-02-19T06:14:01.000Z
Source/Tools/ShaderCompiler/ShaderCompiler.cpp
amerkoleci/alimer
f47b80e0790a42a65366c88c3024a0dfdafb1e1b
[ "MIT" ]
16
2018-05-03T08:15:31.000Z
2022-02-25T09:03:16.000Z
// Copyright © Amer Koleci and Contributors. // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. #include "ShaderCompiler.h" #include <cxxopts.hpp> #if __has_include(<filesystem>) #include <filesystem> namespace fs = std::filesystem; #elif __has_include(<experimental/filesystem>) #include <experimental/filesystem> namespace fs = std::experimental::filesystem; #else error "Missing the <filesystem> header." #endif using namespace std; using namespace cxxopts; bool CommandLineOptions::parse(int argc, char** argv) { Options options(argv[0], "Batch shader compiler for NVRHI"); string platformName; options.add_options() ("i,infile", "File with the list of shaders to compile", value(inputFile)) ("o,out", "Output directory", value(outputPath)) ("p,parallel", "Compile shaders in multiple CPU threads", value(parallel)) ("v,verbose", "Print commands before executing them", value(verbose)) ("f,force", "Treat all source files as modified", value(force)) ("k,keep", "Keep intermediate files", value(keep)) ("c,compiler", "Path to the compiler executable (FXC or DXC)", value(compilerPath)) ("I,include", "Include paths", value(includePaths)) ("D,define", "Additional defines", value(additionalDefines)) ("ignore", "Include files to ignore", value(ignoreFileNames)) ("cflags", "Additional compiler command line options", value(additionalCompilerOptions)) ("P,platform", "Target shader bytecode type, one of: DXBC, DXIL, SPIRV", value(platformName)) ("vk-t-shift", "Register shift for texture (t#) resources on SPIR-V", value(vulkanTextureShift)) ("vk-s-shift", "Register shift for sampler (s#) resources on SPIR-V", value(vulkanSamplerShift)) ("vk-b-shift", "Register shift for constant (b#) resources on SPIR-V", value(vulkanConstantShift)) ("vk-u-shift", "Register shift for UAV (u#) resources on SPIR-V", value(vulkanUavShift)) ("h,help", "Print the help message", value(help)); try { options.parse(argc, argv); if (help) { errorMessage = options.help(); return false; } if (compilerPath.empty()) throw OptionException("Compiler path not specified"); if (!fs::exists(compilerPath)) throw OptionException("Specified compiler executable (" + compilerPath + ") does not exist"); if (inputFile.empty()) throw OptionException("Input file not specified"); if (!fs::exists(inputFile)) throw OptionException("Specified input file (" + inputFile + ") does not exist"); if (outputPath.empty()) throw OptionException("Output path not specified"); if (platformName.empty()) throw OptionException("Platform not specified"); for (char& c : platformName) c = (char)toupper(c); if (platformName == "DXIL") compilePlatform = Platform::DXIL; else if (platformName == "SPIRV" || platformName == "SPIR-V") compilePlatform = Platform::SPIRV; else throw OptionException("Unrecognized platform: " + platformName); //if (argc > 1) // throw OptionException("Unexpected positional arguments"); return true; } catch (const OptionException& e) { errorMessage = e.what(); return false; } } bool CompilerOptions::parse(const std::string& line) { std::vector<char*> tokens; const char* delimiters = " \t"; char* name = strtok(const_cast<char*>(line.c_str()), delimiters); tokens.push_back(name); // argv[0] shaderName = name; while (char* token = strtok(NULL, delimiters)) tokens.push_back(token); Options options("shaderCompilerConfig", "Configuration options for a shader"); options.add_options() ("E", "Entry point", value(entryPoint)) ("T", "Shader target", value(target)) ("D", "Definitions", value(definitions)) ("o", "Output path", value(outputPath)); try { int argc = (int)tokens.size(); char** argv = tokens.data(); options.parse(argc, argv); if (target.empty()) throw OptionException("Shader target not specified"); //if (argc > 1) // throw OptionException("Unexpected positional arguments"); } catch (const OptionException& e) { errorMessage = e.what(); return false; } return true; }
34.007407
106
0.626443
amerkoleci
7cb3c8345c265a5b2663aee3c14207b79a31ed84
10,573
hpp
C++
include/codegen/include/Zenject/FactoryFromBinderBase.hpp
Futuremappermydud/Naluluna-Modifier-Quest
bfda34370764b275d90324b3879f1a429a10a873
[ "MIT" ]
1
2021-11-12T09:29:31.000Z
2021-11-12T09:29:31.000Z
include/codegen/include/Zenject/FactoryFromBinderBase.hpp
Futuremappermydud/Naluluna-Modifier-Quest
bfda34370764b275d90324b3879f1a429a10a873
[ "MIT" ]
null
null
null
include/codegen/include/Zenject/FactoryFromBinderBase.hpp
Futuremappermydud/Naluluna-Modifier-Quest
bfda34370764b275d90324b3879f1a429a10a873
[ "MIT" ]
2
2021-10-03T02:14:20.000Z
2021-11-12T09:29:36.000Z
// Autogenerated from CppHeaderCreator on 7/27/2020 3:10:43 PM // Created by Sc2ad // ========================================================================= #pragma once #pragma pack(push, 8) // Begin includes #include "utils/typedefs.h" // Including type: Zenject.ScopeConcreteIdArgConditionCopyNonLazyBinder #include "Zenject/ScopeConcreteIdArgConditionCopyNonLazyBinder.hpp" // Including type: System.Guid #include "System/Guid.hpp" #include "utils/il2cpp-utils.hpp" // Completed includes // Begin forward declares // Forward declaring namespace: Zenject namespace Zenject { // Forward declaring type: DiContainer class DiContainer; // Forward declaring type: FactoryBindInfo class FactoryBindInfo; // Forward declaring type: BindInfo class BindInfo; // Forward declaring type: IProvider class IProvider; // Skipping declaration: ConditionCopyNonLazyBinder because it is already included! // Forward declaring type: ConcreteBinderGeneric`1<TContract> template<typename TContract> class ConcreteBinderGeneric_1; // Forward declaring type: InjectContext class InjectContext; // Forward declaring type: NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder class NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder; } // Forward declaring namespace: System namespace System { // Forward declaring type: Type class Type; // Forward declaring type: Func`2<TResult, T> template<typename TResult, typename T> class Func_2; // Forward declaring type: Func`2<TResult, T> template<typename TResult, typename T> class Func_2; } // Forward declaring namespace: System::Collections::Generic namespace System::Collections::Generic { // Forward declaring type: IEnumerable`1<T> template<typename T> class IEnumerable_1; } // Forward declaring namespace: UnityEngine namespace UnityEngine { // Forward declaring type: GameObject class GameObject; // Forward declaring type: Object class Object; } // Completed forward declares // Type namespace: Zenject namespace Zenject { // Autogenerated type: Zenject.FactoryFromBinderBase class FactoryFromBinderBase : public Zenject::ScopeConcreteIdArgConditionCopyNonLazyBinder { public: // Nested type: Zenject::FactoryFromBinderBase::$get_AllParentTypes$d__17 class $get_AllParentTypes$d__17; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass20_0 class $$c__DisplayClass20_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass21_0 class $$c__DisplayClass21_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass23_0 class $$c__DisplayClass23_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass24_0 class $$c__DisplayClass24_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass26_0 class $$c__DisplayClass26_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass27_0 class $$c__DisplayClass27_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass28_0 class $$c__DisplayClass28_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass29_0 class $$c__DisplayClass29_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass30_0 class $$c__DisplayClass30_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass31_0 class $$c__DisplayClass31_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass32_0 class $$c__DisplayClass32_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass33_0 class $$c__DisplayClass33_0; // Nested type: Zenject::FactoryFromBinderBase::$$c__DisplayClass34_0 class $$c__DisplayClass34_0; // private Zenject.DiContainer <BindContainer>k__BackingField // Offset: 0x20 Zenject::DiContainer* BindContainer; // private Zenject.FactoryBindInfo <FactoryBindInfo>k__BackingField // Offset: 0x28 Zenject::FactoryBindInfo* FactoryBindInfo; // private System.Type <ContractType>k__BackingField // Offset: 0x30 System::Type* ContractType; // public System.Void .ctor(Zenject.DiContainer bindContainer, System.Type contractType, Zenject.BindInfo bindInfo, Zenject.FactoryBindInfo factoryBindInfo) // Offset: 0xF1A5E8 static FactoryFromBinderBase* New_ctor(Zenject::DiContainer* bindContainer, System::Type* contractType, Zenject::BindInfo* bindInfo, Zenject::FactoryBindInfo* factoryBindInfo); // Zenject.DiContainer get_BindContainer() // Offset: 0xF1A6D0 Zenject::DiContainer* get_BindContainer(); // private System.Void set_BindContainer(Zenject.DiContainer value) // Offset: 0xF1A6D8 void set_BindContainer(Zenject::DiContainer* value); // protected Zenject.FactoryBindInfo get_FactoryBindInfo() // Offset: 0xF1A6E0 Zenject::FactoryBindInfo* get_FactoryBindInfo(); // private System.Void set_FactoryBindInfo(Zenject.FactoryBindInfo value) // Offset: 0xF1A6E8 void set_FactoryBindInfo(Zenject::FactoryBindInfo* value); // System.Func`2<Zenject.DiContainer,Zenject.IProvider> get_ProviderFunc() // Offset: 0xF1A6F0 System::Func_2<Zenject::DiContainer*, Zenject::IProvider*>* get_ProviderFunc(); // System.Void set_ProviderFunc(System.Func`2<Zenject.DiContainer,Zenject.IProvider> value) // Offset: 0xF1A70C void set_ProviderFunc(System::Func_2<Zenject::DiContainer*, Zenject::IProvider*>* value); // protected System.Type get_ContractType() // Offset: 0xF1A728 System::Type* get_ContractType(); // private System.Void set_ContractType(System.Type value) // Offset: 0xF1A730 void set_ContractType(System::Type* value); // public System.Collections.Generic.IEnumerable`1<System.Type> get_AllParentTypes() // Offset: 0xF1A738 System::Collections::Generic::IEnumerable_1<System::Type*>* get_AllParentTypes(); // public Zenject.ConditionCopyNonLazyBinder FromNew() // Offset: 0xF1A7FC Zenject::ConditionCopyNonLazyBinder* FromNew(); // public Zenject.ConditionCopyNonLazyBinder FromResolve() // Offset: 0xF1A834 Zenject::ConditionCopyNonLazyBinder* FromResolve(); // public Zenject.ConditionCopyNonLazyBinder FromInstance(System.Object instance) // Offset: 0xF1A918 Zenject::ConditionCopyNonLazyBinder* FromInstance(::Il2CppObject* instance); // public Zenject.ConditionCopyNonLazyBinder FromResolve(System.Object subIdentifier) // Offset: 0xF1A83C Zenject::ConditionCopyNonLazyBinder* FromResolve(::Il2CppObject* subIdentifier); // Zenject.ConcreteBinderGeneric`1<T> CreateIFactoryBinder(System.Guid factoryId) // Offset: 0x13D4494 template<class T> Zenject::ConcreteBinderGeneric_1<T>* CreateIFactoryBinder(System::Guid& factoryId) { return CRASH_UNLESS(il2cpp_utils::RunGenericMethod<Zenject::ConcreteBinderGeneric_1<T>*>(this, "CreateIFactoryBinder", {il2cpp_utils::il2cpp_type_check::il2cpp_no_arg_class<T>::get()}, factoryId)); } // public Zenject.ConditionCopyNonLazyBinder FromComponentOn(UnityEngine.GameObject gameObject) // Offset: 0xF1AA24 Zenject::ConditionCopyNonLazyBinder* FromComponentOn(UnityEngine::GameObject* gameObject); // public Zenject.ConditionCopyNonLazyBinder FromComponentOn(System.Func`2<Zenject.InjectContext,UnityEngine.GameObject> gameObjectGetter) // Offset: 0xF1AB30 Zenject::ConditionCopyNonLazyBinder* FromComponentOn(System::Func_2<Zenject::InjectContext*, UnityEngine::GameObject*>* gameObjectGetter); // public Zenject.ConditionCopyNonLazyBinder FromComponentOnRoot() // Offset: 0xF1AC2C Zenject::ConditionCopyNonLazyBinder* FromComponentOnRoot(); // public Zenject.ConditionCopyNonLazyBinder FromNewComponentOn(UnityEngine.GameObject gameObject) // Offset: 0xF1ACA8 Zenject::ConditionCopyNonLazyBinder* FromNewComponentOn(UnityEngine::GameObject* gameObject); // public Zenject.ConditionCopyNonLazyBinder FromNewComponentOn(System.Func`2<Zenject.InjectContext,UnityEngine.GameObject> gameObjectGetter) // Offset: 0xF1ADB4 Zenject::ConditionCopyNonLazyBinder* FromNewComponentOn(System::Func_2<Zenject::InjectContext*, UnityEngine::GameObject*>* gameObjectGetter); // public Zenject.NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder FromNewComponentOnNewPrefab(UnityEngine.Object prefab) // Offset: 0xF1AEB0 Zenject::NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder* FromNewComponentOnNewPrefab(UnityEngine::Object* prefab); // public Zenject.NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder FromComponentInNewPrefab(UnityEngine.Object prefab) // Offset: 0xF1B020 Zenject::NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder* FromComponentInNewPrefab(UnityEngine::Object* prefab); // public Zenject.NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder FromComponentInNewPrefabResource(System.String resourcePath) // Offset: 0xF1B17C Zenject::NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder* FromComponentInNewPrefabResource(::Il2CppString* resourcePath); // public Zenject.NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder FromNewComponentOnNewPrefabResource(System.String resourcePath) // Offset: 0xF1B2D8 Zenject::NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder* FromNewComponentOnNewPrefabResource(::Il2CppString* resourcePath); // public Zenject.ConditionCopyNonLazyBinder FromNewScriptableObjectResource(System.String resourcePath) // Offset: 0xF1B440 Zenject::ConditionCopyNonLazyBinder* FromNewScriptableObjectResource(::Il2CppString* resourcePath); // public Zenject.ConditionCopyNonLazyBinder FromScriptableObjectResource(System.String resourcePath) // Offset: 0xF1B540 Zenject::ConditionCopyNonLazyBinder* FromScriptableObjectResource(::Il2CppString* resourcePath); // public Zenject.ConditionCopyNonLazyBinder FromResource(System.String resourcePath) // Offset: 0xF1B640 Zenject::ConditionCopyNonLazyBinder* FromResource(::Il2CppString* resourcePath); // private Zenject.IProvider <.ctor>b__0_0(Zenject.DiContainer container) // Offset: 0xF1B730 Zenject::IProvider* $_ctor$b__0_0(Zenject::DiContainer* container); // private UnityEngine.GameObject <FromComponentOnRoot>b__25_0(Zenject.InjectContext ctx) // Offset: 0xF1B7E0 UnityEngine::GameObject* $FromComponentOnRoot$b__25_0(Zenject::InjectContext* ctx); }; // Zenject.FactoryFromBinderBase } DEFINE_IL2CPP_ARG_TYPE(Zenject::FactoryFromBinderBase*, "Zenject", "FactoryFromBinderBase"); #pragma pack(pop)
54.220513
203
0.779344
Futuremappermydud
7cb588d5198e6a493c7967ccf3c1cab62e752189
496
hpp
C++
library/ATF/_log_case_charselectInfo.hpp
lemkova/Yorozuya
f445d800078d9aba5de28f122cedfa03f26a38e4
[ "MIT" ]
29
2017-07-01T23:08:31.000Z
2022-02-19T10:22:45.000Z
library/ATF/_log_case_charselectInfo.hpp
kotopes/Yorozuya
605c97d3a627a8f6545cc09f2a1b0a8afdedd33a
[ "MIT" ]
90
2017-10-18T21:24:51.000Z
2019-06-06T02:30:33.000Z
library/ATF/_log_case_charselectInfo.hpp
kotopes/Yorozuya
605c97d3a627a8f6545cc09f2a1b0a8afdedd33a
[ "MIT" ]
44
2017-12-19T08:02:59.000Z
2022-02-24T23:15:01.000Z
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually #pragma once #include <common/common.h> #include <_log_case_charselect.hpp> START_ATF_NAMESPACE namespace Info { using _log_case_charselectsize2_ptr = int (WINAPIV*)(struct _log_case_charselect*); using _log_case_charselectsize2_clbk = int (WINAPIV*)(struct _log_case_charselect*, _log_case_charselectsize2_ptr); }; // end namespace Info END_ATF_NAMESPACE
33.066667
123
0.766129
lemkova
7cc020304b6fdb6265d62ac7c1e96f9481564b8a
938
cpp
C++
src/test/key_io_tests.cpp
Cryptario/tidecoin
550b726eb7f39730086522676a9c74e40d672a81
[ "MIT" ]
30
2021-01-05T02:08:40.000Z
2022-01-21T09:32:10.000Z
src/test/key_io_tests.cpp
Cryptario/tidecoin
550b726eb7f39730086522676a9c74e40d672a81
[ "MIT" ]
8
2021-03-15T08:14:30.000Z
2022-02-02T11:37:14.000Z
src/test/key_io_tests.cpp
Cryptario/tidecoin
550b726eb7f39730086522676a9c74e40d672a81
[ "MIT" ]
20
2021-01-09T00:03:48.000Z
2022-03-07T11:58:35.000Z
// Copyright (c) 2011-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <test/data/key_io_invalid.json.h> #include <test/data/key_io_valid.json.h> #include <key.h> #include <key_io.h> #include <script/script.h> #include <util/strencodings.h> #include <test/test_bitcoin.h> #include <boost/test/unit_test.hpp> #include <univalue.h> extern UniValue read_json(const std::string& jsondata); BOOST_FIXTURE_TEST_SUITE(key_io_tests, BasicTestingSetup) // Goal: check that parsed keys match test payload BOOST_AUTO_TEST_CASE(key_io_valid_parse) { } // Goal: check that generated keys match test vectors BOOST_AUTO_TEST_CASE(key_io_valid_gen) { } // Goal: check that base58 parsing code is robust against a variety of corrupted data BOOST_AUTO_TEST_CASE(key_io_invalid) { } BOOST_AUTO_TEST_SUITE_END()
22.333333
85
0.782516
Cryptario
7cc52759b3de12665267e5a58fde4d830ef7cc9f
5,089
cpp
C++
src/cpp/llnms-core/llnms/networking/NetworkModule.cpp
marvins/LLNMS
ebc15418e1a5dddafdb3e55cea4e8cb71f619b2d
[ "MIT" ]
null
null
null
src/cpp/llnms-core/llnms/networking/NetworkModule.cpp
marvins/LLNMS
ebc15418e1a5dddafdb3e55cea4e8cb71f619b2d
[ "MIT" ]
null
null
null
src/cpp/llnms-core/llnms/networking/NetworkModule.cpp
marvins/LLNMS
ebc15418e1a5dddafdb3e55cea4e8cb71f619b2d
[ "MIT" ]
1
2020-12-16T09:28:26.000Z
2020-12-16T09:28:26.000Z
/** * @file NetworkModule.cpp * @author Marvin Smith * @date 2/14/2014 */ #include "NetworkModule.hpp" #include "../utilities/FilesystemUtilities.hpp" #include "../utilities/StringUtilities.hpp" #include <algorithm> #include <exception> #include <fstream> #include <iostream> namespace LLNMS{ namespace NETWORK{ /* * Constructor for Network Module */ NetworkModule::NetworkModule(){ /// Set the default LLNMS_HOME m_LLNMS_HOME = "/var/tmp/llnms"; // look for an LLNMS_HOME Environment variable if( getenv("LLNMS_HOME") != NULL ){ m_LLNMS_HOME = getenv("LLNMS_HOME"); } // set LLNMS_Home in the different modules m_network_hosts.LLNMS_HOME() = m_LLNMS_HOME; m_network_definitions.LLNMS_HOME() = m_LLNMS_HOME; } /** * Parameterized Constructor */ NetworkModule::NetworkModule( const std::string& LLNMS_HOME ){ /// Set the new llnms_home m_LLNMS_HOME = LLNMS_HOME; /// set LLNMS_Home in each of the containers m_network_hosts.LLNMS_HOME() = LLNMS_HOME; m_network_definitions.LLNMS_HOME() = LLNMS_HOME; } /** * Get the LLNMS Home */ std::string NetworkModule::get_LLNMS_HOME()const{ return m_LLNMS_HOME; } /** * Set the LLNMS Module */ void NetworkModule::set_LLNMS_HOME( const std::string& LLNMS_HOME ){ m_LLNMS_HOME = LLNMS_HOME; // update the llnms home variable in each of the container m_network_definitions.LLNMS_HOME() = m_LLNMS_HOME; m_network_hosts.LLNMS_HOME() = m_LLNMS_HOME; } /** * Grab the network definitions */ std::deque<NetworkDefinition> NetworkModule::network_definitions()const{ /// create output std::deque<NetworkDefinition> output; /// load the output NetworkDefinitionContainer::const_iterator it = m_network_definitions.begin(); NetworkDefinitionContainer::const_iterator eit = m_network_definitions.end(); for( ; it != eit; it++ ){ output.push_back( (*it) ); } /// return the container return output; } /** * Retrieve a list of scanned network hosts */ std::vector<NetworkHost> NetworkModule::scanned_network_hosts()const{ /// just call the network host module return m_network_hosts.scanned_network_hosts(); } /** * Start a network scan */ void NetworkModule::start_scan(){ // create the command std::string command = m_LLNMS_HOME + std::string("/bin/llnms-scan-networks &"); std::string message_output; LLNMS::UTILITIES::run_command( command, message_output ); } /** * Update the network list */ void NetworkModule::update(){ /// Update the Network Definition Container m_network_definitions.update(); /// Update the Network Host Container m_network_hosts.update(); } /** * Create a new network */ std::string NetworkModule::create_network( const std::string& network_name, const std::string& address_start, const std::string& address_end ){ // create a new filename std::string header = string_toLower(network_name); for( size_t i=0; i<header.size(); i++ ){ if( header[i] == ' ' ){ header[i] = '_'; } } // if the solo path does not exist, then create it, otherwise create a unique name std::string filename = m_LLNMS_HOME + std::string("/networks/") + header + ".llnms-network.xml"; if( boost::filesystem::exists( filename ) != false ){ int index = 1; std::string tempFilename; while( true ){ tempFilename = m_LLNMS_HOME + std::string("/networks/") + header + num2str(index) + ".llnms-network.xml"; if( boost::filesystem::exists( tempFilename ) == true ){ index++; } else{ filename = tempFilename; break; } } } // open and write out the file std::ofstream fout; fout.open(filename.c_str()); fout << "<llnms-network>" << std::endl; fout << " <name>" << network_name << "</name>" << std::endl; fout << " <address-start>" << address_start << "</address-start>" << std::endl; fout << " <address-end>" << address_end << "</address-end>" << std::endl; fout << "</llnms-network>" << std::endl; fout.close(); return filename; } /** * Delete a network */ void NetworkModule::delete_network( const int& index, std::string& message_output ){ // make sure the bounds are correct if( index < 0 || index >= m_network_definitions.size() ){ throw std::runtime_error("Referenced network module does not exist."); } // delete the file std::string command = m_LLNMS_HOME + std::string("/bin/llnms-remove-network -n \"") + (*(m_network_definitions.begin()+index)).name() + std::string("\""); // run the system command LLNMS::UTILITIES::run_command(command, message_output); // erase the entry m_network_definitions.erase( m_network_definitions.begin() + index ); } } /// End of NETWORK Namespace } /// End of LLNMS Namespace
25.832487
158
0.631951
marvins
7cc56016ff713dc1489092c1d3184994a4c9598b
10,672
cpp
C++
main.cpp
msnh2012/ConvTest
e06b226b084bf4341c61a1dc33499820ca308228
[ "MIT" ]
4
2021-01-09T04:44:11.000Z
2021-03-30T07:56:52.000Z
main.cpp
msnh2012/ConvTest
e06b226b084bf4341c61a1dc33499820ca308228
[ "MIT" ]
null
null
null
main.cpp
msnh2012/ConvTest
e06b226b084bf4341c61a1dc33499820ca308228
[ "MIT" ]
null
null
null
#include <iostream> void demo0() { float F[] = {1,2,3,4,5,6,7,8,9}; float K[] = {1,2,3,4,5,6,7,8,9}; float O = 0; int width = 3; int height = 3; int kSizeX = 3; int kSizeY = 3; for(int m=0;m<kSizeY;m++) { for(int n=0;n<kSizeX;n++) { O+=K[m*kSizeX+n]*F[m*width+n]; } } std::cout<<O<<" "; } void demo1() { // (height + 2 * paddingY - (dilationY * (kSizeY - 1) + 1)) / strideY + 1; // (width + 2 * paddingX - (dilationX * (kSizeX - 1) + 1)) / strideX + 1; float F[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; float K[] = {1,2,3,4,5,6,7,8,9}; float O[] = {0,0,0,0}; int padX = 0; int padY = 0; int dilationX = 1; int dilationY = 1; int strideX = 1; int strideY = 1; int width = 4; int height = 4; int kSizeX = 3; int kSizeY = 3; int outH = (height+2*padY-(dilationY*(kSizeY-1)+1)) / strideY + 1; int outW = (width+2*padX-(dilationX*(kSizeX-1)+1)) / strideX + 1; for(int i=0;i<outH;i++) { for(int j=0;j<outW;j++) { for(int m=0;m<kSizeY;m++) { for(int n=0;n<kSizeX;n++) { O[i*outW+j]+=K[m*kSizeX+n]*F[(m+i)*width+(n+j)]; } } } } for (int i = 0; i < outH; ++i) { for (int j = 0; j < outW; ++j) { std::cout<<O[i*outW+j]<<" "; } std::cout<<std::endl; } } void demo2() { // (height + 2 * paddingY - (dilationY * (kSizeY - 1) + 1)) / strideY + 1; // (width + 2 * paddingX - (dilationX * (kSizeX - 1) + 1)) / strideX + 1; float F[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; float K[] = {1,2,3,4}; //float K[] = {1,2,3,4,5,6,7,8,9}; float O[] = {0,0,0,0}; int padX = 0; int padY = 0; int dilationX = 1; int dilationY = 1; int strideX = 2; int strideY = 2; int width = 4; int height = 4; int kSizeX = 2; int kSizeY = 2; int outH = (height+2*padY-(dilationY*(kSizeY-1)+1)) / strideY + 1; int outW = (width+2*padX-(dilationX*(kSizeX-1)+1)) / strideX + 1; for(int i=0;i<outH;i++) { for(int j=0;j<outW;j++) { for(int m=0;m<kSizeY;m++) { for(int n=0;n<kSizeX;n++) { O[i*outW+j]+=K[m*kSizeX+n]*F[(m+i*strideY)*width+(n+j*strideX)]; } } } } for (int i = 0; i < outH; ++i) { for (int j = 0; j < outW; ++j) { std::cout<<O[i*outW+j]<<" "; } std::cout<<std::endl; } } void demo3() { // (height + 2 * paddingY - (dilationY * (kSizeY - 1) + 1)) / strideY + 1; // (width + 2 * paddingX - (dilationX * (kSizeX - 1) + 1)) / strideX + 1; float F[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; //float K[] = {1,2,3,4}; float K[] = {1,2,3,4,5,6,7,8,9}; float O[] = {0,0,0,0}; int padX = 1; int padY = 1; int dilationX = 1; int dilationY = 1; int strideX = 2; int strideY = 2; int width = 4; int height = 4; int kSizeX = 3; int kSizeY = 3; int outH = (height+2*padY-(dilationY*(kSizeY-1)+1)) / strideY + 1; int outW = (width+2*padX-(dilationX*(kSizeX-1)+1)) / strideX + 1; for(int i=0;i<outH;i++) { for(int j=0;j<outW;j++) { for(int m=0;m<kSizeY;m++) { for(int n=0;n<kSizeX;n++) { float fVal = 0; //考虑边界强情况 if((n+j*strideX-padX)>-1&&(m+i*strideY-padY>-1)&&(n+j*strideX-padX)<=width&&(m+i*strideY-padY>-1)<=height) { fVal = F[(m+i*strideY-padX)*width+(n+j*strideX-padY)]; } O[i*outW+j]+=K[m*kSizeX+n]*fVal; } } } } for (int i = 0; i < outH; ++i) { for (int j = 0; j < outW; ++j) { std::cout<<O[i*outW+j]<<" "; } std::cout<<std::endl; } } void demo4() { // (height + 2 * paddingY - (dilationY * (kSizeY - 1) + 1)) / strideY + 1; // (width + 2 * paddingX - (dilationX * (kSizeX - 1) + 1)) / strideX + 1; float F[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; //float K[] = {1,2,3,4}; float K[] = {1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9}; float O[] = {0,0,0,0}; int padX = 1; int padY = 1; int dilationX = 1; int dilationY = 1; int strideX = 2; int strideY = 2; int width = 4; int height = 4; int kSizeX = 3; int kSizeY = 3; int channel = 2; int outH = (height+2*padY-(dilationY*(kSizeY-1)+1)) / strideY + 1; int outW = (width+2*padX-(dilationX*(kSizeX-1)+1)) / strideX + 1; for (int c = 0; c < channel; ++c) { for(int i=0;i<outH;i++) { for(int j=0;j<outW;j++) { for(int m=0;m<kSizeY;m++) { for(int n=0;n<kSizeX;n++) { float fVal = 0; if((n+j*strideX-padX)>-1&&(m+i*strideY-padY>-1)&&(n+j*strideX-padX)<=width&&(m+i*strideY-padY>-1)<=height) { fVal = F[c*width*height + (m+i*strideY-padX)*width+(n+j*strideX-padY)]; } O[i*outW+j]+=K[c*kSizeX*kSizeY+m*kSizeX+n]*fVal; } } } } } for (int i = 0; i < outH; ++i) { for (int j = 0; j < outW; ++j) { std::cout<<O[i*outW+j]<<" "; } std::cout<<std::endl; } } void demo5() { // (height + 2 * paddingY - (dilationY * (kSizeY - 1) + 1)) / strideY + 1; // (width + 2 * paddingX - (dilationX * (kSizeX - 1) + 1)) / strideX + 1; float F[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; //float K[] = {1,2,3,4}; float K[] = {1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9, 1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9 }; float O[] = {0,0,0,0,0,0,0,0}; int padX = 1; int padY = 1; int dilationX = 1; int dilationY = 1; int strideX = 2; int strideY = 2; int width = 4; int height = 4; int kSizeX = 3; int kSizeY = 3; int channel = 2; int filters = 2; int outH = (height+2*padY-(dilationY*(kSizeY-1)+1)) / strideY + 1; int outW = (width+2*padX-(dilationX*(kSizeX-1)+1)) / strideX + 1; int outC = filters; for (int oc = 0; oc < outC; ++oc) { for (int c = 0; c < channel; ++c) { for(int i=0;i<outH;i++) { for(int j=0;j<outW;j++) { for(int m=0;m<kSizeY;m++) { for(int n=0;n<kSizeX;n++) { float fVal = 0; if((n+j*strideX-padX)>-1&&(m+i*strideY-padY>-1)&&(n+j*strideX-padX)<=width&&(m+i*strideY-padY>-1)<=height) { fVal = F[c*width*height + (m+i*strideY-padX)*width+(n+j*strideX-padY)]; } O[oc*outH*outW+i*outW+j]+=K[oc*channel*kSizeX*kSizeY+c*kSizeX*kSizeY+m*kSizeX+n]*fVal; } } } } } } for (int oc = 0; oc < outC; ++oc) { for (int i = 0; i < outH; ++i) { for (int j = 0; j < outW; ++j) { std::cout<<O[oc*outH*outW+i*outW+j]<<" "; } std::cout<<std::endl; } std::cout<<std::endl<<std::endl; } } void demo6() { // (height + 2 * paddingY - (dilationY * (kSizeY - 1) + 1)) / strideY + 1; // (width + 2 * paddingX - (dilationX * (kSizeX - 1) + 1)) / strideX + 1; float F[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; //float K[] = {1,2,3,4}; float K[] = {1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9, 1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9 }; float O[] = {0,0,0,0,0,0,0,0}; int padX = 1; int padY = 1; int dilationX = 2; int dilationY = 2; int strideX = 1; int strideY = 1; int width = 4; int height = 4; int kSizeX = 3; int kSizeY = 3; int channel = 2; int filters = 2; int outH = (height+2*padY-(dilationY*(kSizeY-1)+1)) / strideY + 1; int outW = (width+2*padX-(dilationX*(kSizeX-1)+1)) / strideX + 1; int outC = filters; for (int oc = 0; oc < outC; ++oc) { for (int c = 0; c < channel; ++c) { for(int i=0;i<outH;i++) { for(int j=0;j<outW;j++) { for(int m=0;m<kSizeY;m++) { for(int n=0;n<kSizeX;n++) { float fVal = 0; if( ((n+j*strideX)*dilationX-padX)>-1 && ((m+i*strideY)*dilationY-padY)>-1&& ((n+j*strideX)*dilationX-padX)<=width && ((m+i*strideY)*dilationY-padY>-1)<=height) { fVal = F[c*width*height + ((m+i*strideY)*dilationX-padX)*width+((n+j*strideX)*dilationY-padY)]; } O[oc*outH*outW+i*outW+j]+=K[oc*channel*kSizeX*kSizeY+c*kSizeX*kSizeY+m*kSizeX+n]*fVal; } } } } } } for (int oc = 0; oc < outC; ++oc) { for (int i = 0; i < outH; ++i) { for (int j = 0; j < outW; ++j) { std::cout<<O[oc*outH*outW+i*outW+j]<<" "; } std::cout<<std::endl; } std::cout<<std::endl; } } int main(int argc, char *argv[]) { //demo0(); //demo1(); //demo2(); //demo3(); //demo4(); //demo5(); demo6(); }
26.09291
135
0.387744
msnh2012
7cd4ce4c664a8c171d2761443fea8de0c21cbecb
1,178
cpp
C++
A_Construct_a_Rectangle.cpp
jnvshubham7/cpp-programming
7d00f4a3b97b9308e337c5d3547fd3edd47c5e0b
[ "Apache-2.0" ]
1
2021-12-22T12:37:36.000Z
2021-12-22T12:37:36.000Z
A_Construct_a_Rectangle.cpp
jnvshubham7/CPP_Programming
a17c4a42209556495302ca305b7c3026df064041
[ "Apache-2.0" ]
null
null
null
A_Construct_a_Rectangle.cpp
jnvshubham7/CPP_Programming
a17c4a42209556495302ca305b7c3026df064041
[ "Apache-2.0" ]
null
null
null
#include<bits/stdc++.h> using namespace std; #define fileio freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout) int main(){ // fileio; int t; cin>>t; while(t--){ int a,b,c; cin>>a>>b>>c; if(a==b){ if(c%2==0){ cout<<"YES"<<endl; } else{ cout<<"NO"<<endl; } } else if(a==c){ if(b%2==0){ cout<<"YES"<<endl; } else{ cout<<"NO"<<endl; } } else if(b==c){ if(a%2==0){ cout<<"YES"<<endl; } else{ cout<<"NO"<<endl; } } else if(a==b+c){ cout<<"YES"<<endl; } else if(a+b==c){ cout<<"YES"<<endl; } else if(a+c==b){ cout<<"YES"<<endl; } else{ cout<<"NO"<<endl; } } return 0; }
20.310345
82
0.270798
jnvshubham7
7cd5d876ef31e358fe85ccf68ad1aab531d64e9f
874
cpp
C++
ABC/ABC083/ABC083B.cpp
uzumal/AtCoder
2d4bc326c29fb6bf1badcfd80077d9e2154e34de
[ "MIT" ]
null
null
null
ABC/ABC083/ABC083B.cpp
uzumal/AtCoder
2d4bc326c29fb6bf1badcfd80077d9e2154e34de
[ "MIT" ]
null
null
null
ABC/ABC083/ABC083B.cpp
uzumal/AtCoder
2d4bc326c29fb6bf1badcfd80077d9e2154e34de
[ "MIT" ]
null
null
null
#include <iostream> #include <string> #include <typeinfo> using namespace std; int ctoi(const char c){ switch(c){ case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9; default : return -1; } } bool cal(string s, int num, int A, int B){ int sum = 0; for(int i = 0; i < num; i++){ sum += ctoi(s[i]); } if(A <= sum and sum <= B){ return true; }else{ return false; } } int main(){ int N,A,B,sum = 0; cin >> N >> A >> B; for(int i = 1; i <= N; i++){ string s; s = to_string(i); if(cal(s, s.length(), A, B)) sum += i; } cout << sum << endl; }
19.863636
46
0.451945
uzumal
7cd878581a40ae5c586908106a3dba84684497e7
4,541
hpp
C++
HugeCTR/include/embeddings/hybrid_embedding/infrequent_embedding.hpp
xjqbest/HugeCTR
0b1c92d5e65891dfdd90d917bc6d520d0ca5d1e1
[ "Apache-2.0" ]
130
2021-10-11T11:55:28.000Z
2022-03-31T21:53:07.000Z
HugeCTR/include/embeddings/hybrid_embedding/infrequent_embedding.hpp
xjqbest/HugeCTR
0b1c92d5e65891dfdd90d917bc6d520d0ca5d1e1
[ "Apache-2.0" ]
72
2021-10-09T04:59:09.000Z
2022-03-31T11:27:54.000Z
HugeCTR/include/embeddings/hybrid_embedding/infrequent_embedding.hpp
xjqbest/HugeCTR
0b1c92d5e65891dfdd90d917bc6d520d0ca5d1e1
[ "Apache-2.0" ]
29
2021-11-03T22:35:01.000Z
2022-03-30T13:11:59.000Z
/* * Copyright (c) 2021, NVIDIA CORPORATION. * * 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 <cuda_runtime.h> #include <memory> #include <vector> #include "HugeCTR/include/common.hpp" #include "HugeCTR/include/embeddings/hybrid_embedding/communication.hpp" #include "HugeCTR/include/embeddings/hybrid_embedding/data.hpp" #include "HugeCTR/include/embeddings/hybrid_embedding/model.hpp" #include "HugeCTR/include/embeddings/hybrid_embedding/utils.hpp" #include "HugeCTR/include/gpu_resource.hpp" #include "HugeCTR/include/tensor2.hpp" #include "hybrid_indices.hpp" namespace HugeCTR { namespace hybrid_embedding { // In order to use it easier in the IndicesContainer template <typename dtype> class InfrequentEmbeddingBase { protected: const Data<dtype> *data_ = nullptr; InfrequentEmbeddingSelectionView<dtype> *indices_view_ = nullptr; public: // Infrequent indices and device pointer! InfrequentEmbeddingSelection<dtype> *indices_; void set_current_indices(InfrequentEmbeddingSelection<dtype> *indices, cudaStream_t stream); InfrequentEmbeddingBase(); ~InfrequentEmbeddingBase(); }; template <typename dtype, typename emtype> class InfrequentEmbedding : public InfrequentEmbeddingBase<dtype> { public: using InfrequentEmbeddingBase<dtype>::data_; // copy of the model parameters and the input data, managed by HybridSparseEmbedding const Model<dtype> &model_; const GPUResource &gpu_resource; // locally stored infrequent embedding vectors for the model-parallel part of the embedding for // each table Tensor2<float> infrequent_embedding_vectors_; Tensor2<emtype *> interaction_layer_input_pointers_train_; Tensor2<emtype *> interaction_layer_input_pointers_eval_; Tensor2<const emtype *> gradients_pointers_; // Communication buffer sizes dtype max_num_infrequent_per_batch_; dtype max_num_infrequent_per_train_batch_; // Tensors to be passed to the hierarchical comms // TODO: move these to the index containers Tensor2<uint32_t> network_indices_offsets_, model_indices_offsets_; Tensor2<size_t> network_indices_sizes_, model_indices_sizes_; Tensor2<size_t *> network_indices_sizes_ptrs_, model_indices_sizes_ptrs_; // to do, we need to initialize it in the constructor uint32_t embedding_vec_size_; // requires model_ and data_ to be set void init(); InfrequentEmbedding(const Model<dtype> &model, const GPUResource &gpu_resource, uint32_t embedding_vec_size); ~InfrequentEmbedding(){}; void initialize_embedding_vectors(const std::vector<size_t> &table_sizes); void forward_model(emtype *message_buffer, cudaStream_t stream); void fused_intra_forward_model(emtype **message_buffer, cudaStream_t stream); void forward_network(const emtype *message_buffer, emtype *interaction_layer_input, cudaStream_t stream); void hier_forward_network(const emtype *message_buffer, emtype *interaction_layer_input, cudaStream_t stream); void forward_network_direct(bool is_train, cudaStream_t stream); void update_network(const emtype *gradients, emtype *message_buffer, cudaStream_t stream); void fused_intra_update_network(const emtype *gradients, emtype **message_buffer, cudaStream_t stream); void update_model(const emtype *message_buffer, float *dev_lr, float scale, cudaStream_t stream); void hier_update_model(const emtype *message_buffer, float *dev_lr, float scale, cudaStream_t stream); void update_model_direct(float *dev_lr, float scale, cudaStream_t stream); void calculate_model_indices_sizes_from_offsets(cudaStream_t stream); void calculate_network_indices_sizes_from_offsets(cudaStream_t stream); const uint32_t *get_model_indices_offsets_ptr() { return model_indices_offsets_.get_ptr(); } const uint32_t *get_network_indices_offsets_ptr() { return network_indices_offsets_.get_ptr(); } }; } // namespace hybrid_embedding } // namespace HugeCTR
39.833333
99
0.77516
xjqbest
7cdeb4460d486a542e8205abb8ec0ab35408eaef
4,631
cpp
C++
src/ga.cpp
o01eg/gfp
49a5becba87ae14f36b3d42190006391d613e03f
[ "MIT" ]
1
2017-01-22T19:40:23.000Z
2017-01-22T19:40:23.000Z
src/ga.cpp
o01eg/gfp
49a5becba87ae14f36b3d42190006391d613e03f
[ "MIT" ]
null
null
null
src/ga.cpp
o01eg/gfp
49a5becba87ae14f36b3d42190006391d613e03f
[ "MIT" ]
null
null
null
/* * Copyright (C) 2010-2014 O01eg <o01eg@yandex.ru> * * This file is part of Genetic Function Programming. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include <fstream> #include <sstream> #include "ga.h" #include "conf.h" #include "ga_utils.h" #include "functions.h" GA::GA(size_t population_size_) : m_PopulationSize(population_size_) { m_Funcs.push_back(std::make_pair(m_Env.GetIF(), 3)); m_Funcs.push_back(std::make_pair(m_Env.GetEVAL(), 1)); FuncData* array = func_array; while(array->func) { size_t index = m_Env.LoadFunction(array->name, array->number_param, array->func); VM::Object f = VM::Object(m_Env, VM::FUNC, index); m_Funcs.push_back(std::make_pair(f, array->number_param)); // load optimize rules m_OptimizeRules.mode.insert({f, array->mode}); m_OptimizeRules.returnERRORat.insert({f, array->returnERRORat}); if(array->return0atBOOL) { m_OptimizeRules.return0atBOOL.insert(f); } ++ array; } for(size_t i = 0; i < m_PopulationSize; ++ i) { //std::clog << "Generating " << i << " individual..." << std::endl; m_Population.push_back(GenerateRand()); m_Population[i].Optimize(m_OptimizeRules); //std::clog << "Generated " << i << " individual..." << std::endl; } } GA::Results GA::Examine() const { Results res = Individual::Execute(m_Env, m_Population); return res; } bool GA::Step() { Results results = Examine(); if(m_PopulationSize != results.size()) { return false; } for(size_t i = 0; i < m_PopulationSize; ++ i) { m_Population[i].SetResult(results[i]); } std::stable_sort(results.begin(), results.end()); Population new_population; bool updated = false; { // add elite individual new_population.push_back(m_Population[results[0].GetIndex()]); if(results[0].GetIndex() != 0) { updated = true; } // make parent pool by tournament std::vector<size_t> parent_pool; parent_pool.push_back(results[0].GetIndex()); while(parent_pool.size() < m_PopulationSize) { size_t i1 = rand() % results.size(); size_t i2 = rand() % results.size(); parent_pool.push_back(results[std::min(i1, i2)].GetIndex()); } while(new_population.size() < m_PopulationSize) { new_population.push_back(Crossover(m_Population[parent_pool[rand() % parent_pool.size()]], m_Population[parent_pool[rand() % parent_pool.size()]])); } for(size_t i = 1; i < m_PopulationSize; ++ i) { if(rand() % 4 == 0) { new_population[i] = Mutation(new_population[i]); } } } m_Population = std::move(new_population); for(auto& ind : m_Population) { ind.Optimize(m_OptimizeRules); } return updated; } void GA::DumpResults(const Population &population, std::ostream& os) { for(size_t i = 0; i < population.size(); ++ i) { population[i].GetResult().Dump(os); } } Individual GA::GenerateRand() const { VM::Program prog = GP::GenerateProg(m_Env, m_Funcs); return Individual(prog, {}); } Individual GA::Mutation(const Individual& ind) const { if(rand() % 2) { Individual(GP::SplitADFProg(ind.GetProgram()), ind.GetParents()); } return Individual(GP::MutateProg(ind.GetProgram(), m_Funcs), ind.GetParents()); } Individual GA::Crossover(const Individual& ind1, const Individual& ind2) const { return Individual(GP::CrossoverProg(ind1.GetProgram(), ind2.GetProgram()), {ind1, ind2}); } void GA::SetInd(size_t index, const std::string& str) { if(index < m_PopulationSize) { VM::Object obj(m_Env); std::stringstream ss(str); ss >> obj; VM::Program prog(obj); m_Population[index] = Individual(std::move(prog), {}); m_Population[index].Optimize(m_OptimizeRules); } }
27.565476
151
0.699849
o01eg
7ce17b972b385d40cecf41773175f4fbd21fef4a
599
cpp
C++
Ritualberater/RuneLeaf.cpp
odom11/ritualberater
b5af60785f8a7b5ec2e0a6be53c4441cc38ba94d
[ "MIT" ]
null
null
null
Ritualberater/RuneLeaf.cpp
odom11/ritualberater
b5af60785f8a7b5ec2e0a6be53c4441cc38ba94d
[ "MIT" ]
null
null
null
Ritualberater/RuneLeaf.cpp
odom11/ritualberater
b5af60785f8a7b5ec2e0a6be53c4441cc38ba94d
[ "MIT" ]
null
null
null
#include "RuneLeaf.h" RuneLeaf::RuneLeaf(const std::string& name, const int cost, AbstractRuneNode * parent) : AbstractRuneNode(name, parent), cost(cost), amount(0) {} unsigned RuneLeaf::getAmount() const { return amount; } void RuneLeaf::setAmount(unsigned amount) { this->amount = amount; } unsigned int RuneLeaf::columnCount() { return 3; } QVariant RuneLeaf::data(unsigned int column) const { enum COLUMN { COST = 1, AMOUNT = 2 }; switch (column) { case COST: return QVariant(cost); case AMOUNT: return QVariant(amount); default: return AbstractRuneNode::data(column); } }
17.617647
145
0.711185
odom11
7ce281184b7aaf30c5ff439efbfd0568330a5173
383
cpp
C++
unit_tests/aub_stream_mocks/aub_stream_interface_mock.cpp
PTS93/compute-runtime
0655045c7962d551e29008547a802e398b646c6e
[ "MIT" ]
null
null
null
unit_tests/aub_stream_mocks/aub_stream_interface_mock.cpp
PTS93/compute-runtime
0655045c7962d551e29008547a802e398b646c6e
[ "MIT" ]
null
null
null
unit_tests/aub_stream_mocks/aub_stream_interface_mock.cpp
PTS93/compute-runtime
0655045c7962d551e29008547a802e398b646c6e
[ "MIT" ]
null
null
null
/* * Copyright (C) 2018-2019 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "unit_tests/mocks/mock_aub_manager.h" namespace OCLRT { aub_stream::AubManager *createAubManager(uint32_t gfxFamily, uint32_t devicesCount, uint64_t memoryBankSize, bool localMemorySupported, const std::string &aubFileName) { return new MockAubManager(); } } // namespace OCLRT
25.533333
169
0.762402
PTS93
7ce64ea434b8f2935ddbe22dae2963306e0adae4
547
cpp
C++
P1012/P1012.cpp
zhouyium/LuoGu
10038dd9876c95534c580da1c31ac2a9b0558df0
[ "MIT" ]
null
null
null
P1012/P1012.cpp
zhouyium/LuoGu
10038dd9876c95534c580da1c31ac2a9b0558df0
[ "MIT" ]
null
null
null
P1012/P1012.cpp
zhouyium/LuoGu
10038dd9876c95534c580da1c31ac2a9b0558df0
[ "MIT" ]
null
null
null
//https://www.luogu.com.cn/problem/P1012 //P1012 拼数 #include <iostream> #include <algorithm> #include <string> int main() { int n; std::cin >> n; std::string arr[21]; int i, j; for (i=0; i<n; i++) { std::cin >> arr[i]; } //排序 for (i=0; i<n; i++) { for (j=i; j<n; j++) { if (arr[j]+arr[i] > arr[i] + arr[j]) { std::swap(arr[j], arr[i]); } } } for (i=0; i<n; i++) { std::cout << arr[i]; } std::cout << "\n"; return 0; }
17.09375
50
0.404022
zhouyium
7ce661c900df5237bb05fb1e00e283b7b8c6a25b
2,003
cpp
C++
C++/695.max-area-of-island.cpp
WilliamZhaoz/github
2aa0eb17e272249fc225cf2e9861c4c44bd0e265
[ "MIT" ]
1
2018-03-06T05:07:22.000Z
2018-03-06T05:07:22.000Z
C++/695.max-area-of-island.cpp
WilliamZhaoz/github
2aa0eb17e272249fc225cf2e9861c4c44bd0e265
[ "MIT" ]
1
2021-12-24T16:41:02.000Z
2021-12-24T16:41:02.000Z
C++/695.max-area-of-island.cpp
WilliamZhaoz/github
2aa0eb17e272249fc225cf2e9861c4c44bd0e265
[ "MIT" ]
null
null
null
class Solution { public: // version 1 : recursive /* vector<pair<int, int>> dir{{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; int maxAreaOfIsland(vector<vector<int>>& grid) { if (grid.empty() || grid[0].empty()) { return 0; } int m = grid.size(), n = grid[0].size(), res = 0; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { int tmp = 0; helper(grid, i, j, tmp, res); } } return res; } void helper(vector<vector<int>> &grid, int i, int j, int &tmp, int &res) { int m = grid.size(); int n = grid[0].size(); if (i < 0 || j < 0 || i >= m || j >= n || grid[i][j] <= 0) { return; } grid[i][j]--; res = max(res, ++tmp); for (auto d : dir) { helper(grid, i + d.first, j + d.second, tmp, res); } } */ vector<pair<int, int>> dir{{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; int maxAreaOfIsland(vector<vector<int>>& grid) { if (grid.empty() || grid[0].empty()) { return 0; } int m = grid.size(), n = grid[0].size(), res = 0, tmp = 0; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { queue<pair<int, int>> q; q.push(pair<int, int>(i, j)); tmp = 0; while (!q.empty()) { pair<int, int> p = q.front(); q.pop(); int ii = p.first, jj = p.second; if (ii >= 0 && ii < m && jj >= 0 && jj < n && grid[ii][jj] > 0) { res = max(res, ++tmp); grid[ii][jj]--; for (auto d : dir) { q.push(pair<int, int>(ii + d.first, jj + d.second)); } } } } } return res; } };
32.836066
85
0.34698
WilliamZhaoz
7ce6c903ac620a6a025f732d29d0252c0170cb45
3,694
hpp
C++
ml/deep_learning/propagation.hpp
stereomatchingkiss/ocv_libs
1424ac2f8a2c034513483b3050d8138ca0a0ae3f
[ "FSFAP" ]
18
2015-12-17T05:28:37.000Z
2021-05-21T02:59:29.000Z
ml/deep_learning/propagation.hpp
stereomatchingkiss/ocv_libs
1424ac2f8a2c034513483b3050d8138ca0a0ae3f
[ "FSFAP" ]
null
null
null
ml/deep_learning/propagation.hpp
stereomatchingkiss/ocv_libs
1424ac2f8a2c034513483b3050d8138ca0a0ae3f
[ "FSFAP" ]
8
2017-05-10T11:20:13.000Z
2021-06-19T17:06:06.000Z
#ifndef PROPAGATION_HPP #define PROPAGATION_HPP #include <opencv2/core.hpp> #include <Eigen/Dense> #include "../utility/activation.hpp" /*! \file propagation.hpp \brief collection of propagation algorithms */ /*! * \addtogroup ocv * @{ */ namespace ocv{ /*! * \addtogroup ml * @{ */ namespace ml{ /** *@brief forward propagation of neural network, this function\n *Assume this is a three layers neural network, this function\n *will compute the output of the layer 2 *@param input The input of the neurals(input of layer 2) *@param weight The weight of the input *@param bias bias of the input *@param output The output of the neurals(output of layer 2).\n * After computation, output.rows == weight.rows && output.cols == input.cols *@param func unary functor which apply the activation on\n * the output *@pre input, weight and bias cannot be empty, the type of the\n * input, weight, bias and output should be double(CV_64F).\n * weight.cols == input.rows && bias.rows == weight.rows */ template<typename UnaryFunc = sigmoid> void forward_propagation(cv::Mat const &input, cv::Mat const &weight, cv::Mat const &bias, cv::Mat &output, UnaryFunc func = UnaryFunc()) { if(!input.empty() && !weight.empty() && !bias.empty()){ //output = weight * input; cv::gemm(weight, input, 1.0, cv::Mat(), 0.0, output); for(int i = 0; i != output.cols; ++i){ output.col(i) += bias; } func(output); } } /** *@brief forward propagation of neural network, this function\n *Assume this is a three layers neural network, this function\n *will compute the output of the layer 2 *@param input The input of the neurals(input of layer 2) *@param weight The weight of the input *@param bias bias of the input *@param output The output of the neurals(output of layer 2).\n * After computation, output.rows == weight.rows && output.cols == input.cols *@param func unary functor which apply the activation on\n * the output *@pre input, weight and bias cannot be empty.\n * weight.cols == input.rows && bias.rows == weight.rows */ template<typename Derived1, typename Derived2, typename Derived3, typename Derived4, typename UnaryFunc = sigmoid> void forward_propagation(Eigen::MatrixBase<Derived1> const &input, Eigen::MatrixBase<Derived2> const &weight, Eigen::MatrixBase<Derived3> const &bias, Eigen::MatrixBase<Derived4> &output, bool no_overlap = true, UnaryFunc func = UnaryFunc()) { static_assert(std::is_same<Derived1::Scalar, Derived2::Scalar>::value && std::is_same<Derived2::Scalar, Derived3::Scalar>::value && std::is_same<Derived4::Scalar, Derived4::Scalar>::value, "Data type of matrix input, weight, bias and output should be the same"); if(input.rows() != 0 && weight.rows() != 0 && bias.rows() != 0){ if(no_overlap){ output.noalias() = weight * input; }else{ output = weight * input; } using Scalar = typename Derived3::Scalar; using MatType = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>; using Mapper = Eigen::Map<const MatType, Eigen::Aligned>; Mapper Map(&bias(0, 0), bias.size()); output.colwise() += Map; func(output); } } } /*! @} End of Doxygen Groups*/ } /*! @} End of Doxygen Groups*/ #endif // PROPAGATION_HPP
32.403509
91
0.605847
stereomatchingkiss
7ce84c2deeeb615d8f4bbd4290b11e557a78c34a
1,871
cpp
C++
Data Structures I (CS331)/EX(7-203) Linked list/EX7 merge two sorted linked lists..cpp
abdulmlik/Data-Structures-HW
2886ae3357f9396bb2ea1d9c7128117eda96d665
[ "BSD-2-Clause" ]
null
null
null
Data Structures I (CS331)/EX(7-203) Linked list/EX7 merge two sorted linked lists..cpp
abdulmlik/Data-Structures-HW
2886ae3357f9396bb2ea1d9c7128117eda96d665
[ "BSD-2-Clause" ]
null
null
null
Data Structures I (CS331)/EX(7-203) Linked list/EX7 merge two sorted linked lists..cpp
abdulmlik/Data-Structures-HW
2886ae3357f9396bb2ea1d9c7128117eda96d665
[ "BSD-2-Clause" ]
null
null
null
#include<iostream> #include<stdio.h> #include<stdlib.h> #include<assert.h> using namespace std; struct node { int data; struct node* next; }; void MoveNode(struct node** destRef, struct node** sourceRef); struct node* SortedMerge(struct node* a, struct node* b) { struct node dummy; struct node* tail = &dummy; dummy.next = NULL; while (1) { if (a == NULL) { tail->next = b; break; } else if (b == NULL) { tail->next = a; break; } if (a->data <= b->data) MoveNode(&(tail->next), &a); else MoveNode(&(tail->next), &b); tail = tail->next; } return(dummy.next); } /* Before calling MoveNode(): source == {1, 2, 3} dest == {1, 2, 3} Affter calling MoveNode(): source == {2, 3} dest == {1, 1, 2, 3} */ void MoveNode(struct node** destRef, struct node** sourceRef) { struct node* newNode = *sourceRef; assert(newNode != NULL); *sourceRef = newNode->next; newNode->next = *destRef; *destRef = newNode; } void push(struct node** head_ref, int new_data) { struct node* new_node =new node; new_node->data = new_data; new_node->next = (*head_ref); (*head_ref) = new_node; } void printList(struct node *node) { cout<<"node"; while (node!=NULL) { cout<<"->"<<node->data; node = node->next; } } int main() { struct node* Objlist3 = NULL; struct node* Objlist1 = NULL; struct node* Objlist2 = NULL; push(&Objlist1, 15); push(&Objlist1, 10); push(&Objlist1, 5); push(&Objlist2, 20); push(&Objlist2, 3); push(&Objlist2, 2); Objlist3 = SortedMerge(Objlist1, Objlist2); cout<<"Merged Linked List is: \n"; printList(Objlist3); return 0; }
16.412281
62
0.541956
abdulmlik
7cef64ec74bfc0271831581002c37d133c2cb028
2,659
hpp
C++
include/libaopp/event_queue.hpp
mjgigli/libaopp
d603127f4e5d9cc1caa6ec5def4f743b2e775812
[ "MIT" ]
null
null
null
include/libaopp/event_queue.hpp
mjgigli/libaopp
d603127f4e5d9cc1caa6ec5def4f743b2e775812
[ "MIT" ]
null
null
null
include/libaopp/event_queue.hpp
mjgigli/libaopp
d603127f4e5d9cc1caa6ec5def4f743b2e775812
[ "MIT" ]
null
null
null
/* * Copyright (c) 2019 Matt Gigli * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE * SOFTWARE. */ #ifndef LIBAOPP_EVENT_QUEUE_HPP #define LIBAOPP_EVENT_QUEUE_HPP #include <condition_variable> #include <memory> #include <mutex> #include <queue> #include "libaopp/event.hpp" namespace aopp { class EventQueue { public: EventQueue(std::size_t max_size); EventQueue(); ~EventQueue(); // Pushes the given element value to the end of the queue. // The content of value is copied to the new element. Increases container // size by one. // Does not block, returns true if push was successful, false if // queue is full. bool try_push(std::shared_ptr<const Event> value); // Removes the first element in the queue, reducing its size by one. // Blocks if queue is empty. std::shared_ptr<const Event> pop(); // Returns true if queue is empty, false if it is not. bool empty() const noexcept; // Returns the number of elements in the queue. std::size_t size() const noexcept; // Returns true if queue is full, false if it is not. bool full() const noexcept; // Returns the max size of this queue. std::size_t max_size() const noexcept; // EventQueue class does not support copying or moving. EventQueue(const EventQueue&) = delete; EventQueue& operator=(const EventQueue&) = delete; EventQueue(EventQueue&&) = delete; EventQueue& operator=(EventQueue&&) = delete; private: std::queue<std::shared_ptr<const Event>> q_; mutable std::mutex mutex_; std::condition_variable pop_cond_; std::size_t max_size_ = -1; }; } // namespace aopp #endif // LIBAOPP_EVENT_QUEUE_HPP
31.654762
79
0.731854
mjgigli
7cefce42a9809da9fe047a672b14df3b49b66b80
498
cpp
C++
XENTASK.cpp
trehanarsh/Codechef-Solutions
8bfd91531138a62aebcc2dffce3ad8e6a296db28
[ "MIT" ]
null
null
null
XENTASK.cpp
trehanarsh/Codechef-Solutions
8bfd91531138a62aebcc2dffce3ad8e6a296db28
[ "MIT" ]
null
null
null
XENTASK.cpp
trehanarsh/Codechef-Solutions
8bfd91531138a62aebcc2dffce3ad8e6a296db28
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; long long a[n],b[n]; for (int i = 0; i < n; ++i) { cin>>a[i]; } for (int i = 0; i < n; ++i) { cin>>b[i]; } long long ans1=0,ans2=0; for (int i = 0; i < n; ++i) { if ((i%2)==0) { ans1+=a[i]; ans2+=b[i]; } else { ans1+=b[i]; ans2+=a[i]; } } printf("%lld\n",min(ans2,ans1) ); } return 0; }
13.459459
36
0.393574
trehanarsh
7cfa54cfd1a892878b5380ffa1f723fc964df6c8
270
cpp
C++
1152.cpp
sat0317/BaekjoonOJ
c9acd973820ced3de4a26e5662641c16f7a9175b
[ "MIT" ]
2
2020-12-07T16:34:16.000Z
2021-09-26T05:59:04.000Z
1152.cpp
sat0317/BaekjoonOJ
c9acd973820ced3de4a26e5662641c16f7a9175b
[ "MIT" ]
null
null
null
1152.cpp
sat0317/BaekjoonOJ
c9acd973820ced3de4a26e5662641c16f7a9175b
[ "MIT" ]
null
null
null
#include <stdio.h> #include <string.h> int main(){ int n, i, cnt=1, imsi=0; char a[1000005]={}; gets(a); n=strlen(a)-1; if(a[0]==' ') imsi++; for(i=0;i<n;i++){ if(a[i]==' ') cnt++; } if(cnt+1==imsi){ printf("0"); } else printf("%d", cnt-imsi); return 0; }
15.882353
45
0.514815
sat0317
cfac268a14c66674fa16f08fb4dd3414b77fbbf9
26
cpp
C++
sdl2/janggi/HistoryStack.cpp
pdpdds/SDL_YUZA
8299672a70005a1b702cc7e3577aad4f8b31bec2
[ "BSD-2-Clause" ]
null
null
null
sdl2/janggi/HistoryStack.cpp
pdpdds/SDL_YUZA
8299672a70005a1b702cc7e3577aad4f8b31bec2
[ "BSD-2-Clause" ]
null
null
null
sdl2/janggi/HistoryStack.cpp
pdpdds/SDL_YUZA
8299672a70005a1b702cc7e3577aad4f8b31bec2
[ "BSD-2-Clause" ]
null
null
null
#include "HistoryStack.h"
13
25
0.769231
pdpdds
cfb112aa84561bb5b561b2c354ffc9041bdac414
536
hpp
C++
builds/includes/helperOC/Grids/destroyGrid.hpp
mdoshi96/beacls
860426ed1336d9539dea195987efcdd8a8276a1c
[ "BSD-2-Clause", "BSD-2-Clause-FreeBSD" ]
30
2017-12-17T22:57:50.000Z
2022-01-30T17:06:34.000Z
builds/includes/helperOC/Grids/destroyGrid.hpp
codingblazes/beacls
6c1d685ee00e3b39d8100c4a170a850682679abc
[ "BSD-2-Clause", "BSD-2-Clause-FreeBSD" ]
2
2017-03-24T06:18:16.000Z
2017-04-04T16:16:06.000Z
builds/includes/helperOC/Grids/destroyGrid.hpp
codingblazes/beacls
6c1d685ee00e3b39d8100c4a170a850682679abc
[ "BSD-2-Clause", "BSD-2-Clause-FreeBSD" ]
8
2018-07-06T01:47:21.000Z
2021-07-23T15:50:34.000Z
#ifndef __DESTROYGRID_hpp__ #define __DESTROYGRID_hpp__ // Mo Chen, 2016-04-18 // Ken Tanabe, 2016-08-05 //! Prefix to generate Visual C++ DLL #ifdef _MAKE_VC_DLL #define PREFIX_VC_DLL __declspec(dllexport) //! Don't add prefix, except dll generating #else #define PREFIX_VC_DLL #endif namespace levelset { class HJI_Grid; }; namespace helperOC { /** @brief destroyGrid @param [in] grid grid structure */ PREFIX_VC_DLL void destroyGrid( levelset::HJI_Grid* grid ); }; #endif /* __DESTROYGRID_hpp__ */
17.290323
43
0.710821
mdoshi96
cfb1202543b6cfbf1bd81ea14c8754894a4cd615
3,248
cpp
C++
common/DebugWriter.cpp
pinterf/AviSynthCUDAFilters
5d5f1a8fdccc52642ad213486127b7e0a034fb16
[ "MIT" ]
9
2021-02-08T17:24:31.000Z
2022-02-03T21:00:08.000Z
common/DebugWriter.cpp
pinterf/AviSynthCUDAFilters
5d5f1a8fdccc52642ad213486127b7e0a034fb16
[ "MIT" ]
null
null
null
common/DebugWriter.cpp
pinterf/AviSynthCUDAFilters
5d5f1a8fdccc52642ad213486127b7e0a034fb16
[ "MIT" ]
1
2022-02-13T15:11:06.000Z
2022-02-13T15:11:06.000Z
#define NOMINMAX #include <Windows.h> #include "DebugWriter.h" #include <stdio.h> #include <string> #include <memory> bool FileExists(const char *fname) { FILE *file; if (file = fopen(fname, "r")) { fclose(file); return true; } return false; } static std::string GetUniqueFileName(const char* fmt) { char buf[200]; for (int i = 0; i < 1000; ++i) { snprintf(buf, sizeof(buf), fmt, i); if (!FileExists(buf)) { return buf; } } return "error"; } void DebugWrite8bitColorBitmap(const char* filenamefmt, const void* data, int width, int height) { BITMAPFILEHEADER bmpFileHeader = { 0 }; BITMAPINFOHEADER bmpInfoHeader = { 0 }; bmpFileHeader.bfType = 0x4d42; /* "BM" */ bmpFileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); bmpFileHeader.bfSize = width * height * 3 + bmpFileHeader.bfOffBits; bmpInfoHeader.biBitCount = 24; bmpInfoHeader.biSize = sizeof(BITMAPINFOHEADER); bmpInfoHeader.biWidth = width; bmpInfoHeader.biHeight = height; bmpInfoHeader.biPlanes = 1; bmpInfoHeader.biCompression = BI_RGB; auto filename = GetUniqueFileName(filenamefmt); FILE *fp = fopen(filename.c_str(), "wb"); fwrite(&bmpFileHeader, sizeof(bmpFileHeader), 1, fp); fwrite(&bmpInfoHeader, sizeof(bmpInfoHeader), 1, fp); fwrite(data, 1, width * height * 3, fp); fclose(fp); printf("DebugWriteBitmap -> %s\n", filename.c_str()); } void DebugWriteGrayBitmap(const char* filenamefmt, const void* data, int width, int height, int pixelSize) { BITMAPFILEHEADER bmpFileHeader = { 0 }; BITMAPINFOHEADER bmpInfoHeader = { 0 }; bmpFileHeader.bfType = 0x4d42; /* "BM" */ bmpFileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); bmpFileHeader.bfSize = width * height + bmpFileHeader.bfOffBits; bmpInfoHeader.biBitCount = pixelSize * 8; bmpInfoHeader.biSize = sizeof(BITMAPINFOHEADER); bmpInfoHeader.biWidth = width; bmpInfoHeader.biHeight = height; bmpInfoHeader.biPlanes = 1; bmpInfoHeader.biCompression = BI_RGB; auto filename = GetUniqueFileName(filenamefmt); FILE *fp = fopen(filename.c_str(), "wb"); fwrite(&bmpFileHeader, sizeof(bmpFileHeader), 1, fp); fwrite(&bmpInfoHeader, sizeof(bmpInfoHeader), 1, fp); fwrite(data, width * height * pixelSize, 1, fp); fclose(fp); printf("DebugWriteBitmap -> %s\n", filename.c_str()); } void DebugWriteBitmap(const char* filenamefmt, const uint8_t* Y, int width, int height, int strideY, int pixelSize) { std::unique_ptr<uint8_t[]> tmpbuf = std::unique_ptr<uint8_t[]>(new uint8_t[width*height*3]); for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { tmpbuf[x * 3 + 0 + y * width * 3] = Y[x + (height - y - 1) * strideY]; tmpbuf[x * 3 + 1 + y * width * 3] = Y[x + (height - y - 1) * strideY]; tmpbuf[x * 3 + 2 + y * width * 3] = Y[x + (height - y - 1) * strideY]; } } DebugWrite8bitColorBitmap(filenamefmt, tmpbuf.get(), width, height); } void DebugWriteBitmap(const char* filenamefmt, const uint8_t* Y, const uint8_t* U, const uint8_t* V, int width, int height, int strideY, int strideUV, int pixelSize) { // TODO: }
32.808081
166
0.661638
pinterf
cfc1860d7363e26e741f08e63bc6c0992bbb25e7
149,205
cpp
C++
twain-v2/support/twain_dsm.cpp
miyako/4d-plugin-twain-v2
b12641250c4522a2a1e0c9c36f86dfe10e34c903
[ "MIT" ]
null
null
null
twain-v2/support/twain_dsm.cpp
miyako/4d-plugin-twain-v2
b12641250c4522a2a1e0c9c36f86dfe10e34c903
[ "MIT" ]
1
2019-10-07T14:36:39.000Z
2019-10-07T16:24:46.000Z
twain-v2/support/twain_dsm.cpp
miyako/4d-plugin-twain-v2
b12641250c4522a2a1e0c9c36f86dfe10e34c903
[ "MIT" ]
null
null
null
#include "twain_dsm.h" void twain_get_option_value_name(TW_UINT16 cap, TW_INT32 item, Json::Value& value) { char str[CAP_VALUE_BUF_SIZE]; memset(str, 0, sizeof(str)); BOOL string_or_constant_value = TRUE; switch (cap) { //convert to constant #if USE_TWAIN_DSM case ICAP_AUTOSIZE: { switch (item) { case TWAS_NONE: sprintf(str, "%s", "TWAS_NONE"); break; case TWAS_AUTO: sprintf(str, "%s", "TWAS_AUTO"); break; case TWAS_CURRENT: sprintf(str, "%s", "TWAS_CURRENT"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_AUTODISCARDBLANKPAGES: { switch (item) { case TWBP_DISABLE: sprintf(str, "%s", "TWBP_DISABLE"); break; case TWBP_AUTO: sprintf(str, "%s", "TWBP_AUTO"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_CAMERASIDE: { switch (item) { case TWCS_BOTH: sprintf(str, "%s", "TWCS_BOTH"); break; case TWCS_TOP: sprintf(str, "%s", "TWCS_TOP"); break; case TWCS_BOTTOM: sprintf(str, "%s", "TWCS_BOTTOM"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_FEEDERTYPE: { switch (item) { case TWFE_GENERAL: sprintf(str, "%s", "TWFE_GENERAL"); break; case TWFE_PHOTO: sprintf(str, "%s", "TWFE_PHOTO"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_FEEDERPOCKET: { switch (item) { case TWFP_POCKETERROR: sprintf(str, "%s", "TWFP_POCKETERROR"); break; case TWFP_POCKET1: sprintf(str, "%s", "TWFP_POCKET1"); break; case TWFP_POCKET2: sprintf(str, "%s", "TWFP_POCKET2"); break; case TWFP_POCKET3: sprintf(str, "%s", "TWFP_POCKET3"); break; case TWFP_POCKET4: sprintf(str, "%s", "TWFP_POCKET4"); break; case TWFP_POCKET5: sprintf(str, "%s", "TWFP_POCKET5"); break; case TWFP_POCKET6: sprintf(str, "%s", "TWFP_POCKET6"); break; case TWFP_POCKET7: sprintf(str, "%s", "TWFP_POCKET7"); break; case TWFP_POCKET8: sprintf(str, "%s", "TWFP_POCKET8"); break; case TWFP_POCKET9: sprintf(str, "%s", "TWFP_POCKET9"); break; case TWFP_POCKET10: sprintf(str, "%s", "TWFP_POCKET10"); break; case TWFP_POCKET11: sprintf(str, "%s", "TWFP_POCKET11"); break; case TWFP_POCKET12: sprintf(str, "%s", "TWFP_POCKET12"); break; case TWFP_POCKET13: sprintf(str, "%s", "TWFP_POCKET13"); break; case TWFP_POCKET14: sprintf(str, "%s", "TWFP_POCKET14"); break; case TWFP_POCKET15: sprintf(str, "%s", "TWFP_POCKET15"); break; case TWFP_POCKET16: sprintf(str, "%s", "TWFP_POCKET16"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_ICCPROFILE: { switch (item) { case TWIC_NONE: sprintf(str, "%s", "TWIC_NONE"); break; case TWIC_LINK: sprintf(str, "%s", "TWIC_LINK"); break; case TWIC_EMBED: sprintf(str, "%s", "TWIC_EMBED"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_IMAGEMERGE: { switch (item) { case TWIM_NONE: sprintf(str, "%s", "TWIM_NONE"); break; case TWIM_FRONTONTOP: sprintf(str, "%s", "TWIM_FRONTONTOP"); break; case TWIM_FRONTONBOTTOM: sprintf(str, "%s", "TWIM_FRONTONBOTTOM"); break; case TWIM_FRONTONLEFT: sprintf(str, "%s", "TWIM_FRONTONLEFT"); break; case TWIM_FRONTONRIGHT: sprintf(str, "%s", "TWIM_FRONTONRIGHT"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_SEGMENTED: { switch (item) { case TWSG_NONE: sprintf(str, "%s", "TWSG_NONE"); break; case TWSG_AUTO: sprintf(str, "%s", "TWSG_AUTO"); break; case TWSG_MANUAL: sprintf(str, "%s", "TWSG_MANUAL"); break; default: string_or_constant_value = FALSE; break; } } break; #endif case CAP_ALARMS: { switch (item) { case TWAL_ALARM: sprintf(str, "%s", "TWAL_ALARM"); break; case TWAL_FEEDERERROR: sprintf(str, "%s", "TWAL_FEEDERERROR"); break; case TWAL_FEEDERWARNING: sprintf(str, "%s", "TWAL_FEEDERWARNING"); break; case TWAL_BARCODE: sprintf(str, "%s", "TWAL_BARCODE"); break; case TWAL_DOUBLEFEED: sprintf(str, "%s", "TWAL_DOUBLEFEED"); break; case TWAL_JAM: sprintf(str, "%s", "TWAL_JAM"); break; case TWAL_PATCHCODE: sprintf(str, "%s", "TWAL_PATCHCODE"); break; case TWAL_POWER: sprintf(str, "%s", "TWAL_POWER"); break; case TWAL_SKEW: sprintf(str, "%s", "TWAL_SKEW"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_COMPRESSION: { switch (item) { case TWCP_NONE: sprintf(str, "%s", "TWCP_NONE"); break; case TWCP_PACKBITS: sprintf(str, "%s", "TWCP_PACKBITS"); break; case TWCP_GROUP31D: sprintf(str, "%s", "TWCP_GROUP31D"); break; case TWCP_GROUP31DEOL: sprintf(str, "%s", "TWCP_GROUP31DEOL"); break; case TWCP_GROUP32D: sprintf(str, "%s", "TWCP_GROUP32D"); break; case TWCP_GROUP4: sprintf(str, "%s", "TWCP_GROUP4"); break; case TWCP_JPEG: sprintf(str, "%s", "TWCP_JPEG"); break; case TWCP_LZW: sprintf(str, "%s", "TWCP_LZW"); break; case TWCP_JBIG: sprintf(str, "%s", "TWCP_JBIG"); break; case TWCP_PNG: sprintf(str, "%s", "TWCP_PNG"); break; case TWCP_RLE4: sprintf(str, "%s", "TWCP_RLE4"); break; case TWCP_RLE8: sprintf(str, "%s", "TWCP_RLE8"); break; case TWCP_BITFIELDS: sprintf(str, "%s", "TWCP_BITFIELDS"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_BARCODESEARCHMODE: { switch (item) { case TWBD_HORZ: sprintf(str, "%s", "TWBD_HORZ"); break; case TWBD_VERT: sprintf(str, "%s", "TWBD_VERT"); break; case TWBD_HORZVERT: sprintf(str, "%s", "TWBD_HORZVERT"); break; case TWBD_VERTHORZ: sprintf(str, "%s", "TWBD_VERTHORZ"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_BITORDER: { switch (item) { case TWBO_LSBFIRST: sprintf(str, "%s", "TWBO_LSBFIRST"); break; case TWBO_MSBFIRST: sprintf(str, "%s", "TWBO_MSBFIRST"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_BITDEPTHREDUCTION: { switch (item) { case TWBR_THRESHOLD: sprintf(str, "%s", "TWBR_THRESHOLD"); break; case TWBR_HALFTONE: sprintf(str, "%s", "TWBR_HALFTONE"); break; case TWBR_CUSTHALFTONE: sprintf(str, "%s", "TWBR_CUSTHALFTONE"); break; case TWBR_DIFFUSION: sprintf(str, "%s", "TWBR_DIFFUSION"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_SUPPORTEDBARCODETYPES: case TWEI_BARCODETYPE: { switch (item) { case TWBT_3OF9: sprintf(str, "%s", "TWBT_3OF9"); break; case TWBT_2OF5INTERLEAVED: sprintf(str, "%s", "TWBT_2OF5INTERLEAVED"); break; case TWBT_2OF5NONINTERLEAVED: sprintf(str, "%s", "TWBT_2OF5NONINTERLEAVED"); break; case TWBT_CODE93: sprintf(str, "%s", "TWBT_CODE93"); break; case TWBT_CODE128: sprintf(str, "%s", "TWBT_CODE128"); break; case TWBT_UCC128: sprintf(str, "%s", "TWBT_UCC128"); break; case TWBT_CODABAR: sprintf(str, "%s", "TWBT_CODABAR"); break; case TWBT_UPCA: sprintf(str, "%s", "TWBT_UPCA"); break; case TWBT_UPCE: sprintf(str, "%s", "TWBT_UPCE"); break; case TWBT_EAN8: sprintf(str, "%s", "TWBT_EAN8"); break; case TWBT_EAN13: sprintf(str, "%s", "TWBT_EAN13"); break; case TWBT_POSTNET: sprintf(str, "%s", "TWBT_POSTNET"); break; case TWBT_PDF417: sprintf(str, "%s", "TWBT_PDF417"); break; case TWBT_2OF5INDUSTRIAL: sprintf(str, "%s", "TWBT_2OF5INDUSTRIAL"); break; case TWBT_2OF5MATRIX: sprintf(str, "%s", "TWBT_2OF5MATRIX"); break; case TWBT_2OF5DATALOGIC: sprintf(str, "%s", "TWBT_2OF5DATALOGIC"); break; case TWBT_2OF5IATA: sprintf(str, "%s", "TWBT_2OF5IATA"); break; case TWBT_3OF9FULLASCII: sprintf(str, "%s", "TWBT_3OF9FULLASCII"); break; case TWBT_CODABARWITHSTARTSTOP: sprintf(str, "%s", "TWBT_CODABARWITHSTARTSTOP"); break; case TWBT_MAXICODE: sprintf(str, "%s", "TWBT_MAXICODE"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_CLEARBUFFERS: { switch (item) { case TWCB_AUTO: sprintf(str, "%s", "TWCB_AUTO"); break; case TWCB_CLEAR: sprintf(str, "%s", "TWCB_CLEAR"); break; case TWCB_NOCLEAR: sprintf(str, "%s", "TWCB_NOCLEAR"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_DEVICEEVENT: { switch (item) { case TWDE_CUSTOMEVENTS: sprintf(str, "%s", "TWDE_CUSTOMEVENTS"); break; case TWDE_CHECKAUTOMATICCAPTURE: sprintf(str, "%s", "TWDE_CHECKAUTOMATICCAPTURE"); break; case TWDE_CHECKBATTERY: sprintf(str, "%s", "TWDE_CHECKBATTERY"); break; case TWDE_CHECKDEVICEONLINE: sprintf(str, "%s", "TWDE_CHECKDEVICEONLINE"); break; case TWDE_CHECKFLASH: sprintf(str, "%s", "TWDE_CHECKFLASH"); break; case TWDE_CHECKPOWERSUPPLY: sprintf(str, "%s", "TWDE_CHECKPOWERSUPPLY"); break; case TWDE_CHECKRESOLUTION: sprintf(str, "%s", "TWDE_CHECKRESOLUTION"); break; case TWDE_DEVICEADDED: sprintf(str, "%s", "TWDE_DEVICEADDED"); break; case TWDE_DEVICEOFFLINE: sprintf(str, "%s", "TWDE_DEVICEOFFLINE"); break; case TWDE_DEVICEREADY: sprintf(str, "%s", "TWDE_DEVICEREADY"); break; case TWDE_DEVICEREMOVED: sprintf(str, "%s", "TWDE_DEVICEREMOVED"); break; case TWDE_IMAGECAPTURED: sprintf(str, "%s", "TWDE_IMAGECAPTURED"); break; case TWDE_IMAGEDELETED: sprintf(str, "%s", "TWDE_IMAGEDELETED"); break; case TWDE_PAPERDOUBLEFEED: sprintf(str, "%s", "TWDE_PAPERDOUBLEFEED"); break; case TWDE_PAPERJAM: sprintf(str, "%s", "TWDE_PAPERJAM"); break; case TWDE_LAMPFAILURE: sprintf(str, "%s", "TWDE_LAMPFAILURE"); break; case TWDE_POWERSAVE: sprintf(str, "%s", "TWDE_POWERSAVE"); break; case TWDE_POWERSAVENOTIFY: sprintf(str, "%s", "TWDE_POWERSAVENOTIFY"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_DUPLEX: { switch (item) { case TWDX_NONE: sprintf(str, "%s", "TWDX_NONE"); break; case TWDX_1PASSDUPLEX: sprintf(str, "%s", "TWDX_1PASSDUPLEX"); break; case TWDX_2PASSDUPLEX: sprintf(str, "%s", "TWDX_2PASSDUPLEX"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_FEEDERALIGNMENT: { switch (item) { case TWFA_NONE: sprintf(str, "%s", "TWFA_NONE"); break; case TWFA_LEFT: sprintf(str, "%s", "TWFA_LEFT"); break; case TWFA_CENTER: sprintf(str, "%s", "TWFA_CENTER"); break; case TWFA_RIGHT: sprintf(str, "%s", "TWFA_RIGHT"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_IMAGEFILEFORMAT: { switch (item) { case TWFF_TIFF: sprintf(str, "%s", "TWFF_TIFF"); break; case TWFF_PICT: sprintf(str, "%s", "TWFF_PICT"); break; case TWFF_BMP: sprintf(str, "%s", "TWFF_BMP"); break; case TWFF_XBM: sprintf(str, "%s", "TWFF_XBM"); break; case TWFF_JFIF: sprintf(str, "%s", "TWFF_JFIF"); break; case TWFF_FPX: sprintf(str, "%s", "TWFF_FPX"); break; case TWFF_TIFFMULTI: sprintf(str, "%s", "TWFF_TIFFMULTI"); break; case TWFF_PNG: sprintf(str, "%s", "TWFF_PNG"); break; case TWFF_SPIFF: sprintf(str, "%s", "TWFF_SPIFF"); break; case TWFF_EXIF: sprintf(str, "%s", "TWFF_EXIF"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_FLASHUSED2: { switch (item) { case TWFL_NONE: sprintf(str, "%s", "TWFL_NONE"); break; case TWFL_OFF: sprintf(str, "%s", "TWFL_OFF"); break; case TWFL_ON: sprintf(str, "%s", "TWFL_ON"); break; case TWFL_AUTO: sprintf(str, "%s", "TWFL_AUTO"); break; case TWFL_REDEYE: sprintf(str, "%s", "TWFL_REDEYE"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_FEEDERORDER: { switch (item) { case TWFO_FIRSTPAGEFIRST: sprintf(str, "%s", "TWFO_FIRSTPAGEFIRST"); break; case TWFO_LASTPAGEFIRST: sprintf(str, "%s", "TWFO_LASTPAGEFIRST"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_FLIPROTATION: { switch (item) { case TWFR_BOOK: sprintf(str, "%s", "TWFR_BOOK"); break; case TWFR_FANFOLD: sprintf(str, "%s", "TWFR_FANFOLD"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_FILTER: { switch (item) { case TWFT_RED: sprintf(str, "%s", "TWFT_RED"); break; case TWFT_GREEN: sprintf(str, "%s", "TWFT_GREEN"); break; case TWFT_BLUE: sprintf(str, "%s", "TWFT_BLUE"); break; case TWFT_NONE: sprintf(str, "%s", "TWFT_NONE"); break; case TWFT_WHITE: sprintf(str, "%s", "TWFT_WHITE"); break; case TWFT_CYAN: sprintf(str, "%s", "TWFT_CYAN"); break; case TWFT_MAGENTA: sprintf(str, "%s", "TWFT_MAGENTA"); break; case TWFT_YELLOW: sprintf(str, "%s", "TWFT_YELLOW"); break; case TWFT_BLACK: sprintf(str, "%s", "TWFT_BLACK"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_IMAGEFILTER: { switch (item) { case TWIF_NONE: sprintf(str, "%s", "TWIF_NONE"); break; case TWIF_AUTO: sprintf(str, "%s", "TWIF_AUTO"); break; case TWIF_LOWPASS: sprintf(str, "%s", "TWIF_LOWPASS"); break; case TWIF_BANDPASS: sprintf(str, "%s", "TWIF_BANDPASS"); break; case TWIF_HIGHPASS: sprintf(str, "%s", "TWIF_HIGHPASS"); break; // case TWIF_TEXT: // sprintf(str, "%s", "TWIF_TEXT");break; // case TWIF_FINELINE: // sprintf(str, "%s", "TWIF_FINELINE");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_JOBCONTROL: { switch (item) { case TWJC_NONE: sprintf(str, "%s", "TWJC_NONE"); break; case TWJC_JSIC: sprintf(str, "%s", "TWJC_JSIC"); break; case TWJC_JSIS: sprintf(str, "%s", "TWJC_JSIS"); break; case TWJC_JSXC: sprintf(str, "%s", "TWJC_JSXC"); break; case TWJC_JSXS: sprintf(str, "%s", "TWJC_JSXS"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_JPEGQUALITY: { switch (item) { case TWJQ_UNKNOWN: sprintf(str, "%s", "TWJQ_UNKNOWN"); break; case TWJQ_LOW: sprintf(str, "%s", "TWJQ_LOW"); break; case TWJQ_MEDIUM: sprintf(str, "%s", "TWJQ_MEDIUM"); break; case TWJQ_HIGH: sprintf(str, "%s", "TWJQ_HIGH"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_LIGHTPATH: { switch (item) { case TWLP_REFLECTIVE: sprintf(str, "%s", "TWLP_REFLECTIVE"); break; case TWLP_TRANSMISSIVE: sprintf(str, "%s", "TWLP_TRANSMISSIVE"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_LIGHTSOURCE: { switch (item) { case TWLS_RED: sprintf(str, "%s", "TWLS_RED"); break; case TWLS_GREEN: sprintf(str, "%s", "TWLS_GREEN"); break; case TWLS_BLUE: sprintf(str, "%s", "TWLS_BLUE"); break; case TWLS_NONE: sprintf(str, "%s", "TWLS_NONE"); break; case TWLS_WHITE: sprintf(str, "%s", "TWLS_WHITE"); break; case TWLS_UV: sprintf(str, "%s", "TWLS_UV"); break; case TWLS_IR: sprintf(str, "%s", "TWLS_IR"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_NOISEFILTER: { switch (item) { case TWNF_NONE: sprintf(str, "%s", "TWNF_NONE"); break; case TWNF_AUTO: sprintf(str, "%s", "TWNF_AUTO"); break; case TWNF_LONEPIXEL: sprintf(str, "%s", "TWNF_LONEPIXEL"); break; case TWNF_MAJORITYRULE: sprintf(str, "%s", "TWNF_MAJORITYRULE"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_ORIENTATION: { switch (item) { case TWOR_ROT0: sprintf(str, "%s", "TWOR_ROT0"); break; case TWOR_ROT90: sprintf(str, "%s", "TWOR_ROT90"); break; case TWOR_ROT180: sprintf(str, "%s", "TWOR_ROT180"); break; case TWOR_ROT270: sprintf(str, "%s", "TWOR_ROT270"); break; // case TWOR_PORTRAIT: // sprintf(str, "%s", "TWOR_PORTRAIT");break; // case TWOR_LANDSCAPE: // sprintf(str, "%s", "TWOR_LANDSCAPE");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_OVERSCAN: { switch (item) { case TWOV_NONE: sprintf(str, "%s", "TWOV_NONE"); break; case TWOV_AUTO: sprintf(str, "%s", "TWOV_AUTO"); break; case TWOV_TOPBOTTOM: sprintf(str, "%s", "TWOV_TOPBOTTOM"); break; case TWOV_LEFTRIGHT: sprintf(str, "%s", "TWOV_LEFTRIGHT"); break; case TWOV_ALL: sprintf(str, "%s", "TWOV_ALL"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_PLANARCHUNKY: { switch (item) { case TWPC_CHUNKY: sprintf(str, "%s", "TWPC_CHUNKY"); break; case TWPC_PLANAR: sprintf(str, "%s", "TWPC_PLANAR"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_PIXELFLAVOR: { switch (item) { case TWPF_CHOCOLATE: sprintf(str, "%s", "TWPF_CHOCOLATE"); break; case TWPF_VANILLA: sprintf(str, "%s", "TWPF_VANILLA"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_PRINTERMODE: { switch (item) { case TWPM_SINGLESTRING: sprintf(str, "%s", "TWPM_SINGLESTRING"); break; case TWPM_MULTISTRING: sprintf(str, "%s", "TWPM_MULTISTRING"); break; case TWPM_COMPOUNDSTRING: sprintf(str, "%s", "TWPM_COMPOUNDSTRING"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_PRINTER: { switch (item) { case TWPR_IMPRINTERTOPBEFORE: sprintf(str, "%s", "TWPR_IMPRINTERTOPBEFORE"); break; case TWPR_IMPRINTERTOPAFTER: sprintf(str, "%s", "TWPR_IMPRINTERTOPAFTER"); break; case TWPR_IMPRINTERBOTTOMBEFORE: sprintf(str, "%s", "TWPR_IMPRINTERBOTTOMBEFORE"); break; case TWPR_IMPRINTERBOTTOMAFTER: sprintf(str, "%s", "TWPR_IMPRINTERBOTTOMAFTER"); break; case TWPR_ENDORSERTOPBEFORE: sprintf(str, "%s", "TWPR_ENDORSERTOPBEFORE"); break; case TWPR_ENDORSERTOPAFTER: sprintf(str, "%s", "TWPR_ENDORSERTOPAFTER"); break; case TWPR_ENDORSERBOTTOMBEFORE: sprintf(str, "%s", "TWPR_ENDORSERBOTTOMBEFORE"); break; case TWPR_ENDORSERBOTTOMAFTER: sprintf(str, "%s", "TWPR_ENDORSERBOTTOMAFTER"); break; default: string_or_constant_value = FALSE; break; } } break; case CAP_POWERSUPPLY: { switch (item) { case TWPS_EXTERNAL: sprintf(str, "%s", "TWPS_EXTERNAL"); break; case TWPS_BATTERY: sprintf(str, "%s", "TWPS_BATTERY"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_PIXELTYPE: { switch (item) { case TWPT_BW: sprintf(str, "%s", "TWPT_BW"); break; case TWPT_GRAY: sprintf(str, "%s", "TWPT_GRAY"); break; case TWPT_RGB: sprintf(str, "%s", "TWPT_RGB"); break; case TWPT_PALETTE: sprintf(str, "%s", "TWPT_PALETTE"); break; case TWPT_CMY: sprintf(str, "%s", "TWPT_CMY"); break; case TWPT_CMYK: sprintf(str, "%s", "TWPT_CMYK"); break; case TWPT_YUV: sprintf(str, "%s", "TWPT_YUV"); break; case TWPT_YUVK: sprintf(str, "%s", "TWPT_YUVK"); break; case TWPT_CIEXYZ: sprintf(str, "%s", "TWPT_CIEXYZ"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_SUPPORTEDSIZES: { switch (item) { case TWSS_NONE: sprintf(str, "%s", "TWSS_NONE"); break; case TWSS_A4LETTER: sprintf(str, "%s", "TWSS_A4LETTER"); break; case TWSS_B5LETTER: sprintf(str, "%s", "TWSS_B5LETTER"); break; case TWSS_USLETTER: sprintf(str, "%s", "TWSS_USLETTER"); break; case TWSS_USLEGAL: sprintf(str, "%s", "TWSS_USLEGAL"); break; case TWSS_A5: sprintf(str, "%s", "TWSS_A5"); break; case TWSS_B4: sprintf(str, "%s", "TWSS_B4"); break; case TWSS_B6: sprintf(str, "%s", "TWSS_B6"); break; // case TWSS_B: // sprintf(str, "%s", "TWSS_B");break; case TWSS_USLEDGER: sprintf(str, "%s", "TWSS_USLEDGER"); break; case TWSS_USEXECUTIVE: sprintf(str, "%s", "TWSS_USEXECUTIVE"); break; case TWSS_A3: sprintf(str, "%s", "TWSS_A3"); break; case TWSS_B3: sprintf(str, "%s", "TWSS_B3"); break; case TWSS_A6: sprintf(str, "%s", "TWSS_A6"); break; case TWSS_C4: sprintf(str, "%s", "TWSS_C4"); break; case TWSS_C5: sprintf(str, "%s", "TWSS_C5"); break; case TWSS_C6: sprintf(str, "%s", "TWSS_C6"); break; case TWSS_4A0: sprintf(str, "%s", "TWSS_4A0"); break; case TWSS_2A0: sprintf(str, "%s", "TWSS_2A0"); break; case TWSS_A0: sprintf(str, "%s", "TWSS_A0"); break; case TWSS_A1: sprintf(str, "%s", "TWSS_A1"); break; case TWSS_A2: sprintf(str, "%s", "TWSS_A2"); break; // case TWSS_A4: // sprintf(str, "%s", "TWSS_A4");break; case TWSS_A7: sprintf(str, "%s", "TWSS_A7"); break; case TWSS_A8: sprintf(str, "%s", "TWSS_A8"); break; case TWSS_A9: sprintf(str, "%s", "TWSS_A9"); break; case TWSS_A10: sprintf(str, "%s", "TWSS_A10"); break; case TWSS_ISOB0: sprintf(str, "%s", "TWSS_ISOB0"); break; case TWSS_ISOB1: sprintf(str, "%s", "TWSS_ISOB1"); break; case TWSS_ISOB2: sprintf(str, "%s", "TWSS_ISOB2"); break; // case TWSS_ISOB3: // sprintf(str, "%s", "TWSS_ISOB3");break; // case TWSS_ISOB4: // sprintf(str, "%s", "TWSS_ISOB4");break; case TWSS_ISOB5: sprintf(str, "%s", "TWSS_ISOB5"); break; // case TWSS_ISOB6: // sprintf(str, "%s", "TWSS_ISOB6");break; case TWSS_ISOB7: sprintf(str, "%s", "TWSS_ISOB7"); break; case TWSS_ISOB8: sprintf(str, "%s", "TWSS_ISOB8"); break; case TWSS_ISOB9: sprintf(str, "%s", "TWSS_ISOB9"); break; case TWSS_ISOB10: sprintf(str, "%s", "TWSS_ISOB10"); break; case TWSS_JISB0: sprintf(str, "%s", "TWSS_JISB0"); break; case TWSS_JISB1: sprintf(str, "%s", "TWSS_JISB1"); break; case TWSS_JISB2: sprintf(str, "%s", "TWSS_JISB2"); break; case TWSS_JISB3: sprintf(str, "%s", "TWSS_JISB3"); break; case TWSS_JISB4: sprintf(str, "%s", "TWSS_JISB4"); break; // case TWSS_JISB5: // sprintf(str, "%s", "TWSS_JISB5");break; case TWSS_JISB6: sprintf(str, "%s", "TWSS_JISB6"); break; case TWSS_JISB7: sprintf(str, "%s", "TWSS_JISB7"); break; case TWSS_JISB8: sprintf(str, "%s", "TWSS_JISB8"); break; case TWSS_JISB9: sprintf(str, "%s", "TWSS_JISB9"); break; case TWSS_JISB10: sprintf(str, "%s", "TWSS_JISB10"); break; case TWSS_C0: sprintf(str, "%s", "TWSS_C0"); break; case TWSS_C1: sprintf(str, "%s", "TWSS_C1"); break; case TWSS_C2: sprintf(str, "%s", "TWSS_C2"); break; case TWSS_C3: sprintf(str, "%s", "TWSS_C3"); break; case TWSS_C7: sprintf(str, "%s", "TWSS_C7"); break; case TWSS_C8: sprintf(str, "%s", "TWSS_C8"); break; case TWSS_C9: sprintf(str, "%s", "TWSS_C9"); break; case TWSS_C10: sprintf(str, "%s", "TWSS_C10"); break; case TWSS_USSTATEMENT: sprintf(str, "%s", "TWSS_USSTATEMENT"); break; case TWSS_BUSINESSCARD: sprintf(str, "%s", "TWSS_BUSINESSCARD"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_XFERMECH: { switch (item) { case TWSX_NATIVE: sprintf(str, "%s", "TWSX_NATIVE"); break; case TWSX_FILE: sprintf(str, "%s", "TWSX_FILE"); break; case TWSX_MEMORY: sprintf(str, "%s", "TWSX_MEMORY"); break; case TWSX_FILE2: sprintf(str, "%s", "TWSX_FILE2"); break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_UNITS: { switch (item) { case TWUN_INCHES: sprintf(str, "%s", "TWUN_INCHES"); break; case TWUN_CENTIMETERS: sprintf(str, "%s", "TWUN_CENTIMETERS"); break; case TWUN_PICAS: sprintf(str, "%s", "TWUN_PICAS"); break; case TWUN_POINTS: sprintf(str, "%s", "TWUN_POINTS"); break; case TWUN_TWIPS: sprintf(str, "%s", "TWUN_TWIPS"); break; case TWUN_PIXELS: sprintf(str, "%s", "TWUN_PIXELS"); break; default: string_or_constant_value = FALSE; break; } } break; default: string_or_constant_value = FALSE; break; } if (string_or_constant_value) { if (strlen(str)) { value = str; } else { value = (Json::Int)item; } }else { value = (Json::Int)item; } } void twain_get_capability_option_name(TW_UINT16 cap, std::string &stringValue) { switch(cap) { case CAP_XFERCOUNT: stringValue = "CAP_XFERCOUNT"; break; case ICAP_COMPRESSION: stringValue = "ICAP_COMPRESSION"; break; case ICAP_PIXELTYPE: stringValue = "ICAP_PIXELTYPE"; break; case ICAP_UNITS: stringValue = "ICAP_UNITS"; break; case ICAP_XFERMECH: stringValue = "ICAP_XFERMECH"; break; case CAP_AUTHOR: stringValue = "CAP_AUTHOR"; break; case CAP_CAPTION: stringValue = "CAP_CAPTION"; break; case CAP_FEEDERENABLED: stringValue = "CAP_FEEDERENABLED"; break; case CAP_FEEDERLOADED: stringValue = "CAP_FEEDERLOADED"; break; case CAP_TIMEDATE: stringValue = "CAP_TIMEDATE"; break; case CAP_SUPPORTEDCAPS: stringValue = "CAP_SUPPORTEDCAPS"; break; case CAP_EXTENDEDCAPS: stringValue = "CAP_EXTENDEDCAPS"; break; case CAP_AUTOFEED: stringValue = "CAP_AUTOFEED"; break; case CAP_CLEARPAGE: stringValue = "CAP_CLEARPAGE"; break; case CAP_FEEDPAGE: stringValue = "CAP_FEEDPAGE"; break; case CAP_REWINDPAGE: stringValue = "CAP_REWINDPAGE"; break; case CAP_INDICATORS: stringValue = "CAP_INDICATORS"; break; case CAP_SUPPORTEDCAPSEXT: stringValue = "CAP_SUPPORTEDCAPSEXT"; break; case CAP_PAPERDETECTABLE: stringValue = "CAP_PAPERDETECTABLE"; break; case CAP_UICONTROLLABLE: stringValue = "CAP_UICONTROLLABLE"; break; case CAP_DEVICEONLINE: stringValue = "CAP_DEVICEONLINE"; break; case CAP_AUTOSCAN: stringValue = "CAP_AUTOSCAN"; break; case CAP_THUMBNAILSENABLED: stringValue = "CAP_THUMBNAILSENABLED"; break; case CAP_DUPLEX: stringValue = "CAP_DUPLEX"; break; case CAP_DUPLEXENABLED: stringValue = "CAP_DUPLEXENABLED"; break; case CAP_ENABLEDSUIONLY: stringValue = "CAP_ENABLEDSUIONLY"; break; case CAP_CUSTOMDSDATA: stringValue = "CAP_CUSTOMDSDATA"; break; case CAP_ENDORSER: stringValue = "CAP_ENDORSER"; break; case CAP_JOBCONTROL: stringValue = "CAP_JOBCONTROL"; break; case CAP_ALARMS: stringValue = "CAP_ALARMS"; break; case CAP_ALARMVOLUME: stringValue = "CAP_ALARMVOLUME"; break; case CAP_AUTOMATICCAPTURE: stringValue = "CAP_AUTOMATICCAPTURE"; break; case CAP_TIMEBEFOREFIRSTCAPTURE: stringValue = "CAP_TIMEBEFOREFIRSTCAPTURE"; break; case CAP_TIMEBETWEENCAPTURES: stringValue = "CAP_TIMEBETWEENCAPTURES"; break; case CAP_CLEARBUFFERS: stringValue = "CAP_CLEARBUFFERS"; break; case CAP_MAXBATCHBUFFERS: stringValue = "CAP_MAXBATCHBUFFERS"; break; case CAP_DEVICETIMEDATE: stringValue = "CAP_DEVICETIMEDATE"; break; case CAP_POWERSUPPLY: stringValue = "CAP_POWERSUPPLY"; break; case CAP_CAMERAPREVIEWUI: stringValue = "CAP_CAMERAPREVIEWUI"; break; case CAP_DEVICEEVENT: stringValue = "CAP_DEVICEEVENT"; break; case CAP_SERIALNUMBER: stringValue = "CAP_SERIALNUMBER"; break; case CAP_PRINTER: stringValue = "CAP_PRINTER"; break; case CAP_PRINTERENABLED: stringValue = "CAP_PRINTERENABLED"; break; case CAP_PRINTERINDEX: stringValue = "CAP_PRINTERINDEX"; break; case CAP_PRINTERMODE: stringValue = "CAP_PRINTERMODE"; break; case CAP_PRINTERSTRING: stringValue = "CAP_PRINTERSTRING"; break; case CAP_PRINTERSUFFIX: stringValue = "CAP_PRINTERSUFFIX"; break; case CAP_LANGUAGE: stringValue = "CAP_LANGUAGE"; break; case CAP_FEEDERALIGNMENT: stringValue = "CAP_FEEDERALIGNMENT"; break; case CAP_FEEDERORDER: stringValue = "CAP_FEEDERORDER"; break; case CAP_REACQUIREALLOWED: stringValue = "CAP_REACQUIREALLOWED"; break; case CAP_BATTERYMINUTES: stringValue = "CAP_BATTERYMINUTES"; break; case CAP_BATTERYPERCENTAGE: stringValue = "CAP_BATTERYPERCENTAGE"; break; /* was missing */ #if USE_TWAIN_DSM case CAP_CAMERASIDE: stringValue = "CAP_CAMERASIDE"; break; case CAP_SEGMENTED: stringValue = "CAP_SEGMENTED"; break; case CAP_CAMERAENABLED: stringValue = "CAP_CAMERAENABLED"; break; case CAP_CAMERAORDER: stringValue = "CAP_CAMERAORDER"; break; case CAP_MICRENABLED: stringValue = "CAP_MICRENABLED"; break; case CAP_FEEDERPREP: stringValue = "CAP_FEEDERPREP"; break; case CAP_FEEDERPOCKET: stringValue = "CAP_FEEDERPOCKET"; break; case CAP_AUTOMATICSENSEMEDIUM: stringValue = "CAP_AUTOMATICSENSEMEDIUM"; break; case CAP_CUSTOMINTERFACEGUID: stringValue = "CAP_CUSTOMINTERFACEGUID"; break; case CAP_SUPPORTEDCAPSSEGMENTUNIQUE: stringValue = "CAP_SUPPORTEDCAPSSEGMENTUNIQUE"; break; case CAP_SUPPORTEDDATS: stringValue = "CAP_SUPPORTEDDATS"; break; case CAP_DOUBLEFEEDDETECTION: stringValue = "CAP_DOUBLEFEEDDETECTION"; break; case CAP_DOUBLEFEEDDETECTIONLENGTH: stringValue = "CAP_DOUBLEFEEDDETECTIONLENGTH"; break; case CAP_DOUBLEFEEDDETECTIONSENSITIVITY: stringValue = "CAP_DOUBLEFEEDDETECTIONSENSITIVITY"; break; case CAP_DOUBLEFEEDDETECTIONRESPONSE: stringValue = "CAP_DOUBLEFEEDDETECTIONRESPONSE"; break; case CAP_PAPERHANDLING: stringValue = "CAP_PAPERHANDLING"; break; case CAP_INDICATORSMODE: stringValue = "CAP_INDICATORSMODE"; break; case CAP_PRINTERVERTICALOFFSET: stringValue = "CAP_PRINTERVERTICALOFFSET"; break; case CAP_POWERSAVETIME: stringValue = "CAP_POWERSAVETIME"; break; case CAP_PRINTERCHARROTATION: stringValue = "CAP_PRINTERCHARROTATION"; break; case CAP_PRINTERFONTSTYLE: stringValue = "CAP_PRINTERFONTSTYLE"; break; case CAP_PRINTERINDEXLEADCHAR: stringValue = "CAP_PRINTERINDEXLEADCHAR"; break; case CAP_PRINTERINDEXMAXVALUE: stringValue = "CAP_PRINTERINDEXMAXVALUE"; break; case CAP_PRINTERINDEXNUMDIGITS: stringValue = "CAP_PRINTERINDEXNUMDIGITS"; break; case CAP_PRINTERINDEXSTEP: stringValue = "CAP_PRINTERINDEXSTEP"; break; case CAP_PRINTERINDEXTRIGGER: stringValue = "CAP_PRINTERINDEXTRIGGER"; break; case CAP_PRINTERSTRINGPREVIEW: stringValue = "CAP_PRINTERSTRINGPREVIEW"; break; #endif case ICAP_AUTOBRIGHT: stringValue = "ICAP_AUTOBRIGHT"; break; case ICAP_BRIGHTNESS: stringValue = "ICAP_BRIGHTNESS"; break; case ICAP_CONTRAST: stringValue = "ICAP_CONTRAST"; break; case ICAP_CUSTHALFTONE: stringValue = "ICAP_CUSTHALFTONE"; break; case ICAP_EXPOSURETIME: stringValue = "ICAP_EXPOSURETIME"; break; case ICAP_FILTER: stringValue = "ICAP_FILTER"; break; case ICAP_FLASHUSED: stringValue = "ICAP_FLASHUSED"; break; case ICAP_GAMMA: stringValue = "ICAP_GAMMA"; break; case ICAP_HALFTONES: stringValue = "ICAP_HALFTONES"; break; case ICAP_HIGHLIGHT: stringValue = "ICAP_HIGHLIGHT"; break; case ICAP_IMAGEFILEFORMAT: stringValue = "ICAP_IMAGEFILEFORMAT"; break; case ICAP_LAMPSTATE: stringValue = "ICAP_LAMPSTATE"; break; case ICAP_LIGHTSOURCE: stringValue = "ICAP_LIGHTSOURCE"; break; case ICAP_ORIENTATION: stringValue = "ICAP_ORIENTATION"; break; case ICAP_PHYSICALWIDTH: stringValue = "ICAP_PHYSICALWIDTH"; break; case ICAP_PHYSICALHEIGHT: stringValue = "ICAP_PHYSICALHEIGHT"; break; case ICAP_SHADOW: stringValue = "ICAP_SHADOW"; break; case ICAP_FRAMES: stringValue = "ICAP_FRAMES"; break; case ICAP_XNATIVERESOLUTION: stringValue = "ICAP_XNATIVERESOLUTION"; break; case ICAP_YNATIVERESOLUTION: stringValue = "ICAP_YNATIVERESOLUTION"; break; case ICAP_XRESOLUTION: stringValue = "ICAP_XRESOLUTION"; break; case ICAP_YRESOLUTION: stringValue = "ICAP_YRESOLUTION"; break; case ICAP_MAXFRAMES: stringValue = "ICAP_MAXFRAMES"; break; case ICAP_TILES: stringValue = "ICAP_TILES"; break; case ICAP_BITORDER: stringValue = "ICAP_BITORDER"; break; case ICAP_CCITTKFACTOR: stringValue = "ICAP_CCITTKFACTOR"; break; case ICAP_LIGHTPATH: stringValue = "ICAP_LIGHTPATH"; break; case ICAP_PIXELFLAVOR: stringValue = "ICAP_PIXELFLAVOR"; break; case ICAP_PLANARCHUNKY: stringValue = "ICAP_PLANARCHUNKY"; break; case ICAP_ROTATION: stringValue = "ICAP_ROTATION"; break; case ICAP_SUPPORTEDSIZES: stringValue = "ICAP_SUPPORTEDSIZES"; break; case ICAP_THRESHOLD: stringValue = "ICAP_THRESHOLD"; break; case ICAP_XSCALING: stringValue = "ICAP_XSCALING"; break; case ICAP_YSCALING: stringValue = "ICAP_YSCALING"; break; case ICAP_BITORDERCODES: stringValue = "ICAP_BITORDERCODES"; break; case ICAP_PIXELFLAVORCODES: stringValue = "ICAP_PIXELFLAVORCODES"; break; case ICAP_JPEGPIXELTYPE: stringValue = "ICAP_JPEGPIXELTYPE"; break; case ICAP_TIMEFILL: stringValue = "ICAP_TIMEFILL"; break; case ICAP_BITDEPTH: stringValue = "ICAP_BITDEPTH"; break; case ICAP_BITDEPTHREDUCTION: stringValue = "ICAP_BITDEPTHREDUCTION"; break; case ICAP_UNDEFINEDIMAGESIZE: stringValue = "ICAP_UNDEFINEDIMAGESIZE"; break; case ICAP_IMAGEDATASET: stringValue = "ICAP_IMAGEDATASET"; break; case ICAP_EXTIMAGEINFO: stringValue = "ICAP_EXTIMAGEINFO"; break; case ICAP_MINIMUMHEIGHT: stringValue = "ICAP_MINIMUMHEIGHT"; break; case ICAP_MINIMUMWIDTH: stringValue = "ICAP_MINIMUMWIDTH"; break; case ICAP_FLIPROTATION: stringValue = "ICAP_FLIPROTATION"; break; case ICAP_BARCODEDETECTIONENABLED: stringValue = "ICAP_BARCODEDETECTIONENABLED"; break; case ICAP_SUPPORTEDBARCODETYPES: stringValue = "ICAP_SUPPORTEDBARCODETYPES"; break; case ICAP_BARCODEMAXSEARCHPRIORITIES: stringValue = "ICAP_BARCODEMAXSEARCHPRIORITIES"; break; case ICAP_BARCODESEARCHPRIORITIES: stringValue = "ICAP_BARCODESEARCHPRIORITIES"; break; case ICAP_BARCODESEARCHMODE: stringValue = "ICAP_BARCODESEARCHMODE"; break; case ICAP_BARCODEMAXRETRIES: stringValue = "ICAP_BARCODEMAXRETRIES"; break; case ICAP_BARCODETIMEOUT: stringValue = "ICAP_BARCODETIMEOUT"; break; case ICAP_ZOOMFACTOR: stringValue = "ICAP_ZOOMFACTOR"; break; case ICAP_PATCHCODEDETECTIONENABLED: stringValue = "ICAP_PATCHCODEDETECTIONENABLED"; break; case ICAP_SUPPORTEDPATCHCODETYPES: stringValue = "ICAP_SUPPORTEDPATCHCODETYPES"; break; case ICAP_PATCHCODEMAXSEARCHPRIORITIES: stringValue = "ICAP_PATCHCODEMAXSEARCHPRIORITIES"; break; case ICAP_PATCHCODESEARCHPRIORITIES: stringValue = "ICAP_PATCHCODESEARCHPRIORITIES"; break; case ICAP_PATCHCODESEARCHMODE: stringValue = "ICAP_PATCHCODESEARCHMODE"; break; case ICAP_PATCHCODEMAXRETRIES: stringValue = "ICAP_PATCHCODEMAXRETRIES"; break; case ICAP_PATCHCODETIMEOUT: stringValue = "ICAP_PATCHCODETIMEOUT"; break; case ICAP_FLASHUSED2: stringValue = "ICAP_FLASHUSED2"; break; case ICAP_IMAGEFILTER: stringValue = "ICAP_IMAGEFILTER"; break; case ICAP_NOISEFILTER: stringValue = "ICAP_NOISEFILTER"; break; case ICAP_OVERSCAN: stringValue = "ICAP_OVERSCAN"; break; case ICAP_AUTOMATICBORDERDETECTION: stringValue = "ICAP_AUTOMATICBORDERDETECTION"; break; case ICAP_AUTOMATICDESKEW: stringValue = "ICAP_AUTOMATICDESKEW"; break; case ICAP_AUTOMATICROTATE: stringValue = "ICAP_AUTOMATICROTATE"; break; case ICAP_JPEGQUALITY: stringValue = "ICAP_JPEGQUALITY"; break; #if USE_TWAIN_DSM case ICAP_AUTODISCARDBLANKPAGES: stringValue = "ICAP_AUTODISCARDBLANKPAGES"; break; case ICAP_FEEDERTYPE: stringValue = "ICAP_FEEDERTYPE"; break; case ICAP_ICCPROFILE: stringValue = "ICAP_ICCPROFILE"; break; case ICAP_AUTOSIZE: stringValue = "ICAP_AUTOSIZE"; break; case ICAP_AUTOMATICCROPUSESFRAME: stringValue = "ICAP_AUTOMATICCROPUSESFRAME"; break; case ICAP_AUTOMATICLENGTHDETECTION: stringValue = "ICAP_AUTOMATICLENGTHDETECTION"; break; case ICAP_AUTOMATICCOLORENABLED: stringValue = "ICAP_AUTOMATICCOLORENABLED"; break; case ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE: stringValue = "ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE"; break; case ICAP_COLORMANAGEMENTENABLED: stringValue = "ICAP_COLORMANAGEMENTENABLED"; break; case ICAP_IMAGEMERGE: stringValue = "ICAP_IMAGEMERGE"; break; case ICAP_IMAGEMERGEHEIGHTTHRESHOLD: stringValue = "ICAP_IMAGEMERGEHEIGHTTHRESHOLD"; break; case ICAP_SUPPORTEDEXTIMAGEINFO: stringValue = "ICAP_SUPPORTEDEXTIMAGEINFO"; break; case ICAP_FILMTYPE: stringValue = "ICAP_FILMTYPE"; break; case ICAP_MIRROR: stringValue = "ICAP_MIRROR"; break; case ICAP_JPEGSUBSAMPLING: stringValue = "ICAP_JPEGSUBSAMPLING"; break; #endif default: { char buf[33]; #if VERSIONWIN stringValue = _itoa(cap, buf, 10); #else snprintf(buf, 33, "%d", cap); stringValue = buf; #endif } break; } } void twain_get_capability_value(TW_CAPABILITY *tw_capability, void *p, Json::Value& json_scanner_option) { TW_UINT16 cap = tw_capability->Cap; TW_UINT16 conType = tw_capability->ConType; pTW_ENUMERATION pENUMERATION = (pTW_ENUMERATION)p; pTW_ONEVALUE pONEVALUE = (pTW_ONEVALUE)p; pTW_RANGE pRANGE = (pTW_RANGE)p; char str[CAP_VALUE_BUF_SIZE]; memset(str, 0, sizeof(str)); BOOL string_or_constant_value = TRUE; TW_INT32 item = 0; switch(conType) { case TWON_ARRAY: break; case TWON_ENUMERATION: item = (pENUMERATION->ItemList[pENUMERATION->CurrentIndex]); break; case TWON_ONEVALUE: item = pONEVALUE->Item; break; case TWON_RANGE: item = pRANGE->CurrentValue; break; } switch(cap) { //convert to constant #if USE_TWAIN_DSM case ICAP_AUTOSIZE: { switch(item) { case TWAS_NONE: sprintf(str, "%s", "TWAS_NONE");break; case TWAS_AUTO: sprintf(str, "%s", "TWAS_AUTO");break; case TWAS_CURRENT: sprintf(str, "%s", "TWAS_CURRENT");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_AUTODISCARDBLANKPAGES: { switch(item) { case TWBP_DISABLE: sprintf(str, "%s", "TWBP_DISABLE");break; case TWBP_AUTO: sprintf(str, "%s", "TWBP_AUTO");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_CAMERASIDE: { switch(item) { case TWCS_BOTH: sprintf(str, "%s", "TWCS_BOTH");break; case TWCS_TOP: sprintf(str, "%s", "TWCS_TOP");break; case TWCS_BOTTOM: sprintf(str, "%s", "TWCS_BOTTOM");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_FEEDERTYPE: { switch(item) { case TWFE_GENERAL: sprintf(str, "%s", "TWFE_GENERAL");break; case TWFE_PHOTO: sprintf(str, "%s", "TWFE_PHOTO");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_FEEDERPOCKET: { switch(item) { case TWFP_POCKETERROR: sprintf(str, "%s", "TWFP_POCKETERROR");break; case TWFP_POCKET1: sprintf(str, "%s", "TWFP_POCKET1");break; case TWFP_POCKET2: sprintf(str, "%s", "TWFP_POCKET2");break; case TWFP_POCKET3: sprintf(str, "%s", "TWFP_POCKET3");break; case TWFP_POCKET4: sprintf(str, "%s", "TWFP_POCKET4");break; case TWFP_POCKET5: sprintf(str, "%s", "TWFP_POCKET5");break; case TWFP_POCKET6: sprintf(str, "%s", "TWFP_POCKET6");break; case TWFP_POCKET7: sprintf(str, "%s", "TWFP_POCKET7");break; case TWFP_POCKET8: sprintf(str, "%s", "TWFP_POCKET8");break; case TWFP_POCKET9: sprintf(str, "%s", "TWFP_POCKET9");break; case TWFP_POCKET10: sprintf(str, "%s", "TWFP_POCKET10");break; case TWFP_POCKET11: sprintf(str, "%s", "TWFP_POCKET11");break; case TWFP_POCKET12: sprintf(str, "%s", "TWFP_POCKET12");break; case TWFP_POCKET13: sprintf(str, "%s", "TWFP_POCKET13");break; case TWFP_POCKET14: sprintf(str, "%s", "TWFP_POCKET14");break; case TWFP_POCKET15: sprintf(str, "%s", "TWFP_POCKET15");break; case TWFP_POCKET16: sprintf(str, "%s", "TWFP_POCKET16");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_ICCPROFILE: { switch(item) { case TWIC_NONE: sprintf(str, "%s", "TWIC_NONE");break; case TWIC_LINK: sprintf(str, "%s", "TWIC_LINK");break; case TWIC_EMBED: sprintf(str, "%s", "TWIC_EMBED");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_IMAGEMERGE: { switch(item) { case TWIM_NONE: sprintf(str, "%s", "TWIM_NONE");break; case TWIM_FRONTONTOP: sprintf(str, "%s", "TWIM_FRONTONTOP");break; case TWIM_FRONTONBOTTOM: sprintf(str, "%s", "TWIM_FRONTONBOTTOM");break; case TWIM_FRONTONLEFT: sprintf(str, "%s", "TWIM_FRONTONLEFT");break; case TWIM_FRONTONRIGHT: sprintf(str, "%s", "TWIM_FRONTONRIGHT");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_SEGMENTED: { switch(item) { case TWSG_NONE: sprintf(str, "%s", "TWSG_NONE");break; case TWSG_AUTO: sprintf(str, "%s", "TWSG_AUTO");break; case TWSG_MANUAL: sprintf(str, "%s", "TWSG_MANUAL");break; default: string_or_constant_value = FALSE; break; } } break; #endif case CAP_ALARMS: { switch(item) { case TWAL_ALARM: sprintf(str, "%s", "TWAL_ALARM");break; case TWAL_FEEDERERROR: sprintf(str, "%s", "TWAL_FEEDERERROR");break; case TWAL_FEEDERWARNING: sprintf(str, "%s", "TWAL_FEEDERWARNING");break; case TWAL_BARCODE: sprintf(str, "%s", "TWAL_BARCODE");break; case TWAL_DOUBLEFEED: sprintf(str, "%s", "TWAL_DOUBLEFEED");break; case TWAL_JAM: sprintf(str, "%s", "TWAL_JAM");break; case TWAL_PATCHCODE: sprintf(str, "%s", "TWAL_PATCHCODE");break; case TWAL_POWER: sprintf(str, "%s", "TWAL_POWER");break; case TWAL_SKEW: sprintf(str, "%s", "TWAL_SKEW");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_COMPRESSION: { switch(item) { case TWCP_NONE: sprintf(str, "%s", "TWCP_NONE");break; case TWCP_PACKBITS: sprintf(str, "%s", "TWCP_PACKBITS");break; case TWCP_GROUP31D: sprintf(str, "%s", "TWCP_GROUP31D");break; case TWCP_GROUP31DEOL: sprintf(str, "%s", "TWCP_GROUP31DEOL");break; case TWCP_GROUP32D: sprintf(str, "%s", "TWCP_GROUP32D");break; case TWCP_GROUP4: sprintf(str, "%s", "TWCP_GROUP4");break; case TWCP_JPEG: sprintf(str, "%s", "TWCP_JPEG");break; case TWCP_LZW: sprintf(str, "%s", "TWCP_LZW");break; case TWCP_JBIG: sprintf(str, "%s", "TWCP_JBIG");break; case TWCP_PNG: sprintf(str, "%s", "TWCP_PNG");break; case TWCP_RLE4: sprintf(str, "%s", "TWCP_RLE4");break; case TWCP_RLE8: sprintf(str, "%s", "TWCP_RLE8");break; case TWCP_BITFIELDS: sprintf(str, "%s", "TWCP_BITFIELDS");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_BARCODESEARCHMODE: { switch(item) { case TWBD_HORZ: sprintf(str, "%s", "TWBD_HORZ");break; case TWBD_VERT: sprintf(str, "%s", "TWBD_VERT");break; case TWBD_HORZVERT: sprintf(str, "%s", "TWBD_HORZVERT");break; case TWBD_VERTHORZ: sprintf(str, "%s", "TWBD_VERTHORZ");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_BITORDER: { switch(item) { case TWBO_LSBFIRST: sprintf(str, "%s", "TWBO_LSBFIRST");break; case TWBO_MSBFIRST: sprintf(str, "%s", "TWBO_MSBFIRST");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_BITDEPTHREDUCTION: { switch(item) { case TWBR_THRESHOLD: sprintf(str, "%s", "TWBR_THRESHOLD");break; case TWBR_HALFTONE: sprintf(str, "%s", "TWBR_HALFTONE");break; case TWBR_CUSTHALFTONE: sprintf(str, "%s", "TWBR_CUSTHALFTONE");break; case TWBR_DIFFUSION: sprintf(str, "%s", "TWBR_DIFFUSION");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_SUPPORTEDBARCODETYPES: case TWEI_BARCODETYPE: { switch(item) { case TWBT_3OF9: sprintf(str, "%s", "TWBT_3OF9");break; case TWBT_2OF5INTERLEAVED: sprintf(str, "%s", "TWBT_2OF5INTERLEAVED");break; case TWBT_2OF5NONINTERLEAVED: sprintf(str, "%s", "TWBT_2OF5NONINTERLEAVED");break; case TWBT_CODE93: sprintf(str, "%s", "TWBT_CODE93");break; case TWBT_CODE128: sprintf(str, "%s", "TWBT_CODE128");break; case TWBT_UCC128: sprintf(str, "%s", "TWBT_UCC128");break; case TWBT_CODABAR: sprintf(str, "%s", "TWBT_CODABAR");break; case TWBT_UPCA: sprintf(str, "%s", "TWBT_UPCA");break; case TWBT_UPCE: sprintf(str, "%s", "TWBT_UPCE");break; case TWBT_EAN8: sprintf(str, "%s", "TWBT_EAN8");break; case TWBT_EAN13: sprintf(str, "%s", "TWBT_EAN13");break; case TWBT_POSTNET: sprintf(str, "%s", "TWBT_POSTNET");break; case TWBT_PDF417: sprintf(str, "%s", "TWBT_PDF417");break; case TWBT_2OF5INDUSTRIAL: sprintf(str, "%s", "TWBT_2OF5INDUSTRIAL");break; case TWBT_2OF5MATRIX: sprintf(str, "%s", "TWBT_2OF5MATRIX");break; case TWBT_2OF5DATALOGIC: sprintf(str, "%s", "TWBT_2OF5DATALOGIC");break; case TWBT_2OF5IATA: sprintf(str, "%s", "TWBT_2OF5IATA");break; case TWBT_3OF9FULLASCII: sprintf(str, "%s", "TWBT_3OF9FULLASCII");break; case TWBT_CODABARWITHSTARTSTOP: sprintf(str, "%s", "TWBT_CODABARWITHSTARTSTOP");break; case TWBT_MAXICODE: sprintf(str, "%s", "TWBT_MAXICODE");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_CLEARBUFFERS: { switch(item) { case TWCB_AUTO: sprintf(str, "%s", "TWCB_AUTO");break; case TWCB_CLEAR: sprintf(str, "%s", "TWCB_CLEAR");break; case TWCB_NOCLEAR: sprintf(str, "%s", "TWCB_NOCLEAR");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_DEVICEEVENT: { switch(item) { case TWDE_CUSTOMEVENTS: sprintf(str, "%s", "TWDE_CUSTOMEVENTS");break; case TWDE_CHECKAUTOMATICCAPTURE: sprintf(str, "%s", "TWDE_CHECKAUTOMATICCAPTURE");break; case TWDE_CHECKBATTERY: sprintf(str, "%s", "TWDE_CHECKBATTERY");break; case TWDE_CHECKDEVICEONLINE: sprintf(str, "%s", "TWDE_CHECKDEVICEONLINE");break; case TWDE_CHECKFLASH: sprintf(str, "%s", "TWDE_CHECKFLASH");break; case TWDE_CHECKPOWERSUPPLY: sprintf(str, "%s", "TWDE_CHECKPOWERSUPPLY");break; case TWDE_CHECKRESOLUTION: sprintf(str, "%s", "TWDE_CHECKRESOLUTION");break; case TWDE_DEVICEADDED: sprintf(str, "%s", "TWDE_DEVICEADDED");break; case TWDE_DEVICEOFFLINE: sprintf(str, "%s", "TWDE_DEVICEOFFLINE");break; case TWDE_DEVICEREADY: sprintf(str, "%s", "TWDE_DEVICEREADY");break; case TWDE_DEVICEREMOVED: sprintf(str, "%s", "TWDE_DEVICEREMOVED");break; case TWDE_IMAGECAPTURED: sprintf(str, "%s", "TWDE_IMAGECAPTURED");break; case TWDE_IMAGEDELETED: sprintf(str, "%s", "TWDE_IMAGEDELETED");break; case TWDE_PAPERDOUBLEFEED: sprintf(str, "%s", "TWDE_PAPERDOUBLEFEED");break; case TWDE_PAPERJAM: sprintf(str, "%s", "TWDE_PAPERJAM");break; case TWDE_LAMPFAILURE: sprintf(str, "%s", "TWDE_LAMPFAILURE");break; case TWDE_POWERSAVE: sprintf(str, "%s", "TWDE_POWERSAVE");break; case TWDE_POWERSAVENOTIFY: sprintf(str, "%s", "TWDE_POWERSAVENOTIFY");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_DUPLEX: { switch(item) { case TWDX_NONE: sprintf(str, "%s", "TWDX_NONE");break; case TWDX_1PASSDUPLEX: sprintf(str, "%s", "TWDX_1PASSDUPLEX");break; case TWDX_2PASSDUPLEX: sprintf(str, "%s", "TWDX_2PASSDUPLEX");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_FEEDERALIGNMENT: { switch(item) { case TWFA_NONE: sprintf(str, "%s", "TWFA_NONE");break; case TWFA_LEFT: sprintf(str, "%s", "TWFA_LEFT");break; case TWFA_CENTER: sprintf(str, "%s", "TWFA_CENTER");break; case TWFA_RIGHT: sprintf(str, "%s", "TWFA_RIGHT");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_IMAGEFILEFORMAT: { switch(item) { case TWFF_TIFF: sprintf(str, "%s", "TWFF_TIFF");break; case TWFF_PICT: sprintf(str, "%s", "TWFF_PICT");break; case TWFF_BMP: sprintf(str, "%s", "TWFF_BMP");break; case TWFF_XBM: sprintf(str, "%s", "TWFF_XBM");break; case TWFF_JFIF: sprintf(str, "%s", "TWFF_JFIF");break; case TWFF_FPX: sprintf(str, "%s", "TWFF_FPX");break; case TWFF_TIFFMULTI: sprintf(str, "%s", "TWFF_TIFFMULTI");break; case TWFF_PNG: sprintf(str, "%s", "TWFF_PNG");break; case TWFF_SPIFF: sprintf(str, "%s", "TWFF_SPIFF");break; case TWFF_EXIF: sprintf(str, "%s", "TWFF_EXIF");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_FLASHUSED2: { switch(item) { case TWFL_NONE: sprintf(str, "%s", "TWFL_NONE");break; case TWFL_OFF: sprintf(str, "%s", "TWFL_OFF");break; case TWFL_ON: sprintf(str, "%s", "TWFL_ON");break; case TWFL_AUTO: sprintf(str, "%s", "TWFL_AUTO");break; case TWFL_REDEYE: sprintf(str, "%s", "TWFL_REDEYE");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_FEEDERORDER: { switch(item) { case TWFO_FIRSTPAGEFIRST: sprintf(str, "%s", "TWFO_FIRSTPAGEFIRST");break; case TWFO_LASTPAGEFIRST: sprintf(str, "%s", "TWFO_LASTPAGEFIRST");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_FLIPROTATION: { switch(item) { case TWFR_BOOK: sprintf(str, "%s", "TWFR_BOOK");break; case TWFR_FANFOLD: sprintf(str, "%s", "TWFR_FANFOLD");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_FILTER: { switch(item) { case TWFT_RED: sprintf(str, "%s", "TWFT_RED");break; case TWFT_GREEN: sprintf(str, "%s", "TWFT_GREEN");break; case TWFT_BLUE: sprintf(str, "%s", "TWFT_BLUE");break; case TWFT_NONE: sprintf(str, "%s", "TWFT_NONE");break; case TWFT_WHITE: sprintf(str, "%s", "TWFT_WHITE");break; case TWFT_CYAN: sprintf(str, "%s", "TWFT_CYAN");break; case TWFT_MAGENTA: sprintf(str, "%s", "TWFT_MAGENTA");break; case TWFT_YELLOW: sprintf(str, "%s", "TWFT_YELLOW");break; case TWFT_BLACK: sprintf(str, "%s", "TWFT_BLACK");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_IMAGEFILTER: { switch(item) { case TWIF_NONE: sprintf(str, "%s", "TWIF_NONE");break; case TWIF_AUTO: sprintf(str, "%s", "TWIF_AUTO");break; case TWIF_LOWPASS: sprintf(str, "%s", "TWIF_LOWPASS");break; case TWIF_BANDPASS: sprintf(str, "%s", "TWIF_BANDPASS");break; case TWIF_HIGHPASS: sprintf(str, "%s", "TWIF_HIGHPASS");break; // case TWIF_TEXT: // sprintf(str, "%s", "TWIF_TEXT");break; // case TWIF_FINELINE: // sprintf(str, "%s", "TWIF_FINELINE");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_JOBCONTROL: { switch(item) { case TWJC_NONE: sprintf(str, "%s", "TWJC_NONE");break; case TWJC_JSIC: sprintf(str, "%s", "TWJC_JSIC");break; case TWJC_JSIS: sprintf(str, "%s", "TWJC_JSIS");break; case TWJC_JSXC: sprintf(str, "%s", "TWJC_JSXC");break; case TWJC_JSXS: sprintf(str, "%s", "TWJC_JSXS");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_JPEGQUALITY: { switch(item) { case TWJQ_UNKNOWN: sprintf(str, "%s", "TWJQ_UNKNOWN");break; case TWJQ_LOW: sprintf(str, "%s", "TWJQ_LOW");break; case TWJQ_MEDIUM: sprintf(str, "%s", "TWJQ_MEDIUM");break; case TWJQ_HIGH: sprintf(str, "%s", "TWJQ_HIGH");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_LIGHTPATH: { switch(item) { case TWLP_REFLECTIVE: sprintf(str, "%s", "TWLP_REFLECTIVE");break; case TWLP_TRANSMISSIVE: sprintf(str, "%s", "TWLP_TRANSMISSIVE");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_LIGHTSOURCE: { switch(item) { case TWLS_RED: sprintf(str, "%s", "TWLS_RED");break; case TWLS_GREEN: sprintf(str, "%s", "TWLS_GREEN");break; case TWLS_BLUE: sprintf(str, "%s", "TWLS_BLUE");break; case TWLS_NONE: sprintf(str, "%s", "TWLS_NONE");break; case TWLS_WHITE: sprintf(str, "%s", "TWLS_WHITE");break; case TWLS_UV: sprintf(str, "%s", "TWLS_UV");break; case TWLS_IR: sprintf(str, "%s", "TWLS_IR");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_NOISEFILTER: { switch(item) { case TWNF_NONE: sprintf(str, "%s", "TWNF_NONE");break; case TWNF_AUTO: sprintf(str, "%s", "TWNF_AUTO");break; case TWNF_LONEPIXEL: sprintf(str, "%s", "TWNF_LONEPIXEL");break; case TWNF_MAJORITYRULE: sprintf(str, "%s", "TWNF_MAJORITYRULE");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_ORIENTATION: { switch(item) { case TWOR_ROT0: sprintf(str, "%s", "TWOR_ROT0");break; case TWOR_ROT90: sprintf(str, "%s", "TWOR_ROT90");break; case TWOR_ROT180: sprintf(str, "%s", "TWOR_ROT180");break; case TWOR_ROT270: sprintf(str, "%s", "TWOR_ROT270");break; // case TWOR_PORTRAIT: // sprintf(str, "%s", "TWOR_PORTRAIT");break; // case TWOR_LANDSCAPE: // sprintf(str, "%s", "TWOR_LANDSCAPE");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_OVERSCAN: { switch(item) { case TWOV_NONE: sprintf(str, "%s", "TWOV_NONE");break; case TWOV_AUTO: sprintf(str, "%s", "TWOV_AUTO");break; case TWOV_TOPBOTTOM: sprintf(str, "%s", "TWOV_TOPBOTTOM");break; case TWOV_LEFTRIGHT: sprintf(str, "%s", "TWOV_LEFTRIGHT");break; case TWOV_ALL: sprintf(str, "%s", "TWOV_ALL");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_PLANARCHUNKY: { switch(item) { case TWPC_CHUNKY: sprintf(str, "%s", "TWPC_CHUNKY");break; case TWPC_PLANAR: sprintf(str, "%s", "TWPC_PLANAR");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_PIXELFLAVOR: { switch(item) { case TWPF_CHOCOLATE: sprintf(str, "%s", "TWPF_CHOCOLATE");break; case TWPF_VANILLA: sprintf(str, "%s", "TWPF_VANILLA");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_PRINTERMODE: { switch(item) { case TWPM_SINGLESTRING: sprintf(str, "%s", "TWPM_SINGLESTRING");break; case TWPM_MULTISTRING: sprintf(str, "%s", "TWPM_MULTISTRING");break; case TWPM_COMPOUNDSTRING: sprintf(str, "%s", "TWPM_COMPOUNDSTRING");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_PRINTER: { switch(item) { case TWPR_IMPRINTERTOPBEFORE: sprintf(str, "%s", "TWPR_IMPRINTERTOPBEFORE");break; case TWPR_IMPRINTERTOPAFTER: sprintf(str, "%s", "TWPR_IMPRINTERTOPAFTER");break; case TWPR_IMPRINTERBOTTOMBEFORE: sprintf(str, "%s", "TWPR_IMPRINTERBOTTOMBEFORE");break; case TWPR_IMPRINTERBOTTOMAFTER: sprintf(str, "%s", "TWPR_IMPRINTERBOTTOMAFTER");break; case TWPR_ENDORSERTOPBEFORE: sprintf(str, "%s", "TWPR_ENDORSERTOPBEFORE");break; case TWPR_ENDORSERTOPAFTER: sprintf(str, "%s", "TWPR_ENDORSERTOPAFTER");break; case TWPR_ENDORSERBOTTOMBEFORE: sprintf(str, "%s", "TWPR_ENDORSERBOTTOMBEFORE");break; case TWPR_ENDORSERBOTTOMAFTER: sprintf(str, "%s", "TWPR_ENDORSERBOTTOMAFTER");break; default: string_or_constant_value = FALSE; break; } } break; case CAP_POWERSUPPLY: { switch(item) { case TWPS_EXTERNAL: sprintf(str, "%s", "TWPS_EXTERNAL");break; case TWPS_BATTERY: sprintf(str, "%s", "TWPS_BATTERY");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_PIXELTYPE: { switch(item) { case TWPT_BW: sprintf(str, "%s", "TWPT_BW");break; case TWPT_GRAY: sprintf(str, "%s", "TWPT_GRAY");break; case TWPT_RGB: sprintf(str, "%s", "TWPT_RGB");break; case TWPT_PALETTE: sprintf(str, "%s", "TWPT_PALETTE");break; case TWPT_CMY: sprintf(str, "%s", "TWPT_CMY");break; case TWPT_CMYK: sprintf(str, "%s", "TWPT_CMYK");break; case TWPT_YUV: sprintf(str, "%s", "TWPT_YUV");break; case TWPT_YUVK: sprintf(str, "%s", "TWPT_YUVK");break; case TWPT_CIEXYZ: sprintf(str, "%s", "TWPT_CIEXYZ");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_SUPPORTEDSIZES: { switch(item) { case TWSS_NONE: sprintf(str, "%s", "TWSS_NONE");break; case TWSS_A4LETTER: sprintf(str, "%s", "TWSS_A4LETTER");break; case TWSS_B5LETTER: sprintf(str, "%s", "TWSS_B5LETTER");break; case TWSS_USLETTER: sprintf(str, "%s", "TWSS_USLETTER");break; case TWSS_USLEGAL: sprintf(str, "%s", "TWSS_USLEGAL");break; case TWSS_A5: sprintf(str, "%s", "TWSS_A5");break; case TWSS_B4: sprintf(str, "%s", "TWSS_B4");break; case TWSS_B6: sprintf(str, "%s", "TWSS_B6");break; // case TWSS_B: // sprintf(str, "%s", "TWSS_B");break; case TWSS_USLEDGER: sprintf(str, "%s", "TWSS_USLEDGER");break; case TWSS_USEXECUTIVE: sprintf(str, "%s", "TWSS_USEXECUTIVE");break; case TWSS_A3: sprintf(str, "%s", "TWSS_A3");break; case TWSS_B3: sprintf(str, "%s", "TWSS_B3");break; case TWSS_A6: sprintf(str, "%s", "TWSS_A6");break; case TWSS_C4: sprintf(str, "%s", "TWSS_C4");break; case TWSS_C5: sprintf(str, "%s", "TWSS_C5");break; case TWSS_C6: sprintf(str, "%s", "TWSS_C6");break; case TWSS_4A0: sprintf(str, "%s", "TWSS_4A0");break; case TWSS_2A0: sprintf(str, "%s", "TWSS_2A0");break; case TWSS_A0: sprintf(str, "%s", "TWSS_A0");break; case TWSS_A1: sprintf(str, "%s", "TWSS_A1");break; case TWSS_A2: sprintf(str, "%s", "TWSS_A2");break; // case TWSS_A4: // sprintf(str, "%s", "TWSS_A4");break; case TWSS_A7: sprintf(str, "%s", "TWSS_A7");break; case TWSS_A8: sprintf(str, "%s", "TWSS_A8");break; case TWSS_A9: sprintf(str, "%s", "TWSS_A9");break; case TWSS_A10: sprintf(str, "%s", "TWSS_A10");break; case TWSS_ISOB0: sprintf(str, "%s", "TWSS_ISOB0");break; case TWSS_ISOB1: sprintf(str, "%s", "TWSS_ISOB1");break; case TWSS_ISOB2: sprintf(str, "%s", "TWSS_ISOB2");break; // case TWSS_ISOB3: // sprintf(str, "%s", "TWSS_ISOB3");break; // case TWSS_ISOB4: // sprintf(str, "%s", "TWSS_ISOB4");break; case TWSS_ISOB5: sprintf(str, "%s", "TWSS_ISOB5");break; // case TWSS_ISOB6: // sprintf(str, "%s", "TWSS_ISOB6");break; case TWSS_ISOB7: sprintf(str, "%s", "TWSS_ISOB7");break; case TWSS_ISOB8: sprintf(str, "%s", "TWSS_ISOB8");break; case TWSS_ISOB9: sprintf(str, "%s", "TWSS_ISOB9");break; case TWSS_ISOB10: sprintf(str, "%s", "TWSS_ISOB10");break; case TWSS_JISB0: sprintf(str, "%s", "TWSS_JISB0");break; case TWSS_JISB1: sprintf(str, "%s", "TWSS_JISB1");break; case TWSS_JISB2: sprintf(str, "%s", "TWSS_JISB2");break; case TWSS_JISB3: sprintf(str, "%s", "TWSS_JISB3");break; case TWSS_JISB4: sprintf(str, "%s", "TWSS_JISB4");break; // case TWSS_JISB5: // sprintf(str, "%s", "TWSS_JISB5");break; case TWSS_JISB6: sprintf(str, "%s", "TWSS_JISB6");break; case TWSS_JISB7: sprintf(str, "%s", "TWSS_JISB7");break; case TWSS_JISB8: sprintf(str, "%s", "TWSS_JISB8");break; case TWSS_JISB9: sprintf(str, "%s", "TWSS_JISB9");break; case TWSS_JISB10: sprintf(str, "%s", "TWSS_JISB10");break; case TWSS_C0: sprintf(str, "%s", "TWSS_C0");break; case TWSS_C1: sprintf(str, "%s", "TWSS_C1");break; case TWSS_C2: sprintf(str, "%s", "TWSS_C2");break; case TWSS_C3: sprintf(str, "%s", "TWSS_C3");break; case TWSS_C7: sprintf(str, "%s", "TWSS_C7");break; case TWSS_C8: sprintf(str, "%s", "TWSS_C8");break; case TWSS_C9: sprintf(str, "%s", "TWSS_C9");break; case TWSS_C10: sprintf(str, "%s", "TWSS_C10");break; case TWSS_USSTATEMENT: sprintf(str, "%s", "TWSS_USSTATEMENT");break; case TWSS_BUSINESSCARD: sprintf(str, "%s", "TWSS_BUSINESSCARD");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_XFERMECH: { switch(item) { case TWSX_NATIVE: sprintf(str, "%s", "TWSX_NATIVE");break; case TWSX_FILE: sprintf(str, "%s", "TWSX_FILE");break; case TWSX_MEMORY: sprintf(str, "%s", "TWSX_MEMORY");break; case TWSX_FILE2: sprintf(str, "%s", "TWSX_FILE2");break; default: string_or_constant_value = FALSE; break; } } break; case ICAP_UNITS: { switch(item) { case TWUN_INCHES: sprintf(str, "%s", "TWUN_INCHES");break; case TWUN_CENTIMETERS: sprintf(str, "%s", "TWUN_CENTIMETERS");break; case TWUN_PICAS: sprintf(str, "%s", "TWUN_PICAS");break; case TWUN_POINTS: sprintf(str, "%s", "TWUN_POINTS");break; case TWUN_TWIPS: sprintf(str, "%s", "TWUN_TWIPS");break; case TWUN_PIXELS: sprintf(str, "%s", "TWUN_PIXELS");break; default: string_or_constant_value = FALSE; break; } } break; default: string_or_constant_value = FALSE; break; } if(string_or_constant_value) { json_scanner_option = str; } else { //generic switch (conType) { case TWON_ARRAY: string_or_constant_value = FALSE; break; case TWON_ENUMERATION: switch (pENUMERATION->ItemType) { case TWTY_FIX32: { string_or_constant_value = FALSE; pTW_FIX32 pFix32 = &((pTW_FIX32)(&pENUMERATION->ItemList))[pENUMERATION->CurrentIndex]; json_scanner_option = float(pFix32->Whole) + float(pFix32->Frac / 65536.0); } break; case TWTY_FRAME: { pTW_FRAME pframe = &((pTW_FRAME)(&pENUMERATION->ItemList))[pENUMERATION->CurrentIndex]; sprintf(str, "%d.%u,%d.%u,%d.%u,%d.%u", pframe->Top.Whole, pframe->Top.Frac, pframe->Left.Whole, pframe->Left.Frac, pframe->Right.Whole, pframe->Right.Frac, pframe->Bottom.Whole, pframe->Bottom.Frac); } break; case TWTY_INT8: case TWTY_INT16: case TWTY_INT32: { string_or_constant_value = FALSE; TW_UINT32 currentValue = ((pTW_UINT32)(&pENUMERATION->ItemList))[pENUMERATION->CurrentIndex]; json_scanner_option = (Json::UInt)currentValue; } break; case TWTY_UINT8: case TWTY_UINT16: case TWTY_UINT32: { string_or_constant_value = FALSE; TW_UINT32 currentValue = ((pTW_UINT32)(&pENUMERATION->ItemList))[pENUMERATION->CurrentIndex]; json_scanner_option = (Json::UInt)currentValue; } break; case TWTY_BOOL: { string_or_constant_value = FALSE; TW_UINT32 currentValue = ((pTW_UINT32)(&pENUMERATION->ItemList))[pENUMERATION->CurrentIndex]; json_scanner_option = (BOOL)currentValue; } break; case TWTY_STR32: { pTW_STR32 pStr32 = &((pTW_STR32)(&pENUMERATION->ItemList))[pENUMERATION->CurrentIndex]; sprintf(str, "%s", pStr32); json_scanner_option = str; } break; case TWTY_STR64: { pTW_STR64 pStr64 = &((pTW_STR64)(&pENUMERATION->ItemList))[pENUMERATION->CurrentIndex]; sprintf(str, "%s", pStr64); json_scanner_option = str; } break; case TWTY_STR128: { pTW_STR128 pStr128 = &((pTW_STR128)(&pENUMERATION->ItemList))[pENUMERATION->CurrentIndex]; sprintf(str, "%s", pStr128); json_scanner_option = str; } break; case TWTY_STR255: { pTW_STR255 pStr255 = &((pTW_STR255)(&pENUMERATION->ItemList))[pENUMERATION->CurrentIndex]; sprintf(str, "%s", pStr255); json_scanner_option = str; } break; // case TWTY_STR1024: // case TWTY_UNI512: // break; default: break; } break; case TWON_ONEVALUE: switch (pONEVALUE->ItemType) { case TWTY_FIX32: { string_or_constant_value = FALSE; pTW_FIX32 pFix32 = (pTW_FIX32)&pONEVALUE->Item; json_scanner_option = float(pFix32->Whole) + float(pFix32->Frac / 65536.0); } break; case TWTY_FRAME: { pTW_FRAME pframe = (pTW_FRAME)&pONEVALUE->Item; sprintf(str, "%d.%u,%d.%u,%d.%u,%d.%u", pframe->Top.Whole, pframe->Top.Frac, pframe->Left.Whole, pframe->Left.Frac, pframe->Right.Whole, pframe->Right.Frac, pframe->Bottom.Whole, pframe->Bottom.Frac); } break; case TWTY_INT8: case TWTY_INT16: case TWTY_INT32: { string_or_constant_value = FALSE; TW_UINT32 currentValue = pONEVALUE->Item; json_scanner_option = (Json::UInt)currentValue; } break; case TWTY_UINT8: case TWTY_UINT16: case TWTY_UINT32: { string_or_constant_value = FALSE; TW_UINT32 currentValue = pONEVALUE->Item; json_scanner_option = (Json::UInt)currentValue; } break; case TWTY_BOOL: { string_or_constant_value = FALSE; TW_UINT32 currentValue = pONEVALUE->Item; json_scanner_option = (BOOL)currentValue; } break; case TWTY_STR32: { pTW_STR32 pStr32 = (pTW_STR32)&pONEVALUE->Item; sprintf(str, "%s", pStr32); json_scanner_option = str; } break; case TWTY_STR64: { pTW_STR64 pStr64 = (pTW_STR64)&pONEVALUE->Item; sprintf(str, "%s", pStr64); json_scanner_option = str; } break; case TWTY_STR128: { pTW_STR128 pStr128 = (pTW_STR128)&pONEVALUE->Item; sprintf(str, "%s", pStr128); json_scanner_option = str; } break; case TWTY_STR255: { pTW_STR255 pStr255 = (pTW_STR255)&pONEVALUE->Item; sprintf(str, "%s", pStr255); json_scanner_option = str; } break; // case TWTY_STR1024: // case TWTY_UNI512: // break; default: break; } break; case TWON_RANGE: string_or_constant_value = FALSE; TW_UINT32 currentValue = pRANGE->CurrentValue; json_scanner_option = (Json::UInt)currentValue; break; } } } void twain_get_capability_param(TW_CAPABILITY *tw_capability, void *p, Json::Value& json_scanner_option) { TW_UINT16 cap = tw_capability->Cap; TW_UINT16 conType = tw_capability->ConType; pTW_ENUMERATION pENUMERATION = (pTW_ENUMERATION)p; pTW_ONEVALUE pONEVALUE = (pTW_ONEVALUE)p; pTW_RANGE pRANGE = (pTW_RANGE)p; pTW_ARRAY pARRAY = (pTW_ARRAY)p; char str[CAP_VALUE_BUF_SIZE]; memset(str, 0, sizeof(str)); switch (conType) { case TWON_ARRAY: { Json::Value json_scanner_option_values(Json::arrayValue); for (int i = 0; i < pARRAY->NumItems; ++i) { switch (pARRAY->ItemType) { case TWTY_FIX32: { pTW_FIX32 pFix32 = &((pTW_FIX32)(&pARRAY->ItemList))[i]; json_scanner_option_values.append(float(pFix32->Whole) + float(pFix32->Frac / 65536.0)); } break; case TWTY_FRAME: { pTW_FRAME pframe = &((pTW_FRAME)(&pARRAY->ItemList))[i]; sprintf(str, "%d.%u,%d.%u,%d.%u,%d.%u", pframe->Top.Whole, pframe->Top.Frac, pframe->Left.Whole, pframe->Left.Frac, pframe->Right.Whole, pframe->Right.Frac, pframe->Bottom.Whole, pframe->Bottom.Frac); json_scanner_option_values.append(str); } break; case TWTY_INT8: { TW_INT8 currentValue = ((pTW_INT8)(&pARRAY->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_INT16: { TW_INT16 currentValue = ((pTW_INT16)(&pARRAY->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_INT32: { TW_INT32 currentValue = ((pTW_INT32)(&pARRAY->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_UINT8: { TW_UINT8 currentValue = ((pTW_UINT8)(&pARRAY->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_UINT16: { TW_UINT16 currentValue = ((pTW_UINT16)(&pARRAY->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_UINT32: { TW_UINT32 currentValue = ((pTW_UINT32)(&pARRAY->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_BOOL: { TW_UINT32 currentValue = ((pTW_UINT32)(&pARRAY->ItemList))[i]; if ((BOOL)currentValue) { json_scanner_option_values.append(true); } else { json_scanner_option_values.append(false); } } break; case TWTY_STR32: { pTW_STR32 pStr32 = &((pTW_STR32)(&pARRAY->ItemList))[i]; sprintf(str, "%s", pStr32); json_scanner_option_values.append(str); } break; case TWTY_STR64: { pTW_STR64 pStr64 = &((pTW_STR64)(&pARRAY->ItemList))[i]; sprintf(str, "%s", pStr64); json_scanner_option_values.append(str); } break; case TWTY_STR128: { pTW_STR128 pStr128 = &((pTW_STR128)(&pARRAY->ItemList))[i]; sprintf(str, "%s", pStr128); json_scanner_option_values.append(str); } break; case TWTY_STR255: { pTW_STR255 pStr255 = &((pTW_STR255)(&pARRAY->ItemList))[i]; sprintf(str, "%s", pStr255); json_scanner_option_values.append(str); } break; // case TWTY_STR1024: // case TWTY_UNI512: // break; default: break; } } json_scanner_option["values"] = json_scanner_option_values; } json_scanner_option["itemType"] = "TWON_ARRAY"; break; case TWON_ENUMERATION: { Json::Value json_scanner_option_values(Json::arrayValue); for (int i = 0; i < pENUMERATION->NumItems; ++i) { switch (pENUMERATION->ItemType) { case TWTY_FIX32: { pTW_FIX32 pFix32 = &((pTW_FIX32)(&pENUMERATION->ItemList))[i]; json_scanner_option_values.append(float(pFix32->Whole) + float(pFix32->Frac / 65536.0)); } break; case TWTY_FRAME: { pTW_FRAME pframe = &((pTW_FRAME)(&pENUMERATION->ItemList))[i]; sprintf(str, "%d.%u,%d.%u,%d.%u,%d.%u", pframe->Top.Whole, pframe->Top.Frac, pframe->Left.Whole, pframe->Left.Frac, pframe->Right.Whole, pframe->Right.Frac, pframe->Bottom.Whole, pframe->Bottom.Frac); json_scanner_option_values.append(str); } break; case TWTY_INT8: { TW_INT8 currentValue = ((pTW_INT8)(&pENUMERATION->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_INT16: { TW_INT16 currentValue = ((pTW_INT16)(&pENUMERATION->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_INT32: { TW_INT32 currentValue = ((pTW_INT32)(&pENUMERATION->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_UINT8: { TW_UINT8 currentValue = ((pTW_UINT8)(&pENUMERATION->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_UINT16: { TW_UINT16 currentValue = ((pTW_UINT16)(&pENUMERATION->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_UINT32: { TW_UINT32 currentValue = ((pTW_UINT32)(&pENUMERATION->ItemList))[i]; Json::Value value(Json::nullValue); twain_get_option_value_name(cap, currentValue, value); json_scanner_option_values.append(value); } break; case TWTY_BOOL: { TW_UINT32 currentValue = ((pTW_UINT32)(&pENUMERATION->ItemList))[i]; if ((BOOL)currentValue) { json_scanner_option_values.append(true); } else { json_scanner_option_values.append(false); } } break; /* important to count the null byte */ case TWTY_STR32: { pTW_STR32 pStr32 = &((pTW_STR32)(&pENUMERATION->ItemList))[i]; pStr32 += (i * 33); sprintf(str, "%s", pStr32); json_scanner_option_values.append(str); } break; case TWTY_STR64: { pTW_STR64 pStr64 = &((pTW_STR64)(&pENUMERATION->ItemList))[i]; pStr64 += (i * 65); sprintf(str, "%s", pStr64); json_scanner_option_values.append(str); } break; case TWTY_STR128: { pTW_STR128 pStr128 = &((pTW_STR128)(&pENUMERATION->ItemList))[i]; pStr128 += (i * 129); sprintf(str, "%s", pStr128); json_scanner_option_values.append(str); } break; case TWTY_STR255: { pTW_STR255 pStr255 = &((pTW_STR255)(&pENUMERATION->ItemList))[i]; pStr255 += (i * 256); sprintf(str, "%s", pStr255); json_scanner_option_values.append(str); } break; // case TWTY_STR1024: // case TWTY_UNI512: // break; default: break; } } json_scanner_option["values"] = json_scanner_option_values; } json_scanner_option["itemType"] = "TWON_ENUMERATION"; break; case TWON_ONEVALUE: json_scanner_option["itemType"] = "TWON_ONEVALUE"; break; case TWON_RANGE: json_scanner_option["itemType"] = "TWON_RANGE"; json_scanner_option["minValue"] = (Json::Int)pRANGE->MinValue; json_scanner_option["maxValue"] = (Json::Int)pRANGE->MaxValue; json_scanner_option["stepSize"] = (Json::Int)pRANGE->StepSize; json_scanner_option["defaultValue"] = (Json::Int)pRANGE->DefaultValue; break; } } void twain_get_option_value(TW_IDENTITY *tw_identity, TW_IDENTITY *tw_source_identity, TW_CAPABILITY *tw_capability, void *_entrypoint, Json::Value& json_scanner_options, Json::Value& json_scanner_option_values) { #if USE_TWAIN_DSM TW_ENTRYPOINT *tw_entrypoint = (TW_ENTRYPOINT *)_entrypoint; #else void *tw_entrypoint = 0; #endif std::string optionName; twain_get_capability_option_name(tw_capability->Cap, optionName); tw_capability->ConType = TWON_ONEVALUE; tw_capability->hContainer = 0; if(TWRC_SUCCESS == DSM_Entry( tw_identity, tw_source_identity, DG_CONTROL, DAT_CAPABILITY, MSG_GET, (TW_MEMREF)tw_capability)) { TW_MEMREF mem = DSM::Lock(tw_entrypoint, tw_capability->hContainer); twain_get_capability_value(tw_capability, mem, json_scanner_options[optionName]); twain_get_capability_param(tw_capability, mem, json_scanner_option_values[optionName]); DSM::Unlock(tw_entrypoint, tw_capability->hContainer); DSM::Free(tw_entrypoint, tw_capability->hContainer); } } TW_INT16 twain_get_condition(TW_IDENTITY *tw_identity) { TW_INT16 condition = 0; TW_STATUS status; memset(&status, 0, sizeof(TW_STATUS)); if(TWRC_SUCCESS == DSM_Entry( tw_identity, 0, DG_CONTROL, DAT_STATUS, MSG_GET, (TW_MEMREF)&status)) { condition = status.ConditionCode; } return condition; } TW_UINT16 twain_dsm_open(TW_IDENTITY *tw_identity, TW_USERINTERFACE *tw_userinterface, void *tw_entrypoint, HWND *tw_parent) { TW_UINT16 tw_ret = DSM_Entry( tw_identity, 0, DG_CONTROL, DAT_PARENT, MSG_OPENDSM, (TW_MEMREF)tw_parent); if(tw_ret == TWRC_SUCCESS) { #if USE_TWAIN_DSM tw_userinterface->hParent = (*tw_parent); if((tw_identity->SupportedGroups & DF_DSM2) == DF_DSM2) { DSM_Entry( tw_identity, 0, DG_CONTROL, DAT_ENTRYPOINT, MSG_GET, (TW_MEMREF)tw_entrypoint); }/* DF_DSM2 */ #endif }/* MSG_OPENDSM */ return tw_ret; } TW_UINT16 twain_dsm_close(TW_IDENTITY *tw_identity, HWND *tw_parent) { TW_UINT16 tw_ret = DSM_Entry( tw_identity, 0, DG_CONTROL, DAT_PARENT, MSG_CLOSEDSM, (TW_MEMREF)tw_parent); return tw_ret; } TW_UINT16 twain_source_open(TW_IDENTITY *tw_identity, TW_IDENTITY *tw_source_identity, C_TEXT& name) { TW_UINT16 ret = twain_get_source(tw_identity, name, tw_source_identity); if(TWRC_SUCCESS == ret) { ret = DSM_Entry( tw_identity, 0, DG_CONTROL, DAT_IDENTITY, MSG_OPENDS, (TW_MEMREF)tw_source_identity); } return ret; } TW_UINT16 twain_source_close(TW_IDENTITY *tw_identity, TW_IDENTITY *tw_source_identity) { TW_UINT16 ret = DSM_Entry( tw_identity, 0, DG_CONTROL, DAT_IDENTITY, MSG_CLOSEDS, (TW_MEMREF)tw_source_identity); return ret; } TW_UINT16 twain_source_enable(TW_IDENTITY *tw_identity, TW_IDENTITY *tw_source_identity, TW_USERINTERFACE *tw_userinterface) { TW_UINT16 ret = DSM_Entry( tw_identity, tw_source_identity, DG_CONTROL, DAT_USERINTERFACE, MSG_ENABLEDS, (TW_MEMREF)tw_userinterface); return ret; } TW_UINT16 twain_source_disable(TW_IDENTITY *tw_identity, TW_IDENTITY *tw_source_identity, TW_USERINTERFACE *tw_userinterface) { TW_UINT16 ret = DSM_Entry( tw_identity, tw_source_identity, DG_CONTROL, DAT_USERINTERFACE, MSG_DISABLEDS, (TW_MEMREF)tw_userinterface); return ret; } TW_INT16 twain_get_default_source(TW_IDENTITY *tw_identity, TW_IDENTITY *tw_source_identity) { memset(tw_source_identity, 0, sizeof(TW_IDENTITY)); TW_UINT16 ret = DSM_Entry( tw_identity, 0, DG_CONTROL, DAT_IDENTITY, MSG_GETDEFAULT, (TW_MEMREF)tw_source_identity); return ret; } void twain_configure(TW_IDENTITY *tw_identity, TW_USERINTERFACE *tw_userinterface, void *_entrypoint, HWND *tw_parent, TW_UINT16 majorNum, TW_UINT16 minorNum, TW_UINT16 language, TW_UINT16 country) { /* init */ memset(tw_identity, 0, sizeof(TW_IDENTITY)); memset(tw_userinterface, 0, sizeof(TW_USERINTERFACE)); tw_userinterface->ShowUI = false; tw_userinterface->ModalUI = false; #if USE_TWAIN_DSM TW_ENTRYPOINT *tw_entrypoint = (TW_ENTRYPOINT *)_entrypoint; memset(tw_entrypoint, 0, sizeof(TW_ENTRYPOINT)); tw_entrypoint->Size = sizeof(TW_ENTRYPOINT); #endif *tw_parent = NULL; tw_identity->Version.Language = language; tw_identity->Version.Country = country; char _majorNum[3]; sprintf(_majorNum, "%X", majorNum); char _minorNum[3]; sprintf(_minorNum, "%X", minorNum); tw_identity->Id = 0;//always 0 tw_identity->Version.MajorNum = atoi(_majorNum); tw_identity->Version.MinorNum = atoi(_minorNum); char _versionInfo[6]; sprintf(_versionInfo, "%X.%X", majorNum, minorNum); SSTRCPY(tw_identity->Version.Info, sizeof(tw_identity->Version.Info), _versionInfo); //protocol tw_identity->ProtocolMajor = TWON_PROTOCOLMAJOR; tw_identity->ProtocolMinor = TWON_PROTOCOLMINOR; /* note: TWAIN.framework on Mac is 1.9 TWAIN_32.DLL on Windows is 1.x and 32-bit only TWAINDSM.DLL on Windows is 2.3 and 32-bit or 64-bit TWAINDSM.DYLIB does not work on Mac (dlopen can't open .ds) */ #if USE_TWAIN_DSM tw_identity->SupportedGroups = DF_APP2 | DG_IMAGE | DG_CONTROL; #else tw_identity->SupportedGroups = DG_IMAGE | DG_CONTROL; #endif SSTRCPY(tw_identity->Manufacturer, sizeof(tw_identity->Manufacturer), PRODUCT_VENDOR_NAME); SSTRCPY(tw_identity->ProductFamily, sizeof(tw_identity->ProductFamily), PRODUCT_FAMILY_NAME); SSTRCPY(tw_identity->ProductName, sizeof(tw_identity->ProductName), PRODUCT_NAME); } TW_INT16 twain_get_source(TW_IDENTITY *tw_identity, C_TEXT& name, TW_IDENTITY *tw_source_identity) { TW_UINT16 ret = TWRC_FAILURE; CUTF8String _name; name.copyUTF8String(&_name); std::vector<TW_IDENTITY>sources; twain_get_sources_list(tw_identity, sources); for(std::vector<TW_IDENTITY>::iterator it = sources.begin(); it < sources.end(); it++) { TW_IDENTITY identity = *it; size_t len = strlen((char *)identity.ProductName); if(len == _name.length()) { if(0 == strncmp((char *)identity.ProductName, (char *)_name.c_str(), len)) { memcpy(tw_source_identity, &identity, sizeof(TW_IDENTITY)); ret = TWRC_SUCCESS; break; } } } if(ret != TWRC_SUCCESS) { ret = twain_get_default_source(tw_identity, tw_source_identity); } return ret; } void twain_get_sources_list(TW_IDENTITY *tw_identity, std::vector<TW_IDENTITY>& sources) { TW_INT16 condition = 0; TW_IDENTITY tw_source_identity; memset(&tw_source_identity, 0, sizeof(TW_IDENTITY)); TW_UINT16 ret = DSM_Entry( tw_identity, 0, DG_CONTROL, DAT_IDENTITY, MSG_GETFIRST, (TW_MEMREF)&tw_source_identity); switch (ret) { case TWRC_SUCCESS: sources.push_back(tw_source_identity); do { memset(&tw_source_identity, 0, sizeof(TW_IDENTITY)); ret = DSM_Entry( tw_identity, 0, DG_CONTROL, DAT_IDENTITY, MSG_GETNEXT, (TW_MEMREF)&tw_source_identity); switch (ret) { case TWRC_SUCCESS: sources.push_back(tw_source_identity); break; case TWRC_ENDOFLIST: //TWRC_ENDOFLIST break; case TWRC_FAILURE: condition = twain_get_condition(tw_identity); break; default: break; } } while (TWRC_SUCCESS == ret); break; case TWRC_ENDOFLIST: //TWRC_ENDOFLIST break; case TWRC_FAILURE: condition = twain_get_condition(tw_identity); break; default: break; } } TW_HANDLE DSM::Alloc(void *_entrypoint, TW_UINT32 size) { #if USE_TWAIN_DSM TW_ENTRYPOINT *tw_entrypoint = (TW_ENTRYPOINT *)_entrypoint; if(tw_entrypoint->DSM_MemAllocate) { return tw_entrypoint->DSM_MemAllocate(size); } return ::GlobalAlloc(GPTR, size); #endif return 0; } void DSM::Free(void *_entrypoint, TW_HANDLE h) { #if USE_TWAIN_DSM TW_ENTRYPOINT *tw_entrypoint = (TW_ENTRYPOINT *)_entrypoint; if(tw_entrypoint->DSM_MemFree) { return tw_entrypoint->DSM_MemFree(h); } ::GlobalFree(h); #endif return; } TW_MEMREF DSM::Lock(void *_entrypoint, TW_HANDLE h) { #if USE_TWAIN_DSM TW_ENTRYPOINT *tw_entrypoint = (TW_ENTRYPOINT *)_entrypoint; if(tw_entrypoint->DSM_MemLock) { return tw_entrypoint->DSM_MemLock(h); } return ::GlobalLock(h); #endif return 0; } void DSM::Unlock(void *_entrypoint, TW_HANDLE h) { #if USE_TWAIN_DSM TW_ENTRYPOINT *tw_entrypoint = (TW_ENTRYPOINT *)_entrypoint; if(tw_entrypoint->DSM_MemUnlock) { return tw_entrypoint->DSM_MemUnlock(h); } ::GlobalUnlock(h); #endif return; } TW_UINT16 twain_get_cap(JSONCPP_STRING& name) { TW_UINT16 cap = 0; if (name.compare("CAP_XFERCOUNT") == 0) { cap = CAP_XFERCOUNT; goto exit; } if (name.compare("ICAP_COMPRESSION") == 0) { cap = ICAP_COMPRESSION; goto exit; } if (name.compare("ICAP_PIXELTYPE") == 0) { cap = ICAP_PIXELTYPE; goto exit; } if (name.compare("ICAP_UNITS") == 0) { cap = ICAP_UNITS; goto exit; } if (name.compare("ICAP_XFERMECH") == 0) { cap = ICAP_XFERMECH; goto exit; } if (name.compare("CAP_AUTHOR") == 0) { cap = CAP_AUTHOR; goto exit; } if (name.compare("CAP_CAPTION") == 0) { cap = CAP_CAPTION; goto exit; } if (name.compare("CAP_FEEDERENABLED") == 0) { cap = CAP_FEEDERENABLED; goto exit; } if (name.compare("CAP_FEEDERLOADED") == 0) { cap = CAP_FEEDERLOADED; goto exit; } if (name.compare("CAP_TIMEDATE") == 0) { cap = CAP_TIMEDATE; goto exit; } if (name.compare("CAP_SUPPORTEDCAPS") == 0) { cap = CAP_SUPPORTEDCAPS; goto exit; } if (name.compare("CAP_EXTENDEDCAPS") == 0) { cap = CAP_EXTENDEDCAPS; goto exit; } if (name.compare("CAP_AUTOFEED") == 0) { cap = CAP_AUTOFEED; goto exit; } if (name.compare("CAP_CLEARPAGE") == 0) { cap = CAP_CLEARPAGE; goto exit; } if (name.compare("CAP_FEEDPAGE") == 0) { cap = CAP_FEEDPAGE; goto exit; } if (name.compare("CAP_REWINDPAGE") == 0) { cap = CAP_REWINDPAGE; goto exit; } if (name.compare("CAP_INDICATORS") == 0) { cap = CAP_INDICATORS; goto exit; } if (name.compare("CAP_SUPPORTEDCAPSEXT") == 0) { cap = CAP_SUPPORTEDCAPSEXT; goto exit; } if (name.compare("CAP_PAPERDETECTABLE") == 0) { cap = CAP_PAPERDETECTABLE; goto exit; } if (name.compare("CAP_UICONTROLLABLE") == 0) { cap = CAP_UICONTROLLABLE; goto exit; } if (name.compare("CAP_DEVICEONLINE") == 0) { cap = CAP_DEVICEONLINE; goto exit; } if (name.compare("CAP_AUTOSCAN") == 0) { cap = CAP_AUTOSCAN; goto exit; } if (name.compare("CAP_THUMBNAILSENABLED") == 0) { cap = CAP_THUMBNAILSENABLED; goto exit; } if (name.compare("CAP_DUPLEX") == 0) { cap = CAP_DUPLEX; goto exit; } if (name.compare("CAP_DUPLEXENABLED") == 0) { cap = CAP_DUPLEXENABLED; goto exit; } if (name.compare("CAP_ENABLEDSUIONLY") == 0) { cap = CAP_ENABLEDSUIONLY; goto exit; } if (name.compare("CAP_CUSTOMDSDATA") == 0) { cap = CAP_CUSTOMDSDATA; goto exit; } if (name.compare("CAP_ENDORSER") == 0) { cap = CAP_ENDORSER; goto exit; } if (name.compare("CAP_JOBCONTROL") == 0) { cap = CAP_JOBCONTROL; goto exit; } if (name.compare("CAP_ALARMS") == 0) { cap = CAP_ALARMS; goto exit; } if (name.compare("CAP_ALARMVOLUME") == 0) { cap = CAP_ALARMVOLUME; goto exit; } if (name.compare("CAP_AUTOMATICCAPTURE") == 0) { cap = CAP_AUTOMATICCAPTURE; goto exit; } if (name.compare("CAP_TIMEBEFOREFIRSTCAPTURE") == 0) { cap = CAP_TIMEBEFOREFIRSTCAPTURE; goto exit; } if (name.compare("CAP_TIMEBETWEENCAPTURES") == 0) { cap = CAP_TIMEBETWEENCAPTURES; goto exit; } if (name.compare("CAP_CLEARBUFFERS") == 0) { cap = CAP_CLEARBUFFERS; goto exit; } if (name.compare("CAP_MAXBATCHBUFFERS") == 0) { cap = CAP_MAXBATCHBUFFERS; goto exit; } if (name.compare("CAP_DEVICETIMEDATE") == 0) { cap = CAP_DEVICETIMEDATE; goto exit; } if (name.compare("CAP_POWERSUPPLY") == 0) { cap = CAP_POWERSUPPLY; goto exit; } if (name.compare("CAP_CAMERAPREVIEWUI") == 0) { cap = CAP_CAMERAPREVIEWUI; goto exit; } if (name.compare("CAP_DEVICEEVENT") == 0) { cap = CAP_DEVICEEVENT; goto exit; } if (name.compare("CAP_SERIALNUMBER") == 0) { cap = CAP_SERIALNUMBER; goto exit; } if (name.compare("CAP_PRINTER") == 0) { cap = CAP_PRINTER; goto exit; } if (name.compare("CAP_PRINTERENABLED") == 0) { cap = CAP_PRINTERENABLED; goto exit; } if (name.compare("CAP_PRINTERINDEX") == 0) { cap = CAP_PRINTERINDEX; goto exit; } if (name.compare("CAP_PRINTERMODE") == 0) { cap = CAP_PRINTERMODE; goto exit; } if (name.compare("CAP_PRINTERSTRING") == 0) { cap = CAP_PRINTERSTRING; goto exit; } if (name.compare("CAP_PRINTERSUFFIX") == 0) { cap = CAP_PRINTERSUFFIX; goto exit; } if (name.compare("CAP_LANGUAGE") == 0) { cap = CAP_LANGUAGE; goto exit; } if (name.compare("CAP_FEEDERALIGNMENT") == 0) { cap = CAP_FEEDERALIGNMENT; goto exit; } if (name.compare("CAP_FEEDERORDER") == 0) { cap = CAP_FEEDERORDER; goto exit; } if (name.compare("CAP_REACQUIREALLOWED") == 0) { cap = CAP_REACQUIREALLOWED; goto exit; } if (name.compare("CAP_BATTERYMINUTES") == 0) { cap = CAP_BATTERYMINUTES; goto exit; } if (name.compare("CAP_BATTERYPERCENTAGE") == 0) { cap = CAP_BATTERYPERCENTAGE; goto exit; } #if USE_TWAIN_DSM if (name.compare("CAP_CAMERASIDE") == 0) { cap = CAP_CAMERASIDE; goto exit; } if (name.compare("CAP_SEGMENTED") == 0) { cap = CAP_SEGMENTED; goto exit; } if (name.compare("CAP_CAMERAENABLED") == 0) { cap = CAP_CAMERAENABLED; goto exit; } if (name.compare("CAP_CAMERAORDER") == 0) { cap = CAP_CAMERAORDER; goto exit; } if (name.compare("CAP_MICRENABLED") == 0) { cap = CAP_MICRENABLED; goto exit; } if (name.compare("CAP_FEEDERPREP") == 0) { cap = CAP_FEEDERPREP; goto exit; } if (name.compare("CAP_FEEDERPOCKET") == 0) { cap = CAP_FEEDERPOCKET; goto exit; } if (name.compare("CAP_AUTOMATICSENSEMEDIUM") == 0) { cap = CAP_AUTOMATICSENSEMEDIUM; goto exit; } if (name.compare("CAP_CUSTOMINTERFACEGUID") == 0) { cap = CAP_CUSTOMINTERFACEGUID; goto exit; } if (name.compare("CAP_SUPPORTEDCAPSSEGMENTUNIQUE") == 0) { cap = CAP_SUPPORTEDCAPSSEGMENTUNIQUE; goto exit; } if (name.compare("CAP_SUPPORTEDDATS") == 0) { cap = CAP_SUPPORTEDDATS; goto exit; } if (name.compare("CAP_DOUBLEFEEDDETECTION") == 0) { cap = CAP_DOUBLEFEEDDETECTION; goto exit; } if (name.compare("CAP_DOUBLEFEEDDETECTIONLENGTH") == 0) { cap = CAP_DOUBLEFEEDDETECTIONLENGTH; goto exit; } if (name.compare("CAP_DOUBLEFEEDDETECTIONSENSITIVITY") == 0) { cap = CAP_DOUBLEFEEDDETECTIONSENSITIVITY; goto exit; } if (name.compare("CAP_DOUBLEFEEDDETECTIONRESPONSE") == 0) { cap = CAP_DOUBLEFEEDDETECTIONRESPONSE; goto exit; } if (name.compare("CAP_PAPERHANDLING") == 0) { cap = CAP_PAPERHANDLING; goto exit; } if (name.compare("CAP_INDICATORSMODE") == 0) { cap = CAP_INDICATORSMODE; goto exit; } if (name.compare("CAP_PRINTERVERTICALOFFSET") == 0) { cap = CAP_PRINTERVERTICALOFFSET; goto exit; } if (name.compare("CAP_POWERSAVETIME") == 0) { cap = CAP_POWERSAVETIME; goto exit; } if (name.compare("CAP_PRINTERCHARROTATION") == 0) { cap = CAP_PRINTERCHARROTATION; goto exit; } if (name.compare("CAP_PRINTERFONTSTYLE") == 0) { cap = CAP_PRINTERFONTSTYLE; goto exit; } if (name.compare("CAP_PRINTERINDEXLEADCHAR") == 0) { cap = CAP_PRINTERINDEXLEADCHAR; goto exit; } if (name.compare("CAP_PRINTERINDEXMAXVALUE") == 0) { cap = CAP_PRINTERINDEXMAXVALUE; goto exit; } if (name.compare("CAP_PRINTERINDEXNUMDIGITS") == 0) { cap = CAP_PRINTERINDEXNUMDIGITS; goto exit; } if (name.compare("CAP_PRINTERINDEXSTEP") == 0) { cap = CAP_PRINTERINDEXSTEP; goto exit; } if (name.compare("CAP_PRINTERINDEXTRIGGER") == 0) { cap = CAP_PRINTERINDEXTRIGGER; goto exit; } if (name.compare("CAP_PRINTERSTRINGPREVIEW") == 0) { cap = CAP_PRINTERSTRINGPREVIEW; goto exit; } if (name.compare("ICAP_AUTODISCARDBLANKPAGES") == 0) { cap = ICAP_AUTODISCARDBLANKPAGES; goto exit; } if (name.compare("ICAP_FEEDERTYPE") == 0) { cap = ICAP_FEEDERTYPE; goto exit; } if (name.compare("ICAP_ICCPROFILE") == 0) { cap = ICAP_ICCPROFILE; goto exit; } if (name.compare("ICAP_AUTOSIZE") == 0) { cap = ICAP_AUTOSIZE; goto exit; } if (name.compare("ICAP_AUTOMATICCROPUSESFRAME") == 0) { cap = ICAP_AUTOMATICCROPUSESFRAME; goto exit; } if (name.compare("ICAP_AUTOMATICLENGTHDETECTION") == 0) { cap = ICAP_AUTOMATICLENGTHDETECTION; goto exit; } if (name.compare("ICAP_AUTOMATICCOLORENABLED") == 0) { cap = ICAP_AUTOMATICCOLORENABLED; goto exit; } if (name.compare("ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE") == 0) { cap = ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE; goto exit; } if (name.compare("ICAP_COLORMANAGEMENTENABLED") == 0) { cap = ICAP_COLORMANAGEMENTENABLED; goto exit; } if (name.compare("ICAP_IMAGEMERGE") == 0) { cap = ICAP_IMAGEMERGE; goto exit; } if (name.compare("ICAP_IMAGEMERGEHEIGHTTHRESHOLD") == 0) { cap = ICAP_IMAGEMERGEHEIGHTTHRESHOLD; goto exit; } if (name.compare("ICAP_SUPPORTEDEXTIMAGEINFO") == 0) { cap = ICAP_SUPPORTEDEXTIMAGEINFO; goto exit; } if (name.compare("ICAP_FILMTYPE") == 0) { cap = ICAP_FILMTYPE; goto exit; } if (name.compare("ICAP_MIRROR") == 0) { cap = ICAP_MIRROR; goto exit; } if (name.compare("ICAP_JPEGSUBSAMPLING") == 0) { cap = ICAP_JPEGSUBSAMPLING; goto exit; } #endif if (name.compare("ICAP_AUTOBRIGHT") == 0) { cap = ICAP_AUTOBRIGHT; goto exit; } if (name.compare("ICAP_BRIGHTNESS") == 0) { cap = ICAP_BRIGHTNESS; goto exit; } if (name.compare("ICAP_CONTRAST") == 0) { cap = ICAP_CONTRAST; goto exit; } if (name.compare("ICAP_CUSTHALFTONE") == 0) { cap = ICAP_CUSTHALFTONE; goto exit; } if (name.compare("ICAP_EXPOSURETIME") == 0) { cap = ICAP_EXPOSURETIME; goto exit; } if (name.compare("ICAP_FILTER") == 0) { cap = ICAP_FILTER; goto exit; } if (name.compare("ICAP_FLASHUSED") == 0) { cap = ICAP_FLASHUSED; goto exit; } if (name.compare("ICAP_GAMMA") == 0) { cap = ICAP_GAMMA; goto exit; } if (name.compare("ICAP_HALFTONES") == 0) { cap = ICAP_HALFTONES; goto exit; } if (name.compare("ICAP_HIGHLIGHT") == 0) { cap = ICAP_HIGHLIGHT; goto exit; } if (name.compare("ICAP_IMAGEFILEFORMAT") == 0) { cap = ICAP_IMAGEFILEFORMAT; goto exit; } if (name.compare("ICAP_LAMPSTATE") == 0) { cap = ICAP_LAMPSTATE; goto exit; } if (name.compare("ICAP_LIGHTSOURCE") == 0) { cap = ICAP_LIGHTSOURCE; goto exit; } if (name.compare("ICAP_ORIENTATION") == 0) { cap = ICAP_ORIENTATION; goto exit; } if (name.compare("ICAP_PHYSICALWIDTH") == 0) { cap = ICAP_PHYSICALWIDTH; goto exit; } if (name.compare("ICAP_PHYSICALHEIGHT") == 0) { cap = ICAP_PHYSICALHEIGHT; goto exit; } if (name.compare("ICAP_SHADOW") == 0) { cap = ICAP_SHADOW; goto exit; } if (name.compare("ICAP_FRAMES") == 0) { cap = ICAP_FRAMES; goto exit; } if (name.compare("ICAP_XNATIVERESOLUTION") == 0) { cap = ICAP_XNATIVERESOLUTION; goto exit; } if (name.compare("ICAP_YNATIVERESOLUTION") == 0) { cap = ICAP_YNATIVERESOLUTION; goto exit; } if (name.compare("ICAP_XRESOLUTION") == 0) { cap = ICAP_XRESOLUTION; goto exit; } if (name.compare("ICAP_YRESOLUTION") == 0) { cap = ICAP_YRESOLUTION; goto exit; } if (name.compare("ICAP_MAXFRAMES") == 0) { cap = ICAP_MAXFRAMES; goto exit; } if (name.compare("ICAP_TILES") == 0) { cap = ICAP_TILES; goto exit; } if (name.compare("ICAP_BITORDER") == 0) { cap = ICAP_BITORDER; goto exit; } if (name.compare("ICAP_CCITTKFACTOR") == 0) { cap = ICAP_CCITTKFACTOR; goto exit; } if (name.compare("ICAP_LIGHTPATH") == 0) { cap = ICAP_LIGHTPATH; goto exit; } if (name.compare("ICAP_PIXELFLAVOR") == 0) { cap = ICAP_PIXELFLAVOR; goto exit; } if (name.compare("ICAP_PLANARCHUNKY") == 0) { cap = ICAP_PLANARCHUNKY; goto exit; } if (name.compare("ICAP_ROTATION") == 0) { cap = ICAP_ROTATION; goto exit; } if (name.compare("ICAP_SUPPORTEDSIZES") == 0) { cap = ICAP_SUPPORTEDSIZES; goto exit; } if (name.compare("ICAP_THRESHOLD") == 0) { cap = ICAP_THRESHOLD; goto exit; } if (name.compare("ICAP_XSCALING") == 0) { cap = ICAP_XSCALING; goto exit; } if (name.compare("ICAP_YSCALING") == 0) { cap = ICAP_YSCALING; goto exit; } if (name.compare("ICAP_BITORDERCODES") == 0) { cap = ICAP_BITORDERCODES; goto exit; } if (name.compare("ICAP_PIXELFLAVORCODES") == 0) { cap = ICAP_PIXELFLAVORCODES; goto exit; } if (name.compare("ICAP_JPEGPIXELTYPE") == 0) { cap = ICAP_JPEGPIXELTYPE; goto exit; } if (name.compare("ICAP_TIMEFILL") == 0) { cap = ICAP_TIMEFILL; goto exit; } if (name.compare("ICAP_BITDEPTH") == 0) { cap = ICAP_BITDEPTH; goto exit; } if (name.compare("ICAP_BITDEPTHREDUCTION") == 0) { cap = ICAP_BITDEPTHREDUCTION; goto exit; } if (name.compare("ICAP_UNDEFINEDIMAGESIZE") == 0) { cap = ICAP_UNDEFINEDIMAGESIZE; goto exit; } if (name.compare("ICAP_IMAGEDATASET") == 0) { cap = ICAP_IMAGEDATASET; goto exit; } if (name.compare("ICAP_EXTIMAGEINFO") == 0) { cap = ICAP_EXTIMAGEINFO; goto exit; } if (name.compare("ICAP_MINIMUMHEIGHT") == 0) { cap = ICAP_MINIMUMHEIGHT; goto exit; } if (name.compare("ICAP_MINIMUMWIDTH") == 0) { cap = ICAP_MINIMUMWIDTH; goto exit; } if (name.compare("ICAP_FLIPROTATION") == 0) { cap = ICAP_FLIPROTATION; goto exit; } if (name.compare("ICAP_BARCODEDETECTIONENABLED") == 0) { cap = ICAP_BARCODEDETECTIONENABLED; goto exit; } if (name.compare("ICAP_SUPPORTEDBARCODETYPES") == 0) { cap = ICAP_SUPPORTEDBARCODETYPES; goto exit; } if (name.compare("ICAP_BARCODEMAXSEARCHPRIORITIES") == 0) { cap = ICAP_BARCODEMAXSEARCHPRIORITIES; goto exit; } if (name.compare("ICAP_BARCODESEARCHPRIORITIES") == 0) { cap = ICAP_BARCODESEARCHPRIORITIES; goto exit; } if (name.compare("ICAP_BARCODESEARCHMODE") == 0) { cap = ICAP_BARCODESEARCHMODE; goto exit; } if (name.compare("ICAP_BARCODEMAXRETRIES") == 0) { cap = ICAP_BARCODEMAXRETRIES; goto exit; } if (name.compare("ICAP_BARCODETIMEOUT") == 0) { cap = ICAP_BARCODETIMEOUT; goto exit; } if (name.compare("ICAP_ZOOMFACTOR") == 0) { cap = ICAP_ZOOMFACTOR; goto exit; } if (name.compare("ICAP_PATCHCODEDETECTIONENABLED") == 0) { cap = ICAP_PATCHCODEDETECTIONENABLED; goto exit; } if (name.compare("ICAP_SUPPORTEDPATCHCODETYPES") == 0) { cap = ICAP_SUPPORTEDPATCHCODETYPES; goto exit; } if (name.compare("ICAP_PATCHCODEMAXSEARCHPRIORITIES") == 0) { cap = ICAP_PATCHCODEMAXSEARCHPRIORITIES; goto exit; } if (name.compare("ICAP_PATCHCODESEARCHPRIORITIES") == 0) { cap = ICAP_PATCHCODESEARCHPRIORITIES; goto exit; } if (name.compare("ICAP_PATCHCODESEARCHMODE") == 0) { cap = ICAP_PATCHCODESEARCHMODE; goto exit; } if (name.compare("ICAP_PATCHCODEMAXRETRIES") == 0) { cap = ICAP_PATCHCODEMAXRETRIES; goto exit; } if (name.compare("ICAP_PATCHCODETIMEOUT") == 0) { cap = ICAP_PATCHCODETIMEOUT; goto exit; } if (name.compare("ICAP_FLASHUSED2") == 0) { cap = ICAP_FLASHUSED2; goto exit; } if (name.compare("ICAP_IMAGEFILTER") == 0) { cap = ICAP_IMAGEFILTER; goto exit; } if (name.compare("ICAP_NOISEFILTER") == 0) { cap = ICAP_NOISEFILTER; goto exit; } if (name.compare("ICAP_OVERSCAN") == 0) { cap = ICAP_OVERSCAN; goto exit; } if (name.compare("ICAP_AUTOMATICBORDERDETECTION") == 0) { cap = ICAP_AUTOMATICBORDERDETECTION; goto exit; } if (name.compare("ICAP_AUTOMATICDESKEW") == 0) { cap = ICAP_AUTOMATICDESKEW; goto exit; } if (name.compare("ICAP_AUTOMATICROTATE") == 0) { cap = ICAP_AUTOMATICROTATE; goto exit; } if (name.compare("ICAP_JPEGQUALITY") == 0) { cap = ICAP_JPEGQUALITY; goto exit; } exit: return cap; } int getSizeForItemType(TW_UINT16 itemType) { switch (itemType) { case TWTY_INT8: return sizeof(TW_INT8); break; case TWTY_INT16: return sizeof(TW_INT16); break; case TWTY_INT32: return sizeof(TW_INT32); break; case TWTY_UINT8: return sizeof(TW_UINT8); break; case TWTY_UINT16: return sizeof(TW_UINT16); break; case TWTY_UINT32: return sizeof(TW_UINT32); break; case TWTY_BOOL: return sizeof(TW_BOOL); break; case TWTY_FIX32: return sizeof(TW_FIX32); break; case TWTY_FRAME: return sizeof(TW_FRAME); break; case TWTY_STR32: return sizeof(TW_STR32); break; case TWTY_STR64: return sizeof(TW_STR64); break; case TWTY_STR128: return sizeof(TW_STR128); break; case TWTY_STR255: return sizeof(TW_STR255); break; #if USE_TWAIN_DSM case TWTY_STR1024: return sizeof(TW_STR1024); break; case TWTY_UNI512: return sizeof(TW_UNI512); break; case TWTY_HANDLE: return sizeof(TW_HANDLE); break; #endif default: break; } return 0; } int json_get_cap_constant(Json::Value& value, TW_UINT16 cap) { JSONCPP_STRING strValue; if (value.isString()) { strValue = value.asString(); } int v = 0; if (value.isInt()) { v = value.asInt(); } switch (cap) { //convert to constant #if USE_TWAIN_DSM case ICAP_AUTOSIZE: { if (strValue.compare("TWAS_NONE") == 0) { v = TWAS_NONE; goto exit2; } if (strValue.compare("TWAS_AUTO") == 0) { v = TWAS_AUTO; goto exit2; } if (strValue.compare("TWAS_CURRENT") == 0) { v = TWAS_CURRENT; goto exit2; } } break; case ICAP_AUTODISCARDBLANKPAGES: { if (strValue.compare("TWBP_DISABLE") == 0) { v = TWBP_DISABLE; goto exit2; } if (strValue.compare("TWBP_AUTO") == 0) { v = TWBP_AUTO; goto exit2; } } break; case CAP_CAMERASIDE: { if (strValue.compare("TWCS_BOTH") == 0) { v = TWCS_BOTH; goto exit2; } if (strValue.compare("TWCS_TOP") == 0) { v = TWCS_TOP; goto exit2; } if (strValue.compare("TWCS_BOTTOM") == 0) { v = TWCS_BOTTOM; goto exit2; } } break; case ICAP_FEEDERTYPE: { if (strValue.compare("TWFE_GENERAL") == 0) { v = TWFE_GENERAL; goto exit2; } if (strValue.compare("TWFE_PHOTO") == 0) { v = TWFE_PHOTO; goto exit2; } } break; case CAP_FEEDERPOCKET: { if (strValue.compare("TWFP_POCKETERROR") == 0) { v = TWFP_POCKETERROR; goto exit2; } if (strValue.compare("TWFP_POCKET1") == 0) { v = TWFP_POCKET1; goto exit2; } if (strValue.compare("TWFP_POCKET2") == 0) { v = TWFP_POCKET2; goto exit2; } if (strValue.compare("TWFP_POCKET3") == 0) { v = TWFP_POCKET3; goto exit2; } if (strValue.compare("TWFP_POCKET4") == 0) { v = TWFP_POCKET4; goto exit2; } if (strValue.compare("TWFP_POCKET5") == 0) { v = TWFP_POCKET5; goto exit2; } if (strValue.compare("TWFP_POCKET6") == 0) { v = TWFP_POCKET6; goto exit2; } if (strValue.compare("TWFP_POCKET7") == 0) { v = TWFP_POCKET7; goto exit2; } if (strValue.compare("TWFP_POCKET8") == 0) { v = TWFP_POCKET8; goto exit2; } if (strValue.compare("TWFP_POCKET9") == 0) { v = TWFP_POCKET9; goto exit2; } if (strValue.compare("TWFP_POCKET10") == 0) { v = TWFP_POCKET10; goto exit2; } if (strValue.compare("TWFP_POCKET11") == 0) { v = TWFP_POCKET11; goto exit2; } if (strValue.compare("TWFP_POCKET12") == 0) { v = TWFP_POCKET12; goto exit2; } if (strValue.compare("TWFP_POCKET13") == 0) { v = TWFP_POCKET13; goto exit2; } if (strValue.compare("TWFP_POCKET14") == 0) { v = TWFP_POCKET14; goto exit2; } if (strValue.compare("TWFP_POCKET15") == 0) { v = TWFP_POCKET15; goto exit2; } if (strValue.compare("TWFP_POCKET16") == 0) { v = TWFP_POCKET16; goto exit2; } } break; case ICAP_ICCPROFILE: { if (strValue.compare("TWIC_NONE") == 0) { v = TWIC_NONE; goto exit2; } if (strValue.compare("TWIC_LINK") == 0) { v = TWIC_LINK; goto exit2; } if (strValue.compare("TWIC_EMBED") == 0) { v = TWIC_EMBED; goto exit2; } } break; case ICAP_IMAGEMERGE: { if (strValue.compare("TWIM_NONE") == 0) { v = TWIM_NONE; goto exit2; } if (strValue.compare("TWIM_FRONTONTOP") == 0) { v = TWIM_FRONTONTOP; goto exit2; } if (strValue.compare("TWIM_FRONTONBOTTOM") == 0) { v = TWIM_FRONTONBOTTOM; goto exit2; } if (strValue.compare("TWIM_FRONTONLEFT") == 0) { v = TWIM_FRONTONLEFT; goto exit2; } if (strValue.compare("TWIM_FRONTONRIGHT") == 0) { v = TWIM_FRONTONRIGHT; goto exit2; } } break; case CAP_SEGMENTED: { if (strValue.compare("TWSG_NONE") == 0) { v = TWSG_NONE; goto exit2; } if (strValue.compare("TWSG_AUTO") == 0) { v = TWSG_AUTO; goto exit2; } if (strValue.compare("TWSG_MANUAL") == 0) { v = TWSG_MANUAL; goto exit2; } } break; #endif case CAP_ALARMS: { if (strValue.compare("TWAL_ALARM") == 0) { v = TWAL_ALARM; goto exit2; } if (strValue.compare("TWAL_FEEDERERROR") == 0) { v = TWAL_FEEDERERROR; goto exit2; } if (strValue.compare("TWAL_FEEDERWARNING") == 0) { v = TWAL_FEEDERWARNING; goto exit2; } if (strValue.compare("TWAL_BARCODE") == 0) { v = TWAL_BARCODE; goto exit2; } if (strValue.compare("TWAL_DOUBLEFEED") == 0) { v = TWAL_DOUBLEFEED; goto exit2; } if (strValue.compare("TWAL_JAM") == 0) { v = TWAL_JAM; goto exit2; } if (strValue.compare("TWAL_PATCHCODE") == 0) { v = TWAL_PATCHCODE; goto exit2; } if (strValue.compare("TWAL_POWER") == 0) { v = TWAL_POWER; goto exit2; } if (strValue.compare("TWAL_SKEW") == 0) { v = TWAL_SKEW; goto exit2; } } break; case ICAP_COMPRESSION: { if (strValue.compare("TWCP_NONE") == 0) { v = TWCP_NONE; goto exit2; } if (strValue.compare("TWCP_PACKBITS") == 0) { v = TWCP_PACKBITS; goto exit2; } if (strValue.compare("TWCP_GROUP31D") == 0) { v = TWCP_GROUP31D; goto exit2; } if (strValue.compare("TWCP_GROUP31DEOL") == 0) { v = TWCP_GROUP31DEOL; goto exit2; } if (strValue.compare("TWCP_GROUP32D") == 0) { v = TWCP_GROUP32D; goto exit2; } if (strValue.compare("TWCP_GROUP4") == 0) { v = TWCP_GROUP4; goto exit2; } if (strValue.compare("TWCP_JPEG") == 0) { v = TWCP_JPEG; goto exit2; } if (strValue.compare("TWCP_LZW") == 0) { v = TWCP_LZW; goto exit2; } if (strValue.compare("TWCP_JBIG") == 0) { v = TWCP_JBIG; goto exit2; } if (strValue.compare("TWCP_PNG") == 0) { v = TWCP_PNG; goto exit2; } if (strValue.compare("TWCP_RLE4") == 0) { v = TWCP_RLE4; goto exit2; } if (strValue.compare("TWCP_RLE8") == 0) { v = TWCP_RLE8; goto exit2; } if (strValue.compare("TWCP_BITFIELDS") == 0) { v = TWCP_BITFIELDS; goto exit2; } } break; case ICAP_BARCODESEARCHMODE: { if (strValue.compare("TWBD_HORZ") == 0) { v = TWBD_HORZ; goto exit2; } if (strValue.compare("TWBD_VERT") == 0) { v = TWBD_VERT; goto exit2; } if (strValue.compare("TWBD_HORZVERT") == 0) { v = TWBD_HORZVERT; goto exit2; } if (strValue.compare("TWBD_VERTHORZ") == 0) { v = TWBD_VERTHORZ; goto exit2; } } break; case ICAP_BITORDER: { if (strValue.compare("TWBO_LSBFIRST") == 0) { v = TWBO_LSBFIRST; goto exit2; } if (strValue.compare("TWBO_MSBFIRST") == 0) { v = TWBO_MSBFIRST; goto exit2; } } break; case ICAP_BITDEPTHREDUCTION: { if (strValue.compare("TWBR_THRESHOLD") == 0) { v = TWBR_THRESHOLD; goto exit2; } if (strValue.compare("TWBR_HALFTONE") == 0) { v = TWBR_HALFTONE; goto exit2; } if (strValue.compare("TWBR_CUSTHALFTONE") == 0) { v = TWBR_CUSTHALFTONE; goto exit2; } if (strValue.compare("TWBR_DIFFUSION") == 0) { v = TWBR_DIFFUSION; goto exit2; } } break; case ICAP_SUPPORTEDBARCODETYPES: case TWEI_BARCODETYPE: { if (strValue.compare("TWBT_3OF9") == 0) { v = TWBT_3OF9; goto exit2; } if (strValue.compare("TWBT_2OF5INTERLEAVED") == 0) { v = TWBT_2OF5INTERLEAVED; goto exit2; } if (strValue.compare("TWBT_2OF5NONINTERLEAVED") == 0) { v = TWBT_2OF5NONINTERLEAVED; goto exit2; } if (strValue.compare("TWBT_CODE93") == 0) { v = TWBT_CODE93; goto exit2; } if (strValue.compare("TWBT_CODE128") == 0) { v = TWBT_CODE128; goto exit2; } if (strValue.compare("TWBT_UCC128") == 0) { v = TWBT_UCC128; goto exit2; } if (strValue.compare("TWBT_CODABAR") == 0) { v = TWBT_CODABAR; goto exit2; } if (strValue.compare("TWBT_UPCA") == 0) { v = TWBT_UPCA; goto exit2; } if (strValue.compare("TWBT_UPCE") == 0) { v = TWBT_UPCE; goto exit2; } if (strValue.compare("TWBT_EAN8") == 0) { v = TWBT_EAN8; goto exit2; } if (strValue.compare("TWBT_EAN13") == 0) { v = TWBT_EAN13; goto exit2; } if (strValue.compare("TWBT_POSTNET") == 0) { v = TWBT_POSTNET; goto exit2; } if (strValue.compare("TWBT_PDF417") == 0) { v = TWBT_PDF417; goto exit2; } if (strValue.compare("TWBT_2OF5INDUSTRIAL") == 0) { v = TWBT_2OF5INDUSTRIAL; goto exit2; } if (strValue.compare("TWBT_2OF5MATRIX") == 0) { v = TWBT_2OF5MATRIX; goto exit2; } if (strValue.compare("TWBT_2OF5DATALOGIC") == 0) { v = TWBT_2OF5DATALOGIC; goto exit2; } if (strValue.compare("TWBT_2OF5IATA") == 0) { v = TWBT_2OF5IATA; goto exit2; } if (strValue.compare("TWBT_3OF9FULLASCII") == 0) { v = TWBT_3OF9FULLASCII; goto exit2; } if (strValue.compare("TWBT_CODABARWITHSTARTSTOP") == 0) { v = TWBT_CODABARWITHSTARTSTOP; goto exit2; } if (strValue.compare("TWBT_MAXICODE") == 0) { v = TWBT_MAXICODE; goto exit2; } } break; case CAP_CLEARBUFFERS: { if (strValue.compare("TWCB_AUTO") == 0) { v = TWCB_AUTO; goto exit2; } if (strValue.compare("TWCB_CLEAR") == 0) { v = TWCB_CLEAR; goto exit2; } if (strValue.compare("TWCB_NOCLEAR") == 0) { v = TWCB_NOCLEAR; goto exit2; } } break; case CAP_DEVICEEVENT: { if (strValue.compare("TWDE_CUSTOMEVENTS") == 0) { v = TWDE_CUSTOMEVENTS; goto exit2; } if (strValue.compare("TWDE_CHECKAUTOMATICCAPTURE") == 0) { v = TWDE_CHECKAUTOMATICCAPTURE; goto exit2; } if (strValue.compare("TWDE_CHECKBATTERY") == 0) { v = TWDE_CHECKBATTERY; goto exit2; } if (strValue.compare("TWDE_CHECKDEVICEONLINE") == 0) { v = TWDE_CHECKDEVICEONLINE; goto exit2; } if (strValue.compare("TWDE_CHECKFLASH") == 0) { v = TWDE_CHECKFLASH; goto exit2; } if (strValue.compare("TWDE_CHECKPOWERSUPPLY") == 0) { v = TWDE_CHECKPOWERSUPPLY; goto exit2; } if (strValue.compare("TWDE_CHECKRESOLUTION") == 0) { v = TWDE_CHECKRESOLUTION; goto exit2; } if (strValue.compare("TWDE_DEVICEADDED") == 0) { v = TWDE_DEVICEADDED; goto exit2; } if (strValue.compare("TWDE_DEVICEOFFLINE") == 0) { v = TWDE_DEVICEOFFLINE; goto exit2; } if (strValue.compare("TWDE_DEVICEREADY") == 0) { v = TWDE_DEVICEREADY; goto exit2; } if (strValue.compare("TWDE_DEVICEREMOVED") == 0) { v = TWDE_DEVICEREMOVED; goto exit2; } if (strValue.compare("TWDE_IMAGECAPTURED") == 0) { v = TWDE_IMAGECAPTURED; goto exit2; } if (strValue.compare("TWDE_IMAGEDELETED") == 0) { v = TWDE_IMAGEDELETED; goto exit2; } if (strValue.compare("TWDE_PAPERDOUBLEFEED") == 0) { v = TWDE_PAPERDOUBLEFEED; goto exit2; } if (strValue.compare("TWDE_PAPERJAM") == 0) { v = TWDE_PAPERJAM; goto exit2; } if (strValue.compare("TWDE_LAMPFAILURE") == 0) { v = TWDE_LAMPFAILURE; goto exit2; } if (strValue.compare("TWDE_POWERSAVE") == 0) { v = TWDE_POWERSAVE; goto exit2; } if (strValue.compare("TWDE_POWERSAVENOTIFY") == 0) { v = TWDE_POWERSAVENOTIFY; goto exit2; } } break; case CAP_DUPLEX: { if (strValue.compare("TWDX_NONE") == 0) { v = TWDX_NONE; goto exit2; } if (strValue.compare("TWDX_1PASSDUPLEX") == 0) { v = TWDX_1PASSDUPLEX; goto exit2; } if (strValue.compare("TWDX_2PASSDUPLEX") == 0) { v = TWDX_2PASSDUPLEX; goto exit2; } } break; case CAP_FEEDERALIGNMENT: { if (strValue.compare("TWFA_NONE") == 0) { v = TWFA_NONE; goto exit2; } if (strValue.compare("TWFA_LEFT") == 0) { v = TWFA_LEFT; goto exit2; } if (strValue.compare("TWFA_CENTER") == 0) { v = TWFA_CENTER; goto exit2; } if (strValue.compare("TWFA_RIGHT") == 0) { v = TWFA_RIGHT; goto exit2; } } break; case ICAP_IMAGEFILEFORMAT: { if (strValue.compare("TWFF_TIFF") == 0) { v = TWFF_TIFF; goto exit2; } if (strValue.compare("TWFF_PICT") == 0) { v = TWFF_PICT; goto exit2; } if (strValue.compare("TWFF_BMP") == 0) { v = TWFF_BMP; goto exit2; } if (strValue.compare("TWFF_XBM") == 0) { v = TWFF_XBM; goto exit2; } if (strValue.compare("TWFF_JFIF") == 0) { v = TWFF_JFIF; goto exit2; } if (strValue.compare("TWFF_FPX") == 0) { v = TWFF_FPX; goto exit2; } if (strValue.compare("TWFF_TIFFMULTI") == 0) { v = TWFF_TIFFMULTI; goto exit2; } if (strValue.compare("TWFF_PNG") == 0) { v = TWFF_PNG; goto exit2; } if (strValue.compare("TWFF_SPIFF") == 0) { v = TWFF_SPIFF; goto exit2; } if (strValue.compare("TWFF_EXIF") == 0) { v = TWFF_EXIF; goto exit2; } if (strValue.compare("TWFF_PDF") == 0) { v = 10; goto exit2; } if (strValue.compare("TWFF_JP2") == 0) { v = 11; goto exit2; } if (strValue.compare("TWFF_JPN") == 0) { v = 12; goto exit2; } if (strValue.compare("TWFF_JPX") == 0) { v = 13; goto exit2; } if (strValue.compare("TWFF_DEJAVU") == 0) { v = 14; goto exit2; } if (strValue.compare("TWFF_PDFA") == 0) { v = 15; goto exit2; } if (strValue.compare("TWFF_PDFA2") == 0) { v = 16; goto exit2; } } break; case ICAP_FLASHUSED2: { if (strValue.compare("TWFL_NONE") == 0) { v = TWFL_NONE; goto exit2; } if (strValue.compare("TWFL_OFF") == 0) { v = TWFL_OFF; goto exit2; } if (strValue.compare("TWFL_ON") == 0) { v = TWFL_ON; goto exit2; } if (strValue.compare("TWFL_AUTO") == 0) { v = TWFL_AUTO; goto exit2; } if (strValue.compare("TWFL_REDEYE") == 0) { v = TWFL_REDEYE; goto exit2; } } break; case CAP_FEEDERORDER: { if (strValue.compare("TWFO_FIRSTPAGEFIRST") == 0) { v = TWFO_FIRSTPAGEFIRST; goto exit2; } if (strValue.compare("TWFO_LASTPAGEFIRST") == 0) { v = TWFO_LASTPAGEFIRST; goto exit2; } } break; case ICAP_FLIPROTATION: { if (strValue.compare("TWFR_BOOK") == 0) { v = TWFR_BOOK; goto exit2; } if (strValue.compare("TWFR_FANFOLD") == 0) { v = TWFR_FANFOLD; goto exit2; } } break; case ICAP_FILTER: { if (strValue.compare("TWFT_RED") == 0) { v = TWFT_RED; goto exit2; } if (strValue.compare("TWFT_GREEN") == 0) { v = TWFT_GREEN; goto exit2; } if (strValue.compare("TWFT_BLUE") == 0) { v = TWFT_BLUE; goto exit2; } if (strValue.compare("TWFT_NONE") == 0) { v = TWFT_NONE; goto exit2; } if (strValue.compare("TWFT_WHITE") == 0) { v = TWFT_WHITE; goto exit2; } if (strValue.compare("TWFT_CYAN") == 0) { v = TWFT_CYAN; goto exit2; } if (strValue.compare("TWFT_MAGENTA") == 0) { v = TWFT_MAGENTA; goto exit2; } if (strValue.compare("TWFT_YELLOW") == 0) { v = TWFT_YELLOW; goto exit2; } if (strValue.compare("TWFT_BLACK") == 0) { v = TWFT_BLACK; goto exit2; } } break; case ICAP_IMAGEFILTER: { if (strValue.compare("TWIF_NONE") == 0) { v = TWIF_NONE; goto exit2; } if (strValue.compare("TWIF_AUTO") == 0) { v = TWIF_AUTO; goto exit2; } if (strValue.compare("TWIF_LOWPASS") == 0) { v = TWIF_LOWPASS; goto exit2; } if (strValue.compare("TWIF_BANDPASS") == 0) { v = TWIF_BANDPASS; goto exit2; } if (strValue.compare("TWIF_HIGHPASS") == 0) { v = TWIF_HIGHPASS; goto exit2; } if (strValue.compare("TWIF_TEXT") == 0) { v = TWIF_TEXT; goto exit2; } if (strValue.compare("TWIF_FINELINE") == 0) { v = TWIF_FINELINE; goto exit2; } } break; case CAP_JOBCONTROL: { if (strValue.compare("TWJC_NONE") == 0) { v = TWJC_NONE; goto exit2; } if (strValue.compare("TWJC_JSIC") == 0) { v = TWJC_JSIC; goto exit2; } if (strValue.compare("TWJC_JSIS") == 0) { v = TWJC_JSIS; goto exit2; } if (strValue.compare("TWJC_JSXC") == 0) { v = TWJC_JSXC; goto exit2; } if (strValue.compare("TWJC_JSXS") == 0) { v = TWJC_JSXS; goto exit2; } } break; case ICAP_JPEGQUALITY: { if (strValue.compare("TWJQ_UNKNOWN") == 0) { v = TWJQ_UNKNOWN; goto exit2; } if (strValue.compare("TWJQ_LOW") == 0) { v = TWJQ_LOW; goto exit2; } if (strValue.compare("TWJQ_MEDIUM") == 0) { v = TWJQ_MEDIUM; goto exit2; } if (strValue.compare("TWJQ_HIGH") == 0) { v = TWJQ_HIGH; goto exit2; } } break; case ICAP_LIGHTPATH: { if (strValue.compare("TWLP_REFLECTIVE") == 0) { v = TWLP_REFLECTIVE; goto exit2; } if (strValue.compare("TWLP_TRANSMISSIVE") == 0) { v = TWLP_TRANSMISSIVE; goto exit2; } } break; case ICAP_LIGHTSOURCE: { if (strValue.compare("TWLS_RED") == 0) { v = TWLS_RED; goto exit2; } if (strValue.compare("TWLS_GREEN") == 0) { v = TWLS_GREEN; goto exit2; } if (strValue.compare("TWLS_BLUE") == 0) { v = TWLS_BLUE; goto exit2; } if (strValue.compare("TWLS_NONE") == 0) { v = TWLS_NONE; goto exit2; } if (strValue.compare("TWLS_WHITE") == 0) { v = TWLS_WHITE; goto exit2; } if (strValue.compare("TWLS_UV") == 0) { v = TWLS_UV; goto exit2; } if (strValue.compare("TWLS_IR") == 0) { v = TWLS_IR; goto exit2; } } break; case ICAP_NOISEFILTER: { if (strValue.compare("TWNF_NONE") == 0) { v = TWNF_NONE; goto exit2; } if (strValue.compare("TWNF_AUTO") == 0) { v = TWNF_AUTO; goto exit2; } if (strValue.compare("TWNF_LONEPIXEL") == 0) { v = TWNF_LONEPIXEL; goto exit2; } if (strValue.compare("TWNF_MAJORITYRULE") == 0) { v = TWNF_MAJORITYRULE; goto exit2; } } break; case ICAP_ORIENTATION: { if (strValue.compare("TWOR_ROT0") == 0) { v = TWOR_ROT0; goto exit2; } if (strValue.compare("TWOR_ROT90") == 0) { v = TWOR_ROT90; goto exit2; } if (strValue.compare("TWOR_ROT180") == 0) { v = TWOR_ROT180; goto exit2; } if (strValue.compare("TWOR_ROT270") == 0) { v = TWOR_ROT270; goto exit2; } if (strValue.compare("TWOR_PORTRAIT") == 0) { v = TWOR_PORTRAIT; goto exit2; } if (strValue.compare("TWOR_LANDSCAPE") == 0) { v = TWOR_LANDSCAPE; goto exit2; } } break; case ICAP_OVERSCAN: { if (strValue.compare("TWOV_NONE") == 0) { v = TWOV_NONE; goto exit2; } if (strValue.compare("TWOV_AUTO") == 0) { v = TWOV_AUTO; goto exit2; } if (strValue.compare("TWOV_TOPBOTTOM") == 0) { v = TWOV_TOPBOTTOM; goto exit2; } if (strValue.compare("TWOV_LEFTRIGHT") == 0) { v = TWOV_LEFTRIGHT; goto exit2; } if (strValue.compare("TWOV_ALL") == 0) { v = TWOV_ALL; goto exit2; } } break; case ICAP_PLANARCHUNKY: { if (strValue.compare("TWPC_CHUNKY") == 0) { v = TWPC_CHUNKY; goto exit2; } if (strValue.compare("TWPC_PLANAR") == 0) { v = TWPC_PLANAR; goto exit2; } } break; case ICAP_PIXELFLAVOR: { if (strValue.compare("TWPF_CHOCOLATE") == 0) { v = TWPF_CHOCOLATE; goto exit2; } if (strValue.compare("TWPF_VANILLA") == 0) { v = TWPF_VANILLA; goto exit2; } } break; case CAP_PRINTERMODE: { if (strValue.compare("TWPM_SINGLESTRING") == 0) { v = TWPM_SINGLESTRING; goto exit2; } if (strValue.compare("TWPM_MULTISTRING") == 0) { v = TWPM_MULTISTRING; goto exit2; } if (strValue.compare("TWPM_COMPOUNDSTRING") == 0) { v = TWPM_COMPOUNDSTRING; goto exit2; } } break; case CAP_PRINTER: { if (strValue.compare("TWPR_IMPRINTERTOPBEFORE") == 0) { v = TWPR_IMPRINTERTOPBEFORE; goto exit2; } if (strValue.compare("TWPR_IMPRINTERTOPAFTER") == 0) { v = TWPR_IMPRINTERTOPAFTER; goto exit2; } if (strValue.compare("TWPR_IMPRINTERBOTTOMBEFORE") == 0) { v = TWPR_IMPRINTERBOTTOMBEFORE; goto exit2; } if (strValue.compare("TWPR_IMPRINTERBOTTOMAFTER") == 0) { v = TWPR_IMPRINTERBOTTOMAFTER; goto exit2; } if (strValue.compare("TWPR_ENDORSERTOPBEFORE") == 0) { v = TWPR_ENDORSERTOPBEFORE; goto exit2; } if (strValue.compare("TWPR_ENDORSERTOPAFTER") == 0) { v = TWPR_ENDORSERTOPAFTER; goto exit2; } if (strValue.compare("TWPR_ENDORSERBOTTOMBEFORE") == 0) { v = TWPR_ENDORSERBOTTOMBEFORE; goto exit2; } if (strValue.compare("TWPR_ENDORSERBOTTOMAFTER") == 0) { v = TWPR_ENDORSERBOTTOMAFTER; goto exit2; } } break; case CAP_POWERSUPPLY: { if (strValue.compare("TWPS_EXTERNAL") == 0) { v = TWPS_EXTERNAL; goto exit2; } if (strValue.compare("TWPS_BATTERY") == 0) { v = TWPS_BATTERY; goto exit2; } } break; case ICAP_PIXELTYPE: { if (strValue.compare("TWPT_BW") == 0) { v = TWPT_BW; goto exit2; } if (strValue.compare("TWPT_GRAY") == 0) { v = TWPT_GRAY; goto exit2; } if (strValue.compare("TWPT_RGB") == 0) { v = TWPT_RGB; goto exit2; } if (strValue.compare("TWPT_PALETTE") == 0) { v = TWPT_PALETTE; goto exit2; } if (strValue.compare("TWPT_CMY") == 0) { v = TWPT_CMY; goto exit2; } if (strValue.compare("TWPT_CMYK") == 0) { v = TWPT_CMYK; goto exit2; } if (strValue.compare("TWPT_YUV") == 0) { v = TWPT_YUV; goto exit2; } if (strValue.compare("TWPT_YUVK") == 0) { v = TWPT_YUVK; goto exit2; } if (strValue.compare("TWPT_CIEXYZ") == 0) { v = TWPT_CIEXYZ; goto exit2; } } break; case ICAP_SUPPORTEDSIZES: { if (strValue.compare("TWSS_NONE") == 0) { v = TWSS_NONE; goto exit2; } if (strValue.compare("TWSS_A4") == 0) { v = TWSS_A4; goto exit2; } if (strValue.compare("TWSS_JISB5") == 0) { v = TWSS_JISB5; goto exit2; } if (strValue.compare("TWSS_USLETTER") == 0) { v = TWSS_USLETTER; goto exit2; } if (strValue.compare("TWSS_USLEGAL") == 0) { v = TWSS_USLEGAL; goto exit2; } if (strValue.compare("TWSS_A5") == 0) { v = TWSS_A5; goto exit2; } if (strValue.compare("TWSS_ISOB4") == 0) { v = TWSS_ISOB4; goto exit2; } if (strValue.compare("TWSS_ISOB6") == 0) { v = TWSS_ISOB6; goto exit2; } if (strValue.compare("TWSS_USLEDGER") == 0) { v = TWSS_USLEDGER; goto exit2; } if (strValue.compare("TWSS_USEXECUTIVE") == 0) { v = TWSS_USEXECUTIVE; goto exit2; } if (strValue.compare("TWSS_A3") == 0) { v = TWSS_A3; goto exit2; } if (strValue.compare("TWSS_ISOB3") == 0) { v = TWSS_ISOB3; goto exit2; } if (strValue.compare("TWSS_A6") == 0) { v = TWSS_A6; goto exit2; } if (strValue.compare("TWSS_C4") == 0) { v = TWSS_C4; goto exit2; } if (strValue.compare("TWSS_C5") == 0) { v = TWSS_C5; goto exit2; } if (strValue.compare("TWSS_C6") == 0) { v = TWSS_C6; goto exit2; } if (strValue.compare("TWSS_4A0") == 0) { v = TWSS_4A0; goto exit2; } if (strValue.compare("TWSS_2A0") == 0) { v = TWSS_2A0; goto exit2; } if (strValue.compare("TWSS_A0") == 0) { v = TWSS_A0; goto exit2; } if (strValue.compare("TWSS_A1") == 0) { v = TWSS_A1; goto exit2; } if (strValue.compare("TWSS_A2") == 0) { v = TWSS_A2; goto exit2; } if (strValue.compare("TWSS_A7") == 0) { v = TWSS_A7; goto exit2; } if (strValue.compare("TWSS_A8") == 0) { v = TWSS_A8; goto exit2; } if (strValue.compare("TWSS_A9") == 0) { v = TWSS_A9; goto exit2; } if (strValue.compare("TWSS_A10") == 0) { v = TWSS_A10; goto exit2; } if (strValue.compare("TWSS_ISOB0") == 0) { v = TWSS_ISOB0; goto exit2; } if (strValue.compare("TWSS_ISOB1") == 0) { v = TWSS_ISOB1; goto exit2; } if (strValue.compare("TWSS_ISOB2") == 0) { v = TWSS_ISOB2; goto exit2; } if (strValue.compare("TWSS_ISOB5") == 0) { v = TWSS_ISOB5; goto exit2; } if (strValue.compare("TWSS_ISOB7") == 0) { v = TWSS_ISOB7; goto exit2; } if (strValue.compare("TWSS_ISOB8") == 0) { v = TWSS_ISOB8; goto exit2; } if (strValue.compare("TWSS_ISOB9") == 0) { v = TWSS_ISOB9; goto exit2; } if (strValue.compare("TWSS_ISOB10") == 0) { v = TWSS_ISOB10; goto exit2; } if (strValue.compare("TWSS_JISB0") == 0) { v = TWSS_JISB0; goto exit2; } if (strValue.compare("TWSS_JISB1") == 0) { v = TWSS_JISB1; goto exit2; } if (strValue.compare("TWSS_JISB2") == 0) { v = TWSS_JISB2; goto exit2; } if (strValue.compare("TWSS_JISB3") == 0) { v = TWSS_JISB3; goto exit2; } if (strValue.compare("TWSS_JISB4") == 0) { v = TWSS_JISB4; goto exit2; } if (strValue.compare("TWSS_JISB6") == 0) { v = TWSS_JISB6; goto exit2; } if (strValue.compare("TWSS_JISB7") == 0) { v = TWSS_JISB7; goto exit2; } if (strValue.compare("TWSS_JISB8") == 0) { v = TWSS_JISB8; goto exit2; } if (strValue.compare("TWSS_JISB9") == 0) { v = TWSS_JISB9; goto exit2; } if (strValue.compare("TWSS_JISB10") == 0) { v = TWSS_JISB10; goto exit2; } if (strValue.compare("TWSS_C0") == 0) { v = TWSS_C0; goto exit2; } if (strValue.compare("TWSS_C1") == 0) { v = TWSS_C1; goto exit2; } if (strValue.compare("TWSS_C2") == 0) { v = TWSS_C2; goto exit2; } if (strValue.compare("TWSS_C3") == 0) { v = TWSS_C3; goto exit2; } if (strValue.compare("TWSS_C7") == 0) { v = TWSS_C7; goto exit2; } if (strValue.compare("TWSS_C8") == 0) { v = TWSS_C8; goto exit2; } if (strValue.compare("TWSS_C9") == 0) { v = TWSS_C9; goto exit2; } if (strValue.compare("TWSS_C10") == 0) { v = TWSS_C10; goto exit2; } if (strValue.compare("TWSS_USSTATEMENT") == 0) { v = TWSS_USSTATEMENT; goto exit2; } if (strValue.compare("TWSS_BUSINESSCARD") == 0) { v = TWSS_BUSINESSCARD; goto exit2; } } break; case ICAP_XFERMECH: { if (strValue.compare("TWSX_NATIVE") == 0) { v = TWSX_NATIVE; goto exit2; } if (strValue.compare("TWSX_FILE") == 0) { v = TWSX_FILE; goto exit2; } if (strValue.compare("TWSX_MEMORY") == 0) { v = TWSX_MEMORY; goto exit2; } } break; case ICAP_UNITS: { if (strValue.compare("TWUN_INCHES") == 0) { v = TWUN_INCHES; goto exit2; } if (strValue.compare("TWUN_CENTIMETERS") == 0) { v = TWUN_CENTIMETERS; goto exit2; } if (strValue.compare("TWUN_PICAS") == 0) { v = TWUN_PICAS; goto exit2; } if (strValue.compare("TWUN_POINTS") == 0) { v = TWUN_POINTS; goto exit2; } if (strValue.compare("TWUN_TWIPS") == 0) { v = TWUN_TWIPS; goto exit2; } if (strValue.compare("TWUN_PIXELS") == 0) { v = TWUN_PIXELS; goto exit2; } } break; } exit2: return v; }
27.402204
114
0.550102
miyako
cfc6913d50c60734473a89636303d95835fb0cab
5,428
cpp
C++
modules/segmentation/src/smooth_Euclidean_segmenter.cpp
v4r-tuwien/v4r
ff3fbd6d2b298b83268ba4737868bab258262a40
[ "BSD-1-Clause", "BSD-2-Clause" ]
2
2021-02-22T11:36:33.000Z
2021-07-20T11:31:08.000Z
modules/segmentation/src/smooth_Euclidean_segmenter.cpp
v4r-tuwien/v4r
ff3fbd6d2b298b83268ba4737868bab258262a40
[ "BSD-1-Clause", "BSD-2-Clause" ]
null
null
null
modules/segmentation/src/smooth_Euclidean_segmenter.cpp
v4r-tuwien/v4r
ff3fbd6d2b298b83268ba4737868bab258262a40
[ "BSD-1-Clause", "BSD-2-Clause" ]
3
2018-10-19T10:39:23.000Z
2021-04-07T13:39:03.000Z
#include <pcl/common/angles.h> #include <v4r/common/miscellaneous.h> #include <v4r/segmentation/smooth_Euclidean_segmenter.h> namespace v4r { template <typename PointT> void SmoothEuclideanSegmenter<PointT>::segment() { size_t max_pts_per_cluster = std::numeric_limits<int>::max(); clusters_.clear(); CHECK(scene_->points.size() == normals_->points.size()); if (!octree_ || octree_->getInputCloud() != scene_) { // create an octree for search octree_.reset(new pcl::octree::OctreePointCloudSearch<PointT>(param_.octree_resolution_)); octree_->setInputCloud(scene_); octree_->addPointsFromInputCloud(); } // Create a bool vector of processed point indices, and initialize it to false std::vector<bool> processed(scene_->points.size(), false); std::vector<int> nn_indices; std::vector<float> nn_distances; float eps_angle_threshold_rad = pcl::deg2rad(param_.eps_angle_threshold_deg_); // Process all points in the indices vector for (size_t i = 0; i < scene_->points.size(); ++i) { if (processed[i] || !pcl::isFinite(scene_->points[i])) continue; std::vector<size_t> seed_queue; size_t sq_idx = 0; seed_queue.push_back(i); processed[i] = true; // this is used if planar surface extraction only is enabled Eigen::Vector3f avg_normal = normals_->points[i].getNormalVector3fMap(); Eigen::Vector3f avg_plane_pt = scene_->points[i].getVector3fMap(); while (sq_idx < seed_queue.size()) { size_t sidx = seed_queue[sq_idx]; const PointT &query_pt = scene_->points[sidx]; const pcl::Normal &query_n = normals_->points[sidx]; if (normals_->points[sidx].curvature > param_.curvature_threshold_) { sq_idx++; continue; } // Search for sq_idx - scale radius with distance of point (due to noise) float radius = param_.cluster_tolerance_; float curvature_threshold = param_.curvature_threshold_; float eps_angle_threshold = eps_angle_threshold_rad; if (param_.z_adaptive_) { radius = param_.cluster_tolerance_ * (1 + (std::max(query_pt.z, 1.f) - 1.f)); curvature_threshold = param_.curvature_threshold_ * (1 + (std::max(query_pt.z, 1.f) - 1.f)); eps_angle_threshold = eps_angle_threshold_rad * (1 + (std::max(query_pt.z, 1.f) - 1.f)); } if (!scene_->isOrganized() && !param_.force_unorganized_) { if (!octree_->radiusSearch(query_pt, radius, nn_indices, nn_distances)) { sq_idx++; continue; } } else // check pixel neighbors { int width = scene_->width; int height = scene_->height; int u = sidx % width; int v = sidx / width; nn_indices.resize(8); nn_distances.resize(8); size_t kept = 0; for (int shift_u = -1; shift_u <= 1; shift_u++) { int uu = u + shift_u; if (uu < 0 || uu >= width) continue; for (int shift_v = -1; shift_v <= 1; shift_v++) { int vv = v + shift_v; if (vv < 0 || vv >= height) continue; int nn_idx = vv * width + uu; float dist = (scene_->points[sidx].getVector3fMap() - scene_->points[nn_idx].getVector3fMap()).norm(); if (dist < radius) { nn_indices[kept] = nn_idx; nn_distances[kept] = dist; kept++; } } } nn_indices.resize(kept); nn_distances.resize(kept); } for (size_t j = 0; j < nn_indices.size(); j++) { if (processed[nn_indices[j]]) // Has this point been processed before ? continue; if (normals_->points[nn_indices[j]].curvature > curvature_threshold) continue; Eigen::Vector3f n1; if (param_.compute_planar_patches_only_) n1 = avg_normal; else n1 = query_n.getNormalVector3fMap(); pcl::Normal nn = normals_->points[nn_indices[j]]; const Eigen::Vector3f &n2 = nn.getNormalVector3fMap(); double dot_p = n1.dot(n2); if (fabs(dot_p) > cos(eps_angle_threshold)) { if (param_.compute_planar_patches_only_) { const Eigen::Vector3f &nn_pt = scene_->points[nn_indices[j]].getVector3fMap(); float dist = fabs(avg_normal.dot(nn_pt - avg_plane_pt)); if (dist > param_.planar_inlier_dist_) continue; runningAverage(avg_normal, seed_queue.size(), n2); avg_normal.normalize(); runningAverage(avg_plane_pt, seed_queue.size(), nn_pt); } processed[nn_indices[j]] = true; seed_queue.push_back(nn_indices[j]); } } sq_idx++; } // If this queue is satisfactory, add to the clusters if (seed_queue.size() >= param_.min_points_ && seed_queue.size() <= max_pts_per_cluster) { std::vector<int> r; r.resize(seed_queue.size()); for (size_t j = 0; j < seed_queue.size(); ++j) r[j] = seed_queue[j]; std::sort(r.begin(), r.end()); r.erase(std::unique(r.begin(), r.end()), r.end()); clusters_.push_back(r); // We could avoid a copy by working directly in the vector } } } //#define PCL_INSTANTIATE_SmoothEuclideanSegmenter(T) template class V4R_EXPORTS SmoothEuclideanSegmenter<T>; // PCL_INSTANTIATE(SmoothEuclideanSegmenter, PCL_XYZ_POINT_TYPES ) } // namespace v4r
34.35443
114
0.616065
v4r-tuwien
cfc7d415da8288cba7eb019a7bfd61b997165bef
599
cpp
C++
src/ComposerGUI/composer/package/form/delegate/BaseDelegate.cpp
composer-gui/composer-gui
2a488db4c6828fee0f36682d0b0edc96d359b4c3
[ "BSD-3-Clause" ]
13
2019-04-01T07:54:05.000Z
2022-03-27T16:55:59.000Z
src/ComposerGUI/composer/package/form/delegate/BaseDelegate.cpp
informaticacba/composer-gui
2a488db4c6828fee0f36682d0b0edc96d359b4c3
[ "BSD-3-Clause" ]
null
null
null
src/ComposerGUI/composer/package/form/delegate/BaseDelegate.cpp
informaticacba/composer-gui
2a488db4c6828fee0f36682d0b0edc96d359b4c3
[ "BSD-3-Clause" ]
1
2022-03-27T16:56:02.000Z
2022-03-27T16:56:02.000Z
#include "BaseDelegate.h" namespace composer_gui { namespace composer { namespace package { namespace form { namespace delegate { void BaseDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { // stub Q_UNUSED(editor); Q_UNUSED(model); Q_UNUSED(index); } void BaseDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const { // stub Q_UNUSED(editor); Q_UNUSED(option); Q_UNUSED(index); } } // delegate } // form } // package } // composer } // composer_gui
16.189189
124
0.714524
composer-gui
cfd16aa39895e7a57c68a60906806cf4d9060967
2,283
hpp
C++
source/canvas/Scene.hpp
RobertDamerius/GroundControlStation
7f0d896bd56e5ea0ee02d5738c2b497dc2956c2f
[ "MIT" ]
1
2021-12-26T12:48:18.000Z
2021-12-26T12:48:18.000Z
source/canvas/Scene.hpp
RobertDamerius/GroundControlStation
7f0d896bd56e5ea0ee02d5738c2b497dc2956c2f
[ "MIT" ]
null
null
null
source/canvas/Scene.hpp
RobertDamerius/GroundControlStation
7f0d896bd56e5ea0ee02d5738c2b497dc2956c2f
[ "MIT" ]
1
2021-12-26T12:48:25.000Z
2021-12-26T12:48:25.000Z
#pragma once #include <GLCallback.hpp> #include <RD.hpp> #include <OriginLLA.hpp> #include <Skybox.hpp> #include <GroundPlane.hpp> #include <HumanInterface.hpp> #include <VehicleManager.hpp> class Scene: public GLCallback { public: glm::dvec3 renderingOffset; ///< The rendering offset (OpenGL-frame) that is set by the scene update and has to be added to all objects before rendering with a relative camera position. OriginLLA origin; ///< The geographical origin. Skybox skybox; ///< The Skybox. GroundPlane groundPlane; ///< The ground plane. RD::Engine::Camera viewCamera; ///< The view camera for the scene. HumanInterface humanInterface; ///< The human interface. VehicleManager vehicleManager; ///< The vehicle manager. /** * @brief Create the scene. */ Scene(); /** * @brief Delete the scene. */ ~Scene(); /** * @brief Initialize the scene. * @return True if success, false otherwise. */ bool Initialize(void); /** * @brief Terminate the scene. */ void Terminate(void); /** * @brief Update the scene. * @param [in] dt Elapsed time in seconds. */ void Update(double dt); /** * @brief Set the camera mode, either perspective or orthographic. * @param [in] mode The camera mode. * @details This will also update the view and up directions of the camera. */ void SetCameraMode(CameraMode mode); /** * @brief Update the view camera. * @param [in] size The framebuffer size. */ void UpdateViewCamera(glm::ivec2 size); private: // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Callback functions // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @brief Framebuffer resize callback. * @param [in] wnd The GLFW window. * @param [in] size Framebuffer size in pixels. */ void CallbackFramebufferResize(GLFWwindow* wnd, glm::ivec2 size); };
30.039474
198
0.52431
RobertDamerius
cfd215b089622d7347cc037149c365df4d88b98e
551
hpp
C++
include/selection.hpp
SimonRussia/COURSEWORK_fixed
8cd58f151e5bcddb03ed98b27e27cea0b769d98f
[ "MIT" ]
null
null
null
include/selection.hpp
SimonRussia/COURSEWORK_fixed
8cd58f151e5bcddb03ed98b27e27cea0b769d98f
[ "MIT" ]
null
null
null
include/selection.hpp
SimonRussia/COURSEWORK_fixed
8cd58f151e5bcddb03ed98b27e27cea0b769d98f
[ "MIT" ]
null
null
null
// SELECTION.HPP #include <iostream> #include <vector> template <typename RandomAccessIterator> void selection_sort(RandomAccessIterator left, RandomAccessIterator right) { for (RandomAccessIterator iter1 = left; iter1 != (right - 1); iter1++) { RandomAccessIterator min = iter1; for (RandomAccessIterator iter2 = (iter1 + 1); iter2 != right; iter2++) { if (*min > *iter2) { min = iter2; } } std::swap(*min, *iter1); // В случае 1 2 3 |4| 5 меняем 4 саму с собой } }
30.611111
81
0.598911
SimonRussia
cfd444ae7a9ee096911fd6285cd5f37c0d95d956
434
cc
C++
src/StackedBlock/Control/StopBlock.cc
khuebeo/scrape
9706fad08041cac1864036916d8675ec8ad6f034
[ "MIT" ]
11
2020-06-01T02:26:07.000Z
2022-03-24T09:12:49.000Z
src/StackedBlock/Control/StopBlock.cc
khuebeo/scrape
9706fad08041cac1864036916d8675ec8ad6f034
[ "MIT" ]
4
2020-06-01T14:48:46.000Z
2020-09-17T16:43:33.000Z
src/StackedBlock/Control/StopBlock.cc
khuebeo/scrape
9706fad08041cac1864036916d8675ec8ad6f034
[ "MIT" ]
2
2020-06-05T18:14:44.000Z
2021-08-13T03:48:17.000Z
#include "StackedBlock/Control/StopBlock.h" #include "NestedBlock/RoundBlock/Constant.h" StopBlock::StopBlock(std::shared_ptr<Constant> opt) : option(opt) {} void StopBlock::exec() const { if(option->getString()=="all" || option->getString()=="this script") { throw StopBlockCalledException(); } } const char * StopBlockCalledException::what() const noexcept { return "Block \"control_stop\" executed!"; }
24.111111
72
0.693548
khuebeo
cfe1ef19aaeb68d68f76160d1d92224114f6bc4e
4,962
cpp
C++
Server/src/Pages/UsersList.cpp
siisgoo/siisty
66103c54e0d1b35b88177c290e2bf60012607309
[ "MIT" ]
null
null
null
Server/src/Pages/UsersList.cpp
siisgoo/siisty
66103c54e0d1b35b88177c290e2bf60012607309
[ "MIT" ]
null
null
null
Server/src/Pages/UsersList.cpp
siisgoo/siisty
66103c54e0d1b35b88177c290e2bf60012607309
[ "MIT" ]
null
null
null
#include "Pages/Users/UsersList.hpp" #include "ui_UsersList.h" #include <QAction> #include <qnamespace.h> UsersList::UsersList(const QMap<Database::RoleId, Database::Driver::role_set>& roles, QWidget *parent) : QWidget(parent), ui(new Ui::UsersList), _usersWaiter(new Database::DriverAssistant), _userWaiter(new Database::DriverAssistant), _roles(roles) { ui->setupUi(this); connect(_usersWaiter, SIGNAL(success(QJsonObject)), this, SLOT(on_usersLoaded(QJsonObject))); connect(_usersWaiter, SIGNAL(failed(Database::CmdError)), this, SLOT(on_usersLoadError(Database::CmdError))); connect(_userWaiter, SIGNAL(success(QJsonObject)), this, SLOT(on_userLoaded(QJsonObject))); connect(_userWaiter, SIGNAL(failed(Database::CmdError)), this, SLOT(on_userLoadError(Database::CmdError))); connect(ui->update_users_Btn, SIGNAL(clicked()), this, SLOT(requestUsers())); connect(ui->users_table, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(on_userClicked(QTableWidgetItem*))); QTimer::singleShot(1000, [this]() {requestUsers();}); // TODO add sorting actions and enabling disabling columns /* ui->users_table->addActions({ */ /* new QAction("bla"), */ /* }); */ } UsersList::~UsersList() { clearTable(); delete _usersWaiter; delete ui; } void UsersList::requestUsers() { Q_EMIT requestedUsers({Database::ROLE_AUTO, QJsonObject{ { "command", Database::CMD_GET_USER_INFO }, { "arg", QJsonObject{ { "id", "*" } } } }, _usersWaiter}); } void UsersList::clearTable() { for (int row = ui->users_table->rowCount(); row >= 0; row--) { for (int i = 0; i < COLUMNS; i++) { delete ui->users_table->takeItem(row, i); ui->users_table->removeRow(row); } } } void UsersList::on_usersLoaded(QJsonObject obj) { clearTable(); QJsonArray users = obj.take("users").toArray(); int row = 0; for (const auto& user : users) { QJsonObject cur = user.toObject(); ui->users_table->insertRow(row); /* ->setData(0, cur["id"].toInt() */ QTableWidgetItem * id_i = new QTableWidgetItem(QString::number(cur["id"].toInt())), * name_i = new QTableWidgetItem(cur["name"].toString()), * role_i = new QTableWidgetItem(_roles[(Database::RoleId)cur["role"].toInteger()].name); ui->users_table->setItem(row, ID, id_i); ui->users_table->setItem(row, NAME, name_i); ui->users_table->setItem(row, ROLE, role_i); /* ui->users_table->itemAt(row, ROLE)->setData(Qt::DisplayRole, _roles[cur["role"].toInteger()].id); // first is AUTO => skip */ row++; } } void UsersList::on_usersLoadError(Database::CmdError e) { Q_EMIT logMessage(e.String(), Error); } void UsersList::on_userClicked(QTableWidgetItem * itm) { int id = this->ui->users_table->indexAt(QPoint(0, itm->row())).data().toInt(); Q_EMIT requestedUsers({Database::ROLE_AUTO, QJsonObject{ { "command", Database::CMD_GET_USER_INFO }, { "arg", QJsonObject{ { "id", id }, { "takeImage", true } } } }, _userWaiter}); } /* { "id", q.record().value("id").toInt() }, */ /* { "name", q.record().value("name").toString() }, */ /* { "role", q.record().value("role_id").toInt() }, */ /* { "email", q.record().value("email").toString() }, */ /* { "login", q.record().value("login").toString() }, */ /* { "entryDate", q.record().value("entryDate").toInt() }, */ /* { "wapon", q.record().value("wapon_id").toInt() }, */ /* { "image", (takeImage ? extractImg(q.record().value("image")) : "") } // remove to another? use a model? */ void UsersList::on_userLoaded(QJsonObject obj) { this->ui->name->setText(obj["name"].toString()); this->ui->role->setText(this->_roles[(Database::RoleId)obj["role"].toInt()].name); this->ui->entrydate->setDateTime(QDateTime::fromSecsSinceEpoch(obj["entryDate"].toInt())); this->ui->login->setText(obj["login"].toString()); this->ui->password->setText("encrypted"); this->ui->avatar->setPixmap( QPixmapFromQString(obj["image"].toString()) .scaled(218, 218, Qt::AspectRatioMode::KeepAspectRatio, Qt::FastTransformation)); } void UsersList::on_userLoadError(Database::CmdError) { }
36.485294
136
0.548771
siisgoo
cfe8884fb75a0abd7db0f86070c02919fd940de3
4,525
cpp
C++
Shader/NormalRenderer.cpp
PremiumGraphicsCodes/CGLib
eecd73c5af1a9e0c044e7d675318dbb496aec6b5
[ "MIT" ]
null
null
null
Shader/NormalRenderer.cpp
PremiumGraphicsCodes/CGLib
eecd73c5af1a9e0c044e7d675318dbb496aec6b5
[ "MIT" ]
null
null
null
Shader/NormalRenderer.cpp
PremiumGraphicsCodes/CGLib
eecd73c5af1a9e0c044e7d675318dbb496aec6b5
[ "MIT" ]
1
2022-02-03T08:09:03.000Z
2022-02-03T08:09:03.000Z
#include "stdafx.h" #include "NormalRenderer.h" #include <sstream> using namespace Crystal::Math; using namespace Crystal::Graphics; using namespace Crystal::Shader; void NormalBuffer::add(const Vector3d<float>& position, const Vector3d<float>& normal, const ColorRGBA<float>& color) { this->position.add(position); this->normal.add(normal); this->color.add(color); } using namespace Crystal::Shader::v330; bool NormalRenderer::build() { const auto vsSource = getBuildinVertexShaderSource(); const auto gsSource = getBuildinGeometryShaderSource(); const auto fsSource = getBuildinFragmentShaderSource(); bool b = shader.build(vsSource, gsSource, fsSource); findLocation(); return b; } std::string NormalRenderer::getBuildinVertexShaderSource() const { std::ostringstream stream; stream << "#version 330" << std::endl << "in vec3 position;" << std::endl << "in vec3 normal;" << std::endl << "in vec4 color;" << std::endl << "out vec4 vNormal;" << std::endl << "out vec4 vColor;" << std::endl << "uniform mat4 projectionMatrix;" << std::endl << "uniform mat4 modelviewMatrix;" << std::endl << "void main(void) {" << std::endl << " gl_Position = projectionMatrix * modelviewMatrix * vec4(position, 1.0);" << std::endl << " vColor = color;" << std::endl << " vNormal = projectionMatrix * modelviewMatrix * vec4(normal,1.0);" << std::endl << "}" << std::endl; return stream.str(); } std::string NormalRenderer::getBuildinGeometryShaderSource() const { std::ostringstream stream; stream << "#version 330" << std::endl << "layout(points) in;" << std::endl << "layout(line_strip, max_vertices = 2) out;" << std::endl << "in vec4 vNormal[];" << std::endl << "in vec4 vColor[];" << std::endl << "out vec4 gColor;" << std::endl << "void main(void) {" << std::endl << " gl_Position = gl_in[0].gl_Position;" << std::endl << " gColor = vColor[0];" << std::endl << " EmitVertex();" << std::endl << " gl_Position = gl_in[0].gl_Position + vNormal[0];" << std::endl << " gColor = vColor[0];" << std::endl << " EmitVertex();" << std::endl << " EndPrimitive();" << std::endl << "}" << std::endl; return stream.str(); } std::string NormalRenderer::getBuildinFragmentShaderSource() const { std::ostringstream stream; stream << "#version 330" << std::endl << "in vec4 gColor;" << std::endl << "out vec4 fragColor;" << std::endl << "void main(void) {" << std::endl << " fragColor.rgba = gColor;" << std::endl << "}" << std::endl; return stream.str(); } void NormalRenderer::findLocation() { shader.findUniformLocation("projectionMatrix"); shader.findUniformLocation("modelviewMatrix"); shader.findAttribLocation("position"); shader.findAttribLocation("color"); shader.findAttribLocation("normal"); } void NormalRenderer::render(const ICamera<float>& camera, const NormalBuffer& buffer) { const auto positions = buffer.getPosition().get(); const auto colors = buffer.getColor().get(); const auto normals = buffer.getNormal().get(); if (positions.empty()) { return; } const auto& projectionMatrix = camera.getProjectionMatrix().toArray(); const auto& modelviewMatrix = camera.getModelviewMatrix().toArray(); glEnable(GL_DEPTH_TEST); //glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); //glEnable(GL_POINT_SPRITE); //glEnable(GL_DEPTH_TEST); glUseProgram(shader.getId()); glUniformMatrix4fv(shader.getUniformLocation("projectionMatrix"), 1, GL_FALSE, projectionMatrix.data()); glUniformMatrix4fv(shader.getUniformLocation("modelviewMatrix"), 1, GL_FALSE, modelviewMatrix.data()); glVertexAttribPointer(shader.getAttribLocation("positions"), 3, GL_FLOAT, GL_FALSE, 0, positions.data()); glVertexAttribPointer(shader.getAttribLocation("color"), 4, GL_FLOAT, GL_FALSE, 0, colors.data()); glVertexAttribPointer(shader.getAttribLocation("normal"), 3, GL_FLOAT, GL_FALSE, 0, normals.data()); //const auto positions = buffer.getPositions(); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(positions.size() / 3)); glDisableVertexAttribArray(2); glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); glBindFragDataLocation(shader.getId(), 0, "fragColor"); glDisable(GL_DEPTH_TEST); //glDisable(GL_VERTEX_PROGRAM_POINT_SIZE); //glDisable(GL_POINT_SPRITE); glUseProgram(0); }
30.782313
118
0.676464
PremiumGraphicsCodes
cfeb18776b9b59f40fc9441765d3ae3af847a120
51
hpp
C++
src/boost_spirit_home_x3_directive_skip.hpp
miathedev/BoostForArduino
919621dcd0c157094bed4df752b583ba6ea6409e
[ "BSL-1.0" ]
10
2018-03-17T00:58:42.000Z
2021-07-06T02:48:49.000Z
src/boost_spirit_home_x3_directive_skip.hpp
miathedev/BoostForArduino
919621dcd0c157094bed4df752b583ba6ea6409e
[ "BSL-1.0" ]
2
2021-03-26T15:17:35.000Z
2021-05-20T23:55:08.000Z
src/boost_spirit_home_x3_directive_skip.hpp
miathedev/BoostForArduino
919621dcd0c157094bed4df752b583ba6ea6409e
[ "BSL-1.0" ]
4
2019-05-28T21:06:37.000Z
2021-07-06T03:06:52.000Z
#include <boost/spirit/home/x3/directive/skip.hpp>
25.5
50
0.784314
miathedev
cff07859889f0d027fa62da168a82bdd58bc24b9
2,670
cpp
C++
software/arduino/SensorDemo/lib/MyCst816s/CST816S.cpp
Ualker/T-Watch-2021
741e29740fd854be6b1036637b5f1dce4b428bb2
[ "MIT" ]
34
2021-08-10T11:12:15.000Z
2022-03-30T11:57:15.000Z
software/arduino/SensorDemo/lib/MyCst816s/CST816S.cpp
Ualker/T-Watch-2021
741e29740fd854be6b1036637b5f1dce4b428bb2
[ "MIT" ]
2
2021-10-03T23:58:16.000Z
2022-01-11T02:01:58.000Z
software/arduino/SensorDemo/lib/MyCst816s/CST816S.cpp
Ualker/T-Watch-2021
741e29740fd854be6b1036637b5f1dce4b428bb2
[ "MIT" ]
11
2021-10-02T05:17:39.000Z
2022-03-30T11:59:41.000Z
#include <Wire.h> #include "CST816S.h" // Write register values to chip void CST816S::_writeReg(uint8_t reg, uint8_t *data, uint8_t len) { _i2cPort->beginTransmission(_address); _i2cPort->write(reg); for (uint8_t i = 0; i < len; i++) { _i2cPort->write(data[i]); } _i2cPort->endTransmission(); } // read register values to chip uint8_t CST816S::_readReg(uint8_t reg, uint8_t *data, uint8_t len) { _i2cPort->beginTransmission(_address); _i2cPort->write(reg); _i2cPort->endTransmission(); _i2cPort->requestFrom(_address, len); uint8_t index = 0; while (_i2cPort->available()) data[index++] = _i2cPort->read(); return 0; } bool CST816S::begin(TwoWire &port, uint8_t res, uint8_t INT, uint8_t addr) { _i2cPort = &port; _address = addr; _res = res; _INT = INT; pinMode(_INT, INPUT_PULLUP); /* attachInterrupt( _INT, [] { isTouch = true }, LOW); */ setReset(); _i2cPort->beginTransmission(_address); if (_i2cPort->endTransmission() != 0) { return false; } uint8_t temp[1]; temp[0] = 0x00; _writeReg(DisAutoSleep, temp, 1); //默认为0,使能自动进入低功耗模式 temp[0] = 0x02; _writeReg(NorScanPer, temp, 1); //设置报点率 temp[0] = 0x60; //报点:0x60 手势:0X11 报点加手势:0X71 _writeReg(IrqCtl, temp, 1); //设置模式 报点/手势 temp[0] = 0x05; //单位1S 为0时不启用功能 默认5 _writeReg(AutoReset, temp, 1); //设置自动复位时间 X秒内有触摸但无手势时,自动复位 temp[0] = 0x10; //单位1S 为0时不启用功能 默认10 _writeReg(LongPressTime, temp, 1); //设置自动复位时间 长按X秒自动复位 temp[0] = 0x1E; //单位0.1mS _writeReg(IrqPluseWidth, temp, 1); //设置中断低脉冲输出宽度 /* temp[0] = 0x30; _writeReg(LpScanTH, temp, 1); //设置低功耗扫描唤醒门限 temp[0] = 0x01; _writeReg(LpScanWin, temp, 1); //设置低功耗扫描量程*/ /* temp[0] = 0x50; _writeReg(LpScanFreq, temp, 1); //设置低功耗扫描频率 temp[0] = 0x80; _writeReg(LpScanIdac, temp, 1); //设置低功耗扫描电流 temp[0] = 0x01; _writeReg(AutoSleepTime, temp, 1); //设置1S进入低功耗 _readReg(0x00, Touch_Data, 7);*/ return true; } // Reset the chip void CST816S::setReset() { pinMode(_res, OUTPUT); digitalWrite(_res, LOW); delay(10); digitalWrite(_res, HIGH); delay(50); } // Set I2C Address if different then default. void CST816S::setADDR(uint8_t b) { _address = b; } bool CST816S::TouchInt(void) { if (!digitalRead(_INT)) { _readReg(0x00, Touch_Data, 7); return true; } else return false; } void CST816S::ReadTouch(void) { _readReg(0x00, Touch_Data, 7); } /* * 按下按钮返回:0x01 */ uint8_t CST816S::getTouchType(void) { return Touch_Data[3] >> 7; } uint16_t CST816S::getX(void) { return ((uint16_t)(Touch_Data[3] & 0x0F) << 8) + (uint16_t)Touch_Data[4]; } uint16_t CST816S::getY(void) { return ((uint16_t)(Touch_Data[5] & 0x0F) << 8) + (uint16_t)Touch_Data[6]; }
19.489051
74
0.668165
Ualker
320100ff5a27d461564894af12821d780c2e310a
1,605
cpp
C++
online-judge/10114.cpp
kirillgashkov/cp-solutions
863603b076e94b324b0d44a9adff4099e3131513
[ "MIT" ]
null
null
null
online-judge/10114.cpp
kirillgashkov/cp-solutions
863603b076e94b324b0d44a9adff4099e3131513
[ "MIT" ]
null
null
null
online-judge/10114.cpp
kirillgashkov/cp-solutions
863603b076e94b324b0d44a9adff4099e3131513
[ "MIT" ]
null
null
null
#include <iostream> #include <unordered_map> using namespace std; float calculate_months( int duration_months, float down_payment, float amount_loan, int depr_count ) { float amount_with_depr = amount_loan + down_payment; float amount_with_paid = amount_loan; float monthly_pay = amount_loan / duration_months; unordered_map<int, float> inv_deprs; for (int i = 0; i < depr_count; ++i) { int depr_month; float depr; cin >> depr_month >> depr; inv_deprs[depr_month] = 1.0 - depr; } float inv_derp; for (int current_month = 0; current_month <= duration_months; ++current_month) { if (inv_deprs.count(current_month)) { inv_derp = inv_deprs[current_month]; } amount_with_depr *= inv_derp; if (amount_with_paid < amount_with_depr) { return current_month; } amount_with_paid -= monthly_pay; } return -1; } int main() { int duration_months; float down_payment; float amount_loan; int depr_count; cin >> duration_months >> down_payment >> amount_loan >> depr_count; while (duration_months > 0) { const float months_needed = calculate_months( duration_months, down_payment, amount_loan, depr_count ); if (months_needed == 1) { cout << months_needed << " month\n"; } else { cout << months_needed << " months\n"; } cin >> duration_months >> down_payment >> amount_loan >> depr_count; } }
25.47619
84
0.598754
kirillgashkov
32035fe4b4bc342eae7759487dadc41b3dcacda5
5,561
cpp
C++
sqlite.cpp
felaugmar/gd-sqlite
29921dabb52b08788cfd659551ea78615cea935a
[ "MIT" ]
1
2020-07-05T13:39:40.000Z
2020-07-05T13:39:40.000Z
sqlite.cpp
felaugmar/gd-sqlite
29921dabb52b08788cfd659551ea78615cea935a
[ "MIT" ]
null
null
null
sqlite.cpp
felaugmar/gd-sqlite
29921dabb52b08788cfd659551ea78615cea935a
[ "MIT" ]
null
null
null
#include "sqlite.h" #include "database.h" SQLite *SQLite::singleton = NULL; SQLite *SQLite::get_singleton() { return singleton; } String SQLite::errstr(int result_code) const { return sqlite3_errstr(result_code); } String SQLite::version() const { return SQLITE_VERSION; } uint32_t SQLite::version_number() const { return SQLITE_VERSION_NUMBER; } String SQLite::source_id() const { return SQLITE_SOURCE_ID; } Ref<SQLiteDatabase> SQLite::open(String path) const { Ref<SQLiteDatabase> database(memnew(SQLiteDatabase)); database->open(path); return database; } void SQLite::_bind_methods() { ClassDB::bind_method(D_METHOD("errstr", "result_code"), &SQLite::errstr); ClassDB::bind_method(D_METHOD("version"), &SQLite::version); ClassDB::bind_method(D_METHOD("version_number"), &SQLite::version_number); ClassDB::bind_method(D_METHOD("source_id"), &SQLite::source_id); ClassDB::bind_method(D_METHOD("open", "path"), &SQLite::open); // Fundamental Datatypes BIND_ENUM_CONSTANT(INTEGER); BIND_ENUM_CONSTANT(FLOAT); BIND_ENUM_CONSTANT(TEXT); BIND_ENUM_CONSTANT(BLOB); #ifdef DEBUG_METHODS_ENABLED ClassDB::bind_integer_constant(get_class_static(), __constant_get_enum_name(NULL_, "NULL"), "NULL", NULL_); #else ClassDB::bind_integer_constant(get_class_static(), StringName(), "NULL", NULL_); #endif // Result Codes BIND_ENUM_CONSTANT(OK); BIND_ENUM_CONSTANT(ERROR); BIND_ENUM_CONSTANT(INTERNAL); BIND_ENUM_CONSTANT(PERM); BIND_ENUM_CONSTANT(ABORT); BIND_ENUM_CONSTANT(BUSY); BIND_ENUM_CONSTANT(LOCKED); BIND_ENUM_CONSTANT(NOMEM); BIND_ENUM_CONSTANT(READONLY); BIND_ENUM_CONSTANT(INTERRUPT); BIND_ENUM_CONSTANT(IOERR); BIND_ENUM_CONSTANT(CORRUPT); BIND_ENUM_CONSTANT(NOTFOUND); BIND_ENUM_CONSTANT(FULL); BIND_ENUM_CONSTANT(CANTOPEN); BIND_ENUM_CONSTANT(PROTOCOL); BIND_ENUM_CONSTANT(EMPTY); BIND_ENUM_CONSTANT(SCHEMA); BIND_ENUM_CONSTANT(TOOBIG); BIND_ENUM_CONSTANT(CONSTRAINT); BIND_ENUM_CONSTANT(MISMATCH); BIND_ENUM_CONSTANT(MISUSE); BIND_ENUM_CONSTANT(NOLFS); BIND_ENUM_CONSTANT(AUTH); BIND_ENUM_CONSTANT(FORMAT); BIND_ENUM_CONSTANT(RANGE); BIND_ENUM_CONSTANT(NOTADB); BIND_ENUM_CONSTANT(NOTICE); BIND_ENUM_CONSTANT(WARNING); BIND_ENUM_CONSTANT(ROW); BIND_ENUM_CONSTANT(DONE); // Extended Result Codes BIND_ENUM_CONSTANT(ERROR_MISSING_COLLSEQ); BIND_ENUM_CONSTANT(ERROR_RETRY); BIND_ENUM_CONSTANT(ERROR_SNAPSHOT); BIND_ENUM_CONSTANT(IOERR_READ); BIND_ENUM_CONSTANT(IOERR_SHORT_READ); BIND_ENUM_CONSTANT(IOERR_WRITE); BIND_ENUM_CONSTANT(IOERR_FSYNC); BIND_ENUM_CONSTANT(IOERR_DIR_FSYNC); BIND_ENUM_CONSTANT(IOERR_TRUNCATE); BIND_ENUM_CONSTANT(IOERR_FSTAT); BIND_ENUM_CONSTANT(IOERR_UNLOCK); BIND_ENUM_CONSTANT(IOERR_RDLOCK); BIND_ENUM_CONSTANT(IOERR_DELETE); BIND_ENUM_CONSTANT(IOERR_BLOCKED); BIND_ENUM_CONSTANT(IOERR_NOMEM); BIND_ENUM_CONSTANT(IOERR_ACCESS); BIND_ENUM_CONSTANT(IOERR_CHECKRESERVEDLOCK); BIND_ENUM_CONSTANT(IOERR_LOCK); BIND_ENUM_CONSTANT(IOERR_CLOSE); BIND_ENUM_CONSTANT(IOERR_DIR_CLOSE); BIND_ENUM_CONSTANT(IOERR_SHMOPEN); BIND_ENUM_CONSTANT(IOERR_SHMSIZE); BIND_ENUM_CONSTANT(IOERR_SHMLOCK); BIND_ENUM_CONSTANT(IOERR_SHMMAP); BIND_ENUM_CONSTANT(IOERR_SEEK); BIND_ENUM_CONSTANT(IOERR_DELETE_NOENT); BIND_ENUM_CONSTANT(IOERR_MMAP); BIND_ENUM_CONSTANT(IOERR_GETTEMPPATH); BIND_ENUM_CONSTANT(IOERR_CONVPATH); BIND_ENUM_CONSTANT(IOERR_VNODE); BIND_ENUM_CONSTANT(IOERR_AUTH); BIND_ENUM_CONSTANT(IOERR_BEGIN_ATOMIC); BIND_ENUM_CONSTANT(IOERR_COMMIT_ATOMIC); BIND_ENUM_CONSTANT(IOERR_ROLLBACK_ATOMIC); BIND_ENUM_CONSTANT(IOERR_DATA); BIND_ENUM_CONSTANT(IOERR_CORRUPTFS); BIND_ENUM_CONSTANT(LOCKED_SHAREDCACHE); BIND_ENUM_CONSTANT(LOCKED_VTAB); BIND_ENUM_CONSTANT(BUSY_RECOVERY); BIND_ENUM_CONSTANT(BUSY_SNAPSHOT); BIND_ENUM_CONSTANT(BUSY_TIMEOUT); BIND_ENUM_CONSTANT(CANTOPEN_NOTEMPDIR); BIND_ENUM_CONSTANT(CANTOPEN_ISDIR); BIND_ENUM_CONSTANT(CANTOPEN_FULLPATH); BIND_ENUM_CONSTANT(CANTOPEN_CONVPATH); BIND_ENUM_CONSTANT(CANTOPEN_DIRTYWAL); BIND_ENUM_CONSTANT(CANTOPEN_SYMLINK); BIND_ENUM_CONSTANT(CORRUPT_VTAB); BIND_ENUM_CONSTANT(CORRUPT_SEQUENCE); BIND_ENUM_CONSTANT(CORRUPT_INDEX); BIND_ENUM_CONSTANT(READONLY_RECOVERY); BIND_ENUM_CONSTANT(READONLY_CANTLOCK); BIND_ENUM_CONSTANT(READONLY_ROLLBACK); BIND_ENUM_CONSTANT(READONLY_DBMOVED); BIND_ENUM_CONSTANT(READONLY_CANTINIT); BIND_ENUM_CONSTANT(READONLY_DIRECTORY); BIND_ENUM_CONSTANT(ABORT_ROLLBACK); BIND_ENUM_CONSTANT(CONSTRAINT_CHECK); BIND_ENUM_CONSTANT(CONSTRAINT_COMMITHOOK); BIND_ENUM_CONSTANT(CONSTRAINT_FOREIGNKEY); BIND_ENUM_CONSTANT(CONSTRAINT_FUNCTION); BIND_ENUM_CONSTANT(CONSTRAINT_NOTNULL); BIND_ENUM_CONSTANT(CONSTRAINT_PRIMARYKEY); BIND_ENUM_CONSTANT(CONSTRAINT_TRIGGER); BIND_ENUM_CONSTANT(CONSTRAINT_UNIQUE); BIND_ENUM_CONSTANT(CONSTRAINT_VTAB); BIND_ENUM_CONSTANT(CONSTRAINT_ROWID); BIND_ENUM_CONSTANT(CONSTRAINT_PINNED); BIND_ENUM_CONSTANT(NOTICE_RECOVER_WAL); BIND_ENUM_CONSTANT(NOTICE_RECOVER_ROLLBACK); BIND_ENUM_CONSTANT(WARNING_AUTOINDEX); BIND_ENUM_CONSTANT(AUTH_USER); BIND_ENUM_CONSTANT(OK_LOAD_PERMANENTLY); BIND_ENUM_CONSTANT(OK_SYMLINK); // Status Parameters for Prepared Statements BIND_ENUM_CONSTANT(STMTSTATUS_FULLSCAN_STEP); BIND_ENUM_CONSTANT(STMTSTATUS_SORT); BIND_ENUM_CONSTANT(STMTSTATUS_AUTOINDEX); BIND_ENUM_CONSTANT(STMTSTATUS_VM_STEP); BIND_ENUM_CONSTANT(STMTSTATUS_REPREPARE); BIND_ENUM_CONSTANT(STMTSTATUS_RUN); BIND_ENUM_CONSTANT(STMTSTATUS_MEMUSED); // Action Codes BIND_ENUM_CONSTANT(INSERT); BIND_ENUM_CONSTANT(UPDATE); BIND_ENUM_CONSTANT(DELETE); } SQLite::SQLite() { singleton = this; }
30.387978
108
0.830067
felaugmar
3203c1934a479ee14d64d08b5ce229a286b82378
1,027
hpp
C++
nacl/graph/spfa.hpp
ToxicPie/NaCl
8cb50bacc25f2b99a33fb5938ea4ec9906d8d65c
[ "MIT" ]
3
2021-08-31T17:51:01.000Z
2021-11-13T16:22:25.000Z
nacl/graph/spfa.hpp
ToxicPie/NaCl
8cb50bacc25f2b99a33fb5938ea4ec9906d8d65c
[ "MIT" ]
null
null
null
nacl/graph/spfa.hpp
ToxicPie/NaCl
8cb50bacc25f2b99a33fb5938ea4ec9906d8d65c
[ "MIT" ]
null
null
null
struct SPFA { static const int maxn = 1010, INF = 1e9; int dis[maxn]; bitset<maxn> inq, inneg; queue<int> q, tq; vector<pii> v[maxn]; void make_edge(int s, int t, int w) { v[s].emplace_back(t, w); } void dfs(int a) { inneg[a] = 1; for (pii i : v[a]) if (!inneg[i.F]) dfs(i.F); } bool solve(int n, int s) { // true if have neg-cycle for (int i = 0; i <= n; i++) dis[i] = INF; dis[s] = 0, q.push(s); for (int i = 0; i < n; i++) { inq.reset(); int now; while (!q.empty()) { now = q.front(), q.pop(); for (pii &i : v[now]) { if (dis[i.F] > dis[now] + i.S) { dis[i.F] = dis[now] + i.S; if (!inq[i.F]) tq.push(i.F), inq[i.F] = 1; } } } q.swap(tq); } bool re = !q.empty(); inneg.reset(); while (!q.empty()) { if (!inneg[q.front()]) dfs(q.front()); q.pop(); } return re; } void reset(int n) { for (int i = 0; i <= n; i++) v[i].clear(); } };
23.340909
54
0.439143
ToxicPie
3209b2cad585d1b7f719f40fe3eebfe11ab57d84
578
cpp
C++
src/Engine/Engine.cpp
Hazurl/Framework-haz
370348801cd969ce8521264653069923a255e0b0
[ "MIT" ]
null
null
null
src/Engine/Engine.cpp
Hazurl/Framework-haz
370348801cd969ce8521264653069923a255e0b0
[ "MIT" ]
null
null
null
src/Engine/Engine.cpp
Hazurl/Framework-haz
370348801cd969ce8521264653069923a255e0b0
[ "MIT" ]
null
null
null
#include <haz/Engine/Engine.hpp> #include <haz/GameObject/GameObject.hpp> #include <haz/Tools/Time.hpp> BEG_NAMESPACE_HAZ Engine::~Engine() { Engine::reset(); } Time const& Engine::time () { return *get()._time; } void Engine::reset() { GameObject::destroyAll(); if (get()._time != nullptr) { delete get()._time; get()._time = nullptr; } } void Engine::start() { get()._time = new Time(); } void Engine::update() { get()._time->update(); for(auto* go : get().gameobjects) { go->update(); } } END_NAMESPACE_HAZ
16.055556
40
0.591696
Hazurl
32172762f4a1853f728f5af8987d401b38b2e5f4
348
cpp
C++
solutions/leetcode/1221. Split a String in Balanced Strings.cpp
MohanedAshraf/competitive-programming
234dc6113b39462c64a2719cd1071f3d99655508
[ "MIT" ]
1
2021-08-12T14:53:37.000Z
2021-08-12T14:53:37.000Z
solutions/leetcode/1221. Split a String in Balanced Strings.cpp
MohanedAshraf/competitive-programming
234dc6113b39462c64a2719cd1071f3d99655508
[ "MIT" ]
null
null
null
solutions/leetcode/1221. Split a String in Balanced Strings.cpp
MohanedAshraf/competitive-programming
234dc6113b39462c64a2719cd1071f3d99655508
[ "MIT" ]
null
null
null
static int __=[](){std::ios::sync_with_stdio(false);return 1000;}(); class Solution { public: int balancedStringSplit(string s) { int sum = 0 , c = 0; for(int i=0 ; i<s.size() ; i++){ if(s[i]=='L') sum--; else sum ++ ; if(!sum)c++; } return c ; } };
23.2
68
0.422414
MohanedAshraf
32177c9c8fd88caf048d0d3e8f53969ed24e714b
17,611
cpp
C++
d-collide/narrowphase/intersectionhelpers.cpp
ColinGilbert/d-collide
8adb354d52e7ee49705ca2853d50a6a879f3cd49
[ "BSD-3-Clause" ]
6
2015-12-08T05:38:03.000Z
2021-04-09T13:45:59.000Z
d-collide/narrowphase/intersectionhelpers.cpp
ColinGilbert/d-collide
8adb354d52e7ee49705ca2853d50a6a879f3cd49
[ "BSD-3-Clause" ]
null
null
null
d-collide/narrowphase/intersectionhelpers.cpp
ColinGilbert/d-collide
8adb354d52e7ee49705ca2853d50a6a879f3cd49
[ "BSD-3-Clause" ]
null
null
null
/******************************************************************************* * Copyright (C) 2007 by the members of PG 510, University of Dortmund: * * d-collide-users@lists.sourceforge.net * * Andreas Beckermann, Christian Bode, Marcel Ens, Sebastian Ens, * * Martin Fassbach, Maximilian Hegele, Daniel Haus, Oliver Horst, * * Gregor Jochmann, Timo Loist, Marcel Nienhaus and Marc Schulz * * * * All rights reserved. * * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions are met:* * - Redistributions of source code must retain the above copyright * * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * * notice, this list of conditions and the following disclaimer in the * * documentation and/or other materials provided with the distribution. * * - Neither the name of the PG510 nor the names of its contributors may be * * used to endorse or promote products derived from this software without * * specific prior written permission. * * * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE * *******************************************************************************/ #include "math/vector.h" #include "math/matrix.h" #include "math/plane.h" #include "real.h" #include "narrowphase/intersectionhelpers.h" #include "dcollide-defines.h" #include "debug.h" #include <math.h> #include <iostream> /* This defines how long an intervall of the radius is: * example: if a circle has a radius of 2, and we have an ACCURACY_ADJUSTMENT of * 0.25, we can divide the radius in 2/0.25 = 8 parts. This means the circle is * approximated by 32 (8 for each quarter) points. * Note that the amount of points is always increased to a power of 2 */ #define CIRCLE_ACCURACY_ADJUSTMENT 0.25 namespace dcollide { IntersectionHelpers::IntersectionHelpers() { } IntersectionHelpers::~IntersectionHelpers() { } /*! * \brief Calcualtes accuracy-level of the circle-approximation * Must be a at least 4 and a power of 2! * Determine a "good" accuracy level, at least 4: * \param radius the radius of the circle we want to approximate * \returns accuracy-level */ int IntersectionHelpers::getAccuracyLevel(real radius) const { int al = 4; if ((radius/CIRCLE_ACCURACY_ADJUSTMENT)*4 > 4) { al = (int)(radius/CIRCLE_ACCURACY_ADJUSTMENT)*4; // adjust to next power: int nv = 2; while (nv < al) { nv *= 2; } al = nv; } return al; } /*! * \brief Calculates circle points * * If radius2 = 0, we assume no top circle, which is the case for e.g. shape * type cone. Currently only radius1=radius2 or radius2 = 0 is supported, * any other value for radius 2 is ignored atm. * * \param radius1 the radius of the bottom circle we want to approximate * \param distance the distance beetween the twao circles we want * \param radius2 the radius of the top circle we want to approximate * \param state The state of the shape the circles belong to * \param bottomPoints contains the returned bottom points * \param topPoints contains the returned top points * \returns accuracy-level */ void IntersectionHelpers::calculateCirclePoints(real radius1, real distance, real radius2,const Matrix& state,Vector3* pointsBottom, Vector3* pointsTop, const int accuracy_level) const { // Get the (unrotated!!) center of the circle on top: Vector3 centerTop = state.getPosition(); centerTop.setZ(centerTop.getZ()+distance); // the center of the bottom circle == position! Vector3 centerBottom = state.getPosition(); // Radius1: real cr = radius1; /* Get the points on the edges of the circles by projecting the centers * to the circle-edges: * * The ordering is like this: * * y * _..--0--.._ ^ * 3_ c _1 | * ''--2--'' | * -------> x ----------------------------------------*/ real bx = centerBottom.getX(); real by = centerBottom.getY(); real bz = centerBottom.getZ(); // We must have at least 4 points for each circle, calculate them: // In these vectors we save the vectors we have to use to calculate the // bisecting lines in each iteration of the bisecting-lines-creator: std::vector<std::pair<int,int> > pairs; std::vector<std::pair<int,int> > pairs_new; std::pair<int,int> pair; pointsBottom[0] = Vector3(bx,by+cr,bz); pair.first = 0; pair.second= 1; pairs.push_back(pair); pointsBottom[1] = Vector3(bx+cr,by,bz); pair.first = 1; pair.second = 2; pairs.push_back(pair); pointsBottom[2] = Vector3(bx,by-cr,bz); pair.first = 2; pair.second = 3; pairs.push_back(pair); pointsBottom[3] = Vector3(bx-cr,by,bz); pair.first = 3; pair.second = 0; pairs.push_back(pair); // now calc. the bottom-offset-vectors, we need them to rotate the // points around the center of the cylinder, not around the global // coordinate system. Vector3* offsetBottom = new Vector3[accuracy_level]; Vector3 offsetBottomTop = centerTop-centerBottom; for (int i=0;i<4;++i) { offsetBottom[i] = pointsBottom[i]-centerBottom; } // create the bisecting lines: int c = 4; std::pair<int,int> p; std::pair<int,int> pn; while (c != accuracy_level) { for (int i = 0; i<(c*2-c);++i) { p = pairs[i]; offsetBottom[i+c] = offsetBottom[p.first]+offsetBottom[p.second]; offsetBottom[i+c].normalize(); offsetBottom[i+c].scale(cr); pn.first = p.first; pn.second = i+c; pairs_new.push_back(pn); pn.first = i+c; pn.second = p.second; pairs_new.push_back(pn); } pairs = pairs_new; pairs_new.clear(); c *= 2; } /* Now rotate the offset-vectors and after that add each one to the * centerBottom point. * The obtained by adding the rotated offset beetween * centerTop and centerBottom to the centerBottom and then add the * previously calc. rotatet offset * ----------------------------------------*/ Matrix rotationMatrix = state.getRotationMatrix(); // Forst rotate the offset vector from bottom to top: Vector3 rotOffset; rotationMatrix.transform(&rotOffset,offsetBottomTop); offsetBottomTop = rotOffset; // Setting the top point if no top circle (cone): if (radius2 == 0) { pointsTop[0] = centerBottom+offsetBottomTop; } for (int i=0; i<accuracy_level;++i) { // Bottom: Vector3 circleOffsetPoint; rotationMatrix.transform(&circleOffsetPoint,offsetBottom[i]); pointsBottom[i] = centerBottom+circleOffsetPoint; // Top, only if radius2 is also != 0! if (radius2 != 0) { pointsTop[i] = centerBottom+offsetBottomTop; pointsTop[i] = pointsTop[i]+circleOffsetPoint; } } // Cleanup delete[] offsetBottom; } /*! * \param planes A box described by its planes * \param point The point to check * \returns true if the given \p point lies inside the given \p planes */ bool IntersectionHelpers::isInsideTheBox(const Plane* planes, const Vector3& point) const { /* we must check all planes to determine wether we have a collision * or not, we have a collision only if the point is beetween ALL * planes! * * All normals are pointing OUTSIDE! (inFrontOf) */ return ( //planes[0].isBehindPlane(point) && planes[0].isInFrontOfPlane(point) && //planes[1].isBehindPlane(point) && planes[1].isInFrontOfPlane(point) && //planes[2].isBehindPlane(point) && planes[2].isInFrontOfPlane(point) && //planes[3].isBehindPlane(point) && planes[3].isInFrontOfPlane(point) && //planes[4].isBehindPlane(point) && planes[4].isInFrontOfPlane(point) && //planes[5].isBehindPlane(point)); planes[5].isInFrontOfPlane(point)); } /*! * \param planes A box described by its planes * \param point The point to check * \param distances Here we can return the distances used by this calc. for * later re-use * \returns true if the given \p point lies inside or on the given \p planes */ bool IntersectionHelpers::isInsideOrOnTheBox(const Plane* planes, const Vector3& point, real (&distances)[6]) const { // First getting the distances: for (int i=0;i<6;++i) { distances[i] = planes[i].calculateDistance(point); } /* we must check all planes to determine wether we have a collision * or not, we have a collision only if the point is beetween ALL * planes! * * All normals are pointing OUTSIDE! (inFrontOf) */ return ( (distances[0] >= 0.0f) && (distances[1] >= 0.0f) && (distances[2] >= 0.0f) && (distances[3] >= 0.0f) && (distances[4] >= 0.0f) && (distances[5] >= 0.0f)); } /*! * \param planes A wedge described by its planes * \param point The point to check * \returns true if the given \p point lies inside the given \p planes */ bool IntersectionHelpers::isInsideTheWedge(const Plane* planes, const Vector3& point) const { /* we must check all planes to determine wether we have a collision or not, we have a collision only if the point is beetween ALL planes! * all normals point outside! * */ return ( planes[0].isBehindPlane(point) && //planes[0].isInFrontOfPlane(point) && planes[1].isBehindPlane(point) && //planes[1].isInFrontOfPlane(point) && planes[2].isBehindPlane(point) && //planes[2].isInFrontOfPlane(point) && planes[3].isBehindPlane(point) && //planes[3].isInFrontOfPlane(point) && planes[4].isBehindPlane(point)); //planes[4].isInFrontOfPlane(point)); } /*! * \param planes A wedge described by its planes * \param point The point to check * \param distance with this param we can return the created distances for * later re-use * \returns true if the given \p point lies inside the given \p planes */ bool IntersectionHelpers::isInsideOrOnTheWedge(const Plane* planes, const Vector3& point, real (&distances)[5]) const { // First getting the distances: for (int i=0;i<5;++i) { distances[i] = planes[i].calculateDistance(point); } /* we must check all planes to determine wether we have a collision * or not, we have a collision only if the point is beetween ALL * planes! * * All normals are pointing OUTSIDE! (inFrontOf) */ return ( (distances[0] <= 0.0f) && (distances[1] <= 0.0f) && (distances[2] <= 0.0f) && (distances[3] <= 0.0f) && (distances[4] <= 0.0f)); } /*! * \brief calculate the penetrationdepth of a collisionpoint * * the pair.first is the penetrationdepth, the pair.second tells you which * one of the planes was finally used to calculate the depth * * \param planes A shape described by its planes * \param sizeOfPlanes The size of the given array * \param point The intersection point * \returns a std::pair<real,int> */ std::pair<real,int> IntersectionHelpers::calculatePenetrationDepth( const Plane* planes, int sizeOfPlanes, const Vector3& intersection) const { real distance = fabs(planes[0].calculateDistance(intersection)); int indexOfPlane = 0; for (int j=1; j<sizeOfPlanes;++j) { real newDistance = fabs(planes[j].calculateDistance(intersection)); if (distance > newDistance) { indexOfPlane = j; distance = newDistance; } } return std::pair<real,int>(distance,indexOfPlane); } /*! * \brief calculate the penetrationdepth of a collisionpoint * * the pair.first is the penetrationdepth, the pair.second tells you which * one of the planes was finally used to calculate the depth * * \param distances previously calc. distances of a point to each plane * \param sizeOfDistances The size of the given array * \returns a std::pair<real,int> */ std::pair<real,int> IntersectionHelpers::calculatePenetrationDepth( const real* distances,int sizeOfDistances) const { real distance = fabs(distances[0]); /*real lastValueNeqZero = distance; // to count how often we had a distance = 0. If this occurs exactly 2 // times, we have a vertex travelling down an edge! // times --> Don't use 0, but the next positive value. int zeroCounter = 0; if (distance == 0) { ++zeroCounter; } */ int indexOfPlane = 0; //std::cout << "D0: " << distance << ";"; for (int j=1; j<sizeOfDistances;++j) { real newDistance = fabs(distances[j]); /*std::cout << "D" << j << ": "<< newDistance << ";"; if (newDistance == 0) { ++zeroCounter; } else { if (newDistance < lastValueNeqZero || lastValueNeqZero == 0) { lastValueNeqZero = newDistance; } }*/ if (distance > newDistance) { indexOfPlane = j; distance = newDistance; } } /*std::cout << "\n\tDistance == 0: " << zeroCounter << " times; distance = " << distance << " lastValueNeqZero = " << lastValueNeqZero << std::endl; if (zeroCounter >= 1 && zeroCounter < 3) { std::cout << "\t\t ADJUSTED distance = " << lastValueNeqZero << std::endl; distance = lastValueNeqZero; } */ return std::pair<real,int>(distance,indexOfPlane); } /*! * \brief calculate the penetrationdepth of a collisionpoint of boxbox * * the pair.first is the penetrationdepth, the pair.second tells you which * one of the planes was finally used to calculate the depth * * \param planes A Box described by its planes * \param sizeOfPlanes The size of the given array * \param centerDiff The difference of the two centers of the boxes * \returns a std::pair<real,int> */ std::pair<real,int> IntersectionHelpers::calculatePenetrationDepth( const Plane* planes, const real* distances,int sizeOfPlanes, const Vector3& centerDiff) const { real cmpdistance = centerDiff.dotProduct(planes[0].getNormal()); int indexOfPlane = 0; for (int j=1; j<sizeOfPlanes;++j) { real newDistance = centerDiff.dotProduct(planes[j].getNormal()); if (cmpdistance > newDistance) { indexOfPlane = j; cmpdistance = newDistance; } } return std::pair<real,int>(distances[indexOfPlane],indexOfPlane); } } /* * vim: et sw=4 ts=4 */
40.392202
87
0.564193
ColinGilbert
322481eb96f697dd11210553d8186567094dc7ed
2,363
cpp
C++
main.cpp
SinaRaoufi/AVLWordTree
87e18951175b9cf93fa9d2323e8df52de2e3c2ab
[ "MIT" ]
null
null
null
main.cpp
SinaRaoufi/AVLWordTree
87e18951175b9cf93fa9d2323e8df52de2e3c2ab
[ "MIT" ]
null
null
null
main.cpp
SinaRaoufi/AVLWordTree
87e18951175b9cf93fa9d2323e8df52de2e3c2ab
[ "MIT" ]
null
null
null
#include <iostream> #include <iomanip> #include "AVLWordTree.hpp" using namespace std; int main() { AVLWordTree tree; // an empty tree cout << "Is tree empty? " << boolalpha << tree.isEmpty() << endl; tree.insert("fig"); // fig cout << "Is tree empty? " << boolalpha << tree.isEmpty() << endl; tree.insert("apple"); // fig // apple tree.insert("banana"); // fig fig // apple ===> banana ===> banana // banana apple apple fig tree.insert("grape"); // banana // apple fig // grape tree.insert("kiwi"); // banana banana // apple fig apple grape // grape ===> fig kiwi // kiwi cout << "PreOrder traversal: "; tree.traversePreOrder(); cout << "InOrder traversal: "; tree.traverseInOrder(); cout << "PostOrder traversal: "; tree.traversePostOrder(); cout << "LevelOrder traversal: "; tree.traverseLevelOrder(); cout << "Is blueberry exist in the tree? " << boolalpha << tree.search("blueberry") << endl; cout << "Is apple exist in the tree? " << boolalpha << tree.search("apple") << endl; cout << "=============================" << endl; tree.remove("apple"); // banana banana grape // apple grape ===> grape ===> banana kiwi // fig kiwi fig kiwi fig cout << "PreOrder traversal: "; tree.traversePreOrder(); cout << "InOrder traversal: "; tree.traverseInOrder(); cout << "PostOrder traversal: "; tree.traversePostOrder(); cout << "LevelOrder traversal: "; tree.traverseLevelOrder(); cout << "Is apple exist in the tree? " << boolalpha << tree.search("apple") << endl; tree.insert("lime"); tree.insert("grapefruit"); auto result = tree.end_with('e'); for (auto &word : result) cout << word << ' '; cout << endl; result = tree.start_with('g'); for (auto &word : result) cout << word << ' '; cout << endl; result = tree.contains("rui"); for (auto &word : result) cout << word << ' '; cout << endl; return 0; }
27.16092
96
0.490478
SinaRaoufi
322538eaab9bfdc0586d6d93e37ef07041b18fe1
5,040
hpp
C++
src/animation.hpp
texierp/easysplash
8885ecad917e4b06da4c447edbd48263a9315955
[ "Apache-2.0", "MIT" ]
1
2021-04-30T22:09:32.000Z
2021-04-30T22:09:32.000Z
src/animation.hpp
texierp/easysplash
8885ecad917e4b06da4c447edbd48263a9315955
[ "Apache-2.0", "MIT" ]
null
null
null
src/animation.hpp
texierp/easysplash
8885ecad917e4b06da4c447edbd48263a9315955
[ "Apache-2.0", "MIT" ]
null
null
null
/* * EasySplash - tool for animated splash screens * Copyright (C) 2014 O.S. Systems Software LTDA. * * SPDX-License-Identifier: Apache-2.0 OR MIT */ #ifndef EASYSPLASH_ANIMATION_HPP #define EASYSPLASH_ANIMATION_HPP #include <cstddef> #include <vector> #include <iostream> #include <functional> #include <condition_variable> #include "display.hpp" #include "types.hpp" #include "zip_archive.hpp" #include "lru_cache.hpp" namespace easysplash { /* animation_position structure: * * This is the current playback position in the frame. It is defined by: * m_part_nr: the number of the part it is currently in * m_part_loop_nr: what loop nr the current position is in (this can only be nonzero if * the part's m_num_times_to_play value is greater than 1) * m_frame_nr_in_part: the frame number inside this part (0 = first frame of this part) */ struct animation_position { unsigned int m_part_nr, m_part_loop_nr; unsigned int m_frame_nr_in_part; animation_position(); }; } namespace std { template < > struct hash < ::easysplash::animation_position > { size_t operator()(::easysplash::animation_position const & p_animation_position) const; }; } // namespace std end namespace easysplash { /* animation structure: * * The animation is defined by a framerate (fps), output width&height, and one or more parts. * the parts, fps and output width & height are read from the desc.txt file in the animation * zip archive. * output width & height defines the size of the rectangle the frames will be painted in. * The rectangle will also be drawn in the center of the screen. * * m_total_num_frames is calculated as the sum of all number of frames of each part, multiplied * by how often the corresponding part is looped. For example, if desc.txt defines three parts, * part 1 with 5 frames and 1 loop, part 2 with 11 frames and 3 loops, part 3 with 6 frames and * 2 loops, m_total_num_frames = 5*1 + 11*3 + 6*2 = 50. * * Parts are defined by a m_play_until_complete flag that indicates if the splash screen * can be stopped immediately or only after this part is done, a m_num_times_to_play value * which defines how often the part shall be played, and an array of zip archive entries which * contain the necessary information to load the individual frame. * * The last part has a special meaning in realtime mode. It will be repeated endlessly, * and the m_num_times_to_play value is ignored. m_play_until_complete is also ignored; * the animation will behave as if m_play_until_complete were false. */ class animation { public: struct part { bool m_play_until_complete; unsigned int m_num_times_to_play; std::vector < zip_archive::entry const * > m_frames; part(); }; explicit animation(zip_archive &p_zip_archive, display &p_display); std::size_t get_num_parts() const; part const * get_part(std::size_t const p_index) const; unsigned int get_fps() const; unsigned int get_total_num_frames() const; long get_output_width() const; long get_output_height() const; /* Retrieves the image handle for the frame at the given position. If no frame can be * found, display::invalid_image_handle is returned. */ display::image_handle get_image_handle_at(animation_position const &p_animation_position); private: animation(animation const &) = delete; animation& operator = (animation const &) = delete; std::vector < part > m_parts; unsigned int m_fps; unsigned int m_total_num_frames; long m_output_width, m_output_height; zip_archive &m_zip_archive; display &m_display; typedef lru_cache < animation_position, display::image_handle > image_handle_cache; image_handle_cache m_image_handle_cache; }; bool operator < (animation_position const &p_first, animation_position const &p_second); bool operator == (animation_position const &p_first, animation_position const &p_second); bool operator != (animation_position const &p_first, animation_position const &p_second); std::ostream& operator << (std::ostream &p_out, animation_position const &p_animation_position); /* Checks if the animation is valid. An animation is valid if it has at least one part, * and the m_fps, m_output_width, m_output_height values are nonzero. */ bool is_valid(animation const &p_animation); /* Loads the animation from a zip archive and allocates images in the display for each frame. * If loading fails, the returned animation object will be invalid. Check with is_valid() for that. */ animation load_animation(zip_archive &p_zip_archive, display &p_display); /* Advances the position by calling update_position() and a given number of frames to * advance. If m_part_nr refers to the last part in the frame, and the positiion would * be advanced beyond the bounds of that part, it loops back, as if m_num_times_to_play * were set to some infinite value for the last part. */ void update_position(animation_position &p_animation_position, animation const &p_animation, unsigned int const p_increase); } // namespace easysplash end #endif
31.111111
124
0.763095
texierp
322938883b8d8ab44d7588fd247252f0a2d4ae88
13,796
cpp
C++
src/arboretum/stSeqNode.cpp
marcosivni/arboretum
329147b2d147903bc8e527fc3dcfe2349141725a
[ "Apache-2.0" ]
null
null
null
src/arboretum/stSeqNode.cpp
marcosivni/arboretum
329147b2d147903bc8e527fc3dcfe2349141725a
[ "Apache-2.0" ]
null
null
null
src/arboretum/stSeqNode.cpp
marcosivni/arboretum
329147b2d147903bc8e527fc3dcfe2349141725a
[ "Apache-2.0" ]
null
null
null
/* Copyright 2003-2017 GBDI-ICMC-USP <caetano@icmc.usp.br> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file * * This file implements the SeqTree nodes. * * @version 1.0 * @author Fabio Jun Takada Chino (chino@icmc.usp.br) * @author Marcos Rodrigues Vieira (mrvieira@icmc.usp.br) * @author Josiel Maimone de Figueiredo (josiel@icmc.usp.br) */ #include <arboretum/stSeqNode.h> //------------------------------------------------------------------------------ // class stSeqNode //------------------------------------------------------------------------------ stSeqNode * stSeqNode::CreateNode(stPage * page){ stSeqNode::stSeqNodeHeader * header; header = (stSeqNodeHeader *)(page->GetData()); switch (header->Type){ case INDEX: // Create an index page return new stSeqIndexNode(page, false); case LEAF: // Create a leaf page return new stSeqLeafNode(page, false); default: return NULL; }//end switch }//end stSeqNode::CreateNode() //------------------------------------------------------------------------------ // class stSeqIndexNode //------------------------------------------------------------------------------ stSeqIndexNode::stSeqIndexNode(stPage * page, bool create): stSeqNode(page){ // Attention to this manouver! It is the brain of this // implementation. Entries = (stSeqIndexEntry *)(page->GetData() + sizeof(stSeqNodeHeader)); // Initialize page if (create){ #ifdef __stDEBUG__ Page->Clear(); #endif //__stDEBUG__ this->Header->Type = INDEX; this->Header->Occupation = 0; }//end if }//end stSeqIndexNode::stSeqIndexNode() //------------------------------------------------------------------------------ int stSeqIndexNode::AddEntry(u_int32_t size, const unsigned char * object){ u_int32_t entrysize; #ifdef __stDEBUG__ if (size == 0){ throw invalid_argument("The object size is 0."); }//end if #endif //__stDEBUG__ // Does it fit ? entrysize = size + sizeof(stSeqIndexEntry); if (entrysize > this->GetFree()){ // No, it doesn't. return -1; }//end if // Ok. I can put it. Lets put it in the last position. // Adding the object. Take care with these pointers or you will destroy the // node. The idea is to put the object of an entry in the reverse order // in the data array. if (Header->Occupation == 0){ Entries[Header->Occupation].Offset = Page->GetPageSize() - size; }else{ Entries[Header->Occupation].Offset = Entries[Header->Occupation - 1].Offset - size; }//end if memcpy((void *)(Page->GetData() + Entries[Header->Occupation].Offset), (void *)object, size); // Update # of entries Header->Occupation++; // One more! return Header->Occupation - 1; }//end stSeqIndexNode::AddEntry() //------------------------------------------------------------------------------ int stSeqIndexNode::GetRepresentativeEntry(){ u_int32_t i; bool stop; // Looking for it i = 0; stop = (i == Header->Occupation); while (!stop){ if (Entries[i].Distance == 0.0){ // Found! stop = true; }else{ // Next... i++; stop = (i == Header->Occupation); }//end if }//end while // Output if (i == Header->Occupation){ // Empty or not found. return -1; }else{ // Found! return i; }//end if }//end stSeqIndexNode::GetRepresentativeEntry() //------------------------------------------------------------------------------ const unsigned char * stSeqIndexNode::GetObject(u_int32_t idx){ #ifdef __stDEBUG__ if (idx >= GetNumberOfEntries()){ throw invalid_argument("idx value is out of range."); }//end if #endif //__stDEBUG__ return Page->GetData() + Entries[idx].Offset; }//end stSeqIndexNode::GetObject() //------------------------------------------------------------------------------ u_int32_t stSeqIndexNode::GetObjectSize(u_int32_t idx){ #ifdef __stDEBUG__ if (idx >= GetNumberOfEntries()){ throw invalid_argument("idx value is out of range."); }//end if #endif //__stDEBUG__ if (idx == 0){ // First object return Page->GetPageSize() - Entries[0].Offset; }else{ // Any other return Entries[idx - 1].Offset - Entries[idx].Offset; }//end if }//end stSeqIndexNode::GetObjectSize() //------------------------------------------------------------------------------ void stSeqIndexNode::RemoveEntry(u_int32_t idx){ u_int32_t rObjSize; u_int32_t i, lastID; // Programmer's note: This procedure is simple but tricky! See the // SeqIndexNode structure documentation for more details. #ifdef __stDEBUG__ if (idx >= GetNumberOfEntries()){ // Oops! This idx doesn't exists. throw range_error("idx is out of range."); }//end if #endif //__stDEBUG__ // Let's remove lastID = Header->Occupation - 1; // The idx of the last object. This // value will be very useful. // Do I need to move something ? if (idx != lastID){ // Yes, I do. rObjSize = GetObjectSize(idx); // Save the removed object size // Let's move objects first. We will use memmove() from stdlib because // it handles the overlap between src and dst. Remember that src is the // offset of the last object and the dst is the offset of the last // object plus removed object size. memmove(Page->GetData() + Entries[lastID].Offset + rObjSize, Page->GetData() + Entries[lastID].Offset, Entries[idx].Offset - Entries[lastID].Offset); // Let's move entries... for (i = idx; i < lastID; i++){ // Copy all fields with memcpy (it's faster than field copy). memcpy(Entries + i, Entries + i + 1, sizeof(stSeqIndexEntry)); // Update offset by adding the removed object size to it. It will // reflect the previous move operation. Entries[i].Offset += rObjSize; }//end for }//end if // Update counter... Header->Occupation--; }//end stSeqIndexNode::RemoveEntry() //------------------------------------------------------------------------------ u_int32_t stSeqIndexNode::GetFree(){ u_int32_t usedsize; // Fixed size usedsize = sizeof(stSeqNodeHeader); // Entries if (GetNumberOfEntries() > 0){ usedsize += // Total size of entries (sizeof(stSeqIndexEntry) * GetNumberOfEntries()) + // Total object size (Page->GetPageSize() - Entries[GetNumberOfEntries() - 1].Offset); }//end if return Page->GetPageSize() - usedsize; }//end stSeqIndexNode::GetFree() //------------------------------------------------------------------------------ double stSeqIndexNode::GetMinimumRadius(){ double minRadius = 0; double distance; u_int32_t i; // For each entry. for (i = 0; i < GetNumberOfEntries(); i++){ distance = GetIndexEntry(i).Distance + GetIndexEntry(i).Radius; if (minRadius < distance){ minRadius = distance; }//end if }//end for return minRadius; }//end stSeqIndexNode::GetMinimumRadius //------------------------------------------------------------------------------ // class stSeqLeafNode //------------------------------------------------------------------------------ stSeqLeafNode::stSeqLeafNode(stPage * page, bool create): stSeqNode(page){ // Attention to this manouver! It is the brain of this // implementation. Entries = (stSeqLeafEntry*)(page->GetData() + sizeof(stSeqNodeHeader)); // Initialize page if (create){ #ifdef __stDEBUG__ Page->Clear(); #endif //__stDEBUG__ this->Header->Type = LEAF; this->Header->Occupation = 0; }//end if }//end stSeqLeafNode::stSeqLeafNode() //------------------------------------------------------------------------------ int stSeqLeafNode::AddEntry(u_int32_t size, const unsigned char * object){ u_int32_t entrySize; #ifdef __stDEBUG__ if (size == 0){ throw invalid_argument("The object size is 0."); }//end if #endif //__stDEBUG__ // Does it fit ? entrySize = size + sizeof(stSeqLeafEntry); if (entrySize > this->GetFree()){ // No, it doesn't. return -1; }//end if // Ok. I can put it. Lets put it in the last position. // Adding the object. Take care with these pointers or you will destroy the // node. The idea is to put the object of an entry in the reverse order // in the data array. if (Header->Occupation == 0){ Entries[Header->Occupation].Offset = Page->GetPageSize() - size; }else{ Entries[Header->Occupation].Offset = Entries[Header->Occupation - 1].Offset - size; }//end if memcpy((void *)(Page->GetData() + Entries[Header->Occupation].Offset), (void *)object, size); // Update # of entries Header->Occupation++; // One more! return Header->Occupation - 1; }//end stSeqLeafNode::AddEntry() //------------------------------------------------------------------------------ int stSeqLeafNode::GetRepresentativeEntry(){ u_int32_t i; bool stop; // Looking for it i = 0; stop = (i == Header->Occupation); while (!stop){ if (Entries[i].Distance == 0.0){ // Found! stop = true; }else{ // Next... i++; stop = (i == Header->Occupation); }//end if }//end while // Output if (i == Header->Occupation){ // Empty or not found. return -1; }else{ // Found! return i; }//end if }//end stSeqLeafNode::GetRepresentativeEntry() //------------------------------------------------------------------------------ const unsigned char * stSeqLeafNode::GetObject(u_int32_t idx){ #ifdef __stDEBUG__ if (idx >= GetNumberOfEntries()){ throw invalid_argument("idx value is out of range."); }//end if #endif //__stDEBUG__ return Page->GetData() + Entries[idx].Offset; }//end stSeqLeafNode::GetObject() //------------------------------------------------------------------------------ u_int32_t stSeqLeafNode::GetObjectSize(u_int32_t idx){ #ifdef __stDEBUG__ if (idx >= GetNumberOfEntries()){ throw invalid_argument("idx value is out of range."); }//end if #endif //__stDEBUG__ if (idx == 0){ // First object return Page->GetPageSize() - Entries[0].Offset; }else{ // Any other return Entries[idx - 1].Offset - Entries[idx].Offset; }//end if }//end stSeqLeafIndexNode::GetObjectSize() //------------------------------------------------------------------------------ void stSeqLeafNode::RemoveEntry(u_int32_t idx){ u_int32_t lastID; u_int32_t i; u_int32_t rObjSize; // Programmer's note: This procedure is simple but tricky! See the // SeqIndexNode structure documentation for more details. #ifdef __stDEBUG__ if (idx >= GetNumberOfEntries()){ // Oops! This idx doesn't exists. throw range_error("idx value is out of range."); }//end if #endif //__stDEBUG__ // Let's remove lastID = Header->Occupation - 1; // The idx of the last object. This // value will be very useful. // Do I need to move something ? if (idx != lastID){ // Yes, I do. rObjSize = GetObjectSize(idx); // Save the removed object size // Let's move objects first. We will use memmove() from stdlib because // it handles the overlap between src and dst. Remember that src is the // offset of the last object and the dst is the offset of the last // object plus removed object size. memmove(Page->GetData() + Entries[lastID].Offset + rObjSize, Page->GetData() + Entries[lastID].Offset, Entries[idx].Offset - Entries[lastID].Offset); // Let's move entries... for (i = idx; i < lastID; i++){ // Copy all fields with memcpy (it's faster than field copy). memcpy(Entries + i, Entries + i + 1, sizeof(stSeqLeafEntry)); // Update offset by adding the removed object size to it. It will // reflect the previous move operation. Entries[i].Offset += rObjSize; }//end for }//end if // Update counter... Header->Occupation--; }//end stSeqLeafNode::RemoveEntry //------------------------------------------------------------------------------ double stSeqLeafNode::GetMinimumRadius(){ u_int32_t i; double radius = 0; for (i = 0; i < GetNumberOfEntries(); i++){ if (radius < GetLeafEntry(i).Distance){ radius = GetLeafEntry(i).Distance; }//end if }//end for return radius; }//end stSeqLeafNode::GetMinimumRadius //------------------------------------------------------------------------------ u_int32_t stSeqLeafNode::GetFree(){ u_int32_t usedSize; // Fixed size usedSize = sizeof(stSeqNodeHeader); // Entries if (GetNumberOfEntries() > 0){ usedSize += // Total size of entries (sizeof(stSeqLeafEntry) * GetNumberOfEntries()) + // Total object size (Page->GetPageSize() - Entries[GetNumberOfEntries() - 1].Offset); }//end if return Page->GetPageSize() - usedSize; }//end stSeqLeafNode::GetFree()
31.788018
89
0.557553
marcosivni
322adaa924d386a395e11b59cc96dc8a89a0460e
1,916
cc
C++
test/server/listener_socket_option_impl_test.cc
wrowe/envoy
e785478be30a55db518c8cf1d9366859cb74d216
[ "Apache-2.0" ]
null
null
null
test/server/listener_socket_option_impl_test.cc
wrowe/envoy
e785478be30a55db518c8cf1d9366859cb74d216
[ "Apache-2.0" ]
null
null
null
test/server/listener_socket_option_impl_test.cc
wrowe/envoy
e785478be30a55db518c8cf1d9366859cb74d216
[ "Apache-2.0" ]
null
null
null
#include "server/listener_socket_option_impl.h" #include "test/common/network/socket_option_test.h" namespace Envoy { namespace Server { class ListenerSocketOptionImplTest : public Network::SocketOptionTest { public: void testSetSocketOptionSuccess(ListenerSocketOptionImpl& socket_option, int socket_level, Network::SocketOptionName option_name, int option_val, const std::set<Network::Socket::SocketState>& when) { Network::SocketOptionTest::testSetSocketOptionSuccess(socket_option, socket_level, option_name, option_val, when); } }; // We fail to set the tcp-fastopen option when the underlying setsockopt syscall fails. TEST_F(ListenerSocketOptionImplTest, SetOptionTcpFastopenFailure) { if (ENVOY_SOCKET_TCP_FASTOPEN.has_value()) { ListenerSocketOptionImpl socket_option{{}, {}, 1}; EXPECT_CALL(os_sys_calls_, setsockopt_(_, IPPROTO_TCP, ENVOY_SOCKET_TCP_FASTOPEN.value(), _, _)) .WillOnce(Return(-1)); EXPECT_FALSE(socket_option.setOption(socket_, Network::Socket::SocketState::Listening)); } } // The happy path for setOption(); TCP_FASTOPEN is set to true. TEST_F(ListenerSocketOptionImplTest, SetOptionTcpFastopenSuccessTrue) { ListenerSocketOptionImpl socket_option{{}, {}, 42}; testSetSocketOptionSuccess(socket_option, IPPROTO_TCP, ENVOY_SOCKET_TCP_FASTOPEN, 42, {Network::Socket::SocketState::Listening}); } // The happy path for setOption(); TCP_FASTOPEN is set to false. TEST_F(ListenerSocketOptionImplTest, SetOptionTcpFastopenSuccessFalse) { ListenerSocketOptionImpl socket_option{{}, {}, 0}; testSetSocketOptionSuccess(socket_option, IPPROTO_TCP, ENVOY_SOCKET_TCP_FASTOPEN, 0, {Network::Socket::SocketState::Listening}); } } // namespace Server } // namespace Envoy
43.545455
100
0.716075
wrowe
7a8c836a34b62a05f010a32b78575184a82313cf
458
cpp
C++
test/example.cpp
dermojo/spsl
68f9ae6f50f7b94601f0b8e7cbc47f553345e836
[ "MIT" ]
null
null
null
test/example.cpp
dermojo/spsl
68f9ae6f50f7b94601f0b8e7cbc47f553345e836
[ "MIT" ]
25
2016-11-06T20:51:06.000Z
2022-02-26T15:43:17.000Z
test/example.cpp
dermojo/spsl
68f9ae6f50f7b94601f0b8e7cbc47f553345e836
[ "MIT" ]
1
2019-07-16T00:37:11.000Z
2019-07-16T00:37:11.000Z
/** * @file Special Purpose Strings Library: example.cpp * @author Daniel Evers * @brief Simple usage examples * @license MIT */ #include <spsl.hpp> int main(int, const char**) { spsl::ArrayString<64> a1("I'm a stack-based string and can store 64 characters + NUL"); spsl::ArrayStringW<32> a2(L"Wide characters are ok, too."); spsl::PasswordString pw1("I'm a secret!"); spsl::PasswordStringW pw2(L"Dream on..."); return 0; }
25.444444
91
0.655022
dermojo
7a95a74430682830236a4a74ef2832ad2cb507e0
6,853
hpp
C++
src/widgets/widget_layer_spacefill.hpp
DisQS/AniMolViewer
c56293067672a453a3cf3490c0e86004df0130dc
[ "BSD-3-Clause" ]
2
2021-11-21T23:26:00.000Z
2021-12-18T10:33:17.000Z
src/widgets/widget_layer_spacefill.hpp
DisQS/AniMolViewer
c56293067672a453a3cf3490c0e86004df0130dc
[ "BSD-3-Clause" ]
5
2021-11-28T18:26:25.000Z
2021-12-06T08:15:06.000Z
src/widgets/widget_layer_spacefill.hpp
DisQS/animol-viewer
c56293067672a453a3cf3490c0e86004df0130dc
[ "BSD-3-Clause" ]
null
null
null
#pragma once #include <array> #include <type_traits> #include "plate.hpp" #include "widgets/widget_spheres.hpp" #include "widgets/anim_alpha.hpp" #include "widget_layer.hpp" namespace animol { template<class M> class widget_layer_spacefill : public widget_layer<M> { public: ~widget_layer_spacefill() { clear(); } void init(const std::shared_ptr<plate::state>& _ui, plate::gpu::int_box& coords, const std::shared_ptr<plate::ui_event_destination>& parent, M* main) noexcept override { plate::ui_event_destination::init(_ui, coords, plate::ui_event_destination::Prop::Display, parent); main_ = main; start(); } int get_loaded_count() const noexcept override { return loaded_count_; } inline bool has_frame(int frame_id) noexcept override { if (main_->is_remote()) return store_[0][frame_id].ibuf.is_ready() && store_[1][frame_id].ibuf.is_ready(); else return store_[0][frame_id].ibuf.is_ready(); } bool set_frame(int frame_id) noexcept override { if (!has_frame(frame_id)) return false; if (widget_spheres_[0]) widget_spheres_[0]->set_instance_ptr(&(store_[0][frame_id].ibuf), &(store_[0][frame_id].vao)); if (widget_spheres_[1]) widget_spheres_[1]->set_instance_ptr(&(store_[1][frame_id].ibuf), &(store_[1][frame_id].vao)); return true; } std::string_view name() const noexcept override { return "layer_spacefill"; } private: void start() noexcept { clear(); if (main_->get_total_frames() <= 0) return; widget_spheres_[0] = plate::ui_event_destination::make_ui<plate::widget_spheres>(this->ui_, this->coords_, this->shared_from_this(), main_->get_shared_ubuf()); if (main_->is_remote()) widget_spheres_[1] = plate::ui_event_destination::make_ui<plate::widget_spheres>(this->ui_, this->coords_, this->shared_from_this(), main_->get_shared_ubuf()); store_[0].resize(main_->get_total_frames()); store_[1].resize(main_->get_total_frames()); // setup the load order- from current_frame for (int i = main_->get_current_frame(); i < main_->get_total_frames(); ++i) to_load_.push(i); for (int i = main_->get_current_frame() - 1; i >= 0; --i) to_load_.push(i); for (int i = 0; i < worker::get_max_workers(); ++i) process_next(); } void process_next() noexcept { if (to_load_.empty()) // nothing left to ask for return; auto to_load = to_load_.front(); to_load_.pop(); auto per_frame_files = main_->get_frame_files(); if (!main_->is_remote()) { main_->worker_->call("visualise_atoms_url", per_frame_files[to_load], [this, wself{this->weak_from_this()}, entry = to_load] (std::span<char> d) { if (auto w = wself.lock()) { emscripten_webgl_make_context_current(this->ui_->ctx_); std::span<plate::widget_spheres::inst> s(reinterpret_cast<plate::widget_spheres::inst*>(d.data()), d.size() / sizeof(plate::widget_spheres::inst)); process_frame(entry, s, 0); } }); } else // remote { std::string u1 = main_->get_url() + main_->get_item() + "/" + per_frame_files[to_load]; std::string u2 = main_->get_url() + main_->get_item() + "/nonCA_" + per_frame_files[to_load]; main_->worker_->call("visualise_atoms_url", u1, [this, wself{this->weak_from_this()}, entry = to_load] (std::span<char> d) { if (auto w = wself.lock()) { emscripten_webgl_make_context_current(this->ui_->ctx_); std::span<plate::widget_spheres::inst> s(reinterpret_cast<plate::widget_spheres::inst*>(d.data()), d.size() / sizeof(plate::widget_spheres::inst)); process_frame(entry, s, 0); } }); main_->worker_->call("visualise_atoms_url", u2, [this, wself{this->weak_from_this()}, entry = to_load] (std::span<char> d) { if (auto w = wself.lock()) { emscripten_webgl_make_context_current(this->ui_->ctx_); std::span<plate::widget_spheres::inst> s(reinterpret_cast<plate::widget_spheres::inst*>(d.data()), d.size() / sizeof(plate::widget_spheres::inst)); process_frame(entry, s, 1); } }); } } void process_frame(int entry, std::span<plate::widget_spheres::inst> s, int layer) noexcept { if (!main_->scale_has_been_set() && !s.empty()) { int max = 0; for (auto& s_entry : s) { if (abs(s_entry.offset[0]) > max) max = abs(s_entry.offset[0]); if (abs(s_entry.offset[1]) > max) max = abs(s_entry.offset[1]); if (abs(s_entry.offset[2]) > max) max = abs(s_entry.offset[2]); } log_debug(FMT_COMPILE("received: {} atoms max width: {}"), s.size(), max); if (max) main_->set_scale((std::min(this->my_width(), this->my_height())/2.0) * (32'768.0 / max) * 0.8); } store_[layer][entry].ibuf.upload(s.data(), s.size()); if (main_->get_current_frame() == entry) // we've caught up with main frame position set_frame(entry); if ((main_->is_remote() && layer == 1) || (!main_->is_remote())) { ++loaded_count_; if (loaded_count_ == main_->get_total_frames()) log_debug(FMT_COMPILE("all loaded: {} atoms: {}"), loaded_count_, s.size()); main_->update_loading(); process_next(); } } void clear() { std::queue<int> x; x.swap(to_load_); loaded_count_ = 0; if (widget_spheres_[0]) { widget_spheres_[0]->disconnect_from_parent(); widget_spheres_[0].reset(); } if (widget_spheres_[1]) { widget_spheres_[1]->disconnect_from_parent(); widget_spheres_[1].reset(); } for (auto& s : store_[0]) if (s.vao) glDeleteVertexArrays(1, &s.vao); store_[0].clear(); for (auto& s : store_[1]) if (s.vao) glDeleteVertexArrays(1, &s.vao); store_[1].clear(); } std::shared_ptr<plate::widget_spheres> widget_spheres_[2]; struct frame { plate::buffer<plate::widget_spheres::inst> ibuf; std::uint32_t vao{0}; }; std::vector<frame> store_[2]; // each frame's vertex and vertex_strip buffer is stored here std::queue<int> to_load_; // the order in which to request frames int loaded_count_{0}; M* main_{nullptr}; // tha main widget }; // class widget_layer_spacefill } // namespace animol
26.66537
150
0.584562
DisQS
7a95c9cf5b65453dff00f81258d0de83284eecb4
2,130
cpp
C++
test/StringTest.cpp
maxvu/busboy
4faed5638e81003d99a68ed68c0db32ffca2be9d
[ "MIT" ]
1
2016-04-11T21:48:54.000Z
2016-04-11T21:48:54.000Z
test/StringTest.cpp
maxvu/busboy
4faed5638e81003d99a68ed68c0db32ffca2be9d
[ "MIT" ]
null
null
null
test/StringTest.cpp
maxvu/busboy
4faed5638e81003d99a68ed68c0db32ffca2be9d
[ "MIT" ]
null
null
null
#include "catch/catch.hpp" #include "String.hpp" using busboy::String; TEST_CASE( "String access", "[String]" ) { SECTION( "Construction, equality" ) { String one = "one"; String two = "two"; CHECK( one.getLength() == 3 ); CHECK( one.getCapacity() >= 3 ); CHECK( one.operator==( "one" ) ); CHECK( one.operator==( String( one ) ) ); CHECK( !one.operator!=( "one" ) ); CHECK( !one.operator==( "two" ) ); CHECK( one.operator!=( two ) ); CHECK( one.operator<( two ) ); CHECK( one.operator<= ( two ) ); CHECK( two.operator>( one ) ); CHECK( two.operator>=( one ) ); String anotherOne( one ); CHECK( one.operator==( anotherOne ) ); } SECTION( "Concatenation" ) { CHECK( ( String( "Hello" ) + String( ", World!" ) ).operator==( "Hello, World!" ) ); CHECK( ( String( "Hello" ) += String( ", World!" ) ).operator==( "Hello, World!" ) ); CHECK( ( String( "Hello" ) + ", World!" ).operator==( "Hello, World!" ) ); CHECK( ( String( "Hello" ) += ", World!" ).operator==( "Hello, World!" ) ); } SECTION( "Assignment, reservation, compaction" ) { String msg; msg = "Hello, World!"; CHECK( msg.getLength() == 13 ); msg.compact(); CHECK( msg.getLength() == 13 ); msg.reserve( 23 ); CHECK( msg.getCapacity() >= 23 ); msg.compact(); CHECK( msg.getLength() == 13 ); CHECK( msg.getCapacity() == 13 ); CHECK( msg.operator==( "Hello, World!" ) ); } SECTION( "Subscript access" ) { String msg( "Hello, World!" ); CHECK( msg[ 0 ] == 'H' ); CHECK( msg[ 1 ] == 'e' ); CHECK( msg[ 2 ] == 'l' ); CHECK( msg[ 3 ] == 'l' ); CHECK( msg[ 4 ] == 'o' ); CHECK( msg[ 12 ] == '!' ); CHECK_THROWS( msg[ 13 ] ); } }
22.903226
69
0.429108
maxvu
7a9b48579ee79e754b24089e0ce91447d1271350
1,112
cpp
C++
SDKs/CryCode/3.7.0/GameDll/uberfiles/GameSDK_7_uber.cpp
amrhead/FireNET
34d439aa0157b0c895b20b2b664fddf4f9b84af1
[ "BSD-2-Clause" ]
4
2017-12-18T20:10:16.000Z
2021-02-07T21:21:24.000Z
SDKs/CryCode/3.7.0/GameDll/uberfiles/GameSDK_7_uber.cpp
amrhead/FireNET
34d439aa0157b0c895b20b2b664fddf4f9b84af1
[ "BSD-2-Clause" ]
null
null
null
SDKs/CryCode/3.7.0/GameDll/uberfiles/GameSDK_7_uber.cpp
amrhead/FireNET
34d439aa0157b0c895b20b2b664fddf4f9b84af1
[ "BSD-2-Clause" ]
3
2019-03-11T21:36:15.000Z
2021-02-07T21:21:26.000Z
#ifdef _DEVIRTUALIZE_ #include <GameSDK_devirt_defines.h> #endif #include "../Utility/AttachmentUtils.cpp" #include "../PlayerAnimation.cpp" #include "../StickyProjectile.cpp" #include "../UI/HUD/HUDControllerInputIcons.cpp" #include "../UI/HUD/HUDEventDispatcher.cpp" #include "../UI/HUD/HUDEventTranslator.cpp" #include "../UI/HUD/HUDEventWrapper.cpp" #include "../UI/HUD/HUDMissionObjectiveSystem.cpp" #include "../UI/HUD/HUDOnScreenMessageDef.cpp" #include "../UI/HUD/HUDSilhouettes.cpp" #include "../UI/HUD/HUDUtils.cpp" #include "../UI/HUD/ScriptBind_HUD.cpp" #include "../UI/HUD/TacticalOverrideEntity.cpp" #include "../UI/Menu3dModels/FrontEndModelCache.cpp" #include "../UI/Menu3dModels/MenuRender3DModelMgr.cpp" #include "../UI/Option.cpp" #include "../UI/ProfileOptions.cpp" #include "../UI/UICVars.cpp" #include "../UI/UIDialogs.cpp" #include "../UI/UIEntityDynTexTag.cpp" #include "../UI/UIEntityTag.cpp" #include "../UI/UIGameEvents.cpp" #include "../UI/UIHUD3D.cpp" #include "../UI/UIInput.cpp" #include "../UI/UILobbyMP.cpp" #ifdef _DEVIRTUALIZE_ #include <GameSDK_wrapper_includes.h> #endif
32.705882
54
0.742806
amrhead
7aa1c363983585b236897b78568c1da965c70ff9
385
hpp
C++
falcon/mpl/key_type.hpp
jonathanpoelen/falcon
5b60a39787eedf15b801d83384193a05efd41a89
[ "MIT" ]
2
2018-02-02T14:19:59.000Z
2018-05-13T02:48:24.000Z
falcon/mpl/key_type.hpp
jonathanpoelen/falcon
5b60a39787eedf15b801d83384193a05efd41a89
[ "MIT" ]
null
null
null
falcon/mpl/key_type.hpp
jonathanpoelen/falcon
5b60a39787eedf15b801d83384193a05efd41a89
[ "MIT" ]
null
null
null
#ifndef FALCON_MPL_KEY_TYPE_HPP #define FALCON_MPL_KEY_TYPE_HPP #include <falcon/mpl/key_type_fwd.hpp> #include <falcon/mpl/sequence_tag.hpp> namespace falcon { namespace mpl { template<typename AssociativeSequence, typename Key> struct key_type { using type = key_type_impl<sequence_tag_t<AssociativeSequence>> ::template apply<AssociativeSequence, Key>::type; }; } } #endif
18.333333
65
0.794805
jonathanpoelen
7aa35115ccb108f020cb6952ce61080d7277556b
2,489
cpp
C++
test/algorithms/dp/test_knapsack_problem.cpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
2
2020-07-31T14:13:56.000Z
2021-02-03T09:51:43.000Z
test/algorithms/dp/test_knapsack_problem.cpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
28
2015-09-22T07:38:21.000Z
2018-10-02T11:00:58.000Z
test/algorithms/dp/test_knapsack_problem.cpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
2
2018-10-11T14:10:50.000Z
2021-02-27T08:53:50.000Z
#include <boost/test/unit_test.hpp> #include "algorithms/dp/knapsack_problem.hpp" #include "common/equality.hpp" BOOST_AUTO_TEST_SUITE(KnapsakProblem) BOOST_AUTO_TEST_CASE(greedy_test) { { std::vector<std::pair<uint32_t, uint32_t>> items = { {10, 10}, {5, 100}, {15, 3} }; uint32_t maxWeight = 20; double expectedResult = 25.35; BOOST_CHECK( equal(Algo::DP::Knapsack::FillGreedy(maxWeight, items), expectedResult)); } { std::vector<std::pair<uint32_t, uint32_t>> items = { {60, 20}, {100, 50}, {120, 30} }; uint32_t maxWeight = 50; double expectedResult = 180.0; BOOST_CHECK( equal(Algo::DP::Knapsack::FillGreedy(maxWeight, items), expectedResult)); } { std::vector<std::pair<uint32_t, uint32_t>> items = { {500, 30} }; uint32_t maxWeight = 10; const double expectedResult = 166.6667; const double result = Algo::DP::Knapsack::FillGreedy(maxWeight, items); BOOST_CHECK(equalDoubles(result, expectedResult, 0.0001)); } { std::vector<std::pair<uint32_t, uint32_t>> items = { {100, 5}, {100, 5} }; uint32_t maxWeight = 10; const double expectedResult = 200; const double result = Algo::DP::Knapsack::FillGreedy(maxWeight, items); BOOST_CHECK(equalDoubles(result, expectedResult, 0.0001)); } } BOOST_AUTO_TEST_CASE(dp_without_repetitions_test) { { std::vector<std::pair<uint32_t, uint32_t>> items; uint32_t maxWeight = 20; uint32_t expected = 0; BOOST_CHECK(Algo::DP::Knapsack::FillDP(maxWeight, items) == expected); } { std::vector<std::pair<uint32_t, uint32_t>> items = {{1, 1}}; uint32_t maxWeight = 0; uint32_t expected = 0; BOOST_CHECK(Algo::DP::Knapsack::FillDP(maxWeight, items) == expected); } { std::vector<std::pair<uint32_t, uint32_t>> items = { {1, 1}, {4, 4}, {8, 8}}; uint32_t maxWeight = 10; uint32_t expected = 9; BOOST_CHECK(Algo::DP::Knapsack::FillDP(maxWeight, items) == expected); } { std::vector<std::pair<uint32_t, uint32_t>> items = { {6, 6}, {3, 3}, {4, 4}, {2, 2}}; uint32_t maxWeight = 10; uint32_t expected = 10; BOOST_CHECK(Algo::DP::Knapsack::FillDP(maxWeight, items) == expected); } } BOOST_AUTO_TEST_SUITE_END()
29.630952
85
0.586581
iamantony