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
108
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
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
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
4b6f9ef0f862da502aaa6a2bd64d1b87072fd18e
2,606
cpp
C++
mbed-glove-firmware/drivers/collector.cpp
apadin1/Team-GLOVE
d5f5134da79d050164dffdfdf87f12504f6b1370
[ "Apache-2.0" ]
null
null
null
mbed-glove-firmware/drivers/collector.cpp
apadin1/Team-GLOVE
d5f5134da79d050164dffdfdf87f12504f6b1370
[ "Apache-2.0" ]
null
null
null
mbed-glove-firmware/drivers/collector.cpp
apadin1/Team-GLOVE
d5f5134da79d050164dffdfdf87f12504f6b1370
[ "Apache-2.0" ]
1
2019-01-09T05:16:42.000Z
2019-01-09T05:16:42.000Z
/* * Filename: collector.cpp * Project: EECS 473 - Team GLOVE * Date: Fall 2016 * Authors: * Nick Bertoldi * Ben Heckathorn * Ryan O’Keefe * Adrian Padin * Tim Schumacher * * Purpose: * Implementation of collector.h * * Copyright (c) 2016 by Nick Bertoldi, Ben Heckathorn, Ryan O'Keefe, * Adrian Padin, Timothy Schumacher * * 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 "collector.h" #include "string.h" Collector::Collector(FlexSensors& _flex, IMU_BNO055& _imu, TouchSensor& _touch, AdvertBLE& _adble) : flex(_flex), imu(_imu), touch(_touch), adble(_adble) { flex_data = glove_data.flex_sensors; // ptr to the first flex_sensor_t touch_data = &(glove_data.touch_sensor); // ptr to the key_states_t struct imu_data = &(glove_data.imu); // ptr to the bno_imu_t struct in glove data update_task_timer = new RtosTimer(this, &Collector::updateAndAdvertise, osTimerPeriodic); } void Collector::updateAndAdvertise() { imu.updateAndWrite(imu_data); flex.updateAndWrite(flex_data); touch.spawnUpdateThread(); Thread::wait(8); touch.writeKeys(touch_data); compressGloveSensors(&glove_data, &glove_data_compressed); adble.update((uint8_t*)&glove_data_compressed, glove_sensors_compressed_size); touch.terminateUpdateThreadIfBlocking(); adble.waitForEvent(); } void Collector::startUpdateTask(uint32_t ms) { update_task_timer->start(ms); } void Collector::stopUpdateTask() { update_task_timer->stop(); }
34.289474
82
0.719493
apadin1
4b735d80b365f4d2664e4cc049e18481dfc5751f
1,333
hpp
C++
irohad/model/commands/transfer_asset.hpp
akshatkarani/iroha
5acef9dd74720c6185360d951e9b11be4ef73260
[ "Apache-2.0" ]
1,467
2016-10-25T12:27:19.000Z
2022-03-28T04:32:05.000Z
irohad/model/commands/transfer_asset.hpp
akshatkarani/iroha
5acef9dd74720c6185360d951e9b11be4ef73260
[ "Apache-2.0" ]
2,366
2016-10-25T10:07:57.000Z
2022-03-31T22:03:24.000Z
irohad/model/commands/transfer_asset.hpp
akshatkarani/iroha
5acef9dd74720c6185360d951e9b11be4ef73260
[ "Apache-2.0" ]
662
2016-10-26T04:41:22.000Z
2022-03-31T04:15:02.000Z
/** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #ifndef IROHA_TRANSFER_ASSET_HPP #define IROHA_TRANSFER_ASSET_HPP #include <string> #include "model/command.hpp" namespace iroha { namespace model { /** * Transfer asset from one account to another */ struct TransferAsset : public Command { /** * Source account */ std::string src_account_id; /** * Destination account */ std::string dest_account_id; /** * Asset to transfer. Identifier is asset_id */ std::string asset_id; /** * Transfer description */ std::string description; /** * Amount of transferred asset */ std::string amount; bool operator==(const Command &command) const override; TransferAsset() {} TransferAsset(const std::string &src_account_id, const std::string &dest_account_id, const std::string &asset_id, const std::string &amount) : src_account_id(src_account_id), dest_account_id(dest_account_id), asset_id(asset_id), amount(amount) {} }; } // namespace model } // namespace iroha #endif // IROHA_TRANSFER_ASSET_HPP
22.216667
61
0.585146
akshatkarani
4b7415838596cae7fdb9101e92160b495319b9b4
570
cpp
C++
13-stencil-buffered/project/src/stencil.cpp
walkieq/fccm2021-tutorial
f0eb2976a657f5a7c5a54be0ebb5d19b79fe93ee
[ "Apache-2.0" ]
2
2021-05-07T22:12:42.000Z
2021-05-09T04:36:28.000Z
13-stencil-buffered/project/src/stencil.cpp
yluo39github/fccm2021-tutorial
af341027d6302deead2a6666254c60d3a46dc6d2
[ "Apache-2.0" ]
null
null
null
13-stencil-buffered/project/src/stencil.cpp
yluo39github/fccm2021-tutorial
af341027d6302deead2a6666254c60d3a46dc6d2
[ "Apache-2.0" ]
2
2021-05-09T14:42:51.000Z
2021-12-05T22:32:10.000Z
#define DATA_SIZE 1024 #define STENCIL_SIZE 16 extern "C" { void stencil(int *in1, int *out) { int buffer[STENCIL_SIZE]; for(unsigned int i = 0; i < (STENCIL_SIZE - 1); i++) buffer[i + 1] = in1[i]; for(unsigned int i = 0; i < DATA_SIZE; i++) { for(unsigned int j = 0; j < (STENCIL_SIZE - 1); j++) buffer[j] = buffer[j + 1]; buffer[STENCIL_SIZE - 1] = in1[i + STENCIL_SIZE - 1]; int acc = 0; for(unsigned int j = 0; j < STENCIL_SIZE; j++) acc += buffer[j]; out[i] = acc; } } }
22.8
61
0.519298
walkieq
4b74679c313220d008be2f2ed9115ee26a73f2dc
11,094
cpp
C++
c/Haxe/OpenFL/01.HelloWorld/Export/windows/cpp/obj/src/lime/audio/FlashAudioContext.cpp
amenoyoya/old-project
640ec696af5d18267d86629098f41451857f8103
[ "MIT" ]
null
null
null
c/Haxe/OpenFL/01.HelloWorld/Export/windows/cpp/obj/src/lime/audio/FlashAudioContext.cpp
amenoyoya/old-project
640ec696af5d18267d86629098f41451857f8103
[ "MIT" ]
1
2019-07-07T09:52:20.000Z
2019-07-07T09:52:20.000Z
c/Haxe/OpenFL/01.HelloWorld/Export/windows/cpp/obj/src/lime/audio/FlashAudioContext.cpp
amenoyoya/old-project
640ec696af5d18267d86629098f41451857f8103
[ "MIT" ]
null
null
null
#include <hxcpp.h> #ifndef INCLUDED_lime_audio_AudioBuffer #include <lime/audio/AudioBuffer.h> #endif #ifndef INCLUDED_lime_audio_FlashAudioContext #include <lime/audio/FlashAudioContext.h> #endif namespace lime{ namespace audio{ Void FlashAudioContext_obj::__construct() { HX_STACK_FRAME("lime.audio.FlashAudioContext","new",0xd15df86a,"lime.audio.FlashAudioContext.new","lime/audio/FlashAudioContext.hx",12,0xbb50a608) HX_STACK_THIS(this) { } ; return null(); } //FlashAudioContext_obj::~FlashAudioContext_obj() { } Dynamic FlashAudioContext_obj::__CreateEmpty() { return new FlashAudioContext_obj; } hx::ObjectPtr< FlashAudioContext_obj > FlashAudioContext_obj::__new() { hx::ObjectPtr< FlashAudioContext_obj > result = new FlashAudioContext_obj(); result->__construct(); return result;} Dynamic FlashAudioContext_obj::__Create(hx::DynamicArray inArgs) { hx::ObjectPtr< FlashAudioContext_obj > result = new FlashAudioContext_obj(); result->__construct(); return result;} ::lime::audio::AudioBuffer FlashAudioContext_obj::createBuffer( Dynamic stream,Dynamic context){ HX_STACK_FRAME("lime.audio.FlashAudioContext","createBuffer",0xd64383d2,"lime.audio.FlashAudioContext.createBuffer","lime/audio/FlashAudioContext.hx",26,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(stream,"stream") HX_STACK_ARG(context,"context") HX_STACK_LINE(26) return null(); } HX_DEFINE_DYNAMIC_FUNC2(FlashAudioContext_obj,createBuffer,return ) int FlashAudioContext_obj::getBytesLoaded( ::lime::audio::AudioBuffer buffer){ HX_STACK_FRAME("lime.audio.FlashAudioContext","getBytesLoaded",0xb339da10,"lime.audio.FlashAudioContext.getBytesLoaded","lime/audio/FlashAudioContext.hx",42,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_LINE(42) return (int)0; } HX_DEFINE_DYNAMIC_FUNC1(FlashAudioContext_obj,getBytesLoaded,return ) int FlashAudioContext_obj::getBytesTotal( ::lime::audio::AudioBuffer buffer){ HX_STACK_FRAME("lime.audio.FlashAudioContext","getBytesTotal",0xad490c19,"lime.audio.FlashAudioContext.getBytesTotal","lime/audio/FlashAudioContext.hx",57,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_LINE(57) return (int)0; } HX_DEFINE_DYNAMIC_FUNC1(FlashAudioContext_obj,getBytesTotal,return ) Dynamic FlashAudioContext_obj::getID3( ::lime::audio::AudioBuffer buffer){ HX_STACK_FRAME("lime.audio.FlashAudioContext","getID3",0x0b7a1b58,"lime.audio.FlashAudioContext.getID3","lime/audio/FlashAudioContext.hx",72,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_LINE(72) return null(); } HX_DEFINE_DYNAMIC_FUNC1(FlashAudioContext_obj,getID3,return ) bool FlashAudioContext_obj::getIsBuffering( ::lime::audio::AudioBuffer buffer){ HX_STACK_FRAME("lime.audio.FlashAudioContext","getIsBuffering",0xa97f99d8,"lime.audio.FlashAudioContext.getIsBuffering","lime/audio/FlashAudioContext.hx",87,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_LINE(87) return false; } HX_DEFINE_DYNAMIC_FUNC1(FlashAudioContext_obj,getIsBuffering,return ) bool FlashAudioContext_obj::getIsURLInaccessible( ::lime::audio::AudioBuffer buffer){ HX_STACK_FRAME("lime.audio.FlashAudioContext","getIsURLInaccessible",0x2645b2e0,"lime.audio.FlashAudioContext.getIsURLInaccessible","lime/audio/FlashAudioContext.hx",102,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_LINE(102) return false; } HX_DEFINE_DYNAMIC_FUNC1(FlashAudioContext_obj,getIsURLInaccessible,return ) Float FlashAudioContext_obj::getLength( ::lime::audio::AudioBuffer buffer){ HX_STACK_FRAME("lime.audio.FlashAudioContext","getLength",0x4a4ce9a6,"lime.audio.FlashAudioContext.getLength","lime/audio/FlashAudioContext.hx",117,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_LINE(117) return (int)0; } HX_DEFINE_DYNAMIC_FUNC1(FlashAudioContext_obj,getLength,return ) ::String FlashAudioContext_obj::getURL( ::lime::audio::AudioBuffer buffer){ HX_STACK_FRAME("lime.audio.FlashAudioContext","getURL",0x0b8342af,"lime.audio.FlashAudioContext.getURL","lime/audio/FlashAudioContext.hx",132,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_LINE(132) return null(); } HX_DEFINE_DYNAMIC_FUNC1(FlashAudioContext_obj,getURL,return ) Void FlashAudioContext_obj::close( ::lime::audio::AudioBuffer buffer){ { HX_STACK_FRAME("lime.audio.FlashAudioContext","close",0x0e4ed642,"lime.audio.FlashAudioContext.close","lime/audio/FlashAudioContext.hx",137,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") } return null(); } HX_DEFINE_DYNAMIC_FUNC1(FlashAudioContext_obj,close,(void)) Float FlashAudioContext_obj::extract( ::lime::audio::AudioBuffer buffer,Dynamic target,Float length,hx::Null< Float > __o_startPosition){ Float startPosition = __o_startPosition.Default(-1); HX_STACK_FRAME("lime.audio.FlashAudioContext","extract",0x602aaa4b,"lime.audio.FlashAudioContext.extract","lime/audio/FlashAudioContext.hx",160,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_ARG(target,"target") HX_STACK_ARG(length,"length") HX_STACK_ARG(startPosition,"startPosition") { HX_STACK_LINE(160) return (int)0; } } HX_DEFINE_DYNAMIC_FUNC4(FlashAudioContext_obj,extract,return ) Void FlashAudioContext_obj::load( ::lime::audio::AudioBuffer buffer,Dynamic stream,Dynamic context){ { HX_STACK_FRAME("lime.audio.FlashAudioContext","load",0x5f907adc,"lime.audio.FlashAudioContext.load","lime/audio/FlashAudioContext.hx",165,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_ARG(stream,"stream") HX_STACK_ARG(context,"context") } return null(); } HX_DEFINE_DYNAMIC_FUNC3(FlashAudioContext_obj,load,(void)) Void FlashAudioContext_obj::loadCompressedDataFromByteArray( ::lime::audio::AudioBuffer buffer,Dynamic bytes,int bytesLength){ { HX_STACK_FRAME("lime.audio.FlashAudioContext","loadCompressedDataFromByteArray",0x525c92e0,"lime.audio.FlashAudioContext.loadCompressedDataFromByteArray","lime/audio/FlashAudioContext.hx",178,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_ARG(bytes,"bytes") HX_STACK_ARG(bytesLength,"bytesLength") } return null(); } HX_DEFINE_DYNAMIC_FUNC3(FlashAudioContext_obj,loadCompressedDataFromByteArray,(void)) Void FlashAudioContext_obj::loadPCMFromByteArray( ::lime::audio::AudioBuffer buffer,Dynamic bytes,int samples,::String format,hx::Null< bool > __o_stereo,hx::Null< Float > __o_sampleRate){ bool stereo = __o_stereo.Default(true); Float sampleRate = __o_sampleRate.Default(44100); HX_STACK_FRAME("lime.audio.FlashAudioContext","loadPCMFromByteArray",0x7dd47e29,"lime.audio.FlashAudioContext.loadPCMFromByteArray","lime/audio/FlashAudioContext.hx",191,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_ARG(bytes,"bytes") HX_STACK_ARG(samples,"samples") HX_STACK_ARG(format,"format") HX_STACK_ARG(stereo,"stereo") HX_STACK_ARG(sampleRate,"sampleRate") { } return null(); } HX_DEFINE_DYNAMIC_FUNC6(FlashAudioContext_obj,loadPCMFromByteArray,(void)) Dynamic FlashAudioContext_obj::play( ::lime::audio::AudioBuffer buffer,hx::Null< Float > __o_startTime,hx::Null< int > __o_loops,Dynamic sndTransform){ Float startTime = __o_startTime.Default(0); int loops = __o_loops.Default(0); HX_STACK_FRAME("lime.audio.FlashAudioContext","play",0x62330eaa,"lime.audio.FlashAudioContext.play","lime/audio/FlashAudioContext.hx",214,0xbb50a608) HX_STACK_THIS(this) HX_STACK_ARG(buffer,"buffer") HX_STACK_ARG(startTime,"startTime") HX_STACK_ARG(loops,"loops") HX_STACK_ARG(sndTransform,"sndTransform") { HX_STACK_LINE(214) return null(); } } HX_DEFINE_DYNAMIC_FUNC4(FlashAudioContext_obj,play,return ) FlashAudioContext_obj::FlashAudioContext_obj() { } Dynamic FlashAudioContext_obj::__Field(const ::String &inName,bool inCallProp) { switch(inName.length) { case 4: if (HX_FIELD_EQ(inName,"load") ) { return load_dyn(); } if (HX_FIELD_EQ(inName,"play") ) { return play_dyn(); } break; case 5: if (HX_FIELD_EQ(inName,"close") ) { return close_dyn(); } break; case 6: if (HX_FIELD_EQ(inName,"getID3") ) { return getID3_dyn(); } if (HX_FIELD_EQ(inName,"getURL") ) { return getURL_dyn(); } break; case 7: if (HX_FIELD_EQ(inName,"extract") ) { return extract_dyn(); } break; case 9: if (HX_FIELD_EQ(inName,"getLength") ) { return getLength_dyn(); } break; case 12: if (HX_FIELD_EQ(inName,"createBuffer") ) { return createBuffer_dyn(); } break; case 13: if (HX_FIELD_EQ(inName,"getBytesTotal") ) { return getBytesTotal_dyn(); } break; case 14: if (HX_FIELD_EQ(inName,"getBytesLoaded") ) { return getBytesLoaded_dyn(); } if (HX_FIELD_EQ(inName,"getIsBuffering") ) { return getIsBuffering_dyn(); } break; case 20: if (HX_FIELD_EQ(inName,"getIsURLInaccessible") ) { return getIsURLInaccessible_dyn(); } if (HX_FIELD_EQ(inName,"loadPCMFromByteArray") ) { return loadPCMFromByteArray_dyn(); } break; case 31: if (HX_FIELD_EQ(inName,"loadCompressedDataFromByteArray") ) { return loadCompressedDataFromByteArray_dyn(); } } return super::__Field(inName,inCallProp); } Dynamic FlashAudioContext_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp) { return super::__SetField(inName,inValue,inCallProp); } void FlashAudioContext_obj::__GetFields(Array< ::String> &outFields) { super::__GetFields(outFields); }; static ::String sStaticFields[] = { String(null()) }; #if HXCPP_SCRIPTABLE static hx::StorageInfo *sMemberStorageInfo = 0; #endif static ::String sMemberFields[] = { HX_CSTRING("createBuffer"), HX_CSTRING("getBytesLoaded"), HX_CSTRING("getBytesTotal"), HX_CSTRING("getID3"), HX_CSTRING("getIsBuffering"), HX_CSTRING("getIsURLInaccessible"), HX_CSTRING("getLength"), HX_CSTRING("getURL"), HX_CSTRING("close"), HX_CSTRING("extract"), HX_CSTRING("load"), HX_CSTRING("loadCompressedDataFromByteArray"), HX_CSTRING("loadPCMFromByteArray"), HX_CSTRING("play"), String(null()) }; static void sMarkStatics(HX_MARK_PARAMS) { HX_MARK_MEMBER_NAME(FlashAudioContext_obj::__mClass,"__mClass"); }; #ifdef HXCPP_VISIT_ALLOCS static void sVisitStatics(HX_VISIT_PARAMS) { HX_VISIT_MEMBER_NAME(FlashAudioContext_obj::__mClass,"__mClass"); }; #endif Class FlashAudioContext_obj::__mClass; void FlashAudioContext_obj::__register() { hx::Static(__mClass) = hx::RegisterClass(HX_CSTRING("lime.audio.FlashAudioContext"), hx::TCanCast< FlashAudioContext_obj> ,sStaticFields,sMemberFields, &__CreateEmpty, &__Create, &super::__SGetClass(), 0, sMarkStatics #ifdef HXCPP_VISIT_ALLOCS , sVisitStatics #endif #ifdef HXCPP_SCRIPTABLE , sMemberStorageInfo #endif ); } void FlashAudioContext_obj::__boot() { } } // end namespace lime } // end namespace audio
33.618182
206
0.765008
amenoyoya
4b78a561e47fe37063b4d7b32c57d9033532bfb0
1,415
cpp
C++
examples/EnsembledCrash.cpp
acpaquette/deepstate
6acf07ad5dd95c9e8b970ca516ab93aa2620ea6e
[ "Apache-2.0" ]
684
2018-02-18T18:04:23.000Z
2022-03-26T06:18:39.000Z
examples/EnsembledCrash.cpp
acpaquette/deepstate
6acf07ad5dd95c9e8b970ca516ab93aa2620ea6e
[ "Apache-2.0" ]
273
2018-02-18T04:01:36.000Z
2022-02-09T16:07:38.000Z
examples/EnsembledCrash.cpp
acpaquette/deepstate
6acf07ad5dd95c9e8b970ca516ab93aa2620ea6e
[ "Apache-2.0" ]
77
2018-02-19T00:18:33.000Z
2022-03-16T04:12:09.000Z
/* * Copyright (c) 2019 Trail of Bits, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <deepstate/DeepState.hpp> using namespace deepstate; DEEPSTATE_NOINLINE static void segfault(char *first, char* second) { std::size_t hashed = std::hash<std::string>{}(first); std::size_t hashed2 = std::hash<std::string>{}(second); unsigned *p = NULL; if (hashed == 7169420828666634849U) { if (hashed2 == 10753164746288518855U) { *(p+2) = 0xdeadbeef; /* crash */ } printf("BOM\n"); } } TEST(SimpleCrash, SegFault) { char *first = (char*)DeepState_CStr_C(9, 0); char *second = (char*)DeepState_CStr_C(9, 0); for (int i = 0; i < 9; ++i) printf("%02x", (unsigned char)first[i]); printf("\n"); for (int i = 0; i < 9; ++i) printf("%02x", (unsigned char)second[i]); segfault(first, second); ASSERT_EQ(first, first); ASSERT_NE(first, second); }
28.877551
75
0.671378
acpaquette
4b7dbe4c07d1aea493805c6e9c7c0557ee55ed6c
1,898
hpp
C++
src/bindings/cpp/include/kdbplugin.hpp
pinotree/libelektra
77696c82bea2ca58ac1636df58f3dcb06b028228
[ "BSD-3-Clause" ]
null
null
null
src/bindings/cpp/include/kdbplugin.hpp
pinotree/libelektra
77696c82bea2ca58ac1636df58f3dcb06b028228
[ "BSD-3-Clause" ]
null
null
null
src/bindings/cpp/include/kdbplugin.hpp
pinotree/libelektra
77696c82bea2ca58ac1636df58f3dcb06b028228
[ "BSD-3-Clause" ]
null
null
null
/** * @file * * @brief Helpers for creating plugins * * Make sure to include kdberrors.h before including this file if you want * warnings/errors to be added. * * Proper usage: * @code using namespace ckdb; #include <kdberrors.h> #include <kdbplugin.hpp> typedef Delegator<elektra::YourPluginClass> YPC; // then e.g. YPC::open(handle, errorKey); * @endcode * * @copyright BSD License (see doc/COPYING or http://www.libelektra.org) * */ #ifndef KDBPLUGIN_HPP #define KDBPLUGIN_HPP #include <kdbplugin.h> #include <key.hpp> #include <keyset.hpp> template <typename Delegated> class Delegator { public: typedef Delegated * (*Builder) (kdb::KeySet config); inline static Delegated * defaultBuilder (kdb::KeySet config) { return new Delegated (config); } inline static int open (ckdb::Plugin * handle, ckdb::Key * errorKey, Builder builder = defaultBuilder) { kdb::KeySet config (elektraPluginGetConfig (handle)); int ret = openHelper (handle, config, errorKey, builder); config.release (); return ret; } inline static int close (ckdb::Plugin * handle, ckdb::Key *) { delete get (handle); return 1; // always successfully } inline static Delegated * get (ckdb::Plugin * handle) { return static_cast<Delegated *> (elektraPluginGetData (handle)); } private: /**This function avoid that every return path need to release the * configuration. */ inline static int openHelper (ckdb::Plugin * handle, kdb::KeySet & config, ckdb::Key * errorKey, Builder builder) { if (config.lookup ("/module")) { // suppress warnings if it is just a module // don't buildup the Delegated then return 0; } try { elektraPluginSetData (handle, (*builder) (config)); } catch (const char * msg) { #ifdef KDBERRORS_H ELEKTRA_ADD_WARNING (69, errorKey, msg); #endif return -1; } return get (handle) != nullptr ? 1 : -1; } }; #endif
21.325843
114
0.689146
pinotree
4b7ede277a45c884ce5e14d1107c6e531948d4ab
371
cpp
C++
C++ Contribution/Possible Combination Problem.cpp
katsuNakajima/Hacktoberfest
ecd09627c5ca2defd08d048d11b5660a78df481c
[ "MIT" ]
1
2021-10-31T11:28:29.000Z
2021-10-31T11:28:29.000Z
C++ Contribution/Possible Combination Problem.cpp
katsuNakajima/Hacktoberfest
ecd09627c5ca2defd08d048d11b5660a78df481c
[ "MIT" ]
1
2021-11-13T18:27:21.000Z
2021-11-13T18:27:21.000Z
C++ Contribution/Possible Combination Problem.cpp
katsuNakajima/Hacktoberfest
ecd09627c5ca2defd08d048d11b5660a78df481c
[ "MIT" ]
1
2021-10-31T11:28:31.000Z
2021-10-31T11:28:31.000Z
#include <iostream> using namespace std; int main() { int factorial = 1; int num1,num2,arrangements,i; cout<<"Enter Number of Guests: "; cin>>num1; cout<<"Enter Number of Chairs: "; cin>>num2; for (i = 1; i<=num1; i++) { factorial = factorial*i; } arrangements = factorial/(num1-num2); cout<<"Possible Arrangments : "<<arrangements; return 0; }
19.526316
51
0.638814
katsuNakajima
4b8a4fcb6b3238e3a5ba1d952f252cdb7c03851a
33,701
cpp
C++
export/release/macos/obj/src/FirstBootState.cpp
BushsHaxs/DOKIDOKI-MAC
22729124a0b7b637d56ff3b18acb555ec05934f1
[ "Apache-2.0" ]
null
null
null
export/release/macos/obj/src/FirstBootState.cpp
BushsHaxs/DOKIDOKI-MAC
22729124a0b7b637d56ff3b18acb555ec05934f1
[ "Apache-2.0" ]
null
null
null
export/release/macos/obj/src/FirstBootState.cpp
BushsHaxs/DOKIDOKI-MAC
22729124a0b7b637d56ff3b18acb555ec05934f1
[ "Apache-2.0" ]
1
2021-12-11T09:19:29.000Z
2021-12-11T09:19:29.000Z
#include <hxcpp.h> #ifndef INCLUDED_Controls #include <Controls.h> #endif #ifndef INCLUDED_CoolUtil #include <CoolUtil.h> #endif #ifndef INCLUDED_FirstBootState #include <FirstBootState.h> #endif #ifndef INCLUDED_LangUtil #include <LangUtil.h> #endif #ifndef INCLUDED_MusicBeatState #include <MusicBeatState.h> #endif #ifndef INCLUDED_Paths #include <Paths.h> #endif #ifndef INCLUDED_PlayerSettings #include <PlayerSettings.h> #endif #ifndef INCLUDED_Std #include <Std.h> #endif #ifndef INCLUDED_TitleState #include <TitleState.h> #endif #ifndef INCLUDED_flixel_FlxBasic #include <flixel/FlxBasic.h> #endif #ifndef INCLUDED_flixel_FlxG #include <flixel/FlxG.h> #endif #ifndef INCLUDED_flixel_FlxGame #include <flixel/FlxGame.h> #endif #ifndef INCLUDED_flixel_FlxObject #include <flixel/FlxObject.h> #endif #ifndef INCLUDED_flixel_FlxSprite #include <flixel/FlxSprite.h> #endif #ifndef INCLUDED_flixel_FlxState #include <flixel/FlxState.h> #endif #ifndef INCLUDED_flixel_addons_display_FlxBackdrop #include <flixel/addons/display/FlxBackdrop.h> #endif #ifndef INCLUDED_flixel_addons_transition_FlxTransitionableState #include <flixel/addons/transition/FlxTransitionableState.h> #endif #ifndef INCLUDED_flixel_addons_transition_TransitionData #include <flixel/addons/transition/TransitionData.h> #endif #ifndef INCLUDED_flixel_addons_ui_FlxUIState #include <flixel/addons/ui/FlxUIState.h> #endif #ifndef INCLUDED_flixel_addons_ui_interfaces_IEventGetter #include <flixel/addons/ui/interfaces/IEventGetter.h> #endif #ifndef INCLUDED_flixel_addons_ui_interfaces_IFlxUIState #include <flixel/addons/ui/interfaces/IFlxUIState.h> #endif #ifndef INCLUDED_flixel_effects_FlxFlicker #include <flixel/effects/FlxFlicker.h> #endif #ifndef INCLUDED_flixel_group_FlxTypedGroup #include <flixel/group/FlxTypedGroup.h> #endif #ifndef INCLUDED_flixel_input_actions_FlxAction #include <flixel/input/actions/FlxAction.h> #endif #ifndef INCLUDED_flixel_input_actions_FlxActionDigital #include <flixel/input/actions/FlxActionDigital.h> #endif #ifndef INCLUDED_flixel_input_actions_FlxActionSet #include <flixel/input/actions/FlxActionSet.h> #endif #ifndef INCLUDED_flixel_system_FlxSound #include <flixel/system/FlxSound.h> #endif #ifndef INCLUDED_flixel_system_FlxSoundGroup #include <flixel/system/FlxSoundGroup.h> #endif #ifndef INCLUDED_flixel_system_frontEnds_SoundFrontEnd #include <flixel/system/frontEnds/SoundFrontEnd.h> #endif #ifndef INCLUDED_flixel_text_FlxText #include <flixel/text/FlxText.h> #endif #ifndef INCLUDED_flixel_text_FlxTextBorderStyle #include <flixel/text/FlxTextBorderStyle.h> #endif #ifndef INCLUDED_flixel_tweens_FlxEase #include <flixel/tweens/FlxEase.h> #endif #ifndef INCLUDED_flixel_tweens_FlxTween #include <flixel/tweens/FlxTween.h> #endif #ifndef INCLUDED_flixel_tweens_misc_VarTween #include <flixel/tweens/misc/VarTween.h> #endif #ifndef INCLUDED_flixel_util_FlxAxes #include <flixel/util/FlxAxes.h> #endif #ifndef INCLUDED_flixel_util_FlxSave #include <flixel/util/FlxSave.h> #endif #ifndef INCLUDED_flixel_util_FlxTimer #include <flixel/util/FlxTimer.h> #endif #ifndef INCLUDED_flixel_util_FlxTimerManager #include <flixel/util/FlxTimerManager.h> #endif #ifndef INCLUDED_flixel_util_IFlxDestroyable #include <flixel/util/IFlxDestroyable.h> #endif #ifndef INCLUDED_haxe_Log #include <haxe/Log.h> #endif #ifndef INCLUDED_openfl_display_DisplayObject #include <openfl/display/DisplayObject.h> #endif #ifndef INCLUDED_openfl_display_DisplayObjectContainer #include <openfl/display/DisplayObjectContainer.h> #endif #ifndef INCLUDED_openfl_display_IBitmapDrawable #include <openfl/display/IBitmapDrawable.h> #endif #ifndef INCLUDED_openfl_display_InteractiveObject #include <openfl/display/InteractiveObject.h> #endif #ifndef INCLUDED_openfl_display_Sprite #include <openfl/display/Sprite.h> #endif #ifndef INCLUDED_openfl_events_EventDispatcher #include <openfl/events/EventDispatcher.h> #endif #ifndef INCLUDED_openfl_events_IEventDispatcher #include <openfl/events/IEventDispatcher.h> #endif #ifndef INCLUDED_openfl_utils_Assets #include <openfl/utils/Assets.h> #endif HX_DEFINE_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_14_new,"FirstBootState","new",0xcc85d6c1,"FirstBootState.new","FirstBootState.hx",14,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_30_create,"FirstBootState","create",0x1282d33b,"FirstBootState.create","FirstBootState.hx",30,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_68_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",68,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_79_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",79,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_111_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",111,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_125_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",125,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_130_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",130,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_137_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",137,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_151_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",151,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_146_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",146,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_165_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",165,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_160_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",160,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_187_bringinthenote,"FirstBootState","bringinthenote",0xc451778b,"FirstBootState.bringinthenote","FirstBootState.hx",187,0xeb1afbcf) HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_178_bringinthenote,"FirstBootState","bringinthenote",0xc451778b,"FirstBootState.bringinthenote","FirstBootState.hx",178,0xeb1afbcf) void FirstBootState_obj::__construct( ::flixel::addons::transition::TransitionData TransIn, ::flixel::addons::transition::TransitionData TransOut){ HX_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_14_new) HXLINE( 65) this->selectedSomethin = false; HXLINE( 21) this->curSelected = 0; HXLINE( 19) this->selectedsomething = false; HXLINE( 17) this->localeList = ::Array_obj< ::String >::__new(0); HXLINE( 16) this->textMenuItems = ::Array_obj< ::String >::__new(0); HXLINE( 14) super::__construct(TransIn,TransOut); } Dynamic FirstBootState_obj::__CreateEmpty() { return new FirstBootState_obj; } void *FirstBootState_obj::_hx_vtable = 0; Dynamic FirstBootState_obj::__Create(::hx::DynamicArray inArgs) { ::hx::ObjectPtr< FirstBootState_obj > _hx_result = new FirstBootState_obj(); _hx_result->__construct(inArgs[0],inArgs[1]); return _hx_result; } bool FirstBootState_obj::_hx_isInstanceOf(int inClassId) { if (inClassId<=(int)0x3f706236) { if (inClassId<=(int)0x23a57bae) { if (inClassId<=(int)0x0430f5d7) { return inClassId==(int)0x00000001 || inClassId==(int)0x0430f5d7; } else { return inClassId==(int)0x23a57bae; } } else { return inClassId==(int)0x2f064378 || inClassId==(int)0x3f706236; } } else { if (inClassId<=(int)0x7c795c9f) { return inClassId==(int)0x62817b24 || inClassId==(int)0x7c795c9f; } else { return inClassId==(int)0x7ccf8994; } } } void FirstBootState_obj::create(){ HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_30_create) HXLINE( 31) this->persistentUpdate = (this->persistentDraw = true); HXLINE( 33) ::String library = null(); HXDLIN( 33) ::String languageList = ::Paths_obj::getPath((HX_("locale/languageList",ab,12,e4,2d) + HX_(".txt",02,3f,c0,1e)),HX_("TEXT",ad,94,ba,37),library); HXDLIN( 33) ::Array< ::String > languageList1 = ::CoolUtil_obj::coolTextFile(languageList); HXLINE( 35) { HXLINE( 35) int _g = 0; HXDLIN( 35) int _g1 = languageList1->length; HXDLIN( 35) while((_g < _g1)){ HXLINE( 35) _g = (_g + 1); HXDLIN( 35) int i = (_g - 1); HXLINE( 37) ::Array< ::String > data = languageList1->__get(i).split(HX_(":",3a,00,00,00)); HXLINE( 38) this->textMenuItems->push(data->__get(0)); HXLINE( 39) this->localeList->push(data->__get(1)); } } HXLINE( 42) ::flixel::FlxSprite _hx_tmp = ::flixel::FlxSprite_obj::__alloc( HX_CTX ,-80,null(),null()); HXDLIN( 42) ::String library1 = null(); HXDLIN( 42) ::String _hx_tmp1 = ::Paths_obj::getPath(((HX_("images/",77,50,74,c1) + HX_("menuBG",24,65,6d,05)) + HX_(".png",3b,2d,bd,1e)),HX_("IMAGE",3b,57,57,3b),library1); HXDLIN( 42) this->bg = _hx_tmp->loadGraphic(_hx_tmp1,null(),null(),null(),null(),null()); HXLINE( 43) ::flixel::FlxSprite _hx_tmp2 = this->bg; HXDLIN( 43) _hx_tmp2->setGraphicSize(::Std_obj::_hx_int((this->bg->get_width() * ((Float)1.1))),null()); HXLINE( 44) this->bg->updateHitbox(); HXLINE( 45) this->bg->screenCenter(null()); HXLINE( 46) this->bg->set_antialiasing(true); HXLINE( 47) this->add(this->bg); HXLINE( 49) this->grpOptionsTexts = ::flixel::group::FlxTypedGroup_obj::__alloc( HX_CTX ,null()); HXLINE( 50) this->add(this->grpOptionsTexts); HXLINE( 52) { HXLINE( 52) int _g2 = 0; HXDLIN( 52) int _g3 = this->textMenuItems->length; HXDLIN( 52) while((_g2 < _g3)){ HXLINE( 52) _g2 = (_g2 + 1); HXDLIN( 52) int i = (_g2 - 1); HXLINE( 54) ::flixel::text::FlxText optionText = ::flixel::text::FlxText_obj::__alloc( HX_CTX ,0,(50 + (i * 50)),0,this->textMenuItems->__get(i),null(),null()); HXLINE( 55) optionText->setFormat(::LangUtil_obj::getFont(HX_("riffic",51,90,7b,4d)),32,-1,HX_("center",d5,25,db,05),null(),null(),null()); HXLINE( 56) optionText->screenCenter(::flixel::util::FlxAxes_obj::X_dyn()); HXLINE( 57) optionText->set_antialiasing(true); HXLINE( 58) optionText->ID = i; HXLINE( 59) this->grpOptionsTexts->add(optionText).StaticCast< ::flixel::text::FlxText >(); } } HXLINE( 62) this->super::create(); } void FirstBootState_obj::update(Float elapsed){ HX_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_68_update) HXDLIN( 68) ::FirstBootState _gthis = ::hx::ObjectPtr<OBJ_>(this); HXLINE( 69) bool _hx_tmp; HXDLIN( 69) if (::hx::IsNotNull( ::flixel::FlxG_obj::sound->music )) { HXLINE( 69) _hx_tmp = (::flixel::FlxG_obj::sound->music->_volume > 0); } else { HXLINE( 69) _hx_tmp = false; } HXDLIN( 69) if (_hx_tmp) { HXLINE( 70) ::flixel::_hx_system::FlxSound fh = ::flixel::FlxG_obj::sound->music; HXDLIN( 70) fh->set_volume((fh->_volume - (((Float)0.25) * ::flixel::FlxG_obj::elapsed))); } HXLINE( 72) this->super::update(elapsed); HXLINE( 74) bool _hx_tmp1; HXDLIN( 74) bool _hx_tmp2; HXDLIN( 74) if (::PlayerSettings_obj::player1->controls->_accept->check()) { HXLINE( 74) _hx_tmp2 = this->selectedSomethin; } else { HXLINE( 74) _hx_tmp2 = false; } HXDLIN( 74) if (_hx_tmp2) { HXLINE( 74) _hx_tmp1 = !(this->selectedsomething); } else { HXLINE( 74) _hx_tmp1 = false; } HXDLIN( 74) if (_hx_tmp1) { HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_0, ::FirstBootState,_gthis) HXARGC(1) void _hx_run( ::flixel::tweens::FlxTween twn){ HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_79_update) HXLINE( 80) _gthis->funnynote->kill(); HXLINE( 82) { HXLINE( 82) ::flixel::FlxState nextState = ::TitleState_obj::__alloc( HX_CTX ,null(),null()); HXDLIN( 82) if (::flixel::FlxG_obj::game->_state->switchTo(nextState)) { HXLINE( 82) ::flixel::FlxG_obj::game->_requestedState = nextState; } } } HX_END_LOCAL_FUNC1((void)) HXLINE( 76) ::flixel::tweens::FlxTween_obj::tween(this->funnynote, ::Dynamic(::hx::Anon_obj::Create(1) ->setFixed(0,HX_("alpha",5e,a7,96,21),0)),2, ::Dynamic(::hx::Anon_obj::Create(2) ->setFixed(0,HX_("ease",ee,8b,0c,43),::flixel::tweens::FlxEase_obj::quadOut_dyn()) ->setFixed(1,HX_("onComplete",f8,d4,7e,5d), ::Dynamic(new _hx_Closure_0(_gthis))))); } HXLINE( 90) if (!(this->selectedSomethin)) { HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_1, ::FirstBootState,_gthis) HXARGC(1) void _hx_run( ::flixel::text::FlxText txt){ HX_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_111_update) HXLINE( 112) { HXLINE( 112) txt->set_borderStyle(::flixel::text::FlxTextBorderStyle_obj::OUTLINE_dyn()); HXDLIN( 112) txt->set_borderColor(-33537); HXDLIN( 112) txt->set_borderSize(( (Float)(2) )); HXDLIN( 112) txt->set_borderQuality(( (Float)(1) )); } HXLINE( 114) if ((txt->ID == _gthis->curSelected)) { HXLINE( 115) txt->set_borderStyle(::flixel::text::FlxTextBorderStyle_obj::OUTLINE_dyn()); HXDLIN( 115) txt->set_borderColor(-12289); HXDLIN( 115) txt->set_borderSize(( (Float)(2) )); HXDLIN( 115) txt->set_borderQuality(( (Float)(1) )); } } HX_END_LOCAL_FUNC1((void)) HXLINE( 92) if (::PlayerSettings_obj::player1->controls->_upP->check()) { HXLINE( 94) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound; HXDLIN( 94) _hx_tmp->play(::Paths_obj::sound(HX_("scrollMenu",4c,d4,18,06),null()),null(),null(),null(),null(),null()); HXLINE( 95) ::FirstBootState _hx_tmp1 = ::hx::ObjectPtr<OBJ_>(this); HXDLIN( 95) _hx_tmp1->curSelected = (_hx_tmp1->curSelected - 1); } HXLINE( 98) if (::PlayerSettings_obj::player1->controls->_downP->check()) { HXLINE( 100) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound; HXDLIN( 100) _hx_tmp->play(::Paths_obj::sound(HX_("scrollMenu",4c,d4,18,06),null()),null(),null(),null(),null(),null()); HXLINE( 101) ::FirstBootState _hx_tmp1 = ::hx::ObjectPtr<OBJ_>(this); HXDLIN( 101) _hx_tmp1->curSelected = (_hx_tmp1->curSelected + 1); } HXLINE( 104) if ((this->curSelected < 0)) { HXLINE( 105) this->curSelected = (this->textMenuItems->length - 1); } HXLINE( 107) if ((this->curSelected >= this->textMenuItems->length)) { HXLINE( 108) this->curSelected = 0; } HXLINE( 110) this->grpOptionsTexts->forEach( ::Dynamic(new _hx_Closure_1(_gthis)),null()); HXLINE( 118) if (::PlayerSettings_obj::player1->controls->_accept->check()) { HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_8, ::FirstBootState,_gthis) HXARGC(1) void _hx_run( ::flixel::text::FlxText txt){ HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_125_update) HXLINE( 125) if ((_gthis->curSelected != txt->ID)) { HX_BEGIN_LOCAL_FUNC_S0(::hx::LocalFunc,_hx_Closure_2) HXARGC(1) void _hx_run( ::flixel::tweens::FlxTween twn){ HX_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_130_update) } HX_END_LOCAL_FUNC1((void)) HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_3, ::flixel::text::FlxText,txt) HXARGC(1) void _hx_run( ::flixel::tweens::FlxTween twn){ HX_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_137_update) HXLINE( 137) txt->kill(); } HX_END_LOCAL_FUNC1((void)) HXLINE( 127) ::flixel::tweens::FlxTween_obj::tween(_gthis->bg, ::Dynamic(::hx::Anon_obj::Create(1) ->setFixed(0,HX_("alpha",5e,a7,96,21),0)),((Float)1.3), ::Dynamic(::hx::Anon_obj::Create(2) ->setFixed(0,HX_("ease",ee,8b,0c,43),::flixel::tweens::FlxEase_obj::quadOut_dyn()) ->setFixed(1,HX_("onComplete",f8,d4,7e,5d), ::Dynamic(new _hx_Closure_2())))); HXLINE( 133) ::flixel::tweens::FlxTween_obj::tween(txt, ::Dynamic(::hx::Anon_obj::Create(1) ->setFixed(0,HX_("alpha",5e,a7,96,21),0)),((Float)1.3), ::Dynamic(::hx::Anon_obj::Create(2) ->setFixed(0,HX_("ease",ee,8b,0c,43),::flixel::tweens::FlxEase_obj::quadOut_dyn()) ->setFixed(1,HX_("onComplete",f8,d4,7e,5d), ::Dynamic(new _hx_Closure_3(txt))))); } else { HXLINE( 143) if (( (bool)(::flixel::FlxG_obj::save->data->__Field(HX_("flashing",32,85,e8,99),::hx::paccDynamic)) )) { HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_5, ::FirstBootState,_gthis) HXARGC(1) void _hx_run( ::flixel::effects::FlxFlicker flick){ HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_4, ::FirstBootState,_gthis) HXARGC(1) void _hx_run( ::flixel::util::FlxTimer tmr){ HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_151_update) HXLINE( 152) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound; HXDLIN( 152) _hx_tmp->play(::Paths_obj::sound(HX_("flip_page",61,10,21,01),HX_("shared",a5,5e,2b,1d)),null(),null(),null(),null(),null()); HXLINE( 153) _gthis->bringinthenote(); } HX_END_LOCAL_FUNC1((void)) HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_146_update) HXLINE( 147) ::flixel::FlxG_obj::save->data->__SetField(HX_("language",58,80,11,7a),_gthis->localeList->__get(_gthis->curSelected),::hx::paccDynamic); HXLINE( 148) ::Dynamic _hx_tmp = ::haxe::Log_obj::trace; HXDLIN( 148) ::String _hx_tmp1 = (HX_("langauge set to ",a7,fb,71,af) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))); HXDLIN( 148) _hx_tmp(_hx_tmp1,::hx::SourceInfo(HX_("source/FirstBootState.hx",5b,da,01,2e),148,HX_("FirstBootState",4f,62,c9,d3),HX_("update",09,86,05,87))); HXLINE( 149) ::String _hx_tmp2; HXDLIN( 149) if (::openfl::utils::Assets_obj::exists(::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/",2f,00,00,00) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e))),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35)),null())) { HXLINE( 149) _hx_tmp2 = ::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/",2f,00,00,00) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e))),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35)); } else { HXLINE( 149) _hx_tmp2 = ::Paths_obj::getPath(((HX_("locale/en-US/",02,23,bf,a8) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e)),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35)); } HXDLIN( 149) ::LangUtil_obj::localeList = ::CoolUtil_obj::coolTextFile(_hx_tmp2); HXLINE( 150) ::flixel::util::FlxTimer_obj::__alloc( HX_CTX ,null())->start(2, ::Dynamic(new _hx_Closure_4(_gthis)),null()); } HX_END_LOCAL_FUNC1((void)) HXLINE( 145) ::flixel::effects::FlxFlicker_obj::flicker(txt,1,((Float)0.06),false,false, ::Dynamic(new _hx_Closure_5(_gthis)),null()); } else { HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_7, ::FirstBootState,_gthis) HXARGC(1) void _hx_run( ::flixel::util::FlxTimer tmr){ HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_6, ::FirstBootState,_gthis) HXARGC(1) void _hx_run( ::flixel::util::FlxTimer tmr){ HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_165_update) HXLINE( 166) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound; HXDLIN( 166) _hx_tmp->play(::Paths_obj::sound(HX_("flip_page",61,10,21,01),HX_("shared",a5,5e,2b,1d)),null(),null(),null(),null(),null()); HXLINE( 167) _gthis->bringinthenote(); } HX_END_LOCAL_FUNC1((void)) HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_160_update) HXLINE( 161) ::flixel::FlxG_obj::save->data->__SetField(HX_("language",58,80,11,7a),_gthis->localeList->__get(_gthis->curSelected),::hx::paccDynamic); HXLINE( 162) ::Dynamic _hx_tmp = ::haxe::Log_obj::trace; HXDLIN( 162) ::String _hx_tmp1 = (HX_("langauge set to ",a7,fb,71,af) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))); HXDLIN( 162) _hx_tmp(_hx_tmp1,::hx::SourceInfo(HX_("source/FirstBootState.hx",5b,da,01,2e),162,HX_("FirstBootState",4f,62,c9,d3),HX_("update",09,86,05,87))); HXLINE( 163) ::String _hx_tmp2; HXDLIN( 163) if (::openfl::utils::Assets_obj::exists(::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/",2f,00,00,00) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e))),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35)),null())) { HXLINE( 163) _hx_tmp2 = ::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/",2f,00,00,00) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e))),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35)); } else { HXLINE( 163) _hx_tmp2 = ::Paths_obj::getPath(((HX_("locale/en-US/",02,23,bf,a8) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e)),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35)); } HXDLIN( 163) ::LangUtil_obj::localeList = ::CoolUtil_obj::coolTextFile(_hx_tmp2); HXLINE( 164) ::flixel::util::FlxTimer_obj::__alloc( HX_CTX ,null())->start(2, ::Dynamic(new _hx_Closure_6(_gthis)),null()); } HX_END_LOCAL_FUNC1((void)) HXLINE( 159) ::flixel::util::FlxTimer_obj::__alloc( HX_CTX ,null())->start(1, ::Dynamic(new _hx_Closure_7(_gthis)),null()); } } } HX_END_LOCAL_FUNC1((void)) HXLINE( 120) this->selectedsomething = true; HXLINE( 121) this->selectedSomethin = true; HXLINE( 122) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound; HXDLIN( 122) _hx_tmp->play(::Paths_obj::sound(HX_("confirmMenu",bf,8e,fe,3c),null()),null(),null(),null(),null(),null()); HXLINE( 123) this->grpOptionsTexts->forEach( ::Dynamic(new _hx_Closure_8(_gthis)),null()); } } } void FirstBootState_obj::bringinthenote(){ HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_0, ::FirstBootState,_gthis) HXARGC(1) void _hx_run( ::flixel::tweens::FlxTween twn){ HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_187_bringinthenote) HXLINE( 187) _gthis->selectedsomething = false; } HX_END_LOCAL_FUNC1((void)) HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_178_bringinthenote) HXDLIN( 178) ::FirstBootState _gthis = ::hx::ObjectPtr<OBJ_>(this); HXLINE( 179) ::flixel::FlxSprite _hx_tmp = ::flixel::FlxSprite_obj::__alloc( HX_CTX ,0,0,null()); HXDLIN( 179) ::String _hx_tmp1; HXDLIN( 179) if (::openfl::utils::Assets_obj::exists(::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/images/",28,44,b7,41) + HX_("DDLCIntroWarning",e7,dd,da,5c)) + HX_(".png",3b,2d,bd,1e))),HX_("IMAGE",3b,57,57,3b),HX_("preload",c9,47,43,35)),null())) { HXLINE( 179) _hx_tmp1 = ::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/images/",28,44,b7,41) + HX_("DDLCIntroWarning",e7,dd,da,5c)) + HX_(".png",3b,2d,bd,1e))),HX_("IMAGE",3b,57,57,3b),HX_("preload",c9,47,43,35)); } else { HXLINE( 179) _hx_tmp1 = ::Paths_obj::getPath(((HX_("locale/en-US/images/",b5,71,94,96) + HX_("DDLCIntroWarning",e7,dd,da,5c)) + HX_(".png",3b,2d,bd,1e)),HX_("IMAGE",3b,57,57,3b),HX_("preload",c9,47,43,35)); } HXDLIN( 179) this->funnynote = _hx_tmp->loadGraphic(_hx_tmp1,null(),null(),null(),null(),null()); HXLINE( 180) this->funnynote->set_alpha(( (Float)(0) )); HXLINE( 181) this->funnynote->screenCenter(::flixel::util::FlxAxes_obj::X_dyn()); HXLINE( 182) this->add(this->funnynote); HXLINE( 183) ::flixel::tweens::FlxTween_obj::tween(this->funnynote, ::Dynamic(::hx::Anon_obj::Create(1) ->setFixed(0,HX_("alpha",5e,a7,96,21),1)),1, ::Dynamic(::hx::Anon_obj::Create(2) ->setFixed(0,HX_("ease",ee,8b,0c,43),::flixel::tweens::FlxEase_obj::quadOut_dyn()) ->setFixed(1,HX_("onComplete",f8,d4,7e,5d), ::Dynamic(new _hx_Closure_0(_gthis))))); } HX_DEFINE_DYNAMIC_FUNC0(FirstBootState_obj,bringinthenote,(void)) ::hx::ObjectPtr< FirstBootState_obj > FirstBootState_obj::__new( ::flixel::addons::transition::TransitionData TransIn, ::flixel::addons::transition::TransitionData TransOut) { ::hx::ObjectPtr< FirstBootState_obj > __this = new FirstBootState_obj(); __this->__construct(TransIn,TransOut); return __this; } ::hx::ObjectPtr< FirstBootState_obj > FirstBootState_obj::__alloc(::hx::Ctx *_hx_ctx, ::flixel::addons::transition::TransitionData TransIn, ::flixel::addons::transition::TransitionData TransOut) { FirstBootState_obj *__this = (FirstBootState_obj*)(::hx::Ctx::alloc(_hx_ctx, sizeof(FirstBootState_obj), true, "FirstBootState")); *(void **)__this = FirstBootState_obj::_hx_vtable; __this->__construct(TransIn,TransOut); return __this; } FirstBootState_obj::FirstBootState_obj() { } void FirstBootState_obj::__Mark(HX_MARK_PARAMS) { HX_MARK_BEGIN_CLASS(FirstBootState); HX_MARK_MEMBER_NAME(textMenuItems,"textMenuItems"); HX_MARK_MEMBER_NAME(localeList,"localeList"); HX_MARK_MEMBER_NAME(selectedsomething,"selectedsomething"); HX_MARK_MEMBER_NAME(curSelected,"curSelected"); HX_MARK_MEMBER_NAME(backdrop,"backdrop"); HX_MARK_MEMBER_NAME(bg,"bg"); HX_MARK_MEMBER_NAME(funnynote,"funnynote"); HX_MARK_MEMBER_NAME(grpOptionsTexts,"grpOptionsTexts"); HX_MARK_MEMBER_NAME(selectedSomethin,"selectedSomethin"); ::MusicBeatState_obj::__Mark(HX_MARK_ARG); HX_MARK_END_CLASS(); } void FirstBootState_obj::__Visit(HX_VISIT_PARAMS) { HX_VISIT_MEMBER_NAME(textMenuItems,"textMenuItems"); HX_VISIT_MEMBER_NAME(localeList,"localeList"); HX_VISIT_MEMBER_NAME(selectedsomething,"selectedsomething"); HX_VISIT_MEMBER_NAME(curSelected,"curSelected"); HX_VISIT_MEMBER_NAME(backdrop,"backdrop"); HX_VISIT_MEMBER_NAME(bg,"bg"); HX_VISIT_MEMBER_NAME(funnynote,"funnynote"); HX_VISIT_MEMBER_NAME(grpOptionsTexts,"grpOptionsTexts"); HX_VISIT_MEMBER_NAME(selectedSomethin,"selectedSomethin"); ::MusicBeatState_obj::__Visit(HX_VISIT_ARG); } ::hx::Val FirstBootState_obj::__Field(const ::String &inName,::hx::PropertyAccess inCallProp) { switch(inName.length) { case 2: if (HX_FIELD_EQ(inName,"bg") ) { return ::hx::Val( bg ); } break; case 6: if (HX_FIELD_EQ(inName,"create") ) { return ::hx::Val( create_dyn() ); } if (HX_FIELD_EQ(inName,"update") ) { return ::hx::Val( update_dyn() ); } break; case 8: if (HX_FIELD_EQ(inName,"backdrop") ) { return ::hx::Val( backdrop ); } break; case 9: if (HX_FIELD_EQ(inName,"funnynote") ) { return ::hx::Val( funnynote ); } break; case 10: if (HX_FIELD_EQ(inName,"localeList") ) { return ::hx::Val( localeList ); } break; case 11: if (HX_FIELD_EQ(inName,"curSelected") ) { return ::hx::Val( curSelected ); } break; case 13: if (HX_FIELD_EQ(inName,"textMenuItems") ) { return ::hx::Val( textMenuItems ); } break; case 14: if (HX_FIELD_EQ(inName,"bringinthenote") ) { return ::hx::Val( bringinthenote_dyn() ); } break; case 15: if (HX_FIELD_EQ(inName,"grpOptionsTexts") ) { return ::hx::Val( grpOptionsTexts ); } break; case 16: if (HX_FIELD_EQ(inName,"selectedSomethin") ) { return ::hx::Val( selectedSomethin ); } break; case 17: if (HX_FIELD_EQ(inName,"selectedsomething") ) { return ::hx::Val( selectedsomething ); } } return super::__Field(inName,inCallProp); } ::hx::Val FirstBootState_obj::__SetField(const ::String &inName,const ::hx::Val &inValue,::hx::PropertyAccess inCallProp) { switch(inName.length) { case 2: if (HX_FIELD_EQ(inName,"bg") ) { bg=inValue.Cast< ::flixel::FlxSprite >(); return inValue; } break; case 8: if (HX_FIELD_EQ(inName,"backdrop") ) { backdrop=inValue.Cast< ::flixel::addons::display::FlxBackdrop >(); return inValue; } break; case 9: if (HX_FIELD_EQ(inName,"funnynote") ) { funnynote=inValue.Cast< ::flixel::FlxSprite >(); return inValue; } break; case 10: if (HX_FIELD_EQ(inName,"localeList") ) { localeList=inValue.Cast< ::Array< ::String > >(); return inValue; } break; case 11: if (HX_FIELD_EQ(inName,"curSelected") ) { curSelected=inValue.Cast< int >(); return inValue; } break; case 13: if (HX_FIELD_EQ(inName,"textMenuItems") ) { textMenuItems=inValue.Cast< ::Array< ::String > >(); return inValue; } break; case 15: if (HX_FIELD_EQ(inName,"grpOptionsTexts") ) { grpOptionsTexts=inValue.Cast< ::flixel::group::FlxTypedGroup >(); return inValue; } break; case 16: if (HX_FIELD_EQ(inName,"selectedSomethin") ) { selectedSomethin=inValue.Cast< bool >(); return inValue; } break; case 17: if (HX_FIELD_EQ(inName,"selectedsomething") ) { selectedsomething=inValue.Cast< bool >(); return inValue; } } return super::__SetField(inName,inValue,inCallProp); } void FirstBootState_obj::__GetFields(Array< ::String> &outFields) { outFields->push(HX_("textMenuItems",74,ab,77,14)); outFields->push(HX_("localeList",18,12,cb,fe)); outFields->push(HX_("selectedsomething",bf,62,a0,80)); outFields->push(HX_("curSelected",fb,eb,ab,32)); outFields->push(HX_("backdrop",d6,b1,96,1a)); outFields->push(HX_("bg",c5,55,00,00)); outFields->push(HX_("funnynote",3c,ff,3e,fe)); outFields->push(HX_("grpOptionsTexts",6d,2e,b1,bf)); outFields->push(HX_("selectedSomethin",c8,ec,fb,99)); super::__GetFields(outFields); }; #ifdef HXCPP_SCRIPTABLE static ::hx::StorageInfo FirstBootState_obj_sMemberStorageInfo[] = { {::hx::fsObject /* ::Array< ::String > */ ,(int)offsetof(FirstBootState_obj,textMenuItems),HX_("textMenuItems",74,ab,77,14)}, {::hx::fsObject /* ::Array< ::String > */ ,(int)offsetof(FirstBootState_obj,localeList),HX_("localeList",18,12,cb,fe)}, {::hx::fsBool,(int)offsetof(FirstBootState_obj,selectedsomething),HX_("selectedsomething",bf,62,a0,80)}, {::hx::fsInt,(int)offsetof(FirstBootState_obj,curSelected),HX_("curSelected",fb,eb,ab,32)}, {::hx::fsObject /* ::flixel::addons::display::FlxBackdrop */ ,(int)offsetof(FirstBootState_obj,backdrop),HX_("backdrop",d6,b1,96,1a)}, {::hx::fsObject /* ::flixel::FlxSprite */ ,(int)offsetof(FirstBootState_obj,bg),HX_("bg",c5,55,00,00)}, {::hx::fsObject /* ::flixel::FlxSprite */ ,(int)offsetof(FirstBootState_obj,funnynote),HX_("funnynote",3c,ff,3e,fe)}, {::hx::fsObject /* ::flixel::group::FlxTypedGroup */ ,(int)offsetof(FirstBootState_obj,grpOptionsTexts),HX_("grpOptionsTexts",6d,2e,b1,bf)}, {::hx::fsBool,(int)offsetof(FirstBootState_obj,selectedSomethin),HX_("selectedSomethin",c8,ec,fb,99)}, { ::hx::fsUnknown, 0, null()} }; static ::hx::StaticInfo *FirstBootState_obj_sStaticStorageInfo = 0; #endif static ::String FirstBootState_obj_sMemberFields[] = { HX_("textMenuItems",74,ab,77,14), HX_("localeList",18,12,cb,fe), HX_("selectedsomething",bf,62,a0,80), HX_("curSelected",fb,eb,ab,32), HX_("backdrop",d6,b1,96,1a), HX_("bg",c5,55,00,00), HX_("funnynote",3c,ff,3e,fe), HX_("grpOptionsTexts",6d,2e,b1,bf), HX_("create",fc,66,0f,7c), HX_("selectedSomethin",c8,ec,fb,99), HX_("update",09,86,05,87), HX_("bringinthenote",4c,34,29,41), ::String(null()) }; ::hx::Class FirstBootState_obj::__mClass; void FirstBootState_obj::__register() { FirstBootState_obj _hx_dummy; FirstBootState_obj::_hx_vtable = *(void **)&_hx_dummy; ::hx::Static(__mClass) = new ::hx::Class_obj(); __mClass->mName = HX_("FirstBootState",4f,62,c9,d3); __mClass->mSuper = &super::__SGetClass(); __mClass->mConstructEmpty = &__CreateEmpty; __mClass->mConstructArgs = &__Create; __mClass->mGetStaticField = &::hx::Class_obj::GetNoStaticField; __mClass->mSetStaticField = &::hx::Class_obj::SetNoStaticField; __mClass->mStatics = ::hx::Class_obj::dupFunctions(0 /* sStaticFields */); __mClass->mMembers = ::hx::Class_obj::dupFunctions(FirstBootState_obj_sMemberFields); __mClass->mCanCast = ::hx::TCanCast< FirstBootState_obj >; #ifdef HXCPP_SCRIPTABLE __mClass->mMemberStorageInfo = FirstBootState_obj_sMemberStorageInfo; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mStaticStorageInfo = FirstBootState_obj_sStaticStorageInfo; #endif ::hx::_hx_RegisterClass(__mClass->mName, __mClass); }
50.831071
387
0.68722
BushsHaxs
4b8ea7f2aed29595e152b05388b165c9910b2f5b
9,121
cc
C++
base/linux_input.cc
rkb-1/quad
66ae3bc5ccb6db070bc1e32a3b9386f6d01a049e
[ "Apache-2.0" ]
64
2017-01-18T15:12:05.000Z
2022-02-16T08:28:11.000Z
base/linux_input.cc
rkb-1/quad
66ae3bc5ccb6db070bc1e32a3b9386f6d01a049e
[ "Apache-2.0" ]
2
2021-02-11T14:39:38.000Z
2021-10-03T16:49:57.000Z
base/linux_input.cc
rkb-1/quad
66ae3bc5ccb6db070bc1e32a3b9386f6d01a049e
[ "Apache-2.0" ]
14
2021-01-11T09:48:34.000Z
2021-12-16T16:20:35.000Z
// Copyright 2014-2020 Josh Pieper, jjp@pobox.com. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "linux_input.h" #include <linux/input.h> #include <boost/asio/posix/stream_descriptor.hpp> #include <boost/asio/post.hpp> #include <fmt/format.h> #include "mjlib/base/fail.h" #include "mjlib/base/system_error.h" namespace mjmech { namespace base { class LinuxInput::Impl : boost::noncopyable { public: Impl(const boost::asio::any_io_executor& executor) : executor_(executor) {} boost::asio::any_io_executor executor_; boost::asio::posix::stream_descriptor stream_{executor_}; struct input_event input_event_; std::map<int, AbsInfo> abs_info_; }; LinuxInput::LinuxInput(const boost::asio::any_io_executor& executor) : impl_(new Impl(executor)) {} LinuxInput::LinuxInput(const boost::asio::any_io_executor& executor, const std::string& device) : LinuxInput(executor) { Open(device); } LinuxInput::~LinuxInput() {} boost::asio::any_io_executor LinuxInput::get_executor() { return impl_->executor_; } void LinuxInput::Open(const std::string& device) { int fd = ::open(device.c_str(), O_RDONLY | O_NONBLOCK); if (fd < 0) { throw mjlib::base::system_error::syserrno("opening device: " + device); } impl_->stream_.assign(fd); auto f = features(EV_ABS); for (size_t i = 0; i < f.capabilities.size(); ++i) { if (!f.capabilities.test(i)) { continue; } struct cgabs { cgabs(int axis) : axis(axis) {} int name() const { return EVIOCGABS(axis); } void* data() { return &abs_info; } const int axis; struct input_absinfo abs_info; }; cgabs op(i); impl_->stream_.io_control(op); AbsInfo info; info.axis = i; info.minimum = op.abs_info.minimum; info.maximum = op.abs_info.maximum; info.fuzz = op.abs_info.fuzz; info.flat = op.abs_info.flat; info.resolution = op.abs_info.resolution; info.value = op.abs_info.value; impl_->abs_info_[i] = info; } } int LinuxInput::fileno() const { return impl_->stream_.native_handle(); } std::string LinuxInput::name() const { struct cgname { int name() const { return EVIOCGNAME(256); } void* data() { return buffer; } char buffer[257] = {}; }; cgname op; impl_->stream_.io_control(op); return std::string(op.buffer); } LinuxInput::AbsInfo LinuxInput::abs_info(int axis) const { auto it = impl_->abs_info_.find(axis); if (it != impl_->abs_info_.end()) { return it->second; } AbsInfo result; result.axis = axis; result.minimum = -100; result.maximum = 100; result.resolution = 100; return result; } LinuxInput::Features LinuxInput::features(int ev_type) const { struct cgbit { cgbit(int name) : name_(name) {} int name() const { return EVIOCGBIT(name_, sizeof(buffer)); } void* data() { return buffer; } const int name_; char buffer[256] = {}; }; cgbit op(ev_type); impl_->stream_.io_control(op); size_t end = [ev_type]() { switch (ev_type) { case EV_SYN: { return SYN_MAX; } case EV_KEY: { return KEY_MAX; } case EV_REL: { return REL_MAX; } case EV_ABS: { return ABS_MAX; } } mjlib::base::AssertNotReached(); }() / 8 + 1; Features result; result.ev_type = ev_type; for (size_t i = 0; i < end; i++) { for (int bit = 0; bit < 8; bit++) { result.capabilities.push_back((op.buffer[i] >> bit) & 0x1 ? true : false); } } return result; } void LinuxInput::AsyncRead(Event* event, mjlib::io::ErrorCallback handler) { impl_->stream_.async_read_some( boost::asio::buffer(&impl_->input_event_, sizeof(impl_->input_event_)), [event, handler=std::move(handler), this] ( mjlib::base::error_code ec, std::size_t size) mutable { if (ec) { ec.Append("reading input event"); boost::asio::post( impl_->executor_, std::bind(std::move(handler), ec)); return; } if (size != sizeof(impl_->input_event_)) { boost::asio::post( impl_->executor_, std::bind( std::move(handler), mjlib::base::error_code::einval("short read for input event"))); return; } event->ev_type = impl_->input_event_.type; event->code = impl_->input_event_.code; event->value = impl_->input_event_.value; /// Update our internal absolute structure if necessary. if (event->ev_type == EV_ABS) { auto it = impl_->abs_info_.find(event->code); if (it != impl_->abs_info_.end()) { it->second.value = event->value; } } boost::asio::post( impl_->executor_, std::bind(std::move(handler), mjlib::base::error_code())); }); } void LinuxInput::cancel() { impl_->stream_.cancel(); } std::ostream& operator<<(std::ostream& ostr, const LinuxInput& rhs) { ostr << fmt::format("<LinuxInput '{}'>", rhs.name()); return ostr; } namespace { std::string MapBitmask(boost::dynamic_bitset<> bitset, std::function<std::string (int)> mapper) { std::vector<std::string> elements; for (size_t i = 0; i < bitset.size(); i++) { if (bitset.test(i)) { elements.push_back(mapper(i)); } } std::ostringstream result; for (size_t i = 0; i < elements.size(); i++) { if (i != 0) { result << "|"; } result << elements[i]; } return result.str(); } std::string MapEvType(int ev_type) { switch (ev_type) { case EV_SYN: { return "EV_SYN"; } case EV_KEY: { return "EV_KEY"; } case EV_REL: { return "EV_REL"; } case EV_ABS: { return "EV_ABS"; } default: { return fmt::format("EV_{:02X}", ev_type); } } } std::string MapSyn(int code) { switch (code) { case SYN_REPORT: { return "SYN_REPORT"; } case SYN_CONFIG: { return "SYN_CONFIG"; } case SYN_MT_REPORT: { return "SYN_MT_REPORT"; } case SYN_DROPPED: { return "SYN_DROPPED"; } default: { return fmt::format("SYN_{:02X}", code); } } } std::string MapKey(int code) { return fmt::format("KEY_{:03X}", code); } std::string MapRel(int code) { switch (code) { case REL_X: { return "REL_X"; } case REL_Y: { return "REL_Y"; } case REL_Z: { return "REL_Z"; } case REL_RX: { return "REL_RX"; } case REL_RY: { return "REL_RY"; } case REL_RZ: { return "REL_RZ"; } case REL_HWHEEL: { return "REL_HWHEEL"; } case REL_DIAL: { return "REL_DIAL"; } case REL_WHEEL: { return "REL_WHEEL"; } case REL_MISC: { return "REL_MISC"; } default: { return fmt::format("REL_{:02X}", code); } } } std::string MapAbs(int code) { switch (code) { case ABS_X: { return "ABS_X"; } case ABS_Y: { return "ABS_Y"; } case ABS_Z: { return "ABS_Z"; } case ABS_RX: { return "ABS_RX"; } case ABS_RY: { return "ABS_RY"; } case ABS_RZ: { return "ABS_RZ"; } case ABS_HAT0X: { return "ABS_HAT0X"; } case ABS_HAT0Y: { return "ABS_HAT0Y"; } case ABS_HAT1X: { return "ABS_HAT1X"; } case ABS_HAT1Y: { return "ABS_HAT1Y"; } case ABS_HAT2X: { return "ABS_HAT2X"; } case ABS_HAT2Y: { return "ABS_HAT2Y"; } case ABS_HAT3X: { return "ABS_HAT3X"; } case ABS_HAT3Y: { return "ABS_HAT3Y"; } default: { return fmt::format("ABS_{:02X}", code); } } } std::string MapUnknown(int code) { return fmt::format("{:03X}", code); } std::function<std::string (int)> MakeCodeMapper(int ev_type) { switch (ev_type) { case EV_SYN: { return MapSyn; } case EV_KEY: { return MapKey; } case EV_REL: { return MapRel; } case EV_ABS: { return MapAbs; } default: { return MapUnknown; } } } } std::ostream& operator<<(std::ostream& ostr, const LinuxInput::AbsInfo& rhs) { ostr << fmt::format("<AbsInfo {} val={} min={} max={} scaled={}>", MapAbs(rhs.axis), rhs.value, rhs.minimum, rhs.maximum, rhs.scaled()); return ostr; } std::ostream& operator<<(std::ostream& ostr, const LinuxInput::Features& rhs) { ostr << fmt::format("<Features type={} {}>", MapEvType(rhs.ev_type), MapBitmask(rhs.capabilities, MakeCodeMapper(rhs.ev_type))); return ostr; } std::ostream& operator<<(std::ostream& ostr, const LinuxInput::Event& rhs) { ostr << fmt::format("<Event ev_type={} code={} value={}>", MapEvType(rhs.ev_type), MakeCodeMapper(rhs.ev_type)(rhs.code), rhs.value); return ostr; } } }
27.978528
82
0.609802
rkb-1
4b91b0f9fe178a22024479cf967d1b16dc4dbe2e
6,467
cpp
C++
OpenSimRoot/src/modules/WaterModule/WaterUptakeByRoots.cpp
nb-e/OpenRootSim
aaa1cd18e94ebf613c28737842401daba3b8d5ef
[ "BSD-3-Clause" ]
1
2021-08-03T00:52:58.000Z
2021-08-03T00:52:58.000Z
OpenSimRoot/src/modules/WaterModule/WaterUptakeByRoots.cpp
nb-e/OpenRootSim
aaa1cd18e94ebf613c28737842401daba3b8d5ef
[ "BSD-3-Clause" ]
null
null
null
OpenSimRoot/src/modules/WaterModule/WaterUptakeByRoots.cpp
nb-e/OpenRootSim
aaa1cd18e94ebf613c28737842401daba3b8d5ef
[ "BSD-3-Clause" ]
1
2021-08-03T00:52:59.000Z
2021-08-03T00:52:59.000Z
/* Copyright © 2016, The Pennsylvania State University All rights reserved. Copyright © 2016 Forschungszentrum Jülich GmbH All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted under the GNU General Public License v3 and provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. Disclaimer THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. You should have received the GNU GENERAL PUBLIC LICENSE v3 with this file in license.txt but can also be found at http://www.gnu.org/licenses/gpl-3.0.en.html NOTE: The GPL.v3 license requires that all derivative work is distributed under the same license. That means that if you use this source code in any other program, you can only distribute that program with the full source code included and licensed under a GPL license. */ #include "WaterUptakeByRoots.hpp" #include "../PlantType.hpp" WaterUptakeFromHopmans::WaterUptakeFromHopmans(SimulaDynamic* pSD):DerivativeBase(pSD) { //Check the units if(pSD->getUnit()=="cm3") { mode=1; }else if (pSD->getUnit()=="cm3/cm"){ mode=0; }else{ msg::error("WaterUptakeFromHopmans: expected unit cm3"); } //pointer to total transpiration of this plant SimulaBase *plant(pSD); PLANTTOP(plant) potentialTranspiration=plant->getChild("plantPosition")->getChild("shoot")->getChild("potentialTranspiration","cm3"); //pointer to segment length segmentLength=pSD->getSibling("rootSegmentLength","cm"); //check position of the root Coordinate pos; pSD->getAbsolute(pSD->getStartTime(),pos); if(pos.y>=0) mode=-1; //pointer to total root length totalRootLength=plant->existingChild("rootLengthBelowTheSurface",segmentLength->getUnit()); if(!totalRootLength){ totalRootLength=plant->getChild("rootLongitudinalGrowth",segmentLength->getUnit()); if(mode<0) msg::warning("WaterUptakeFromHopmans: rootsegment is above ground, but averaging potential transpiration over total root length. Consider adding rootLenthBelowTheSurface to your plant template."); } } void WaterUptakeFromHopmans::calculate(const Time &t,double &total){ if(mode==-1){ //root is above ground, set uptake to 0 total=0; return; } //get the total transpiration double tr; potentialTranspiration->getRate(t,tr); //get fraction double tl; totalRootLength->get(t,tl); if(tl!=0){ if(mode){ double sl; segmentLength->get(t,sl); total=tr*(sl/tl); }else{ total=tr/tl; } }else{ if (tr!=0)msg::warning("WaterUptakeFromHopmans: Transpiration but zero root length."); total=0; } } std::string WaterUptakeFromHopmans::getName()const{ return "waterUptakeFromHopmans"; } DerivativeBase * newInstantiationWaterUptakeFromHopmans(SimulaDynamic* const pSD){ return new WaterUptakeFromHopmans(pSD); } ScaledWaterUptake::ScaledWaterUptake(SimulaDynamic* pSD):DerivativeBase(pSD) { //Check the units if(pSD->getUnit()=="cm3") { length=nullptr; }else if (pSD->getUnit()=="cm3/cm"){ length=pSD->getSibling("rootSegmentLength","cm");; }else{ msg::error("ScaledWaterUptake: expected unit cm3"); } //pointer to total transpiration of this plant SimulaBase *plant(pSD); PLANTTOP(plant) actualTranspiration=plant->getChild("plantPosition")->getChild("shoot")->getChild("actualTranspiration","cm3");; total=plant->getChild("rootPotentialWaterUptake","cm3"); fraction=pSD->getSibling("rootSegmentPotentialWaterUptake","cm3"); } void ScaledWaterUptake::calculate(const Time &t,double &uptake){ //get the total transpiration actualTranspiration->getRate(t,uptake); //get fraction double tl; total->getRate(t,tl); if(tl!=0){ double sl; fraction->getRate(t,sl); uptake*=(sl/tl); if(length){ length->get(t,sl); if(sl>0){ uptake/=sl; }else{ uptake=0; } } }else{ uptake=0; } if(std::isnan(uptake)) msg::error("ScaledWaterUptake: value is nan"); } std::string ScaledWaterUptake::getName()const{ return "scaledWaterUptake"; } DerivativeBase * newInstantiationScaledWaterUptake(SimulaDynamic* const pSD){ return new ScaledWaterUptake(pSD); } GetValuesFromPlantWaterUptake::GetValuesFromPlantWaterUptake(SimulaDynamic* pSD):DerivativeBase(pSD){ SimulaBase * top=pSD->getParent(); if(!top->existingChild("plantPosition") ) { PLANTTOP(top); } wu=top->getChild("rootWaterUptakeCheck"); } std::string GetValuesFromPlantWaterUptake::getName()const{ return "getValuesFromPlantWaterUptake"; } void GetValuesFromPlantWaterUptake::calculate(const Time &t,double &var){ wu->get(t,var); } DerivativeBase * newInstantiationGetValuesFromPlantWaterUptake(SimulaDynamic* const pSD) { return new GetValuesFromPlantWaterUptake(pSD); } //Register the module class AutoRegisterWaterUptakeInstantiationFunctions { public: AutoRegisterWaterUptakeInstantiationFunctions() { BaseClassesMap::getDerivativeBaseClasses()["waterUptakeFromHopmans"] = newInstantiationWaterUptakeFromHopmans; BaseClassesMap::getDerivativeBaseClasses()["scaledWaterUptake"] = newInstantiationScaledWaterUptake; BaseClassesMap::getDerivativeBaseClasses()["getValuesFromPlantWaterUptake"] = newInstantiationGetValuesFromPlantWaterUptake; } }; // our one instance of the proxy static AutoRegisterWaterUptakeInstantiationFunctions l654645648435135753;
37.381503
755
0.772692
nb-e
4b9572f3d61de9388831bfdd40a78ae7f07c14db
3,409
hpp
C++
external/boost_1_60_0/qsboost/smart_ptr/detail/sp_counted_base.hpp
wouterboomsma/quickstep
a33447562eca1350c626883f21c68125bd9f776c
[ "MIT" ]
1
2019-06-27T17:54:13.000Z
2019-06-27T17:54:13.000Z
external/boost_1_60_0/qsboost/smart_ptr/detail/sp_counted_base.hpp
wouterboomsma/quickstep
a33447562eca1350c626883f21c68125bd9f776c
[ "MIT" ]
null
null
null
external/boost_1_60_0/qsboost/smart_ptr/detail/sp_counted_base.hpp
wouterboomsma/quickstep
a33447562eca1350c626883f21c68125bd9f776c
[ "MIT" ]
null
null
null
#ifndef QSBOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED #define QSBOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/sp_counted_base.hpp // // Copyright 2005-2013 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include <qsboost/config.hpp> #include <qsboost/smart_ptr/detail/sp_has_sync.hpp> #if defined( __clang__ ) && defined( __has_extension ) # if __has_extension( __c_atomic__ ) # define QSBOOST_SP_HAS_CLANG_C11_ATOMICS # endif #endif #if defined( QSBOOST_SP_DISABLE_THREADS ) # include <qsboost/smart_ptr/detail/sp_counted_base_nt.hpp> #elif defined( QSBOOST_SP_USE_STD_ATOMIC ) # include <qsboost/smart_ptr/detail/sp_counted_base_std_atomic.hpp> #elif defined( QSBOOST_SP_USE_SPINLOCK ) # include <qsboost/smart_ptr/detail/sp_counted_base_spin.hpp> #elif defined( QSBOOST_SP_USE_PTHREADS ) # include <qsboost/smart_ptr/detail/sp_counted_base_pt.hpp> #elif defined( QSBOOST_DISABLE_THREADS ) && !defined( QSBOOST_SP_ENABLE_THREADS ) && !defined( QSBOOST_DISABLE_WIN32 ) # include <qsboost/smart_ptr/detail/sp_counted_base_nt.hpp> #elif defined( QSBOOST_SP_HAS_CLANG_C11_ATOMICS ) # include <qsboost/smart_ptr/detail/sp_counted_base_clang.hpp> #elif defined( __SNC__ ) # include <qsboost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp> #elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) && !defined(__PATHSCALE__) # include <qsboost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp> #elif defined(__HP_aCC) && defined(__ia64) # include <qsboost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp> #elif defined( __GNUC__ ) && defined( __ia64__ ) && !defined( __INTEL_COMPILER ) && !defined(__PATHSCALE__) # include <qsboost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp> #elif defined( __IBMCPP__ ) && defined( __powerpc ) # include <qsboost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp> #elif defined( __MWERKS__ ) && defined( __POWERPC__ ) # include <qsboost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp> #elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX ) # include <qsboost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp> #elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) # include <qsboost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp> #elif defined( QSBOOST_SP_HAS_SYNC ) # include <qsboost/smart_ptr/detail/sp_counted_base_sync.hpp> #elif defined(__GNUC__) && ( defined( __sparcv9 ) || ( defined( __sparcv8 ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 402 ) ) ) # include <qsboost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp> #elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__) # include <qsboost/smart_ptr/detail/sp_counted_base_w32.hpp> #elif defined( _AIX ) # include <qsboost/smart_ptr/detail/sp_counted_base_aix.hpp> #elif !defined( QSBOOST_HAS_THREADS ) # include <qsboost/smart_ptr/detail/sp_counted_base_nt.hpp> #else # include <qsboost/smart_ptr/detail/sp_counted_base_spin.hpp> #endif #undef QSBOOST_SP_HAS_CLANG_C11_ATOMICS #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
36.265957
144
0.779114
wouterboomsma
4b978a1ff39635a620417cd5866024fc1900aea0
2,563
cc
C++
metrics/src/Meter.cc
benjamin-bader/cppmetrics
a5ab3295ad3a9774522f3bffa67732a0048a140e
[ "Apache-2.0" ]
7
2018-07-09T20:41:10.000Z
2022-01-04T07:41:11.000Z
metrics/src/Meter.cc
benjamin-bader/cppmetrics
a5ab3295ad3a9774522f3bffa67732a0048a140e
[ "Apache-2.0" ]
6
2018-07-09T20:54:51.000Z
2022-01-11T17:50:37.000Z
metrics/src/Meter.cc
benjamin-bader/cppmetrics
a5ab3295ad3a9774522f3bffa67732a0048a140e
[ "Apache-2.0" ]
2
2018-07-09T20:22:16.000Z
2019-02-07T20:44:56.000Z
// Copyright 2018 Benjamin Bader // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include <metrics/Meter.h> #include <metrics/Clock.h> #include <metrics/EWMA.h> namespace cppmetrics { namespace { using namespace std::chrono; using namespace std::chrono_literals; const long long kTickInterval = duration_cast<nanoseconds>(5s).count(); } Meter::Meter(Clock* clock) : m_clock(clock != nullptr ? clock : GetDefaultClock()) , m_count(0) , m_start_time(m_clock->tick()) , m_last_tick(m_start_time.count()) , m_m1( EWMA::one_minute() ) , m_m5( EWMA::five_minutes() ) , m_m15( EWMA::fifteen_minutes() ) {} void Meter::mark(long n) { tick_if_necessary(); m_count += n; m_m1->update(n); m_m5->update(n); m_m15->update(n); } void Meter::tick_if_necessary() { auto old_tick = m_last_tick.load(); auto new_tick = m_clock->tick().count(); auto age = new_tick - old_tick; if (age > kTickInterval) { auto new_interval_start_tick = new_tick - age % kTickInterval; if (std::atomic_compare_exchange_strong(&m_last_tick, &old_tick, new_interval_start_tick)) { auto required_ticks = age / kTickInterval; for (int i = 0; i < required_ticks; ++i) { m_m1->tick(); m_m5->tick(); m_m15->tick(); } } } } long Meter::get_count() const noexcept { return m_count.load(); } double Meter::get_m1_rate() { tick_if_necessary(); return m_m1->get_rate(std::chrono::seconds(1)); } double Meter::get_m5_rate() { tick_if_necessary(); return m_m5->get_rate(std::chrono::seconds(1)); } double Meter::get_m15_rate() { tick_if_necessary(); return m_m15->get_rate(std::chrono::seconds(1)); } double Meter::get_mean_rate() { auto count = get_count(); if (count == 0) { return 0.0; } constexpr auto kNanosPerSecond = std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::seconds(1)).count(); auto elapsed = m_clock->tick() - m_start_time; return static_cast<double>(count) / elapsed.count() * kNanosPerSecond; } }
23.731481
121
0.679672
benjamin-bader
4b9e620559db53c441cff1aeaaf21b598bec79e3
13,715
cpp
C++
Code/Components/PlayerComponent.cpp
Battledrake/CryShooter
42184444606e1dfd41c963c87f8d16bfef8656a1
[ "MIT" ]
1
2021-10-11T12:46:59.000Z
2021-10-11T12:46:59.000Z
Code/Components/PlayerComponent.cpp
Battledrake/CryShooter
42184444606e1dfd41c963c87f8d16bfef8656a1
[ "MIT" ]
null
null
null
Code/Components/PlayerComponent.cpp
Battledrake/CryShooter
42184444606e1dfd41c963c87f8d16bfef8656a1
[ "MIT" ]
null
null
null
#include "StdAfx.h" #include "PlayerComponent.h" #include <CrySchematyc/Env/IEnvRegistrar.h> #include <CrySchematyc/Env/Elements/EnvComponent.h> #include <CryCore/StaticInstanceList.h> #include "Components/CharacterComponent.h" namespace { static void RegisterPlayerComponent(Schematyc::IEnvRegistrar& registrar) { Schematyc::CEnvRegistrationScope scope = registrar.Scope(IEntity::GetEntityScopeGUID()); { Schematyc::CEnvRegistrationScope componentScope = scope.Register(SCHEMATYC_MAKE_ENV_COMPONENT(CPlayerComponent)); } } CRY_STATIC_AUTO_REGISTER_FUNCTION(&RegisterPlayerComponent); } void CPlayerComponent::Initialize() { m_inputFlags.Clear(); m_mouseDeltaRotation = ZERO; m_pCameraComponent = m_pEntity->GetOrCreateComponent<Cry::DefaultComponents::CCameraComponent>(); m_pCameraComponent->SetNearPlane(0.01f); m_pAudioListenerComponent = m_pEntity->GetOrCreateComponent<Cry::Audio::DefaultComponents::CListenerComponent>(); m_pInputComponent = m_pEntity->GetOrCreateComponent<Cry::DefaultComponents::CInputComponent>(); m_currentViewMode = EViewMode::ThirdPerson; m_viewBeforeSpectate = m_currentViewMode; RegisterInputs(); } Cry::Entity::EventFlags CPlayerComponent::GetEventMask() const { return Cry::Entity::EEvent::GameplayStarted | Cry::Entity::EEvent::Update | Cry::Entity::EEvent::Reset; } void CPlayerComponent::ProcessEvent(const SEntityEvent& event) { switch (event.event) { case Cry::Entity::EEvent::GameplayStarted: { m_pUIComponent = m_pEntity->GetOrCreateComponent<CUIComponent>(); m_lookOrientation = IDENTITY; } break; case Cry::Entity::EEvent::Update: { const float frameTime = event.fParam[0]; float travelSpeed = 0; float travelAngle = 0; // Check input to calculate local space velocity if (m_inputFlags & EInputFlag::MoveLeft) { travelAngle -= 1.0f; } if (m_inputFlags & EInputFlag::MoveRight) { travelAngle += 1.0f; } if (m_inputFlags & EInputFlag::MoveForward) { travelSpeed += 1.0f; } if (m_inputFlags & EInputFlag::MoveBack) { travelSpeed -= 1.0f; } const float rotationSpeed = 0.002f; const float rotationLimitsMinPitch = m_currentViewMode == EViewMode::ThirdPerson ? -0.8f : -1.3f; const float rotationLimitsMaxPitch = 1.5f; m_mouseDeltaRotation = m_mouseDeltaSmoothingFilter.Push(m_mouseDeltaRotation).Get(); Ang3 playerYPR = CCamera::CreateAnglesYPR(Matrix33(m_pEntity->GetLocalTM())); playerYPR.y = CLAMP(playerYPR.y + m_mouseDeltaRotation.y * rotationSpeed, rotationLimitsMinPitch, rotationLimitsMaxPitch); playerYPR.x += m_currentViewMode == EViewMode::Spectator ? m_mouseDeltaRotation.x * rotationSpeed : 0.0f; playerYPR.z = 0; Quat camOrientation = Quat(CCamera::CreateOrientationYPR(playerYPR)); m_pEntity->SetRotation(camOrientation); if (!m_pCharacter || m_currentViewMode == EViewMode::Spectator) { FreeMovement(travelSpeed, travelAngle, frameTime); } if (m_pCharacter && m_currentViewMode != EViewMode::Spectator) { UpdateCharacter(travelSpeed, travelAngle, rotationSpeed, frameTime); } m_mouseDeltaRotation = ZERO; CheckInteractables(); } break; case Cry::Entity::EEvent::Reset: { } break; } } void CPlayerComponent::FreeMovement(float travelSpeed, float travelAngle, float frameTime) { const float spectatorSpeed = 20.5f; Vec3 velocity = Vec3(travelAngle, travelSpeed, 0).normalized(); velocity.z = 0; Matrix34 transformation = m_pEntity->GetWorldTM(); transformation.AddTranslation(transformation.TransformVector(velocity * spectatorSpeed * frameTime)); m_pEntity->SetWorldTM(transformation); } void CPlayerComponent::UpdateCharacter(float travelSpeed, float travelAngle, float rotationSpeed, float frameTime) { Ang3 characterYPR = CCamera::CreateAnglesYPR(Matrix33(m_lookOrientation)); characterYPR.x += m_mouseDeltaRotation.x * rotationSpeed; characterYPR.z = 0; characterYPR.y = 0; m_lookOrientation = Quat(CCamera::CreateOrientationYPR(characterYPR)); m_pCharacter->UpdateRotation(m_lookOrientation); m_pCharacter->UpdateMovement(travelSpeed, travelAngle); m_pCharacter->UpdateLookOrientation(GetDirectionForIK()); const QuatT& entityOrientation = m_pCharacter->GetAnimComp()->GetCharacter()->GetISkeletonPose()->GetAbsJointByID(m_attachJointId); m_pEntity->SetPos(LERP(m_pEntity->GetPos(), entityOrientation.t + m_activePos, 5.0f * frameTime)); } Vec3 CPlayerComponent::GetDirectionForIK() { Vec3 finalLookDirection = m_pEntity->GetForwardDir(); if (m_currentViewMode == EViewMode::ThirdPerson) { finalLookDirection *= 2.0f; //We move the position out a bit to make 3rd person follow better } return finalLookDirection; } void CPlayerComponent::SetPosOnAttach() { const QuatT& entityOrientation = m_pCharacter->GetAnimComp()->GetCharacter()->GetISkeletonPose()->GetAbsJointByID(m_attachJointId); m_pEntity->SetLocalTM(Matrix34::Create(Vec3(1.0f), IDENTITY, entityOrientation.t + m_activePos)); m_currentViewMode = m_viewBeforeSpectate; } void CPlayerComponent::SetCharacter(CCharacterComponent* character) { m_pCharacter = character; m_attachJointId = m_pCharacter->GetAnimComp()->GetCharacter()->GetIDefaultSkeleton().GetJointIDByName("mixamorig:head"); m_activePos = m_thirdPersonPos; m_currentViewMode = EViewMode::ThirdPerson; } void CPlayerComponent::CheckInteractables() { Vec3 origin = m_pEntity->GetWorldPos(); Vec3 direction = m_pEntity->GetForwardDir(); float distance = m_currentViewMode == EViewMode::FirstPerson ? 1.5f : 3.0f; const unsigned int rayFlags = rwi_stop_at_pierceable | rwi_colltype_any; ray_hit hitInfo; if (gEnv->pPhysicalWorld->RayWorldIntersection(origin, direction * distance, ent_all, rayFlags, &hitInfo, 1, m_pCharacter->GetEntity()->GetPhysicalEntity())) { if (IEntity* pHitEntity = gEnv->pEntitySystem->GetEntityFromPhysics(hitInfo.pCollider)) { if (pHitEntity == m_pInteractEntity) return; if (CInterfaceComponent* pInterfaceComp = pHitEntity->GetComponent<CInterfaceComponent>()) { if (IInteractable* pInteractable = pInterfaceComp->GetInterface<IInteractable>()) { if (m_pInteractEntity) { if (IRenderNode* pRenderNode = m_pInteractEntity->GetRenderNode()) { pRenderNode->m_nHUDSilhouettesParam = RGBA8(0.0f, 0.0f, 0.0f, 0.0f); } } m_pInteractEntity = pHitEntity; if (IRenderNode* pRenderNode = pHitEntity->GetRenderNode()) { //RGBA8 for Silhouette is actually ABGR instead of RGBA pRenderNode->m_nHUDSilhouettesParam = RGBA8(1.0f, 0.0f, 0.0f, 255.0f); } SObjectData objData; pInteractable->Observe(m_pCharacter, objData); m_interactEvent.Invoke(objData, true); return; } } } } if (m_pInteractEntity) { m_interactEvent.Invoke(SObjectData(), false); if (IRenderNode* pRenderNode = m_pInteractEntity->GetRenderNode()) { pRenderNode->m_nHUDSilhouettesParam = RGBA8(0.0f, 0.0f, 0.0f, 0.0f); } m_pInteractEntity = nullptr; } } void CPlayerComponent::RegisterInputs() { m_pInputComponent->RegisterAction("player", "moveleft", [this](int activationMode, float value) { HandleInputFlagChange(EInputFlag::MoveLeft, (EActionActivationMode)activationMode); }); m_pInputComponent->BindAction("player", "moveleft", eAID_KeyboardMouse, EKeyId::eKI_A); m_pInputComponent->RegisterAction("player", "moveright", [this](int activationMode, float value) { HandleInputFlagChange(EInputFlag::MoveRight, (EActionActivationMode)activationMode); }); m_pInputComponent->BindAction("player", "moveright", eAID_KeyboardMouse, EKeyId::eKI_D); m_pInputComponent->RegisterAction("player", "moveforward", [this](int activationMode, float value) { HandleInputFlagChange(EInputFlag::MoveForward, (EActionActivationMode)activationMode); }); m_pInputComponent->BindAction("player", "moveforward", eAID_KeyboardMouse, EKeyId::eKI_W); m_pInputComponent->RegisterAction("player", "moveback", [this](int activationMode, float value) { HandleInputFlagChange(EInputFlag::MoveBack, (EActionActivationMode)activationMode); }); m_pInputComponent->BindAction("player", "moveback", eAID_KeyboardMouse, EKeyId::eKI_S); m_pInputComponent->RegisterAction("player", "mouse_rotateyaw", [this](int activationMode, float value) { m_mouseDeltaRotation.x -= value; }); m_pInputComponent->BindAction("player", "mouse_rotateyaw", eAID_KeyboardMouse, EKeyId::eKI_MouseX); m_pInputComponent->RegisterAction("player", "mouse_rotatepitch", [this](int activationMode, float value) { m_mouseDeltaRotation.y -= value; }); m_pInputComponent->BindAction("player", "mouse_rotatepitch", eAID_KeyboardMouse, EKeyId::eKI_MouseY); m_pInputComponent->RegisterAction("player", "jump", [this](int activationMode, float value) { if (m_pCharacter) m_pCharacter->ProcessJump(); }); m_pInputComponent->BindAction("player", "jump", eAID_KeyboardMouse, eKI_Space, true, false, false); m_pInputComponent->RegisterAction("player", "changeviewmode", [this](int activationMode, float value) { if (m_currentViewMode == EViewMode::Spectator) return; m_currentViewMode = m_currentViewMode == EViewMode::ThirdPerson ? EViewMode::FirstPerson : EViewMode::ThirdPerson; switch (m_currentViewMode) { case EViewMode::FirstPerson: { m_pCharacter->ChangeCharacter("Objects/Characters/exo_swat/exo_swat_1p.cdf", "FirstPersonCharacter"); m_activePos = m_firstPersonPos; m_attachJointId = m_pCharacter->GetAnimComp()->GetCharacter()->GetIDefaultSkeleton().GetJointIDByName("mixamorig:head"); } break; case EViewMode::ThirdPerson: { m_pCharacter->ChangeCharacter("Objects/Characters/exo_swat/exo_swat_3p.cdf", "ThirdPersonCharacter"); m_activePos = m_thirdPersonPos; m_attachJointId = m_pCharacter->GetAnimComp()->GetCharacter()->GetIDefaultSkeleton().GetJointIDByName("mixamorig:head"); } break; } }); m_pInputComponent->BindAction("player", "changeviewmode", eAID_KeyboardMouse, eKI_F, true, false, false); m_pInputComponent->RegisterAction("player", "interact", [this](int activationMode, float value) { if (!m_pCharacter || m_currentViewMode == EViewMode::Spectator) return; if (m_pInteractEntity) { if (CInterfaceComponent* pInterfaceComp = m_pInteractEntity->GetComponent<CInterfaceComponent>()) { if (IInteractable* pInteract = pInterfaceComp->GetInterface<IInteractable>()) { pInteract->Interact(m_pCharacter); } } } }); m_pInputComponent->BindAction("player", "interact", eAID_KeyboardMouse, eKI_E, true, false, false); m_pInputComponent->RegisterAction("player", "firebutton", [this](int activationMode, float value) { if (m_currentViewMode == EViewMode::Spectator) return; if (m_pCharacter) { switch (activationMode) { case EActionActivationMode::eAAM_OnPress: m_pCharacter->ProcessFire(true); break; case EActionActivationMode::eAAM_OnRelease: m_pCharacter->ProcessFire(false); break; default: break; } } }); m_pInputComponent->BindAction("player", "fireButton", eAID_KeyboardMouse, eKI_Mouse1, true, true, false); m_pInputComponent->RegisterAction("player", "reloadweapon", [this](int activationMode, float value) { if (m_currentViewMode == EViewMode::Spectator) return; if (m_pCharacter) { m_pCharacter->ProcessReload(); } }); m_pInputComponent->BindAction("player", "reloadweapon", eAID_KeyboardMouse, eKI_R, true, false, false); m_pInputComponent->RegisterAction("player", "switchfiremode", [this](int activationMode, float value) { if (m_currentViewMode == EViewMode::Spectator) return; if (m_pCharacter) { m_pCharacter->SwitchFireMode(); } }); m_pInputComponent->BindAction("player", "switchfiremode", eAID_KeyboardMouse, eKI_X, true, false, false); m_pInputComponent->RegisterAction("player", "swapweapons", [this](int activationMode, float value) { m_pCharacter->GetEquipmentComponent()->SwapWeapons(); }); m_pInputComponent->BindAction("player", "swapweapons", eAID_KeyboardMouse, eKI_Q, true, false, false); m_pInputComponent->RegisterAction("player", "sprint", [this](int activationMode, float value) { if (m_currentViewMode == EViewMode::Spectator) return; switch (activationMode) { case EActionActivationMode::eAAM_OnPress: if (m_pCharacter) { m_pCharacter->ProcessSprinting(true); } break; case EActionActivationMode::eAAM_OnRelease: if (m_pCharacter) { m_pCharacter->ProcessSprinting(false); } break; default: break; } }); m_pInputComponent->BindAction("player", "sprint", eAID_KeyboardMouse, eKI_LShift, true, true, false); m_pInputComponent->RegisterAction("player", "spectate", [this](int activationMode, float value) { if (m_currentViewMode == EViewMode::Spectator) { if (m_pCharacter) { m_pCharacter->GetEntity()->AttachChild(m_pEntity); SetPosOnAttach(); } } else { if (m_pCharacter) m_pEntity->DetachThis(); m_viewBeforeSpectate = m_currentViewMode; m_currentViewMode = EViewMode::Spectator; } }); m_pInputComponent->BindAction("player", "spectate", eAID_KeyboardMouse, eKI_F1, true, false, false); } void CPlayerComponent::HandleInputFlagChange(const CEnumFlags<EInputFlag> flags, const CEnumFlags<EActionActivationMode> activationMode, const EInputFlagType type) { switch (type) { case EInputFlagType::Hold: { if (activationMode == eAAM_OnRelease) { m_inputFlags &= ~flags; } else { m_inputFlags |= flags; } } break; case EInputFlagType::Toggle: { if (activationMode == eAAM_OnRelease) { // Toggle the bit(s) m_inputFlags ^= flags; } } break; } }
32.732697
192
0.741816
Battledrake
4b9f3cea2d12514a0b68770f7c965e39c90e1a91
2,838
cpp
C++
src/Adafruit_I2CRegister.cpp
nrobinson2000/Adafruit_VEML7700
ad29bfb331ad08ed6e40de68abae6455f99760bf
[ "BSD-3-Clause" ]
3
2019-07-19T23:47:53.000Z
2019-07-22T03:45:10.000Z
src/Adafruit_I2CRegister.cpp
nrobinson2000/Adafruit_VEML7700
ad29bfb331ad08ed6e40de68abae6455f99760bf
[ "BSD-3-Clause" ]
1
2019-11-15T22:59:55.000Z
2019-11-15T22:59:55.000Z
src/Adafruit_I2CRegister.cpp
nrobinson2000/Adafruit_VEML7700
ad29bfb331ad08ed6e40de68abae6455f99760bf
[ "BSD-3-Clause" ]
null
null
null
#include "Adafruit_I2CRegister.h" Adafruit_I2CRegister::Adafruit_I2CRegister(Adafruit_I2CDevice *device, uint16_t reg_addr, uint8_t width, uint8_t bitorder, uint8_t address_width) { _device = device; _addrwidth = address_width; _address = reg_addr; _bitorder = bitorder; _width = width; } bool Adafruit_I2CRegister::write(uint8_t *buffer, uint8_t len) { uint8_t addrbuffer[2] = {(uint8_t)(_address & 0xFF), (uint8_t)(_address>>8)}; if (! _device->write(buffer, len, true, addrbuffer, _addrwidth)) { return false; } return true; } bool Adafruit_I2CRegister::write(uint32_t value, uint8_t numbytes) { if (numbytes == 0) { numbytes = _width; } if (numbytes > 4) { return false; } for (int i=0; i<numbytes; i++) { if (_bitorder == LSBFIRST) { _buffer[i] = value & 0xFF; } else { _buffer[numbytes-i-1] = value & 0xFF; } value >>= 8; } return write(_buffer, numbytes); } // This does not do any error checking! returns 0xFFFFFFFF on failure uint32_t Adafruit_I2CRegister::read(void) { if (! read(_buffer, _width)) { return -1; } uint32_t value = 0; for (int i=0; i < _width; i++) { value <<= 8; if (_bitorder == LSBFIRST) { value |= _buffer[_width-i-1]; } else { value |= _buffer[i]; } } return value; } bool Adafruit_I2CRegister::read(uint8_t *buffer, uint8_t len) { _buffer[0] = _address; if (! _device->write_then_read(_buffer, 1, buffer, len)) { return false; } return true; } bool Adafruit_I2CRegister::read(uint16_t *value) { if (! read(_buffer, 2)) { return false; } if (_bitorder == LSBFIRST) { *value = _buffer[1]; *value <<= 8; *value |= _buffer[0]; } else { *value = _buffer[0]; *value <<= 8; *value |= _buffer[1]; } return true; } bool Adafruit_I2CRegister::read(uint8_t *value) { if (! read(_buffer, 1)) { return false; } *value = _buffer[0]; return true; } void Adafruit_I2CRegister::print(Stream *s) { uint32_t val = read(); s->print("0x"); s->print(val, HEX); } void Adafruit_I2CRegister::println(Stream *s) { print(s); s->println(); } Adafruit_I2CRegisterBits::Adafruit_I2CRegisterBits(Adafruit_I2CRegister *reg, uint8_t bits, uint8_t shift) { _register = reg; _bits = bits; _shift = shift; } uint32_t Adafruit_I2CRegisterBits::read(void) { uint32_t val = _register->read(); val >>= _shift; return val & ((1 << (_bits+1)) - 1); } void Adafruit_I2CRegisterBits::write(uint32_t data) { uint32_t val = _register->read(); // mask off the data before writing uint32_t mask = (1 << (_bits+1)) - 1; data &= mask; mask <<= _shift; val &= ~mask; // remove the current data at that spot val |= data << _shift; // and add in the new data _register->write(val, _register->width()); }
22
147
0.634249
nrobinson2000
4b9f4ffb8f7f140a3470bd0bf5449145af0bfa38
15,593
cpp
C++
tests/src/error_event_test.cpp
Appdynamics/iot-cpp-sdk
abb7d70b2364089495ac73adf2a992c0af6eaf8c
[ "Apache-2.0" ]
3
2018-09-13T21:26:27.000Z
2022-01-25T06:15:06.000Z
tests/src/error_event_test.cpp
Appdynamics/iot-cpp-sdk
abb7d70b2364089495ac73adf2a992c0af6eaf8c
[ "Apache-2.0" ]
11
2018-01-30T00:42:23.000Z
2019-10-20T07:19:37.000Z
tests/src/error_event_test.cpp
Appdynamics/iot-cpp-sdk
abb7d70b2364089495ac73adf2a992c0af6eaf8c
[ "Apache-2.0" ]
5
2018-01-29T18:52:21.000Z
2019-05-19T02:38:18.000Z
/* * Copyright (c) 2018 AppDynamics LLC and its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cgreen/cgreen.h> #include <appd_iot_interface.h> #include <time.h> #include <unistd.h> #include "common_test.hpp" #include "http_mock_interface.hpp" #include "log_mock_interface.hpp" using namespace cgreen; Describe(error_event); BeforeEach(error_event) { } AfterEach(error_event) { } /** * @brief Unit Test for valid alert and critical error event */ Ensure(error_event, test_full_alert_and_critical_error_event) { appd_iot_sdk_config_t sdkcfg; appd_iot_device_config_t devcfg; appd_iot_error_code_t retcode; appd_iot_init_to_zero(&sdkcfg, sizeof(sdkcfg)); sdkcfg.appkey = TEST_APP_KEY; sdkcfg.eum_collector_url = TEST_EUM_COLLECTOR_URL; sdkcfg.log_write_cb = &appd_iot_log_write_cb; sdkcfg.log_level = APPD_IOT_LOG_ALL; devcfg.device_id = "1111"; devcfg.device_type = "SmartCar"; devcfg.device_name = "AudiS3"; devcfg.fw_version = "1.0"; devcfg.hw_version = "1.0"; devcfg.os_version = "1.0"; devcfg.sw_version = "1.0"; appd_iot_clear_log_write_cb_flags(); retcode = appd_iot_init_sdk(sdkcfg, devcfg); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_error_event_t error_event_1, error_event_2; appd_iot_init_to_zero(&error_event_1, sizeof(appd_iot_error_event_t)); appd_iot_init_to_zero(&error_event_2, sizeof(appd_iot_error_event_t)); error_event_1.name = "Warning Light"; error_event_1.message = "Oil Change Reminder"; error_event_1.severity = APPD_IOT_ERR_SEVERITY_ALERT; error_event_1.timestamp_ms = ((int64_t)time(NULL) * 1000); error_event_1.duration_ms = 0; error_event_1.data_count = 1; error_event_1.data = (appd_iot_data_t*)calloc(error_event_1.data_count, sizeof(appd_iot_data_t)); appd_iot_data_set_integer(&error_event_1.data[0], "Mileage", 27300); retcode = appd_iot_add_error_event(error_event_1); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); error_event_2.name = "Bluetooth Connection Error"; error_event_2.message = "connection dropped during voice call due to bluetooth exception"; error_event_2.severity = APPD_IOT_ERR_SEVERITY_CRITICAL; error_event_2.timestamp_ms = ((int64_t)time(NULL) * 1000); error_event_2.duration_ms = 0; error_event_2.data_count = 3; error_event_2.data = (appd_iot_data_t*)calloc(error_event_2.data_count, sizeof(appd_iot_data_t)); appd_iot_data_set_string(&error_event_2.data[0], "UUID", "00001101-0000-1000-8000-00805f9b34fb"); appd_iot_data_set_string(&error_event_2.data[1], "Bluetooth Version", "3.0"); appd_iot_data_set_integer(&error_event_2.data[2], "Error Code", 43); retcode = appd_iot_add_error_event(error_event_2); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_http_cb_t http_cb; http_cb.http_req_send_cb = &appd_iot_test_http_req_send_cb; http_cb.http_resp_done_cb = &appd_iot_test_http_resp_done_cb; retcode = appd_iot_register_network_interface(http_cb); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_data_t* resp_headers = NULL; int resp_headers_count = 3; resp_headers = (appd_iot_data_t*)calloc(resp_headers_count, sizeof(appd_iot_data_t)); appd_iot_data_set_string(&resp_headers[0], "Pragma", "no-cache"); appd_iot_data_set_string(&resp_headers[1], "Transfer-Encoding", "chunked"); appd_iot_data_set_string(&resp_headers[2], "Expires", "0"); appd_iot_set_response_code(202); appd_iot_set_response_headers(resp_headers_count, resp_headers); appd_iot_clear_http_cb_triggered_flags(); retcode = appd_iot_send_all_events(); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); //test if callbacks are triggered assert_that(appd_iot_is_http_req_send_cb_triggered(), is_equal_to(true)); assert_that(appd_iot_is_http_resp_done_cb_triggered(), is_equal_to(true)); appd_iot_clear_http_cb_triggered_flags(); free(resp_headers); free(error_event_1.data); free(error_event_2.data); //test for log write cb assert_that(appd_iot_is_log_write_cb_success(), is_equal_to(true)); } /** * @brief Unit Test for minimal alert and critical error event */ Ensure(error_event, test_minimal_alert_and_critical_error_event) { appd_iot_sdk_config_t sdkcfg; appd_iot_device_config_t devcfg; appd_iot_error_code_t retcode; appd_iot_init_to_zero(&sdkcfg, sizeof(sdkcfg)); sdkcfg.appkey = TEST_APP_KEY; sdkcfg.eum_collector_url = TEST_EUM_COLLECTOR_URL; sdkcfg.log_write_cb = &appd_iot_log_write_cb; sdkcfg.log_level = APPD_IOT_LOG_ALL; devcfg.device_id = "1111"; devcfg.device_type = "SmartCar"; devcfg.device_name = "AudiS3"; devcfg.fw_version = "1.0"; devcfg.hw_version = "1.0"; devcfg.os_version = "1.0"; devcfg.sw_version = "1.0"; appd_iot_clear_log_write_cb_flags(); retcode = appd_iot_init_sdk(sdkcfg, devcfg); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_error_event_t error_event; appd_iot_init_to_zero(&error_event, sizeof(appd_iot_error_event_t)); error_event.name = "Tire Pressure Low"; error_event.timestamp_ms = ((int64_t)time(NULL) * 1000); retcode = appd_iot_add_error_event(error_event); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_http_cb_t http_cb; http_cb.http_req_send_cb = &appd_iot_test_http_req_send_cb; http_cb.http_resp_done_cb = &appd_iot_test_http_resp_done_cb; retcode = appd_iot_register_network_interface(http_cb); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_data_t* resp_headers = NULL; int resp_headers_count = 3; resp_headers = (appd_iot_data_t*)calloc(resp_headers_count, sizeof(appd_iot_data_t)); appd_iot_data_set_string(&resp_headers[0], "Pragma", "no-cache"); appd_iot_data_set_string(&resp_headers[1], "Transfer-Encoding", "chunked"); appd_iot_data_set_string(&resp_headers[2], "Expires", "0"); appd_iot_set_response_code(202); appd_iot_set_response_headers(resp_headers_count, resp_headers); appd_iot_clear_http_cb_triggered_flags(); retcode = appd_iot_send_all_events(); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); //test if callbacks are triggered assert_that(appd_iot_is_http_req_send_cb_triggered(), is_equal_to(true)); assert_that(appd_iot_is_http_resp_done_cb_triggered(), is_equal_to(true)); appd_iot_clear_http_cb_triggered_flags(); free(resp_headers); //test for log write cb assert_that(appd_iot_is_log_write_cb_success(), is_equal_to(true)); } /** * @brief Unit Test for valid fatal error event */ Ensure(error_event, test_full_fatal_error_event) { appd_iot_sdk_config_t sdkcfg; appd_iot_device_config_t devcfg; appd_iot_error_code_t retcode; appd_iot_init_to_zero(&sdkcfg, sizeof(sdkcfg)); sdkcfg.appkey = TEST_APP_KEY; sdkcfg.eum_collector_url = TEST_EUM_COLLECTOR_URL; sdkcfg.log_write_cb = &appd_iot_log_write_cb; sdkcfg.log_level = APPD_IOT_LOG_ALL; devcfg.device_id = "1111"; devcfg.device_type = "SmartCar"; devcfg.device_name = "AudiS3"; devcfg.fw_version = "1.0"; devcfg.hw_version = "1.0"; devcfg.os_version = "1.0"; devcfg.sw_version = "1.0"; appd_iot_clear_log_write_cb_flags(); retcode = appd_iot_init_sdk(sdkcfg, devcfg); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_error_event_t error_event; appd_iot_init_to_zero(&error_event, sizeof(appd_iot_error_event_t)); error_event.name = "I/O Exception"; error_event.message = "error while writing data to file"; error_event.severity = APPD_IOT_ERR_SEVERITY_FATAL; error_event.timestamp_ms = ((int64_t)time(NULL) * 1000); error_event.duration_ms = 0; error_event.stack_trace_count = 1; error_event.error_stack_trace_index = 0; appd_iot_stack_trace_t* stack_trace = (appd_iot_stack_trace_t*)calloc(error_event.stack_trace_count, sizeof(appd_iot_stack_trace_t)); stack_trace->stack_frame_count = 4; stack_trace->thread = "main"; appd_iot_stack_frame_t* stack_frame = (appd_iot_stack_frame_t*)calloc(stack_trace->stack_frame_count, sizeof(appd_iot_stack_frame_t)); stack_trace->stack_frame = stack_frame; stack_frame[0].symbol_name = "_libc_start_main"; stack_frame[0].package_name = "/system/lib/libc.so"; stack_frame[1].symbol_name = "main"; stack_frame[1].package_name = "/home/native-app/mediaplayer/build/mediaplayer_main.so"; stack_frame[1].absolute_addr = 0x7f8bd984876c; stack_frame[1].image_offset = 18861; stack_frame[1].symbol_offset = 10; stack_frame[1].file_name = "main.c"; stack_frame[1].lineno = 71; stack_frame[2].symbol_name = "write_data"; stack_frame[2].package_name = "/home/native-app/mediaplayer/build/mediaplayer_main.so"; stack_frame[2].absolute_addr = 0x7f8bda3f915b; stack_frame[2].image_offset = 116437; stack_frame[2].symbol_offset = 12; stack_frame[2].file_name = "writedata.c"; stack_frame[2].lineno = 271; stack_frame[3].symbol_name = "write_to_file"; stack_frame[3].package_name = "/home/native-app/mediaplayer/build/mediaplayer_main.so"; stack_frame[3].absolute_addr = 0x7f8bda9f69d1; stack_frame[3].image_offset = 287531; stack_frame[3].symbol_offset = 34; stack_frame[3].file_name = "writedata.c"; stack_frame[3].lineno = 524; error_event.stack_trace = stack_trace; error_event.data_count = 4; error_event.data = (appd_iot_data_t*)calloc(error_event.data_count, sizeof(appd_iot_data_t)); appd_iot_data_set_string(&error_event.data[0], "filename", "buffer-126543.mp3"); appd_iot_data_set_integer(&error_event.data[1], "filesize", 120000000); appd_iot_data_set_integer(&error_event.data[2], "signal number", 6); appd_iot_data_set_string(&error_event.data[3], "mediaplayer_version", "1.1"); retcode = appd_iot_add_error_event(error_event); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_http_cb_t http_cb; http_cb.http_req_send_cb = &appd_iot_test_http_req_send_cb; http_cb.http_resp_done_cb = &appd_iot_test_http_resp_done_cb; retcode = appd_iot_register_network_interface(http_cb); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_data_t* resp_headers = NULL; int resp_headers_count = 3; resp_headers = (appd_iot_data_t*)calloc(resp_headers_count, sizeof(appd_iot_data_t)); appd_iot_data_set_string(&resp_headers[0], "Pragma", "no-cache"); appd_iot_data_set_string(&resp_headers[1], "Transfer-Encoding", "chunked"); appd_iot_data_set_string(&resp_headers[2], "Expires", "0"); appd_iot_set_response_code(202); appd_iot_set_response_headers(resp_headers_count, resp_headers); appd_iot_clear_http_cb_triggered_flags(); retcode = appd_iot_send_all_events(); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); //test if callbacks are triggered assert_that(appd_iot_is_http_req_send_cb_triggered(), is_equal_to(true)); assert_that(appd_iot_is_http_resp_done_cb_triggered(), is_equal_to(true)); appd_iot_clear_http_cb_triggered_flags(); free(resp_headers); free(error_event.stack_trace->stack_frame); free(error_event.stack_trace); free(error_event.data); //test for log write cb assert_that(appd_iot_is_log_write_cb_success(), is_equal_to(true)); } /** * @brief Unit Test for null error event */ Ensure(error_event, test_null_error_event) { appd_iot_sdk_config_t sdkcfg; appd_iot_device_config_t devcfg; appd_iot_error_code_t retcode; appd_iot_init_to_zero(&sdkcfg, sizeof(sdkcfg)); sdkcfg.appkey = TEST_APP_KEY; sdkcfg.eum_collector_url = TEST_EUM_COLLECTOR_URL; sdkcfg.log_write_cb = &appd_iot_log_write_cb; sdkcfg.log_level = APPD_IOT_LOG_ALL; devcfg.device_id = "1111"; devcfg.device_type = "SmartCar"; devcfg.device_name = "AudiS3"; devcfg.fw_version = "1.0"; devcfg.hw_version = "1.0"; devcfg.os_version = "1.0"; devcfg.sw_version = "1.0"; appd_iot_clear_log_write_cb_flags(); retcode = appd_iot_init_sdk(sdkcfg, devcfg); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_error_event_t error_event; appd_iot_init_to_zero(&error_event, sizeof(appd_iot_error_event_t)); //null error event name retcode = appd_iot_add_error_event(error_event); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); //zero stack traces error_event.name = "SIGINT1"; error_event.stack_trace_count = 0; retcode = appd_iot_add_error_event(error_event); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); //null stack traces error_event.name = "SIGINT2"; error_event.stack_trace_count = 1; error_event.stack_trace = NULL; retcode = appd_iot_add_error_event(error_event); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); //null error stack frame error_event.name = "SIGINT3"; error_event.error_stack_trace_index = 0; appd_iot_stack_trace_t* stack_trace = (appd_iot_stack_trace_t*)calloc(error_event.stack_trace_count, sizeof(appd_iot_stack_trace_t)); error_event.stack_trace = stack_trace; stack_trace->stack_frame_count = 1; stack_trace->stack_frame = NULL; stack_trace->thread = "main"; retcode = appd_iot_add_error_event(error_event); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); //zero error stack frame count error_event.name = "SIGINT4"; stack_trace->stack_frame_count = 0; stack_trace->thread = "libc"; retcode = appd_iot_add_error_event(error_event); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); free(stack_trace); appd_iot_http_cb_t http_cb; http_cb.http_req_send_cb = &appd_iot_test_http_req_send_cb; http_cb.http_resp_done_cb = &appd_iot_test_http_resp_done_cb; retcode = appd_iot_register_network_interface(http_cb); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); appd_iot_data_t* resp_headers = NULL; int resp_headers_count = 3; resp_headers = (appd_iot_data_t*)calloc(resp_headers_count, sizeof(appd_iot_data_t)); appd_iot_data_set_string(&resp_headers[0], "Pragma", "no-cache"); appd_iot_data_set_string(&resp_headers[1], "Transfer-Encoding", "chunked"); appd_iot_data_set_string(&resp_headers[2], "Expires", "0"); appd_iot_set_response_code(202); appd_iot_set_response_headers(resp_headers_count, resp_headers); appd_iot_clear_http_cb_triggered_flags(); retcode = appd_iot_send_all_events(); assert_that(retcode, is_equal_to(APPD_IOT_SUCCESS)); //test if callbacks are triggered assert_that(appd_iot_is_http_req_send_cb_triggered(), is_equal_to(true)); assert_that(appd_iot_is_http_resp_done_cb_triggered(), is_equal_to(true)); appd_iot_clear_http_cb_triggered_flags(); free(resp_headers); //test for log write cb assert_that(appd_iot_is_log_write_cb_success(), is_equal_to(true)); } TestSuite* error_event_tests() { TestSuite* suite = create_test_suite(); add_test_with_context(suite, error_event, test_full_alert_and_critical_error_event); add_test_with_context(suite, error_event, test_minimal_alert_and_critical_error_event); add_test_with_context(suite, error_event, test_full_fatal_error_event); add_test_with_context(suite, error_event, test_null_error_event); return suite; }
33.897826
103
0.775669
Appdynamics
4ba1b62c5c53e99eaca43b4436efb9366426c299
4,566
cpp
C++
share/crts/plugins/Filters/readline.cpp
xywzwd/VT-Wireless
ec42e742e2be26310df4b25cef9cea873896890b
[ "MIT" ]
6
2019-01-05T08:30:32.000Z
2022-03-10T08:19:57.000Z
share/crts/plugins/Filters/readline.cpp
xywzwd/VT-Wireless
ec42e742e2be26310df4b25cef9cea873896890b
[ "MIT" ]
4
2019-10-18T14:31:04.000Z
2020-10-16T16:52:30.000Z
share/crts/plugins/Filters/readline.cpp
xywzwd/VT-Wireless
ec42e742e2be26310df4b25cef9cea873896890b
[ "MIT" ]
5
2017-05-12T21:24:18.000Z
2022-03-10T08:20:02.000Z
#include <stdio.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include <readline/readline.h> #include <readline/history.h> #include "crts/debug.h" #include "crts/Filter.hpp" #include "crts/crts.hpp" // for: FILE *crtsOut #define BUFLEN 1024 class Readline : public CRTSFilter { public: Readline(int argc, const char **argv); ~Readline(void); ssize_t write(void *buffer, size_t len, uint32_t channelNum); private: void run(void); const char *prompt; const char *sendPrefix; size_t sendPrefixLen; char *line; // last line read buffer }; static void usage(const char *arg = 0) { char name[64]; if(arg) fprintf(stderr, "module: %s: unknown option arg=\"%s\"\n", CRTS_BASENAME(name, 64), arg); fprintf(stderr, "\n" "\n" "Usage: %s [ OPTIONS ]\n" "\n" " OPTIONS are optional.\n" "\n" " As an example you can run something like this:\n" "\n" " crts_radio -f rx [ --uhd addr=192.168.10.3 --freq 932 ] -f stdout\n" "\n" "\n" " ---------------------------------------------------------------------------\n" " OPTIONS\n" " ---------------------------------------------------------------------------\n" "\n" "\n" " --prompt PROMPT \n" "\n" "\n" "\n --send-prefix PREFIX \n" "\n" "\n" "\n" "\n", CRTS_BASENAME(name, 64)); errno = 0; throw "usage help"; // This is how return an error from a C++ constructor // the module loader will catch this throw. } Readline::Readline(int argc, const char **argv): prompt("> "), sendPrefix("received: "), sendPrefixLen(strlen(sendPrefix)), line(0) { int i = 0; while(i<argc) { // TODO: Keep argument option parsing simple?? // // argv[0] is the first argument // if(!strcmp("--prompt", argv[i]) && i+1 < argc) { prompt = argv[++i]; ++i; continue; } if(!strcmp("--send-prefix", argv[i]) && i+1 < argc) { sendPrefix = argv[++i]; sendPrefixLen = strlen(sendPrefix); if(sendPrefixLen > BUFLEN/2) { fprintf(stderr,"argument: \"%s\" is to long\n\n", argv[i-1]); usage(); } ++i; continue; } usage(argv[i]); } // Because libuhd pollutes stdout we must use a different readline // prompt stream: rl_outstream = crtsOut; DSPEW(); } Readline::~Readline(void) { if(line) { free(line); line = 0; } // TODO: cleanup readline? } #define IS_WHITE(x) ((x) < '!' || (x) > '~') //#define IS_WHITE(x) ((x) == '\n') void Readline::run(void) { // get a line line = readline(prompt); if(!line) { stream->isRunning = false; return; } #if 0 fprintf(stderr, "%s:%d: GOT: \"%s\" prompt=\"%s\"\n", __BASE_FILE__, __LINE__, line, prompt); #endif // Strip off trailing white chars: size_t len = strlen(line); while(len && IS_WHITE(line[len -1])) line[--len] = '\0'; //fprintf(stderr, "\n\nline=\"%s\"\n\n", line); if(len < 1) { free(line); line = 0; return; // continue to next loop readline() } // TODO: add tab help, history saving, and other readline user // interface stuff. if(!strcmp(line, "exit") || !strcmp(line, "quit")) { stream->isRunning = false; return; } ssize_t bufLen = len + sendPrefixLen + 2; char *buffer = (char *) getBuffer(bufLen); memcpy(buffer, sendPrefix, sendPrefixLen); memcpy(&buffer[sendPrefixLen], line, len); buffer[bufLen-2] = '\n'; buffer[bufLen-1] = '\0'; // We do not add the sendPrefix to the history. Note: buffer was // '\0' terminated just above, so the history string is cool. add_history(line); free(line); // reset readline(). line = 0; writePush((void *) buffer, bufLen, CRTSFilter::ALL_CHANNELS); } // This call will block until we get input. // // We write to crtsOut // ssize_t Readline::write(void *buffer_in, size_t bufferLen_in, uint32_t channelNum) { // This module is a source. DASSERT(!buffer_in, ""); // Source filters loop like this, regular filters do not. while(stream->isRunning) run(); return 0; // done } // Define the module loader stuff to make one of these class objects. CRTSFILTER_MAKE_MODULE(Readline)
21.041475
82
0.529566
xywzwd
4ba4101a5bbb18c7916f7ba0dabc0272663d911e
5,194
hpp
C++
traceur-core/include/traceur/core/scene/primitive/box.hpp
fabianishere/traceur
93eefd77fc402dbd340dac7760a27b491c44a30f
[ "MIT" ]
2
2018-04-26T09:00:20.000Z
2019-11-02T08:09:03.000Z
traceur-core/include/traceur/core/scene/primitive/box.hpp
fabianishere/traceur
93eefd77fc402dbd340dac7760a27b491c44a30f
[ "MIT" ]
2
2018-01-08T14:43:17.000Z
2018-03-28T12:32:45.000Z
traceur-core/include/traceur/core/scene/primitive/box.hpp
fabianishere/traceur
93eefd77fc402dbd340dac7760a27b491c44a30f
[ "MIT" ]
null
null
null
/* * The MIT License (MIT) * * Copyright (c) 2017 Traceur authors * * 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 TRACEUR_CORE_SCENE_PRIMITIVE_BOX_H #define TRACEUR_CORE_SCENE_PRIMITIVE_BOX_H #include <limits> #include <traceur/core/scene/primitive/primitive.hpp> namespace traceur { /** * A primitive that represents a box. */ class Box : public Primitive { public: /** * An axis of the box. */ enum class Axis: int { X = 0, Y = 1, Z = 2 }; /** * The minimum vertex in the box. */ glm::vec3 min; /** * The maximum vertex in the box. */ glm::vec3 max; /** * Construct a {@link Box} instance. * * @param[in] material The material of the primitive. */ Box(const std::shared_ptr<traceur::Material> material) : Primitive(glm::vec3(), material), min(glm::vec3()), max(glm::vec3()) {} /** * Construct a {@link Box} instance. * * @param[in] min The minimum vertex in the box. * @param[in] max The maximum vertex in the box. * @param[in] material The material of the primitive. */ Box(const glm::vec3 &min, const glm::vec3 max, const std::shared_ptr<traceur::Material> material) : Primitive((min + max) / 2.f, material), min(min), max(max) {} /** * Construct a {@link Box} as bounding box. * * @return The bounding box instance. */ static Box createBoundingBox() { auto min = glm::vec3(std::numeric_limits<float>::infinity()); auto max = -min; return createBoundingBox(min, max); } /** * Construct a {@link Box} as bounding box. * * @param[in] min The minimum vertex in the box. * @param[in] max The maximum vertex in the box. * @return The bounding box instance. */ static Box createBoundingBox(const glm::vec3 &min, const glm::vec3 &max) { return Box(min, max, std::make_shared<traceur::Material>()); } /** * Determine whether the given ray intersects the shape. * * @param[in] ray The ray to intersect with this shape. * @param[in] hit The intersection structure to which the details will * be written to. * @return <code>true</code> if the shape intersects the ray, otherwise * <code>false</code>. */ inline virtual bool intersect(const traceur::Ray &ray, traceur::Hit &hit) const final { /* TODO precalculate inverse */ glm::vec3 inverse = 1.0f / ray.direction; auto u = (min - ray.origin) * inverse; auto v = (max - ray.origin) * inverse; float tmin = std::fmax(std::fmax(std::fmin(u[0], v[0]), std::fmin(u[1], v[1])), std::fmin(u[2], v[2])); float tmax = std::fmin(std::fmin(std::fmax(u[0], v[0]), std::fmax(u[1], v[1])), std::fmax(u[2], v[2])); if (tmax < 0) return false; if (tmin > tmax) return false; hit.primitive = this; hit.distance = tmin; hit.position = ray.origin + tmin * ray.direction; return true; } /** * Expand this {@link Box} with another box. * * @param[in] other The other box to expand with. * @return The next expanded box with the material properties of this * instance. */ traceur::Box expand(const traceur::Box &other) const { return traceur::Box(glm::min(min, other.min), glm::max(max, other.max), material); } /** * Accept a {@link SceneGraphVisitor} instance to visit this node in * the graph of the scene. * * @param[in] visitor The visitor to accept. */ inline virtual void accept(traceur::SceneGraphVisitor &visitor) const final { visitor.visit(*this); } /** * Return the bounding {@link Box} which encapsulates the whole * primitive. * * @return The bounding {@link Box} instance. */ virtual const traceur::Box & bounding_box() const final { return *this; } /** * Return the longest axis of this box. * * @return The longest axis of the box. */ traceur::Box::Axis longestAxis() const { auto length = max - min; if (length.x > length.y && length.x > length.z) return traceur::Box::Axis::X; if (length.y > length.x && length.y > length.z) return traceur::Box::Axis::Y; return traceur::Box::Axis::Z; } }; } #endif /* TRACEUR_CORE_SCENE_PRIMITIVE_PRIMITIVE_H */
29.01676
106
0.656912
fabianishere
4baa902f1c857f5cf35594d184ad7999702e3e25
1,043
cpp
C++
terminal/connimpls/TextCodecsDialog.cpp
chivstyle/comxd
d3eb006f866faf22cc8e1524afa0d99ae2049f79
[ "MIT" ]
null
null
null
terminal/connimpls/TextCodecsDialog.cpp
chivstyle/comxd
d3eb006f866faf22cc8e1524afa0d99ae2049f79
[ "MIT" ]
null
null
null
terminal/connimpls/TextCodecsDialog.cpp
chivstyle/comxd
d3eb006f866faf22cc8e1524afa0d99ae2049f79
[ "MIT" ]
null
null
null
// // (c) 2020 chiv // #include "terminal_rc.h" #include "TextCodecsDialog.h" #include "CodecFactory.h" TextCodecsDialog::TextCodecsDialog(const char* name) { CtrlLayout(*this); // this->Title(t_("Select a text codec")); this->Icon(terminal::text_codec()); // auto codec_names = CodecFactory::Inst()->GetSupportedCodecNames(); for (size_t k = 0; k < codec_names.size(); ++k) { mCodecs.Add(codec_names[k]); } mCodecs.SetData(name); // this->Acceptor(mOk, IDOK).Rejector(mCancel, IDCANCEL); } bool TextCodecsDialog::Key(Upp::dword key, int count) { dword flags = K_CTRL | K_ALT | K_SHIFT; dword d_key = key & ~(flags | K_KEYUP); // key with delta flags = key & flags; if (key & Upp::K_KEYUP) { if (flags == 0 && d_key == Upp::K_ESCAPE) { Close(); return true; } } return TopWindow::Key(key, count); } TextCodecsDialog::~TextCodecsDialog() { } Upp::String TextCodecsDialog::GetCodecName() const { return mCodecs.Get(); }
22.191489
70
0.610738
chivstyle
4bac72371db0bf99458292a1f74ab2846fdae963
4,461
cc
C++
ash/first_run/first_run_helper_unittest.cc
iplo/Chain
8bc8943d66285d5258fffc41bed7c840516c4422
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
231
2015-01-08T09:04:44.000Z
2021-12-30T03:03:10.000Z
ash/first_run/first_run_helper_unittest.cc
j4ckfrost/android_external_chromium_org
a1a3dad8b08d1fcf6b6b36c267158ed63217c780
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2017-02-14T21:55:58.000Z
2017-02-14T21:55:58.000Z
ash/first_run/first_run_helper_unittest.cc
j4ckfrost/android_external_chromium_org
a1a3dad8b08d1fcf6b6b36c267158ed63217c780
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
268
2015-01-21T05:53:28.000Z
2022-03-25T22:09:01.000Z
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ash/first_run/first_run_helper.h" #include "ash/first_run/desktop_cleaner.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" #include "ui/aura/test/event_generator.h" #include "ui/events/event_handler.h" #include "ui/views/window/dialog_delegate.h" namespace ash { namespace test { namespace { class TestModalDialogDelegate : public views::DialogDelegateView { public: TestModalDialogDelegate() {} virtual ~TestModalDialogDelegate() {} // Overridden from views::WidgetDelegate: virtual ui::ModalType GetModalType() const OVERRIDE { return ui::MODAL_TYPE_SYSTEM; } private: DISALLOW_COPY_AND_ASSIGN(TestModalDialogDelegate); }; class CountingEventHandler : public ui::EventHandler { public: // Handler resets |*mouse_events_registered_| during construction and updates // it after each registered event. explicit CountingEventHandler(int* mouse_events_registered) : mouse_events_registered_(mouse_events_registered) { *mouse_events_registered = 0; } virtual ~CountingEventHandler() {} private: // ui::EventHandler overrides. virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE { ++*mouse_events_registered_; } int* mouse_events_registered_; DISALLOW_COPY_AND_ASSIGN(CountingEventHandler); }; } // namespace class FirstRunHelperTest : public AshTestBase, public FirstRunHelper::Observer { public: FirstRunHelperTest() : cancelled_times_(0) {} virtual ~FirstRunHelperTest() {} virtual void SetUp() OVERRIDE { AshTestBase::SetUp(); CheckContainersAreVisible(); helper_.reset(ash::Shell::GetInstance()->CreateFirstRunHelper()); helper_->AddObserver(this); helper_->GetOverlayWidget()->Show(); } virtual void TearDown() OVERRIDE { EXPECT_TRUE(helper_.get()); helper_.reset(); CheckContainersAreVisible(); AshTestBase::TearDown(); } void CheckContainersAreVisible() const { aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow(); std::vector<int> containers_to_check = internal::DesktopCleaner::GetContainersToHideForTest(); for (size_t i = 0; i < containers_to_check.size(); ++i) { aura::Window* container = Shell::GetContainer(root_window, containers_to_check[i]); EXPECT_TRUE(container->IsVisible()); } } void CheckContainersAreHidden() const { aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow(); std::vector<int> containers_to_check = internal::DesktopCleaner::GetContainersToHideForTest(); for (size_t i = 0; i < containers_to_check.size(); ++i) { aura::Window* container = Shell::GetContainer(root_window, containers_to_check[i]); EXPECT_TRUE(!container->IsVisible()); } } FirstRunHelper* helper() { return helper_.get(); } int cancelled_times() const { return cancelled_times_; } private: // FirstRunHelper::Observer overrides. virtual void OnCancelled() OVERRIDE { ++cancelled_times_; } scoped_ptr<FirstRunHelper> helper_; int cancelled_times_; DISALLOW_COPY_AND_ASSIGN(FirstRunHelperTest); }; // This test creates helper, checks that containers are hidden and then // destructs helper. TEST_F(FirstRunHelperTest, ContainersAreHidden) { CheckContainersAreHidden(); } // Tests that helper correctly handles Escape key press. TEST_F(FirstRunHelperTest, Cancel) { GetEventGenerator().PressKey(ui::VKEY_ESCAPE, 0); EXPECT_EQ(cancelled_times(), 1); } // Tests that modal window doesn't block events for overlay window. TEST_F(FirstRunHelperTest, ModalWindowDoesNotBlock) { views::Widget* modal_dialog = views::DialogDelegate::CreateDialogWidget( new TestModalDialogDelegate(), CurrentContext(), NULL); modal_dialog->Show(); // TODO(dzhioev): modal window should not steal focus from overlay window. aura::Window* overlay_window = helper()->GetOverlayWidget()->GetNativeView(); overlay_window->Focus(); EXPECT_TRUE(overlay_window->HasFocus()); int mouse_events; overlay_window->SetEventFilter(new CountingEventHandler(&mouse_events)); GetEventGenerator().PressLeftButton(); GetEventGenerator().ReleaseLeftButton(); EXPECT_EQ(mouse_events, 2); } } // namespace test } // namespace ash
30.141892
79
0.732347
iplo
4bac771afa8d439dc79051fcccb0b4dfa4b5c3df
6,382
hpp
C++
libs/libnet/inc/net/post_mortem.hpp
mbits-os/JiraDesktop
eb9b66b9c11b2fba1079f03a6f90aea425ce6138
[ "MIT" ]
null
null
null
libs/libnet/inc/net/post_mortem.hpp
mbits-os/JiraDesktop
eb9b66b9c11b2fba1079f03a6f90aea425ce6138
[ "MIT" ]
null
null
null
libs/libnet/inc/net/post_mortem.hpp
mbits-os/JiraDesktop
eb9b66b9c11b2fba1079f03a6f90aea425ce6138
[ "MIT" ]
null
null
null
/* * Copyright (C) 2013 midnightBITS * * 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 __POST_MORTEM_HPP__ #define __POST_MORTEM_HPP__ #include <thread> #include <net/filesystem.hpp> #ifdef WIN32 # include <windows.h> # pragma warning(push) // warning C4091: 'typedef ': ignored on left of 'tagSTRUCT' when no variable is declared # pragma warning(disable: 4091) # include <DbgHelp.h> # pragma warning(pop) # pragma comment(lib, "dbghelp.lib") #endif namespace pm { #ifdef WIN32 class Win32PostMortemSupport { static fs::path tempDir() { auto size = GetTempPath(0, nullptr); if (!size) return fs::current_path(); ++size; std::unique_ptr<WCHAR[]> path{ new WCHAR[size] }; if (!GetTempPath(size, path.get())) return fs::current_path(); return path.get(); } static std::wstring buildPath() { auto temp = tempDir(); temp /= "MiniDump.dmp"; temp.make_preferred(); return temp.wstring(); } static LPCWSTR dumpPath() { static std::wstring path = buildPath(); return path.c_str(); } static void Write(_EXCEPTION_POINTERS* ep) { auto mdt = static_cast<MINIDUMP_TYPE>( MiniDumpWithDataSegs | MiniDumpWithFullMemory | MiniDumpWithFullMemoryInfo | MiniDumpWithHandleData | MiniDumpWithThreadInfo | MiniDumpWithProcessThreadData | MiniDumpWithUnloadedModules ); auto file = CreateFileW(dumpPath(), GENERIC_READ | GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); if (file && file != INVALID_HANDLE_VALUE) { wchar_t buffer[2048]; MINIDUMP_EXCEPTION_INFORMATION mei{ GetCurrentThreadId(), ep, TRUE }; if (!MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), file, mdt, ep ? &mei : nullptr, nullptr, nullptr)) { auto err = GetLastError(); CloseHandle(file); DeleteFileW(dumpPath()); if (!err) { swprintf_s(buffer, L"An error occured, but memory was not dumped due to unknown reason."); } else { swprintf_s(buffer, L"An error occured, but memory was not dumped due to error %08x.", err); } } else { CloseHandle(file); if (ep) { swprintf_s(buffer, L"An error %08x occured at %p (thread %u), memory dumped to:\n\n%s", ep->ExceptionRecord->ExceptionCode, ep->ExceptionRecord->ExceptionAddress, GetCurrentThreadId(), dumpPath()); } else { swprintf_s(buffer, L"An unkown error occured, memory dumped to:\n\n%s", dumpPath()); } } buffer[__countof(buffer) - 1] = 0; MessageBoxW(nullptr, buffer, L"This program perfomed illegal operation", MB_ICONINFORMATION); } TerminateProcess(GetCurrentProcess(), 1); } public: template <class Fn, class... Args> static void Run(Fn&& fn, Args&&... args) { (void)dumpPath(); // build file path now for any OOM later... _EXCEPTION_POINTERS* exception = nullptr; __try { fn(std::forward<Args>(args)...); } __except (exception = GetExceptionInformation(), EXCEPTION_EXECUTE_HANDLER) { Write(exception); } } }; template <class Fn, class... Args> inline void PostMortemSupport(Fn&& fn, Args&&... args) { Win32PostMortemSupport::Run(std::forward<Fn>(fn), std::forward<Args>(args)...); } #else // !WIN32 template <class Fn, class... Args> inline void PostMortemSupport(Fn&& fn, Args&&... args) { fn(std::forward<Args>(args)...); } #endif // WIN32 template <class Fn, class... Args> inline std::thread thread(Fn&& fn, Args&&... args) { return std::thread{ PostMortemSupport<Fn, Args...>, std::forward<Fn>(fn), std::forward<Args>(args)... }; } }; #define BEGIN_MSG_MAP_POSTMORTEM(theClass) \ public: \ BOOL ProcessWindowMessage(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, \ _In_ LPARAM lParam, _Inout_ LRESULT& lResult, _In_ DWORD dwMsgMapID = 0) \ { \ BOOL retVal = FALSE; \ pm::PostMortemSupport([&, this] () mutable { \ auto innerLambda = [&, this] () mutable -> BOOL { \ BOOL bHandled = TRUE; \ (hWnd); \ (uMsg); \ (wParam); \ (lParam); \ (lResult); \ (bHandled); \ switch (dwMsgMapID) \ { \ case 0: #define END_MSG_MAP_POSTMORTEM() \ break; \ default: \ ATLTRACE(static_cast<int>(ATL::atlTraceWindowing), 0, _T("Invalid message map ID (%i)\n"), dwMsgMapID); \ ATLASSERT(FALSE); \ break; \ } \ return FALSE; \ }; \ retVal = innerLambda(); \ }); \ return retVal; \ } #endif // __POST_MORTEM_HPP__
35.455556
135
0.579912
mbits-os
4baecd5806579f89491db2fd56bdba15f2b80c43
398
cc
C++
src/rpcz/singleton_service_factory.cc
jinq0123/rpcz
d273dc1a8de770cb4c2ddee98c17ce60c657d6ca
[ "Apache-2.0" ]
4
2015-06-14T13:38:40.000Z
2020-11-07T02:29:59.000Z
src/rpcz/singleton_service_factory.cc
jinq0123/rpcz
d273dc1a8de770cb4c2ddee98c17ce60c657d6ca
[ "Apache-2.0" ]
1
2015-06-19T07:54:53.000Z
2015-11-12T10:38:21.000Z
src/rpcz/singleton_service_factory.cc
jinq0123/rpcz
d273dc1a8de770cb4c2ddee98c17ce60c657d6ca
[ "Apache-2.0" ]
3
2015-06-15T02:28:39.000Z
2018-10-18T11:02:59.000Z
// Author: Jin Qing (http://blog.csdn.net/jq0123) #include <rpcz/singleton_service_factory.hpp> #include <boost/make_shared.hpp> #include <rpcz/mono_state_service.hpp> namespace rpcz { singleton_service_factory::singleton_service_factory(iservice& svc) : service_(svc) { } iservice* singleton_service_factory::create() { return new mono_state_service(service_); } } // namespace rpcz
18.952381
67
0.761307
jinq0123
4bb00ec52fa391009712feab2ff8571f0761c394
976
cc
C++
components/services/storage/filesystem_proxy_factory.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
14,668
2015-01-01T01:57:10.000Z
2022-03-31T23:33:32.000Z
components/services/storage/filesystem_proxy_factory.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
113
2015-05-04T09:58:14.000Z
2022-01-31T19:35:03.000Z
components/services/storage/filesystem_proxy_factory.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
5,941
2015-01-02T11:32:21.000Z
2022-03-31T16:35:46.000Z
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/services/storage/filesystem_proxy_factory.h" #include <utility> #include "base/bind.h" #include "base/no_destructor.h" namespace storage { namespace { std::unique_ptr<FilesystemProxy> CreateUnrestrictedFilesystemProxy() { return std::make_unique<FilesystemProxy>(FilesystemProxy::UNRESTRICTED, base::FilePath()); } FilesystemProxyFactory& GetFactory() { static base::NoDestructor<FilesystemProxyFactory> factory{ base::BindRepeating(&CreateUnrestrictedFilesystemProxy)}; return *factory; } } // namespace void SetFilesystemProxyFactory(FilesystemProxyFactory factory) { GetFactory() = std::move(factory); } std::unique_ptr<FilesystemProxy> CreateFilesystemProxy() { return GetFactory().Run(); } } // namespace storage
25.684211
73
0.735656
zealoussnow
4bb42b810567dbe097568b23e35fd8026be52179
332
hpp
C++
dynamic/wrappers/cell_based/AbstractCellPopulationBoundaryCondition3_3.cppwg.hpp
jmsgrogan/PyChaste
48a9863d2c941c71e47ecb72e917b477ba5c1413
[ "FTL" ]
6
2017-02-04T16:10:53.000Z
2021-07-01T08:03:16.000Z
dynamic/wrappers/cell_based/AbstractCellPopulationBoundaryCondition3_3.cppwg.hpp
jmsgrogan/PyChaste
48a9863d2c941c71e47ecb72e917b477ba5c1413
[ "FTL" ]
6
2017-06-22T08:50:41.000Z
2019-12-15T20:17:29.000Z
dynamic/wrappers/cell_based/AbstractCellPopulationBoundaryCondition3_3.cppwg.hpp
jmsgrogan/PyChaste
48a9863d2c941c71e47ecb72e917b477ba5c1413
[ "FTL" ]
3
2017-05-15T21:33:58.000Z
2019-10-27T21:43:07.000Z
#ifndef AbstractCellPopulationBoundaryCondition3_3_hpp__pyplusplus_wrapper #define AbstractCellPopulationBoundaryCondition3_3_hpp__pyplusplus_wrapper namespace py = pybind11; void register_AbstractCellPopulationBoundaryCondition3_3_class(py::module &m); #endif // AbstractCellPopulationBoundaryCondition3_3_hpp__pyplusplus_wrapper
47.428571
78
0.915663
jmsgrogan
4bb4d54b0dff96d9c2763aae213775de552d7c5c
4,830
cxx
C++
plugins/examples/noise.cxx
kahlertfr/cgv
a48139eb8af777ab63c78c09fc6aa44592908bc7
[ "BSD-3-Clause" ]
null
null
null
plugins/examples/noise.cxx
kahlertfr/cgv
a48139eb8af777ab63c78c09fc6aa44592908bc7
[ "BSD-3-Clause" ]
null
null
null
plugins/examples/noise.cxx
kahlertfr/cgv
a48139eb8af777ab63c78c09fc6aa44592908bc7
[ "BSD-3-Clause" ]
null
null
null
#include <cgv/gui/provider.h> #include <cgv/gui/dialog.h> #include <cgv/gui/file_dialog.h> #include <cgv/data/data_format.h> #include <cgv/os/clipboard.h> #include <cgv/data/data_view.h> #include <cgv/media/image/image_writer.h> #include <cgv/render/drawable.h> #include <cgv/render/context.h> #include <cgv/render/texture.h> #include <cgv/render/attribute_array_binding.h> #include <cgv/render/frame_buffer.h> #include <cgv/render/shader_program.h> #include <cgv_gl/gl/gl.h> #include <cgv/math/ftransform.h> #include <random> using namespace cgv::base; using namespace cgv::gui; using namespace cgv::data; using namespace cgv::render; using namespace cgv::utils; using namespace cgv::type; class noise : public node, public drawable, public provider { bool recreate_texture; protected: bool interpolate; float density; int w, h; int mode; texture T; public: noise() { set_name("noise"); w = 256; h = 128; mode = 0; recreate_texture = true; density = 0.5f; interpolate = false; T.set_mag_filter(TF_NEAREST); T.set_wrap_s(cgv::render::TW_REPEAT); T.set_wrap_t(cgv::render::TW_REPEAT); } void on_set(void* member_ptr) { if (member_ptr == &interpolate) { T.set_mag_filter(interpolate ? TF_LINEAR : TF_NEAREST); } if (member_ptr == &w || member_ptr == &h || member_ptr == &mode || member_ptr == &density) { recreate_texture = true; } update_member(member_ptr); post_redraw(); } void save() { std::string file_name = file_save_dialog("save noise to file", "Image Files (bmp,png,jpg,tif):*.bmp;*.png;*.jpg;*.tif|All Files:*.*"); if (file_name.empty()) return; std::vector<rgba8> data(w*h); create_texture_data(data); cgv::data::data_format df(w, h, cgv::type::info::TI_UINT8, cgv::data::CF_RGBA); cgv::data::data_view dv(&df, &data.front()); cgv::media::image::image_writer ir(file_name); ir.write_image(dv); } void copy() { std::vector<rgba8> data(w*h); create_texture_data(data); std::vector<rgb8> rgb_data(w*h); for (size_t i = 0; i < data.size(); ++i) rgb_data[i] = data[i]; cgv::os::copy_rgb_image_to_clipboard(w, h, &rgb_data.front()[0]); cgv::gui::message("copied image to clipboard"); } void create_gui() { add_member_control(this, "w", (cgv::type::DummyEnum&)w, "dropdown", "enums='4=4,8=8,16=16,32=32,64=64,128=128,256=256,512=512'"); add_member_control(this, "h", (cgv::type::DummyEnum&)h, "dropdown", "enums='4=4,8=8,16=16,32=32,64=64,128=128,256=256,512=512'"); add_member_control(this, "mode", (DummyEnum&)mode, "dropdown", "enums='grey=0;white,brown'"); add_member_control(this, "density", density, "value_slider", "min=0;max=1;ticks=true"); add_member_control(this, "interpolate", interpolate, "toggle"); connect_copy(add_button("save to file")->click, cgv::signal::rebind(this, &noise::save)); connect_copy(add_button("copy to clipboard")->click, cgv::signal::rebind(this, &noise::copy)); } bool init(context& ctx) { return true; } void draw_quad(context& ctx) { const vec2 P[4] = { vec2(-1,1), vec2(-1,-1), vec2(1,1), vec2(1,-1) }; const vec2 T[4] = { vec2(0,1), vec2(0.0f,0.0f), vec2(1,1), vec2(1.0f,0.0f) }; attribute_array_binding::set_global_attribute_array(ctx, 0, P, 4); attribute_array_binding::enable_global_array(ctx, 0); attribute_array_binding::set_global_attribute_array(ctx, 3, T, 4); attribute_array_binding::enable_global_array(ctx, 3); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); attribute_array_binding::disable_global_array(ctx, 3); attribute_array_binding::disable_global_array(ctx, 0); } void create_texture_data(std::vector<rgba8>& data) { std::default_random_engine g; std::uniform_int_distribution<cgv::type::uint32_type> d(0,255); for (auto& c : data) { cgv::type::uint8_type v = d(g); if (mode == 1) v = v < density*255 ? 0 : 255; else if (mode == 2) v = (v + d(g) + d(g) + d(g))/4; c[0] = c[1] = c[2] = v; c[3] = 255; } } void init_frame(context& ctx) { if (!recreate_texture) return; std::vector<rgba8> data(w*h); create_texture_data(data); cgv::data::data_format df(w, h, cgv::type::info::TI_UINT8, cgv::data::CF_RGBA); cgv::data::data_view dv(&df, &data.front()); T.create(ctx, dv); recreate_texture = false; } void draw(context& ctx) { glDisable(GL_CULL_FACE); ctx.push_modelview_matrix(); ctx.mul_modelview_matrix(cgv::math::scale4<double>(double(w) / h, -1.0, 1.0)); ctx.ref_default_shader_program(true).enable(ctx); ctx.set_color(rgb(1, 1, 1)); T.enable(ctx); draw_quad(ctx); T.disable(ctx); ctx.ref_default_shader_program(true).disable(ctx); ctx.pop_modelview_matrix(); glEnable(GL_CULL_FACE); } }; #include <cgv/base/register.h> /// register a factory to create new cubes extern cgv::base::factory_registration<noise> noise_fac("new/algorithms/noise", 'N');
30.764331
131
0.68323
kahlertfr
4bb9ead4e506077a4414a01d0d8c39b7458eb9d3
1,508
cpp
C++
src/tests/src/loader/token-test.cpp
Penguin-Guru/imgbrd-grabber
69bdd5566dc2b2cb3a67456bf1a159d544699bc9
[ "Apache-2.0" ]
1,449
2015-03-16T02:21:41.000Z
2022-03-31T22:49:10.000Z
src/tests/src/loader/token-test.cpp
sisco0/imgbrd-grabber
89bf97ccab3df62286784baac242f00bf006d562
[ "Apache-2.0" ]
2,325
2015-03-16T02:23:30.000Z
2022-03-31T21:38:26.000Z
src/tests/src/loader/token-test.cpp
evanjs/imgbrd-grabber
491f8f3c05be3fc02bc10007735c5afa19d47449
[ "Apache-2.0" ]
242
2015-03-22T11:00:54.000Z
2022-03-31T12:37:15.000Z
#include "loader/token.h" #include "catch.h" TEST_CASE("Token") { SECTION("LazyNotCalled") { int callCount = 0; Token token([&callCount]() { return ++callCount; }); REQUIRE(callCount == 0); } SECTION("LazyWithCaching") { int callCount = 0; Token token([&callCount]() { return ++callCount; }, true); token.value(); int val = token.value().toInt(); REQUIRE(callCount == 1); REQUIRE(val == 1); } SECTION("LazyWithoutCaching") { int callCount = 0; Token token([&callCount]() { return ++callCount; }, false); token.value(); int val = token.value().toInt(); REQUIRE(callCount == 2); REQUIRE(val == 2); } SECTION("Compare") { REQUIRE(Token(13) == Token(13)); REQUIRE(Token(13) != Token(17)); REQUIRE(Token("test") == Token("test")); REQUIRE(Token("test") != Token("not_test")); REQUIRE(Token(QStringList() << "1" << "2") == Token(QStringList() << "1" << "2")); REQUIRE(Token(QStringList() << "1" << "2") != Token(QStringList() << "1" << "2" << "3")); } SECTION("Value") { Token token(13); QVariant val = token.value(); REQUIRE(val.toInt() == 13); const QVariant &valRef = token.value(); REQUIRE(valRef.toInt() == 13); } SECTION("Value template") { REQUIRE(Token(13).value<int>() == 13); Token token("test"); REQUIRE(token.value<QString>() == "test"); QString val = token.value<QString>(); REQUIRE(val.toUpper() == "TEST"); const QString &valRef = token.value<QString>(); REQUIRE(valRef.toUpper() == "TEST"); } }
19.842105
91
0.596154
Penguin-Guru
4bbedc44c3bc6733c71401f63541e7b6d10c51c7
7,795
cpp
C++
test/readme-example.cpp
gabrielheinrich/pure-cpp
c774b135745bbb8b47a5bdfd728063e4ea0268fb
[ "BSL-1.0" ]
8
2019-06-27T02:28:03.000Z
2021-12-16T17:57:22.000Z
test/readme-example.cpp
gabrielheinrich/pure-cpp
c774b135745bbb8b47a5bdfd728063e4ea0268fb
[ "BSL-1.0" ]
null
null
null
test/readme-example.cpp
gabrielheinrich/pure-cpp
c774b135745bbb8b47a5bdfd728063e4ea0268fb
[ "BSL-1.0" ]
null
null
null
#if defined(__GNUC__) #pragma GCC diagnostic ignored "-Wunused-comparison" #pragma GCC diagnostic ignored "-Wunused-variable" #endif #if defined (_MSC_VER) #pragma warning (disable : 4553 4834 4521) #endif #include <pure/core.hpp> // Not strictly necessary but highly recommended using namespace pure; int main() { // ****************************************************** // # Builtin Categories // ****************************************************** // Nil auto n = nullptr; // Bool auto b = true; // Int auto i = 0; // Double auto d = 0.0; // Character auto c = 'a'; // String auto s = "String"; auto s_id = STR ("String"); // Compile-time constexpr // Vector auto v = VEC (1, true, "Hello World"); // Function auto f = [] (auto&& name) { return concat ("Hello ", FORWARD(name)); }; auto m = MAP (STR ("a"), 1, STR ("b"), 2, STR ("c"), 3); // Set auto S = [] (const auto& x) -> bool { return x < 10 && (x % 2 == 0); }; // Error auto e = operation_not_supported(); // Error // Object auto o = IO::fopen ("test.txt", "w"); // ****************************************************** // # Sets // ****************************************************** // Sets are named in uppercase by convention // They are called like functions Nil (nullptr); Nil (0) == false; Bool (true); Int (123); // Range of Integers 0, 1, .. 10 Ints <0, 10> (7); Double (123.0); Character (U'\u00DF'); String ("Hello World"); String (STR ("ns::name")); Vector<Ints <1, 3>> (VEC (1, 2, 3)); Vector<Any> (VEC (1, "2", '3')); Tuple<Int, String, Character> (VEC (1, "2", '3')); Function<String, Int> (MAP ("a", 1, "b", 2, "c", 3)); Record<STR ("name"), String, STR ("age"), Int> (MAP (STR ("name"), "Albert", STR ("age"), 99)); Set<Any> (Set<Any>); // Every boolean function is a set Set<Any> ([] (int x) -> bool {return x % 2 == 0;}); Error (operation_not_supported()); Object (stdout); Any (nullptr); None (nullptr) == false; // ****************************************************** // # Gradual typesystem // ****************************************************** // var is the most basic type to hold arbitrary values var x = "Hello World"; var x_1 = 42; var x_2 = VEC ("Hello", "World"); var x_3 = stdout; // There are multiple other types, which all inherit from var, but add // further restrictions // uniquely owned heap allocated Object of unknown type unique<> x_unique = "Hello World"; // ref counted heap allocated Object of unknown type shared<> x_shared = "Hello World"; // Object of type Basic::String with dynamically handled ownership some<Basic::String> x_string = "Hello World"; // Some Basic::String or nullptr maybe<Basic::String> x_maybe_string = nullptr; // Allocated on the stack immediate<Boxed<const char*>> x_cstring = "Hello World"; // 'fully' typed string unique<Basic::String> x_unique_string = "Hello World"; // ****************************************************** // # Domains // ****************************************************** // Every type has a domain, which is a constexpr set domain<unique<Basic::String>> ("Hello World"); // true // A type's domain can be restricted restrict<var, String> x_restricted = "Hello World"; // Ok // Domains can be used for static and dynamic checking // This wouldn't compile because domain<int> and String don't overlap // restrict <var, String> x_restricted = 42; Static Error // This will compile, but throw an exception at runtime try { restrict<var, Ints<0, 10>> x_dyn_restricted = 42; // Dynamic Error } catch (...) { } // ****************************************************** // # Basic Operations // ****************************************************** // operators == != < > <= >= + - * / % work as known from C++ true == 1.0; // true // equal checks strict value equality equal (true, 1.0) == false; // Vectors and strings are also comparable VEC (1, 2, 3) < VEC (1, 2, 4); compare (VEC (1, 2, 3), VEC (1, 2, 4)) == -1; // Comparison operators can be used accross categories VEC (1, 2, 3) != "1, 2, 3"; // ****************************************************** // # Functional // ****************************************************** // All strings, vectors, functions and sets are functional values // apply applies some arguments to a functional value apply (Int, 1) == true; apply (compare, 3, 5) == -1; apply (MAP ("a", 1, "b", 2), "b") == 2; pure::apply (VEC (1, 2, 3), 1) == 2; apply ("Hello", 2) == 'l'; // Functions, sets (and some vectors) also forward the call operator to // apply Int (1) == true; compare (3, 5) == -1; MAP ("a", 1, "b", 2) ("b") == 2; // set (f, key, value) returns a new value in which key is mapped to value set (MAP (), "a", 1) == MAP ("a", 1); set (VEC (nullptr, 2, 3), 0, 1) == VEC (1, 2, 3); set ("Hello", 4, U'\u00F8') == u8"Hellø"; // ****************************************************** // # Enumerable // ****************************************************** // All strings and vectors and some functions and sets are enumerable Enumerable ("Hello World"); Enumerable (VEC (1, 2, 3)); Enumerable (MAP ("a", 1, "b", 2)); Enumerable ([] (const auto& x) {return x + 1;}) == false; Enumerable (Any) == false; // Elements of enumerable values can be accessed through nth nth (VEC (1, 2, 3), 0) == 1; first (VEC (1, 2, 3)) == 1; second (VEC (1, 2, 3)) == 2; // count returns the number of elements in an enumerable value count (VEC (1, 2, 3)) == 3; count (MAP ("a", 1, "b", 2)) == 2; Empty (VEC()); // append (v, element) returns a vector with element added to v append (VEC (1, 2), 3) == VEC (1, 2, 3); append (VEC (1, 2, 3), "End") == VEC (1, 2, 3, "End"); // concat (v1, v2) returns a vector that is the concatenation of v1 and v2 concat (VEC (1, 2), VEC (3, 4)) == VEC (1, 2, 3, 4); // Functional style iteration map ([] (auto&& x) {return x * 2;}, VEC (1, 2, 3)) == VEC (2, 4, 6); filter (Int, VEC (1, 1.0, 2, "Hello World", 3)) == VEC (1, 2, 3); reduce ([] (int result, int next) {return result + next;}, 0, VEC(1, 2, 3)) == 6; // There's also support for traditional style iteration through the // enumerator interface auto accumulate = [] (const auto& vec, auto result) { for (auto e = enumerate (vec); !e.empty(); e.next()) { result += e.read(); } return result; }; accumulate (VEC (1, 2, 3), 0) == 6; // ****************************************************** // # Formatting // ****************************************************** // Values are printed in a JSON style to_string (VEC (1, 2, 3)) == "[1, 2, 3]"; to_string (MAP (STR ("a"), 1, STR("b"), 2)) == "{\"a\" : 1, \"b\" : 2}"; // ****************************************************** // # Records // ****************************************************** // Enumerable functions, which only have strings as keys are called // records. // If MAP is called with compile-time strings as keys, it returns an // efficient tuple-like struct. // Here the memory layout of the return value is equivalent to // struct {double x; double y;} auto point = MAP (STR ("x"), 1.0, STR ("y"), 2.0); point ("x") == 1.0; point (STR ("y")) == 2.0; // Compile-time lookup through type of STR ("y") // Sets can be used to check 'type' auto Point_2D = Record <STR ("x"), Double, STR ("y"), Double>; Point_2D (point); // ****************************************************** // # IO // ****************************************************** // By convention all functions, which 'do' something, i.e. have // side-effects, should be in the namespace IO IO::print ("Hello World!"); IO::print_to (IO::fopen("test_tmp_file.txt", "w"), "Hello temporary file!"); return 0; }
28.658088
82
0.515202
gabrielheinrich
4bbfdcd60fab0aa46b4517c697884bd31f954f5d
7,617
cpp
C++
gloom/src/Stars.cpp
DennisNTNU/TDT4230-Project
be84beb61c9e7dadf27b4b4752fa157e6843cf14
[ "MIT" ]
null
null
null
gloom/src/Stars.cpp
DennisNTNU/TDT4230-Project
be84beb61c9e7dadf27b4b4752fa157e6843cf14
[ "MIT" ]
null
null
null
gloom/src/Stars.cpp
DennisNTNU/TDT4230-Project
be84beb61c9e7dadf27b4b4752fa157e6843cf14
[ "MIT" ]
null
null
null
#include "Stars.h" #include <iostream> #include "Asterism.h" Stars::Stars(Gloom::Shader * shader, std::string starChartPath) { _shader = shader; _modelMatrix = glm::mat4(1.0f); if (readStarChart(starChartPath)) { std::cout << "Failed to read starchart file!" << std::endl; } initVAO_Stars(); initVAO_Asterisms(); } Stars::~Stars() { } void Stars::draw(glm::mat4 * perspView) { _shader->activate(); glPointSize(2.0f); glBindVertexArray(_vaoID_stars); glUniformMatrix4fv(2, 1, GL_FALSE, &(_modelMatrix[0][0])); glUniformMatrix4fv(3, 1, GL_FALSE, &((*perspView)[0][0])); glDrawArrays(GL_POINTS, 0, _vertexCount_stars); //glDrawArrays(GL_LINE_STRIP, 0, _vertexCount_stars); //glDrawArrays(GL_LINES, 0, _vertexCount_stars); //glDrawArrays(GL_TRIANGLES, 0, _vertexCount_stars); //glDrawArrays(GL_TRIANGLE_FAN, 0, _vertexCount_stars); glPointSize(1.0f); glBindVertexArray(_vaoID_asterisms); glUniformMatrix4fv(2, 1, GL_FALSE, &(_modelMatrix[0][0])); glUniformMatrix4fv(3, 1, GL_FALSE, &((*perspView)[0][0])); glDrawArrays(GL_LINES, 0, _vertexCount_asterisms); _shader->deactivate(); } void Stars::initVAO_Stars() { glGenVertexArrays(1, &_vaoID_stars); glBindVertexArray(_vaoID_stars); unsigned int _vboID[2]; glGenBuffers(2, _vboID); // one vertex per star _vertexCount_stars = int(stars.size()); int numDoubles = 3 * _vertexCount_stars; // positions int numFloats = 4 * _vertexCount_stars; // colors double* vertexPoses = new double[numDoubles]; float* vertexColors = new float[numFloats]; int k = 0; int j = 0; double dist = 0.0; for (unsigned int i = 0; i < _vertexCount_stars; i++) { dist = (600.0 + stars[i].dist) * 6378.0/8.0; vertexPoses[k++] = dist * cos(stars[i].ra*3.141592653589793238462 / 12.0) * cos(stars[i].dec*3.141592653589793238462 / 180.0); vertexPoses[k++] = dist * sin(stars[i].ra*3.141592653589793238462 / 12.0) * cos(stars[i].dec*3.141592653589793238462 / 180.0); vertexPoses[k++] = dist * sin(stars[i].dec*3.141592653589793238462 / 180.0); //float factor = 0.9f - 0.9f * (*stars)[i].mag / 8.0f; float factor = float(1.0 / (1.0 + pow(2.718281828, stars[i].mag - 3.5))); vertexColors[j++] = factor; vertexColors[j++] = factor; vertexColors[j++] = factor; vertexColors[j++] = 1.0; } glBindBuffer(GL_ARRAY_BUFFER, _vboID[0]); glBufferData(GL_ARRAY_BUFFER, numDoubles*sizeof(double), vertexPoses, GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_DOUBLE, GL_FALSE, 3 * sizeof(double), 0); glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, _vboID[1]); glBufferData(GL_ARRAY_BUFFER, numFloats*sizeof(float), vertexColors, GL_STATIC_DRAW); glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0); glEnableVertexAttribArray(1); delete[] vertexPoses; delete[] vertexColors; } void Stars::initVAO_Asterisms() { glGenVertexArrays(1, &_vaoID_asterisms); glBindVertexArray(_vaoID_asterisms); unsigned int _vboID[2]; glGenBuffers(2, _vboID); Asterism asterisms; asterisms.init(); _vertexCount_asterisms = 2 * asterisms.edges.size(); //_vertexCount_asterisms = 2 * 2; double* vertexPoses = new double[3 * _vertexCount_asterisms]; float* vertexColors = new float[4 * _vertexCount_asterisms]; for (unsigned int i = 0; i < _vertexCount_asterisms / 2; i++) { int indexStart = hip_to_index[asterisms.edges[i].star1]; int indexEnd = hip_to_index[asterisms.edges[i].star2]; //double distStart = (150.0 + stars[indexStart].dist) * 6378.0; //double distEnd = (150.0 + stars[indexEnd].dist) * 6378.0; double distStart = (600.0 + stars[indexStart].dist) * 6378.0/8.0; double distEnd = (600.0 + stars[indexEnd].dist) * 6378.0/8.0; vertexPoses[6 * i + 0] = distStart * cos(stars[indexStart].ra*3.141592653589793238462 / 12.0) * cos(stars[indexStart].dec*3.141592653589793238462 / 180.0); vertexPoses[6 * i + 1] = distStart * sin(stars[indexStart].ra*3.141592653589793238462 / 12.0) * cos(stars[indexStart].dec*3.141592653589793238462 / 180.0); vertexPoses[6 * i + 2] = distStart * sin(stars[indexStart].dec*3.141592653589793238462 / 180.0); vertexPoses[6 * i + 3] = distEnd * cos(stars[indexEnd].ra*3.141592653589793238462 / 12.0) * cos(stars[indexEnd].dec*3.141592653589793238462 / 180.0); vertexPoses[6 * i + 4] = distEnd * sin(stars[indexEnd].ra*3.141592653589793238462 / 12.0) * cos(stars[indexEnd].dec*3.141592653589793238462 / 180.0); vertexPoses[6 * i + 5] = distEnd * sin(stars[indexEnd].dec*3.141592653589793238462 / 180.0); vertexColors[8 * i + 0] = 0.7; vertexColors[8 * i + 1] = 0.7; vertexColors[8 * i + 2] = 0.9; vertexColors[8 * i + 3] = 0.3; vertexColors[8 * i + 4] = 0.7; vertexColors[8 * i + 5] = 0.7; vertexColors[8 * i + 6] = 0.9; vertexColors[8 * i + 7] = 0.3; } glBindBuffer(GL_ARRAY_BUFFER, _vboID[0]); glBufferData(GL_ARRAY_BUFFER, 3 * _vertexCount_asterisms * sizeof(double), vertexPoses, GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_DOUBLE, GL_FALSE, 3 * sizeof(double), 0); glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, _vboID[1]); glBufferData(GL_ARRAY_BUFFER, 4 * _vertexCount_asterisms * sizeof(float), vertexColors, GL_STATIC_DRAW); glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0); glEnableVertexAttribArray(1); delete[] vertexPoses; delete[] vertexColors; } bool Stars::readStarChart(std::string path) { std::ifstream file(path, std::ios::in); if (file.fail()) { perror(path.c_str()); return true; } std::vector<std::string> rawData; file.seekg(0, std::ios::beg); char line[256]; while (!file.eof()) { file.getline(line, 160); rawData.emplace_back(std::string(line)); } file.close(); int k = int(rawData.size()); Star star; std::string temp; int valueID; int starIndex = 0; double maxDist = 0.0; double filterDist = 1200.0; double filterMag = 7.0; // Iterates through each line i.e. through stars for (int i = 1; i < k; i++) { temp = ""; valueID = 0; // iterates through chars in line for (unsigned int j = 0; j < rawData[i].size(); j++) { if (rawData[i][j] == ',') { switch (++valueID) { case 1: star.id = atoi(temp.c_str()); break; case 2: star.hip = atoi(temp.c_str()); break; case 8: // right ascention star.ra = atof(temp.c_str()); break; case 9: // declination star.dec = atof(temp.c_str()); break; case 10: // distance star.dist = atof(temp.c_str()); break; case 11: // magnitude star.mag = atof(temp.c_str()); break; case 12: // absolute Magnitude star.absMag = atof(temp.c_str()); j = 160; break; default: break; } temp = ""; } else { temp = temp + rawData[i][j]; } } if (star.mag < filterMag && star.dist < filterDist) { stars.emplace_back(star); hip_to_index[star.hip] = starIndex++; if (maxDist < star.dist) { maxDist = star.dist; } } if (i % 1500 == 0) { std::cout << i << " "; } } std::cout << " There are " << stars.size() << " stars with magnitude less than " << filterMag << " and nearer than " << filterDist << ". Maximal Distance of those is " << maxDist << std::endl; //std::cout << "ID: " << stars[0].id << " RA: " << stars[0].ra << " Dec: " << stars[0].dec << " Dist: " << stars[0].dist << " AbsMag: " << stars[0].absMag << std::endl; return false; }
29.183908
194
0.64251
DennisNTNU
4bc3323da969d2e0b764d6a19c6cf7cda8ac9f12
168
cpp
C++
demos/http_demo.cpp
nathanmullenax83/rhizome
e7410341fdc4d38ab5aaecc55c94d3ac6efd51da
[ "MIT" ]
1
2020-07-11T14:53:38.000Z
2020-07-11T14:53:38.000Z
demos/http_demo.cpp
nathanmullenax83/rhizome
e7410341fdc4d38ab5aaecc55c94d3ac6efd51da
[ "MIT" ]
1
2020-07-04T16:45:49.000Z
2020-07-04T16:45:49.000Z
demos/http_demo.cpp
nathanmullenax83/rhizome
e7410341fdc4d38ab5aaecc55c94d3ac6efd51da
[ "MIT" ]
null
null
null
#include "http_demo.hpp" namespace rhizome { namespace demo { void http_demo() { rn::HTTPServer server(8080,10); } } }
16.8
43
0.505952
nathanmullenax83
4bc36bae0a9f615755d7491639d71fdbe8239104
25,663
cc
C++
SimMuon/CSCDigitizer/src/CSCGasCollisions.cc
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
SimMuon/CSCDigitizer/src/CSCGasCollisions.cc
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
SimMuon/CSCDigitizer/src/CSCGasCollisions.cc
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
// This implements the CSC gas ionization simulation. // It requires the GEANT3-generated tables in the input file // (default) MuonData/EndcapData/collisions.dat // Outstanding problems to fix 15-Oct-2003 // - ework must be re-tuned once eion or ework are removed before delta e range // estimation. // - logic of long-range delta e's must be revisited. // - The code here needs to have diagnostic output removed, or reduced. // PARTICULARLY filling of std::vectors! // - 'gap' is a misnomer, when simhit entry and exit don't coincide with gap // edges // so the CSCCrossGap might better be named as a simhit-related thing. // 22-Jan-2004 Corrected position of trap for 'infinite' loop while // generating steps. Output files (debugV-flagged only) require SC flag. // Increase deCut from 10 keV to 100 keV to accomodate protons! // Mar-2015: cout to LogVerbatim. Change superseded debugV-flagged code to flag // from config. #include "DataFormats/GeometryVector/interface/LocalVector.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/FileInPath.h" #include "FWCore/Utilities/interface/Exception.h" #include "SimMuon/CSCDigitizer/src/CSCGasCollisions.h" #include "CLHEP/Random/RandExponential.h" #include "CLHEP/Random/RandFlat.h" // Only needed if file writing code is activated again // #include <iostream> #include <cassert> #include <fstream> // stdlib math functions // for 'abs': #include <cstdlib> // for usual math functions: #include <cmath> // stdlib container trickery // for 'for_each': #include <algorithm> // for 'greater' and 'less': #include <functional> // for 'accumulate': #include <iterator> #include <numeric> using namespace std; /* Gas mixture is Ar/CO2/CF4 = 40/50/10 We'll use the ionization energies Ar 15.8 eV CO2 13.7 eV CF4 17.8 to arrive at a weighted average of eion = 14.95 */ CSCGasCollisions::CSCGasCollisions(const edm::ParameterSet &pset) : me("CSCGasCollisions"), gasDensity(2.1416e-03), deCut(1.e05), eion(14.95), ework(34.0), clusterExtent(0.001), theGammaBins(N_GAMMA, 0.), theEnergyBins(N_ENERGY, 0.), theCollisionTable(N_ENTRIES, 0.), theCrossGap(nullptr), theParticleDataTable(nullptr), saveGasCollisions_(false), dumpGasCollisions_(false) { dumpGasCollisions_ = pset.getUntrackedParameter<bool>("dumpGasCollisions"); edm::LogInfo(me) << "Constructing a " << me << ":"; edm::LogInfo(me) << "gas density = " << gasDensity << " g/cm3"; edm::LogInfo(me) << "max eloss per collision allowed = " << deCut / 1000. << " keV (for higher elosses, hits should have been simulated.)"; edm::LogInfo(me) << "ionization threshold = " << eion << " eV"; edm::LogInfo(me) << "effective work function = " << ework << " eV"; edm::LogInfo(me) << "cluster extent = " << clusterExtent * 1.e04 << " micrometres"; edm::LogInfo(me) << "dump gas collision and simhit information? " << dumpGasCollisions(); edm::LogInfo(me) << "save gas collision information? -NOT YET IMPLEMENTED- " << saveGasCollisions(); readCollisionTable(); } CSCGasCollisions::~CSCGasCollisions() { edm::LogInfo(me) << "Destructing a " << me; delete theCrossGap; } void CSCGasCollisions::readCollisionTable() { // I'd prefer to allow comments in the data file which means // complications of reading line-by-line and then item-by-item. // Is float OK? Or do I need double? // Do I need any sort of error trapping? // We use the default CMSSW data file path // We use the default file name 'collisions.dat' // This can be reset in .orcarc by SimpleConfigurable // Muon:Endcap:CollisionsFile // TODO make configurable string colliFile = "SimMuon/CSCDigitizer/data/collisions.dat"; edm::FileInPath f1{colliFile}; edm::LogInfo(me) << ": reading " << f1.fullPath(); ifstream fin{f1.fullPath()}; if (fin.fail()) { string errorMessage = "Cannot open input file " + f1.fullPath(); edm::LogError("CSCGasCollisions") << errorMessage; throw cms::Exception(errorMessage); } fin.clear(); // Clear eof read status fin.seekg(0, ios::beg); // Position at start of file // @@ We had better have the right sizes everywhere or all // hell will break loose. There's no trapping. LogTrace(me) << "Reading gamma bins"; for (int i = 0; i < N_GAMMA; ++i) { fin >> theGammaBins[i]; LogTrace(me) << i + 1 << " " << theGammaBins[i]; } LogTrace(me) << "Reading energy bins \n"; for (int i = 0; i < N_ENERGY; ++i) { fin >> theEnergyBins[i]; LogTrace(me) << i + 1 << " " << theEnergyBins[i]; } LogTrace(me) << "Reading collisions table \n"; for (int i = 0; i < N_ENTRIES; ++i) { fin >> theCollisionTable[i]; LogTrace(me) << i + 1 << " " << theCollisionTable[i]; } fin.close(); } void CSCGasCollisions::setParticleDataTable(const ParticleDataTable *pdt) { theParticleDataTable = pdt; } void CSCGasCollisions::simulate(const PSimHit &simhit, std::vector<LocalPoint> &positions, std::vector<int> &electrons, CLHEP::HepRandomEngine *engine) { const float epsilonL = 0.01; // Shortness of simhit 'length' // const float max_gap_z = 1.5; // Gas gaps are 0.5 // or 1.0 cm // Note that what I call the 'gap' may in fact be the 'length' of a PSimHit // which does not start and end on the gap edges. This confuses the // nomenclature at least. double mom = simhit.pabs(); // in GeV/c - see MuonSensitiveDetector.cc // int iam = simhit.particleType(); // PDG type delete theCrossGap; // before building new one assert(theParticleDataTable != nullptr); ParticleData const *particle = theParticleDataTable->particle(simhit.particleType()); double mass = 0.105658; // assume a muon if (particle == nullptr) { edm::LogError("CSCGasCollisions") << "Cannot find particle of type " << simhit.particleType() << " in the PDT"; } else { mass = particle->mass(); LogTrace(me) << "[CSCGasCollisions] Found particle of type " << simhit.particleType() << " in the PDT; mass = " << mass; } theCrossGap = new CSCCrossGap(mass, mom, simhit.exitPoint() - simhit.entryPoint()); float gapSize = theCrossGap->length(); // Test the simhit 'length' (beware of angular effects) // if ( gapSize <= epsilonL || gapSize > max_gap_z ) { if (gapSize <= epsilonL) { edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] WARNING! simhit entry and exit are too close - " "skipping simhit:" << "\n entry = " << simhit.entryPoint() << ": exit = " << simhit.exitPoint() << "\n particle type = " << simhit.particleType() << " : momentum = " << simhit.pabs() << " GeV/c : energy loss = " << simhit.energyLoss() * 1.E06 << " keV" << ", gapSize = " << gapSize << " cm (< epsilonL = " << epsilonL << " cm)"; return; //@@ Just skip this PSimHit } // Interpolate the table for current gamma value // Extract collisions binned by energy loss values, for this gamma std::vector<float> collisions(N_ENERGY); double loggam = theCrossGap->logGamma(); fillCollisionsForThisGamma(static_cast<float>(loggam), collisions); double anmin = exp(collisions[N_ENERGY - 1]); double anmax = exp(collisions[0]); double amu = anmax - anmin; LogTrace(me) << "collisions extremes = " << collisions[N_ENERGY - 1] << ", " << collisions[0] << "\n" << "anmin = " << anmin << ", anmax = " << anmax << "\n" << "amu = " << amu << "\n"; float dedx = 0.; // total energy loss double sum_steps = 0.; // total distance across gap (along simhit direction) int n_steps = 0; // no. of steps/primary collisions int n_try = 0; // no. of tries to generate steps double step = -1.; // Sentinel for start LocalPoint layerLocalPoint(simhit.entryPoint()); // step/primary collision loop while (sum_steps < gapSize) { ++n_try; if (n_try > MAX_STEPS) { int maxst = MAX_STEPS; edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] WARNING! n_try = " << n_try << " is > MAX_STEPS = " << maxst << " - skipping simhit:" << "\n entry = " << simhit.entryPoint() << ": exit = " << simhit.exitPoint() << "\n particle type = " << simhit.particleType() << " : momentum = " << simhit.pabs() << " GeV/c : energy loss = " << simhit.energyLoss() * 1.E06 << " keV" << "\n gapSize = " << gapSize << " cm, last step = " << step << " cm, sum_steps = " << sum_steps << " cm, n_steps = " << n_steps; break; } step = generateStep(amu, engine); if (sum_steps + step > gapSize) break; // this step goes too far float eloss = generateEnergyLoss(amu, anmin, anmax, collisions, engine); // Is the eloss too large? (then GEANT should have produced hits!) if (eloss > deCut) { edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] WARNING! eloss = " << eloss << " eV is too large (> " << deCut << " eV) - trying another collision"; continue; // to generate another collision/step } dedx += eloss; // the energy lost from the ionizing particle sum_steps += step; // the position of the ionizing particle ++n_steps; // the number of primary collisions if (n_steps > MAX_STEPS) { // Extra-careful trap for bizarreness edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] WARNING! " << n_steps << " is too many steps - skipping simhit:" << "\n entry = " << simhit.entryPoint() << ": exit = " << simhit.exitPoint() << "\n particle type = " << simhit.particleType() << " : momentum = " << simhit.pabs() << " GeV/c : energy loss = " << simhit.energyLoss() * 1.E06 << " keV" << "\ngapSize=" << gapSize << " cm, last step=" << step << " cm, sum_steps=" << sum_steps << " cm"; break; } LogTrace(me) << "sum_steps = " << sum_steps << " cm , dedx = " << dedx << " eV"; // Generate ionization. // eion is the minimum energy at which ionization can occur in the gas if (eloss > eion) { layerLocalPoint += step * theCrossGap->unitVector(); // local point where the collision occurs ionize(eloss, layerLocalPoint); } else { LogTrace(me) << "Energy available = " << eloss << " eV is too low for ionization (< eion = " << eion << " eV)"; } } // step/collision loop if (dumpGasCollisions()) writeSummary(n_try, n_steps, sum_steps, dedx, simhit); // Return values in two container arguments positions = theCrossGap->ionClusters(); electrons = theCrossGap->electrons(); return; } double CSCGasCollisions::generateStep(double avCollisions, CLHEP::HepRandomEngine *engine) const { // Generate a m.f.p. (1/avCollisions = cm/collision) double step = (CLHEP::RandExponential::shoot(engine)) / avCollisions; // Without using CLHEP: approx random exponential by... // double da = double(rand())/double(RAND_MAX); // double step = -log(1.-da)/avCollisions; LogTrace(me) << " step = " << step << " cm"; // Next line only used to fill a container of 'step's for later diagnostic // dumps if (dumpGasCollisions()) theCrossGap->addStep(step); return step; } float CSCGasCollisions::generateEnergyLoss(double avCollisions, double anmin, double anmax, const std::vector<float> &collisions, CLHEP::HepRandomEngine *engine) const { // Generate a no. of collisions between collisions[0] and [N_ENERGY-1] float lnColl = log(CLHEP::RandFlat::shoot(engine, anmin, anmax)); // Without using CLHEP: approx random between anmin and anmax // double ra = double(rand())/double(RAND_MAX)*avCollisions; // cout << "ra = " << ra << std::endl; // float lnColl = static_cast<float>( log( ra ) ); // Find energy loss for that number float lnE = lnEnergyLoss(lnColl, collisions); float eloss = exp(lnE); // Compensate if gamma was actually below 1.1 if (theCrossGap->gamma() < 1.1) eloss = eloss * 0.173554 / theCrossGap->beta2(); LogTrace(me) << "eloss = " << eloss << " eV"; // Next line only used to fill container of eloss's for later diagnostic dumps if (dumpGasCollisions()) theCrossGap->addEloss(eloss); return eloss; } void CSCGasCollisions::ionize(double energyAvailable, LocalPoint startHere) const { while (energyAvailable > eion) { LogTrace(me) << " NEW CLUSTER " << theCrossGap->noOfClusters() + 1 << " AT " << startHere; LocalPoint newCluster(startHere); theCrossGap->addCluster(newCluster); //@@ I consider NOT subtracting eion before calculating range to be a bug. //@@ But this changes tuning of the algorithm so leave it until after the // big rush to 7_5_0 //@@ energyAvailable -= eion; // Sauli CERN 77-09: delta e range with E in MeV (Sauli references Kobetich // & Katz 1968 but that has nothing to do with this expression! He seems to // have made a mistake.) I found the Sauli-quoted relationship in R. // Glocker, Z. Naturforsch. Ba, 129 (1948): delta e range R = aE^n with // a=710, n=1.72 for E in MeV and R in mg/cm^2 applicable over the range E = // 0.001 to 0.3 MeV. // Take HALF that range. //@@ Why? Why not... double range = 0.5 * (0.71 / gasDensity) * pow(energyAvailable * 1.E-6, 1.72); LogTrace(me) << " range = " << range << " cm"; if (range < clusterExtent) { // short-range delta e // How many electrons can we make? Now use *average* energy for ionization // (not *minimum*) int nelec = static_cast<int>(energyAvailable / ework); LogTrace(me) << "short-range delta energy in = " << energyAvailable << " eV"; // energyAvailable -= nelec*(energyAvailable/ework); energyAvailable -= nelec * ework; // If still above eion (minimum, not average) add one more e if (energyAvailable > eion) { ++nelec; energyAvailable -= eion; } LogTrace(me) << "short-range delta energy out = " << energyAvailable << " eV, nelec = " << nelec; theCrossGap->addElectrons(nelec); break; } else { // long-range delta e LogTrace(me) << "long-range delta \n" << "no. of electrons in cluster now = " << theCrossGap->noOfElectrons(); theCrossGap->addElectrons(1); // Position is at startHere still bool new_range = false; while (!new_range && (energyAvailable > ework)) { energyAvailable -= ework; while (energyAvailable > eion) { double range2 = 0.5 * 0.71 / gasDensity * pow(1.E-6 * energyAvailable, 1.72); double drange = range - range2; LogTrace(me) << " energy left = " << energyAvailable << " eV, range2 = " << range2 << " cm, drange = " << drange << " cm"; if (drange < clusterExtent) { theCrossGap->addElectronToBack(); // increment last element } else { startHere += drange * theCrossGap->unitVector(); // update delta e start position range = range2; // update range new_range = true; // Test range again LogTrace(me) << "reset range to range2 = " << range << " from startHere = " << startHere << " and iterate"; } break; // out of inner while energyAvailable>eion } // inner while energyAvailable>eion } // while !new_range && energyAvailable>ework // energyAvailable now less than ework, but still may be over eion...add // an e if (energyAvailable > eion) { energyAvailable -= ework; // yes, it may go negative theCrossGap->addElectronToBack(); // add one more e } } // if range } // outer while energyAvailable>eion } void CSCGasCollisions::writeSummary(int n_try, int n_steps, double sum_steps, float dedx, const PSimHit &simhit) const { // Switched from std::cout to LogVerbatim, Mar 2015 std::vector<LocalPoint> ion_clusters = theCrossGap->ionClusters(); std::vector<int> electrons = theCrossGap->electrons(); std::vector<float> elosses = theCrossGap->eLossPerStep(); std::vector<double> steps = theCrossGap->stepLengths(); edm::LogVerbatim("CSCDigitizer") << "------------------" << "\nAFTER CROSSING GAP"; /* edm::LogVerbatim("CSCDigitizer") << "no. of steps tried = " << n_try << "\nno. of steps from theCrossGap = " << theCrossGap->noOfSteps() << "\nsize of steps vector = " << steps.size(); edm::LogVerbatim("CSCDigitizer") << "no. of collisions (steps) = " << n_steps << "\nsize of elosses vector = " << elosses.size() << "\nsize of ion clusters vector = " << ion_clusters.size() << "\nsize of electrons vector = " << electrons.size(); */ size_t nsteps = n_steps; // force ridiculous type conversion size_t mstep = steps.size() - 1; // final step gets filled but is outside gas // gap - unless we reach MAX_STEPS if ((nsteps != MAX_STEPS) && (nsteps != mstep)) { edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] WARNING! no. of steps = " << nsteps << " .ne. steps.size()-1 = " << mstep; } size_t meloss = elosses.size(); if (nsteps != meloss) { edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] WARNING! no. of steps = " << nsteps << " .ne. no. of elosses = " << meloss; } else { edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] # / length of step / energy loss per collision:"; for (size_t i = 0; i != nsteps; ++i) { edm::LogVerbatim("CSCDigitizer") << i + 1 << " / S: " << steps[i] << " / E: " << elosses[i]; } } size_t mclus = ion_clusters.size(); size_t melec = electrons.size(); if (mclus != melec) { edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] WARNING! size of cluster vector = " << mclus << " .ne. size of electrons vector = " << melec; } else { edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] # / postion of " "cluster / electrons per cluster: "; for (size_t i = 0; i != mclus; ++i) { edm::LogVerbatim("CSCDigitizer") << i + 1 << " / I: " << ion_clusters[i] << " / E: " << electrons[i]; } } int n_ic = count_if(elosses.begin(), elosses.end(), [&](auto c) { return c > this->eion; }); edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] total no. of collision steps = " << n_steps; edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] total sum of steps = " << sum_steps << " cm"; if (nsteps > 0) edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] average step length = " << sum_steps / float(nsteps) << " cm"; edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] total energy loss across gap = " << dedx << " eV = " << dedx / 1000. << " keV"; edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] no. of primary ionizing collisions across gap = " "no. with eloss > eion = " << eion << " eV = " << n_ic; if (nsteps > 0) edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] average energy loss/collision = " << dedx / float(nsteps) << " eV"; std::vector<int>::const_iterator bigger = find(electrons.begin(), electrons.end(), 0); if (bigger != electrons.end()) { edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] TROUBLE! There is a cluster with 0 electrons."; } int n_e = accumulate(electrons.begin(), electrons.end(), 0); edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] SUMMARY: simhit" << "\n entry = " << simhit.entryPoint() << ": exit = " << simhit.exitPoint() << "\n particle type = " << simhit.particleType() << " : momentum = " << simhit.pabs() << " GeV/c : energy loss = " << simhit.energyLoss() * 1.E06 << " keV"; if (nsteps > 0) { edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisions] SUMMARY: ionization" << " : steps= " << nsteps << " : sum(steps)= " << sum_steps << " cm : <step>= " << sum_steps / float(nsteps) << " cm" << " : ionizing= " << n_ic << " : ionclus= " << mclus << " : total e= " << n_e << " : <dedx/step>= " << dedx / float(nsteps) << " eV : <e/ionclus>= " << float(n_e) / float(mclus) << " : dedx= " << dedx / 1000. << " keV"; } else { edm::LogVerbatim("CSCDigitizer") << "[CSCGasCollisons] ERROR? no collision steps!"; } // Turn off output file - used for initial development // if ( saveGasCollisions() ) { // ofstream of0("osteplen.dat",ios::app); // std::copy( steps.begin(), steps.end(), // std::ostream_iterator<float>(of0,"\n")); // ofstream of1("olperc.dat",ios::app); // std::copy( elosses.begin(), elosses.end(), // std::ostream_iterator<float>(of1,"\n")); // ofstream of2("oclpos.dat",ios::app); // std::copy( ion_clusters.begin(), ion_clusters.end(), // std::ostream_iterator<LocalPoint>(of2,"\n")); // ofstream of3("oepercl.dat",ios::app); // std::copy( electrons.begin(), electrons.end(), // std::ostream_iterator<int>(of3,"\n")); // } } float CSCGasCollisions::lnEnergyLoss(float lnCollisions, const std::vector<float> &collisions) const { float lnE = -1.; // Find collision[] bin in which lnCollisions falls std::vector<float>::const_iterator it = find(collisions.begin(), collisions.end(), lnCollisions); if (it != collisions.end()) { // found the value std::vector<float>::difference_type ihi = it - collisions.begin(); LogTrace(me) << ": using one energy bin " << ihi << " = " << theEnergyBins[ihi] << " for lnCollisions = " << lnCollisions; lnE = theEnergyBins[ihi]; } else { // interpolate the value std::vector<float>::const_iterator loside = find_if(collisions.begin(), collisions.end(), [&lnCollisions](auto c) { return c < lnCollisions; }); std::vector<float>::difference_type ilo = loside - collisions.begin(); if (ilo > 0) { LogTrace(me) << ": using energy bin " << ilo - 1 << " and " << ilo; lnE = theEnergyBins[ilo - 1] + (lnCollisions - collisions[ilo - 1]) * (theEnergyBins[ilo] - theEnergyBins[ilo - 1]) / (collisions[ilo] - collisions[ilo - 1]); } else { LogTrace(me) << ": using one energy bin 0 = " << theEnergyBins[0] << " for lnCollisions = " << lnCollisions; lnE = theEnergyBins[0]; //@@ WHAT ELSE TO DO? } } return lnE; } void CSCGasCollisions::fillCollisionsForThisGamma(float logGamma, std::vector<float> &collisions) const { std::vector<float>::const_iterator bigger = find_if(theGammaBins.begin(), theGammaBins.end(), [&logGamma](auto c) { return c > logGamma; }); if (bigger == theGammaBins.end()) { // use highest bin LogTrace(me) << ": using highest gamma bin" << " for logGamma = " << logGamma; for (int i = 0; i < N_ENERGY; ++i) collisions[i] = theCollisionTable[i * N_GAMMA]; } else { // use bigger and its lower neighbour std::vector<float>::difference_type ihi = bigger - theGammaBins.begin(); if (ihi > 0) { double dlg2 = *bigger--; // and decrement after deref // LogTrace(me) << ": using gamma bins " // << ihi-1 << " and " << ihi; double dlg1 = *bigger; // now the preceding element double dlg = (logGamma - dlg1) / (dlg2 - dlg1); double omdlg = 1. - dlg; for (int i = 0; i < N_ENERGY; ++i) collisions[i] = theCollisionTable[i * N_GAMMA + ihi - 1] * omdlg + theCollisionTable[i * N_GAMMA + ihi] * dlg; } else { // bigger has no lower neighbour LogTrace(me) << ": using lowest gamma bin" << " for logGamma = " << logGamma; for (int i = 0; i < N_ENERGY; ++i) collisions[i] = theCollisionTable[i * N_GAMMA]; } } }
44.094502
120
0.573588
Purva-Chaudhari
4bc55f3f6bb87df6369b1e16fd70729bbd6073e9
782
cpp
C++
src/resource/MemoryResource.cpp
nanzifan/Umpire-edit
990895b527bef0716aaa0fbb0c0f2017e8e15882
[ "MIT" ]
null
null
null
src/resource/MemoryResource.cpp
nanzifan/Umpire-edit
990895b527bef0716aaa0fbb0c0f2017e8e15882
[ "MIT" ]
null
null
null
src/resource/MemoryResource.cpp
nanzifan/Umpire-edit
990895b527bef0716aaa0fbb0c0f2017e8e15882
[ "MIT" ]
null
null
null
////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2018, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory // // Created by David Beckingsale, david@llnl.gov // LLNL-CODE-747640 // // All rights reserved. // // This file is part of Umpire. // // For details, see https://github.com/LLNL/Umpire // Please also see the LICENSE file for MIT license. ////////////////////////////////////////////////////////////////////////////// #include "umpire/resource/MemoryResource.hpp" namespace umpire { namespace resource { MemoryResource::MemoryResource(const std::string& name, int id) : strategy::AllocationStrategy(name, id) { } } // end of namespace resource } // end of namespace umpire
28.962963
78
0.588235
nanzifan
4bccfc4405c2707254a17efe77467f5d02c2b41d
1,664
cpp
C++
leetcode/medianoftwosortedarray.cpp
WIZARD-CXY/pl
22b7f5d81804f4e333d3cff6433364ba1a0ac7ef
[ "Apache-2.0" ]
1
2016-01-20T08:26:34.000Z
2016-01-20T08:26:34.000Z
leetcode/medianoftwosortedarray.cpp
WIZARD-CXY/pl
22b7f5d81804f4e333d3cff6433364ba1a0ac7ef
[ "Apache-2.0" ]
1
2015-10-21T05:38:17.000Z
2015-11-02T07:42:55.000Z
leetcode/medianoftwosortedarray.cpp
WIZARD-CXY/pl
22b7f5d81804f4e333d3cff6433364ba1a0ac7ef
[ "Apache-2.0" ]
null
null
null
class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { int m=nums1.size(); int n=nums2.size(); int total = m+n; if(total & 0x1){ return find_kth(nums1,m,nums2,n,total/2+1); }else{ return (find_kth(nums1,m,nums2,n,total/2) +find_kth(nums1,m,nums2,n,total/2+1))/2.0; } } private: int find_kth(vector<int> nums1, int m, vector<int> nums2, int n, int k){ //always let nums1's size smaller or equal to nums2 if(m>n){ return find_kth(nums2,n,nums1,m,k); } if(m==0){ return nums2[k-1]; } if(k==1){ return min(nums1[0],nums2[0]); } //divide k into two parts int mid1=min(k/2,m),mid2=k-mid1; vector<int>::iterator iter; if(nums1[mid1-1]<nums2[mid2-1]){ //safely ignore the mid1 number of elements in num1 iter=nums1.begin(); for(int i=0; i<mid1; i++){ iter++; } nums1.assign(iter,nums1.end()); return find_kth(nums1,nums1.size(),nums2,nums2.size(),k-mid1); }else if (nums1[mid1-1]>nums2[mid2-1]){ iter=nums2.begin(); for(int i=0; i<mid2;i++){ iter++; } //safely ignore the mid2 number of elements in num2 nums2.assign(iter,nums2.end()); return find_kth(nums1,nums1.size(),nums2,nums2.size(),k-mid2); }else{ return nums1[mid1-1]; } } };
29.714286
79
0.484375
WIZARD-CXY
4bd04aa516001a5c045a170b82b15a96af0ac994
655
hpp
C++
EngineBuilder/PolluxEngineSolution.hpp
GabyForceQ/PolluxEngine
2dbc84ed1d434f1b6d794f775f315758f0e8cc49
[ "BSD-3-Clause" ]
3
2020-05-19T20:24:28.000Z
2020-09-27T11:28:42.000Z
EngineBuilder/PolluxEngineSolution.hpp
GabyForceQ/PolluxEngine
2dbc84ed1d434f1b6d794f775f315758f0e8cc49
[ "BSD-3-Clause" ]
31
2020-05-27T11:01:27.000Z
2020-08-08T15:53:23.000Z
EngineBuilder/PolluxEngineSolution.hpp
GabyForceQ/PolluxEngine
2dbc84ed1d434f1b6d794f775f315758f0e8cc49
[ "BSD-3-Clause" ]
null
null
null
/***************************************************************************************************************************** * Copyright 2020 Gabriel Gheorghe. All rights reserved. * This code is licensed under the BSD 3-Clause "New" or "Revised" License * License url: https://github.com/GabyForceQ/PolluxEngine/blob/master/LICENSE *****************************************************************************************************************************/ #pragma once namespace Pollux::EngineBuilder { class PolluxEngineSolution final : public BuildSystem::Solution { public: PolluxEngineSolution(const std::string& path) noexcept; }; }
40.9375
127
0.470229
GabyForceQ
4bd14f533a2faca521e7265842253784514442c5
1,517
cc
C++
src/file.cc
cloudcosmonaut/Browser
4534b66266d73afdd8c80bea437a740b87e8c645
[ "MIT" ]
null
null
null
src/file.cc
cloudcosmonaut/Browser
4534b66266d73afdd8c80bea437a740b87e8c645
[ "MIT" ]
null
null
null
src/file.cc
cloudcosmonaut/Browser
4534b66266d73afdd8c80bea437a740b87e8c645
[ "MIT" ]
null
null
null
#include "file.h" #include <fstream> #include <sstream> #include <stdexcept> #ifdef LEGACY_CXX #include <experimental/filesystem> namespace n_fs = ::std::experimental::filesystem; #else #include <filesystem> namespace n_fs = ::std::filesystem; #endif /** * \brief Read file from disk * \param path File path location to read the file from * \throw std::runtime_error exception when file is not found (or not a regular file), * or std::ios_base::failure when file can't be read * \return Contents as string */ std::string File::read(const std::string& path) { if (n_fs::exists(path) && n_fs::is_regular_file(path)) { std::ifstream inFile; inFile.open(path, std::ifstream::in); std::stringstream strStream; strStream << inFile.rdbuf(); return strStream.str(); } else { // File doesn't exists or isn't a file throw std::runtime_error("File does not exists or isn't a regular file."); } } /** * \brief Write file to disk * \param path File path location for storing the file * \param content Content that needs to be written to file * \throw std::ios_base::failure when file can't be written to */ void File::write(const std::string& path, const std::string& content) { std::ofstream file; file.open(path.c_str()); file << content; file.close(); } /** * \brief Retrieve filename from file path * \param path Full path * \return filename */ std::string File::getFilename(const std::string& path) { return n_fs::path(path).filename().string(); }
24.467742
86
0.685564
cloudcosmonaut
4bd282131724cd9b6e178bef15c75c41aef3c691
1,515
cpp
C++
engine/XML/custom_maps/source/XMLMapCoordinateReader.cpp
sidav/shadow-of-the-wyrm
747afdeebed885b1a4f7ab42f04f9f756afd3e52
[ "MIT" ]
60
2019-08-21T04:08:41.000Z
2022-03-10T13:48:04.000Z
engine/XML/custom_maps/source/XMLMapCoordinateReader.cpp
cleancoindev/shadow-of-the-wyrm
51b23e98285ecb8336324bfd41ebf00f67b30389
[ "MIT" ]
3
2021-03-18T15:11:14.000Z
2021-10-20T12:13:07.000Z
engine/XML/custom_maps/source/XMLMapCoordinateReader.cpp
cleancoindev/shadow-of-the-wyrm
51b23e98285ecb8336324bfd41ebf00f67b30389
[ "MIT" ]
8
2019-11-16T06:29:05.000Z
2022-01-23T17:33:43.000Z
#include "RNG.hpp" #include "XMLMapCoordinateReader.hpp" using namespace std; // Given a parent node, which may have either a Coord or a Random element (xs:choice), // parse it and return an engine Coordinate. Coordinate XMLMapCoordinateReader::parse_coordinate(const XMLNode& parent_node) { Coordinate c(0,0); XMLNode child_node = XMLUtils::get_next_element_by_local_name(parent_node, "Coord"); if (!child_node.is_null()) { c = parse_fixed_coordinate(child_node); } else { child_node = XMLUtils::get_next_element_by_local_name(parent_node, "Random"); if (!child_node.is_null()) { c = parse_random_coordinate(child_node); } } return c; } // Given a node of type Coord in the schema, return an engine Coordinate. Coordinate XMLMapCoordinateReader::parse_fixed_coordinate(const XMLNode& coord_node) { Coordinate c(0,0); if (!coord_node.is_null()) { c.first = XMLUtils::get_child_node_int_value(coord_node, "Row"); c.second = XMLUtils::get_child_node_int_value(coord_node, "Col"); } return c; } // Given a node of type Random in the schema, return an engine coordinate. Coordinate XMLMapCoordinateReader::parse_random_coordinate(const XMLNode& random_coord_node) { Coordinate c(0,0); vector<XMLNode> coord_nodes = XMLUtils::get_elements_by_local_name(random_coord_node, "Coord"); if (!coord_nodes.empty()) { XMLNode node = coord_nodes.at(RNG::range(0, coord_nodes.size()-1)); c = parse_fixed_coordinate(node); } return c; }
25.677966
97
0.729373
sidav
4bd2b31960fe1d09770065136c147f3a38afa175
2,012
cpp
C++
the_concepts_and_practice_of_math_fin/Project5/ProjectB_7/test_framework/asian_ql.cpp
calvin456/intro_derivative_pricing
0841fbc0344bee00044d67977faccfd2098b5887
[ "MIT" ]
5
2016-12-28T16:07:38.000Z
2022-03-11T09:55:57.000Z
the_concepts_and_practice_of_math_fin/Project5/ProjectB_7/test_framework/asian_ql.cpp
calvin456/intro_derivative_pricing
0841fbc0344bee00044d67977faccfd2098b5887
[ "MIT" ]
null
null
null
the_concepts_and_practice_of_math_fin/Project5/ProjectB_7/test_framework/asian_ql.cpp
calvin456/intro_derivative_pricing
0841fbc0344bee00044d67977faccfd2098b5887
[ "MIT" ]
5
2017-06-04T04:50:47.000Z
2022-03-17T17:41:16.000Z
//asian_ql.cpp //Wrapper function. Computes semi-analytical heston w/ QuantLib //ref. quantlib asianoption.cpp #include "asian_ql.h" double asian_geo_call_ql(const Date& todaysDate_, const Date& settlementDate_, const Date& maturity_, Real spot_, Real strike, Size m, Spread dividendYield, Rate riskFreeRate, Volatility volatility ) { // set up dates Calendar calendar = TARGET(); Date todaysDate = todaysDate_; Date settlementDate = settlementDate_; Date maturity = maturity_; Settings::instance().evaluationDate() = todaysDate_; DayCounter dc = Actual360(); Handle <Quote > spot(boost::shared_ptr<SimpleQuote>(new SimpleQuote(spot_))); Handle<YieldTermStructure> qTS(boost::shared_ptr<YieldTermStructure>( new FlatForward(settlementDate, dividendYield, dc))); Handle<YieldTermStructure> rTS(boost::shared_ptr<YieldTermStructure>( new FlatForward(settlementDate, riskFreeRate, dc))); Handle<BlackVolTermStructure> volTS(boost::shared_ptr<BlackVolTermStructure>( new BlackConstantVol(settlementDate, calendar, volatility, dc))); boost::shared_ptr<BlackScholesMertonProcess> stochProcess(new BlackScholesMertonProcess(spot,qTS, rTS, volTS)); boost::shared_ptr<PricingEngine> engine( new AnalyticDiscreteGeometricAveragePriceAsianEngine(stochProcess)); Average::Type averageType = Average::Geometric; Real runningAccumulator = 1.0; Size pastFixings = 0; Size futureFixings = m; Option::Type type = Option::Call; boost::shared_ptr<StrikedTypePayoff> payoff(new PlainVanillaPayoff(type, strike)); boost::shared_ptr<Exercise> exercise(new EuropeanExercise(maturity)); std::vector<Date> fixingDates(futureFixings); Integer dt = Integer(360 / futureFixings + 0.5); fixingDates[0] = todaysDate + dt; for (Size j = 1; j<futureFixings; j++) fixingDates[j] = fixingDates[j - 1] + dt; DiscreteAveragingAsianOption option(averageType, runningAccumulator, pastFixings, fixingDates, payoff, exercise); option.setPricingEngine(engine); return option.NPV(); }
28.742857
112
0.772366
calvin456
4bd36c6e161394eb98a9dd0788b28ef2dc4012aa
359
cpp
C++
src/Pizza/Americana.cpp
HugoPrat/Multi-process-threads-plazza-Cpp
ef97968a360e77ebeed69a96e44ed801c40e6509
[ "0BSD" ]
3
2019-12-01T10:18:12.000Z
2020-02-22T10:54:36.000Z
src/Pizza/Americana.cpp
HugoPrat/Multi-process-threads-plazza-Cpp
ef97968a360e77ebeed69a96e44ed801c40e6509
[ "0BSD" ]
null
null
null
src/Pizza/Americana.cpp
HugoPrat/Multi-process-threads-plazza-Cpp
ef97968a360e77ebeed69a96e44ed801c40e6509
[ "0BSD" ]
null
null
null
/* ** EPITECH PROJECT, 2019 ** CCP_plazza_2018 ** File description: ** Americana */ #include "Pizza/Americana.hpp" Americana_P::Americana_P(PizzaSize size, float multi) : Pizza(Americana, size, 2 * multi) { this->_recipe.push_back(DOE); this->_recipe.push_back(TOMATO); this->_recipe.push_back(GRUYERE); this->_recipe.push_back(STEAK); }
21.117647
55
0.699164
HugoPrat
4bd4766fdea5a1e9a5af3ed5e63601b099b16f0a
695
cpp
C++
ALGO-5/main.cpp
codexvn/lanqiao
16fbbecaa4e0f042dd2d402469aeda552149a1f7
[ "MIT" ]
null
null
null
ALGO-5/main.cpp
codexvn/lanqiao
16fbbecaa4e0f042dd2d402469aeda552149a1f7
[ "MIT" ]
null
null
null
ALGO-5/main.cpp
codexvn/lanqiao
16fbbecaa4e0f042dd2d402469aeda552149a1f7
[ "MIT" ]
null
null
null
#include<iostream> using namespace std; int main() { int MAX = 99999999; int dis[20001] = {0}, u[200001] ,v[200001], l[200001]; fill(dis + 2, dis + 20001, MAX); int n, m; cin >> n >> m; for(int i=1;i<=m;i++) cin>>u[i]>>v[i]>>l[i]; for (int j = 1; j < n; j++) { bool all_finished = true; for (int i = 1; i <= m; i++) { if (dis[v[i]] > dis[u[i]] + l[i]) { dis[v[i]] = dis[u[i]] + l[i]; all_finished = false; } } if (all_finished == true) break; } for (int i = 2; i <= n; i++) cout << dis[i]<<endl; return 0; }
23.965517
59
0.392806
codexvn
4bd8db499766c3075b65e8a612ce49e294ac3f58
1,465
cpp
C++
String/prefix_function/Codeforces_432D.Prefixes_and_Suffixes_prefix.cpp
sheikh-arman/icpc_2021_template
2fc278576bb94ab3ee30a7e150b7b1f1b0e9c977
[ "MIT" ]
null
null
null
String/prefix_function/Codeforces_432D.Prefixes_and_Suffixes_prefix.cpp
sheikh-arman/icpc_2021_template
2fc278576bb94ab3ee30a7e150b7b1f1b0e9c977
[ "MIT" ]
null
null
null
String/prefix_function/Codeforces_432D.Prefixes_and_Suffixes_prefix.cpp
sheikh-arman/icpc_2021_template
2fc278576bb94ab3ee30a7e150b7b1f1b0e9c977
[ "MIT" ]
null
null
null
#include<bits/stdc++.h> using namespace std; typedef long long int ll; #define PB push_back #define VST(V) sort(V.begin(),V.end()) #define VSTrev(V) sort(V.begin(),V.end(),greater<long long int>()) #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define base1 129 #define base2 137 #define MOD1 1479386893 #define MOD2 1928476349 #define MAX 2000010 ll cnt_ar[500010]; vector<ll> prefix_function(string s){ ll n=s.size(); vector<ll>prefix(n+1); prefix[0]=0; ll j=0; for(ll i=1;i<n;i++){ while(j>0&&s[i]!=s[j]){ j=prefix[j-1]; } if(s[i]==s[j]){ j++; } prefix[i]=j; cnt_ar[j]++; } return prefix; } int main(){ //freopen("1input.txt","r",stdin); fast; ll tcase=1; //cin>>tcase; for(ll test=1;test<=tcase;test++){ string s; cin>>s; ll n=s.size(); for(ll i=0;i<=n;i++){ cnt_ar[i]=0; } vector<ll>V=prefix_function(s);vector<ll>ans; for (int i = n-1; i > 0; i--) cnt_ar[V[i-1]] += cnt_ar[i]; ll i=n-1; ll j=V[n-1]; while(j>0){ if(s[j-1]==s[i]){ ans.PB(j); } j=V[j-1]; } ans.PB(n); VST(ans); ll siz=ans.size(); cout<<siz<<"\n"; for(ll i=0;i<=n;i++){ cnt_ar[i]+=1; } for(ll i:ans){ cout<<i<<" "; cout<<cnt_ar[i]<<"\n"; } } return 0; }
21.544118
69
0.485324
sheikh-arman
4bd96fda5ba2095bb1cf532093b1ad7cd794cc04
518
hpp
C++
include/Utilities/TimeHelper.hpp
mmathys/blacksmith
6735c10519a6e15b3490b7c7927b3652db9c9ecc
[ "MIT" ]
1
2021-12-20T04:08:45.000Z
2021-12-20T04:08:45.000Z
include/Utilities/TimeHelper.hpp
iwangjye/blacksmith
01faacfaf9b619d5de9a8fcb9236f63510c7161d
[ "MIT" ]
null
null
null
include/Utilities/TimeHelper.hpp
iwangjye/blacksmith
01faacfaf9b619d5de9a8fcb9236f63510c7161d
[ "MIT" ]
null
null
null
#ifndef BLACKSMITH_INCLUDE_UTILITIES_TIMEHELPER_HPP_ #define BLACKSMITH_INCLUDE_UTILITIES_TIMEHELPER_HPP_ #include <chrono> inline int64_t get_timestamp_sec() { return std::chrono::duration_cast<std::chrono::seconds>( std::chrono::system_clock::now().time_since_epoch()).count(); } inline int64_t get_timestamp_us() { return std::chrono::duration_cast<std::chrono::microseconds>( std::chrono::system_clock::now().time_since_epoch()).count(); } #endif //BLACKSMITH_INCLUDE_UTILITIES_TIMEHELPER_HPP_
30.470588
67
0.779923
mmathys
4bd987770978c20db1ad28db90791f1c04dc803f
589
cpp
C++
answers/harshpreet0508/day16/q1.cpp
justshivam/30-DaysOfCode-March-2021
64d434c07b9ec875384dee681a3eecefab3ddef0
[ "MIT" ]
22
2021-03-16T14:07:47.000Z
2021-08-13T08:52:50.000Z
answers/harshpreet0508/day16/q1.cpp
justshivam/30-DaysOfCode-March-2021
64d434c07b9ec875384dee681a3eecefab3ddef0
[ "MIT" ]
174
2021-03-16T21:16:40.000Z
2021-06-12T05:19:51.000Z
answers/harshpreet0508/day16/q1.cpp
justshivam/30-DaysOfCode-March-2021
64d434c07b9ec875384dee681a3eecefab3ddef0
[ "MIT" ]
135
2021-03-16T16:47:12.000Z
2021-06-27T14:22:38.000Z
// Given a binary array, sorted in non increasing order, count the number of 1's in it #include <iostream> using namespace std; int count(bool a[], int l, int h) { int m; if(h >= l) { m = l + (h-l)/2; if((m == h||a[m+1] == 0)&&(a[m] == 1)) return m+1; if(a[m] == 1) return count(a,m+1,h); return count(a,l,m-1); } return 0; } int main() { int n,i; cin>>n; bool a[n]; for(i=0;i<n;i++) { cin>>a[i]; } cout<<"\nNo of 1's are "<<count(a,0,n-1); return 0; }
15.5
86
0.436333
justshivam
4bdb3cc82aff905692475265f5850bfd969c6cca
2,190
cc
C++
content/browser/service_worker/service_worker_type_converters.cc
zipated/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
content/browser/service_worker/service_worker_type_converters.cc
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
content/browser/service_worker/service_worker_type_converters.cc
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/browser/service_worker/service_worker_type_converters.h" #include "base/logging.h" namespace mojo { // TODO(falken): TypeConverter is deprecated, and we should change // ServiceWorkerVersion to just use the mojom enum, but it will be a huge change // and not sure how to reconcile the NEW and kUnknown thing yet, so we use the // mojo type converter temporarily as an identifier to track. blink::mojom::ServiceWorkerState TypeConverter<blink::mojom::ServiceWorkerState, content::ServiceWorkerVersion::Status>:: Convert(content::ServiceWorkerVersion::Status status) { switch (status) { case content::ServiceWorkerVersion::NEW: return blink::mojom::ServiceWorkerState::kUnknown; case content::ServiceWorkerVersion::INSTALLING: return blink::mojom::ServiceWorkerState::kInstalling; case content::ServiceWorkerVersion::INSTALLED: return blink::mojom::ServiceWorkerState::kInstalled; case content::ServiceWorkerVersion::ACTIVATING: return blink::mojom::ServiceWorkerState::kActivating; case content::ServiceWorkerVersion::ACTIVATED: return blink::mojom::ServiceWorkerState::kActivated; case content::ServiceWorkerVersion::REDUNDANT: return blink::mojom::ServiceWorkerState::kRedundant; } NOTREACHED() << status; return blink::mojom::ServiceWorkerState::kUnknown; } content::ServiceWorkerStatusCode TypeConverter<content::ServiceWorkerStatusCode, blink::mojom::ServiceWorkerEventStatus>:: Convert(blink::mojom::ServiceWorkerEventStatus status) { switch (status) { case blink::mojom::ServiceWorkerEventStatus::COMPLETED: return content::SERVICE_WORKER_OK; case blink::mojom::ServiceWorkerEventStatus::REJECTED: return content::SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED; case blink::mojom::ServiceWorkerEventStatus::ABORTED: return content::SERVICE_WORKER_ERROR_ABORT; } NOTREACHED() << status; return content::SERVICE_WORKER_ERROR_FAILED; } } // namespace mojo
40.555556
80
0.759817
zipated
4bdc2aacd41ed2b2e6375f05dc56913a95edc115
18,710
cpp
C++
FaceRecognizer/seeta/FaceRecognizerPrivate.cpp
glcnzude126/SeetaFace2
1c8c20bf87e2d0a8f582a025869c184145a30b5d
[ "BSD-2-Clause" ]
null
null
null
FaceRecognizer/seeta/FaceRecognizerPrivate.cpp
glcnzude126/SeetaFace2
1c8c20bf87e2d0a8f582a025869c184145a30b5d
[ "BSD-2-Clause" ]
null
null
null
FaceRecognizer/seeta/FaceRecognizerPrivate.cpp
glcnzude126/SeetaFace2
1c8c20bf87e2d0a8f582a025869c184145a30b5d
[ "BSD-2-Clause" ]
null
null
null
#include "FaceRecognizerPrivate.h" #include <cmath> #include <string> #include <memory> #include <algorithm> #include <functional> #include <iostream> #include <SeetaNetForward.h> #include "SeetaModelHeader.h" #include "seeta/common_alignment.h" #include "seeta/ImageProcess.h" class FaceRecognizerPrivate::Recognizer { public: SeetaNet_Model *model = nullptr; SeetaNet_Net *net = nullptr; seeta::FRModelHeader header; SeetaDevice device = SEETA_DEVICE_AUTO; // for memory share SeetaNet_SharedParam *param = nullptr; std::string version; std::string date; std::string name; std::function<float(float)> trans_func; static int max_batch_global; int max_batch_local; // for YuLe setting int sqrt_times = -1; std::string default_method = "crop"; std::string method = ""; static int core_number_global; int recognizer_number_threads = 2; std::vector<SeetaNet_Net *> cores; Recognizer() { header.width = 256; header.height = 256; header.channels = 3; max_batch_local = max_batch_global; recognizer_number_threads = core_number_global; } void free() { if (model) SeetaReleaseModel(model); model = nullptr; if (net) SeetaReleaseNet(net); net = nullptr; for (size_t i = 1; i < cores.size(); ++i) { SeetaReleaseNet(cores[i]); } cores.clear(); } float trans(float similar) const { if (trans_func) { return trans_func(similar); } return similar; } int GetMaxBatch() { return max_batch_local; } int GetCoreNumber() { return 1; } ~Recognizer() { Recognizer::free(); } void fix() { if (this->sqrt_times < 0) { this->sqrt_times = this->header.feature_size >= 1024 ? 1 : 0; } if (this->method.empty()) { this->method = this->header.feature_size >= 1024 ? this->default_method : "resize"; } } }; int FaceRecognizerPrivate::Recognizer::max_batch_global = 1; int FaceRecognizerPrivate::Recognizer::core_number_global = 1; float sigmoid(float x, float a = 0, float b = 1) { return 1 / (1 + exp(a - b * x)); } float poly(float x, const std::vector<float> &params) { if (params.empty()) return x; float y = 0; for (size_t i = 0; i < params.size(); ++i) { int p = static_cast<int>(params.size() - 1 - i); y += params[i] * std::pow(x, p); } return std::max<float>(0, std::min<float>(1, y)); } FaceRecognizerModel::FaceRecognizerModel(const char *model_path, int device) : m_impl(new FaceRecognizerPrivate::Recognizer) { auto recognizer = reinterpret_cast<FaceRecognizerPrivate::Recognizer *>(m_impl); if (!model_path) { std::cout << "Can not load empty model" << std::endl; exit(-1); } int gpu_id = 0; SeetaNet_DEVICE_TYPE type = SEETANET_CPU_DEVICE; recognizer->device = SeetaDevice(device); std::shared_ptr<char> sta_buffer; char *buffer = nullptr; int64_t buffer_len = 0; std::ifstream inf(model_path, std::ios::binary); if (!inf.is_open()) { std::cout << "Can not access \"" << model_path << "\"" << std::endl; exit(-1); } inf.seekg(0, std::ios::end); auto sta_length = inf.tellg(); sta_buffer.reset(new char[size_t(sta_length)], std::default_delete<char[]>()); inf.seekg(0, std::ios::beg); inf.read(sta_buffer.get(), sta_length); buffer = sta_buffer.get(); buffer_len = sta_length; inf.close(); // read header size_t header_size = recognizer->header.read_ex(buffer, size_t(buffer_len)); // convert the model if (SeetaReadModelFromBuffer(buffer + header_size, size_t(buffer_len - header_size), &recognizer->model)) { std::cout << "Got an broken model file" << std::endl; exit(-1); } // create the net int err_code; err_code = SeetaCreateNetSharedParam(recognizer->model, 1, type, &recognizer->net, &recognizer->param); if (err_code) { SeetaReleaseModel(recognizer->model); recognizer->model = nullptr; std::cout << "Can not init net from broken model" << std::endl; exit(-1); } recognizer->fix(); // here, we got model, net, and param } FaceRecognizerModel::~FaceRecognizerModel() { auto recognizer = reinterpret_cast<FaceRecognizerPrivate::Recognizer *>(m_impl); delete recognizer; } const FaceRecognizerPrivate::Param *FaceRecognizerPrivate::GetParam() const { return reinterpret_cast<const Param *>(SeetaGetSharedParam(recognizer->net)); } FaceRecognizerPrivate::FaceRecognizerPrivate(const Param *param) : recognizer(new Recognizer) { #ifdef SEETA_CHECK_INIT SEETA_CHECK_INIT; #endif recognizer->param = const_cast<SeetaNet_SharedParam *>(reinterpret_cast<const SeetaNet_SharedParam *>(param)); } FaceRecognizerPrivate::FaceRecognizerPrivate(const FaceRecognizerModel &model) : recognizer(new Recognizer) { #ifdef SEETA_CHECK_INIT SEETA_CHECK_INIT; #endif auto other = reinterpret_cast<FaceRecognizerPrivate::Recognizer *>(model.m_impl); auto device = other->device; using self = FaceRecognizerPrivate; SeetaNet_DEVICE_TYPE type = SEETANET_CPU_DEVICE; *recognizer = *other; recognizer->model = nullptr; recognizer->net = nullptr; int err_code; err_code = SeetaCreateNetSharedParam(other->model, GetMaxBatch(), type, &recognizer->net, &other->param); if (err_code) { std::cout << "Can not init net from unload model" << std::endl; exit(-1); } SeetaKeepBlob(recognizer->net, recognizer->header.blob_name.c_str()); } FaceRecognizerPrivate::FaceRecognizerPrivate(const char *modelPath) : FaceRecognizerPrivate(modelPath, SEETA_DEVICE_AUTO, 0) { } FaceRecognizerPrivate::FaceRecognizerPrivate(const char *modelPath, SeetaDevice device, int gpuid) : recognizer(new Recognizer) { #ifdef SEETA_CHECK_INIT SEETA_CHECK_INIT; #endif if (modelPath && !LoadModel(modelPath, device, gpuid)) { std::cerr << "Error: Can not access \"" << modelPath << "\"!" << std::endl; throw std::logic_error("Missing model"); } } FaceRecognizerPrivate::FaceRecognizerPrivate(const char *modelBuffer, size_t bufferLength, SeetaDevice device, int gpuid) : recognizer(new Recognizer) { #ifdef SEETA_CHECK_INIT SEETA_CHECK_INIT; #endif if (modelBuffer && !LoadModel(modelBuffer, bufferLength, device, gpuid)) { std::cerr << "Error: Can not initialize from memory!" << std::endl; throw std::logic_error("Missing model"); } } FaceRecognizerPrivate::~FaceRecognizerPrivate() { delete recognizer; } bool FaceRecognizerPrivate::LoadModel(const char *modelPath) { return LoadModel(modelPath, SEETA_DEVICE_AUTO, 0); } bool FaceRecognizerPrivate::LoadModel(const char *modelPath, SeetaDevice device, int gpuid) { if (modelPath == NULL) return false; recognizer->trans_func = nullptr; char *buffer = nullptr; int64_t buffer_len = 0; if (SeetaReadAllContentFromFile(modelPath, &buffer, &buffer_len)) { return false; } bool loaded = LoadModel(buffer, size_t(buffer_len), device, gpuid); SeetaFreeBuffer(buffer); recognizer->fix(); return loaded; } bool FaceRecognizerPrivate::LoadModel(const char *modelBuffer, size_t bufferLength, SeetaDevice device, int gpuid) { // Code #ifdef NEED_CHECK checkit(); #endif if (modelBuffer == NULL) { return false; } recognizer->free(); using self = FaceRecognizerPrivate; SeetaNet_DEVICE_TYPE type = SEETANET_CPU_DEVICE; recognizer->device = device; // read header size_t header_size = recognizer->header.read_ex(modelBuffer, bufferLength); std::cout << "[INFO] FaceRecognizer: " << "Feature size: " << recognizer->header.feature_size << std::endl; // convert the model if (SeetaReadModelFromBuffer(modelBuffer + header_size, bufferLength - header_size, &recognizer->model)) { return false; } // create the net int err_code; err_code = SeetaCreateNetSharedParam(recognizer->model, GetMaxBatch(), type, &recognizer->net, &recognizer->param); if (err_code) { SeetaReleaseModel(recognizer->model); recognizer->model = nullptr; return false; } SeetaKeepBlob(recognizer->net, recognizer->header.blob_name.c_str()); SeetaReleaseModel(recognizer->model); recognizer->model = nullptr; return true; } uint32_t FaceRecognizerPrivate::GetFeatureSize() { return recognizer->header.feature_size; } uint32_t FaceRecognizerPrivate::GetCropWidth() { return recognizer->header.width; } uint32_t FaceRecognizerPrivate::GetCropHeight() { return recognizer->header.height; } uint32_t FaceRecognizerPrivate::GetCropChannels() { return recognizer->header.channels; } bool FaceRecognizerPrivate::CropFace(const SeetaImageData &srcImg, const SeetaPointF *llpoint, SeetaImageData &dstImg, uint8_t posNum) { float mean_shape[10] = { 89.3095f, 72.9025f, 169.3095f, 72.9025f, 127.8949f, 127.0441f, 96.8796f, 184.8907f, 159.1065f, 184.7601f, }; float points[10]; for (int i = 0; i < 5; ++i) { points[2 * i] = float(llpoint[i].x); points[2 * i + 1] = float(llpoint[i].y); } if (GetCropHeight() == 256 && GetCropWidth() == 256) { face_crop_core(srcImg.data, srcImg.width, srcImg.height, srcImg.channels, dstImg.data, GetCropWidth(), GetCropHeight(), points, 5, mean_shape, 256, 256); } else { if (recognizer->method == "resize") { seeta::Image face256x256(256, 256, 3); face_crop_core(srcImg.data, srcImg.width, srcImg.height, srcImg.channels, face256x256.data(), 256, 256, points, 5, mean_shape, 256, 256); seeta::Image fixed = seeta::resize(face256x256, seeta::Size(GetCropWidth(), GetCropHeight())); fixed.copy_to(dstImg.data); } else { face_crop_core(srcImg.data, srcImg.width, srcImg.height, srcImg.channels, dstImg.data, GetCropWidth(), GetCropHeight(), points, 5, mean_shape, 256, 256); } } return true; } bool FaceRecognizerPrivate::ExtractFeature(const SeetaImageData &cropImg, float *feats) { std::vector<SeetaImageData> faces = { cropImg }; return ExtractFeature(faces, feats, false); } static void normalize(float *features, int num) { double norm = 0; float *dim = features; for (int i = 0; i < num; ++i) { norm += *dim * *dim; ++dim; } norm = std::sqrt(norm) + 1e-5; dim = features; for (int i = 0; i < num; ++i) { *dim /= float(norm); ++dim; } } bool FaceRecognizerPrivate::ExtractFeatureNormalized(const SeetaImageData &cropImg, float *feats) { std::vector<SeetaImageData> faces = { cropImg }; return ExtractFeature(faces, feats, true); } bool FaceRecognizerPrivate::ExtractFeatureWithCrop(const SeetaImageData &srcImg, const SeetaPointF *llpoint, float *feats, uint8_t posNum) { SeetaImageData dstImg; dstImg.width = GetCropWidth(); dstImg.height = GetCropHeight(); dstImg.channels = srcImg.channels; std::unique_ptr<uint8_t[]> dstImgData(new uint8_t[dstImg.width * dstImg.height * dstImg.channels]); dstImg.data = dstImgData.get(); CropFace(srcImg, llpoint, dstImg, posNum); ExtractFeature(dstImg, feats); return true; } bool FaceRecognizerPrivate::ExtractFeatureWithCropNormalized(const SeetaImageData &srcImg, const SeetaPointF *llpoint, float *feats, uint8_t posNum) { if (ExtractFeatureWithCrop(srcImg, llpoint, feats, posNum)) { normalize(feats, GetFeatureSize()); return true; } return false; } float FaceRecognizerPrivate::CalcSimilarity(const float *fc1, const float *fc2, long dim) { if (dim <= 0) dim = GetFeatureSize(); double dot = 0; double norm1 = 0; double norm2 = 0; for (size_t i = 0; i < dim; ++i) { dot += fc1[i] * fc2[i]; norm1 += fc1[i] * fc1[i]; norm2 += fc2[i] * fc2[i]; } double similar = dot / (sqrt(norm1 * norm2) + 1e-5); return recognizer->trans(float(similar)); } float FaceRecognizerPrivate::CalcSimilarityNormalized(const float *fc1, const float *fc2, long dim) { if (dim <= 0) dim = GetFeatureSize(); double dot = 0; const float *fc1_dim = fc1; const float *fc2_dim = fc2; for (int i = 0; i < dim; ++i) { dot += *fc1_dim * *fc2_dim; ++fc1_dim; ++fc2_dim; } double similar = dot; return recognizer->trans(float(similar)); } int FaceRecognizerPrivate::SetMaxBatchGlobal(int max_batch) { std::swap(max_batch, Recognizer::max_batch_global); return max_batch; } int FaceRecognizerPrivate::GetMaxBatch() { return recognizer->GetMaxBatch(); } int FaceRecognizerPrivate::SetCoreNumberGlobal(int core_number) { std::swap(core_number, Recognizer::core_number_global); return core_number; } int FaceRecognizerPrivate::GetCoreNumber() { return recognizer->GetCoreNumber(); } template <typename T> static void CopyData(T *dst, const T *src, size_t count) { #if _MSC_VER >= 1600 memcpy_s(dst, count * sizeof(T), src, count * sizeof(T)); #else memcpy(dst, src, count * sizeof(T)); #endif } static bool LocalExtractFeature( int number, int width, int height, int channels, unsigned char *data, SeetaNet_Net *net, int max_batch, const char *blob_name, int feature_size, float *feats, bool normalization, int sqrt_times = 0) { if (!net) return false; if (data == nullptr || number <= 0) return true; auto single_image_size = channels * height * width; if (number > max_batch) { // Divide and Conquer int end = number; int step = max_batch; int left = 0; while (left < end) { int right = std::min(left + step, end); int local_number = right - left; unsigned char *local_data = data + left * single_image_size; float *local_feats = feats + left * feature_size; if (!LocalExtractFeature( local_number, width, height, channels, local_data, net, max_batch, blob_name, feature_size, local_feats, normalization, sqrt_times)) return false; left = right; } return true; } SeetaNet_InputOutputData himg; himg.number = number; himg.channel = channels; himg.height = height; himg.width = width; himg.buffer_type = SEETANET_BGR_IMGE_CHAR; himg.data_point_char = data; // do forward if (SeetaRunNetChar(net, 1, &himg)) { std::cout << "SeetaRunNetChar failed." << std::endl; return false; } // get the output SeetaNet_InputOutputData output; if (SeetaGetFeatureMap(net, blob_name, &output)) { std::cout << "SeetaGetFeatureMap failed." << std::endl; return false; } // check the output size if (output.channel * output.height * output.width != feature_size || output.number != himg.number) { std::cout << "output shape missmatch. " << feature_size << " expected. but " << output.channel *output.height *output.width << " given" << std::endl; return false; } // copy data for output CopyData(feats, output.data_point_float, output.number * feature_size); int32_t all_feats_size = output.number * feature_size; float *all_feats = feats; #if defined(DOUBLE_SQRT) || defined(SINGLE_SQRT) for (int i = 0; i != all_feats_size; i++) { #if defined(DOUBLE_SQRT) feat[i] = sqrt(sqrt(feat[i])); #elif defined(SINGLE_SQRT) all_feats[i] = sqrt(all_feats[i]); #endif // DOUBLE_SQRT } #endif // DOUBLE_SQRT || SINGLE_SQRT if (sqrt_times > 0) { while (sqrt_times--) { for (int i = 0; i != all_feats_size; i++) all_feats[i] = std::sqrt(all_feats[i]); } } if (normalization) { for (int i = 0; i < number; ++i) { float *local_feats = feats + i * feature_size; normalize(local_feats, feature_size); } } return true; } bool FaceRecognizerPrivate::ExtractFeature(const std::vector<SeetaImageData> &faces, float *feats, bool normalization) { if (!recognizer->net) return false; if (faces.empty()) return true; int number = int(faces.size()); int channels = GetCropChannels(); int height = GetCropHeight(); int width = GetCropWidth(); auto single_image_size = channels * height * width; std::unique_ptr<unsigned char[]> data_point_char(new unsigned char[number * single_image_size]); for (int i = 0; i < number; ++i) { if (faces[i].channels == channels && faces[i].height == height && faces[i].width == width) { CopyData(&data_point_char[i * single_image_size], faces[i].data, single_image_size); continue; } if (recognizer->method == "resize") { seeta::Image face(faces[i].data, faces[i].width, faces[i].height, faces[i].channels); seeta::Image fixed = seeta::resize(face, seeta::Size(GetCropWidth(), GetCropHeight())); CopyData(&data_point_char[i * single_image_size], fixed.data(), single_image_size); } else { seeta::Image face(faces[i].data, faces[i].width, faces[i].height, faces[i].channels); seeta::Rect rect((GetCropWidth() - faces[i].width) / 2, (GetCropHeight() - faces[i].height) / 2, GetCropWidth(), GetCropHeight()); seeta::Image fixed = seeta::crop_resize(face, rect, seeta::Size(GetCropWidth(), GetCropHeight())); CopyData(&data_point_char[i * single_image_size], fixed.data(), single_image_size); } } return LocalExtractFeature( number, width, height, channels, data_point_char.get(), recognizer->net, GetMaxBatch(), recognizer->header.blob_name.c_str(), GetFeatureSize(), feats, normalization, recognizer->sqrt_times); } bool FaceRecognizerPrivate::ExtractFeatureNormalized(const std::vector<SeetaImageData> &faces, float *feats) { return ExtractFeature(faces, feats, true); } // on checking param, sure right static bool CropFaceBatch(FaceRecognizerPrivate &FR, const std::vector<SeetaImageData> &images, const std::vector<SeetaPointF> &points, unsigned char *faces_data) { const int PN = 5; const auto single_image_size = FR.GetCropChannels() * FR.GetCropHeight() * FR.GetCropWidth(); unsigned char *single_face_data = faces_data; const SeetaPointF *single_points = points.data(); for (size_t i = 0; i < images.size(); ++i) { SeetaImageData face; face.width = FR.GetCropWidth(); face.height = FR.GetCropHeight(); face.channels = FR.GetCropChannels(); face.data = single_face_data; if (!FR.CropFace(images[i], single_points, face)) return false; single_points += PN; single_face_data += single_image_size; } return true; } bool FaceRecognizerPrivate::ExtractFeatureWithCrop(const std::vector<SeetaImageData> &images, const std::vector<SeetaPointF> &points, float *feats, bool normalization) { if (!recognizer->net) return false; if (images.empty()) return true; const int PN = 5; if (images.size() * PN != points.size()) { return false; } // crop face std::unique_ptr<unsigned char[]> faces_data(new unsigned char[images.size() * GetCropChannels() * GetCropHeight() * GetCropWidth()]); ::CropFaceBatch(*this, images, points, faces_data.get()); int number = int(images.size()); int channels = GetCropChannels(); int height = GetCropHeight(); int width = GetCropWidth(); return LocalExtractFeature( number, width, height, channels, faces_data.get(), recognizer->net, GetMaxBatch(), recognizer->header.blob_name.c_str(), GetFeatureSize(), feats, normalization, recognizer->sqrt_times ); } bool FaceRecognizerPrivate::ExtractFeatureWithCropNormalized(const std::vector<SeetaImageData> &images, const std::vector<SeetaPointF> &points, float *feats) { return ExtractFeatureWithCrop(images, points, feats, true); }
23.895275
156
0.708552
glcnzude126
4bdcbd3ca95c78dbc88ff627212e69599c9396f3
753
hpp
C++
IA-testing/IA/IA/ICromosomaObserver.hpp
alseether/GeneticGame
83bbdf926e6eb0974d9cacba7b315c91e59a1095
[ "MIT" ]
5
2017-07-08T18:26:31.000Z
2022-03-30T12:07:03.000Z
IA-testing/IA/IA/ICromosomaObserver.hpp
alseether/GeneticGame
83bbdf926e6eb0974d9cacba7b315c91e59a1095
[ "MIT" ]
null
null
null
IA-testing/IA/IA/ICromosomaObserver.hpp
alseether/GeneticGame
83bbdf926e6eb0974d9cacba7b315c91e59a1095
[ "MIT" ]
2
2017-07-08T18:26:33.000Z
2018-10-26T08:14:28.000Z
#ifndef ICROMOSOMAOBSERVER_HPP #define ICROMOSOMAOBSERVER_HPP #include "npc.hpp" #include "Mapa.hpp" #include "Cromosoma.hpp" class Cromosoma; class ICromosomaObserver{ public: virtual ~ICromosomaObserver() {}; virtual void onSimulacionIniciada(const Cromosoma*) = 0; virtual void onTurno(const Cromosoma*, npc, npc, Mapa, Mapa, Mapa, Mapa) = 0; // jugador, enemigo, mapa, explorado, andado virtual void onMapaTerminado(double fitness, double factorPatrulla, int cExpl, int cAndadas, int turnosQueValen, double factorAtaque, int cAndadasAtaque, int golpesEvitados, int golpes, int encontradoAtaque, int turnosAtaque, int intentos, double distancia, int turnosGolpeo) = 0; virtual void onSimulacionTerminada(const Cromosoma*) = 0; }; #endif
31.375
281
0.780876
alseether
4bdda407769d525130dc6a91ae9cf106f1f6f3c1
1,035
cc
C++
src/wal/encoder.cc
Watch-Later/libraft
f45c39c1d77558ea3f262fd366b05f0a38504be4
[ "Apache-2.0" ]
106
2018-03-08T10:29:21.000Z
2022-03-20T11:50:40.000Z
src/wal/encoder.cc
Watch-Later/libraft
f45c39c1d77558ea3f262fd366b05f0a38504be4
[ "Apache-2.0" ]
1
2019-08-20T06:49:34.000Z
2020-05-17T01:35:44.000Z
src/wal/encoder.cc
Watch-Later/libraft
f45c39c1d77558ea3f262fd366b05f0a38504be4
[ "Apache-2.0" ]
35
2018-11-06T07:58:36.000Z
2022-03-13T14:23:07.000Z
/* * Copyright (C) lichuang */ #include "base/file.h" #include "base/crc32c.h" #include "wal/encoder.h" namespace libraft { encoder* newEncoder(File* file, uint32_t prevCrc, int32_t pageOffset) { encoder* ec = new encoder(); return ec; } int encoder::encode(Record* rec) { locker.Lock(); string data; rec->set_crc(Value(rec->data().c_str(), rec->data().size())); rec->SerializeToString(&data); uint64_t lenField; int64_t padBytes; encodeFrameSize(data.length(), &lenField, &padBytes); int err; err = file->WriteUint64(lenField); if (err != kOK) { return err; } if (padBytes != 0) { data += string('\0', padBytes); } return file->Write(data); } void encoder::encodeFrameSize(int64_t dataBytes, uint64_t* lenField, int64_t* padBytes) { *lenField = uint64_t(dataBytes); // force 8 byte alignment so length never gets a torn write *padBytes = (8 - (dataBytes % 8)) % 8; if (*padBytes != 0) { *lenField |= uint64_t(0x80 | *padBytes) << 56; } } }; // namespace libraft
20.294118
84
0.645411
Watch-Later
4bdeae632048141dd6f6047df723979c16f4e95b
31,226
hpp
C++
Types/PE/include/pe.hpp
rzaharia/GView
db1836121de7007ebcf591a1f9755176e9ab0bde
[ "MIT" ]
null
null
null
Types/PE/include/pe.hpp
rzaharia/GView
db1836121de7007ebcf591a1f9755176e9ab0bde
[ "MIT" ]
null
null
null
Types/PE/include/pe.hpp
rzaharia/GView
db1836121de7007ebcf591a1f9755176e9ab0bde
[ "MIT" ]
null
null
null
#pragma once #include "GView.hpp" #define MAX_NR_SECTIONS 256 #define MAX_DLL_NAME 64 #define MAX_PDB_NAME 128 #define MAX_EXPORTFNC_SIZE 128 #define MAX_IMPORTFNC_SIZE 128 #define MAX_RES_NAME 64 #define MAX_DESCRIPTION_SIZE 256 #define MAX_VERNAME_SIZE 64 #define MAX_VERVERSION_SIZE 32 #define MAX_VERSION_BUFFER 16386 #define PE_INVALID_ADDRESS 0xFFFFFFFFFFFFFFFF #define MAX_IMPORTED_FUNCTIONS 4096 #define ADDR_FA 0 #define ADDR_RVA 1 #define ADDR_VA 2 #define MAX_ADDR_TYPES 3 #define IMAGE_DLLCHARACTERISTICS_APPCONTAINER 0x1000 #define IMAGE_DLLCHARACTERISTICS_NO_LEGACY_BIOS_DEPENDENCIES 0x2000 #define __IMAGE_DOS_SIGNATURE 0x5A4D #define __IMAGE_NT_SIGNATURE 0x00004550 #define __IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b #define __IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b #define __IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107 #define __IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 #define __IMAGE_SIZEOF_SHORT_NAME 8 #define __IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file. #define __IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved external references). #define __IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file. #define __IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file. #define __IMAGE_FILE_AGGRESIVE_WS_TRIM 0x0010 // Aggressively trim working set #define __IMAGE_FILE_LARGE_ADDRESS_AWARE 0x0020 // App can handle >2gb addresses #define __IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed. #define __IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine. #define __IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file #define __IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 0x0400 // If Image is on removable media, copy and run from the swap file. #define __IMAGE_FILE_NET_RUN_FROM_SWAP 0x0800 // If Image is on Net, copy and run from the swap file. #define __IMAGE_FILE_SYSTEM 0x1000 // System File. #define __IMAGE_FILE_DLL 0x2000 // File is a DLL. #define __IMAGE_FILE_UP_SYSTEM_ONLY 0x4000 // File should only be run on a UP machine #define __IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed. #define __IMAGE_FILE_MACHINE_UNKNOWN 0 #define __IMAGE_FILE_MACHINE_I386 0x014c // Intel 386. #define __IMAGE_FILE_MACHINE_R3000 0x0162 // MIPS little-endian, 0x160 big-endian #define __IMAGE_FILE_MACHINE_R4000 0x0166 // MIPS little-endian #define __IMAGE_FILE_MACHINE_R10000 0x0168 // MIPS little-endian #define __IMAGE_FILE_MACHINE_WCEMIPSV2 0x0169 // MIPS little-endian WCE v2 #define __IMAGE_FILE_MACHINE_ALPHA 0x0184 // Alpha_AXP #define __IMAGE_FILE_MACHINE_SH3 0x01a2 // SH3 little-endian #define __IMAGE_FILE_MACHINE_SH3DSP 0x01a3 #define __IMAGE_FILE_MACHINE_SH3E 0x01a4 // SH3E little-endian #define __IMAGE_FILE_MACHINE_SH4 0x01a6 // SH4 little-endian #define __IMAGE_FILE_MACHINE_SH5 0x01a8 // SH5 #define __IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM Little-Endian #define __IMAGE_FILE_MACHINE_THUMB 0x01c2 // ARM Thumb/Thumb-2 Little-Endian #define __IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian #define __IMAGE_FILE_MACHINE_AM33 0x01d3 #define __IMAGE_FILE_MACHINE_POWERPC 0x01F0 // IBM PowerPC Little-Endian #define __IMAGE_FILE_MACHINE_POWERPCFP 0x01f1 #define __IMAGE_FILE_MACHINE_IA64 0x0200 // Intel 64 #define __IMAGE_FILE_MACHINE_MIPS16 0x0266 // MIPS #define __IMAGE_FILE_MACHINE_ALPHA64 0x0284 // ALPHA64 #define __IMAGE_FILE_MACHINE_MIPSFPU 0x0366 // MIPS #define __IMAGE_FILE_MACHINE_MIPSFPU16 0x0466 // MIPS #define __IMAGE_FILE_MACHINE_AXP64 __IMAGE_FILE_MACHINE_ALPHA64 #define __IMAGE_FILE_MACHINE_TRICORE 0x0520 // Infineon #define __IMAGE_FILE_MACHINE_CEF 0x0CEF #define __IMAGE_FILE_MACHINE_EBC 0x0EBC // EFI Byte Code #define __IMAGE_FILE_MACHINE_AMD64 0x8664 // AMD64 (K8) #define __IMAGE_FILE_MACHINE_M32R 0x9041 // M32R little-endian #define __IMAGE_FILE_MACHINE_CEE 0xC0EE #define __IMAGE_SUBSYSTEM_UNKNOWN 0 // Unknown subsystem. #define __IMAGE_SUBSYSTEM_NATIVE 1 // Image doesn't require a subsystem. #define __IMAGE_SUBSYSTEM_WINDOWS_GUI 2 // Image runs in the Windows GUI subsystem. #define __IMAGE_SUBSYSTEM_WINDOWS_CUI 3 // Image runs in the Windows character subsystem. #define __IMAGE_SUBSYSTEM_OS2_CUI 5 // image runs in the OS/2 character subsystem. #define __IMAGE_SUBSYSTEM_POSIX_CUI 7 // image runs in the Posix character subsystem. #define __IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8 // image is a native Win9x driver. #define __IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9 // Image runs in the Windows CE subsystem. #define __IMAGE_SUBSYSTEM_EFI_APPLICATION 10 // #define __IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11 // #define __IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12 // #define __IMAGE_SUBSYSTEM_EFI_ROM 13 #define __IMAGE_SUBSYSTEM_XBOX 14 #define __IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION 16 #define __IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory #define __IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory #define __IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory #define __IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory #define __IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security Directory #define __IMAGE_DIRECTORY_ENTRY_BASERELOC 5 // Base Relocation Table #define __IMAGE_DIRECTORY_ENTRY_DEBUG 6 // Debug Directory // __IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // (X86 usage) #define __IMAGE_DIRECTORY_ENTRY_ARCHITECTURE 7 // Architecture Specific Data #define __IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 // RVA of GP #define __IMAGE_DIRECTORY_ENTRY_TLS 9 // TLS Directory #define __IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 // Load Configuration Directory #define __IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11 // Bound Import Directory in headers #define __IMAGE_DIRECTORY_ENTRY_IAT 12 // Import Address Table #define __IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13 // Delay Load Import Descriptors #define __IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14 // COM Runtime descriptor #define __IMAGE_DEBUG_TYPE_UNKNOWN 0 #define __IMAGE_DEBUG_TYPE_COFF 1 #define __IMAGE_DEBUG_TYPE_CODEVIEW 2 #define __IMAGE_DEBUG_TYPE_FPO 3 #define __IMAGE_DEBUG_TYPE_MISC 4 #define __IMAGE_DEBUG_TYPE_EXCEPTION 5 #define __IMAGE_DEBUG_TYPE_FIXUP 6 #define __IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7 #define __IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8 #define __IMAGE_DEBUG_TYPE_BORLAND 9 #define __IMAGE_DEBUG_TYPE_RESERVED10 10 #define __IMAGE_DEBUG_TYPE_CLSID 11 #define __IMAGE_SCN_CNT_CODE 0x00000020 // Section contains code. #define __IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 // Section contains initialized data. #define __IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 // Section contains uninitialized data. #define __IMAGE_SCN_MEM_SHARED 0x10000000 // Section is shareable. #define __IMAGE_SCN_MEM_EXECUTE 0x20000000 // Section is executable. #define __IMAGE_SCN_MEM_READ 0x40000000 // Section is readable. #define __IMAGE_SCN_MEM_WRITE 0x80000000 // Section is writeable. #define __IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA 0x0020 // Image can handle a high entropy 64-bit virtual address space. #define __IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE 0x0040 // DLL can move. #define __IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY 0x0080 // Code Integrity Image #define __IMAGE_DLLCHARACTERISTICS_NX_COMPAT 0x0100 // Image is NX compatible #define __IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200 // Image understands isolation and doesn't want it #define __IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400 // Image does not use SEH. No SE handler may reside in this image #define __IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800 // Do not bind this image. #define __IMAGE_DLLCHARACTERISTICS_APPCONTAINER 0x1000 // Image should execute in an AppContainer #define __IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000 // Driver uses WDM model #define __IMAGE_DLLCHARACTERISTICS_GUARD_CF 0x4000 // Image supports Control Flow Guard. #define __IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000 #define __MAKEINITRESOURCE(i) ((uint32_t*) (i)) #define __RT_CURSOR 1 #define __RT_BITMAP 2 #define __RT_ICON 3 #define __RT_MENU 4 #define __RT_DIALOG 5 #define __RT_STRING 6 #define __RT_FONTDIR 7 #define __RT_FONT 8 #define __RT_ACCELERATOR 9 #define __RT_RCDATA 10 #define __RT_MESSAGETABLE 11 #define __DIFFERENCE 11 #define __RT_GROUP_CURSOR ((__RT_CURSOR) + __DIFFERENCE) #define __RT_GROUP_ICON ((__RT_ICON) + __DIFFERENCE) #define __RT_VERSION 16 #define __RT_DLGINCLUDE 17 #define __RT_PLUGPLAY 19 #define __RT_VXD 20 #define __RT_ANICURSOR 21 #define __RT_ANIICON 22 #define __RT_HTML 23 #define __RT_MANIFEST 24 #define __BI_RGB 0L #define __BI_RLE8 1L #define __BI_RLE4 2L #define __BI_BITFIELDS 3L #define __BI_JPEG 4L #define __BI_PNG 5L #define __IMAGE_ORDINAL_FLAG32 0x80000000 #define __IMAGE_ORDINAL_FLAG64 0x8000000000000000 #define __ANYSIZE_ARRAY 1 #define MAX_VERION_PAIRS 64 #define MAX_VERSION_UNICODE 128 #define VERSION_VSFIX_SIG 0xFEEF04BD namespace GView { namespace Type { namespace PE { namespace Panels { enum class IDs : unsigned char { Information = 0, Directories, Exports, Sections, Headers, Resources, Icons, Imports, TLS, }; }; class VersionInformation { #pragma pack(push, 1) struct VersionString { uint16_t wLength; uint16_t wValueLength; uint16_t wType; uint16_t Key[1]; }; struct VS_FIXEDFILEINFO { uint32_t dwSignature; uint32_t dwStrucVersion; uint32_t dwFileVersionMS; uint32_t dwFileVersionLS; uint32_t dwProductVersionMS; uint32_t dwProductVersionLS; uint32_t dwFileFlagsMask; uint32_t dwFileFlags; uint32_t dwFileOS; uint32_t dwFileType; uint32_t dwFileSubtype; uint32_t dwFileDateMS; uint32_t dwFileDateLS; }; #pragma pack(pop) struct VersionPair { String Key, Value; uint16_t Unicode[MAX_VERSION_UNICODE]; }; VersionPair Pairs[MAX_VERION_PAIRS]; int nrPairs; int AddPair(const unsigned char* Buffer, int size, int poz); bool TestIfValidKey(const unsigned char* Buffer, int size, int poz); public: VersionInformation(void); ~VersionInformation(void); bool ComputeVersionInformation(const unsigned char* Buffer, int size); int GetNrItems() { return nrPairs; } String* GetKey(int index) { return &Pairs[index].Key; } String* GetValue(int index) { return &Pairs[index].Value; } uint16_t* GetUnicode(int index) { return &Pairs[index].Unicode[0]; } }; struct Guid { uint32_t Data1; uint16_t Data2; uint16_t Data3; uint8_t Data4[8]; }; #pragma pack(push, 4) struct ImageTLSDirectory32 { uint32_t StartAddressOfRawData; uint32_t EndAddressOfRawData; uint32_t AddressOfIndex; // PDWORD uint32_t AddressOfCallBacks; // PIMAGE_TLS_CALLBACK * uint32_t SizeOfZeroFill; union { uint32_t Characteristics; struct { uint32_t Reserved0 : 20; uint32_t Alignment : 4; uint32_t Reserved1 : 8; }; }; }; struct ImageDebugDirectory { uint32_t Characteristics; uint32_t TimeDateStamp; uint16_t MajorVersion; uint16_t MinorVersion; uint32_t Type; uint32_t SizeOfData; uint32_t AddressOfRawData; uint32_t PointerToRawData; }; struct ImageExportDirectory { uint32_t Characteristics; uint32_t TimeDateStamp; uint16_t MajorVersion; uint16_t MinorVersion; uint32_t Name; uint32_t Base; uint32_t NumberOfFunctions; uint32_t NumberOfNames; uint32_t AddressOfFunctions; // RVA from base of image uint32_t AddressOfNames; // RVA from base of image uint32_t AddressOfNameOrdinals; // RVA from base of image }; #pragma pack(push, 2) struct ImageDOSHeader { uint16_t e_magic; // Magic number uint16_t e_cblp; // Bytes on last page of file uint16_t e_cp; // Pages in file uint16_t e_crlc; // Relocations uint16_t e_cparhdr; // Size of header in paragraphs uint16_t e_minalloc; // Minimum extra paragraphs needed uint16_t e_maxalloc; // Maximum extra paragraphs needed uint16_t e_ss; // Initial (relative) SS value uint16_t e_sp; // Initial SP value uint16_t e_csum; // Checksum uint16_t e_ip; // Initial IP value uint16_t e_cs; // Initial (relative) CS value uint16_t e_lfarlc; // File address of relocation table uint16_t e_ovno; // Overlay number uint16_t e_res[4]; // Reserved words uint16_t e_oemid; // OEM identifier (for e_oeminfo) uint16_t e_oeminfo; // OEM information; e_oemid specific uint16_t e_res2[10]; // Reserved words uint32_t e_lfanew; // File address of new exe header }; #pragma pack(pop) // Back to 4 byte packing. struct ImageFileHeader { uint16_t Machine; uint16_t NumberOfSections; uint32_t TimeDateStamp; uint32_t PointerToSymbolTable; uint32_t NumberOfSymbols; uint16_t SizeOfOptionalHeader; uint16_t Characteristics; }; struct ImageDataDirectory { uint32_t VirtualAddress; uint32_t Size; }; struct ImageOptionalHeader32 { uint16_t Magic; uint8_t MajorLinkerVersion; uint8_t MinorLinkerVersion; uint32_t SizeOfCode; uint32_t SizeOfInitializedData; uint32_t SizeOfUninitializedData; uint32_t AddressOfEntryPoint; uint32_t BaseOfCode; uint32_t BaseOfData; uint32_t ImageBase; uint32_t SectionAlignment; uint32_t FileAlignment; uint16_t MajorOperatingSystemVersion; uint16_t MinorOperatingSystemVersion; uint16_t MajorImageVersion; uint16_t MinorImageVersion; uint16_t MajorSubsystemVersion; uint16_t MinorSubsystemVersion; uint32_t Win32VersionValue; uint32_t SizeOfImage; uint32_t SizeOfHeaders; uint32_t CheckSum; uint16_t Subsystem; uint16_t DllCharacteristics; uint32_t SizeOfStackReserve; uint32_t SizeOfStackCommit; uint32_t SizeOfHeapReserve; uint32_t SizeOfHeapCommit; uint32_t LoaderFlags; uint32_t NumberOfRvaAndSizes; ImageDataDirectory DataDirectory[__IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; }; struct ImageNTHeaders32 { uint32_t Signature; ImageFileHeader FileHeader; ImageOptionalHeader32 OptionalHeader; }; struct ImageOptionalHeader64 { uint16_t Magic; uint8_t MajorLinkerVersion; uint8_t MinorLinkerVersion; uint32_t SizeOfCode; uint32_t SizeOfInitializedData; uint32_t SizeOfUninitializedData; uint32_t AddressOfEntryPoint; uint32_t BaseOfCode; uint64_t ImageBase; uint32_t SectionAlignment; uint32_t FileAlignment; uint16_t MajorOperatingSystemVersion; uint16_t MinorOperatingSystemVersion; uint16_t MajorImageVersion; uint16_t MinorImageVersion; uint16_t MajorSubsystemVersion; uint16_t MinorSubsystemVersion; uint32_t Win32VersionValue; uint32_t SizeOfImage; uint32_t SizeOfHeaders; uint32_t CheckSum; uint16_t Subsystem; uint16_t DllCharacteristics; uint64_t SizeOfStackReserve; uint64_t SizeOfStackCommit; uint64_t SizeOfHeapReserve; uint64_t SizeOfHeapCommit; uint32_t LoaderFlags; uint32_t NumberOfRvaAndSizes; ImageDataDirectory DataDirectory[__IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; }; struct ImageNTHeaders64 { uint32_t Signature; ImageFileHeader FileHeader; ImageOptionalHeader64 OptionalHeader; }; struct ImageSectionHeader { uint8_t Name[__IMAGE_SIZEOF_SHORT_NAME]; union { uint32_t PhysicalAddress; uint32_t VirtualSize; } Misc; uint32_t VirtualAddress; uint32_t SizeOfRawData; uint32_t PointerToRawData; uint32_t PointerToRelocations; uint32_t PointerToLinenumbers; uint16_t NumberOfRelocations; uint16_t NumberOfLinenumbers; uint32_t Characteristics; }; struct ImageImportDescriptor { union { uint32_t Characteristics; // 0 for terminating null import descriptor uint32_t OriginalFirstThunk; // RVA to original unbound IAT (PIMAGE_THUNK_DATA) }; uint32_t TimeDateStamp; // 0 if not bound, // -1 if bound, and real date\time stamp // in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT (new BIND) // O.W. date/time stamp of DLL bound to (Old BIND) uint32_t ForwarderChain; // -1 if no forwarders uint32_t Name; uint32_t FirstThunk; // RVA to IAT (if bound this IAT has actual addresses) }; struct ImageResourceDataEntry { uint32_t OffsetToData; uint32_t Size; uint32_t CodePage; uint32_t Reserved; }; struct ImageResourceDirectory { uint32_t Characteristics; uint32_t TimeDateStamp; uint16_t MajorVersion; uint16_t MinorVersion; uint16_t NumberOfNamedEntries; uint16_t NumberOfIdEntries; // IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; }; struct ImageResourceDirectoryEntry { union { struct { uint32_t NameOffset : 31; uint32_t NameIsString : 1; }; uint32_t Name; uint16_t Id; }; union { uint32_t OffsetToData; struct { uint32_t OffsetToDirectory : 31; uint32_t DataIsDirectory : 1; }; }; }; struct ImageThunkData32 { union { uint32_t ForwarderString; // PBYTE uint32_t Function; // PDWORD uint32_t Ordinal; uint32_t AddressOfData; // PIMAGE_IMPORT_BY_NAME } u1; }; #pragma pack(push, 8) struct ImageThunkData64 { union { uint64_t ForwarderString; // PBYTE uint64_t Function; // PDWORD uint64_t Ordinal; uint64_t AddressOfData; // PIMAGE_IMPORT_BY_NAME } u1; }; #pragma pack(pop) // Pack to 4 byte packing. #pragma pack(pop) // Back to default packing. struct BitmapInfoHeader { uint32_t biSize; uint32_t biWidth; uint32_t biHeight; uint16_t biPlanes; uint16_t biBitCount; uint32_t biCompression; uint32_t biSizeImage; uint32_t biXPelsPerMeter; uint32_t biYPelsPerMeter; uint32_t biClrUsed; uint32_t biClrImportant; }; struct RGBQuad { uint8_t rgbBlue; uint8_t rgbGreen; uint8_t rgbRed; uint8_t rgbReserved; }; class PEFile : public TypeInterface { public: struct LANGANDCODEPAGE { uint16_t wLanguage; uint16_t wCodePage; }; struct ExportedFunction { uint32_t RVA; uint16_t Ordinal; FixSizeString<125> Name; }; struct PEColors { ColorPair colMZ, colPE, colSectDef; ColorPair colSect; ColorPair colDir[15]; }; struct ResourceInformation { uint32_t Type; uint32_t ID; uint32_t CodePage; uint32_t Language; uint64_t Start; uint64_t Size; FixSizeString<61> Name; }; struct ImportDllInformation { uint64_t RVA; FixSizeString<117> Name; }; struct ImportFunctionInformation { uint64_t RVA; uint32_t dllIndex; FixSizeString<111> Name; }; enum { SHOW_JUMPS = 1, SHOW_CALLS = 2, SHOW_FSTART = 4, SHOW_FEND = 8, SHOW_MZPE = 16, SHOW_INT3 = 32 }; public: Reference<GView::Utils::FileCache> file; Reference<GView::View::WindowInterface> win_interface; // PE informations ImageDOSHeader dos; union { ImageNTHeaders32 nth32; ImageNTHeaders64 nth64; }; uint32_t nrSections; uint64_t computedSize, virtualComputedSize, computedWithCertificate; uint64_t imageBase; uint64_t rvaEntryPoint; uint64_t fileAlign; FixSizeString<61> dllName; FixSizeString<125> pdbName; ImageSectionHeader sect[MAX_NR_SECTIONS]; ImageExportDirectory exportDir; ImageDataDirectory* dirs; GView::Utils::ErrorList errList; std::vector<ExportedFunction> exp; std::vector<ResourceInformation> res; std::vector<ImportDllInformation> impDLL; std::vector<ImageDebugDirectory> debugData; std::vector<ImportFunctionInformation> impFunc; ImageTLSDirectory32 tlsDir; PEColors peCols; VersionInformation Ver; uint32_t asmShow; uint32_t sectStart, peStart; uint64_t panelsMask; bool hdr64; bool isMetroApp; bool hasTLS; std::string_view ReadString(uint32_t RVA, unsigned int maxSize); bool ReadUnicodeLengthString(uint32_t FileAddress, char* text, int maxSize); public: PEFile(Reference<GView::Utils::FileCache> file); virtual ~PEFile() { } bool Update(); std::string_view GetMachine(); std::string_view GetSubsystem(); uint64_t RVAtoFilePointer(uint64_t RVA); int RVAToSectionIndex(uint64_t RVA); uint64_t FilePointerToRVA(uint64_t fileAddress); uint64_t FilePointerToVA(uint64_t fileAddress); uint64_t ConvertAddress(uint64_t address, unsigned int fromAddressType, unsigned int toAddressType); bool BuildExport(); void BuildVersionInfo(); bool ProcessResourceDataEntry(uint64_t relAddress, uint64_t startRes, uint32_t* level, uint32_t indexLevel, char* resName); bool ProcessResourceDirTable(uint64_t relAddress, uint64_t startRes, uint32_t* level, uint32_t indexLevel, char* parentName); bool BuildResources(); bool BuildImportDLLFunctions(uint32_t index, ImageImportDescriptor* impD); bool BuildImport(); bool BuildTLS(); bool BuildDebugData(); bool HasPanel(Panels::IDs id); void UpdateBufferViewZones(Reference<GView::View::BufferViewerInterface> bufferView); void CopySectionName(uint32_t index, String& name); std::string_view GetTypeName() override { return "PE"; } static std::string_view ResourceIDToName(uint32_t resID); static std::string_view LanguageIDToName(uint32_t langID); static std::string_view DirectoryIDToName(uint32_t dirID); }; namespace Panels { class Information : public AppCUI::Controls::TabPage { Reference<GView::Type::PE::PEFile> pe; Reference<AppCUI::Controls::ListView> general; Reference<AppCUI::Controls::ListView> issues; Reference<AppCUI::Controls::ListView> version; void UpdateGeneralInformation(); void UpdateVersionInformation(); void UpdateIssues(); void RecomputePanelsPositions(); public: Information(Reference<GView::Type::PE::PEFile> pe); void Update(); virtual void OnAfterResize(int newWidth, int newHeight) override { RecomputePanelsPositions(); } }; class Sections : public AppCUI::Controls::TabPage { Reference<GView::Type::PE::PEFile> pe; Reference<GView::View::WindowInterface> win; Reference<AppCUI::Controls::ListView> list; int Base; std::string_view GetValue(NumericFormatter& n, unsigned int value); void GoToSelectedSection(); void SelectCurrentSection(); public: Sections(Reference<GView::Type::PE::PEFile> pe, Reference<GView::View::WindowInterface> win); void Update(); bool OnUpdateCommandBar(AppCUI::Application::CommandBar& commandBar) override; bool OnEvent(Reference<Control>, Event evnt, int controlID) override; }; class Directories : public TabPage { Reference<GView::Type::PE::PEFile> pe; Reference<GView::View::WindowInterface> win; Reference<AppCUI::Controls::ListView> list; void GoToSelectedDirectory(); void SelectCurrentDirectory(); public: Directories(Reference<GView::Type::PE::PEFile> pe, Reference<GView::View::WindowInterface> win); void Update(); bool OnUpdateCommandBar(AppCUI::Application::CommandBar& commandBar) override; bool OnEvent(Reference<Control>, Event evnt, int controlID) override; }; class Imports: public TabPage { Reference<GView::Type::PE::PEFile> pe; Reference<GView::View::WindowInterface> win; Reference<AppCUI::Controls::ListView> list; Reference<AppCUI::Controls::ListView> info; Reference<AppCUI::Controls::ListView> dlls; public: Imports(Reference<GView::Type::PE::PEFile> pe, Reference<GView::View::WindowInterface> win); void Update(); void OnAfterResize(int newWidth, int newHeight) override; }; class Exports : public TabPage { Reference<GView::Type::PE::PEFile> pe; Reference<GView::View::WindowInterface> win; Reference<AppCUI::Controls::ListView> list; public: Exports(Reference<GView::Type::PE::PEFile> pe, Reference<GView::View::WindowInterface> win); void Update(); bool OnUpdateCommandBar(AppCUI::Application::CommandBar& commandBar) override; bool OnEvent(Reference<Control>, Event evnt, int controlID) override; }; class Resources : public TabPage { Reference<GView::Type::PE::PEFile> pe; Reference<GView::View::WindowInterface> win; Reference<AppCUI::Controls::ListView> list; void SaveCurrentResource(); void GoToSelectedResource(); void SelectCurrentResource(); public: Resources(Reference<GView::Type::PE::PEFile> pe, Reference<GView::View::WindowInterface> win); void Update(); bool OnUpdateCommandBar(AppCUI::Application::CommandBar& commandBar) override; bool OnEvent(Reference<Control>, Event evnt, int controlID) override; }; }; // namespace Panels } // namespace PE } // namespace Type } // namespace GView
38.034105
137
0.604208
rzaharia
4be12d6b090fe3b53d86842b0411f44c24a6a964
1,415
cpp
C++
SPOJ/SPOJ_-_181._Scuba_diver/main.cpp
rusucosmin/Cplusplus
0e95cd01d20b22404aa4166c71d5a9e834a5a21b
[ "MIT" ]
11
2015-08-29T13:41:22.000Z
2020-01-08T20:34:06.000Z
SPOJ/SPOJ_-_181._Scuba_diver/main.cpp
rusucosmin/Cplusplus
0e95cd01d20b22404aa4166c71d5a9e834a5a21b
[ "MIT" ]
null
null
null
SPOJ/SPOJ_-_181._Scuba_diver/main.cpp
rusucosmin/Cplusplus
0e95cd01d20b22404aa4166c71d5a9e834a5a21b
[ "MIT" ]
5
2016-01-20T18:17:01.000Z
2019-10-30T11:57:15.000Z
#include <fstream> #include <iostream> #include <vector> #include <bitset> #include <string.h> #include <algorithm> #include <iomanip> #include <math.h> #include <time.h> #include <stdlib.h> #include <set> #include <map> #include <string> #include <queue> #include <deque> using namespace std; const char infile[] = "input.in"; const char outfile[] = "output.out"; ifstream fin(infile); ofstream fout(outfile); const int MAXN = 705; const int MAXG = 1010; const int oo = 0x3f3f3f3f; typedef vector<int> Graph[MAXN]; typedef vector<int> :: iterator It; int T, A, B, N; int a, b, c; int dp[MAXG][MAXG]; int main() { cin.sync_with_stdio(false); #ifndef ONLINE_JUDGE freopen(infile, "r", stdin); freopen(outfile, "w", stdout); #endif cin >> T; for(int test = 1 ; test <= T ; ++ test) { cin >> A >> B >> N; int Ans = oo; memset(dp, oo, sizeof(dp)); dp[0][0] = 0; for(int i = 1 ; i <= N ; ++ i) { cin >> a >> b >> c; for(int j = 4 * A ; j >= 0 ; -- j) for(int k = 4 * B ; k >= 0 ; -- k) if(dp[j][k] != oo) { dp[j + a][k + b] = min(dp[j + a][k + b], dp[j][k] + c); if(j + a >= A && k + b >= B) Ans = min(Ans, dp[j + a][k + b]); } } cout << Ans << '\n'; } return 0; }
22.822581
79
0.482686
rusucosmin
4be266e5726c6be9d8b71d1f629dd07a6ebc567c
1,263
cc
C++
src/test/CppFile.cc
KomodoPlatform/marketmaker-cli
433199ecc26eaadfbeff50deebd6a16184fa4a12
[ "MIT" ]
5
2018-02-27T11:04:42.000Z
2018-09-28T20:49:01.000Z
src/test/CppFile.cc
KomodoPlatform/marketmaker-cli
433199ecc26eaadfbeff50deebd6a16184fa4a12
[ "MIT" ]
3
2018-02-27T14:07:14.000Z
2018-02-28T06:44:46.000Z
src/test/CppFile.cc
KomodoPlatform/marketmaker-cli
433199ecc26eaadfbeff50deebd6a16184fa4a12
[ "MIT" ]
6
2018-03-08T05:40:41.000Z
2018-12-31T11:09:29.000Z
#include "CppFile.h" static bool _open(AbstractFile *absFile, const char *pathname, const char *mode, err_t *errp); static long _size(AbstractFile *absFile, err_t *errp); static size_t _read(AbstractFile *absFile, void *ptr, size_t size, err_t *errp); static bool _write(AbstractFile *absFile, const void *ptr, size_t size, err_t *errp); static void _close(AbstractFile *absFile); CppFile::CppFile() { this->open = _open; this->size = _size; this->read = _read; this->write = _write; this->close = _close; } bool _open(AbstractFile *absFile, const char *pathname, const char *mode, err_t *errp) { auto *file = (CppFile *) absFile; return file->doOpen(pathname, mode, errp); } long _size(AbstractFile *absFile, err_t *errp) { auto *file = (CppFile *) absFile; return file->doSize(errp); } size_t _read(AbstractFile *absFile, void *ptr, size_t size, err_t *errp) { auto *file = (CppFile *) absFile; return file->doRead((char *) ptr, size, errp); } bool _write(AbstractFile *absFile, const void *ptr, size_t size, err_t *errp) { auto *file = (CppFile *) absFile; return file->doWrite(ptr, size, errp); } void _close(AbstractFile *absFile) { auto *file = (CppFile *) absFile; file->doClose(); }
24.288462
94
0.679335
KomodoPlatform
4be2dc3cabb7fc6d8ad6f202d1a71c2c9f3a6432
9,728
cc
C++
Test Execution/src/WebSocket_EncDec.cc
PHANTOM-Platform/MBT-Test-Execution
d22f786ba49878c9f123843a5bea538875d77795
[ "Apache-2.0" ]
null
null
null
Test Execution/src/WebSocket_EncDec.cc
PHANTOM-Platform/MBT-Test-Execution
d22f786ba49878c9f123843a5bea538875d77795
[ "Apache-2.0" ]
null
null
null
Test Execution/src/WebSocket_EncDec.cc
PHANTOM-Platform/MBT-Test-Execution
d22f786ba49878c9f123843a5bea538875d77795
[ "Apache-2.0" ]
null
null
null
/****************************************************************************** * Copyright (c) 2000-2018 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * * Contributors: * Gabor Szalai ******************************************************************************/ // // File: WebSocket_EncDec.cc // Prodnr: CNL 113 782 // Rev: R2B #include "WebSocket_Types.hh" #include <stdlib.h> #include <time.h> #include <sys/types.h> static const unsigned char zero_data[]={0,0,0,0}; static const OCTETSTRING zero_oct=OCTETSTRING(4,&zero_data[0]); namespace WebSocket__Types { void do_mask(const unsigned char* key, const unsigned char* source, unsigned char* target, size_t size){ int key_idx=0; for(size_t i=0;i<size;i++){ target[i]=source[i]^key[key_idx]; key_idx++; key_idx&=0x3; } } void f__WebSocket__Encode(const WebSocket__PDU& pl__pdu, OCTETSTRING& pl__data, const BOOLEAN& pl__gen__maks, const BOOLEAN& pl__auto__maks){ TTCN_Buffer buff; unsigned char* data_ptr=NULL; size_t payload_size=0; if(pl__pdu.payload__data().ispresent()){ if(pl__pdu.payload__data()().ischosen(WebSocket__payloads::ALT_data)){ payload_size=pl__pdu.payload__data()().data().lengthof(); } else { payload_size=2; if(pl__pdu.payload__data()().close__data().data().ispresent()){ payload_size+=pl__pdu.payload__data()().close__data().data()().lengthof(); } } } size_t data_size=14+payload_size; // max header size + payload size buff.get_end(data_ptr,data_size); unsigned char* begin_ptr=data_ptr; memset(data_ptr,0,data_size); *data_ptr|=((*((const unsigned char*)pl__pdu.fin__bit()))&0x1)<<7; *data_ptr|=((*((const unsigned char*)pl__pdu.rsv1__bit()))&0x1)<<6; *data_ptr|=((*((const unsigned char*)pl__pdu.rsv2__bit()))&0x1)<<5; *data_ptr|=((*((const unsigned char*)pl__pdu.rsv3__bit()))&0x1)<<4; *data_ptr|=((int)pl__pdu.opcode())&0xf; data_ptr++; *data_ptr|=((*((const unsigned char*)pl__pdu.mask__bit()))&0x1)<<7; // encode size if(payload_size<126){ *data_ptr|=(payload_size&0x7f); data_ptr++; } else if (payload_size<65536) { // 16 bit unsigned max size_t orig_p_size=payload_size; *data_ptr|=126; data_ptr++; data_ptr[1]=orig_p_size&0xff; orig_p_size>>=8; data_ptr[0]=orig_p_size&0xff; data_ptr+=2; } else { size_t orig_p_size=payload_size; *data_ptr|=127; data_ptr++; data_ptr[7]=orig_p_size&0xff; orig_p_size>>=8; data_ptr[6]=orig_p_size&0xff; orig_p_size>>=8; data_ptr[5]=orig_p_size&0xff; orig_p_size>>=8; data_ptr[4]=orig_p_size&0xff; orig_p_size>>=8; data_ptr[3]=orig_p_size&0xff; orig_p_size>>=8; data_ptr[2]=orig_p_size&0xff; orig_p_size>>=8; data_ptr[1]=orig_p_size&0xff; orig_p_size>>=8; data_ptr[0]=orig_p_size&0xff; data_ptr+=8; } unsigned char* mask_ptr=NULL; if(((*((const unsigned char*)pl__pdu.mask__bit()))&0x1) && pl__gen__maks && (!pl__pdu.masking__key().ispresent() || pl__pdu.masking__key()()==zero_oct)){ // generate masking key mask_ptr=data_ptr; OCTETSTRING mk=f__WebSocket__Generate__Masking__Key(); memcpy(data_ptr,(const unsigned char *)mk,4); data_ptr+=4; } else if(pl__pdu.masking__key().ispresent()) { // use the provided key mask_ptr=data_ptr; memcpy(data_ptr,(const unsigned char *)pl__pdu.masking__key()(),4); data_ptr+=4; } if(pl__pdu.payload__data().ispresent()){ if(pl__pdu.payload__data()().ischosen(WebSocket__payloads::ALT_data)){ memcpy(data_ptr, (const unsigned char *)pl__pdu.payload__data()().data(), pl__pdu.payload__data()().data().lengthof()); } else { int st_code=(int)pl__pdu.payload__data()().close__data().status__code(); data_ptr[1]=st_code&0xFF; st_code>>=8; data_ptr[0]=st_code&0xFF; if(pl__pdu.payload__data()().close__data().data().ispresent()){ memcpy(data_ptr+2, // skip status code (const unsigned char *)pl__pdu.payload__data()().close__data().data()(), pl__pdu.payload__data()().close__data().data()().lengthof()); } } } if(mask_ptr && pl__auto__maks){ // apply mask do_mask(mask_ptr,data_ptr,data_ptr,payload_size); } buff.increase_length(data_ptr-begin_ptr+payload_size); buff.get_string(pl__data); } INTEGER f__WebSocket__Decode(const OCTETSTRING& pl__data, WebSocket__PDU& pl__pdu, const BOOLEAN& pl__auto__maks){ size_t data_len=pl__data.lengthof(); if(data_len>=2){ const unsigned char* data_ptr=(const unsigned char*)pl__data; size_t base_length=(data_ptr[1]&0x80)?6:2; size_t payload_length=data_ptr[1]&0x7F; size_t len_len=0; if (payload_length==126) { if(data_len>=4){ payload_length=(data_ptr[2]<<8)+data_ptr[3]; len_len=2; } else { return 1; // NOT_MY_TYPE not enough bits in the buffer } } else if (payload_length==127) { if(data_len>=10){ len_len=8; long long int large_payload_length=(((long long int)data_ptr[2])<<56)+ (((long long int)data_ptr[3])<<48)+(((long long int)data_ptr[4])<<40)+ (((long long int)data_ptr[5])<<32)+(((long long int)data_ptr[6])<<24)+ (((long long int)data_ptr[7])<<16)+(((long long int)data_ptr[8])<<8)+ (long long int)data_ptr[9]; payload_length=large_payload_length; if(large_payload_length!=(long long int)payload_length){ // overflow TTCN_warning("The received WebSocket messages is too large"); return 1; // NOT_MY_TYPE message too largo to handle } } else { return 1; // NOT_MY_TYPE not enough bits in the buffer } } if(data_len<(payload_length+base_length)){ return 1; // NOT_MY_TYPE not enough bits in the buffer } // Now the decodeing can be started. unsigned char bit_temp; bit_temp=(data_ptr[0]>>7)&0x1; pl__pdu.fin__bit()=BITSTRING(1,&bit_temp); bit_temp=(data_ptr[0]>>6)&0x1; pl__pdu.rsv1__bit()=BITSTRING(1,&bit_temp); bit_temp=(data_ptr[0]>>5)&0x1; pl__pdu.rsv2__bit()=BITSTRING(1,&bit_temp); bit_temp=(data_ptr[0]>>4)&0x1; pl__pdu.rsv3__bit()=BITSTRING(1,&bit_temp); pl__pdu.opcode()=data_ptr[0]&0xf; bit_temp=(data_ptr[1]>>7)&0x1; bool masked=bit_temp; pl__pdu.mask__bit()=BITSTRING(1,&bit_temp); pl__pdu.payload__len()=payload_length; data_ptr+=len_len+2; unsigned char* unmasked=NULL; if(masked){ pl__pdu.masking__key()=OCTETSTRING(4,data_ptr); if(pl__auto__maks && payload_length){ unmasked=(unsigned char*)Malloc(payload_length*sizeof(unsigned char)); do_mask(data_ptr,data_ptr+4,unmasked,payload_length); data_ptr=unmasked; } else { data_ptr+=4; } } else { pl__pdu.masking__key()=OMIT_VALUE; } if(payload_length){ if(pl__pdu.opcode()==WebSocket__opcode::Connection__Close){ if(payload_length>=2){ pl__pdu.payload__data()().close__data().status__code()= (data_ptr[0]<<8) + data_ptr[1]; if(payload_length>2){ pl__pdu.payload__data()().close__data().data()()= OCTETSTRING(payload_length-2,data_ptr+2); } else { pl__pdu.payload__data()().close__data().data()=OMIT_VALUE; } } else { return 1; // NOT_MY_TYPE not enough bits in the buffer } } else { pl__pdu.payload__data()().data()=OCTETSTRING(payload_length,data_ptr); } } else { pl__pdu.payload__data()=OMIT_VALUE; } if(unmasked) { Free(unmasked); } } else { return 1; // NOT_MY_TYPE not enough bits in the buffer } return 0; } INTEGER f__WebSocket__calc__length(const OCTETSTRING& pl__data){ size_t data_len=pl__data.lengthof(); if(data_len>=2){ const unsigned char* data_ptr=(const unsigned char*)pl__data; int base_length=(data_ptr[1]&0x80)?6:2; int payload_length=data_ptr[1]&0x7F; if(payload_length<126){ return payload_length+base_length; } else if (payload_length==126) { if(data_len>=4){ payload_length=(data_ptr[2]<<8)+data_ptr[3]; return payload_length+base_length+2; } } else { if(data_len>=10){ long long int large_payload_length=(((long long int)data_ptr[2])<<56)+ (((long long int)data_ptr[3])<<48)+(((long long int)data_ptr[4])<<40)+ (((long long int)data_ptr[5])<<32)+(((long long int)data_ptr[6])<<24)+ (((long long int)data_ptr[7])<<16)+(((long long int)data_ptr[8])<<8)+ (long long int)data_ptr[9]+(long long int)base_length+8; INTEGER large_ret_val; large_ret_val.set_long_long_val(large_payload_length); return large_ret_val; } } } return -1; } OCTETSTRING f__WebSocket__Generate__Masking__Key(){ static bool inited=false; if(!inited){ time_t t1; time(&t1); srand48((long) t1); inited=true; } unsigned char mkey[4]; long int key=mrand48(); mkey[0]= key & 0xFF; key>>=8; mkey[1]= key & 0xFF; key>>=8; mkey[2]= key & 0xFF; key>>=8; mkey[3]= key & 0xFF; return OCTETSTRING(4,&mkey[0]); } }
32.318937
82
0.619449
PHANTOM-Platform
4be337d8967c994ad318b65aa8c8187f5af3b338
841
hpp
C++
oms_small/include/okapi/api/control/async/asyncController.hpp
wanton-wind/oms-vex
d2eca00ccfefad5e2f85f8465837bd8a0710359c
[ "Apache-2.0" ]
1
2018-10-28T01:49:16.000Z
2018-10-28T01:49:16.000Z
oms_small/include/okapi/api/control/async/asyncController.hpp
wanton-wind/oms-vex
d2eca00ccfefad5e2f85f8465837bd8a0710359c
[ "Apache-2.0" ]
1
2018-10-28T01:40:00.000Z
2018-10-28T01:40:00.000Z
oms_small/include/okapi/api/control/async/asyncController.hpp
wanton-wind/oms-vex
d2eca00ccfefad5e2f85f8465837bd8a0710359c
[ "Apache-2.0" ]
3
2018-10-26T08:45:58.000Z
2018-10-27T13:36:37.000Z
/** * @author Ryan Benasutti, WPI * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _OKAPI_ASYNCCONTROLLER_HPP_ #define _OKAPI_ASYNCCONTROLLER_HPP_ #include "okapi/api/control/closedLoopController.hpp" namespace okapi { /** * Closed-loop controller that steps on its own in another thread and automatically writes to the * output. */ template <typename Input, typename Output> class AsyncController : public ClosedLoopController<Input, Output> { public: /** * Blocks the current task until the controller has settled. Determining what settling means is * implementation-dependent. */ virtual void waitUntilSettled() = 0; }; } // namespace okapi #endif
28.033333
97
0.740785
wanton-wind
4be6caed4bbeccc5bc193ed624b18fc98f56568c
3,048
cpp
C++
src/Plugins/MyPedestrianModel/MyModel.cpp
mfprado/Menge
75b1ebe91989c2a58073444fb2d5908644856372
[ "Apache-2.0" ]
null
null
null
src/Plugins/MyPedestrianModel/MyModel.cpp
mfprado/Menge
75b1ebe91989c2a58073444fb2d5908644856372
[ "Apache-2.0" ]
null
null
null
src/Plugins/MyPedestrianModel/MyModel.cpp
mfprado/Menge
75b1ebe91989c2a58073444fb2d5908644856372
[ "Apache-2.0" ]
null
null
null
/* License Menge Copyright � and trademark � 2012-14 University of North Carolina at Chapel Hill. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph, and the following four paragraphs appear in all copies. This software program and documentation are copyrighted by the University of North Carolina at Chapel Hill. The software program and documentation are supplied "as is," without any accompanying services from the University of North Carolina at Chapel Hill or the authors. The University of North Carolina at Chapel Hill and the authors do not warrant that the operation of the program will be uninterrupted or error-free. The end-user understands that the program was developed for research purposes and is advised not to rely exclusively on the program for any reason. IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY STATUTORY WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. Any questions or comments should be sent to the authors {menge,geom}@cs.unc.edu */ /*! * @file MyModel.cpp * @brief Plugin for dummy pedestrian. */ #include "MyModel.h" #include "MyModelDBEntry.h" #include "MengeCore/PluginEngine/CorePluginEngine.h" extern "C" { /*! * @brief Retrieves the name of the plug-in. * * @returns The name of the plug in. */ MENGE_API const char * getName() { // http://gamma.cs.unc.edu/DenseCrowds/narain-siga09.pdf return "My Pedestrian Model, based on Aggregate Dynamics for Dense Crowd Simulation"; } /*! * @brief Description of the plug-in. * * @returns A description of the plugin. */ MENGE_API const char * getDescription() { return "A simple example of a pedestrian model. This model computes a " "new velocity following this paper: http://gamma.cs.unc.edu/DenseCrowds/narain-siga09.pdf"; } /*! * @brief Registers the plug-in with the PluginEngine * * @param engine A pointer to the plugin engine. */ MENGE_API void registerCorePlugin( Menge::PluginEngine::CorePluginEngine * engine ) { engine->registerModelDBEntry( new MyModel::MyModelDBEntry() ); } }
38.582278
98
0.76542
mfprado
4be98c935c0c35f7daeaabf951b5b732e6370dfb
19,593
cpp
C++
deps/binreloc/binreloc.cpp
Symaxion/libsylph
c22f94b8e132dc25a86f27443041965982b3982d
[ "Zlib" ]
1
2020-09-25T02:27:38.000Z
2020-09-25T02:27:38.000Z
deps/binreloc/binreloc.cpp
Symaxion/libsylph
c22f94b8e132dc25a86f27443041965982b3982d
[ "Zlib" ]
null
null
null
deps/binreloc/binreloc.cpp
Symaxion/libsylph
c22f94b8e132dc25a86f27443041965982b3982d
[ "Zlib" ]
null
null
null
/* * BinReloc - a library for creating relocatable executables * Written by: Hongli Lai <h.lai@chello.nl> * http://autopackage.org/ * * This source code is public domain. You can relicense this code * under whatever license you want. * * See http://autopackage.org/docs/binreloc/ for * more information and how to use this. */ #ifndef __BINRELOC_C__ #define __BINRELOC_C__ // note: always enable for LibSylph #define ENABLE_BINRELOC #ifdef ENABLE_BINRELOC #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #endif /* ENABLE_BINRELOC */ #include <cstdio> #include <cstdlib> #include <climits> #include <cstring> #include "binreloc.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ using namespace std; /** @internal * Not all platforms seem to have _br_strdup, so we implement our own here. * (Modified for LibSylph) */ static char* _br_strdup (const char *in) { char *toreturn; size_t len; len = strlen (in) + 1; toreturn = (char *) malloc (len); memcpy (toreturn, in, len); return toreturn; } /** @internal * Find the canonical filename of the executable. Returns the filename * (which must be freed) or NULL on error. If the parameter 'error' is * not NULL, the error code will be stored there, if an error occured. */ static char * _br_find_exe (BrInitError *error) { #ifndef ENABLE_BINRELOC if (error) *error = BR_INIT_ERROR_DISABLED; return NULL; #else char *path, *path2, *line, *result; size_t buf_size; ssize_t size; struct stat stat_buf; FILE *f; /* Read from /proc/self/exe (symlink) */ if (sizeof (path) > SSIZE_MAX) buf_size = SSIZE_MAX - 1; else buf_size = PATH_MAX - 1; path = (char *) malloc (buf_size); if (path == NULL) { /* Cannot allocate memory. */ if (error) *error = BR_INIT_ERROR_NOMEM; return NULL; } path2 = (char *) malloc (buf_size); if (path2 == NULL) { /* Cannot allocate memory. */ if (error) *error = BR_INIT_ERROR_NOMEM; free (path); return NULL; } strncpy (path2, "/proc/self/exe", buf_size - 1); while (1) { int i; size = readlink (path2, path, buf_size - 1); if (size == -1) { /* Error. */ free (path2); break; } /* readlink() success. */ path[size] = '\0'; /* Check whether the symlink's target is also a symlink. * We want to get the final target. */ i = stat (path, &stat_buf); if (i == -1) { /* Error. */ free (path2); break; } /* stat() success. */ if (!S_ISLNK (stat_buf.st_mode)) { /* path is not a symlink. Done. */ free (path2); return path; } /* path is a symlink. Continue loop and resolve this. */ strncpy (path, path2, buf_size - 1); } /* readlink() or stat() failed; this can happen when the program is * running in Valgrind 2.2. Read from /proc/self/maps as fallback. */ buf_size = PATH_MAX + 128; line = (char *) realloc (path, buf_size); if (line == NULL) { /* Cannot allocate memory. */ free (path); if (error) *error = BR_INIT_ERROR_NOMEM; return NULL; } f = fopen ("/proc/self/maps", "r"); if (f == NULL) { free (line); if (error) *error = BR_INIT_ERROR_OPEN_MAPS; return NULL; } /* The first entry should be the executable name. */ result = fgets (line, (int) buf_size, f); if (result == NULL) { fclose (f); free (line); if (error) *error = BR_INIT_ERROR_READ_MAPS; return NULL; } /* Get rid of newline character. */ buf_size = strlen (line); if (buf_size <= 0) { /* Huh? An empty string? */ fclose (f); free (line); if (error) *error = BR_INIT_ERROR_INVALID_MAPS; return NULL; } if (line[buf_size - 1] == 10) line[buf_size - 1] = 0; /* Extract the filename; it is always an absolute path. */ path = strchr (line, '/'); /* Sanity check. */ if (strstr (line, " r-xp ") == NULL || path == NULL) { fclose (f); free (line); if (error) *error = BR_INIT_ERROR_INVALID_MAPS; return NULL; } path = _br_strdup (path); free (line); fclose (f); return path; #endif /* ENABLE_BINRELOC */ } /** @internal * Find the canonical filename of the executable which owns symbol. * Returns a filename which must be freed, or NULL on error. */ static char * _br_find_exe_for_symbol (const void *symbol, BrInitError *error){ (void) error; #ifndef ENABLE_BINRELOC if (error) *error = BR_INIT_ERROR_DISABLED; return (char *) NULL; #else #define SIZE PATH_MAX + 100 FILE *f; size_t address_string_len; char *address_string, line[SIZE], *found; if (symbol == NULL) return (char *) NULL; f = fopen ("/proc/self/maps", "r"); if (f == NULL) return (char *) NULL; address_string_len = 4; address_string = (char *) malloc (address_string_len); found = (char *) NULL; while (!feof (f)) { char *start_addr, *end_addr, *end_addr_end, *file; void *start_addr_p, *end_addr_p; size_t len; if (fgets (line, SIZE, f) == NULL) break; /* Sanity check. */ if (strstr (line, " r-xp ") == NULL || strchr (line, '/') == NULL) continue; /* Parse line. */ start_addr = line; end_addr = strchr (line, '-'); file = strchr (line, '/'); /* More sanity check. */ if (!(file > end_addr && end_addr != NULL && end_addr[0] == '-')) continue; end_addr[0] = '\0'; end_addr++; end_addr_end = strchr (end_addr, ' '); if (end_addr_end == NULL) continue; end_addr_end[0] = '\0'; len = strlen (file); if (len == 0) continue; if (file[len - 1] == '\n') file[len - 1] = '\0'; /* Get rid of "(deleted)" from the filename. */ len = strlen (file); if (len > 10 && strcmp (file + len - 10, " (deleted)") == 0) file[len - 10] = '\0'; /* I don't know whether this can happen but better safe than sorry. */ len = strlen (start_addr); if (len != strlen (end_addr)) continue; /* Transform the addresses into a string in the form of 0xdeadbeef, * then transform that into a pointer. */ if (address_string_len < len + 3) { address_string_len = len + 3; address_string = (char *) realloc (address_string, address_string_len); } memcpy (address_string, "0x", 2); memcpy (address_string + 2, start_addr, len); address_string[2 + len] = '\0'; sscanf (address_string, "%p", &start_addr_p); memcpy (address_string, "0x", 2); memcpy (address_string + 2, end_addr, len); address_string[2 + len] = '\0'; sscanf (address_string, "%p", &end_addr_p); if (symbol >= start_addr_p && symbol < end_addr_p) { found = file; break; } } free (address_string); fclose (f); if (found == NULL) return (char *) NULL; else return _br_strdup (found); #endif /* ENABLE_BINRELOC */ } #ifndef BINRELOC_RUNNING_DOXYGEN #undef NULL #define NULL ((void *) 0) /* typecasted as char* for C++ type safeness */ #endif static char *exe = (char *) NULL; /** Initialize the BinReloc library (for applications). * * This function must be called before using any other BinReloc functions. * It attempts to locate the application's canonical filename. * * @note If you want to use BinReloc for a library, then you should call * br_init_lib() instead. * * @param error If BinReloc failed to initialize, then the error code will * be stored in this variable. Set to NULL if you want to * ignore this. See #BrInitError for a list of error codes. * * @returns 1 on success, 0 if BinReloc failed to initialize. */ int br_init (BrInitError *error) { exe = _br_find_exe (error); return exe != NULL; } /** Initialize the BinReloc library (for libraries). * * This function must be called before using any other BinReloc functions. * It attempts to locate the calling library's canonical filename. * * @note The BinReloc source code MUST be included in your library, or this * function won't work correctly. * * @param error If BinReloc failed to initialize, then the error code will * be stored in this variable. Set to NULL if you want to * ignore this. See #BrInitError for a list of error codes. * * @returns 1 on success, 0 if a filename cannot be found. */ int br_init_lib (BrInitError *error) { exe = _br_find_exe_for_symbol ((const void *) "", error); return exe != NULL; } int br_init_lib_from_symbol(const void * symbol, BrInitError *error) { exe = _br_find_exe_for_symbol (symbol, error); return exe != NULL; } /** Find the canonical filename of the current application. * * @param default_exe A default filename which will be used as fallback. * @returns A string containing the application's canonical filename, * which must be freed when no longer necessary. If BinReloc is * not initialized, or if br_init() failed, then a copy of * default_exe will be returned. If default_exe is NULL, then * NULL will be returned. */ char * br_find_exe (const char *default_exe) { if (exe == (char *) NULL) { /* BinReloc is not initialized. */ if (default_exe != (const char *) NULL) return _br_strdup (default_exe); else return (char *) NULL; } return _br_strdup (exe); } /** Locate the directory in which the current application is installed. * * The prefix is generated by the following pseudo-code evaluation: * \code * dirname(exename) * \endcode * * @param default_dir A default directory which will used as fallback. * @return A string containing the directory, which must be freed when no * longer necessary. If BinReloc is not initialized, or if the * initialization function failed, then a copy of default_dir * will be returned. If default_dir is NULL, then NULL will be * returned. */ char * br_find_exe_dir (const char *default_dir) { if (exe == NULL) { /* BinReloc not initialized. */ if (default_dir != NULL) return _br_strdup (default_dir); else return (char*)NULL; } return br_dirname (exe); } /** Locate the prefix in which the current application is installed. * * The prefix is generated by the following pseudo-code evaluation: * \code * dirname(dirname(exename)) * \endcode * * @param default_prefix A default prefix which will used as fallback. * @return A string containing the prefix, which must be freed when no * longer necessary. If BinReloc is not initialized, or if * the initialization function failed, then a copy of default_prefix * will be returned. If default_prefix is NULL, then NULL will be returned. */ char * br_find_prefix (const char *default_prefix) { char *dir1, *dir2; if (exe == (char *) NULL) { /* BinReloc not initialized. */ if (default_prefix != (const char *) NULL) return _br_strdup (default_prefix); else return (char *) NULL; } dir1 = br_dirname (exe); dir2 = br_dirname (dir1); free (dir1); return dir2; } /** Locate the application's binary folder. * * The path is generated by the following pseudo-code evaluation: * \code * prefix + "/bin" * \endcode * * @param default_bin_dir A default path which will used as fallback. * @return A string containing the bin folder's path, which must be freed when * no longer necessary. If BinReloc is not initialized, or if * the initialization function failed, then a copy of default_bin_dir will * be returned. If default_bin_dir is NULL, then NULL will be returned. */ char * br_find_bin_dir (const char *default_bin_dir) { char *prefix, *dir; prefix = br_find_prefix ((const char *) NULL); if (prefix == (char *) NULL) { /* BinReloc not initialized. */ if (default_bin_dir != (const char *) NULL) return _br_strdup (default_bin_dir); else return (char *) NULL; } dir = br_build_path (prefix, "bin"); free (prefix); return dir; } /** Locate the application's superuser binary folder. * * The path is generated by the following pseudo-code evaluation: * \code * prefix + "/sbin" * \endcode * * @param default_sbin_dir A default path which will used as fallback. * @return A string containing the sbin folder's path, which must be freed when * no longer necessary. If BinReloc is not initialized, or if the * initialization function failed, then a copy of default_sbin_dir will * be returned. If default_bin_dir is NULL, then NULL will be returned. */ char * br_find_sbin_dir (const char *default_sbin_dir) { char *prefix, *dir; prefix = br_find_prefix ((const char *) NULL); if (prefix == (char *) NULL) { /* BinReloc not initialized. */ if (default_sbin_dir != (const char *) NULL) return _br_strdup (default_sbin_dir); else return (char *) NULL; } dir = br_build_path (prefix, "sbin"); free (prefix); return dir; } /** Locate the application's data folder. * * The path is generated by the following pseudo-code evaluation: * \code * prefix + "/share" * \endcode * * @param default_data_dir A default path which will used as fallback. * @return A string containing the data folder's path, which must be freed when * no longer necessary. If BinReloc is not initialized, or if the * initialization function failed, then a copy of default_data_dir * will be returned. If default_data_dir is NULL, then NULL will be * returned. */ char * br_find_data_dir (const char *default_data_dir) { char *prefix, *dir; prefix = br_find_prefix ((const char *) NULL); if (prefix == (char *) NULL) { /* BinReloc not initialized. */ if (default_data_dir != (const char *) NULL) return _br_strdup (default_data_dir); else return (char *) NULL; } dir = br_build_path (prefix, "share"); free (prefix); return dir; } /** Locate the application's localization folder. * * The path is generated by the following pseudo-code evaluation: * \code * prefix + "/share/locale" * \endcode * * @param default_locale_dir A default path which will used as fallback. * @return A string containing the localization folder's path, which must be freed when * no longer necessary. If BinReloc is not initialized, or if the * initialization function failed, then a copy of default_locale_dir will be returned. * If default_locale_dir is NULL, then NULL will be returned. */ char * br_find_locale_dir (const char *default_locale_dir) { char *data_dir, *dir; data_dir = br_find_data_dir ((const char *) NULL); if (data_dir == (char *) NULL) { /* BinReloc not initialized. */ if (default_locale_dir != (const char *) NULL) return _br_strdup (default_locale_dir); else return (char *) NULL; } dir = br_build_path (data_dir, "locale"); free (data_dir); return dir; } /** Locate the application's library folder. * * The path is generated by the following pseudo-code evaluation: * \code * prefix + "/lib" * \endcode * * @param default_lib_dir A default path which will used as fallback. * @return A string containing the library folder's path, which must be freed when * no longer necessary. If BinReloc is not initialized, or if the initialization * function failed, then a copy of default_lib_dir will be returned. * If default_lib_dir is NULL, then NULL will be returned. */ char * br_find_lib_dir (const char *default_lib_dir) { char *prefix, *dir; prefix = br_find_prefix ((const char *) NULL); if (prefix == (char *) NULL) { /* BinReloc not initialized. */ if (default_lib_dir != (const char *) NULL) return _br_strdup (default_lib_dir); else return (char *) NULL; } dir = br_build_path (prefix, "lib"); free (prefix); return dir; } /** Locate the application's libexec folder. * * The path is generated by the following pseudo-code evaluation: * \code * prefix + "/libexec" * \endcode * * @param default_libexec_dir A default path which will used as fallback. * @return A string containing the libexec folder's path, which must be freed when * no longer necessary. If BinReloc is not initialized, or if the initialization * function failed, then a copy of default_libexec_dir will be returned. * If default_libexec_dir is NULL, then NULL will be returned. */ char * br_find_libexec_dir (const char *default_libexec_dir) { char *prefix, *dir; prefix = br_find_prefix ((const char *) NULL); if (prefix == (char *) NULL) { /* BinReloc not initialized. */ if (default_libexec_dir != (const char *) NULL) return _br_strdup (default_libexec_dir); else return (char *) NULL; } dir = br_build_path (prefix, "libexec"); free (prefix); return dir; } /** Locate the application's configuration files folder. * * The path is generated by the following pseudo-code evaluation: * \code * prefix + "/etc" * \endcode * * @param default_etc_dir A default path which will used as fallback. * @return A string containing the etc folder's path, which must be freed when * no longer necessary. If BinReloc is not initialized, or if the initialization * function failed, then a copy of default_etc_dir will be returned. * If default_etc_dir is NULL, then NULL will be returned. */ char * br_find_etc_dir (const char *default_etc_dir) { char *prefix, *dir; prefix = br_find_prefix ((const char *) NULL); if (prefix == (char *) NULL) { /* BinReloc not initialized. */ if (default_etc_dir != (const char *) NULL) return _br_strdup (default_etc_dir); else return (char *) NULL; } dir = br_build_path (prefix, "etc"); free (prefix); return dir; } /*********************** * Utility functions ***********************/ /** Concatenate str1 and str2 to a newly allocated string. * * @param str1 A string. * @param str2 Another string. * @returns A newly-allocated string. This string should be freed when no longer needed. */ char * br_strcat (const char *str1, const char *str2) { char *result; size_t len1, len2; if (str1 == NULL) str1 = ""; if (str2 == NULL) str2 = ""; len1 = strlen (str1); len2 = strlen (str2); result = (char *) malloc (len1 + len2 + 1); memcpy (result, str1, len1); memcpy (result + len1, str2, len2); result[len1 + len2] = '\0'; return result; } char * br_build_path (const char *dir, const char *file) { char *dir2, *result; size_t len; int must_free = 0; len = strlen (dir); if (len > 0 && dir[len - 1] != '/') { dir2 = br_strcat (dir, "/"); must_free = 1; } else dir2 = (char *) dir; result = br_strcat (dir2, file); if (must_free) free (dir2); return result; } /* Emulates glibc's strndup() */ static char * br_strndup (const char *str, size_t size) { char *result = (char *) NULL; size_t len; if (str == (const char *) NULL) return (char *) NULL; len = strlen (str); if (len == 0) return _br_strdup (""); if (size > len) size = len; result = (char *) malloc (len + 1); memcpy (result, str, size); result[size] = '\0'; return result; } /** Extracts the directory component of a path. * * Similar to g_dirname() or the dirname commandline application. * * Example: * \code * br_dirname ("/usr/local/foobar"); --> Returns: "/usr/local" * \endcode * * @param path A path. * @returns A directory name. This string should be freed when no longer needed. */ char * br_dirname (const char *path) { char *end, *result; if (path == (const char *) NULL) return (char *) NULL; end = strrchr ((char*)path, '/'); if (end == (const char *) NULL) return _br_strdup ("."); while (end > path && *end == '/') end--; result = br_strndup (path, end - path + 1); if (result[0] == 0) { free (result); return _br_strdup ("/"); } else return result; } #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __BINRELOC_C__ */
24.645283
94
0.658807
Symaxion
4bec35f22fa7f8a114901b8f4c8c5f038b9c9d66
3,901
cpp
C++
src/main_ds.cpp
MartinK84/riesling
3deb01ef6ec4a03ecbd5cf694d37f20de063dbae
[ "MIT" ]
null
null
null
src/main_ds.cpp
MartinK84/riesling
3deb01ef6ec4a03ecbd5cf694d37f20de063dbae
[ "MIT" ]
null
null
null
src/main_ds.cpp
MartinK84/riesling
3deb01ef6ec4a03ecbd5cf694d37f20de063dbae
[ "MIT" ]
null
null
null
#include "types.h" #include "filter.h" #include "io_hd5.h" #include "io_nifti.h" #include "log.h" #include "parse_args.h" #include "threads.h" using namespace std::complex_literals; constexpr float pi = M_PI; int main_ds(args::Subparser &parser) { args::Positional<std::string> iname(parser, "FILE", "Input radial k-space file"); args::ValueFlag<std::string> oname(parser, "OUTPUT", "Override output name", {"out", 'o'}); args::ValueFlag<std::string> oftype( parser, "OUT FILETYPE", "File type of output (nii/nii.gz/img/h5)", {"oft"}, "nii"); Log log = ParseCommand(parser, iname); HD5::Reader reader(iname.Get(), log); Trajectory traj = reader.readTrajectory(); auto const &info = traj.info(); Cx3 rad_ks = info.noncartesianVolume(); Cx4 channels(info.channels, info.matrix[0], info.matrix[1], info.matrix[2]); R4 out(info.matrix[0], info.matrix[1], info.matrix[2], info.volumes); auto const sx = info.matrix[0]; auto const hx = sx / 2; auto const sy = info.matrix[1]; auto const hy = sy / 2; auto const sz = info.matrix[2]; auto const hz = sz / 2; auto const maxX = info.matrix.maxCoeff(); auto const maxK = maxX / 2; float const scale = std::sqrt(info.matrix.prod()); // Work out volume element auto const delta = 1.; float const d_lo = (4. / 3.) * M_PI * delta * delta * delta / info.spokes_lo; float const d_hi = (4. / 3.) * M_PI * delta * delta * delta / info.spokes_hi; // When k-space becomes undersampled need to flatten DC (Menon & Pipe 1999) float const approx_undersamp = (M_PI * info.matrix.maxCoeff() * info.matrix.maxCoeff()) / info.spokes_hi; float const flat_start = maxK / sqrt(approx_undersamp); float const flat_val = d_hi * (3. * (flat_start * flat_start) + 1. / 4.); auto const &all_start = log.now(); for (long iv = 0; iv < info.volumes; iv++) { auto const &vol_start = log.now(); reader.readNoncartesian(iv, rad_ks); channels.setZero(); log.info("Beginning Direct Summation"); auto fourier = [&](long const lo, long const hi) { for (long iz = lo; iz < hi; iz++) { log.info("Starting {}/{}", iz, hi); for (long iy = 0; iy < sy; iy++) { for (long ix = 0; ix < sx; ix++) { Point3 const c = Point3{ (ix - hx) / (float)(maxX), (iy - hy) / (float)(maxX), (iz - hz) / (float)(maxX)}; for (long is = 0; is < info.spokes_total(); is++) { for (long ir = info.read_gap; ir < info.read_points; ir++) { Point3 const r = traj.point(ir, is, maxK); float const r_mag = r.matrix().norm(); auto const &d_k = is < info.spokes_lo ? d_lo : d_hi; float dc; if (r_mag == 0.f) { dc = d_k * 1.f / 8.f; } else if (r_mag < flat_start) { dc = d_k * (3. * (r_mag * r_mag) + 1. / 4.); } else { dc = flat_val; } std::complex<float> const f_term = std::exp(2.if * pi * r.matrix().dot(c.matrix())) * dc / scale; for (long ic = 0; ic < info.channels; ic++) { auto const val = rad_ks(ic, ir, is) * f_term; channels(ic, ix, iy, iz) += val; } } } } } log.info("Finished {}/{}", iz, hi); } }; Threads::RangeFor(fourier, sz); log.info("Calculating RSS"); WriteNifti(info, Cx4(channels.shuffle(Sz4{1, 2, 3, 0})), "chan.nii", log); out.chip(iv, 3).device(Threads::GlobalDevice()) = (channels * channels.conjugate()).sum(Sz1{0}).sqrt(); log.info("Volume {}: {}", iv, log.toNow(vol_start)); } log.info("All volumes: {}", log.toNow(all_start)); WriteOutput(out, false, info, iname.Get(), oname.Get(), "ds", oftype.Get(), log); return EXIT_SUCCESS; }
38.245098
97
0.558831
MartinK84
4bee5810032b2cabd5a11ada18849f0e7ab3ec95
13,234
cc
C++
pdlab/test/foo.pb.cc
SonuRex/Traffic-Management-System
afe7449790a06ca29dfa49552d2ec921b353238d
[ "MIT" ]
7
2018-12-21T13:38:43.000Z
2020-05-03T18:12:25.000Z
pdlab/test/foo.pb.cc
ujlive/Traffic-Management-system
afe7449790a06ca29dfa49552d2ec921b353238d
[ "MIT" ]
null
null
null
pdlab/test/foo.pb.cc
ujlive/Traffic-Management-system
afe7449790a06ca29dfa49552d2ec921b353238d
[ "MIT" ]
6
2021-03-15T23:08:16.000Z
2022-03-29T17:51:33.000Z
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: foo.proto #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include "foo.pb.h" #include <algorithm> #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/once.h> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/wire_format_lite_inl.h> #include <google/protobuf/descriptor.h> #include <google/protobuf/generated_message_reflection.h> #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> // @@protoc_insertion_point(includes) namespace prototest { namespace { const ::google::protobuf::Descriptor* Foo_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* Foo_reflection_ = NULL; } // namespace void protobuf_AssignDesc_foo_2eproto() { protobuf_AddDesc_foo_2eproto(); const ::google::protobuf::FileDescriptor* file = ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( "foo.proto"); GOOGLE_CHECK(file != NULL); Foo_descriptor_ = file->message_type(0); static const int Foo_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Foo, id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Foo, bar_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Foo, baz_), }; Foo_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( Foo_descriptor_, Foo::default_instance_, Foo_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Foo, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Foo, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(Foo)); } namespace { GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); inline void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, &protobuf_AssignDesc_foo_2eproto); } void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( Foo_descriptor_, &Foo::default_instance()); } } // namespace void protobuf_ShutdownFile_foo_2eproto() { delete Foo::default_instance_; delete Foo_reflection_; } void protobuf_AddDesc_foo_2eproto() { static bool already_here = false; if (already_here) return; already_here = true; GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( "\n\tfoo.proto\022\tprototest\"+\n\003Foo\022\n\n\002id\030\001 \002(" "\005\022\013\n\003bar\030\002 \002(\t\022\013\n\003baz\030\003 \001(\t", 67); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "foo.proto", &protobuf_RegisterTypes); Foo::default_instance_ = new Foo(); Foo::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_foo_2eproto); } // Force AddDescriptors() to be called at static initialization time. struct StaticDescriptorInitializer_foo_2eproto { StaticDescriptorInitializer_foo_2eproto() { protobuf_AddDesc_foo_2eproto(); } } static_descriptor_initializer_foo_2eproto_; // =================================================================== #ifndef _MSC_VER const int Foo::kIdFieldNumber; const int Foo::kBarFieldNumber; const int Foo::kBazFieldNumber; #endif // !_MSC_VER Foo::Foo() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:prototest.Foo) } void Foo::InitAsDefaultInstance() { } Foo::Foo(const Foo& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:prototest.Foo) } void Foo::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; id_ = 0; bar_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); baz_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } Foo::~Foo() { // @@protoc_insertion_point(destructor:prototest.Foo) SharedDtor(); } void Foo::SharedDtor() { if (bar_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete bar_; } if (baz_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete baz_; } if (this != default_instance_) { } } void Foo::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Foo::descriptor() { protobuf_AssignDescriptorsOnce(); return Foo_descriptor_; } const Foo& Foo::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_foo_2eproto(); return *default_instance_; } Foo* Foo::default_instance_ = NULL; Foo* Foo::New() const { return new Foo; } void Foo::Clear() { if (_has_bits_[0 / 32] & 7) { id_ = 0; if (has_bar()) { if (bar_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { bar_->clear(); } } if (has_baz()) { if (baz_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { baz_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool Foo::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:prototest.Foo) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int32 id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &id_))); set_has_id(); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_bar; break; } // required string bar = 2; case 2: { if (tag == 18) { parse_bar: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_bar())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->bar().data(), this->bar().length(), ::google::protobuf::internal::WireFormat::PARSE, "bar"); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_baz; break; } // optional string baz = 3; case 3: { if (tag == 26) { parse_baz: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_baz())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->baz().data(), this->baz().length(), ::google::protobuf::internal::WireFormat::PARSE, "baz"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:prototest.Foo) return true; failure: // @@protoc_insertion_point(parse_failure:prototest.Foo) return false; #undef DO_ } void Foo::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:prototest.Foo) // required int32 id = 1; if (has_id()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->id(), output); } // required string bar = 2; if (has_bar()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->bar().data(), this->bar().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "bar"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 2, this->bar(), output); } // optional string baz = 3; if (has_baz()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->baz().data(), this->baz().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "baz"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 3, this->baz(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:prototest.Foo) } ::google::protobuf::uint8* Foo::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:prototest.Foo) // required int32 id = 1; if (has_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->id(), target); } // required string bar = 2; if (has_bar()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->bar().data(), this->bar().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "bar"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->bar(), target); } // optional string baz = 3; if (has_baz()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->baz().data(), this->baz().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "baz"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->baz(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:prototest.Foo) return target; } int Foo::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // required int32 id = 1; if (has_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->id()); } // required string bar = 2; if (has_bar()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->bar()); } // optional string baz = 3; if (has_baz()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->baz()); } } if (!unknown_fields().empty()) { total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( unknown_fields()); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void Foo::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const Foo* source = ::google::protobuf::internal::dynamic_cast_if_available<const Foo*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void Foo::MergeFrom(const Foo& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_id()) { set_id(from.id()); } if (from.has_bar()) { set_bar(from.bar()); } if (from.has_baz()) { set_baz(from.baz()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void Foo::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void Foo::CopyFrom(const Foo& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool Foo::IsInitialized() const { if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; return true; } void Foo::Swap(Foo* other) { if (other != this) { std::swap(id_, other->id_); std::swap(bar_, other->bar_); std::swap(baz_, other->baz_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata Foo::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = Foo_descriptor_; metadata.reflection = Foo_reflection_; return metadata; } // @@protoc_insertion_point(namespace_scope) } // namespace prototest // @@protoc_insertion_point(global_scope)
29.540179
104
0.65974
SonuRex
4bef91892f792413a33e7ff36fccb86a2b4140db
4,170
hpp
C++
nvm_engine/NvmEngine.hpp
JYLeeLYJ/tair_contest_season1
34d00801bb01bb355b630ecb8bd30159ed8b59ef
[ "MIT" ]
1
2021-04-02T06:02:57.000Z
2021-04-02T06:02:57.000Z
nvm_engine/NvmEngine.hpp
JYLeeLYJ/tair_contest_code
34d00801bb01bb355b630ecb8bd30159ed8b59ef
[ "MIT" ]
null
null
null
nvm_engine/NvmEngine.hpp
JYLeeLYJ/tair_contest_code
34d00801bb01bb355b630ecb8bd30159ed8b59ef
[ "MIT" ]
null
null
null
#ifndef TAIR_CONTEST_KV_CONTEST_NVM_ENGINE_H_ #define TAIR_CONTEST_KV_CONTEST_NVM_ENGINE_H_ #include <atomic> #include <climits> #include <cstddef> #include <cstdlib> #include <iostream> #include <atomic> #include "include/db.hpp" #include "include/kvfile.hpp" #include "include/hash_index.hpp" #include "include/allocator.hpp" #include "include/open_address_hash_index.hpp" #include "include/bloom_filter.hpp" #include "include/lru_cache.hpp" class NvmEngine : DB { public: /** * @param * name: file in AEP(exist) * dbptr: pointer of db object * */ static Status CreateOrOpen(const std::string &name, DB **dbptr); NvmEngine(const std::string &name); Status Get(const Slice &key, std::string *value); Status Set(const Slice &key, const Slice &value); ~NvmEngine(); private: static constexpr size_t META_SIZE = 1_KB; #ifdef LOCAL_TEST static constexpr size_t DRAN_SIZE = 256_MB; static constexpr size_t NVM_SIZE = 64_MB ; static constexpr size_t KEY_AREA = 14_MB; static constexpr size_t VALUE_AREA = NVM_SIZE - META_SIZE - KEY_AREA ; #else static constexpr size_t DRAM_SIZE = 8_GB; static constexpr size_t NVM_SIZE = 64_GB ; static constexpr size_t KEY_AREA = 14_GB + 256_MB ; static constexpr size_t VALUE_AREA = NVM_SIZE - META_SIZE - KEY_AREA ; static_assert(VALUE_AREA > 48_GB , "" ); #endif static constexpr size_t N_KEY = KEY_AREA / sizeof(head_info) ; static constexpr size_t N_VALUE = VALUE_AREA / sizeof(value_block); static constexpr size_t N_IDINFO = N_KEY; static constexpr size_t THREAD_CNT = 16; static constexpr size_t BUCKET_CNT = THREAD_CNT; static constexpr size_t HASH_SIZE = N_KEY /2; static constexpr size_t cache_size = (N_KEY / BUCKET_CNT) / 1_KB; public: struct alignas(CACHELINE_SIZE) bucket_info{ value_block_allocator<N_VALUE / BUCKET_CNT> allocator; uint32_t key_seq{}; }; struct cache_info{ char key[KEY_SIZE]; uint32_t ver{}; std::string value{}; explicit cache_info() = default; explicit cache_info(const char * key , uint32_t ver , const std::string & str ){ value = str; this->ver = ver; memcpy_avx_16(this->key , key); } }; using lru_cache_t = lru_cache<uint32_t , cache_info , cache_size>; private: void recovery(); void first_init(); uint32_t search(const Slice & key , uint64_t hash) ; Status update(const Slice & value , uint64_t hash , uint32_t key_index , uint32_t bucket_id); Status append(const Slice & key , const Slice & value , uint64_t hash , uint32_t bucket_id); uint32_t search_get(const Slice & key , uint64_t hash , lru_cache_t & cache); block_index alloc_value_blocks(uint32_t bucket_id , uint32_t len); void recollect_value_blocks(uint32_t bucket_id , block_index & block , uint32_t len); void write_value(const Slice & value , block_index & block ,block_index & indics ); void read_value(const Slice & key , std::string & value , uint32_t key_index , lru_cache_t & cache); uint32_t get_bucket_id(){ return thread_seq ++ % BUCKET_CNT; } uint32_t new_key_info(uint32_t bucket_id){ constexpr auto n_key_per_bk = N_KEY / BUCKET_CNT; auto seq = bucket_infos[bucket_id].key_seq ++; return seq < n_key_per_bk ? seq + bucket_id * n_key_per_bk : index.null_id; } bool is_invalid_block(const block_index & block){ constexpr auto null = decltype(bucket_info{}.allocator)::null_index; return block[0] == null || block[1] == null || block[2] == null || block[3] == null; } private: kv_file_info<N_KEY ,N_VALUE> file; std::atomic<uint32_t> thread_seq{0}; alignas(CACHELINE_SIZE) std::array<bucket_info , BUCKET_CNT> bucket_infos; open_address_hash<N_KEY * 2> index; // 3.6GB bitmap_filter<N_KEY * 8> bitset{}; // 228MB std::unique_ptr<std::atomic<uint32_t>[]> ver_seq; //896MB static_assert(sizeof(bucket_info) == 64 , ""); static_assert(sizeof(bucket_infos) == 1_KB , ""); }; #endif
31.832061
104
0.679616
JYLeeLYJ
4bf154d0827bf541abc2907bc35ad102425df801
1,116
cpp
C++
src/falclib/msgsrc/sendteaminfomsg.cpp
Terebinth/freefalcon-central
c28d807183ab447ef6a801068aa3769527d55deb
[ "BSD-2-Clause" ]
117
2015-01-13T14:48:49.000Z
2022-03-16T01:38:19.000Z
src/falclib/msgsrc/sendteaminfomsg.cpp
darongE/freefalcon-central
c28d807183ab447ef6a801068aa3769527d55deb
[ "BSD-2-Clause" ]
4
2015-05-01T13:09:53.000Z
2017-07-22T09:11:06.000Z
src/falclib/msgsrc/sendteaminfomsg.cpp
darongE/freefalcon-central
c28d807183ab447ef6a801068aa3769527d55deb
[ "BSD-2-Clause" ]
78
2015-01-13T09:27:47.000Z
2022-03-18T14:39:09.000Z
/* * Machine Generated source file for message "Send Team Info". * NOTE: The functions here must be completed by hand. * Generated on 05-November-1996 at 17:39:12 * Generated from file EVENTS.XLS by Leon Rosenshein */ //sfr: took it out, not used!! /* #include "MsgInc/SendTeamInfoMsg.h" #include "mesg.h" #include "falclib.h" #include "falcmesg.h" #include "falcgame.h" #include "falcsess.h" //sfr: added here for checks #include "InvalidBufferException.h" using std::memcpychk; FalconSendTeamInfoMessage::FalconSendTeamInfoMessage( VU_ID entityId, VuTargetEntity *target, VU_BOOL loopback) : FalconEvent (SendTeamInfoMsg, FalconEvent::CampaignThread, entityId, target, loopback) { // Your Code Goes Here } FalconSendTeamInfoMessage::FalconSendTeamInfoMessage(VU_MSG_TYPE type, VU_ID senderid, VU_ID target) : FalconEvent (SendTeamInfoMsg, FalconEvent::CampaignThread, senderid, target) { // Your Code Goes Here } FalconSendTeamInfoMessage::~FalconSendTeamInfoMessage(void) { // Your Code Goes Here } int FalconSendTeamInfoMessage::Process(void) { // Your Code Goes Here return 0; } */
24.8
179
0.756272
Terebinth
4bf22fa119f3682697812926ff6de00193f14833
3,527
cpp
C++
variant.cpp
Yichen-Si/vt-topmed
e22e964a68e236b190b3038318ca9799f1922e0e
[ "MIT" ]
null
null
null
variant.cpp
Yichen-Si/vt-topmed
e22e964a68e236b190b3038318ca9799f1922e0e
[ "MIT" ]
1
2019-12-26T09:34:03.000Z
2019-12-26T09:34:03.000Z
variant.cpp
Yichen-Si/vt-topmed
e22e964a68e236b190b3038318ca9799f1922e0e
[ "MIT" ]
1
2021-09-18T18:23:00.000Z
2021-09-18T18:23:00.000Z
/* The MIT License Copyright (c) 2013 Adrian Tan <atks@umich.edu> 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 "variant.h" /** * Constructor. */ Variant::Variant(bcf1_t* v) { this->v = v; } /** * Constructor. */ Variant::Variant() { type = VT_REF; alleles.clear(); } /** * Destructor. */ Variant::~Variant() {}; /** * Clears variant information. */ void Variant::clear() { type = VT_REF; alleles.clear(); vntr.clear(); }; /** * Prints variant information. */ void Variant::print() { std::cerr << "type : " << vtype2string(type) << "\n"; std::cerr << "motif: " << vntr.motif << "\n"; std::cerr << "rlen : " << vntr.motif.size() << "\n"; for (int32_t i=0; i<alleles.size(); ++i) { std::cerr << "\tallele: " << i << "\n"; std::cerr << "\t type: " << vtype2string(alleles[i].type) << "\n"; std::cerr << "\t diff: " << alleles[i].diff << "\n"; std::cerr << "\t alen: " << alleles[i].alen << "\n"; std::cerr << "\t dlen: " << alleles[i].dlen << "\n"; } }; /** * Gets a string representation of the underlying VNTR. */ void Variant::get_vntr_string(kstring_t* s) { s->l = 0; kputs(chrom.c_str(), s); kputc(':', s); kputw(vntr.rbeg1, s); kputc(':', s); kputs(vntr.repeat_tract.c_str(), s); kputc(':', s); kputs("<VNTR>", s); }; /** * Gets a string representation of the underlying VNTR. */ void Variant::get_fuzzy_vntr_string(kstring_t* s) { s->l = 0; kputs(chrom.c_str(), s); kputc(':', s); kputw(vntr.fuzzy_rbeg1, s); kputc(':', s); kputs(vntr.fuzzy_repeat_tract.c_str(), s); kputc(':', s); kputs("<VNTR>", s); }; /** * Converts VTYPE to string. */ std::string Variant::vtype2string(int32_t VTYPE) { std::string s; if (!VTYPE) { s += (s.size()==0) ? "" : "/"; s += "REF"; } if (VTYPE & VT_SNP) { s += (s.size()==0) ? "" : "/"; s += "SNP"; } if (VTYPE & VT_MNP) { s += (s.size()==0) ? "" : "/"; s += "MNP"; } if (VTYPE & VT_INDEL) { s += (s.size()==0) ? "" : "/"; s += "INDEL"; } if (VTYPE & VT_CLUMPED) { s += (s.size()==0) ? "" : "/"; s += "CLUMPED"; } if (VTYPE & VT_VNTR) { s += (s.size()==0) ? "" : "/"; s += "VNTR"; } if (VTYPE & VT_SV) { s += (s.size()==0) ? "" : "/"; s += "SV"; } return s; }
22.464968
80
0.55146
Yichen-Si
4bf245b1134125f506767b6764affb1e1de6793b
929
cpp
C++
code/stable/gooltest/cpp/PatternTest/PatternTest.cpp
smiths/Drasil
947be0411babe79ff198224d620b97642152710d
[ "BSD-2-Clause" ]
114
2017-12-16T04:51:37.000Z
2021-12-20T16:27:51.000Z
code/stable/gooltest/cpp/PatternTest/PatternTest.cpp
smiths/Drasil
947be0411babe79ff198224d620b97642152710d
[ "BSD-2-Clause" ]
1,762
2017-12-02T14:39:11.000Z
2022-03-29T16:28:57.000Z
code/stable/gooltest/cpp/PatternTest/PatternTest.cpp
smiths/Drasil
947be0411babe79ff198224d620b97642152710d
[ "BSD-2-Clause" ]
31
2018-11-25T22:16:12.000Z
2021-12-01T20:15:38.000Z
#include <iostream> #include <iterator> #include <string> #include <vector> #include "Observer.hpp" using std::string; using std::vector; int main(int argc, const char *argv[]) { int n; string myFSM = "Off"; myFSM = "On"; if (myFSM == "Off") { std::cout << "Off" << std::endl; } else if (myFSM == "On") { std::cout << "On" << std::endl; } else { std::cout << "Neither" << std::endl; } std::cout << "myStrat" << std::endl; n = 3; Observer obs1 = Observer(); Observer obs2 = Observer(); vector<Observer> observerList{obs1}; observerList.insert(observerList.begin() + (int)(observerList.size()), obs2); for (int observerIndex = 0; observerIndex < (int)(observerList.size()); observerIndex++) { observerList.at(observerIndex).printNum(); } obs1.setX(10); std::cout << obs1.getX(); return 0; }
22.119048
94
0.557589
smiths
4bf4b679ce3b99a81b11b99a357e2f68adc2d858
17,837
cpp
C++
emulator/src/mame/drivers/inufuku.cpp
rjw57/tiw-computer
5ef1c79893165b8622d1114d81cd0cded58910f0
[ "MIT" ]
1
2022-01-15T21:38:38.000Z
2022-01-15T21:38:38.000Z
emulator/src/mame/drivers/inufuku.cpp
rjw57/tiw-computer
5ef1c79893165b8622d1114d81cd0cded58910f0
[ "MIT" ]
null
null
null
emulator/src/mame/drivers/inufuku.cpp
rjw57/tiw-computer
5ef1c79893165b8622d1114d81cd0cded58910f0
[ "MIT" ]
null
null
null
// license:BSD-3-Clause // copyright-holders:Takahiro Nogi /****************************************************************************** Video Hardware for Video System Games. Quiz & Variety Sukusuku Inufuku (Japan) (c)1998 Video System Co.,Ltd. 3 On 3 Dunk Madness (US, prototype?) (c)1996 Video System Co.,Ltd. Driver by Takahiro Nogi <nogi@kt.rim.or.jp> 2003/08/09 - based on other Video System drivers ******************************************************************************/ /****************************************************************************** Quiz & Variety Sukusuku Inufuku (c)1998 Video System VSBB-31-1 CPU : MC68HC000P-16 Sound: TMPZ84C000AP-8 YM2610 YM3016 OSC : 32.0000MHz 14.31818MHz ROMs: U107.BIN - Sound Program (27C1001) U146.BIN - Main Programs (27C240) U147.BIN | LHMN5L28.148 / (32M Mask) Others: 93C46 (EEPROM) UMAG1 (ALTERA MAX EPM7128ELC84-10 BG9625) PLD00?? (ALTERA EPM7032LC44-15 BA9631) 002 (PALCE16V8-10PC) 003 (PALCE16V8-15PC) Custom Chips: VS920A VS920E VS9210 VS9108 (Fujitsu CG10103) (blank pattern for VS9210 and VS9108) VSBB31-ROM ROMs: LHMN5KU6.U53 - 32M SOP Mask ROMs LHMN5KU8.U40 | LHMN5KU7.U8 | LHMN5KUB.U34 | LHMN5KUA.U36 | LHMN5KU9.U38 / ******************************************************************************/ /****************************************************************************** TODO: - User must initialize NVRAM at first boot in test mode (factory settings). - Sometimes, sounds are not played (especially SFX), but this is a bug of real machine. - Sound Code 0x08 remains unknown. - Priority of tests and sprites seems to be correct, but I may have mistaken. ******************************************************************************/ #include "emu.h" #include "includes/inufuku.h" #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "machine/eepromser.h" #include "sound/2610intf.h" #include "screen.h" #include "speaker.h" /****************************************************************************** Sound CPU interface ******************************************************************************/ WRITE8_MEMBER(inufuku_state::inufuku_soundrombank_w) { membank("bank1")->set_entry(data & 0x03); } /****************************************************************************** Input/Output port interface ******************************************************************************/ CUSTOM_INPUT_MEMBER(inufuku_state::soundflag_r) { return m_soundlatch->pending_r() ? 0 : 1; } /****************************************************************************** Main CPU memory handlers ******************************************************************************/ void inufuku_state::inufuku_map(address_map &map) { map(0x000000, 0x0fffff).rom(); // main rom // AM_RANGE(0x100000, 0x100007) AM_WRITENOP // ? map(0x180000, 0x180001).portr("P1"); map(0x180002, 0x180003).portr("P2"); map(0x180004, 0x180005).portr("SYSTEM"); map(0x180006, 0x180007).portr("P4"); map(0x180008, 0x180009).portr("EXTRA"); map(0x18000a, 0x18000b).portr("P3"); map(0x200000, 0x200001).portw("EEPROMOUT"); map(0x280001, 0x280001).w(m_soundlatch, FUNC(generic_latch_8_device::write)); // sound command map(0x300000, 0x301fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // palette ram map(0x380000, 0x3801ff).writeonly().share("bg_rasterram"); // bg raster ram map(0x400000, 0x401fff).rw(this, FUNC(inufuku_state::inufuku_bg_videoram_r), FUNC(inufuku_state::inufuku_bg_videoram_w)).share("bg_videoram"); // bg ram map(0x402000, 0x403fff).rw(this, FUNC(inufuku_state::inufuku_tx_videoram_r), FUNC(inufuku_state::inufuku_tx_videoram_w)).share("tx_videoram"); // text ram map(0x404000, 0x40ffff).ram(); // ?? mirror (3on3dunk) map(0x580000, 0x581fff).ram().share("spriteram1"); // sprite table + sprite attribute map(0x600000, 0x61ffff).ram().share("spriteram2"); // cell table map(0x780000, 0x780013).w(this, FUNC(inufuku_state::inufuku_palettereg_w)); // bg & text palettebank register map(0x7a0000, 0x7a0023).w(this, FUNC(inufuku_state::inufuku_scrollreg_w)); // bg & text scroll register // AM_RANGE(0x7e0000, 0x7e0001) AM_WRITENOP // ? map(0x800000, 0xbfffff).rom(); // data rom map(0xfd0000, 0xfdffff).ram(); // work ram } /****************************************************************************** Sound CPU memory handlers ******************************************************************************/ void inufuku_state::inufuku_sound_map(address_map &map) { map(0x0000, 0x77ff).rom(); map(0x7800, 0x7fff).ram(); map(0x8000, 0xffff).bankr("bank1"); } void inufuku_state::inufuku_sound_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).w(this, FUNC(inufuku_state::inufuku_soundrombank_w)); map(0x04, 0x04).rw(m_soundlatch, FUNC(generic_latch_8_device::read), FUNC(generic_latch_8_device::acknowledge_w)); map(0x08, 0x0b).rw("ymsnd", FUNC(ym2610_device::read), FUNC(ym2610_device::write)); } /****************************************************************************** Port definitions ******************************************************************************/ static INPUT_PORTS_START( inufuku ) PORT_START("P1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_START("P2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_START("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("P4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) PORT_START("EXTRA") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START3 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START4 ) PORT_DIPNAME( 0x0010, 0x0010, "3P/4P" ) PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, inufuku_state,soundflag_r, nullptr) // pending sound command PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 3on3dunk cares about something in here, possibly a vblank flag PORT_START( "EEPROMOUT" ) PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, di_write) PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, clk_write) PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, cs_write) PORT_START("P3") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3) INPUT_PORTS_END /****************************************************************************** Graphics definitions ******************************************************************************/ static const gfx_layout tilelayout = { 8, 8, RGN_FRAC(1, 1), 8, { 0, 1, 2, 3, 4, 5, 6, 7 }, { 1*8, 0*8, 3*8, 2*8, 5*8, 4*8, 7*8, 6*8 }, { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64 }, 64*8 }; static const gfx_layout spritelayout = { 16, 16, RGN_FRAC(1, 1), 4, { 0, 1, 2, 3 }, { 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4, 10*4, 11*4, 8*4, 9*4, 14*4, 15*4, 12*4, 13*4 }, { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, 128*8 }; static const gfx_layout spritelayout_alt = { 16, 16, RGN_FRAC(1, 1), 4, { 0, 1, 2, 3 }, { 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 }, { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, 128*8 }; static GFXDECODE_START( inufuku ) GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 256*16 ) // bg GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 256*16 ) // text GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 256*16 ) // sprite GFXDECODE_END static GFXDECODE_START( _3on3dunk ) GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 256*16 ) // bg GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 256*16 ) // text GFXDECODE_ENTRY( "gfx3", 0, spritelayout_alt, 0, 256*16 ) // sprite GFXDECODE_END /****************************************************************************** Machine driver ******************************************************************************/ void inufuku_state::machine_start() { uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x00000], 0x8000); membank("bank1")->set_entry(0); save_item(NAME(m_bg_scrollx)); save_item(NAME(m_bg_scrolly)); save_item(NAME(m_tx_scrollx)); save_item(NAME(m_tx_scrolly)); save_item(NAME(m_bg_raster)); save_item(NAME(m_bg_palettebank)); save_item(NAME(m_tx_palettebank)); } void inufuku_state::machine_reset() { m_bg_scrollx = 0; m_bg_scrolly = 0; m_tx_scrollx = 0; m_tx_scrolly = 0; m_bg_raster = 0; m_bg_palettebank = 0; m_tx_palettebank = 0; } MACHINE_CONFIG_START(inufuku_state::inufuku) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, 32000000/2) /* 16.00 MHz */ MCFG_CPU_PROGRAM_MAP(inufuku_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", inufuku_state, irq1_line_hold) MCFG_CPU_ADD("audiocpu", Z80, 32000000/4) /* 8.00 MHz */ MCFG_CPU_PROGRAM_MAP(inufuku_sound_map) MCFG_CPU_IO_MAP(inufuku_sound_io_map) /* IRQs are triggered by the YM2610 */ MCFG_EEPROM_SERIAL_93C46_ADD("eeprom") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2300)) MCFG_SCREEN_SIZE(2048, 256) MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 223) MCFG_SCREEN_UPDATE_DRIVER(inufuku_state, screen_update_inufuku) MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(inufuku_state, screen_vblank_inufuku)) MCFG_SCREEN_PALETTE("palette") MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0) MCFG_VSYSTEM_SPR_SET_OFFSETS(0,1) // reference videos confirm at least the +1 against tilemaps in 3on3dunk (the highscore header text and black box are meant to be 1 pixel misaligned, although there is currently a priority bug there too) MCFG_VSYSTEM_SPR_SET_PDRAW(true) MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( inufuku_state, inufuku_tile_callback ) MCFG_VSYSTEM_SPR_SET_GFXREGION(2) MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode") MCFG_GFXDECODE_ADD("gfxdecode", "palette", inufuku) MCFG_PALETTE_ADD("palette", 4096) MCFG_PALETTE_FORMAT(xGGGGGBBBBBRRRRR) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI)) MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true) MCFG_SOUND_ADD("ymsnd", YM2610, 32000000/4) MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "mono", 0.50) MCFG_SOUND_ROUTE(1, "mono", 0.75) MCFG_SOUND_ROUTE(2, "mono", 0.75) MACHINE_CONFIG_END MACHINE_CONFIG_START(inufuku_state::_3on3dunk) inufuku(config); MCFG_GFXDECODE_MODIFY("gfxdecode", _3on3dunk) MACHINE_CONFIG_END /****************************************************************************** ROM definitions ******************************************************************************/ ROM_START( inufuku ) ROM_REGION( 0x1000000, "maincpu", 0 ) // main cpu + data ROM_LOAD16_WORD_SWAP( "u147.bin", 0x0000000, 0x080000, CRC(ab72398c) SHA1(f5dc266ffa936ea6528b46a34113f5e2f8141d71) ) ROM_LOAD16_WORD_SWAP( "u146.bin", 0x0080000, 0x080000, CRC(e05e9bd4) SHA1(af0fdf31c2bdf851bf15c9de725dcbbb58464d54) ) ROM_LOAD16_WORD_SWAP( "lhmn5l28.148", 0x0800000, 0x400000, CRC(802d17e7) SHA1(43b26efea65fd051c094d19784cb977ced39a1a0) ) ROM_REGION( 0x0020000, "audiocpu", 0 ) // sound cpu ROM_LOAD( "u107.bin", 0x0000000, 0x020000, CRC(1744ef90) SHA1(e019f4ca83e21aa25710cc0ca40ffe765c7486c9) ) ROM_REGION( 0x0400000, "gfx1", 0 ) // bg ROM_LOAD16_WORD_SWAP( "lhmn5ku8.u40", 0x0000000, 0x400000, CRC(8cbca80a) SHA1(063e9be97f5a1f021f8326f2994b51f9af5e1eaf) ) ROM_REGION( 0x0400000, "gfx2", 0 ) // text ROM_LOAD16_WORD_SWAP( "lhmn5ku7.u8", 0x0000000, 0x400000, CRC(a6c0f07f) SHA1(971803d1933d8296767d8766ea9f04dcd6ab065c) ) ROM_REGION( 0x0c00000, "gfx3", 0 ) // sprite ROM_LOAD16_WORD_SWAP( "lhmn5kub.u34", 0x0000000, 0x400000, CRC(7753a7b6) SHA1(a2e8747ce83ea5a57e2fe62f2452de355d7f48b6) ) ROM_LOAD16_WORD_SWAP( "lhmn5kua.u36", 0x0400000, 0x400000, CRC(1ac4402a) SHA1(c15acc6fce4fe0b54e92d14c31a1bd78acf2c8fc) ) ROM_LOAD16_WORD_SWAP( "lhmn5ku9.u38", 0x0800000, 0x400000, CRC(e4e9b1b6) SHA1(4d4ad85fbe6a442d4f8cafad748bcae4af6245b7) ) ROM_REGION( 0x0400000, "ymsnd", 0 ) // adpcm data ROM_LOAD( "lhmn5ku6.u53", 0x0000000, 0x400000, CRC(b320c5c9) SHA1(7c99da2d85597a3c008ed61a3aa5f47ad36186ec) ) ROM_END ROM_START( 3on3dunk ) ROM_REGION( 0x1000000, "maincpu", 0 ) // main cpu + data ROM_LOAD16_WORD_SWAP( "prog0_2_4_usa.u147", 0x0000000, 0x080000, CRC(957924ab) SHA1(6fe8ca711d11239310d58188e9d6d28cd27bc5af) ) ROM_LOAD16_WORD_SWAP( "prog1_2_4_usa.u146", 0x0080000, 0x080000, CRC(2479e236) SHA1(729e6c85d34d6925c8d6557b138e2bed43e1de6a) ) ROM_LOAD16_WORD_SWAP( "lh535l5y.u148", 0x0800000, 0x400000, CRC(aa33e02a) SHA1(86381ecf18fba9065cbc02112751c435bbf8b8b4) ) ROM_REGION( 0x0020000, "audiocpu", 0 ) // sound cpu ROM_LOAD( "sound_prog_97_1_13.u107", 0x0000000, 0x020000, CRC(d9d42805) SHA1(ab5cb7c141d9c9ed5121ba4dbc1d0fa187bd9f68) ) ROM_REGION( 0x0400000, "gfx1", 0 ) // bg ROM_LOAD16_WORD_SWAP( "lh525kwy.u40", 0x0000000, 0x400000, CRC(aaa426d1) SHA1(2f9a2981f336caf3188baec9a34f61452dee2203) ) ROM_REGION( 0x0400000, "gfx2", 0 ) // text ROM_LOAD16_WORD_SWAP( "lh537nn4.u8", 0x0000000, 0x200000, CRC(2b7be1d8) SHA1(aac274a8f4028db7429478601a1761e61ab4f9a2) ) ROM_REGION( 0x2000000, "gfx3", 0 ) // sprite ROM_LOAD( "lh535kwz.u34", 0x0000000, 0x400000, CRC(7372ce78) SHA1(ed2a861986357fad7ef983750cd906c3d722b862) ) ROM_LOAD( "lh535kv0.u36", 0x0400000, 0x400000, CRC(247e5741) SHA1(8d71d964791fb4b86e390bcdf7744f616d6357b1) ) ROM_LOAD( "lh535kv2.u38", 0x0800000, 0x400000, CRC(76449b1e) SHA1(b63d50c6f0dc91dc94dbcdda9842598529c1c26e) ) ROM_LOAD( "lh537nn5.u20", 0x0c00000, 0x200000, CRC(f457cd3b) SHA1(cc13f5dc44e4675c1074a365b10f34e684817d81) ) /* 0x0e00000, 0x200000 empty */ ROM_LOAD( "lh536pnm.u32", 0x1000000, 0x400000, CRC(bc39e449) SHA1(5aea90b66ee03c70797ddc42dbcb064d83ce8cc7) ) ROM_REGION( 0x0400000, "ymsnd", 0 ) // ADPCM data ROM_LOAD( "lh5388r1.u53", 0x0000000, 0x100000, CRC(765d892f) SHA1(9b078c879d0437d1669bf4301fd52a768aa4d293) ) ROM_REGION( 0x400000, "ymsnd.deltat", 0 ) // speech ROM_LOAD( "lh536pkl.u51", 0x0000000, 0x300000, CRC(e4919abf) SHA1(d6af4b9c6ff62f92216c9927027d3b2376416bae) ) ROM_END /****************************************************************************** Game drivers ******************************************************************************/ GAME( 1998, inufuku, 0, inufuku, inufuku, inufuku_state, 0, ROT0, "Video System Co.", "Quiz & Variety Sukusuku Inufuku (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) GAME( 1996, 3on3dunk, 0, _3on3dunk, inufuku, inufuku_state, 0, ROT0, "Video System Co.", "3 On 3 Dunk Madness (US, prototype? 1997/02/04)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) // tilemap priority is wrong in places (basketball before explosion in attract, highscores)
38.276824
306
0.663677
rjw57
4bf78b1cef8b89c8b600a967ed3610294c2d769d
4,398
cpp
C++
src/sfutil/blend-mode.cpp
tilnewman/heroespath-src
a7784e44d8b5724f305ef8b8671fed54e2e5fd69
[ "BSL-1.0", "Beerware" ]
2
2019-02-28T00:28:08.000Z
2019-10-20T14:39:48.000Z
src/sfutil/blend-mode.cpp
tilnewman/heroespath-src
a7784e44d8b5724f305ef8b8671fed54e2e5fd69
[ "BSL-1.0", "Beerware" ]
null
null
null
src/sfutil/blend-mode.cpp
tilnewman/heroespath-src
a7784e44d8b5724f305ef8b8671fed54e2e5fd69
[ "BSL-1.0", "Beerware" ]
null
null
null
// ---------------------------------------------------------------------------- // "THE BEER-WARE LICENSE" (Revision 42): // <ztn@zurreal.com> wrote this file. As long as you retain this notice you // can do whatever you want with this stuff. If we meet some day, and you think // this stuff is worth it, you can buy me a beer in return. Ziesche Til Newman // ---------------------------------------------------------------------------- // // blend-mode.cpp // #include "blend-mode.hpp" #include "misc/strings.hpp" #include <ostream> #include <tuple> namespace sf { bool operator<(const sf::BlendMode & L, const sf::BlendMode & R) { return std::tie( L.colorSrcFactor, L.colorDstFactor, L.colorEquation, L.alphaSrcFactor, L.alphaDstFactor, L.alphaEquation) < std::tie( R.colorSrcFactor, R.colorDstFactor, R.colorEquation, R.alphaSrcFactor, R.alphaDstFactor, R.alphaEquation); } std::ostream & operator<<(std::ostream & os, const sf::BlendMode & BM) { os << "("; if (BM == sf::BlendAlpha) { os << "Alpha"; } else if (BM == sf::BlendAdd) { os << "Add"; } else if (BM == sf::BlendMultiply) { os << "Multiply"; } else if (BM == sf::BlendNone) { os << "None"; } else { auto factorToString = [](const sf::BlendMode::Factor FACTOR) -> std::string { switch (FACTOR) { case sf::BlendMode::Factor::Zero: { return "Zero"; } case sf::BlendMode::Factor::One: { return "One"; } case sf::BlendMode::Factor::SrcColor: { return "SrcColor"; } case sf::BlendMode::Factor::OneMinusSrcColor: { return "OneMinusSrcColor"; } case sf::BlendMode::Factor::DstColor: { return "DstColor"; } case sf::BlendMode::Factor::OneMinusDstColor: { return "OneMinusDstColor"; } case sf::BlendMode::Factor::SrcAlpha: { return "SrcAlpha"; } case sf::BlendMode::Factor::OneMinusSrcAlpha: { return "OneMinusSrcAlpha"; } case sf::BlendMode::Factor::DstAlpha: { return "DstAlpha"; } default: case sf::BlendMode::Factor::OneMinusDstAlpha: { return "OneMinusDstAlpha"; } } }; auto equationToString = [](const sf::BlendMode::Equation EQUATION) -> std::string { switch (EQUATION) { case sf::BlendMode::Equation::Add: { return "Add"; } case sf::BlendMode::Equation::Subtract: { return "Subtract"; } default: case sf::BlendMode::Equation::ReverseSubtract: { return "ReverseSubtract"; } } }; os << factorToString(BM.colorSrcFactor) << "," << factorToString(BM.colorDstFactor) << "," << equationToString(BM.colorEquation) << "," << factorToString(BM.alphaSrcFactor) << "," << factorToString(BM.alphaDstFactor) << "," << equationToString(BM.alphaEquation); } os << ")"; return os; } } // namespace sf namespace heroespath { namespace sfutil { const std::string ToString(const sf::BlendMode & BM, const misc::ToStringPrefix::Enum OPTIONS) { std::ostringstream ss; ss << misc::MakeToStringPrefix<sf::BlendMode>(OPTIONS, "BlendMode") << BM; return ss.str(); } } // namespace sfutil } // namespace heroespath
29.125828
100
0.429286
tilnewman
4bf7f750e7993e8adee89375cef90d9d4af2ea1b
2,724
hpp
C++
include/eepp/audio/soundfilewriter.hpp
jayrulez/eepp
09c5c1b6b4c0306bb0a188474778c6949b5df3a7
[ "MIT" ]
37
2020-01-20T06:21:24.000Z
2022-03-21T17:44:50.000Z
include/eepp/audio/soundfilewriter.hpp
jayrulez/eepp
09c5c1b6b4c0306bb0a188474778c6949b5df3a7
[ "MIT" ]
null
null
null
include/eepp/audio/soundfilewriter.hpp
jayrulez/eepp
09c5c1b6b4c0306bb0a188474778c6949b5df3a7
[ "MIT" ]
9
2019-03-22T00:33:07.000Z
2022-03-01T01:35:59.000Z
#ifndef EE_AUDIO_SOUNDFILEWRITER_HPP #define EE_AUDIO_SOUNDFILEWRITER_HPP #include <eepp/config.hpp> #include <string> namespace EE { namespace Audio { /// \brief Abstract base class for sound file encoding class EE_API SoundFileWriter { public: virtual ~SoundFileWriter() {} //////////////////////////////////////////////////////////// /// \brief Open a sound file for writing /// /// \param filename Path of the file to open /// \param sampleRate Sample rate of the sound /// \param channelCount Number of channels of the sound /// /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// virtual bool open( const std::string& filename, unsigned int sampleRate, unsigned int channelCount ) = 0; //////////////////////////////////////////////////////////// /// \brief Write audio samples to the open file /// /// \param samples Pointer to the sample array to write /// \param count Number of samples to write /// //////////////////////////////////////////////////////////// virtual void write( const Int16* samples, Uint64 count ) = 0; }; }} // namespace EE::Audio #endif //////////////////////////////////////////////////////////// /// @class EE::Audio::SoundFileWriter /// /// This class allows users to write audio file formats not natively /// supported by EEPP, and thus extend the set of supported writable /// audio formats. /// /// A valid sound file writer must override the open and write functions, /// as well as providing a static check function; the latter is used by /// EEPP to find a suitable writer for a given filename. /// /// To register a new writer, use the SoundFileFactory::registerWriter /// template function. /// /// Usage example: /// \code /// class MySoundFileWriter : public SoundFileWriter /// { /// public: /// /// static bool check(const std::string& filename) /// { /// // typically, check the extension /// // return true if the writer can handle the format /// } /// /// virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int /// channelCount) /// { /// // open the file 'filename' for writing, /// // write the given sample rate and channel count to the file header /// // return true on success /// } /// /// virtual void write(const Int16* samples, Uint64 count) /// { /// // write 'count' samples stored at address 'samples', /// // convert them (for example to normalized float) if the format requires it /// } /// }; /// /// SoundFileFactory::registerWriter<MySoundFileWriter>(); /// \endcode /// /// \see OutputSoundFile, SoundFileFactory, SoundFileReader /// ////////////////////////////////////////////////////////////
30.954545
89
0.595815
jayrulez
4bfbb94537ea202cfdfba57084ed14ec13da51ca
13,090
hpp
C++
include/imgproc/laplace.hpp
waterben/LineExtraction
d247de45417a1512a3bf5d0ffcd630d40ffb8798
[ "MIT" ]
1
2020-06-12T13:30:56.000Z
2020-06-12T13:30:56.000Z
include/imgproc/laplace.hpp
waterben/LineExtraction
d247de45417a1512a3bf5d0ffcd630d40ffb8798
[ "MIT" ]
null
null
null
include/imgproc/laplace.hpp
waterben/LineExtraction
d247de45417a1512a3bf5d0ffcd630d40ffb8798
[ "MIT" ]
null
null
null
/*M/////////////////////////////////////////////////////////////////////////////////////// // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved. // Third party copyrights are property of their respective owners. // // 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. // // * The name of the copyright holders may not 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 Intel Corporation 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. // // C by Benjamin Wassermann //M*/ #ifndef _LAPLACE_HPP_ #define _LAPLACE_HPP_ #ifdef __cplusplus #include "opencv2/imgproc/imgproc.hpp" #include "filter.hpp" namespace lsfm { //! Laplace base class //! Use IT to define Image type (8Bit, 16Bit, 32Bit, or floating type float or double) //! Use LT to define Laplace type (int, float or double) //! For 8 Bit images use GT = short, for 16 Bit images float. //! For images with floating values, use IT and GT = image floating type (float or double) template<class IT, class LT> class LaplaceI : public FilterI<IT> { LaplaceI(const LaplaceI&); public: typedef IT img_type; typedef Range<IT> IntensityRange; typedef LT laplace_type; typedef Range<LT> LaplaceRange; LaplaceI() {} virtual ~LaplaceI() {} //! get magnitude virtual cv::Mat laplace() const = 0; //! get magnitude range for intensity range virtual LaplaceRange laplaceRange() const = 0; //! convert threshold between 0-1 to mangitude threshold virtual LT laplaceThreshold(double val) const { return static_cast<LT>(laplaceRange().size() * val); } }; //! Laplace base class helper template<class IT, class LT> class Laplace : public LaplaceI<IT, LT> { protected: Range<IT> intRange_; public: typedef IT img_type; typedef Range<IT> IntensityRange; typedef LT laplace_type; typedef Range<LT> LaplaceRange; Laplace(IT int_lower = std::numeric_limits<IT>::lowest(), IT int_upper = std::numeric_limits<IT>::max()) : intRange_(int_lower,int_upper) {} //! get image intensity range (for single channel) IntensityRange intensityRange() const { return intRange_; } //! generic interface to get processed data virtual FilterResults results() const { FilterResults ret; ret["laplace"] = FilterData(this->laplace(), this->laplaceRange()); return ret; } }; template<class IT, class LT> class LaplaceSimple : public Laplace<IT, LT> { protected: cv::Mat laplace_; cv::Mat_<LT> k_; cv::Point anchor; using Laplace<IT, LT>::intRange_; public: typedef IT img_type; typedef Range<IT> IntensityRange; typedef LT laplace_type; typedef Range<LT> LaplaceRange; LaplaceSimple(IT int_lower = std::numeric_limits<IT>::lowest(), IT int_upper = std::numeric_limits<IT>::max()) : Laplace<IT,LT>(int_lower, int_upper), anchor(-1, -1) { k_ = cv::Mat_<LT>::ones(3, 3); k_(1, 1) = -8; } //! process laplacian void process(const cv::Mat& img) { cv::filter2D(img, laplace_, cv::DataType<LT>::type, k_, anchor, 0, cv::BORDER_REFLECT_101); } //! get magnitude cv::Mat laplace() const { return laplace_; } //! get magnitude range for intensity range virtual LaplaceRange laplaceRange() const { LT val = intRange_.upper * 8; return LaplaceRange(-val, val); } //! get name of gradient operator std::string name() const { return "laplace"; } using ValueManager::values; using ValueManager::valuePair; using ValueManager::value; using Laplace<IT, LT>::intensityRange; using Laplace<IT, LT>::results; }; template<class IT, class LT> class LoG : public LaplaceSimple<IT, LT> { int ksize_; double kspace_, kscale_; using LaplaceSimple<IT, LT>::intRange_; Range<LT> laplaceRange_; public: static inline double exp_d2(double x, double y, double s) { double xy2 = x*x + y*y; return s*(xy2 - 1)*std::exp(-xy2); } static inline cv::Mat_<LT> createFilter(int width, double spacing, double scale) { width = width / 2; cv::Mat_<LT> kernel(width * 2 + 1, width * 2 + 1); for (int i = -width; i <= width; ++i) for (int j = -width; j <= width; ++j) kernel(j + width, i + width) = static_cast<LT>(exp_d2(i*spacing, j*spacing, scale)); // zero dc #ifndef DISABLE_DC_ZERO_FIX kernel -= cv::sum(kernel)[0] / (kernel.size().area()); #endif return kernel; } private: void create_kernel() { this->k_ = createFilter(ksize_, kspace_, kscale_); cv::Mat_<LT> tmp; this->k_.copyTo(tmp); tmp.setTo(0, tmp < 0); laplaceRange_.upper = static_cast<LT>(cv::sum(tmp)[0] * intRange_.upper); this->k_.copyTo(tmp); tmp.setTo(0, tmp > 0); laplaceRange_.lower = static_cast<LT>(cv::sum(tmp)[0] * intRange_.upper); //std::cout << this->k_ << std::endl << laplaceRange_.upper << std::endl << laplaceRange_.lower << std::endl; } public: typedef IT img_type; typedef Range<IT> IntensityRange; typedef LT laplace_type; typedef Range<LT> LaplaceRange; LoG(int kernel_size = 5, double kernel_spacing = 1.008, double kernel_scale = 1, IT int_lower = std::numeric_limits<IT>::lowest(), IT int_upper = std::numeric_limits<IT>::max()) : LaplaceSimple<IT,LT>(int_lower, int_upper), ksize_(kernel_size), kspace_(kernel_spacing), kscale_(kernel_scale) { this->add("grad_kernel_size", std::bind(&LoG<IT, LT>::valueKernelSize, this, std::placeholders::_1), "Kernel size for LoG-Operator."); this->add("grad_kernel_spacing", std::bind(&LoG<IT, LT>::valueKernelSpacing, this, std::placeholders::_1), "Spacing for a single step for LoG-Operator."); this->add("grad_kernel_scale", std::bind(&LoG<IT, LT>::valueKernelScale, this, std::placeholders::_1), "Upscale for LoG-Operator (e.g. for converting to short)."); create_kernel(); } Value valueKernelSize(const Value &ks = Value::NAV()) { if (ks.type()) kernelSize(ks); return ksize_; } //! get kernel size int kernelSize() const { return ksize_; } //! set kernel size (range 2-99, has to be odd, even will be corrected to ksize+1) //! Note: large kernels needs larger GT type like int or long long int void kernelSize(int ks) { if (ks == ksize_) return; if (ks < 3) ks = 3; if (ks % 2 == 0) ++ks; if (ks > 99) ks = 99; ksize_ = ks; create_kernel(); } Value valueKernelSpacing(const Value &ks = Value::NAV()) { if (ks.type()) kernelSpacing(ks); return kspace_; } double kernelSpacing() const { return kspace_; } void kernelSpacing(double ks) { if (ks == kspace_ || ks <= 0) return; kspace_ = ks; create_kernel(); } Value valueKernelScale(const Value &ks = Value::NAV()) { if (ks.type()) kernelScale(ks); return kscale_; } double kernelScale() const { return kscale_; } void kernelScale(double ks) { if (ks == kscale_ || ks <= 0) return; kscale_ = ks; create_kernel(); } cv::Mat kernel() const { return this->k_; } cv::Mat even() const { return this->laplace(); } using ValueManager::values; using ValueManager::valuePair; using ValueManager::value; using LaplaceSimple<IT,LT>::process; using LaplaceSimple<IT,LT>::laplace; using LaplaceSimple<IT, LT>::intensityRange; using LaplaceSimple<IT, LT>::results; //! get magnitude range for intensity range virtual LaplaceRange laplaceRange() const { return laplaceRange_; } //! get name of gradient operator std::string name() const { return "LoG"; } }; template<class IT, class LT> class LaplaceCV : public Laplace<IT,LT> { Range<LT> laplaceRange_; cv::Mat laplace_; int ksize_; void calc_range() { // TODO laplaceRange_.lower = -this->intRange_.upper * 2 * ksize_; laplaceRange_.upper = this->intRange_.upper * 2 * ksize_; } public: typedef IT img_type; typedef Range<IT> IntensityRange; typedef LT laplace_type; typedef Range<LT> LaplaceRange; LaplaceCV(int ksize = 5, IT int_lower = std::numeric_limits<IT>::lowest(), IT int_upper = std::numeric_limits<IT>::max()) : Laplace<IT,LT>(int_lower, int_upper), ksize_(ksize) { this->add("grad_kernel_size", std::bind(&LaplaceCV<IT, LT>::valueKernelSize, this, std::placeholders::_1), "Kernel size for Laplace-Operator."); calc_range(); } Value valueKernelSize(const Value &ks = Value::NAV()) { if (ks.type()) kernelSize(ks.getInt()); return ksize_; } //! Get kernel size int kernelSize() const { return ksize_; } //! Set kernel size (range 1-31, has to be odd, even will be corrected to ksize+1) //! Note: large kernels needs larger GT type like float or double void kernelSize(int ks) { if (ksize_ == ks) return; if (ks < 1) ks = 1; if (ks % 2 == 0) ++ks; if (ks > 31) ks = 31; ksize_ = ks; calc_range(); } //! process laplacian void process(const cv::Mat& img) { cv::Laplacian(img, laplace_, cv::DataType<LT>::type, ksize_, 1, 0, cv::BORDER_REFLECT_101); } //! get magnitude cv::Mat laplace() const { return laplace_; } //! get magnitude range for intensity range LaplaceRange laplaceRange() const { return laplaceRange_; } //! get name of gradient operator std::string name() const { return "laplaceCV"; } using ValueManager::values; using ValueManager::valuePair; using ValueManager::value; using Laplace<IT, LT>::intensityRange; using Laplace<IT, LT>::results; }; } #endif #endif
35.283019
188
0.56906
waterben
4bfdb1205e199c04b53f11940a66e2da2f0ea4fe
11,628
cpp
C++
tools/aapt2/split/TableSplitter.cpp
Keneral/aframeworksbase1
0287c3e3f6f763cd630290343cda11e15db1844f
[ "Unlicense" ]
null
null
null
tools/aapt2/split/TableSplitter.cpp
Keneral/aframeworksbase1
0287c3e3f6f763cd630290343cda11e15db1844f
[ "Unlicense" ]
null
null
null
tools/aapt2/split/TableSplitter.cpp
Keneral/aframeworksbase1
0287c3e3f6f763cd630290343cda11e15db1844f
[ "Unlicense" ]
null
null
null
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "ConfigDescription.h" #include "ResourceTable.h" #include "split/TableSplitter.h" #include <algorithm> #include <map> #include <set> #include <unordered_map> #include <vector> namespace aapt { using ConfigClaimedMap = std::unordered_map<ResourceConfigValue*, bool>; using ConfigDensityGroups = std::map<ConfigDescription, std::vector<ResourceConfigValue*>>; static ConfigDescription copyWithoutDensity(const ConfigDescription& config) { ConfigDescription withoutDensity = config; withoutDensity.density = 0; return withoutDensity; } /** * Selects values that match exactly the constraints given. */ class SplitValueSelector { public: SplitValueSelector(const SplitConstraints& constraints) { for (const ConfigDescription& config : constraints.configs) { if (config.density == 0) { mDensityIndependentConfigs.insert(config); } else { mDensityDependentConfigToDensityMap[copyWithoutDensity(config)] = config.density; } } } std::vector<ResourceConfigValue*> selectValues(const ConfigDensityGroups& densityGroups, ConfigClaimedMap* claimedValues) { std::vector<ResourceConfigValue*> selected; // Select the regular values. for (auto& entry : *claimedValues) { // Check if the entry has a density. ResourceConfigValue* configValue = entry.first; if (configValue->config.density == 0 && !entry.second) { // This is still available. if (mDensityIndependentConfigs.find(configValue->config) != mDensityIndependentConfigs.end()) { selected.push_back(configValue); // Mark the entry as taken. entry.second = true; } } } // Now examine the densities for (auto& entry : densityGroups) { // We do not care if the value is claimed, since density values can be // in multiple splits. const ConfigDescription& config = entry.first; const std::vector<ResourceConfigValue*>& relatedValues = entry.second; auto densityValueIter = mDensityDependentConfigToDensityMap.find(config); if (densityValueIter != mDensityDependentConfigToDensityMap.end()) { // Select the best one! ConfigDescription targetDensity = config; targetDensity.density = densityValueIter->second; ResourceConfigValue* bestValue = nullptr; for (ResourceConfigValue* thisValue : relatedValues) { if (!bestValue || thisValue->config.isBetterThan(bestValue->config, &targetDensity)) { bestValue = thisValue; } // When we select one of these, they are all claimed such that the base // doesn't include any anymore. (*claimedValues)[thisValue] = true; } assert(bestValue); selected.push_back(bestValue); } } return selected; } private: std::set<ConfigDescription> mDensityIndependentConfigs; std::map<ConfigDescription, uint16_t> mDensityDependentConfigToDensityMap; }; /** * Marking non-preferred densities as claimed will make sure the base doesn't include them, * leaving only the preferred density behind. */ static void markNonPreferredDensitiesAsClaimed(uint16_t preferredDensity, const ConfigDensityGroups& densityGroups, ConfigClaimedMap* configClaimedMap) { for (auto& entry : densityGroups) { const ConfigDescription& config = entry.first; const std::vector<ResourceConfigValue*>& relatedValues = entry.second; ConfigDescription targetDensity = config; targetDensity.density = preferredDensity; ResourceConfigValue* bestValue = nullptr; for (ResourceConfigValue* thisValue : relatedValues) { if (!bestValue) { bestValue = thisValue; } else if (thisValue->config.isBetterThan(bestValue->config, &targetDensity)) { // Claim the previous value so that it is not included in the base. (*configClaimedMap)[bestValue] = true; bestValue = thisValue; } else { // Claim this value so that it is not included in the base. (*configClaimedMap)[thisValue] = true; } } assert(bestValue); } } bool TableSplitter::verifySplitConstraints(IAaptContext* context) { bool error = false; for (size_t i = 0; i < mSplitConstraints.size(); i++) { for (size_t j = i + 1; j < mSplitConstraints.size(); j++) { for (const ConfigDescription& config : mSplitConstraints[i].configs) { if (mSplitConstraints[j].configs.find(config) != mSplitConstraints[j].configs.end()) { context->getDiagnostics()->error(DiagMessage() << "config '" << config << "' appears in multiple splits, " << "target split ambiguous"); error = true; } } } } return !error; } void TableSplitter::splitTable(ResourceTable* originalTable) { const size_t splitCount = mSplitConstraints.size(); for (auto& pkg : originalTable->packages) { // Initialize all packages for splits. for (size_t idx = 0; idx < splitCount; idx++) { ResourceTable* splitTable = mSplits[idx].get(); splitTable->createPackage(pkg->name, pkg->id); } for (auto& type : pkg->types) { if (type->type == ResourceType::kMipmap) { // Always keep mipmaps. continue; } for (auto& entry : type->entries) { if (mConfigFilter) { // First eliminate any resource that we definitely don't want. for (std::unique_ptr<ResourceConfigValue>& configValue : entry->values) { if (!mConfigFilter->match(configValue->config)) { // null out the entry. We will clean up and remove nulls at the end // for performance reasons. configValue.reset(); } } } // Organize the values into two separate buckets. Those that are density-dependent // and those that are density-independent. // One density technically matches all density, it's just that some densities // match better. So we need to be aware of the full set of densities to make this // decision. ConfigDensityGroups densityGroups; ConfigClaimedMap configClaimedMap; for (const std::unique_ptr<ResourceConfigValue>& configValue : entry->values) { if (configValue) { configClaimedMap[configValue.get()] = false; if (configValue->config.density != 0) { // Create a bucket for this density-dependent config. densityGroups[copyWithoutDensity(configValue->config)] .push_back(configValue.get()); } } } // First we check all the splits. If it doesn't match one of the splits, we // leave it in the base. for (size_t idx = 0; idx < splitCount; idx++) { const SplitConstraints& splitConstraint = mSplitConstraints[idx]; ResourceTable* splitTable = mSplits[idx].get(); // Select the values we want from this entry for this split. SplitValueSelector selector(splitConstraint); std::vector<ResourceConfigValue*> selectedValues = selector.selectValues(densityGroups, &configClaimedMap); // No need to do any work if we selected nothing. if (!selectedValues.empty()) { // Create the same resource structure in the split. We do this lazily // because we might not have actual values for each type/entry. ResourceTablePackage* splitPkg = splitTable->findPackage(pkg->name); ResourceTableType* splitType = splitPkg->findOrCreateType(type->type); if (!splitType->id) { splitType->id = type->id; splitType->symbolStatus = type->symbolStatus; } ResourceEntry* splitEntry = splitType->findOrCreateEntry(entry->name); if (!splitEntry->id) { splitEntry->id = entry->id; splitEntry->symbolStatus = entry->symbolStatus; } // Copy the selected values into the new Split Entry. for (ResourceConfigValue* configValue : selectedValues) { ResourceConfigValue* newConfigValue = splitEntry->findOrCreateValue( configValue->config, configValue->product); newConfigValue->value = std::unique_ptr<Value>( configValue->value->clone(&splitTable->stringPool)); } } } if (mPreferredDensity) { markNonPreferredDensitiesAsClaimed(mPreferredDensity.value(), densityGroups, &configClaimedMap); } // All splits are handled, now check to see what wasn't claimed and remove // whatever exists in other splits. for (std::unique_ptr<ResourceConfigValue>& configValue : entry->values) { if (configValue && configClaimedMap[configValue.get()]) { // Claimed, remove from base. configValue.reset(); } } // Now erase all nullptrs. entry->values.erase( std::remove(entry->values.begin(), entry->values.end(), nullptr), entry->values.end()); } } } } } // namespace aapt
43.714286
98
0.547816
Keneral
4bfe429f97b49ba4a61fe07d03698b6291a2fd25
1,938
hpp
C++
app/bin/miner/xmr-stak/xmrstak/backend/miner_work.hpp
chrisknepper/electron-gui-crypto-miner
e154b1f1ea6ce8285c7a682a8dcef90f17a5c8a2
[ "MIT" ]
2
2018-01-25T04:29:57.000Z
2020-02-13T15:30:55.000Z
app/bin/miner/xmr-stak/xmrstak/backend/miner_work.hpp
chrisknepper/electron-gui-crypto-miner
e154b1f1ea6ce8285c7a682a8dcef90f17a5c8a2
[ "MIT" ]
1
2019-05-26T17:51:57.000Z
2019-05-26T17:51:57.000Z
app/bin/miner/xmr-stak/xmrstak/backend/miner_work.hpp
chrisknepper/electron-gui-crypto-miner
e154b1f1ea6ce8285c7a682a8dcef90f17a5c8a2
[ "MIT" ]
5
2018-02-17T11:32:37.000Z
2021-02-26T22:26:07.000Z
#pragma once #include <thread> #include <atomic> #include <mutex> #include <cstdint> #include <iostream> #include <cassert> #include <cstring> namespace xmrstak { struct miner_work { char sJobID[64]; uint8_t bWorkBlob[112]; uint32_t iWorkSize; uint64_t iTarget; bool bNiceHash; bool bStall; size_t iPoolId; miner_work() : iWorkSize(0), bNiceHash(false), bStall(true), iPoolId(0) { } miner_work(const char* sJobID, const uint8_t* bWork, uint32_t iWorkSize, uint64_t iTarget, bool bNiceHash, size_t iPoolId) : iWorkSize(iWorkSize), iTarget(iTarget), bNiceHash(bNiceHash), bStall(false), iPoolId(iPoolId) { assert(iWorkSize <= sizeof(bWorkBlob)); memcpy(this->sJobID, sJobID, sizeof(miner_work::sJobID)); memcpy(this->bWorkBlob, bWork, iWorkSize); } miner_work(miner_work const&) = delete; miner_work& operator=(miner_work const& from) { assert(this != &from); iWorkSize = from.iWorkSize; iTarget = from.iTarget; bNiceHash = from.bNiceHash; bStall = from.bStall; iPoolId = from.iPoolId; assert(iWorkSize <= sizeof(bWorkBlob)); memcpy(sJobID, from.sJobID, sizeof(sJobID)); memcpy(bWorkBlob, from.bWorkBlob, iWorkSize); return *this; } miner_work(miner_work&& from) : iWorkSize(from.iWorkSize), iTarget(from.iTarget), bStall(from.bStall), iPoolId(from.iPoolId) { assert(iWorkSize <= sizeof(bWorkBlob)); memcpy(sJobID, from.sJobID, sizeof(sJobID)); memcpy(bWorkBlob, from.bWorkBlob, iWorkSize); } miner_work& operator=(miner_work&& from) { assert(this != &from); iWorkSize = from.iWorkSize; iTarget = from.iTarget; bNiceHash = from.bNiceHash; bStall = from.bStall; iPoolId = from.iPoolId; assert(iWorkSize <= sizeof(bWorkBlob)); memcpy(sJobID, from.sJobID, sizeof(sJobID)); memcpy(bWorkBlob, from.bWorkBlob, iWorkSize); return *this; } }; } // namepsace xmrstak
24.531646
83
0.684727
chrisknepper
ef02864b04104925cda2a3a4ce09fcac1c40a528
4,740
cpp
C++
MonoNative.Tests/SampleFixture.cpp
brunolauze/MonoNative
959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66
[ "BSD-2-Clause" ]
7
2015-03-10T03:36:16.000Z
2021-11-05T01:16:58.000Z
MonoNative.Tests/SampleFixture.cpp
brunolauze/MonoNative
959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66
[ "BSD-2-Clause" ]
1
2020-06-23T10:02:33.000Z
2020-06-24T02:05:47.000Z
MonoNative.Tests/SampleFixture.cpp
brunolauze/MonoNative
959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66
[ "BSD-2-Clause" ]
null
null
null
 #include <gtest/gtest.h> #include <mscorlib.h> using namespace mscorlib::System; using namespace mscorlib::System::Collections::Generic; extern "C" { MONO_API void* mono_delegate_to_ftnptr (MonoDelegate *delegate); MONO_API MonoDelegate* mono_ftnptr_to_delegate (MonoClass *klass, void* ftn); MONO_API void mono_delegate_free_ftnptr (MonoDelegate *delegate); } extern "C" { MonoBoolean List_Exists(MonoObject *arg1, MonoObject *arg2) { if (arg2 != NULL) { const char *result = mono_string_to_utf8(mono_object_to_string(arg2, NULL)); if (strcmp(result, "TEST") == 0) return TRUE; } return FALSE; } } TEST(SampleFixture, BasicTest1) { /* Just try Console a bit */ ConsoleColor::__ENUM__ lastColor = Console::ForegroundColor; std::cout << "Current Console Color: " << lastColor << std::endl; Console::WriteLine(String("Hello World!")); Console::ForegroundColor = ConsoleColor::Magenta; Console::WriteLine(String("Writing here in Magenta foreground color.")); Console::ForegroundColor = lastColor; Console::WriteLine(String("Writing back with default foreground color.")); Console::WriteLine("Writing from a plain old const char *"); std::cout << "pass1" << std::endl; MonoType *type1 = Global::GetType("mscorlib", "System", "Object"); std::cout << "pass2" << std::endl; MonoClass *kclass1 = mono_class_from_mono_type(type1); std::cout << "pass3" << std::endl; MonoClass *arraykclass = mono_array_class_get(kclass1, 1); std::cout << "pass4" << std::endl; MonoType *type2 = mono_class_get_type(arraykclass); std::cout << "pass7" << std::endl; const char *typeName = mono_type_get_name(type2); std::cout << "Array Type Created is : " << typeName << std::endl; Object obj1 = String("Jim"); Console::WriteLine(String("Formatting: My name is {0}."), obj1); std::vector<Object*> objs; Object *arg1 = new String("John"); objs.push_back(arg1); Console::WriteLine(String("Formatting: My name is {0}."), objs); } TEST(SampleFixture, BasicTest2) { std::vector<Object*> objs; Object *arg1 = new String("John"); objs.push_back(arg1); MonoObject* arrayObj = Global::FromArray<Object*>(objs, typeid(Object).name()); MonoArray *arrayEl = (MonoArray*)arrayObj; int length = mono_array_length(arrayEl); std::cout << "Array Length: " << length << std::endl; } TEST(SampleFixture, BasicTest3) { List<String> *list = new List<String>(); list->Add(String("TEST")); std::cout << "pass1" << std::endl; //mscorlib::System::Boolean doesExists = list->Exists(BIND_FREE_CB(SampleFixture_BasicTest3_Exists)); MonoObject *__native_object__ = list->GetNativeObject(); MonoType *__parameter_types__[1]; void *__parameters__[1]; MonoType *__generic_types__[1]; __generic_types__[0] = Global::GetType(typeid(String).name()); std::cout << "pass2" << std::endl; __parameter_types__[0] = Global::GetType("mscorlib", "System", "Predicate`1", 1, __generic_types__); std::cout << "pass3" << std::endl; //MonoType *typeDelegate = Global::GetType("mscorlib", "System", "Predicate`1", 1, __generic_types__); //MonoType *typeDelegate = Global::GetType("mscorlib", "System", "Action"); MonoClass *delegateClass = Global::GetClass("mscorlib", "System", "Predicate`1", 1, __generic_types__); /* MonoAssembly *ass = mono_assembly_open("MonoNativeHelper.dll", NULL); MonoImage *image = mono_assembly_get_image(ass); MonoClass *delegateClass = mono_class_from_name(image, "System", "BooleanDelegate"); */ //std::cout << mono_type_get_name(typeDelegate) << std::endl; std::cout << "pass4" << std::endl; //mono_type_get_class(typeDelegate) MonoDelegate *delegateObj = mono_ftnptr_to_delegate(delegateClass, (void*)List_Exists); std::cout << "pass5" << std::endl; __parameters__[0] = delegateObj; std::cout << "pass6" << std::endl; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Collections.Generic", "List`1", 1, __generic_types__, "Exists", __native_object__, 1, __parameter_types__, __parameters__, NULL); const char *resStr = mono_string_to_utf8(mono_object_to_string(__result__, NULL)); std::cout << "pass7:" << resStr << std::endl; mscorlib::System::Boolean doesExists = *(mscorlib::System::Boolean*)mono_object_unbox(__result__); std::cout << "pass8" << std::endl; EXPECT_TRUE(doesExists); list->Remove(String("TEST")); EXPECT_EQ(0, list->Count); list->Add(String("TEST_NO")); __result__ = Global::InvokeMethod("mscorlib", "System.Collections.Generic", "List`1", 1, __generic_types__, "Exists", __native_object__, 1, __parameter_types__, __parameters__, NULL); doesExists = *(mscorlib::System::Boolean*)mono_object_unbox(__result__); EXPECT_FALSE(doesExists); } TEST(SampleFixture, BasicTest4) { } TEST(SampleFixture, BasicTest5) { }
32.027027
196
0.715401
brunolauze
ef0290a03a5005abce124c9cffb3bf7594a922a1
7,199
cpp
C++
brsdk/net/event/event_loop.cpp
JerryYu512/brsdk
b0bc4606a34e5d934db52b7b054f36c588b840f9
[ "MIT" ]
null
null
null
brsdk/net/event/event_loop.cpp
JerryYu512/brsdk
b0bc4606a34e5d934db52b7b054f36c588b840f9
[ "MIT" ]
null
null
null
brsdk/net/event/event_loop.cpp
JerryYu512/brsdk
b0bc4606a34e5d934db52b7b054f36c588b840f9
[ "MIT" ]
null
null
null
/** * MIT License * * Copyright © 2021 <Jerry.Yu>. * * 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 * * 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. * * @file event_loop.cpp * @brief * @author Jerry.Yu (jerry.yu512@outlook.com) * @version 1.0.0 * @date 2021-10-17 * * @copyright MIT License * */ #include "event_log.hpp" #include "event_loop.hpp" #include "event_channel.hpp" #include "poller.hpp" #include "brsdk/net/socket/socket_util.hpp" #include <algorithm> // #include <signal.h> #include <sys/eventfd.h> #include <unistd.h> namespace brsdk { namespace net { __thread EventLoop* t_loop_in_this_thread = nullptr; // 轮询其间隔10s const int kPollTimeMs = 10000; static int create_eventfd(void) { int evtfd = ::eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); if (evtfd < 0) { LOG_SYSERR << "Failed in eventfd"; abort(); } return evtfd; } EventLoop* EventLoop::GetEventLoopOfCurrentThead(void) { return t_loop_in_this_thread; } EventLoop::EventLoop() : looping_(false), quit_(false), event_handling_(false), calling_pending_functors_(false), iteration_(0), tid_(thread::tid()), poller_(EventPoller::NewDefaultPoller(this)), timer_queue_(new TimerQueue(this)), wakeup_fd_(create_eventfd()), wakeup_channel_(new EventChannel(this, wakeup_fd_)), current_active_channel_(nullptr) { LOG_DEBUG << "EventLopp created " << this << " in thread " << tid_; // 全局判断,一个线程只能创建一个 if (t_loop_in_this_thread) { LOG_FATAL << "Another EventLoop " << t_loop_in_this_thread << " exists in this thread " << tid_; } else { t_loop_in_this_thread = this; } // 设置唤醒通道的读事件 wakeup_channel_->SetReadCallback(std::bind(&EventLoop::HandleWakeupRead, this)); // 始终允许读事件 wakeup_channel_->EnableReading(); } EventLoop::~EventLoop() { LOG_DEBUG << "EventLoop" << this << " of thread " << tid_ << " destructs in thread " << thread::tid(); // 移除唤醒通道 wakeup_channel_->DisableAll(); wakeup_channel_->remove(); ::close(wakeup_fd_); // 处理待处理的回调接口 DoPendingFunctors(); t_loop_in_this_thread = nullptr; } void EventLoop::loop(void) { assert(!looping_); AssertInLoopThread(); looping_ = true; quit_ = false; LOG_TRACE << "EventLoop " << this << " start looping"; while (!quit_) { // 清空活动队列 active_channels_.clear(); // 轮询活动通道 poll_return_time_ = poller_->poll(kPollTimeMs, &active_channels_); // loop次数增加 ++iteration_; if (Logger::logLevel() <= Logger::TRACE) { PrintActiveChannels(); } // 正在处理事件 event_handling_ = true; // 活动事件轮询处理 for (EventChannel* channel : active_channels_) { current_active_channel_ = channel; current_active_channel_->HandleEvent(poll_return_time_); } current_active_channel_ = nullptr; // 事件处理结束 event_handling_ = false; // 处理待处理的回调接口 DoPendingFunctors(); } LOG_TRACE << "EventLoop " << this << " stop looping"; looping_ = false; } void EventLoop::quit(void) { // FIXME:非线程安全的,退出需要使用加锁来解决 quit_ = true; // 如果不是loop线程内的话,唤醒一次,因为有机会将剩下的事件/回调处理完 if (!IsInLoopThread()) { wakeup(); } } void EventLoop::RunInLoop(EventFunctor cb) { if (IsInLoopThread() || quit_) { // loop线程内的直接调用,因为已经在loop里了 cb(); } else { // 放到队列中,在loop循环内执行 QueueInLoop(std::move(cb)); } } void EventLoop::QueueInLoop(EventFunctor cb) { if (quit_) { cb(); return; } { MutexLockGuard lock(mutex_); pending_functors_.push_back(std::move(cb)); } // 如果不是在loop线程内,或者正在执行待处理回调函数,需要唤醒一次,避免处理延后 if (!IsInLoopThread() || calling_pending_functors_) { wakeup(); } } size_t EventLoop::queue_size(void) const { MutexLockGuard lock(mutex_); return pending_functors_.size(); } TimerId EventLoop::RunAt(Timestamp time, TimerCallback cb) { // 间隔为0则不需要间隔执行 return timer_queue_->AddTimer(std::move(cb), time, 0.0); } TimerId EventLoop::RunAfter(double delay, TimerCallback cb) { Timestamp time(addTime(Timestamp::now(), delay)); return RunAt(time, std::move(cb)); } TimerId EventLoop::RunEvery(double interval, TimerCallback cb) { Timestamp time(addTime(Timestamp::now(), interval)); return timer_queue_->AddTimer(std::move(cb), time, interval); } void EventLoop::cancel(TimerId timer_id) { return timer_queue_->cancel(timer_id); } void EventLoop::UpdateChannel(EventChannel* channel) { // 更新是在loop线程中更新的 assert(channel->OwnerLoop() == this); AssertInLoopThread(); // 事件更新 poller_->UpdateChannel(channel); } void EventLoop::RemoveChannel(EventChannel* channel) { // 更新是在loop线程中删除的 assert(channel->OwnerLoop() == this); AssertInLoopThread(); if (event_handling_) { assert(current_active_channel_ == channel || std::find(active_channels_.begin(), active_channels_.end(), channel) == active_channels_.end()); } poller_->RemoveChannel(channel); } bool EventLoop::HasChannel(EventChannel* channel) { assert(channel->OwnerLoop() == this); AssertInLoopThread(); return poller_->HasChannel(channel); } void EventLoop::AbortNotInLoopThread(void) { LOG_FATAL << "EventLoop::abortNotInLoopThread - EventLoop " << this << " was created in threadId_ = " << tid_ << ", current thread id = " << thread::tid(); } void EventLoop::wakeup(void) { uint64_t one = 1; // 通过写数据来唤醒轮询器 ssize_t n = sock_write(wakeup_fd_, &one, sizeof(one)); if (n != sizeof(one)) { LOG_ERROR << "EventLoop::wakeup() writes " << n << " bytes instead of 8"; } } void EventLoop::HandleWakeupRead(void) { uint64_t one = 1; ssize_t n = sock_read(wakeup_fd_, &one, sizeof(one)); if (n != sizeof(one)) { LOG_ERROR << "EventLoop::handleRead() reads " << n << " bytes instead of 8"; } } void EventLoop::DoPendingFunctors(void) { std::vector<EventFunctor> functors; // 正在处理回调接口 calling_pending_functors_ = true; { MutexLockGuard lock(mutex_); functors.swap(pending_functors_); } for (const EventFunctor& functor : functors) { functor(); } calling_pending_functors_ = false; } void EventLoop::PrintActiveChannels(void) const { for (const EventChannel* channel : active_channels_) { LOG_TRACE << "{" << channel->ReventsToString() << "}"; } } } // namespace net } // namespace brsdk
26.564576
100
0.681761
JerryYu512
ef056550a0ab7ebcf4496c64f27d7965838047b0
18,690
cc
C++
image_loader.cc
diixo/tensorflow_xla
f5a82ff203670103b6fd81b72682623123724ca1
[ "Apache-2.0" ]
3
2020-08-27T16:40:04.000Z
2021-05-12T13:31:05.000Z
image_loader.cc
diixo/tensorflow_xla
f5a82ff203670103b6fd81b72682623123724ca1
[ "Apache-2.0" ]
null
null
null
image_loader.cc
diixo/tensorflow_xla
f5a82ff203670103b6fd81b72682623123724ca1
[ "Apache-2.0" ]
2
2020-06-09T11:32:27.000Z
2021-04-04T18:41:11.000Z
#include "image_loader.h" namespace xla { std::unique_ptr<xla::Array4D <UChar8> > load_bmp(const std::string& file_name) { std::ifstream fin(file_name.c_str(), std::ios::in | std::ios::binary); if (!fin) { //throw image_load_error("Unable to open " + file_name + " for reading."); return std::unique_ptr<xla::Array4D<UChar8>>(); } unsigned long bytes_read_so_far = 0; using namespace std; streambuf& in = *fin.rdbuf(); // streamsize num; UChar8 buf[100]; std::unique_ptr<xla::Array4D<UChar8>> image = 0; try { BITMAPFILEHEADER header; header.bfType = read_u16(in); header.bfSize = read_u32(in); header.bfReserved1 = read_u16(in); header.bfReserved2 = read_u16(in); header.bfOffBits = read_u32(in); buf[0] = UChar8(header.bfType); buf[1] = UChar8(header.bfType >> 8); bytes_read_so_far += 2; if (buf[0] != 'B' || buf[1] != 'M') { throw image_load_error("bmp load error 2: header error"); } bytes_read_so_far += 12; // finish read BITMAPFILEHEADER // https://ziggi.org/bystryy-negativ-bmp-izobrazheniya-v-cpp/ // if this value isn't zero then there is something wrong // with this bitmap. if (header.bfReserved1 != 0) { throw image_load_error("bmp load error 4: reserved area not zero"); } bytes_read_so_far += 40; /////////////////////////////////// BITMAPINFOHEADER info; info.biSize = read_u32(in); info.biWidth = read_u32(in); info.biHeight = read_u32(in); info.biPlanes = read_u16(in); info.biBitCount = read_u16(in); info.biCompression = read_u32(in); info.biSizeImage = read_u32(in); info.biXPelsPerMeter = read_u32(in); info.biYPelsPerMeter = read_u32(in); info.biClrUsed = read_u32(in); info.biClrImportant = read_u32(in); image = xla::MakeUnique<xla::Array4D<UChar8>>(1, 3, info.biHeight, info.biWidth); switch (info.biBitCount) { case 1: { // figure out how the pixels are packed long padding; if (header.bfSize - header.bfOffBits == static_cast<unsigned int>(info.biWidth*info.biHeight) / 8U) { padding = 0; } else { padding = 4 - ((info.biWidth + 7) / 8) % 4; } const unsigned int palette_size = 2; UChar8 red[palette_size]; UChar8 green[palette_size]; UChar8 blue[palette_size]; for (unsigned int i = 0; i < palette_size; ++i) { if (in.sgetn(reinterpret_cast<char*>(buf), 4) != 4) { throw image_load_error("bmp load error 20: color palette missing"); } bytes_read_so_far += 4; blue[i] = buf[0]; green[i] = buf[1]; red[i] = buf[2]; } // seek to the start of the pixel data while (bytes_read_so_far != header.bfOffBits) { const long to_read = (long)std::min(header.bfOffBits - bytes_read_so_far, (unsigned long)sizeof(buf)); if (in.sgetn(reinterpret_cast<char*>(buf), to_read) != to_read) { throw image_load_error("bmp load error: missing data"); } bytes_read_so_far += to_read; } // load the image data for (int row = info.biHeight - 1; row >= 0; --row) { for (int col = 0; col < info.biWidth; col += 8) { if (in.sgetn(reinterpret_cast<char*>(buf), 1) != 1) { throw image_load_error("bmp load error 21.6: file too short"); } UChar8 pixels[8]; pixels[0] = (buf[0] >> 7); pixels[1] = ((buf[0] >> 6) & 0x01); pixels[2] = ((buf[0] >> 5) & 0x01); pixels[3] = ((buf[0] >> 4) & 0x01); pixels[4] = ((buf[0] >> 3) & 0x01); pixels[5] = ((buf[0] >> 2) & 0x01); pixels[6] = ((buf[0] >> 1) & 0x01); pixels[7] = ((buf[0]) & 0x01); for (int i = 0; i < 8 && col + i < info.biWidth; ++i) { rgb_pixel p; p.red = red[pixels[i]]; p.green = green[pixels[i]]; p.blue = blue[pixels[i]]; (*image)(0, 0, row, col + i) = p.red; (*image)(0, 1, row, col + i) = p.green; (*image)(0, 2, row, col + i) = p.blue; } } if (in.sgetn(reinterpret_cast<char*>(buf), padding) != padding) { throw image_load_error("bmp load error 9: file too short"); } } } break; case 4: { // figure out how the pixels are packed long padding; if (header.bfSize - header.bfOffBits == static_cast<unsigned int>(info.biWidth*info.biHeight) / 2U) { padding = 0; } else { padding = 4 - ((info.biWidth + 1) / 2) % 4; } const int palette_size = 16; UChar8 red[palette_size]; UChar8 green[palette_size]; UChar8 blue[palette_size]; for (int i = 0; i < palette_size; ++i) { if (in.sgetn(reinterpret_cast<char*>(buf), 4) != 4) { throw image_load_error("bmp load error 20: color palette missing"); } bytes_read_so_far += 4; blue[i] = buf[0]; green[i] = buf[1]; red[i] = buf[2]; } // seek to the start of the pixel data while (bytes_read_so_far != header.bfOffBits) { const long to_read = (long)std::min(header.bfOffBits - bytes_read_so_far, (unsigned long)sizeof(buf)); if (in.sgetn(reinterpret_cast<char*>(buf), to_read) != to_read) { throw image_load_error("bmp load error: missing data"); } bytes_read_so_far += to_read; } // load the image data for (int row = info.biHeight - 1; row >= 0; --row) { for (int col = 0; col < info.biWidth; col += 2) { if (in.sgetn(reinterpret_cast<char*>(buf), 1) != 1) { throw image_load_error("bmp load error 21.7: file too short"); } const unsigned char pixel1 = (buf[0] >> 4); const unsigned char pixel2 = (buf[0] & 0x0F); rgb_pixel p; p.red = red[pixel1]; p.green = green[pixel1]; p.blue = blue[pixel1]; (*image)(0, 0, row, col) = p.red; (*image)(0, 1, row, col) = p.green; (*image)(0, 2, row, col) = p.blue; if (col + 1 < info.biWidth) { p.red = red[pixel2]; p.green = green[pixel2]; p.blue = blue[pixel2]; //(*image)(row, col+1) = p; (*image)(0, 0, row, col + 1) = p.red; (*image)(0, 1, row, col + 1) = p.green; (*image)(0, 2, row, col + 1) = p.blue; } } if (in.sgetn(reinterpret_cast<char*>(buf), padding) != padding) throw image_load_error("bmp load error 9: file too short"); } } break; case 8: { // figure out how the pixels are packed int padding = 0; if (header.bfSize - header.bfOffBits == static_cast<unsigned int>(info.biWidth*info.biHeight)) padding = 0; else padding = 4 - info.biWidth % 4; // check for this case. It shouldn't happen but some BMP writers screw up the files // so we have to do this. if (info.biHeight * (info.biWidth + padding) > static_cast<int>(header.bfSize - header.bfOffBits)) padding = 0; const unsigned int palette_size = 256; UChar8 red[palette_size]; UChar8 green[palette_size]; UChar8 blue[palette_size]; for (unsigned int i = 0; i < palette_size; ++i) { if (in.sgetn(reinterpret_cast<char*>(buf), 4) != 4) { throw image_load_error("bmp load error 20: color palette missing"); } bytes_read_so_far += 4; blue[i] = buf[0]; green[i] = buf[1]; red[i] = buf[2]; } // seek to the start of the pixel data while (bytes_read_so_far != header.bfOffBits) { const long to_read = (long)std::min(header.bfOffBits - bytes_read_so_far, (unsigned long)sizeof(buf)); if (in.sgetn(reinterpret_cast<char*>(buf), to_read) != to_read) { throw image_load_error("bmp load error: missing data"); } bytes_read_so_far += to_read; } // Next we load the image data. // if there is no RLE compression if (info.biCompression == 0) { for (long row = info.biHeight - 1; row >= 0; --row) { for (/*unsigned long*/ int col = 0; col < info.biWidth; ++col) { if (in.sgetn(reinterpret_cast<char*>(buf), 1) != 1) { throw image_load_error("bmp load error 21.8: file too short"); } rgb_pixel p; p.red = red[buf[0]]; p.green = green[buf[0]]; p.blue = blue[buf[0]]; //(*image)(row, col) = p; (*image)(0, 0, row, col) = p.red; (*image)(0, 1, row, col) = p.green; (*image)(0, 2, row, col) = p.blue; } if (in.sgetn(reinterpret_cast<char*>(buf), padding) != padding) { throw image_load_error("bmp load error 9: file too short"); } } } else { // Here we deal with the psychotic RLE used by BMP files. // First zero the image since the RLE sometimes jumps over // pixels and assumes the image has been zero initialized. //assign_all_pixels(image, 0); long row = info.biHeight - 1; long col = 0; while (true) { if (in.sgetn(reinterpret_cast<char*>(buf), 2) != 2) { throw image_load_error("bmp load error 21.9: file too short"); } const unsigned char count = buf[0]; const unsigned char command = buf[1]; if (count == 0 && command == 0) { // This is an escape code that means go to the next row // of the image --row; col = 0; continue; } else if (count == 0 && command == 1) { // This is the end of the image. So quit this loop. break; } else if (count == 0 && command == 2) { // This is the escape code for the command to jump to // a new part of the image relative to where we are now. if (in.sgetn(reinterpret_cast<char*>(buf), 2) != 2) { throw image_load_error("bmp load error 21.1: file too short"); } col += buf[0]; row -= buf[1]; continue; } else if (count == 0) { // This is the escape code for a run of uncompressed bytes if (row < 0 || col + command > image->width()) { // If this is just some padding bytes at the end then ignore them if (row >= 0 && col + count <= image->width() + padding) continue; throw image_load_error("bmp load error 21.2: file data corrupt"); } // put the bytes into the image for (unsigned int i = 0; i < command; ++i) { if (in.sgetn(reinterpret_cast<char*>(buf), 1) != 1) { throw image_load_error("bmp load error 21.3: file too short"); } rgb_pixel p; p.red = red[buf[0]]; p.green = green[buf[0]]; p.blue = blue[buf[0]]; (*image)(0, 0, row, col) = p.red; (*image)(0, 1, row, col) = p.green; (*image)(0, 2, row, col) = p.blue; ++col; } // if we read an uneven number of bytes then we need to read and // discard the next byte. if ((command & 1) != 1) { if (in.sgetn(reinterpret_cast<char*>(buf), 1) != 1) { throw image_load_error("bmp load error 21.4: file too short"); } } continue; } rgb_pixel p; if (row < 0 || col + count > image->width()) { // If this is just some padding bytes at the end then ignore them if (row >= 0 && col + count <= image->width() + padding) { continue; } throw image_load_error("bmp load error 21.5: file data corrupt"); } // put the bytes into the image for (unsigned int i = 0; i < count; ++i) { p.red = red[command]; p.green = green[command]; p.blue = blue[command]; (*image)(0, 0, row, col) = p.red; (*image)(0, 1, row, col) = p.green; (*image)(0, 2, row, col) = p.blue; ++col; } } } } break; case 16: throw image_load_error("16 bit BMP images not supported"); case 24: // { // figure out how the pixels are packed long padding; if (header.bfSize - header.bfOffBits == static_cast<unsigned int>(info.biWidth * info.biHeight) * 3U) { padding = 0; } else { padding = 4 - (info.biWidth * 3) % 4; } // check for this case. It shouldn't happen but some BMP writers screw up the files // so we have to do this. if (info.biHeight * (info.biWidth * 3 + padding) > static_cast<int>(header.bfSize - header.bfOffBits)) { padding = 0; } // seek to the start of the pixel data while (bytes_read_so_far != header.bfOffBits) { const long to_read = (long)std::min(header.bfOffBits - bytes_read_so_far, (unsigned long)sizeof(buf)); if (in.sgetn(reinterpret_cast<char*>(buf), to_read) != to_read) { throw image_load_error("bmp load error: missing data"); } bytes_read_so_far += to_read; } // load the image data for (int row = info.biHeight - 1; row >= 0; --row) { for (int col = 0; col < info.biWidth; ++col) { if (in.sgetn(reinterpret_cast<char*>(buf), 3) != 3) { throw image_load_error("bmp load error 8: file too short"); } rgb_pixel p; p.red = buf[2]; p.green = buf[1]; p.blue = buf[0]; (*image)(0, 2, row, col) = p.red; (*image)(0, 1, row, col) = p.green; (*image)(0, 0, row, col) = p.blue; } if (padding > 0) { if (in.sgetn(reinterpret_cast<char*>(buf), padding) != padding) { throw image_load_error("bmp load error 9: file too short"); } } } break; } case 32: throw image_load_error("32 bit BMP images not supported"); default: throw image_load_error("bmp load error 10: unknown color depth"); } } catch (...) { //image.clear(); throw; } return image; } } // ns
36.15087
118
0.410166
diixo
ef0622b20e496e86c2657c671f4659318a2e420b
447
cc
C++
src/plugin/compute/cpu/src/memoryhost.cc
bugengine/BugEngine
1b3831d494ee06b0bd74a8227c939dd774b91226
[ "BSD-3-Clause" ]
4
2015-05-13T16:28:36.000Z
2017-05-24T15:34:14.000Z
src/plugin/compute/cpu/src/memoryhost.cc
bugengine/BugEngine
1b3831d494ee06b0bd74a8227c939dd774b91226
[ "BSD-3-Clause" ]
null
null
null
src/plugin/compute/cpu/src/memoryhost.cc
bugengine/BugEngine
1b3831d494ee06b0bd74a8227c939dd774b91226
[ "BSD-3-Clause" ]
1
2017-03-21T08:28:07.000Z
2017-03-21T08:28:07.000Z
/* BugEngine <bugengine.devel@gmail.com> see LICENSE for detail */ #include <bugengine/plugin.compute.cpu/stdafx.h> #include <memoryhost.hh> namespace BugEngine { namespace KernelScheduler { namespace CPU { MemoryHost::MemoryHost() : IMemoryHost("CPU") { } MemoryHost::~MemoryHost() { } void MemoryHost::release(weak< KernelScheduler::IMemoryBuffer > buffer) { be_forceuse(buffer); } }}} // namespace BugEngine::KernelScheduler::CPU
19.434783
71
0.733781
bugengine
ef0980024b906ff33de021901b826b70145eefa1
10,039
cpp
C++
oneflow/user/ops/nccl_logical_ops.cpp
mosout/oneflow
afbb221d900f1a340568ae2462b2022f8fcc4b3d
[ "Apache-2.0" ]
1
2022-01-19T07:50:28.000Z
2022-01-19T07:50:28.000Z
oneflow/user/ops/nccl_logical_ops.cpp
mosout/oneflow
afbb221d900f1a340568ae2462b2022f8fcc4b3d
[ "Apache-2.0" ]
null
null
null
oneflow/user/ops/nccl_logical_ops.cpp
mosout/oneflow
afbb221d900f1a340568ae2462b2022f8fcc4b3d
[ "Apache-2.0" ]
null
null
null
/* Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "oneflow/core/framework/framework.h" #include "oneflow/core/operator/operator.h" #include "oneflow/user/ops/comm_net_device_infer_util.h" #include "oneflow/core/framework/op_generated.h" namespace oneflow { /* static */ Maybe<void> _ncclLogicalAllReduceOp::InferLogicalTensorDesc( user_op::InferContext* ctx) { *ctx->OutputShape("out", 0) = ctx->InputShape("in", 0); *ctx->OutputIsDynamic("out", 0) = ctx->InputIsDynamic("in", 0); return Maybe<void>::Ok(); } /* static */ Maybe<void> _ncclLogicalAllReduceOp::GetSbp(user_op::SbpContext* ctx) { return user_op::GetSbpFnUtil::DefaultBroadcastToBroadcast(ctx); } /* static */ Maybe<void> _ncclLogicalAllReduceOp::InferNdSbp(user_op::InferNdSbpFnContext* ctx) { const cfg::NdSbp& in_dis_hint = ctx->NdSbpHint4InputArgNameAndIndex("in", 0); cfg::NdSbp* in_distribution = ctx->NdSbp4ArgNameAndIndex("in", 0); cfg::NdSbp* out_distribution = ctx->NdSbp4ArgNameAndIndex("out", 0); CHECK_GE_OR_RETURN(in_dis_hint.sbp_parallel_size(), 1); for (const auto& sbp_hint : in_dis_hint.sbp_parallel()) { CHECK_OR_RETURN(sbp_hint.has_partial_sum_parallel()); } in_distribution->clear_sbp_parallel(); out_distribution->clear_sbp_parallel(); // P2B const Shape& parallel_hierarchy = ctx->parallel_hierarchy(); CHECK_GE_OR_RETURN(parallel_hierarchy.NumAxes(), 1); for (int32_t i = 0; i < parallel_hierarchy.NumAxes(); ++i) { in_distribution->add_sbp_parallel()->mutable_partial_sum_parallel(); out_distribution->add_sbp_parallel()->mutable_broadcast_parallel(); } return Maybe<void>::Ok(); } /* static */ Maybe<void> _ncclLogicalAllReduceOp::InferDataType(user_op::InferContext* ctx) { *ctx->OutputDType("out", 0) = ctx->InputDType("in", 0); return Maybe<void>::Ok(); } /* static */ Maybe<Symbol<Device>> _ncclLogicalAllReduceOp::InferDevice( user_op::DeviceInferContext* ctx) { return DeviceInferFn<&SyncLaunched>(ctx); } /* static */ Maybe<void> _ncclLogicalReduceScatterOp::InferLogicalTensorDesc( user_op::InferContext* ctx) { *ctx->OutputShape("out", 0) = ctx->InputShape("in", 0); *ctx->OutputIsDynamic("out", 0) = ctx->InputIsDynamic("in", 0); return Maybe<void>::Ok(); } /* static */ Maybe<void> _ncclLogicalReduceScatterOp::GetSbp(user_op::SbpContext* ctx) { return user_op::GetSbpFnUtil::DefaultBroadcastToBroadcast(ctx); } /* static */ Maybe<void> _ncclLogicalReduceScatterOp::InferNdSbp( user_op::InferNdSbpFnContext* ctx) { const cfg::NdSbp& in_dis_hint = ctx->NdSbpHint4InputArgNameAndIndex("in", 0); cfg::NdSbp* in_distribution = ctx->NdSbp4ArgNameAndIndex("in", 0); cfg::NdSbp* out_distribution = ctx->NdSbp4ArgNameAndIndex("out", 0); CHECK_GE_OR_RETURN(in_dis_hint.sbp_parallel_size(), 1); for (const auto& sbp_hint : in_dis_hint.sbp_parallel()) { CHECK_OR_RETURN(sbp_hint.has_partial_sum_parallel()); } in_distribution->clear_sbp_parallel(); out_distribution->clear_sbp_parallel(); // P2S const Shape& parallel_hierarchy = ctx->parallel_hierarchy(); CHECK_GE_OR_RETURN(parallel_hierarchy.NumAxes(), 1); for (int32_t i = 0; i < parallel_hierarchy.NumAxes(); ++i) { in_distribution->add_sbp_parallel()->mutable_partial_sum_parallel(); out_distribution->add_sbp_parallel()->mutable_split_parallel()->set_axis(0); } return Maybe<void>::Ok(); } /* static */ Maybe<void> _ncclLogicalReduceScatterOp::InferDataType(user_op::InferContext* ctx) { *ctx->OutputDType("out", 0) = ctx->InputDType("in", 0); return Maybe<void>::Ok(); } /* static */ Maybe<Symbol<Device>> _ncclLogicalReduceScatterOp::InferDevice( user_op::DeviceInferContext* ctx) { return DeviceInferFn<&SyncLaunched>(ctx); } /* static */ Maybe<void> _ncclLogicalAllGatherOp::InferLogicalTensorDesc( user_op::InferContext* ctx) { *ctx->OutputShape("out", 0) = ctx->InputShape("in", 0); *ctx->OutputIsDynamic("out", 0) = ctx->InputIsDynamic("in", 0); return Maybe<void>::Ok(); } /* static */ Maybe<void> _ncclLogicalAllGatherOp::GetSbp(user_op::SbpContext* ctx) { return user_op::GetSbpFnUtil::DefaultBroadcastToBroadcast(ctx); } /* static */ Maybe<void> _ncclLogicalAllGatherOp::InferNdSbp(user_op::InferNdSbpFnContext* ctx) { const cfg::NdSbp& in_dis_hint = ctx->NdSbpHint4InputArgNameAndIndex("in", 0); cfg::NdSbp* in_distribution = ctx->NdSbp4ArgNameAndIndex("in", 0); cfg::NdSbp* out_distribution = ctx->NdSbp4ArgNameAndIndex("out", 0); CHECK_GE_OR_RETURN(in_dis_hint.sbp_parallel_size(), 1); for (const auto& sbp_hint : in_dis_hint.sbp_parallel()) { CHECK_OR_RETURN(sbp_hint.has_split_parallel()); CHECK_EQ_OR_RETURN(sbp_hint.split_parallel().axis(), 0); } in_distribution->clear_sbp_parallel(); out_distribution->clear_sbp_parallel(); // S(0)->B const Shape& parallel_hierarchy = ctx->parallel_hierarchy(); CHECK_GE_OR_RETURN(parallel_hierarchy.NumAxes(), 1); for (int32_t i = 0; i < parallel_hierarchy.NumAxes(); ++i) { in_distribution->add_sbp_parallel()->mutable_split_parallel()->set_axis(0); out_distribution->add_sbp_parallel()->mutable_broadcast_parallel(); } return Maybe<void>::Ok(); } /* static */ Maybe<void> _ncclLogicalAllGatherOp::InferDataType(user_op::InferContext* ctx) { *ctx->OutputDType("out", 0) = ctx->InputDType("in", 0); return Maybe<void>::Ok(); } /* static */ Maybe<Symbol<Device>> _ncclLogicalAllGatherOp::InferDevice( user_op::DeviceInferContext* ctx) { return DeviceInferFn<&SyncLaunched>(ctx); } /* static */ Maybe<void> _ncclLogicalAllGatherNoncontinuousOp::InferLogicalTensorDesc( user_op::InferContext* ctx) { *ctx->OutputShape("out", 0) = ctx->InputShape("in", 0); *ctx->OutputIsDynamic("out", 0) = ctx->InputIsDynamic("in", 0); return Maybe<void>::Ok(); } /* static */ Maybe<void> _ncclLogicalAllGatherNoncontinuousOp::GetSbp(user_op::SbpContext* ctx) { return user_op::GetSbpFnUtil::DefaultBroadcastToBroadcast(ctx); } /* static */ Maybe<void> _ncclLogicalAllGatherNoncontinuousOp::InferNdSbp( user_op::InferNdSbpFnContext* ctx) { const cfg::NdSbp& in_dis_hint = ctx->NdSbpHint4InputArgNameAndIndex("in", 0); CHECK_GE_OR_RETURN(in_dis_hint.sbp_parallel_size(), 1); const int64_t in_split_axis = ctx->user_op_conf().attr<int64_t>("in_split_axis"); CHECK_GE_OR_RETURN(in_split_axis, 1); for (const auto& sbp_hint : in_dis_hint.sbp_parallel()) { CHECK_OR_RETURN(sbp_hint.has_split_parallel()); CHECK_EQ_OR_RETURN(sbp_hint.split_parallel().axis(), in_split_axis); } cfg::NdSbp* in_distribution = ctx->NdSbp4ArgNameAndIndex("in", 0); cfg::NdSbp* out_distribution = ctx->NdSbp4ArgNameAndIndex("out", 0); in_distribution->clear_sbp_parallel(); out_distribution->clear_sbp_parallel(); // S(1)->(B) const Shape& parallel_hierarchy = ctx->parallel_hierarchy(); CHECK_GE_OR_RETURN(parallel_hierarchy.NumAxes(), 1); for (int32_t i = 0; i < parallel_hierarchy.NumAxes(); ++i) { in_distribution->add_sbp_parallel()->mutable_split_parallel()->set_axis(in_split_axis); out_distribution->add_sbp_parallel()->mutable_broadcast_parallel(); } return Maybe<void>::Ok(); } /* static */ Maybe<void> _ncclLogicalAllGatherNoncontinuousOp::InferDataType( user_op::InferContext* ctx) { *ctx->OutputDType("out", 0) = ctx->InputDType("in", 0); return Maybe<void>::Ok(); } /* static */ Maybe<Symbol<Device>> _ncclLogicalAllGatherNoncontinuousOp::InferDevice( user_op::DeviceInferContext* ctx) { return DeviceInferFn<&SyncLaunched>(ctx); } /* static */ Maybe<void> _ncclLogicalS2sOp::InferLogicalTensorDesc(user_op::InferContext* ctx) { *ctx->OutputShape("out", 0) = ctx->InputShape("in", 0); *ctx->OutputIsDynamic("out", 0) = ctx->InputIsDynamic("in", 0); return Maybe<void>::Ok(); } /* static */ Maybe<void> _ncclLogicalS2sOp::GetSbp(user_op::SbpContext* ctx) { return user_op::GetSbpFnUtil::DefaultBroadcastToBroadcast(ctx); } /* static */ Maybe<void> _ncclLogicalS2sOp::InferNdSbp(user_op::InferNdSbpFnContext* ctx) { const int64_t in_split_axis = ctx->user_op_conf().attr<int64_t>("in_split_axis"); const int64_t out_split_axis = ctx->user_op_conf().attr<int64_t>("out_split_axis"); const cfg::NdSbp& in_dis_hint = ctx->NdSbpHint4InputArgNameAndIndex("in", 0); cfg::NdSbp* in_distribution = ctx->NdSbp4ArgNameAndIndex("in", 0); cfg::NdSbp* out_distribution = ctx->NdSbp4ArgNameAndIndex("out", 0); CHECK_GE_OR_RETURN(in_dis_hint.sbp_parallel_size(), 1); for (const auto& sbp_hint : in_dis_hint.sbp_parallel()) { CHECK_OR_RETURN(sbp_hint.has_split_parallel()); CHECK_EQ_OR_RETURN(sbp_hint.split_parallel().axis(), in_split_axis); } in_distribution->clear_sbp_parallel(); out_distribution->clear_sbp_parallel(); // S(in)->S(out) const Shape& parallel_hierarchy = ctx->parallel_hierarchy(); CHECK_GE_OR_RETURN(parallel_hierarchy.NumAxes(), 1); for (int32_t i = 0; i < parallel_hierarchy.NumAxes(); ++i) { in_distribution->add_sbp_parallel()->mutable_split_parallel()->set_axis(in_split_axis); out_distribution->add_sbp_parallel()->mutable_split_parallel()->set_axis(out_split_axis); } return Maybe<void>::Ok(); } /* static */ Maybe<void> _ncclLogicalS2sOp::InferDataType(user_op::InferContext* ctx) { *ctx->OutputDType("out", 0) = ctx->InputDType("in", 0); return Maybe<void>::Ok(); } /* static */ Maybe<Symbol<Device>> _ncclLogicalS2sOp::InferDevice( user_op::DeviceInferContext* ctx) { return DeviceInferFn<&SyncLaunched>(ctx); } } // namespace oneflow
40.479839
97
0.735332
mosout
ef0ab296eec650c9b29211f50170745b67f18cbf
3,003
cc
C++
tools/json_schema_compiler/test/additional_properties_unittest.cc
1065672644894730302/Chromium
239dd49e906be4909e293d8991e998c9816eaa35
[ "BSD-3-Clause" ]
1
2019-04-23T15:57:04.000Z
2019-04-23T15:57:04.000Z
tools/json_schema_compiler/test/additional_properties_unittest.cc
1065672644894730302/Chromium
239dd49e906be4909e293d8991e998c9816eaa35
[ "BSD-3-Clause" ]
null
null
null
tools/json_schema_compiler/test/additional_properties_unittest.cc
1065672644894730302/Chromium
239dd49e906be4909e293d8991e998c9816eaa35
[ "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "tools/json_schema_compiler/test/additional_properties.h" #include "testing/gtest/include/gtest/gtest.h" using namespace test::api::additional_properties; TEST(JsonSchemaCompilerAdditionalPropertiesTest, AdditionalPropertiesTypePopulate) { { scoped_ptr<ListValue> list_value(new ListValue()); list_value->Append(Value::CreateStringValue("asdf")); list_value->Append(Value::CreateIntegerValue(4)); scoped_ptr<DictionaryValue> type_value(new DictionaryValue()); type_value->SetString("string", "value"); type_value->SetInteger("other", 9); type_value->Set("another", list_value.release()); scoped_ptr<AdditionalPropertiesType> type(new AdditionalPropertiesType()); EXPECT_TRUE(AdditionalPropertiesType::Populate(*type_value, type.get())); EXPECT_EQ("value", type->string); EXPECT_TRUE(type_value->Remove("string", NULL)); EXPECT_TRUE(type->additional_properties.Equals(type_value.get())); } { scoped_ptr<DictionaryValue> type_value(new DictionaryValue()); type_value->SetInteger("string", 3); scoped_ptr<AdditionalPropertiesType> type(new AdditionalPropertiesType()); EXPECT_FALSE(AdditionalPropertiesType::Populate(*type_value, type.get())); } } TEST(JsonSchemaCompilerAdditionalPropertiesTest, AdditionalPropertiesParamsCreate) { scoped_ptr<DictionaryValue> param_object_value(new DictionaryValue()); param_object_value->SetString("str", "a"); param_object_value->SetInteger("num", 1); scoped_ptr<ListValue> params_value(new ListValue()); params_value->Append(param_object_value->DeepCopy()); scoped_ptr<AdditionalProperties::Params> params( AdditionalProperties::Params::Create(*params_value)); EXPECT_TRUE(params.get()); EXPECT_TRUE(params->param_object.additional_properties.Equals( param_object_value.get())); } TEST(JsonSchemaCompilerAdditionalPropertiesTest, ReturnAdditionalPropertiesResultCreate) { scoped_ptr<DictionaryValue> result_object_value(new DictionaryValue()); result_object_value->SetString("key", "value"); scoped_ptr<ReturnAdditionalProperties::Result::ResultObject> result_object( new ReturnAdditionalProperties::Result::ResultObject()); result_object->integer = 5; result_object->additional_properties.MergeDictionary( result_object_value.get()); scoped_ptr<Value> result( ReturnAdditionalProperties::Result::Create(*result_object)); DictionaryValue* result_dict = NULL; EXPECT_TRUE(result->GetAsDictionary(&result_dict)); Value* int_temp_value_out = NULL; int int_temp = 0; EXPECT_TRUE(result_dict->Remove("integer", &int_temp_value_out)); scoped_ptr<Value> int_temp_value(int_temp_value_out); EXPECT_TRUE(int_temp_value->GetAsInteger(&int_temp)); EXPECT_EQ(5, int_temp); EXPECT_TRUE(result_dict->Equals(result_object_value.get())); }
41.708333
78
0.770563
1065672644894730302
ef12cb8c58d72f8b5244d7669f6853461dfbeb1e
12,963
cpp
C++
http_parser.cpp
patrickmoffitt/ble_sensor_cgi
25f00060f4ab5f1b27eb3924253d41f38b9a9094
[ "MIT" ]
1
2020-09-04T22:14:41.000Z
2020-09-04T22:14:41.000Z
http_parser.cpp
patrickmoffitt/ble_sensor_cgi
25f00060f4ab5f1b27eb3924253d41f38b9a9094
[ "MIT" ]
null
null
null
http_parser.cpp
patrickmoffitt/ble_sensor_cgi
25f00060f4ab5f1b27eb3924253d41f38b9a9094
[ "MIT" ]
null
null
null
// /* Copyright (c) 2020 Patrick Moffitt 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 "http_parser.hpp" /** * A class for parsing the stdin passed to us by the CGI web server. * * Note that the order of operations is dependent. * * @param env_ptr The web server CGI shell environment passed into main() * and parsed into Http_io::env */ Http_parser::Http_parser(map<string, string> &env_ptr) { env = env_ptr; curl = curl_easy_init(); parse_raw_content_type(); parse_query_string(); parse_multipart_form(); parse_json(); } Http_parser::~Http_parser() { curl_easy_cleanup(curl); } /** * Sets Http_parser::content_type, Http_parser::boundary, Http_parser::charset from * values found in the raw HTTP Content-Type header. */ void Http_parser::parse_raw_content_type() { content_type = env["content_type"]; const string mime_type{"multipart/form-data"}; if (content_type.compare(0, mime_type.length(), mime_type) != 0) return; ///< No boundary or charset to parse. smatch match; regex_search(env["content_type"], match, content_type_regex); if (not match.empty()) { content_type = match[1]; auto pair = su.explode(match[2].str(), "="); if (!pair.empty()) { if ( pair.at(0) == "boundary" ) { boundary = "--" + pair.at(1) + cr_nl; } if ( pair.at(0) == "charset" ) { charset = pair.at(1); } } } else { DEBUG(env["script_name"].c_str(), " parse_raw_content_type() Error, No match found in: (", env["content_type"].c_str(), ")"); } } /** * Sets Http_parser::get from values found in the raw HTTP query string. */ void Http_parser::parse_query_string() { if (env["query_string"].empty()) return; int result_len; char *result = curl_easy_unescape(curl, env["query_string"].c_str(), 0, &result_len); string query(result); curl_free(result); if (query.empty()) return; auto pairs = su.explode(&query, "&"); for (auto p: pairs) { auto pair = su.explode(&p, "="); if (not pair[0].empty() && not pair[1].empty()) { get[pair[0]].emplace_back(pair[1]); } } } /** * Parse an HTTP message body in JSON format. * * Stores key:value pairs in Http_parser::post and Http_parser::file objects. */ void Http_parser::parse_json() { if (content_type != "application/json" or env["body"].empty()) return; using namespace jsonxx; Object json; ///< jsonxx::Settings; Parser = Strict, Assertions = Disabled. bool r = json.parse(env["body"]); if (not r) { DEBUG("JSON parser failed."); return; } if (not json.has<Array>("body")) { DEBUG("JSON object is missing the \"body\" array."); return; } auto& body = json.get<Array>("body"); for (int i=0; i < body.size(); i++) { if (not body.has<Object>(i)) { DEBUG("JSON object has an empty \"body\" array."); break; } auto& item = body.get<Object>(i); // Put string values in Http_parser::post if (item.size() == 2 and item.has<String>("value")) { string name; for (auto &pair: item.kv_map()) { if (pair.first == "name" and pair.second->is<String>()) { name = pair.second->get<String>(); auto search = post.find(name); if (search == post.end()) { post[name] = vector<string>{}; } } if (pair.first == "value" and not name.empty() and pair.second->is<String>()) { auto& value = pair.second->get<String>(); post[name].emplace_back(value); } } } // Put array values in Http_parser::post if (item.size() == 2 and item.has<Array>("value")) { auto it = item.kv_map().begin(); string name; if (it->first == "name" and it->second->is<String>()) { name = it->second->get<String>(); auto search = post.find(name); if (search == post.end()) { post[name] = vector<string>{}; } } it++; if (not name.empty() and it->first == "value" and it->second->is<Array>()) { auto a = it->second->get<Array>().values(); for (auto & j : a) { auto &value = j->get<String>(); post[name].emplace_back(value); } } } // Emplace into Http_parser::file if (item.size() == 4 and item.has<String>("name") and item.has<Number>("frames") and item.has<String>("content_type") and item.has<String>("value")) { auto& key = item.get<String>("name"); auto& frames = item.get<Number>("frames"); auto& mime = item.get<String>("content_type"); auto& value = item.get<String>("value"); string ext{".jpg"}; // Single frame JPEG data. if (frames > 0) ext = ".avi"; // Multiple frame MJPEG data. string filename = to_string(time(nullptr)) + ext; file[key].emplace_back(map<string, string>{ {"filename", filename}, {"frames", to_string(int(frames))}, {"type", mime}, {"value", move(value)} }); } } } /** * Parse an HTTP message body in multipart/form-data format. * * Stores key:value pairs in Http_parser::post and file objects * in Http_parser::file. */ void Http_parser::parse_multipart_form() { if (content_type != "multipart/form-data" or boundary.empty() or env["body"].empty()) return; smatch match; vector<string> output{}; string raw_body = env["body"].substr(0, env["body"].rfind("--")); su.explode(&raw_body, boundary, &output); for (auto s: output) { if (s.empty()) continue; map<string, string> data; if (s.find("filename=") != string::npos) { // Item is a file field. int eol_1 = s.find(cr_nl, 0); // end of line (eol). int line2_start = eol_1 + cr_nl_s; int eol_2 = s.find(cr_nl_2, line2_start); // Extra cr_nl consumes empty line3. int line2_length = eol_2 - line2_start; int line4_start = eol_2 + cr_nl_2s; int eol_4 = s.size() - cr_nl_s; int line4_length = eol_4 - line4_start; string line1 = s.substr(0, eol_1); string line2 = s.substr(line2_start, line2_length); string line4 = s.substr(line4_start, line4_length); regex_search(line1, match, multipart_form_file_l1); string key = match[1]; string filename{}; string mime{}; if (match.size() == 3) filename = match[2]; regex_search(line2, match, multipart_form_file_l2); if (match.size() == 2) mime = match[1]; if (not filename.empty() and not mime.empty() and not line4.empty()) { file[key].emplace_back(map<string, string>{ {"filename", filename}, {"type", mime}, {"value", line4} }); } } else { // Item is a data field. int eol_1 = s.find(cr_nl_2, 0); // Extra cr_nl consumes empty line 2. int line3_start = eol_1 + cr_nl_2s; int eol_3 = s.find(cr_nl, line3_start); int line3_length = eol_3 - line3_start; string line1 = s.substr(0, eol_1); string line3 = s.substr(line3_start, line3_length); regex_search(s, match, multipart_form_data); if (match.size() == 2) { auto search = post.find(match[1]); if (search != post.end()) { post[match[1]].emplace_back(line3); } else { post[match[1]] = vector<string>{line3}; } } } } } /** * Dump all the data structures (optionally in hex_dump format) to any stream. * Calls Http_io::print_env, Http_parser::print_file, Http_parser::print_post, and * Http_parser::print_get. * * @param o_stream The stream to print the output to; stdout or a file typically. * @param io Additional data to print. * @param hex_dump whether to print in hex_dump format. */ void Http_parser::print_all(ostream &o_stream, http_io &io, bool hex_dump) { o_stream << "Locale: " << io.locale << endl; o_stream << "TLS enabled: " << boolalpha << io.https << endl; o_stream << "Content type: " << content_type << endl; o_stream << "Multipart form boundary: " << boundary << endl; o_stream << "Character set: " << charset << endl; io.print_env(o_stream); o_stream << endl; print_file(o_stream, hex_dump); o_stream << endl; print_post(o_stream, hex_dump); o_stream << endl; print_get(o_stream, hex_dump); o_stream << endl; if (hex_dump) { o_stream << "Body in hex: " << endl; hex_dump::string(io.env["body"], o_stream); } io.header["Status-Message"] = "Http_parser::print_all output."; io.respond(dynamic_cast<ostringstream &>(o_stream), 200); } /** * Dump Http_parser::file (optionally in hex_dump format) to any stream. * * @param o_stream The stream to print the output to; stdout or a file typically. * @param hex_dump whether to print in hex_dump format. */ void Http_parser::print_file(ostream &o_stream, bool hex_dump) { o_stream << "Http_parser::file" << endl; for (const auto& key: file) { o_stream << key.first << ": " << endl; for (const auto& v: key.second) { // v for vector. for (const auto& m: v) { // m for map. if (hex_dump) { o_stream << m.first << ": " << endl; hex_dump::string(m.second, o_stream); } else { o_stream << " " << m.first << ": " << m.second; } o_stream << endl; } } o_stream << endl; } } /** * Dump Http_parser::get (optionally in hex_dump format) to any stream. * * @param o_stream The stream to print the output to; stdout or a file typically. * @param hex_dump whether to print in hex_dump format. */ void Http_parser::print_get(ostream &o_stream, bool hex_dump) { o_stream << "Http_parser::get" << endl; for (const auto& key: get) { o_stream << key.first << ": " << endl; for (const auto& value: key.second) { if (hex_dump) { hex_dump::string(value, o_stream); } else { o_stream << " " << value << ", "; } } o_stream << endl << endl; } } /** * Dump Http_parser::post (optionally in hex_dump format) to any stream. * * @param o_stream The stream to print the output to; stdout or a file typically. * @param hex_dump whether to print in hex_dump format. */ void Http_parser::print_post(ostream &o_stream, bool hex_dump) { o_stream << "Http_parser::post" << endl; for (const auto& key: post) { o_stream << key.first << ": " << endl; for (const auto& value: key.second) { if (hex_dump) { hex_dump::string(value, o_stream); } else { o_stream << " " << value << ", "; } } o_stream << endl << endl; } }
36.310924
90
0.54887
patrickmoffitt
ef1740eaadc446c62f1b35e5919b6031f8113063
5,213
cpp
C++
plugins/gui/src/code_editor/code_editor_minimap.cpp
emsec/HAL
608e801896e1b5254b28ce0f29d4d898b81b0f77
[ "MIT" ]
407
2019-04-26T10:45:52.000Z
2022-03-31T15:52:30.000Z
plugins/gui/src/code_editor/code_editor_minimap.cpp
emsec/HAL
608e801896e1b5254b28ce0f29d4d898b81b0f77
[ "MIT" ]
219
2019-04-29T16:42:01.000Z
2022-03-11T22:57:41.000Z
plugins/gui/src/code_editor/code_editor_minimap.cpp
emsec/HAL
608e801896e1b5254b28ce0f29d4d898b81b0f77
[ "MIT" ]
53
2019-05-02T21:23:35.000Z
2022-03-11T19:46:05.000Z
#include "gui/code_editor/code_editor_minimap.h" #include "gui/code_editor/code_editor.h" #include "gui/code_editor/minimap_scrollbar.h" #include <QPainter> #include <QStyleOption> #include <QTextBlock> #include <cmath> #include <math.h> #include <QDebug> namespace hal { CodeEditorMinimap::CodeEditorMinimap(CodeEditor* editor) : QWidget(editor), mEditor(editor), mDocument(new QTextDocument()), mScrollbar(new MinimapScrollbar(this)), mDocumentHeight(0), mOffset(0) { connect(mEditor->document(), &QTextDocument::contentsChange, this, &CodeEditorMinimap::handleContentsChange); connect(mDocument->documentLayout(), &QAbstractTextDocumentLayout::documentSizeChanged, this, &CodeEditorMinimap::handleDocumentSizeChanged); mDocument->setDocumentMargin(0); mScrollbar->show(); repolish(); } MinimapScrollbar* CodeEditorMinimap::scrollbar() { return mScrollbar; } QTextDocument* CodeEditorMinimap::document() { return mDocument; } void CodeEditorMinimap::adjustSliderHeight(int viewport_height) { Q_UNUSED(viewport_height); qDebug() << "editor " << mEditor->document()->documentLayout()->documentSize().height(); qDebug() << "mini " << mDocument->documentLayout()->documentSize().height(); qreal ratio = mEditor->document()->documentLayout()->documentSize().height() / mDocument->documentLayout()->documentSize().height(); // UNEXPECTED RESULT, MAKES NO SENSE mScrollbar->setSliderHeight(std::round(mEditor->viewport()->contentsRect().height() * ratio)); } void CodeEditorMinimap::adjustSliderHeight(qreal ratio) { mScrollbar->setSliderHeight(std::round(ratio * mDocument->documentLayout()->blockBoundingRect(mDocument->firstBlock()).height())); resizeScrollbar(); } void CodeEditorMinimap::adjustSliderHeight(int first_visible_block, int last_visible_block) { qDebug() << "first block: " + QString::number(first_visible_block); qDebug() << "last block: " + QString::number(last_visible_block); qreal top = mDocument->documentLayout()->blockBoundingRect(mDocument->findBlockByNumber(first_visible_block)).top(); qreal bottom = mDocument->documentLayout()->blockBoundingRect(mDocument->findBlockByNumber(last_visible_block)).bottom(); qDebug() << "top: " + QString::number(top); qDebug() << "bottom: " + QString::number(bottom); mScrollbar->setSliderHeight(std::round(bottom - top)); } void CodeEditorMinimap::handleDocumentSizeChanged(const QSizeF& new_size) { mDocumentHeight = std::ceil(new_size.height()); resizeScrollbar(); } void CodeEditorMinimap::handleContentsChange(int position, int chars_removed, int chars_added) { QTextCursor cursor = QTextCursor(mDocument); cursor.setPosition(position); if (chars_removed) { cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, chars_removed); cursor.removeSelectedText(); } if (chars_added) cursor.insertText(mEditor->document()->toPlainText().mid(position, chars_added)); } void CodeEditorMinimap::paintEvent(QPaintEvent* event) { Q_UNUSED(event) QStyleOption opt; opt.init(this); QPainter painter(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this); painter.setClipping(true); painter.setClipRect(rect()); QAbstractTextDocumentLayout::PaintContext ctx; ctx.palette.setColor(QPalette::Text, palette().text().color()); if (mDocumentHeight > height()) { int block_number = mEditor->first_visible_block(); int sliderPosition = mScrollbar->sliderPosition(); mOffset = mDocument->documentLayout()->blockBoundingRect(mDocument->findBlockByNumber(block_number)).top() - sliderPosition; painter.translate(0, -mOffset); ctx.clip = QRectF(0, mOffset, width(), height()); } mDocument->documentLayout()->draw(&painter, ctx); } void CodeEditorMinimap::resizeEvent(QResizeEvent* event) { Q_UNUSED(event) resizeScrollbar(); } void CodeEditorMinimap::mousePressEvent(QMouseEvent* event) { int position = mDocument->documentLayout()->hitTest(QPointF(event->pos().x(), event->pos().y() + mOffset), Qt::FuzzyHit); QTextCursor cursor(mDocument); cursor.setPosition(position); mEditor->centerOnLine(cursor.blockNumber()); } void CodeEditorMinimap::wheelEvent(QWheelEvent* event) { mEditor->handleWheelEvent(event); } void CodeEditorMinimap::resizeScrollbar() { if (mDocumentHeight < height()) mScrollbar->resize(width(), std::max(mScrollbar->sliderHeight(), mDocumentHeight)); else mScrollbar->resize(width(), height()); } void CodeEditorMinimap::repolish() { QStyle* s = style(); s->unpolish(this); s->polish(this); mDocument->setDefaultFont(font()); } }
33.203822
180
0.656819
emsec
fa9fa94871067ab1c459223b392a4c90ae4026ce
52
cc
C++
tests/Anderson/Solution.cc
jeanlucf22/mgmol
4e79bc32c14c8a47ae18ad0659ea740719c8b77f
[ "BSD-3-Clause-LBNL", "FSFAP" ]
25
2018-12-29T03:33:01.000Z
2021-05-08T12:52:27.000Z
tests/Anderson/Solution.cc
jeanlucf22/mgmol
4e79bc32c14c8a47ae18ad0659ea740719c8b77f
[ "BSD-3-Clause-LBNL", "FSFAP" ]
121
2018-12-19T02:38:21.000Z
2021-12-20T16:29:24.000Z
tests/Anderson/Solution.cc
jeanlucf22/mgmol
4e79bc32c14c8a47ae18ad0659ea740719c8b77f
[ "BSD-3-Clause-LBNL", "FSFAP" ]
15
2019-02-17T05:28:43.000Z
2022-02-28T05:24:11.000Z
#include "Solution.h" double Solution::invs_ = 1.;
13
28
0.692308
jeanlucf22
faa2d85910b3524ecbc8cf8e0bdce970b462431d
10,104
hpp
C++
Lib-ZeroG/src/d3d12/D3D12CommandQueue.hpp
PetorSFZ/sfz_tech
0d4027ad2c2bb444b83e78f009b649478cb97a73
[ "Zlib" ]
2
2020-09-04T16:52:47.000Z
2021-04-21T18:30:25.000Z
Lib-ZeroG/src/d3d12/D3D12CommandQueue.hpp
PetorSFZ/sfz_tech
0d4027ad2c2bb444b83e78f009b649478cb97a73
[ "Zlib" ]
null
null
null
Lib-ZeroG/src/d3d12/D3D12CommandQueue.hpp
PetorSFZ/sfz_tech
0d4027ad2c2bb444b83e78f009b649478cb97a73
[ "Zlib" ]
null
null
null
// Copyright (c) Peter Hillerström (skipifzero.com, peter@hstroem.se) // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. #pragma once #include <mutex> #include <skipifzero.hpp> #include <skipifzero_arrays.hpp> #include <skipifzero_ring_buffers.hpp> #include "ZeroG.h" #include "d3d12/D3D12Common.hpp" #include "d3d12/D3D12CommandList.hpp" #include "d3d12/D3D12DescriptorRingBuffer.hpp" #include "d3d12/D3D12ResourceTracking.hpp" // Fence // ------------------------------------------------------------------------------------------------ struct ZgFence final { public: // Constructors & destructors // -------------------------------------------------------------------------------------------- ZgFence() noexcept = default; ZgFence(const ZgFence&) = delete; ZgFence& operator= (const ZgFence&) = delete; ZgFence(ZgFence&&) = delete; ZgFence& operator= (ZgFence&&) = delete; ~ZgFence() noexcept {} // Members // -------------------------------------------------------------------------------------------- u64 fenceValue = 0; ZgCommandQueue* commandQueue = nullptr; // Virtual methods // -------------------------------------------------------------------------------------------- ZgResult reset() noexcept { this->fenceValue = 0; this->commandQueue = nullptr; return ZG_SUCCESS; } ZgResult checkIfSignaled(bool& fenceSignaledOut) const noexcept; ZgResult waitOnCpuBlocking() const noexcept; }; // ZgCommandQueue // ------------------------------------------------------------------------------------------------ constexpr u32 MAX_NUM_COMMAND_LISTS = 1024; struct ZgCommandQueue final { // Constructors & destructors // -------------------------------------------------------------------------------------------- ZgCommandQueue() noexcept = default; ZgCommandQueue(const ZgCommandQueue&) = delete; ZgCommandQueue& operator= (const ZgCommandQueue&) = delete; ZgCommandQueue(ZgCommandQueue&&) = delete; ZgCommandQueue& operator= (ZgCommandQueue&&) = delete; ~ZgCommandQueue() noexcept { // Flush queue [[maybe_unused]] ZgResult res = this->flush(); // Check that all command lists have been returned sfz_assert(mCommandListStorage.size() == mCommandListQueue.size()); // Destroy fence event CloseHandle(mCommandQueueFenceEvent); } // State methods // -------------------------------------------------------------------------------------------- ZgResult create( D3D12_COMMAND_LIST_TYPE type, ComPtr<ID3D12Device3>& device, D3D12DescriptorRingBuffer* descriptorBuffer) noexcept { mType = type; mDevice = device; mDescriptorBuffer = descriptorBuffer; // Create command queue D3D12_COMMAND_QUEUE_DESC desc = {}; desc.Type = type; desc.Priority = D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; desc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE; // TODO: D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT desc.NodeMask = 0; if (D3D12_FAIL(device->CreateCommandQueue(&desc, IID_PPV_ARGS(&mCommandQueue)))) { return ZG_ERROR_NO_SUITABLE_DEVICE; } // Create command queue fence if (D3D12_FAIL(device->CreateFence( mCommandQueueFenceValue, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&mCommandQueueFence)))) { return ZG_ERROR_GENERIC; } // Create command queue fence event mCommandQueueFenceEvent = ::CreateEvent(NULL, false, false, NULL); // Allocate memory for command lists mCommandListStorage.init( MAX_NUM_COMMAND_LISTS, getAllocator(), sfz_dbg("ZeroG - D3D12CommandQueue - CommandListStorage")); mCommandListQueue.create( MAX_NUM_COMMAND_LISTS, getAllocator(), sfz_dbg("ZeroG - D3D12CommandQueue - CommandListQueue")); return ZG_SUCCESS; } // Members // -------------------------------------------------------------------------------------------- D3D12_COMMAND_LIST_TYPE mType; ComPtr<ID3D12Device3> mDevice; D3D12DescriptorRingBuffer* mDescriptorBuffer = nullptr; ComPtr<ID3D12CommandQueue> mCommandQueue; ComPtr<ID3D12Fence> mCommandQueueFence; u64 mCommandQueueFenceValue = 0; HANDLE mCommandQueueFenceEvent = nullptr; sfz::Array<ZgCommandList> mCommandListStorage; sfz::RingBuffer<ZgCommandList*> mCommandListQueue; // Virtual methods // -------------------------------------------------------------------------------------------- ZgResult signalOnGpu(ZgFence& fenceToSignal) noexcept { fenceToSignal.commandQueue = this; fenceToSignal.fenceValue = signalOnGpuInternal(); return ZG_SUCCESS; } ZgResult waitOnGpu(const ZgFence& fence) noexcept { if (fence.commandQueue == nullptr) return ZG_ERROR_INVALID_ARGUMENT; CHECK_D3D12 this->mCommandQueue->Wait( fence.commandQueue->mCommandQueueFence.Get(), fence.fenceValue); return ZG_SUCCESS; } ZgResult flush() noexcept { u64 fenceValue = this->signalOnGpuInternal(); this->waitOnCpuInternal(fenceValue); return ZG_SUCCESS; } ZgResult beginCommandListRecording(ZgCommandList** commandListOut) noexcept { ZgCommandList* commandList = nullptr; bool commandListFound = false; // If command lists available in queue, attempt to get one of them u64 queueSize = mCommandListQueue.size(); if (queueSize != 0) { if (isFenceValueDone(mCommandListQueue.first()->fenceValue)) { mCommandListQueue.pop(commandList); commandListFound = true; } } // If no command list found, create new one if (!commandListFound) { ZgResult res = createCommandList(commandList); if (res != ZG_SUCCESS) return res; commandListFound = true; } // Reset command list and allocator ZgResult res = commandList->reset(); if (res != ZG_SUCCESS) return res; // Return command list *commandListOut = commandList; return ZG_SUCCESS; } ZgResult executeCommandList(ZgCommandList* commandList, bool barrierList = false) noexcept { // Close command list if (D3D12_FAIL(commandList->commandList->Close())) { return ZG_ERROR_GENERIC; } auto execBarriers = [&](const CD3DX12_RESOURCE_BARRIER* barriers, u32 numBarriers) -> ZgResult { // Get command list to execute barriers in ZgCommandList* commandList = nullptr; ZgResult res = this->beginCommandListRecording(&commandList); if (res != ZG_SUCCESS) return res; // Insert barrier call commandList->commandList->ResourceBarrier(numBarriers, barriers); // Execute barriers return this->executeCommandList(commandList, true); }; // Execute command list ID3D12CommandList* cmdLists[1] = {}; ZgTrackerCommandListState* cmdListStates[1] = {}; cmdLists[0] = commandList->commandList.Get(); cmdListStates[0] = &commandList->tracking; executeCommandLists(*mCommandQueue.Get(), cmdLists, cmdListStates, 1, execBarriers, barrierList); // Signal u64 fenceValue = this->signalOnGpuInternal(); commandList->fenceValue = fenceValue; // Add command list to queue mCommandListQueue.add(commandList); return ZG_SUCCESS; } // Synchronization methods // -------------------------------------------------------------------------------------------- u64 signalOnGpuInternal() noexcept { CHECK_D3D12 mCommandQueue->Signal(mCommandQueueFence.Get(), mCommandQueueFenceValue); return mCommandQueueFenceValue++; } void waitOnCpuInternal(u64 fenceValue) noexcept { if (!isFenceValueDone(fenceValue)) { CHECK_D3D12 mCommandQueueFence->SetEventOnCompletion( fenceValue, mCommandQueueFenceEvent); // TODO: Don't wait forever ::WaitForSingleObject(mCommandQueueFenceEvent, INFINITE); } } bool isFenceValueDone(u64 fenceValue) noexcept { return mCommandQueueFence->GetCompletedValue() >= fenceValue; } private: // Private methods // -------------------------------------------------------------------------------------------- ZgResult createCommandList(ZgCommandList*& commandListOut) noexcept { // Create a new command list in storage ZgCommandList& commandList = mCommandListStorage.add(); sfz_assert_hard(mCommandListStorage.size() < MAX_NUM_COMMAND_LISTS); commandList.commandListType = this->mType; // Create command allocator if (D3D12_FAIL(mDevice->CreateCommandAllocator( mType, IID_PPV_ARGS(&commandList.commandAllocator)))) { mCommandListStorage.pop(); return ZG_ERROR_GENERIC; } // Create command list if (D3D12_FAIL(mDevice->CreateCommandList( 0, mType, commandList.commandAllocator.Get(), nullptr, IID_PPV_ARGS(&commandList.commandList)))) { mCommandListStorage.pop(); return ZG_ERROR_GENERIC; } // Ensure command list is in closed state if (D3D12_FAIL(commandList.commandList->Close())) { mCommandListStorage.pop(); return ZG_ERROR_GENERIC; } // Initialize command list commandList.create( mDevice, mDescriptorBuffer); commandListOut = &commandList; return ZG_SUCCESS; } }; // Fence (continued // ------------------------------------------------------------------------------------------------ inline ZgResult ZgFence::checkIfSignaled(bool& fenceSignaledOut) const noexcept { if (this->commandQueue == nullptr) return ZG_ERROR_INVALID_ARGUMENT; fenceSignaledOut = this->commandQueue->isFenceValueDone(this->fenceValue); return ZG_SUCCESS; } inline ZgResult ZgFence::waitOnCpuBlocking() const noexcept { if (this->commandQueue == nullptr) return ZG_SUCCESS; this->commandQueue->waitOnCpuInternal(this->fenceValue); return ZG_SUCCESS; }
30.711246
101
0.665182
PetorSFZ
faa4639450ed204eb03868ec1076c5f094a4aab9
151,060
cc
C++
cc/trees/layer_tree_host_impl.cc
maidiHaitai/haitaibrowser
a232a56bcfb177913a14210e7733e0ea83a6b18d
[ "BSD-3-Clause" ]
1
2020-09-15T08:43:34.000Z
2020-09-15T08:43:34.000Z
cc/trees/layer_tree_host_impl.cc
maidiHaitai/haitaibrowser
a232a56bcfb177913a14210e7733e0ea83a6b18d
[ "BSD-3-Clause" ]
null
null
null
cc/trees/layer_tree_host_impl.cc
maidiHaitai/haitaibrowser
a232a56bcfb177913a14210e7733e0ea83a6b18d
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "cc/trees/layer_tree_host_impl.h" #include <stddef.h> #include <stdint.h> #include <algorithm> #include <limits> #include <map> #include <set> #include <unordered_map> #include <utility> #include "base/auto_reset.h" #include "base/bind.h" #include "base/containers/small_map.h" #include "base/json/json_writer.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram.h" #include "base/numerics/safe_conversions.h" #include "base/stl_util.h" #include "base/strings/stringprintf.h" #include "base/trace_event/trace_event_argument.h" #include "cc/animation/animation_events.h" #include "cc/animation/animation_host.h" #include "cc/animation/animation_id_provider.h" #include "cc/animation/scroll_offset_animation_curve.h" #include "cc/animation/timing_function.h" #include "cc/base/histograms.h" #include "cc/base/math_util.h" #include "cc/debug/benchmark_instrumentation.h" #include "cc/debug/debug_rect_history.h" #include "cc/debug/devtools_instrumentation.h" #include "cc/debug/frame_rate_counter.h" #include "cc/debug/frame_viewer_instrumentation.h" #include "cc/debug/rendering_stats_instrumentation.h" #include "cc/debug/traced_value.h" #include "cc/input/main_thread_scrolling_reason.h" #include "cc/input/page_scale_animation.h" #include "cc/input/scroll_elasticity_helper.h" #include "cc/input/scroll_state.h" #include "cc/input/scrollbar_animation_controller.h" #include "cc/input/top_controls_manager.h" #include "cc/layers/append_quads_data.h" #include "cc/layers/heads_up_display_layer_impl.h" #include "cc/layers/layer_impl.h" #include "cc/layers/layer_iterator.h" #include "cc/layers/painted_scrollbar_layer_impl.h" #include "cc/layers/render_surface_impl.h" #include "cc/layers/scrollbar_layer_impl_base.h" #include "cc/layers/surface_layer_impl.h" #include "cc/layers/viewport.h" #include "cc/output/compositor_frame_metadata.h" #include "cc/output/copy_output_request.h" #include "cc/output/delegating_renderer.h" #include "cc/output/gl_renderer.h" #include "cc/output/software_renderer.h" #include "cc/output/texture_mailbox_deleter.h" #include "cc/quads/render_pass_draw_quad.h" #include "cc/quads/shared_quad_state.h" #include "cc/quads/solid_color_draw_quad.h" #include "cc/quads/texture_draw_quad.h" #include "cc/raster/bitmap_raster_buffer_provider.h" #include "cc/raster/gpu_raster_buffer_provider.h" #include "cc/raster/gpu_rasterizer.h" #include "cc/raster/one_copy_raster_buffer_provider.h" #include "cc/raster/raster_buffer_provider.h" #include "cc/raster/synchronous_task_graph_runner.h" #include "cc/raster/zero_copy_raster_buffer_provider.h" #include "cc/resources/memory_history.h" #include "cc/resources/resource_pool.h" #include "cc/resources/ui_resource_bitmap.h" #include "cc/scheduler/delay_based_time_source.h" #include "cc/tiles/eviction_tile_priority_queue.h" #include "cc/tiles/gpu_image_decode_controller.h" #include "cc/tiles/picture_layer_tiling.h" #include "cc/tiles/raster_tile_priority_queue.h" #include "cc/tiles/software_image_decode_controller.h" #include "cc/tiles/tile_task_manager.h" #include "cc/trees/damage_tracker.h" #include "cc/trees/draw_property_utils.h" #include "cc/trees/latency_info_swap_promise_monitor.h" #include "cc/trees/layer_tree_host.h" #include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_impl.h" #include "cc/trees/single_thread_proxy.h" #include "cc/trees/tree_synchronizer.h" #include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/client/gles2_interface.h" #include "ui/gfx/geometry/point_conversions.h" #include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/geometry/scroll_offset.h" #include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/geometry/vector2d_conversions.h" namespace cc { namespace { // Small helper class that saves the current viewport location as the user sees // it and resets to the same location. class ViewportAnchor { public: ViewportAnchor(LayerImpl* inner_scroll, LayerImpl* outer_scroll) : inner_(inner_scroll), outer_(outer_scroll) { viewport_in_content_coordinates_ = inner_->CurrentScrollOffset(); if (outer_) viewport_in_content_coordinates_ += outer_->CurrentScrollOffset(); } void ResetViewportToAnchoredPosition() { DCHECK(outer_); inner_->ClampScrollToMaxScrollOffset(); outer_->ClampScrollToMaxScrollOffset(); gfx::ScrollOffset viewport_location = inner_->CurrentScrollOffset() + outer_->CurrentScrollOffset(); gfx::Vector2dF delta = viewport_in_content_coordinates_.DeltaFrom(viewport_location); delta = inner_->ScrollBy(delta); outer_->ScrollBy(delta); } private: LayerImpl* inner_; LayerImpl* outer_; gfx::ScrollOffset viewport_in_content_coordinates_; }; void DidVisibilityChange(LayerTreeHostImpl* id, bool visible) { if (visible) { TRACE_EVENT_ASYNC_BEGIN1("cc", "LayerTreeHostImpl::SetVisible", id, "LayerTreeHostImpl", id); return; } TRACE_EVENT_ASYNC_END0("cc", "LayerTreeHostImpl::SetVisible", id); } bool IsWheelBasedScroll(InputHandler::ScrollInputType type) { return type == InputHandler::WHEEL; } enum ScrollThread { MAIN_THREAD, CC_THREAD }; void RecordCompositorSlowScrollMetric(InputHandler::ScrollInputType type, ScrollThread scroll_thread) { bool scroll_on_main_thread = (scroll_thread == MAIN_THREAD); if (IsWheelBasedScroll(type)) { UMA_HISTOGRAM_BOOLEAN("Renderer4.CompositorWheelScrollUpdateThread", scroll_on_main_thread); } else { UMA_HISTOGRAM_BOOLEAN("Renderer4.CompositorTouchScrollUpdateThread", scroll_on_main_thread); } } } // namespace LayerTreeHostImpl::FrameData::FrameData() : render_surface_layer_list(nullptr), has_no_damage(false) {} LayerTreeHostImpl::FrameData::~FrameData() {} std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( const LayerTreeSettings& settings, LayerTreeHostImplClient* client, TaskRunnerProvider* task_runner_provider, RenderingStatsInstrumentation* rendering_stats_instrumentation, SharedBitmapManager* shared_bitmap_manager, gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, int id) { return base::WrapUnique(new LayerTreeHostImpl( settings, client, task_runner_provider, rendering_stats_instrumentation, shared_bitmap_manager, gpu_memory_buffer_manager, task_graph_runner, id)); } LayerTreeHostImpl::LayerTreeHostImpl( const LayerTreeSettings& settings, LayerTreeHostImplClient* client, TaskRunnerProvider* task_runner_provider, RenderingStatsInstrumentation* rendering_stats_instrumentation, SharedBitmapManager* shared_bitmap_manager, gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, int id) : client_(client), task_runner_provider_(task_runner_provider), current_begin_frame_tracker_(BEGINFRAMETRACKER_FROM_HERE), output_surface_(nullptr), content_is_suitable_for_gpu_rasterization_(true), has_gpu_rasterization_trigger_(false), use_gpu_rasterization_(false), use_msaa_(false), gpu_rasterization_status_(GpuRasterizationStatus::OFF_DEVICE), tree_resources_for_gpu_rasterization_dirty_(false), input_handler_client_(NULL), did_lock_scrolling_layer_(false), wheel_scrolling_(false), scroll_affects_scroll_handler_(false), scroll_layer_id_when_mouse_over_scrollbar_(Layer::INVALID_ID), tile_priorities_dirty_(false), settings_(settings), visible_(false), cached_managed_memory_policy_(settings.memory_policy_), is_synchronous_single_threaded_(!task_runner_provider->HasImplThread() && !settings.single_thread_proxy_scheduler), // Must be initialized after is_synchronous_single_threaded_ and // task_runner_provider_. tile_manager_( TileManager::Create(this, GetTaskRunner(), is_synchronous_single_threaded_ ? std::numeric_limits<size_t>::max() : settings.scheduled_raster_task_limit, settings.use_partial_raster)), pinch_gesture_active_(false), pinch_gesture_end_should_clear_scrolling_layer_(false), fps_counter_( FrameRateCounter::Create(task_runner_provider_->HasImplThread())), memory_history_(MemoryHistory::Create()), debug_rect_history_(DebugRectHistory::Create()), texture_mailbox_deleter_(new TextureMailboxDeleter(GetTaskRunner())), max_memory_needed_bytes_(0), resourceless_software_draw_(false), animation_host_(), rendering_stats_instrumentation_(rendering_stats_instrumentation), micro_benchmark_controller_(this), shared_bitmap_manager_(shared_bitmap_manager), gpu_memory_buffer_manager_(gpu_memory_buffer_manager), task_graph_runner_(task_graph_runner), id_(id), requires_high_res_to_draw_(false), is_likely_to_require_a_draw_(false), mutator_(nullptr), has_fixed_raster_scale_blurry_content_(false) { animation_host_ = AnimationHost::Create(ThreadInstance::IMPL); animation_host_->SetMutatorHostClient(this); animation_host_->SetSupportsScrollAnimations(SupportsImplScrolling()); DCHECK(task_runner_provider_->IsImplThread()); DidVisibilityChange(this, visible_); SetDebugState(settings.initial_debug_state); // LTHI always has an active tree. active_tree_ = LayerTreeImpl::create(this, new SyncedProperty<ScaleGroup>(), new SyncedTopControls, new SyncedElasticOverscroll); active_tree_->property_trees()->is_active = true; viewport_ = Viewport::Create(this); TRACE_EVENT_OBJECT_CREATED_WITH_ID( TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerTreeHostImpl", id_); top_controls_manager_ = TopControlsManager::Create(this, settings.top_controls_show_threshold, settings.top_controls_hide_threshold); } LayerTreeHostImpl::~LayerTreeHostImpl() { DCHECK(task_runner_provider_->IsImplThread()); TRACE_EVENT0("cc", "LayerTreeHostImpl::~LayerTreeHostImpl()"); TRACE_EVENT_OBJECT_DELETED_WITH_ID( TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerTreeHostImpl", id_); if (input_handler_client_) { input_handler_client_->WillShutdown(); input_handler_client_ = NULL; } if (scroll_elasticity_helper_) scroll_elasticity_helper_.reset(); // The layer trees must be destroyed before the layer tree host. We've // made a contract with our animation controllers that the animation_host // will outlive them, and we must make good. if (recycle_tree_) recycle_tree_->Shutdown(); if (pending_tree_) pending_tree_->Shutdown(); active_tree_->Shutdown(); recycle_tree_ = nullptr; pending_tree_ = nullptr; active_tree_ = nullptr; animation_host_->ClearTimelines(); animation_host_->SetMutatorHostClient(nullptr); CleanUpTileManagerAndUIResources(); renderer_ = nullptr; resource_provider_ = nullptr; if (output_surface_) { output_surface_->DetachFromClient(); output_surface_ = nullptr; } } void LayerTreeHostImpl::BeginMainFrameAborted(CommitEarlyOutReason reason) { // If the begin frame data was handled, then scroll and scale set was applied // by the main thread, so the active tree needs to be updated as if these sent // values were applied and committed. if (CommitEarlyOutHandledCommit(reason)) active_tree_->ApplySentScrollAndScaleDeltasFromAbortedCommit(); } void LayerTreeHostImpl::BeginCommit() { TRACE_EVENT0("cc", "LayerTreeHostImpl::BeginCommit"); // Ensure all textures are returned so partial texture updates can happen // during the commit. // TODO(ericrk): We should not need to ForceReclaimResources when using // Impl-side-painting as it doesn't upload during commits. However, // Display::Draw currently relies on resource being reclaimed to block drawing // between BeginCommit / Swap. See crbug.com/489515. if (output_surface_) output_surface_->ForceReclaimResources(); if (!CommitToActiveTree()) CreatePendingTree(); } void LayerTreeHostImpl::CommitComplete() { TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); if (CommitToActiveTree()) { // We have to activate animations here or "IsActive()" is true on the layers // but the animations aren't activated yet so they get ignored by // UpdateDrawProperties. ActivateAnimations(); } // Start animations before UpdateDrawProperties and PrepareTiles, as they can // change the results. When doing commit to the active tree, this must happen // after ActivateAnimations() in order for this ticking to be propogated to // layers on the active tree. if (CommitToActiveTree()) Animate(); else AnimatePendingTreeAfterCommit(); // LayerTreeHost may have changed the GPU rasterization flags state, which // may require an update of the tree resources. UpdateTreeResourcesForGpuRasterizationIfNeeded(); sync_tree()->set_needs_update_draw_properties(); // Advance the attempted scale change history before updating draw properties. fixed_raster_scale_attempted_scale_change_history_ <<= 1; // We need an update immediately post-commit to have the opportunity to create // tilings. Because invalidations may be coming from the main thread, it's // safe to do an update for lcd text at this point and see if lcd text needs // to be disabled on any layers. bool update_lcd_text = true; sync_tree()->UpdateDrawProperties(update_lcd_text); // Start working on newly created tiles immediately if needed. // TODO(vmpstr): Investigate always having PrepareTiles issue // NotifyReadyToActivate, instead of handling it here. bool did_prepare_tiles = PrepareTiles(); if (!did_prepare_tiles) { NotifyReadyToActivate(); // Ensure we get ReadyToDraw signal even when PrepareTiles not run. This // is important for SingleThreadProxy and impl-side painting case. For // STP, we commit to active tree and RequiresHighResToDraw, and set // Scheduler to wait for ReadyToDraw signal to avoid Checkerboard. if (CommitToActiveTree()) NotifyReadyToDraw(); } micro_benchmark_controller_.DidCompleteCommit(); } bool LayerTreeHostImpl::CanDraw() const { // Note: If you are changing this function or any other function that might // affect the result of CanDraw, make sure to call // client_->OnCanDrawStateChanged in the proper places and update the // NotifyIfCanDrawChanged test. if (!renderer_) { TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::CanDraw no renderer", TRACE_EVENT_SCOPE_THREAD); return false; } // Must have an OutputSurface if |renderer_| is not NULL. DCHECK(output_surface_); // TODO(boliu): Make draws without root_layer work and move this below // |resourceless_software_draw_| check. Tracked in crbug.com/264967. if (!active_tree_->root_layer()) { TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::CanDraw no root layer", TRACE_EVENT_SCOPE_THREAD); return false; } if (resourceless_software_draw_) return true; if (DrawViewportSize().IsEmpty()) { TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::CanDraw empty viewport", TRACE_EVENT_SCOPE_THREAD); return false; } if (active_tree_->ViewportSizeInvalid()) { TRACE_EVENT_INSTANT0( "cc", "LayerTreeHostImpl::CanDraw viewport size recently changed", TRACE_EVENT_SCOPE_THREAD); return false; } if (EvictedUIResourcesExist()) { TRACE_EVENT_INSTANT0( "cc", "LayerTreeHostImpl::CanDraw UI resources evicted not recreated", TRACE_EVENT_SCOPE_THREAD); return false; } return true; } void LayerTreeHostImpl::AnimatePendingTreeAfterCommit() { AnimateInternal(false); } void LayerTreeHostImpl::Animate() { AnimateInternal(true); } void LayerTreeHostImpl::AnimateInternal(bool active_tree) { DCHECK(task_runner_provider_->IsImplThread()); base::TimeTicks monotonic_time = CurrentBeginFrameArgs().frame_time; // mithro(TODO): Enable these checks. // DCHECK(!current_begin_frame_tracker_.HasFinished()); // DCHECK(monotonic_time == current_begin_frame_tracker_.Current().frame_time) // << "Called animate with unknown frame time!?"; bool did_animate = false; if (input_handler_client_) { // This animates fling scrolls. But on Android WebView root flings are // controlled by the application, so the compositor does not animate them. bool ignore_fling = settings_.ignore_root_layer_flings && IsCurrentlyScrollingInnerViewport(); if (!ignore_fling) { // This does not set did_animate, because if the InputHandlerClient // changes anything it will be through the InputHandler interface which // does SetNeedsRedraw. input_handler_client_->Animate(monotonic_time); } } did_animate |= AnimatePageScale(monotonic_time); did_animate |= AnimateLayers(monotonic_time); did_animate |= AnimateScrollbars(monotonic_time); did_animate |= AnimateTopControls(monotonic_time); if (active_tree) { // Animating stuff can change the root scroll offset, so inform the // synchronous input handler. UpdateRootLayerStateForSynchronousInputHandler(); if (did_animate) { // If the tree changed, then we want to draw at the end of the current // frame. SetNeedsRedraw(); } } } bool LayerTreeHostImpl::PrepareTiles() { if (!tile_priorities_dirty_) return false; client_->WillPrepareTiles(); bool did_prepare_tiles = tile_manager_->PrepareTiles(global_tile_state_); if (did_prepare_tiles) tile_priorities_dirty_ = false; client_->DidPrepareTiles(); return did_prepare_tiles; } void LayerTreeHostImpl::StartPageScaleAnimation( const gfx::Vector2d& target_offset, bool anchor_point, float page_scale, base::TimeDelta duration) { if (!InnerViewportScrollLayer()) return; gfx::ScrollOffset scroll_total = active_tree_->TotalScrollOffset(); gfx::SizeF scaled_scrollable_size = active_tree_->ScrollableSize(); gfx::SizeF viewport_size = gfx::SizeF(active_tree_->InnerViewportContainerLayer()->bounds()); // Easing constants experimentally determined. std::unique_ptr<TimingFunction> timing_function = CubicBezierTimingFunction::Create(.8, 0, .3, .9); // TODO(miletus) : Pass in ScrollOffset. page_scale_animation_ = PageScaleAnimation::Create( ScrollOffsetToVector2dF(scroll_total), active_tree_->current_page_scale_factor(), viewport_size, scaled_scrollable_size, std::move(timing_function)); if (anchor_point) { gfx::Vector2dF anchor(target_offset); page_scale_animation_->ZoomWithAnchor(anchor, page_scale, duration.InSecondsF()); } else { gfx::Vector2dF scaled_target_offset = target_offset; page_scale_animation_->ZoomTo(scaled_target_offset, page_scale, duration.InSecondsF()); } SetNeedsOneBeginImplFrame(); client_->SetNeedsCommitOnImplThread(); client_->RenewTreePriority(); } void LayerTreeHostImpl::SetNeedsAnimateInput() { DCHECK(!IsCurrentlyScrollingInnerViewport() || !settings_.ignore_root_layer_flings); SetNeedsOneBeginImplFrame(); } bool LayerTreeHostImpl::IsCurrentlyScrollingInnerViewport() const { LayerImpl* scrolling_layer = CurrentlyScrollingLayer(); if (!scrolling_layer) return false; return scrolling_layer == InnerViewportScrollLayer(); } bool LayerTreeHostImpl::IsCurrentlyScrollingLayerAt( const gfx::Point& viewport_point, InputHandler::ScrollInputType type) const { LayerImpl* scrolling_layer_impl = CurrentlyScrollingLayer(); if (!scrolling_layer_impl) return false; gfx::PointF device_viewport_point = gfx::ScalePoint( gfx::PointF(viewport_point), active_tree_->device_scale_factor()); LayerImpl* layer_impl = active_tree_->FindLayerThatIsHitByPoint(device_viewport_point); bool scroll_on_main_thread = false; uint32_t main_thread_scrolling_reasons; LayerImpl* test_layer_impl = FindScrollLayerForDeviceViewportPoint( device_viewport_point, type, layer_impl, &scroll_on_main_thread, &main_thread_scrolling_reasons); if (!test_layer_impl) return false; if (scrolling_layer_impl == test_layer_impl) return true; // For active scrolling state treat the inner/outer viewports interchangeably. if ((scrolling_layer_impl == InnerViewportScrollLayer() && test_layer_impl == OuterViewportScrollLayer()) || (scrolling_layer_impl == OuterViewportScrollLayer() && test_layer_impl == InnerViewportScrollLayer())) { return true; } return false; } EventListenerProperties LayerTreeHostImpl::GetEventListenerProperties( EventListenerClass event_class) const { return active_tree_->event_listener_properties(event_class); } bool LayerTreeHostImpl::DoTouchEventsBlockScrollAt( const gfx::Point& viewport_point) { gfx::PointF device_viewport_point = gfx::ScalePoint( gfx::PointF(viewport_point), active_tree_->device_scale_factor()); // Now determine if there are actually any handlers at that point. // TODO(rbyers): Consider also honoring touch-action (crbug.com/347272). LayerImpl* layer_impl = active_tree_->FindLayerThatIsHitByPointInTouchHandlerRegion( device_viewport_point); return layer_impl != NULL; } std::unique_ptr<SwapPromiseMonitor> LayerTreeHostImpl::CreateLatencyInfoSwapPromiseMonitor( ui::LatencyInfo* latency) { return base::WrapUnique( new LatencyInfoSwapPromiseMonitor(latency, NULL, this)); } ScrollElasticityHelper* LayerTreeHostImpl::CreateScrollElasticityHelper() { DCHECK(!scroll_elasticity_helper_); if (settings_.enable_elastic_overscroll) { scroll_elasticity_helper_.reset( ScrollElasticityHelper::CreateForLayerTreeHostImpl(this)); } return scroll_elasticity_helper_.get(); } void LayerTreeHostImpl::QueueSwapPromiseForMainThreadScrollUpdate( std::unique_ptr<SwapPromise> swap_promise) { swap_promises_for_main_thread_scroll_update_.push_back( std::move(swap_promise)); } void LayerTreeHostImpl::TrackDamageForAllSurfaces( LayerImpl* root_draw_layer, const LayerImplList& render_surface_layer_list) { // For now, we use damage tracking to compute a global scissor. To do this, we // must compute all damage tracking before drawing anything, so that we know // the root damage rect. The root damage rect is then used to scissor each // surface. size_t render_surface_layer_list_size = render_surface_layer_list.size(); for (size_t i = 0; i < render_surface_layer_list_size; ++i) { size_t surface_index = render_surface_layer_list_size - 1 - i; LayerImpl* render_surface_layer = render_surface_layer_list[surface_index]; RenderSurfaceImpl* render_surface = render_surface_layer->render_surface(); DCHECK(render_surface); render_surface->damage_tracker()->UpdateDamageTrackingState( render_surface->layer_list(), render_surface, render_surface->SurfacePropertyChangedOnlyFromDescendant(), render_surface->content_rect(), render_surface_layer->mask_layer(), render_surface_layer->filters()); } } void LayerTreeHostImpl::FrameData::AsValueInto( base::trace_event::TracedValue* value) const { value->SetBoolean("has_no_damage", has_no_damage); // Quad data can be quite large, so only dump render passes if we select // cc.debug.quads. bool quads_enabled; TRACE_EVENT_CATEGORY_GROUP_ENABLED( TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), &quads_enabled); if (quads_enabled) { value->BeginArray("render_passes"); for (size_t i = 0; i < render_passes.size(); ++i) { value->BeginDictionary(); render_passes[i]->AsValueInto(value); value->EndDictionary(); } value->EndArray(); } } void LayerTreeHostImpl::FrameData::AppendRenderPass( std::unique_ptr<RenderPass> render_pass) { render_passes.push_back(std::move(render_pass)); } DrawMode LayerTreeHostImpl::GetDrawMode() const { if (resourceless_software_draw_) { return DRAW_MODE_RESOURCELESS_SOFTWARE; } else if (output_surface_->context_provider()) { return DRAW_MODE_HARDWARE; } else { return DRAW_MODE_SOFTWARE; } } static void AppendQuadsForRenderSurfaceLayer( RenderPass* target_render_pass, LayerImpl* layer, const RenderPass* contributing_render_pass, AppendQuadsData* append_quads_data) { RenderSurfaceImpl* surface = layer->render_surface(); const gfx::Transform& draw_transform = surface->draw_transform(); const Occlusion& occlusion = surface->occlusion_in_content_space(); SkColor debug_border_color = surface->GetDebugBorderColor(); float debug_border_width = surface->GetDebugBorderWidth(); LayerImpl* mask_layer = layer->mask_layer(); surface->AppendQuads(target_render_pass, draw_transform, occlusion, debug_border_color, debug_border_width, mask_layer, append_quads_data, contributing_render_pass->id); // Add replica after the surface so that it appears below the surface. if (layer->has_replica()) { const gfx::Transform& replica_draw_transform = surface->replica_draw_transform(); Occlusion replica_occlusion = occlusion.GetOcclusionWithGivenDrawTransform( surface->replica_draw_transform()); SkColor replica_debug_border_color = surface->GetReplicaDebugBorderColor(); float replica_debug_border_width = surface->GetReplicaDebugBorderWidth(); // TODO(danakj): By using the same RenderSurfaceImpl for both the // content and its reflection, it's currently not possible to apply a // separate mask to the reflection layer or correctly handle opacity in // reflections (opacity must be applied after drawing both the layer and its // reflection). The solution is to introduce yet another RenderSurfaceImpl // to draw the layer and its reflection in. For now we only apply a separate // reflection mask if the contents don't have a mask of their own. LayerImpl* replica_mask_layer = mask_layer ? mask_layer : layer->replica_layer()->mask_layer(); surface->AppendQuads(target_render_pass, replica_draw_transform, replica_occlusion, replica_debug_border_color, replica_debug_border_width, replica_mask_layer, append_quads_data, contributing_render_pass->id); } } static void AppendQuadsToFillScreen(const gfx::Rect& root_scroll_layer_rect, RenderPass* target_render_pass, LayerImpl* root_layer, SkColor screen_background_color, const Region& fill_region) { if (!root_layer || !SkColorGetA(screen_background_color)) return; if (fill_region.IsEmpty()) return; // Manually create the quad state for the gutter quads, as the root layer // doesn't have any bounds and so can't generate this itself. // TODO(danakj): Make the gutter quads generated by the solid color layer // (make it smarter about generating quads to fill unoccluded areas). gfx::Rect root_target_rect = root_layer->render_surface()->content_rect(); float opacity = 1.f; int sorting_context_id = 0; SharedQuadState* shared_quad_state = target_render_pass->CreateAndAppendSharedQuadState(); shared_quad_state->SetAll(gfx::Transform(), root_target_rect.size(), root_target_rect, root_target_rect, false, opacity, SkXfermode::kSrcOver_Mode, sorting_context_id); for (Region::Iterator fill_rects(fill_region); fill_rects.has_rect(); fill_rects.next()) { gfx::Rect screen_space_rect = fill_rects.rect(); gfx::Rect visible_screen_space_rect = screen_space_rect; // Skip the quad culler and just append the quads directly to avoid // occlusion checks. SolidColorDrawQuad* quad = target_render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); quad->SetNew(shared_quad_state, screen_space_rect, visible_screen_space_rect, screen_background_color, false); } } static RenderPass* FindRenderPassById(const RenderPassList& list, RenderPassId id) { auto it = std::find_if( list.begin(), list.end(), [id](const std::unique_ptr<RenderPass>& p) { return p->id == id; }); return it == list.end() ? nullptr : it->get(); } DrawResult LayerTreeHostImpl::CalculateRenderPasses( FrameData* frame) { DCHECK(frame->render_passes.empty()); DCHECK(CanDraw()); DCHECK(active_tree_->root_layer()); TrackDamageForAllSurfaces(active_tree_->root_layer(), *frame->render_surface_layer_list); // If the root render surface has no visible damage, then don't generate a // frame at all. RenderSurfaceImpl* root_surface = active_tree_->root_layer()->render_surface(); bool root_surface_has_no_visible_damage = !root_surface->damage_tracker()->current_damage_rect().Intersects( root_surface->content_rect()); bool root_surface_has_contributing_layers = !root_surface->layer_list().empty(); bool hud_wants_to_draw_ = active_tree_->hud_layer() && active_tree_->hud_layer()->IsAnimatingHUDContents(); if (root_surface_has_contributing_layers && root_surface_has_no_visible_damage && active_tree_->LayersWithCopyOutputRequest().empty() && !output_surface_->capabilities().can_force_reclaim_resources && !hud_wants_to_draw_) { TRACE_EVENT0("cc", "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); frame->has_no_damage = true; DCHECK(!resourceless_software_draw_); return DRAW_SUCCESS; } TRACE_EVENT_BEGIN2( "cc", "LayerTreeHostImpl::CalculateRenderPasses", "render_surface_layer_list.size()", static_cast<uint64_t>(frame->render_surface_layer_list->size()), "RequiresHighResToDraw", RequiresHighResToDraw()); // Create the render passes in dependency order. size_t render_surface_layer_list_size = frame->render_surface_layer_list->size(); for (size_t i = 0; i < render_surface_layer_list_size; ++i) { size_t surface_index = render_surface_layer_list_size - 1 - i; LayerImpl* render_surface_layer = (*frame->render_surface_layer_list)[surface_index]; RenderSurfaceImpl* render_surface = render_surface_layer->render_surface(); bool should_draw_into_render_pass = active_tree_->IsRootLayer(render_surface_layer) || render_surface->contributes_to_drawn_surface() || render_surface_layer->HasCopyRequest(); if (should_draw_into_render_pass) render_surface->AppendRenderPasses(frame); } // Damage rects for non-root passes aren't meaningful, so set them to be // equal to the output rect. for (size_t i = 0; i + 1 < frame->render_passes.size(); ++i) { RenderPass* pass = frame->render_passes[i].get(); pass->damage_rect = pass->output_rect; } // When we are displaying the HUD, change the root damage rect to cover the // entire root surface. This will disable partial-swap/scissor optimizations // that would prevent the HUD from updating, since the HUD does not cause // damage itself, to prevent it from messing with damage visualizations. Since // damage visualizations are done off the LayerImpls and RenderSurfaceImpls, // changing the RenderPass does not affect them. if (active_tree_->hud_layer()) { RenderPass* root_pass = frame->render_passes.back().get(); root_pass->damage_rect = root_pass->output_rect; } // Because the active tree could be drawn again if this fails for some reason, // clear all of the copy request flags so that sanity checks for the counts // succeed. if (!active_tree_->LayersWithCopyOutputRequest().empty()) { active_tree()->property_trees()->effect_tree.ClearCopyRequests(); } // Grab this region here before iterating layers. Taking copy requests from // the layers while constructing the render passes will dirty the render // surface layer list and this unoccluded region, flipping the dirty bit to // true, and making us able to query for it without doing // UpdateDrawProperties again. The value inside the Region is not actually // changed until UpdateDrawProperties happens, so a reference to it is safe. const Region& unoccluded_screen_space_region = active_tree_->UnoccludedScreenSpaceRegion(); // Typically when we are missing a texture and use a checkerboard quad, we // still draw the frame. However when the layer being checkerboarded is moving // due to an impl-animation, we drop the frame to avoid flashing due to the // texture suddenly appearing in the future. DrawResult draw_result = DRAW_SUCCESS; int layers_drawn = 0; const DrawMode draw_mode = GetDrawMode(); int num_missing_tiles = 0; int num_incomplete_tiles = 0; int64_t checkerboarded_no_recording_content_area = 0; int64_t checkerboarded_needs_raster_content_area = 0; bool have_copy_request = false; bool have_missing_animated_tiles = false; LayerIterator end = LayerIterator::End(frame->render_surface_layer_list); for (LayerIterator it = LayerIterator::Begin(frame->render_surface_layer_list); it != end; ++it) { RenderPassId target_render_pass_id = it.target_render_surface_layer()->render_surface()->GetRenderPassId(); RenderPass* target_render_pass = FindRenderPassById(frame->render_passes, target_render_pass_id); AppendQuadsData append_quads_data; if (it.represents_target_render_surface()) { if (it->HasCopyRequest()) { have_copy_request = true; it->TakeCopyRequestsAndTransformToTarget( &target_render_pass->copy_requests); } } else if (it.represents_contributing_render_surface() && it->render_surface()->contributes_to_drawn_surface()) { RenderPassId contributing_render_pass_id = it->render_surface()->GetRenderPassId(); RenderPass* contributing_render_pass = FindRenderPassById(frame->render_passes, contributing_render_pass_id); AppendQuadsForRenderSurfaceLayer(target_render_pass, *it, contributing_render_pass, &append_quads_data); } else if (it.represents_itself() && !it->visible_layer_rect().IsEmpty()) { bool occluded = it->draw_properties().occlusion_in_content_space.IsOccluded( it->visible_layer_rect()); if (!occluded && it->WillDraw(draw_mode, resource_provider_.get())) { DCHECK_EQ(active_tree_.get(), it->layer_tree_impl()); frame->will_draw_layers.push_back(*it); it->AppendQuads(target_render_pass, &append_quads_data); } ++layers_drawn; } rendering_stats_instrumentation_->AddVisibleContentArea( append_quads_data.visible_layer_area); rendering_stats_instrumentation_->AddApproximatedVisibleContentArea( append_quads_data.approximated_visible_content_area); rendering_stats_instrumentation_->AddCheckerboardedVisibleContentArea( append_quads_data.checkerboarded_visible_content_area); rendering_stats_instrumentation_->AddCheckerboardedNoRecordingContentArea( append_quads_data.checkerboarded_no_recording_content_area); rendering_stats_instrumentation_->AddCheckerboardedNeedsRasterContentArea( append_quads_data.checkerboarded_needs_raster_content_area); num_missing_tiles += append_quads_data.num_missing_tiles; num_incomplete_tiles += append_quads_data.num_incomplete_tiles; checkerboarded_no_recording_content_area += append_quads_data.checkerboarded_no_recording_content_area; checkerboarded_needs_raster_content_area += append_quads_data.checkerboarded_needs_raster_content_area; if (append_quads_data.num_missing_tiles > 0) { have_missing_animated_tiles |= !it->was_ever_ready_since_last_transform_animation() || it->screen_space_transform_is_animating(); } else { it->set_was_ever_ready_since_last_transform_animation(true); } } // If CommitToActiveTree() is true, then we wait to draw until // NotifyReadyToDraw. That means we're in as good shape as is possible now, // so there's no reason to stop the draw now (and this is not supported by // SingleThreadProxy). if (have_missing_animated_tiles && !CommitToActiveTree()) draw_result = DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; // When we require high res to draw, abort the draw (almost) always. This does // not cause the scheduler to do a main frame, instead it will continue to try // drawing until we finally complete, so the copy request will not be lost. // TODO(weiliangc): Remove RequiresHighResToDraw. crbug.com/469175 if (num_incomplete_tiles || num_missing_tiles) { if (RequiresHighResToDraw()) draw_result = DRAW_ABORTED_MISSING_HIGH_RES_CONTENT; } // When doing a resourceless software draw, we don't have control over the // surface the compositor draws to, so even though the frame may not be // complete, the previous frame has already been potentially lost, so an // incomplete frame is better than nothing, so this takes highest precidence. if (resourceless_software_draw_) draw_result = DRAW_SUCCESS; #if DCHECK_IS_ON() for (const auto& render_pass : frame->render_passes) { for (const auto& quad : render_pass->quad_list) DCHECK(quad->shared_quad_state); } DCHECK(frame->render_passes.back()->output_rect.origin().IsOrigin()); #endif if (!active_tree_->has_transparent_background()) { frame->render_passes.back()->has_transparent_background = false; AppendQuadsToFillScreen( active_tree_->RootScrollLayerDeviceViewportBounds(), frame->render_passes.back().get(), active_tree_->root_layer(), active_tree_->background_color(), unoccluded_screen_space_region); } RemoveRenderPasses(frame); renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes); // Any copy requests left in the tree are not going to get serviced, and // should be aborted. std::vector<std::unique_ptr<CopyOutputRequest>> requests_to_abort; while (!active_tree_->LayersWithCopyOutputRequest().empty()) { LayerImpl* layer = active_tree_->LayersWithCopyOutputRequest().back(); layer->TakeCopyRequestsAndTransformToTarget(&requests_to_abort); } for (size_t i = 0; i < requests_to_abort.size(); ++i) requests_to_abort[i]->SendEmptyResult(); // If we're making a frame to draw, it better have at least one render pass. DCHECK(!frame->render_passes.empty()); if (active_tree_->has_ever_been_drawn()) { UMA_HISTOGRAM_COUNTS_100( "Compositing.RenderPass.AppendQuadData.NumMissingTiles", num_missing_tiles); UMA_HISTOGRAM_COUNTS_100( "Compositing.RenderPass.AppendQuadData.NumIncompleteTiles", num_incomplete_tiles); UMA_HISTOGRAM_COUNTS( "Compositing.RenderPass.AppendQuadData." "CheckerboardedNoRecordingContentArea", checkerboarded_no_recording_content_area); UMA_HISTOGRAM_COUNTS( "Compositing.RenderPass.AppendQuadData." "CheckerboardedNeedRasterContentArea", checkerboarded_needs_raster_content_area); } // Should only have one render pass in resourceless software mode. DCHECK(draw_mode != DRAW_MODE_RESOURCELESS_SOFTWARE || frame->render_passes.size() == 1u) << frame->render_passes.size(); TRACE_EVENT_END2("cc", "LayerTreeHostImpl::CalculateRenderPasses", "draw_result", draw_result, "missing tiles", num_missing_tiles); // Draw has to be successful to not drop the copy request layer. // When we have a copy request for a layer, we need to draw even if there // would be animating checkerboards, because failing under those conditions // triggers a new main frame, which may cause the copy request layer to be // destroyed. // TODO(weiliangc): Test copy request w/ output surface recreation. Would // trigger this DCHECK. DCHECK(!have_copy_request || draw_result == DRAW_SUCCESS); // TODO(crbug.com/564832): This workaround to prevent creating unnecessarily // persistent render passes. When a copy request is made, it may force a // separate render pass for the layer, which will persist until a new commit // removes it. Force a commit after copy requests, to remove extra render // passes. if (have_copy_request) client_->SetNeedsCommitOnImplThread(); return draw_result; } void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { top_controls_manager_->MainThreadHasStoppedFlinging(); if (input_handler_client_) input_handler_client_->MainThreadHasStoppedFlinging(); } void LayerTreeHostImpl::DidAnimateScrollOffset() { client_->SetNeedsCommitOnImplThread(); client_->RenewTreePriority(); } void LayerTreeHostImpl::SetViewportDamage(const gfx::Rect& damage_rect) { viewport_damage_rect_.Union(damage_rect); } DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) { TRACE_EVENT1("cc", "LayerTreeHostImpl::PrepareToDraw", "SourceFrameNumber", active_tree_->source_frame_number()); if (input_handler_client_) input_handler_client_->ReconcileElasticOverscrollAndRootScroll(); if (const char* client_name = GetClientNameForMetrics()) { size_t total_picture_memory = 0; for (const PictureLayerImpl* layer : active_tree()->picture_layers()) total_picture_memory += layer->GetRasterSource()->GetPictureMemoryUsage(); if (total_picture_memory != 0) { // GetClientNameForMetrics only returns one non-null value over the // lifetime of the process, so this histogram name is runtime constant. UMA_HISTOGRAM_COUNTS( base::StringPrintf("Compositing.%s.PictureMemoryUsageKb", client_name), base::saturated_cast<int>(total_picture_memory / 1024)); } // GetClientNameForMetrics only returns one non-null value over the lifetime // of the process, so this histogram name is runtime constant. UMA_HISTOGRAM_CUSTOM_COUNTS( base::StringPrintf("Compositing.%s.NumActiveLayers", client_name), base::saturated_cast<int>(active_tree_->NumLayers()), 1, 400, 20); } bool update_lcd_text = false; bool ok = active_tree_->UpdateDrawProperties(update_lcd_text); DCHECK(ok) << "UpdateDrawProperties failed during draw"; // This will cause NotifyTileStateChanged() to be called for any tiles that // completed, which will add damage for visible tiles to the frame for them so // they appear as part of the current frame being drawn. tile_manager_->Flush(); frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList(); frame->render_passes.clear(); frame->will_draw_layers.clear(); frame->has_no_damage = false; if (active_tree_->root_layer()) { gfx::Rect device_viewport_damage_rect = viewport_damage_rect_; viewport_damage_rect_ = gfx::Rect(); active_tree_->root_layer()->render_surface()->damage_tracker()-> AddDamageNextUpdate(device_viewport_damage_rect); } DrawResult draw_result = CalculateRenderPasses(frame); if (draw_result != DRAW_SUCCESS) { DCHECK(!resourceless_software_draw_); return draw_result; } // If we return DRAW_SUCCESS, then we expect DrawLayers() to be called before // this function is called again. return draw_result; } void LayerTreeHostImpl::RemoveRenderPasses(FrameData* frame) { // There is always at least a root RenderPass. DCHECK_GE(frame->render_passes.size(), 1u); // A set of RenderPasses that we have seen. std::set<RenderPassId> pass_exists; // A set of RenderPassDrawQuads that we have seen (stored by the RenderPasses // they refer to). base::SmallMap<std::unordered_map<RenderPassId, int, RenderPassIdHash>> pass_references; // Iterate RenderPasses in draw order, removing empty render passes (except // the root RenderPass). for (size_t i = 0; i < frame->render_passes.size(); ++i) { RenderPass* pass = frame->render_passes[i].get(); // Remove orphan RenderPassDrawQuads. for (auto it = pass->quad_list.begin(); it != pass->quad_list.end();) { if (it->material != DrawQuad::RENDER_PASS) { ++it; continue; } const RenderPassDrawQuad* quad = RenderPassDrawQuad::MaterialCast(*it); // If the RenderPass doesn't exist, we can remove the quad. if (pass_exists.count(quad->render_pass_id)) { // Otherwise, save a reference to the RenderPass so we know there's a // quad using it. pass_references[quad->render_pass_id]++; ++it; } else { it = pass->quad_list.EraseAndInvalidateAllPointers(it); } } if (i == frame->render_passes.size() - 1) { // Don't remove the root RenderPass. break; } if (pass->quad_list.empty() && pass->copy_requests.empty()) { // Remove the pass and decrement |i| to counter the for loop's increment, // so we don't skip the next pass in the loop. frame->render_passes.erase(frame->render_passes.begin() + i); --i; continue; } pass_exists.insert(pass->id); } // Remove RenderPasses that are not referenced by any draw quads or copy // requests (except the root RenderPass). for (size_t i = 0; i < frame->render_passes.size() - 1; ++i) { // Iterating from the back of the list to the front, skipping over the // back-most (root) pass, in order to remove each qualified RenderPass, and // drop references to earlier RenderPasses allowing them to be removed to. RenderPass* pass = frame->render_passes[frame->render_passes.size() - 2 - i].get(); if (!pass->copy_requests.empty()) continue; if (pass_references[pass->id]) continue; for (auto it = pass->quad_list.begin(); it != pass->quad_list.end(); ++it) { if (it->material != DrawQuad::RENDER_PASS) continue; const RenderPassDrawQuad* quad = RenderPassDrawQuad::MaterialCast(*it); pass_references[quad->render_pass_id]--; } frame->render_passes.erase(frame->render_passes.end() - 2 - i); --i; } } void LayerTreeHostImpl::EvictTexturesForTesting() { UpdateTileManagerMemoryPolicy(ManagedMemoryPolicy(0)); } void LayerTreeHostImpl::BlockNotifyReadyToActivateForTesting(bool block) { NOTREACHED(); } void LayerTreeHostImpl::ResetTreesForTesting() { if (active_tree_) active_tree_->ClearLayers(); active_tree_ = LayerTreeImpl::create(this, active_tree()->page_scale_factor(), active_tree()->top_controls_shown_ratio(), active_tree()->elastic_overscroll()); active_tree_->property_trees()->is_active = true; if (pending_tree_) pending_tree_->ClearLayers(); pending_tree_ = nullptr; if (recycle_tree_) recycle_tree_->ClearLayers(); recycle_tree_ = nullptr; } size_t LayerTreeHostImpl::SourceAnimationFrameNumberForTesting() const { return fps_counter_->current_frame_number(); } void LayerTreeHostImpl::UpdateTileManagerMemoryPolicy( const ManagedMemoryPolicy& policy) { if (!resource_pool_) return; global_tile_state_.hard_memory_limit_in_bytes = 0; global_tile_state_.soft_memory_limit_in_bytes = 0; if (visible_ && policy.bytes_limit_when_visible > 0) { global_tile_state_.hard_memory_limit_in_bytes = policy.bytes_limit_when_visible; global_tile_state_.soft_memory_limit_in_bytes = (static_cast<int64_t>(global_tile_state_.hard_memory_limit_in_bytes) * settings_.max_memory_for_prepaint_percentage) / 100; } global_tile_state_.memory_limit_policy = ManagedMemoryPolicy::PriorityCutoffToTileMemoryLimitPolicy( visible_ ? policy.priority_cutoff_when_visible : gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING); global_tile_state_.num_resources_limit = policy.num_resources_limit; if (global_tile_state_.hard_memory_limit_in_bytes > 0) { // If |global_tile_state_.hard_memory_limit_in_bytes| is greater than 0, we // allow the worker context and image decode controller to retain allocated // resources. Notify them here. If the memory policy has become zero, we'll // handle the notification in NotifyAllTileTasksCompleted, after // in-progress work finishes. if (output_surface_) { output_surface_->SetWorkerContextShouldAggressivelyFreeResources( false /* aggressively_free_resources */); } if (image_decode_controller_) { image_decode_controller_->SetShouldAggressivelyFreeResources( false /* aggressively_free_resources */); } } DCHECK(resource_pool_); resource_pool_->CheckBusyResources(); // Soft limit is used for resource pool such that memory returns to soft // limit after going over. resource_pool_->SetResourceUsageLimits( global_tile_state_.soft_memory_limit_in_bytes, global_tile_state_.num_resources_limit); DidModifyTilePriorities(); } void LayerTreeHostImpl::DidModifyTilePriorities() { // Mark priorities as dirty and schedule a PrepareTiles(). tile_priorities_dirty_ = true; client_->SetNeedsPrepareTilesOnImplThread(); } std::unique_ptr<RasterTilePriorityQueue> LayerTreeHostImpl::BuildRasterQueue( TreePriority tree_priority, RasterTilePriorityQueue::Type type) { TRACE_EVENT0("disabled-by-default-cc.debug", "LayerTreeHostImpl::BuildRasterQueue"); return RasterTilePriorityQueue::Create(active_tree_->picture_layers(), pending_tree_ ? pending_tree_->picture_layers() : std::vector<PictureLayerImpl*>(), tree_priority, type); } std::unique_ptr<EvictionTilePriorityQueue> LayerTreeHostImpl::BuildEvictionQueue(TreePriority tree_priority) { TRACE_EVENT0("disabled-by-default-cc.debug", "LayerTreeHostImpl::BuildEvictionQueue"); std::unique_ptr<EvictionTilePriorityQueue> queue( new EvictionTilePriorityQueue); queue->Build(active_tree_->picture_layers(), pending_tree_ ? pending_tree_->picture_layers() : std::vector<PictureLayerImpl*>(), tree_priority); return queue; } void LayerTreeHostImpl::SetIsLikelyToRequireADraw( bool is_likely_to_require_a_draw) { // Proactively tell the scheduler that we expect to draw within each vsync // until we get all the tiles ready to draw. If we happen to miss a required // for draw tile here, then we will miss telling the scheduler each frame that // we intend to draw so it may make worse scheduling decisions. is_likely_to_require_a_draw_ = is_likely_to_require_a_draw; } void LayerTreeHostImpl::NotifyReadyToActivate() { client_->NotifyReadyToActivate(); } void LayerTreeHostImpl::NotifyReadyToDraw() { // Tiles that are ready will cause NotifyTileStateChanged() to be called so we // don't need to schedule a draw here. Just stop WillBeginImplFrame() from // causing optimistic requests to draw a frame. is_likely_to_require_a_draw_ = false; client_->NotifyReadyToDraw(); } void LayerTreeHostImpl::NotifyAllTileTasksCompleted() { // The tile tasks started by the most recent call to PrepareTiles have // completed. Now is a good time to free resources if necessary. if (global_tile_state_.hard_memory_limit_in_bytes == 0) { // Free image decode controller resources before worker context resources. // This ensures that the imaged decode controller has released all Skia refs // at the time Skia's cleanup executes (within worker context's cleanup). if (image_decode_controller_) { image_decode_controller_->SetShouldAggressivelyFreeResources( true /* aggressively_free_resources */); } if (output_surface_) { output_surface_->SetWorkerContextShouldAggressivelyFreeResources( true /* aggressively_free_resources */); } } } void LayerTreeHostImpl::NotifyTileStateChanged(const Tile* tile) { TRACE_EVENT0("cc", "LayerTreeHostImpl::NotifyTileStateChanged"); if (active_tree_) { LayerImpl* layer_impl = active_tree_->FindActiveTreeLayerById(tile->layer_id()); if (layer_impl) layer_impl->NotifyTileStateChanged(tile); } if (pending_tree_) { LayerImpl* layer_impl = pending_tree_->FindPendingTreeLayerById(tile->layer_id()); if (layer_impl) layer_impl->NotifyTileStateChanged(tile); } // Check for a non-null active tree to avoid doing this during shutdown. if (active_tree_ && !client_->IsInsideDraw() && tile->required_for_draw()) { // The LayerImpl::NotifyTileStateChanged() should damage the layer, so this // redraw will make those tiles be displayed. SetNeedsRedraw(); } } void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { SetManagedMemoryPolicy(policy); // This is short term solution to synchronously drop tile resources when // using synchronous compositing to avoid memory usage regression. // TODO(boliu): crbug.com/499004 to track removing this. if (!policy.bytes_limit_when_visible && resource_pool_ && settings_.using_synchronous_renderer_compositor) { ReleaseTreeResources(); CleanUpTileManagerAndUIResources(); // Force a call to NotifyAllTileTasks completed - otherwise this logic may // be skipped if no work was enqueued at the time the tile manager was // destroyed. NotifyAllTileTasksCompleted(); CreateTileManagerResources(); RecreateTreeResources(); } } void LayerTreeHostImpl::SetTreeActivationCallback( const base::Closure& callback) { DCHECK(task_runner_provider_->IsImplThread()); tree_activation_callback_ = callback; } void LayerTreeHostImpl::SetManagedMemoryPolicy( const ManagedMemoryPolicy& policy) { if (cached_managed_memory_policy_ == policy) return; ManagedMemoryPolicy old_policy = ActualManagedMemoryPolicy(); cached_managed_memory_policy_ = policy; ManagedMemoryPolicy actual_policy = ActualManagedMemoryPolicy(); if (old_policy == actual_policy) return; if (!task_runner_provider_->HasImplThread()) { // In single-thread mode, this can be called on the main thread by // GLRenderer::OnMemoryAllocationChanged. DebugScopedSetImplThread impl_thread(task_runner_provider_); UpdateTileManagerMemoryPolicy(actual_policy); } else { DCHECK(task_runner_provider_->IsImplThread()); UpdateTileManagerMemoryPolicy(actual_policy); } // If there is already enough memory to draw everything imaginable and the // new memory limit does not change this, then do not re-commit. Don't bother // skipping commits if this is not visible (commits don't happen when not // visible, there will almost always be a commit when this becomes visible). bool needs_commit = true; if (visible() && actual_policy.bytes_limit_when_visible >= max_memory_needed_bytes_ && old_policy.bytes_limit_when_visible >= max_memory_needed_bytes_ && actual_policy.priority_cutoff_when_visible == old_policy.priority_cutoff_when_visible) { needs_commit = false; } if (needs_commit) client_->SetNeedsCommitOnImplThread(); } void LayerTreeHostImpl::SetExternalTilePriorityConstraints( const gfx::Rect& viewport_rect, const gfx::Transform& transform) { gfx::Rect viewport_rect_for_tile_priority_in_view_space; gfx::Transform screen_to_view(gfx::Transform::kSkipInitialization); if (transform.GetInverse(&screen_to_view)) { // Convert from screen space to view space. viewport_rect_for_tile_priority_in_view_space = MathUtil::ProjectEnclosingClippedRect(screen_to_view, viewport_rect); } const bool tile_priority_params_changed = viewport_rect_for_tile_priority_ != viewport_rect_for_tile_priority_in_view_space; viewport_rect_for_tile_priority_ = viewport_rect_for_tile_priority_in_view_space; if (tile_priority_params_changed) { active_tree_->set_needs_update_draw_properties(); if (pending_tree_) pending_tree_->set_needs_update_draw_properties(); // Compositor, not OutputSurface, is responsible for setting damage and // triggering redraw for constraint changes. SetFullRootLayerDamage(); SetNeedsRedraw(); } } void LayerTreeHostImpl::SetNeedsRedrawRect(const gfx::Rect& damage_rect) { if (damage_rect.IsEmpty()) return; NotifySwapPromiseMonitorsOfSetNeedsRedraw(); client_->SetNeedsRedrawRectOnImplThread(damage_rect); } void LayerTreeHostImpl::DidSwapBuffers() { client_->DidSwapBuffersOnImplThread(); } void LayerTreeHostImpl::DidSwapBuffersComplete() { client_->DidSwapBuffersCompleteOnImplThread(); } void LayerTreeHostImpl::ReclaimResources(const CompositorFrameAck* ack) { // TODO(piman): We may need to do some validation on this ack before // processing it. if (renderer_) renderer_->ReceiveSwapBuffersAck(*ack); // In OOM, we now might be able to release more resources that were held // because they were exported. if (resource_pool_) { if (resource_pool_->memory_usage_bytes()) { const size_t kMegabyte = 1024 * 1024; // This is a good time to log memory usage. A chunk of work has just // completed but none of the memory used for that work has likely been // freed. UMA_HISTOGRAM_MEMORY_MB( "Renderer4.ResourcePoolMemoryUsage", static_cast<int>(resource_pool_->memory_usage_bytes() / kMegabyte)); } resource_pool_->CheckBusyResources(); resource_pool_->ReduceResourceUsage(); } // If we're not visible, we likely released resources, so we want to // aggressively flush here to make sure those DeleteTextures make it to the // GPU process to free up the memory. if (output_surface_->context_provider() && !visible_) { output_surface_->context_provider()->ContextGL()->ShallowFlushCHROMIUM(); } } void LayerTreeHostImpl::OnDraw(const gfx::Transform& transform, const gfx::Rect& viewport, const gfx::Rect& clip, bool resourceless_software_draw) { DCHECK(!resourceless_software_draw_); const bool transform_changed = external_transform_ != transform; const bool viewport_changed = external_viewport_ != viewport; const bool clip_changed = external_clip_ != clip; external_transform_ = transform; external_viewport_ = viewport; external_clip_ = clip; { base::AutoReset<bool> resourceless_software_draw_reset( &resourceless_software_draw_, resourceless_software_draw); // For resourceless software draw, always set full damage to ensure they // always swap. Otherwise, need to set redraw for any changes to draw // parameters. const bool draw_params_changed = transform_changed || viewport_changed || clip_changed; if (resourceless_software_draw_ || draw_params_changed) { SetFullRootLayerDamage(); SetNeedsRedraw(); } // UpdateDrawProperties does not depend on clip. if (transform_changed || viewport_changed || resourceless_software_draw_) { active_tree_->set_needs_update_draw_properties(); } if (resourceless_software_draw) { client_->OnCanDrawStateChanged(CanDraw()); } client_->OnDrawForOutputSurface(resourceless_software_draw_); } if (resourceless_software_draw) { active_tree_->set_needs_update_draw_properties(); client_->OnCanDrawStateChanged(CanDraw()); // This draw may have reset all damage, which would lead to subsequent // incorrect hardware draw, so explicitly set damage for next hardware // draw as well. SetFullRootLayerDamage(); } } void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { client_->OnCanDrawStateChanged(CanDraw()); } CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { CompositorFrameMetadata metadata; metadata.device_scale_factor = active_tree_->painted_device_scale_factor() * active_tree_->device_scale_factor(); metadata.page_scale_factor = active_tree_->current_page_scale_factor(); metadata.scrollable_viewport_size = active_tree_->ScrollableViewportSize(); metadata.root_layer_size = active_tree_->ScrollableSize(); metadata.min_page_scale_factor = active_tree_->min_page_scale_factor(); metadata.max_page_scale_factor = active_tree_->max_page_scale_factor(); metadata.location_bar_offset = gfx::Vector2dF(0.f, top_controls_manager_->ControlsTopOffset()); metadata.location_bar_content_translation = gfx::Vector2dF(0.f, top_controls_manager_->ContentTopOffset()); metadata.root_background_color = active_tree_->background_color(); active_tree_->GetViewportSelection(&metadata.selection); if (OuterViewportScrollLayer()) { metadata.root_overflow_x_hidden = !OuterViewportScrollLayer()->user_scrollable_horizontal(); metadata.root_overflow_y_hidden = !OuterViewportScrollLayer()->user_scrollable_vertical(); } for (LayerImpl* surface_layer : active_tree_->SurfaceLayers()) { metadata.referenced_surfaces.push_back( static_cast<SurfaceLayerImpl*>(surface_layer)->surface_id()); } if (!InnerViewportScrollLayer()) return metadata; metadata.root_overflow_x_hidden |= !InnerViewportScrollLayer()->user_scrollable_horizontal(); metadata.root_overflow_y_hidden |= !InnerViewportScrollLayer()->user_scrollable_vertical(); // TODO(miletus) : Change the metadata to hold ScrollOffset. metadata.root_scroll_offset = gfx::ScrollOffsetToVector2dF( active_tree_->TotalScrollOffset()); return metadata; } void LayerTreeHostImpl::DrawLayers(FrameData* frame) { TRACE_EVENT0("cc", "LayerTreeHostImpl::DrawLayers"); base::TimeTicks frame_begin_time = CurrentBeginFrameArgs().frame_time; DCHECK(CanDraw()); if (frame->has_no_damage) { TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoDamage", TRACE_EVENT_SCOPE_THREAD); DCHECK(!resourceless_software_draw_); return; } DCHECK(!frame->render_passes.empty()); fps_counter_->SaveTimeStamp(frame_begin_time, !output_surface_->context_provider()); rendering_stats_instrumentation_->IncrementFrameCount(1); memory_history_->SaveEntry(tile_manager_->memory_stats_from_last_assign()); if (debug_state_.ShowHudRects()) { debug_rect_history_->SaveDebugRectsForCurrentFrame( active_tree_->root_layer(), active_tree_->hud_layer(), *frame->render_surface_layer_list, debug_state_); } bool is_new_trace; TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); if (is_new_trace) { if (pending_tree_) { LayerTreeHostCommon::CallFunctionForEveryLayer( pending_tree(), [](LayerImpl* layer) { layer->DidBeginTracing(); }); } LayerTreeHostCommon::CallFunctionForEveryLayer( active_tree(), [](LayerImpl* layer) { layer->DidBeginTracing(); }); } { TRACE_EVENT0("cc", "DrawLayers.FrameViewerTracing"); TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( frame_viewer_instrumentation::kCategoryLayerTree, "cc::LayerTreeHostImpl", id_, AsValueWithFrame(frame)); } const DrawMode draw_mode = GetDrawMode(); // Because the contents of the HUD depend on everything else in the frame, the // contents of its texture are updated as the last thing before the frame is // drawn. if (active_tree_->hud_layer()) { TRACE_EVENT0("cc", "DrawLayers.UpdateHudTexture"); active_tree_->hud_layer()->UpdateHudTexture(draw_mode, resource_provider_.get()); } if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE) { bool disable_picture_quad_image_filtering = IsActivelyScrolling() || animation_host_->NeedsAnimateLayers(); // We must disable the image hijack canvas when using GPU rasterization but // performing a resourceless software draw. Otherwise, we will attempt to // use the GPU ImageDecodeController during software raster. bool use_image_hijack_canvas = !use_gpu_rasterization_; std::unique_ptr<SoftwareRenderer> temp_software_renderer = SoftwareRenderer::Create(this, &settings_.renderer_settings, output_surface_, nullptr, use_image_hijack_canvas); temp_software_renderer->DrawFrame( &frame->render_passes, active_tree_->device_scale_factor(), DeviceViewport(), DeviceClip(), disable_picture_quad_image_filtering); } else { renderer_->DrawFrame(&frame->render_passes, active_tree_->device_scale_factor(), DeviceViewport(), DeviceClip(), false); } // The render passes should be consumed by the renderer. DCHECK(frame->render_passes.empty()); // The next frame should start by assuming nothing has changed, and changes // are noted as they occur. // TODO(boliu): If we did a temporary software renderer frame, propogate the // damage forward to the next frame. for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> DidDrawDamagedArea(); } active_tree_->ResetAllChangeTracking(); active_tree_->set_has_ever_been_drawn(true); devtools_instrumentation::DidDrawFrame(id_); benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( rendering_stats_instrumentation_->impl_thread_rendering_stats()); rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); } void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); for (auto& it : video_frame_controllers_) it->DidDrawFrame(); } void LayerTreeHostImpl::FinishAllRendering() { if (renderer_) renderer_->Finish(); } int LayerTreeHostImpl::RequestedMSAASampleCount() const { if (settings_.gpu_rasterization_msaa_sample_count == -1) { // Use the most up-to-date version of device_scale_factor that we have. float device_scale_factor = pending_tree_ ? pending_tree_->device_scale_factor() : active_tree_->device_scale_factor(); return device_scale_factor >= 2.0f ? 4 : 8; } return settings_.gpu_rasterization_msaa_sample_count; } bool LayerTreeHostImpl::CanUseGpuRasterization() { if (!(output_surface_ && output_surface_->context_provider() && output_surface_->worker_context_provider())) return false; ContextProvider* context_provider = output_surface_->worker_context_provider(); ContextProvider::ScopedContextLock scoped_context(context_provider); if (!context_provider->GrContext()) return false; return true; } void LayerTreeHostImpl::UpdateGpuRasterizationStatus() { bool use_gpu = false; bool use_msaa = false; bool using_msaa_for_complex_content = renderer() && RequestedMSAASampleCount() > 0 && GetRendererCapabilities().max_msaa_samples >= RequestedMSAASampleCount(); if (settings_.gpu_rasterization_forced) { use_gpu = true; gpu_rasterization_status_ = GpuRasterizationStatus::ON_FORCED; use_msaa = !content_is_suitable_for_gpu_rasterization_ && using_msaa_for_complex_content; if (use_msaa) { gpu_rasterization_status_ = GpuRasterizationStatus::MSAA_CONTENT; } } else if (!settings_.gpu_rasterization_enabled) { gpu_rasterization_status_ = GpuRasterizationStatus::OFF_DEVICE; } else if (!has_gpu_rasterization_trigger_) { gpu_rasterization_status_ = GpuRasterizationStatus::OFF_VIEWPORT; } else if (content_is_suitable_for_gpu_rasterization_) { use_gpu = true; gpu_rasterization_status_ = GpuRasterizationStatus::ON; } else if (using_msaa_for_complex_content) { use_gpu = use_msaa = true; gpu_rasterization_status_ = GpuRasterizationStatus::MSAA_CONTENT; } else { gpu_rasterization_status_ = GpuRasterizationStatus::OFF_CONTENT; } if (use_gpu && !use_gpu_rasterization_) { if (!CanUseGpuRasterization()) { // If GPU rasterization is unusable, e.g. if GlContext could not // be created due to losing the GL context, force use of software // raster. use_gpu = false; use_msaa = false; gpu_rasterization_status_ = GpuRasterizationStatus::OFF_DEVICE; } } if (use_gpu == use_gpu_rasterization_ && use_msaa == use_msaa_) return; // Note that this must happen first, in case the rest of the calls want to // query the new state of |use_gpu_rasterization_|. use_gpu_rasterization_ = use_gpu; use_msaa_ = use_msaa; tree_resources_for_gpu_rasterization_dirty_ = true; } void LayerTreeHostImpl::UpdateTreeResourcesForGpuRasterizationIfNeeded() { if (!tree_resources_for_gpu_rasterization_dirty_) return; // Clean up and replace existing tile manager with another one that uses // appropriate rasterizer. Only do this however if we already have a // resource pool, since otherwise we might not be able to create a new // one. ReleaseTreeResources(); if (resource_pool_) { CleanUpTileManagerAndUIResources(); CreateTileManagerResources(); } RecreateTreeResources(); // We have released tilings for both active and pending tree. // We would not have any content to draw until the pending tree is activated. // Prevent the active tree from drawing until activation. // TODO(crbug.com/469175): Replace with RequiresHighResToDraw. SetRequiresHighResToDraw(); tree_resources_for_gpu_rasterization_dirty_ = false; } const RendererCapabilitiesImpl& LayerTreeHostImpl::GetRendererCapabilities() const { CHECK(renderer_); return renderer_->Capabilities(); } bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { ResetRequiresHighResToDraw(); if (frame.has_no_damage) { active_tree()->BreakSwapPromises(SwapPromise::SWAP_FAILS); return false; } CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); active_tree()->FinishSwapPromises(&metadata); for (auto& latency : metadata.latency_info) { TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", TRACE_ID_DONT_MANGLE(latency.trace_id()), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step", "SwapBuffers"); // Only add the latency component once for renderer swap, not the browser // swap. if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 0, nullptr)) { latency.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 0, 0); } } renderer_->SwapBuffers(metadata); return true; } void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) { current_begin_frame_tracker_.Start(args); if (is_likely_to_require_a_draw_) { // Optimistically schedule a draw. This will let us expect the tile manager // to complete its work so that we can draw new tiles within the impl frame // we are beginning now. SetNeedsRedraw(); } Animate(); for (auto& it : video_frame_controllers_) it->OnBeginFrame(args); } void LayerTreeHostImpl::DidFinishImplFrame() { current_begin_frame_tracker_.Finish(); } void LayerTreeHostImpl::UpdateViewportContainerSizes() { LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer(); LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer(); if (!inner_container) return; ViewportAnchor anchor(InnerViewportScrollLayer(), OuterViewportScrollLayer()); float top_controls_layout_height = active_tree_->top_controls_shrink_blink_size() ? active_tree_->top_controls_height() : 0.f; float delta_from_top_controls = top_controls_layout_height - top_controls_manager_->ContentTopOffset(); // Adjust the viewport layers by shrinking/expanding the container to account // for changes in the size (e.g. top controls) since the last resize from // Blink. gfx::Vector2dF amount_to_expand( 0.f, delta_from_top_controls); inner_container->SetBoundsDelta(amount_to_expand); if (outer_container && !outer_container->BoundsForScrolling().IsEmpty()) { // Adjust the outer viewport container as well, since adjusting only the // inner may cause its bounds to exceed those of the outer, causing scroll // clamping. gfx::Vector2dF amount_to_expand_scaled = gfx::ScaleVector2d( amount_to_expand, 1.f / active_tree_->min_page_scale_factor()); outer_container->SetBoundsDelta(amount_to_expand_scaled); active_tree_->InnerViewportScrollLayer()->SetBoundsDelta( amount_to_expand_scaled); anchor.ResetViewportToAnchoredPosition(); } } void LayerTreeHostImpl::SynchronouslyInitializeAllTiles() { // Only valid for the single-threaded non-scheduled/synchronous case // using the zero copy raster worker pool. single_thread_synchronous_task_graph_runner_->RunUntilIdle(); } void LayerTreeHostImpl::DidLoseOutputSurface() { if (resource_provider_) resource_provider_->DidLoseOutputSurface(); client_->DidLoseOutputSurfaceOnImplThread(); } bool LayerTreeHostImpl::HaveRootScrollLayer() const { return !!InnerViewportScrollLayer(); } LayerImpl* LayerTreeHostImpl::RootLayer() const { return active_tree_->root_layer(); } LayerImpl* LayerTreeHostImpl::InnerViewportScrollLayer() const { return active_tree_->InnerViewportScrollLayer(); } LayerImpl* LayerTreeHostImpl::OuterViewportScrollLayer() const { return active_tree_->OuterViewportScrollLayer(); } LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const { return active_tree_->CurrentlyScrollingLayer(); } bool LayerTreeHostImpl::IsActivelyScrolling() const { if (!CurrentlyScrollingLayer()) return false; // On Android WebView root flings are controlled by the application, // so the compositor does not animate them and can't tell if they // are actually animating. So assume there are none. if (settings_.ignore_root_layer_flings && IsCurrentlyScrollingInnerViewport()) return false; return did_lock_scrolling_layer_; } void LayerTreeHostImpl::CreatePendingTree() { CHECK(!pending_tree_); if (recycle_tree_) recycle_tree_.swap(pending_tree_); else pending_tree_ = LayerTreeImpl::create(this, active_tree()->page_scale_factor(), active_tree()->top_controls_shown_ratio(), active_tree()->elastic_overscroll()); client_->OnCanDrawStateChanged(CanDraw()); TRACE_EVENT_ASYNC_BEGIN0("cc", "PendingTree:waiting", pending_tree_.get()); } void LayerTreeHostImpl::ActivateSyncTree() { if (pending_tree_) { TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get()); // Process any requests in the UI resource queue. The request queue is // given in LayerTreeHost::FinishCommitOnImplThread. This must take place // before the swap. pending_tree_->ProcessUIResourceRequestQueue(); if (pending_tree_->needs_full_tree_sync()) { TreeSynchronizer::SynchronizeTrees(pending_tree_->root_layer(), active_tree_.get()); } // Property trees may store damage status. We preserve the active tree // damage status by pushing the damage status from active tree property // trees to pending tree property trees or by moving it onto the layers. if (active_tree_->property_trees()->changed) { if (pending_tree_->property_trees()->sequence_number == active_tree_->property_trees()->sequence_number) active_tree_->property_trees()->PushChangeTrackingTo( pending_tree_->property_trees()); else active_tree_->MoveChangeTrackingToLayers(); } active_tree_->property_trees()->PushOpacityIfNeeded( pending_tree_->property_trees()); TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree()); pending_tree_->PushPropertiesTo(active_tree_.get()); if (pending_tree_->root_layer()) pending_tree_->property_trees()->ResetAllChangeTracking(); // Now that we've synced everything from the pending tree to the active // tree, rename the pending tree the recycle tree so we can reuse it on the // next sync. DCHECK(!recycle_tree_); pending_tree_.swap(recycle_tree_); // If we commit to the active tree directly, this is already done during // commit. ActivateAnimations(); } else { active_tree_->ProcessUIResourceRequestQueue(); } // bounds_delta isn't a pushed property, so the newly-pushed property tree // won't already account for current bounds_delta values. This needs to // happen before calling UpdateViewportContainerSizes(). active_tree_->UpdatePropertyTreesForBoundsDelta(); UpdateViewportContainerSizes(); active_tree_->DidBecomeActive(); client_->RenewTreePriority(); // If we have any picture layers, then by activating we also modified tile // priorities. if (!active_tree_->picture_layers().empty()) DidModifyTilePriorities(); client_->OnCanDrawStateChanged(CanDraw()); client_->DidActivateSyncTree(); if (!tree_activation_callback_.is_null()) tree_activation_callback_.Run(); std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation = active_tree_->TakePendingPageScaleAnimation(); if (pending_page_scale_animation) { StartPageScaleAnimation( pending_page_scale_animation->target_offset, pending_page_scale_animation->use_anchor, pending_page_scale_animation->scale, pending_page_scale_animation->duration); } // Activation can change the root scroll offset, so inform the synchronous // input handler. UpdateRootLayerStateForSynchronousInputHandler(); } void LayerTreeHostImpl::SetVisible(bool visible) { DCHECK(task_runner_provider_->IsImplThread()); if (visible_ == visible) return; visible_ = visible; DidVisibilityChange(this, visible_); UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); // If we just became visible, we have to ensure that we draw high res tiles, // to prevent checkerboard/low res flashes. if (visible_) { // TODO(crbug.com/469175): Replace with RequiresHighResToDraw. SetRequiresHighResToDraw(); } else { EvictAllUIResources(); } // Call PrepareTiles to evict tiles when we become invisible. if (!visible) PrepareTiles(); if (!renderer_) return; renderer_->SetVisible(visible); } void LayerTreeHostImpl::SetNeedsOneBeginImplFrame() { // TODO(miletus): This is just the compositor-thread-side call to the // SwapPromiseMonitor to say something happened that may cause a swap in the // future. The name should not refer to SetNeedsRedraw but it does for now. NotifySwapPromiseMonitorsOfSetNeedsRedraw(); client_->SetNeedsOneBeginImplFrameOnImplThread(); } void LayerTreeHostImpl::SetNeedsRedraw() { NotifySwapPromiseMonitorsOfSetNeedsRedraw(); client_->SetNeedsRedrawOnImplThread(); } ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const { ManagedMemoryPolicy actual = cached_managed_memory_policy_; if (debug_state_.rasterize_only_visible_content) { actual.priority_cutoff_when_visible = gpu::MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY; } else if (use_gpu_rasterization()) { actual.priority_cutoff_when_visible = gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; } return actual; } size_t LayerTreeHostImpl::memory_allocation_limit_bytes() const { return ActualManagedMemoryPolicy().bytes_limit_when_visible; } void LayerTreeHostImpl::ReleaseTreeResources() { active_tree_->ReleaseResources(); if (pending_tree_) pending_tree_->ReleaseResources(); if (recycle_tree_) recycle_tree_->ReleaseResources(); EvictAllUIResources(); } void LayerTreeHostImpl::RecreateTreeResources() { active_tree_->RecreateResources(); if (pending_tree_) pending_tree_->RecreateResources(); if (recycle_tree_) recycle_tree_->RecreateResources(); } void LayerTreeHostImpl::CreateAndSetRenderer() { DCHECK(!renderer_); DCHECK(output_surface_); DCHECK(resource_provider_); if (output_surface_->capabilities().delegated_rendering) { renderer_ = DelegatingRenderer::Create(this, &settings_.renderer_settings, output_surface_, resource_provider_.get()); } else if (output_surface_->context_provider()) { renderer_ = GLRenderer::Create( this, &settings_.renderer_settings, output_surface_, resource_provider_.get(), texture_mailbox_deleter_.get(), settings_.renderer_settings.highp_threshold_min); } else if (output_surface_->software_device()) { renderer_ = SoftwareRenderer::Create( this, &settings_.renderer_settings, output_surface_, resource_provider_.get(), true /* use_image_hijack_canvas */); } DCHECK(renderer_); renderer_->SetVisible(visible_); SetFullRootLayerDamage(); // See note in LayerTreeImpl::UpdateDrawProperties. Renderer needs to be // initialized to get max texture size. Also, after releasing resources, // trees need another update to generate new ones. active_tree_->set_needs_update_draw_properties(); if (pending_tree_) pending_tree_->set_needs_update_draw_properties(); client_->UpdateRendererCapabilitiesOnImplThread(); } void LayerTreeHostImpl::CreateTileManagerResources() { std::unique_ptr<RasterBufferProvider> raster_buffer_provider; CreateResourceAndRasterBufferProvider(&raster_buffer_provider, &resource_pool_); if (use_gpu_rasterization_) { image_decode_controller_ = base::WrapUnique(new GpuImageDecodeController( output_surface_->worker_context_provider(), settings_.renderer_settings.preferred_tile_format)); } else { image_decode_controller_ = base::WrapUnique(new SoftwareImageDecodeController( settings_.renderer_settings.preferred_tile_format)); } // Pass the single-threaded synchronous task graph runner to the worker pool // if we're in synchronous single-threaded mode. TaskGraphRunner* task_graph_runner = task_graph_runner_; if (is_synchronous_single_threaded_) { DCHECK(!single_thread_synchronous_task_graph_runner_); single_thread_synchronous_task_graph_runner_.reset( new SynchronousTaskGraphRunner); task_graph_runner = single_thread_synchronous_task_graph_runner_.get(); } tile_task_manager_ = TileTaskManagerImpl::Create( std::move(raster_buffer_provider), task_graph_runner); // TODO(vmpstr): Initialize tile task limit at ctor time. tile_manager_->SetResources( resource_pool_.get(), image_decode_controller_.get(), tile_task_manager_.get(), is_synchronous_single_threaded_ ? std::numeric_limits<size_t>::max() : settings_.scheduled_raster_task_limit, use_gpu_rasterization_); UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); } void LayerTreeHostImpl::CreateResourceAndRasterBufferProvider( std::unique_ptr<RasterBufferProvider>* raster_buffer_provider, std::unique_ptr<ResourcePool>* resource_pool) { DCHECK(GetTaskRunner()); // TODO(vmpstr): Make this a DCHECK (or remove) when crbug.com/419086 is // resolved. CHECK(resource_provider_); ContextProvider* context_provider = output_surface_->context_provider(); if (!context_provider) { *resource_pool = ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); *raster_buffer_provider = BitmapRasterBufferProvider::Create(resource_provider_.get()); return; } if (use_gpu_rasterization_) { DCHECK(resource_provider_->output_surface()->worker_context_provider()); *resource_pool = ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); int msaa_sample_count = use_msaa_ ? RequestedMSAASampleCount() : 0; *raster_buffer_provider = GpuRasterBufferProvider::Create( context_provider, resource_provider_.get(), settings_.use_distance_field_text, msaa_sample_count); return; } DCHECK(GetRendererCapabilities().using_image); bool use_zero_copy = settings_.use_zero_copy; // TODO(reveman): Remove this when mojo supports worker contexts. // crbug.com/522440 if (!resource_provider_->output_surface()->worker_context_provider()) { LOG(ERROR) << "Forcing zero-copy tile initialization as worker context is missing"; use_zero_copy = true; } if (use_zero_copy) { *resource_pool = ResourcePool::CreateForGpuMemoryBufferResources( resource_provider_.get(), GetTaskRunner()); *raster_buffer_provider = ZeroCopyRasterBufferProvider::Create( resource_provider_.get(), settings_.renderer_settings.preferred_tile_format); return; } *resource_pool = ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); const int max_copy_texture_chromium_size = context_provider->ContextCapabilities().max_copy_texture_chromium_size; *raster_buffer_provider = OneCopyRasterBufferProvider::Create( GetTaskRunner(), context_provider, resource_provider_.get(), max_copy_texture_chromium_size, settings_.use_partial_raster, settings_.max_staging_buffer_usage_in_bytes, settings_.renderer_settings.preferred_tile_format); } void LayerTreeHostImpl::SetLayerTreeMutator(LayerTreeMutator* mutator) { TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "LayerTreeHostImpl::SetLayerTreeMutator"); mutator_ = mutator; } void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() { ClearUIResources(); tile_manager_->FinishTasksAndCleanUp(); resource_pool_ = nullptr; tile_task_manager_ = nullptr; single_thread_synchronous_task_graph_runner_ = nullptr; image_decode_controller_ = nullptr; } void LayerTreeHostImpl::ReleaseOutputSurface() { TRACE_EVENT0("cc", "LayerTreeHostImpl::ReleaseOutputSurface"); // Since we will create a new resource provider, we cannot continue to use // the old resources (i.e. render_surfaces and texture IDs). Clear them // before we destroy the old resource provider. ReleaseTreeResources(); // Note: order is important here. renderer_ = nullptr; CleanUpTileManagerAndUIResources(); resource_provider_ = nullptr; // Detach from the old output surface and reset |output_surface_| pointer // as this surface is going to be destroyed independent of if binding the // new output surface succeeds or not. if (output_surface_) { output_surface_->DetachFromClient(); output_surface_ = nullptr; } // We don't know if the next OutputSurface will support GPU rasterization. // Make sure to clear the flag so that we force a re-computation. use_gpu_rasterization_ = false; } bool LayerTreeHostImpl::InitializeRenderer(OutputSurface* output_surface) { TRACE_EVENT0("cc", "LayerTreeHostImpl::InitializeRenderer"); ReleaseOutputSurface(); if (!output_surface->BindToClient(this)) { // Avoid recreating tree resources because we might not have enough // information to do this yet (eg. we don't have a TileManager at this // point). return false; } output_surface_ = output_surface; resource_provider_ = ResourceProvider::Create( output_surface_, shared_bitmap_manager_, gpu_memory_buffer_manager_, task_runner_provider_->blocking_main_thread_task_runner(), settings_.renderer_settings.highp_threshold_min, settings_.renderer_settings.texture_id_allocation_chunk_size, settings_.renderer_settings.use_gpu_memory_buffer_resources, settings_.use_image_texture_targets); CreateAndSetRenderer(); // Since the new renderer may be capable of MSAA, update status here. UpdateGpuRasterizationStatus(); CreateTileManagerResources(); RecreateTreeResources(); // Initialize vsync parameters to sane values. const base::TimeDelta display_refresh_interval = base::TimeDelta::FromMicroseconds( base::Time::kMicrosecondsPerSecond / settings_.renderer_settings.refresh_rate); CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); // TODO(brianderson): Don't use a hard-coded parent draw time. base::TimeDelta parent_draw_time = (!settings_.use_external_begin_frame_source && output_surface_->capabilities().adjust_deadline_for_parent) ? BeginFrameArgs::DefaultEstimatedParentDrawTime() : base::TimeDelta(); client_->SetEstimatedParentDrawTime(parent_draw_time); DCHECK_EQ(1, output_surface_->capabilities().max_frames_pending); client_->OnCanDrawStateChanged(CanDraw()); // There will not be anything to draw here, so set high res // to avoid checkerboards, typically when we are recovering // from lost context. // TODO(crbug.com/469175): Replace with RequiresHighResToDraw. SetRequiresHighResToDraw(); return true; } void LayerTreeHostImpl::CommitVSyncParameters(base::TimeTicks timebase, base::TimeDelta interval) { client_->CommitVSyncParameters(timebase, interval); } void LayerTreeHostImpl::SetBeginFrameSource(BeginFrameSource* source) { client_->SetBeginFrameSource(source); } void LayerTreeHostImpl::SetViewportSize(const gfx::Size& device_viewport_size) { if (device_viewport_size == device_viewport_size_) return; TRACE_EVENT_INSTANT2("cc", "LayerTreeHostImpl::SetViewportSize", TRACE_EVENT_SCOPE_THREAD, "width", device_viewport_size.width(), "height", device_viewport_size.height()); if (pending_tree_) active_tree_->SetViewportSizeInvalid(); device_viewport_size_ = device_viewport_size; UpdateViewportContainerSizes(); client_->OnCanDrawStateChanged(CanDraw()); SetFullRootLayerDamage(); active_tree_->set_needs_update_draw_properties(); } const gfx::Rect LayerTreeHostImpl::ViewportRectForTilePriority() const { if (viewport_rect_for_tile_priority_.IsEmpty()) return DeviceViewport(); return viewport_rect_for_tile_priority_; } gfx::Size LayerTreeHostImpl::DrawViewportSize() const { return DeviceViewport().size(); } gfx::Rect LayerTreeHostImpl::DeviceViewport() const { if (external_viewport_.IsEmpty()) return gfx::Rect(device_viewport_size_); return external_viewport_; } gfx::Rect LayerTreeHostImpl::DeviceClip() const { if (external_clip_.IsEmpty()) return DeviceViewport(); return external_clip_; } const gfx::Transform& LayerTreeHostImpl::DrawTransform() const { return external_transform_; } void LayerTreeHostImpl::DidChangeTopControlsPosition() { UpdateViewportContainerSizes(); SetNeedsRedraw(); SetNeedsOneBeginImplFrame(); active_tree_->set_needs_update_draw_properties(); SetFullRootLayerDamage(); } float LayerTreeHostImpl::TopControlsHeight() const { return active_tree_->top_controls_height(); } void LayerTreeHostImpl::SetCurrentTopControlsShownRatio(float ratio) { if (active_tree_->SetCurrentTopControlsShownRatio(ratio)) DidChangeTopControlsPosition(); } float LayerTreeHostImpl::CurrentTopControlsShownRatio() const { return active_tree_->CurrentTopControlsShownRatio(); } void LayerTreeHostImpl::BindToClient(InputHandlerClient* client) { DCHECK(input_handler_client_ == NULL); input_handler_client_ = client; } InputHandler::ScrollStatus LayerTreeHostImpl::TryScroll( const gfx::PointF& screen_space_point, InputHandler::ScrollInputType type, const ScrollTree& scroll_tree, ScrollNode* scroll_node) const { InputHandler::ScrollStatus scroll_status; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollingOnMain; if (!!scroll_node->data.main_thread_scrolling_reasons) { TRACE_EVENT0("cc", "LayerImpl::TryScroll: Failed ShouldScrollOnMainThread"); scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD; scroll_status.main_thread_scrolling_reasons = scroll_node->data.main_thread_scrolling_reasons; return scroll_status; } gfx::Transform screen_space_transform = scroll_tree.ScreenSpaceTransform(scroll_node->id); if (!screen_space_transform.IsInvertible()) { TRACE_EVENT0("cc", "LayerImpl::TryScroll: Ignored NonInvertibleTransform"); scroll_status.thread = InputHandler::SCROLL_IGNORED; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNonInvertibleTransform; return scroll_status; } if (scroll_node->data.contains_non_fast_scrollable_region) { bool clipped = false; gfx::Transform inverse_screen_space_transform( gfx::Transform::kSkipInitialization); if (!screen_space_transform.GetInverse(&inverse_screen_space_transform)) { // TODO(shawnsingh): We shouldn't be applying a projection if screen space // transform is uninvertible here. Perhaps we should be returning // SCROLL_ON_MAIN_THREAD in this case? } gfx::PointF hit_test_point_in_layer_space = MathUtil::ProjectPoint( inverse_screen_space_transform, screen_space_point, &clipped); if (!clipped && active_tree() ->LayerById(scroll_node->owner_id) ->non_fast_scrollable_region() .Contains(gfx::ToRoundedPoint(hit_test_point_in_layer_space))) { TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed NonFastScrollableRegion"); scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNonFastScrollableRegion; return scroll_status; } } if (IsWheelBasedScroll(type) && !active_tree()->settings().use_mouse_wheel_gestures) { EventListenerProperties event_properties = active_tree()->event_listener_properties( EventListenerClass::kMouseWheel); if (event_properties != EventListenerProperties::kNone) { TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed WheelEventHandlers"); scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kEventHandlers; return scroll_status; } } if (!scroll_node->data.scrollable) { TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored not scrollable"); scroll_status.thread = InputHandler::SCROLL_IGNORED; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollable; return scroll_status; } gfx::ScrollOffset max_scroll_offset = scroll_tree.MaxScrollOffset(scroll_node->id); if (max_scroll_offset.x() <= 0 && max_scroll_offset.y() <= 0) { TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored. Technically scrollable," " but has no affordance in either direction."); scroll_status.thread = InputHandler::SCROLL_IGNORED; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollable; return scroll_status; } scroll_status.thread = InputHandler::SCROLL_ON_IMPL_THREAD; return scroll_status; } LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint( const gfx::PointF& device_viewport_point, InputHandler::ScrollInputType type, LayerImpl* layer_impl, bool* scroll_on_main_thread, uint32_t* main_thread_scrolling_reasons) const { DCHECK(scroll_on_main_thread); DCHECK(main_thread_scrolling_reasons); *main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollingOnMain; // Walk up the hierarchy and look for a scrollable layer. LayerImpl* potentially_scrolling_layer_impl = NULL; if (layer_impl) { ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; ScrollNode* scroll_node = scroll_tree.Node(layer_impl->scroll_tree_index()); for (; scroll_tree.parent(scroll_node); scroll_node = scroll_tree.parent(scroll_node)) { // The content layer can also block attempts to scroll outside the main // thread. ScrollStatus status = TryScroll(device_viewport_point, type, scroll_tree, scroll_node); if (status.thread == SCROLL_ON_MAIN_THREAD) { if (!!scroll_node->data.main_thread_scrolling_reasons) { DCHECK(MainThreadScrollingReason::MainThreadCanSetScrollReasons( status.main_thread_scrolling_reasons)); } else { DCHECK(MainThreadScrollingReason::CompositorCanSetScrollReasons( status.main_thread_scrolling_reasons)); } *scroll_on_main_thread = true; *main_thread_scrolling_reasons = status.main_thread_scrolling_reasons; return NULL; } if (status.thread == InputHandler::SCROLL_ON_IMPL_THREAD && !potentially_scrolling_layer_impl) { potentially_scrolling_layer_impl = active_tree_->LayerById(scroll_node->owner_id); } } } // Falling back to the root scroll layer ensures generation of root overscroll // notifications while preventing scroll updates from being unintentionally // forwarded to the main thread. The inner viewport layer represents the // viewport during scrolling. if (!potentially_scrolling_layer_impl) potentially_scrolling_layer_impl = InnerViewportScrollLayer(); // The inner viewport layer represents the viewport. if (potentially_scrolling_layer_impl == OuterViewportScrollLayer()) potentially_scrolling_layer_impl = InnerViewportScrollLayer(); return potentially_scrolling_layer_impl; } // Similar to LayerImpl::HasAncestor, but walks up the scroll parents. static bool HasScrollAncestor(LayerImpl* child, LayerImpl* scroll_ancestor) { DCHECK(scroll_ancestor); if (!child) return false; ScrollTree& scroll_tree = child->layer_tree_impl()->property_trees()->scroll_tree; ScrollNode* scroll_node = scroll_tree.Node(child->scroll_tree_index()); for (; scroll_tree.parent(scroll_node); scroll_node = scroll_tree.parent(scroll_node)) { if (scroll_node->data.scrollable) return scroll_node->owner_id == scroll_ancestor->id(); } return false; } InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl( ScrollState* scroll_state, LayerImpl* scrolling_layer_impl, InputHandler::ScrollInputType type) { DCHECK(scroll_state); DCHECK(scroll_state->delta_x() == 0 && scroll_state->delta_y() == 0); InputHandler::ScrollStatus scroll_status; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollingOnMain; if (!scrolling_layer_impl) { scroll_status.thread = SCROLL_IGNORED; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNoScrollingLayer; return scroll_status; } scroll_status.thread = SCROLL_ON_IMPL_THREAD; ScrollAnimationAbort(scrolling_layer_impl); top_controls_manager_->ScrollBegin(); active_tree_->SetCurrentlyScrollingLayer(scrolling_layer_impl); // TODO(majidvp): get rid of wheel_scrolling_ and set is_direct_manipulation // in input_handler_proxy instead. wheel_scrolling_ = IsWheelBasedScroll(type); scroll_state->set_is_direct_manipulation(!wheel_scrolling_); // Invoke |DistributeScrollDelta| even with zero delta and velocity to ensure // scroll customization callbacks are invoked. DistributeScrollDelta(scroll_state); client_->RenewTreePriority(); RecordCompositorSlowScrollMetric(type, CC_THREAD); return scroll_status; } InputHandler::ScrollStatus LayerTreeHostImpl::RootScrollBegin( ScrollState* scroll_state, InputHandler::ScrollInputType type) { TRACE_EVENT0("cc", "LayerTreeHostImpl::RootScrollBegin"); ClearCurrentlyScrollingLayer(); return ScrollBeginImpl(scroll_state, InnerViewportScrollLayer(), type); } InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin( ScrollState* scroll_state, InputHandler::ScrollInputType type) { ScrollStatus scroll_status; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollingOnMain; TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin"); ClearCurrentlyScrollingLayer(); gfx::Point viewport_point(scroll_state->position_x(), scroll_state->position_y()); gfx::PointF device_viewport_point = gfx::ScalePoint( gfx::PointF(viewport_point), active_tree_->device_scale_factor()); LayerImpl* layer_impl = active_tree_->FindLayerThatIsHitByPoint(device_viewport_point); if (layer_impl) { LayerImpl* scroll_layer_impl = active_tree_->FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint( device_viewport_point); if (scroll_layer_impl && !HasScrollAncestor(layer_impl, scroll_layer_impl)) { scroll_status.thread = SCROLL_UNKNOWN; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kFailedHitTest; return scroll_status; } } bool scroll_on_main_thread = false; LayerImpl* scrolling_layer_impl = FindScrollLayerForDeviceViewportPoint( device_viewport_point, type, layer_impl, &scroll_on_main_thread, &scroll_status.main_thread_scrolling_reasons); if (scrolling_layer_impl) scroll_affects_scroll_handler_ = scrolling_layer_impl->layer_tree_impl()->have_scroll_event_handlers(); if (scroll_on_main_thread) { RecordCompositorSlowScrollMetric(type, MAIN_THREAD); scroll_status.thread = SCROLL_ON_MAIN_THREAD; return scroll_status; } return ScrollBeginImpl(scroll_state, scrolling_layer_impl, type); } InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimatedBegin( const gfx::Point& viewport_point) { InputHandler::ScrollStatus scroll_status; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollingOnMain; ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); if (scroll_node) { gfx::Vector2dF delta; if (ScrollAnimationUpdateTarget(scroll_node, delta)) { scroll_status.thread = SCROLL_ON_IMPL_THREAD; } else { scroll_status.thread = SCROLL_IGNORED; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollable; } return scroll_status; } ScrollStateData scroll_state_data; scroll_state_data.position_x = viewport_point.x(); scroll_state_data.position_y = viewport_point.y(); scroll_state_data.is_in_inertial_phase = true; ScrollState scroll_state(scroll_state_data); // ScrollAnimated is used for animated wheel scrolls. We find the first layer // that can scroll and set up an animation of its scroll offset. Note that // this does not currently go through the scroll customization machinery // that ScrollBy uses for non-animated wheel scrolls. scroll_status = ScrollBegin(&scroll_state, WHEEL); scroll_node = scroll_tree.CurrentlyScrollingNode(); if (scroll_status.thread == SCROLL_ON_IMPL_THREAD) { ScrollStateData scroll_state_end_data; scroll_state_end_data.is_ending = true; ScrollState scroll_state_end(scroll_state_end_data); ScrollEnd(&scroll_state_end); } return scroll_status; } gfx::Vector2dF LayerTreeHostImpl::ComputeScrollDelta( ScrollNode* scroll_node, const gfx::Vector2dF& delta) { ScrollTree& scroll_tree = active_tree()->property_trees()->scroll_tree; float scale_factor = active_tree()->current_page_scale_factor(); gfx::Vector2dF adjusted_scroll(delta); adjusted_scroll.Scale(1.f / scale_factor); if (!scroll_node->data.user_scrollable_horizontal) adjusted_scroll.set_x(0); if (!scroll_node->data.user_scrollable_vertical) adjusted_scroll.set_y(0); gfx::ScrollOffset old_offset = scroll_tree.current_scroll_offset(scroll_node->owner_id); gfx::ScrollOffset new_offset = scroll_tree.ClampScrollOffsetToLimits( old_offset + gfx::ScrollOffset(adjusted_scroll), scroll_node); gfx::ScrollOffset scrolled = new_offset - old_offset; return gfx::Vector2dF(scrolled.x(), scrolled.y()); } bool LayerTreeHostImpl::ScrollAnimationCreate(ScrollNode* scroll_node, const gfx::Vector2dF& delta) { ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; const float kEpsilon = 0.1f; bool scroll_animated = (std::abs(delta.x()) > kEpsilon || std::abs(delta.y()) > kEpsilon); if (!scroll_animated) { scroll_tree.ScrollBy(scroll_node, delta, active_tree()); return false; } scroll_tree.set_currently_scrolling_node(scroll_node->id); gfx::ScrollOffset current_offset = scroll_tree.current_scroll_offset(scroll_node->owner_id); gfx::ScrollOffset target_offset = scroll_tree.ClampScrollOffsetToLimits( current_offset + gfx::ScrollOffset(delta), scroll_node); animation_host_->ImplOnlyScrollAnimationCreate(scroll_node->owner_id, target_offset, current_offset); SetNeedsOneBeginImplFrame(); return true; } InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated( const gfx::Point& viewport_point, const gfx::Vector2dF& scroll_delta) { InputHandler::ScrollStatus scroll_status; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollingOnMain; ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); if (scroll_node) { gfx::Vector2dF delta = scroll_delta; if (!scroll_node->data.user_scrollable_horizontal) delta.set_x(0); if (!scroll_node->data.user_scrollable_vertical) delta.set_y(0); if (ScrollAnimationUpdateTarget(scroll_node, delta)) { scroll_status.thread = SCROLL_ON_IMPL_THREAD; } else { scroll_status.thread = SCROLL_IGNORED; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollable; } return scroll_status; } ScrollStateData scroll_state_data; scroll_state_data.position_x = viewport_point.x(); scroll_state_data.position_y = viewport_point.y(); scroll_state_data.is_in_inertial_phase = true; ScrollState scroll_state(scroll_state_data); // ScrollAnimated is used for animated wheel scrolls. We find the first layer // that can scroll and set up an animation of its scroll offset. Note that // this does not currently go through the scroll customization machinery // that ScrollBy uses for non-animated wheel scrolls. scroll_status = ScrollBegin(&scroll_state, WHEEL); scroll_node = scroll_tree.CurrentlyScrollingNode(); if (scroll_status.thread == SCROLL_ON_IMPL_THREAD) { gfx::Vector2dF pending_delta = scroll_delta; if (scroll_node) { for (; scroll_tree.parent(scroll_node); scroll_node = scroll_tree.parent(scroll_node)) { if (!scroll_node->data.scrollable || scroll_node->data.is_outer_viewport_scroll_layer) continue; if (scroll_node->data.is_inner_viewport_scroll_layer) { gfx::Vector2dF scrolled = viewport()->ScrollAnimated(pending_delta); // Viewport::ScrollAnimated returns pending_delta as long as it // starts an animation. if (scrolled == pending_delta) return scroll_status; pending_delta -= scrolled; continue; } gfx::Vector2dF scroll_delta = ComputeScrollDelta(scroll_node, pending_delta); if (ScrollAnimationCreate(scroll_node, scroll_delta)) return scroll_status; pending_delta -= scroll_delta; } } } scroll_state.set_is_ending(true); ScrollEnd(&scroll_state); return scroll_status; } gfx::Vector2dF LayerTreeHostImpl::ScrollNodeWithViewportSpaceDelta( ScrollNode* scroll_node, const gfx::PointF& viewport_point, const gfx::Vector2dF& viewport_delta, ScrollTree* scroll_tree) { // Layers with non-invertible screen space transforms should not have passed // the scroll hit test in the first place. const gfx::Transform screen_space_transform = scroll_tree->ScreenSpaceTransform(scroll_node->id); DCHECK(screen_space_transform.IsInvertible()); gfx::Transform inverse_screen_space_transform( gfx::Transform::kSkipInitialization); bool did_invert = screen_space_transform.GetInverse(&inverse_screen_space_transform); // TODO(shawnsingh): With the advent of impl-side scrolling for non-root // layers, we may need to explicitly handle uninvertible transforms here. DCHECK(did_invert); float scale_from_viewport_to_screen_space = active_tree_->device_scale_factor(); gfx::PointF screen_space_point = gfx::ScalePoint(viewport_point, scale_from_viewport_to_screen_space); gfx::Vector2dF screen_space_delta = viewport_delta; screen_space_delta.Scale(scale_from_viewport_to_screen_space); // First project the scroll start and end points to local layer space to find // the scroll delta in layer coordinates. bool start_clipped, end_clipped; gfx::PointF screen_space_end_point = screen_space_point + screen_space_delta; gfx::PointF local_start_point = MathUtil::ProjectPoint(inverse_screen_space_transform, screen_space_point, &start_clipped); gfx::PointF local_end_point = MathUtil::ProjectPoint(inverse_screen_space_transform, screen_space_end_point, &end_clipped); // In general scroll point coordinates should not get clipped. DCHECK(!start_clipped); DCHECK(!end_clipped); if (start_clipped || end_clipped) return gfx::Vector2dF(); // Apply the scroll delta. gfx::ScrollOffset previous_offset = scroll_tree->current_scroll_offset(scroll_node->owner_id); scroll_tree->ScrollBy(scroll_node, local_end_point - local_start_point, active_tree()); gfx::ScrollOffset scrolled = scroll_tree->current_scroll_offset(scroll_node->owner_id) - previous_offset; // Get the end point in the layer's content space so we can apply its // ScreenSpaceTransform. gfx::PointF actual_local_end_point = local_start_point + gfx::Vector2dF(scrolled.x(), scrolled.y()); // Calculate the applied scroll delta in viewport space coordinates. gfx::PointF actual_screen_space_end_point = MathUtil::MapPoint( screen_space_transform, actual_local_end_point, &end_clipped); DCHECK(!end_clipped); if (end_clipped) return gfx::Vector2dF(); gfx::PointF actual_viewport_end_point = gfx::ScalePoint(actual_screen_space_end_point, 1.f / scale_from_viewport_to_screen_space); return actual_viewport_end_point - viewport_point; } static gfx::Vector2dF ScrollNodeWithLocalDelta( ScrollNode* scroll_node, const gfx::Vector2dF& local_delta, float page_scale_factor, LayerTreeImpl* layer_tree_impl) { ScrollTree& scroll_tree = layer_tree_impl->property_trees()->scroll_tree; gfx::ScrollOffset previous_offset = scroll_tree.current_scroll_offset(scroll_node->owner_id); gfx::Vector2dF delta = local_delta; delta.Scale(1.f / page_scale_factor); scroll_tree.ScrollBy(scroll_node, delta, layer_tree_impl); gfx::ScrollOffset scrolled = scroll_tree.current_scroll_offset(scroll_node->owner_id) - previous_offset; gfx::Vector2dF consumed_scroll(scrolled.x(), scrolled.y()); consumed_scroll.Scale(page_scale_factor); return consumed_scroll; } // TODO(danakj): Make this into two functions, one with delta, one with // viewport_point, no bool required. gfx::Vector2dF LayerTreeHostImpl::ScrollSingleNode( ScrollNode* scroll_node, const gfx::Vector2dF& delta, const gfx::Point& viewport_point, bool is_direct_manipulation, ScrollTree* scroll_tree) { // Events representing direct manipulation of the screen (such as gesture // events) need to be transformed from viewport coordinates to local layer // coordinates so that the scrolling contents exactly follow the user's // finger. In contrast, events not representing direct manipulation of the // screen (such as wheel events) represent a fixed amount of scrolling so we // can just apply them directly, but the page scale factor is applied to the // scroll delta. if (is_direct_manipulation) { return ScrollNodeWithViewportSpaceDelta( scroll_node, gfx::PointF(viewport_point), delta, scroll_tree); } float scale_factor = active_tree()->current_page_scale_factor(); return ScrollNodeWithLocalDelta(scroll_node, delta, scale_factor, active_tree()); } void LayerTreeHostImpl::ApplyScroll(ScrollNode* scroll_node, ScrollState* scroll_state) { DCHECK(scroll_state); gfx::Point viewport_point(scroll_state->position_x(), scroll_state->position_y()); const gfx::Vector2dF delta(scroll_state->delta_x(), scroll_state->delta_y()); gfx::Vector2dF applied_delta; // TODO(tdresser): Use a more rational epsilon. See crbug.com/510550 for // details. const float kEpsilon = 0.1f; if (scroll_node->data.is_inner_viewport_scroll_layer) { bool affect_top_controls = !wheel_scrolling_; Viewport::ScrollResult result = viewport()->ScrollBy( delta, viewport_point, scroll_state->is_direct_manipulation(), affect_top_controls); applied_delta = result.consumed_delta; scroll_state->set_caused_scroll( std::abs(result.content_scrolled_delta.x()) > kEpsilon, std::abs(result.content_scrolled_delta.y()) > kEpsilon); scroll_state->ConsumeDelta(applied_delta.x(), applied_delta.y()); } else { applied_delta = ScrollSingleNode( scroll_node, delta, viewport_point, scroll_state->is_direct_manipulation(), &scroll_state->layer_tree_impl()->property_trees()->scroll_tree); } // If the layer wasn't able to move, try the next one in the hierarchy. bool scrolled = std::abs(applied_delta.x()) > kEpsilon; scrolled = scrolled || std::abs(applied_delta.y()) > kEpsilon; if (scrolled && !scroll_node->data.is_inner_viewport_scroll_layer) { // If the applied delta is within 45 degrees of the input // delta, bail out to make it easier to scroll just one layer // in one direction without affecting any of its parents. float angle_threshold = 45; if (MathUtil::SmallestAngleBetweenVectors(applied_delta, delta) < angle_threshold) { applied_delta = delta; } else { // Allow further movement only on an axis perpendicular to the direction // in which the layer moved. applied_delta = MathUtil::ProjectVector(delta, applied_delta); } scroll_state->set_caused_scroll(std::abs(applied_delta.x()) > kEpsilon, std::abs(applied_delta.y()) > kEpsilon); scroll_state->ConsumeDelta(applied_delta.x(), applied_delta.y()); } if (!scrolled) return; scroll_state->set_current_native_scrolling_node(scroll_node); } void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) { // TODO(majidvp): in Blink we compute scroll chain only at scroll begin which // is not the case here. We eventually want to have the same behaviour on both // sides but it may become a non issue if we get rid of scroll chaining (see // crbug.com/526462) std::list<const ScrollNode*> current_scroll_chain; ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); if (scroll_node) { for (; scroll_tree.parent(scroll_node); scroll_node = scroll_tree.parent(scroll_node)) { // Skip the outer viewport scroll layer so that we try to scroll the // viewport only once. i.e. The inner viewport layer represents the // viewport. if (!scroll_node->data.scrollable || scroll_node->data.is_outer_viewport_scroll_layer) continue; current_scroll_chain.push_front(scroll_node); } } scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain, active_tree()); scroll_state->DistributeToScrollChainDescendant(); } InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( ScrollState* scroll_state) { DCHECK(scroll_state); TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); if (!CurrentlyScrollingLayer()) return InputHandlerScrollResult(); float initial_top_controls_offset = top_controls_manager_->ControlsTopOffset(); scroll_state->set_delta_consumed_for_scroll_sequence( did_lock_scrolling_layer_); scroll_state->set_is_direct_manipulation(!wheel_scrolling_); scroll_state->set_current_native_scrolling_node( active_tree()->property_trees()->scroll_tree.CurrentlyScrollingNode()); DistributeScrollDelta(scroll_state); active_tree_->SetCurrentlyScrollingLayer(active_tree_->LayerById( scroll_state->current_native_scrolling_node()->owner_id)); did_lock_scrolling_layer_ = scroll_state->delta_consumed_for_scroll_sequence(); bool did_scroll_x = scroll_state->caused_scroll_x(); bool did_scroll_y = scroll_state->caused_scroll_y(); bool did_scroll_content = did_scroll_x || did_scroll_y; if (did_scroll_content) { // If we are scrolling with an active scroll handler, forward latency // tracking information to the main thread so the delay introduced by the // handler is accounted for. if (scroll_affects_scroll_handler()) NotifySwapPromiseMonitorsOfForwardingToMainThread(); client_->SetNeedsCommitOnImplThread(); SetNeedsRedraw(); client_->RenewTreePriority(); } // Scrolling along an axis resets accumulated root overscroll for that axis. if (did_scroll_x) accumulated_root_overscroll_.set_x(0); if (did_scroll_y) accumulated_root_overscroll_.set_y(0); gfx::Vector2dF unused_root_delta(scroll_state->delta_x(), scroll_state->delta_y()); // When inner viewport is unscrollable, disable overscrolls. if (InnerViewportScrollLayer()) { if (!InnerViewportScrollLayer()->user_scrollable_horizontal()) unused_root_delta.set_x(0); if (!InnerViewportScrollLayer()->user_scrollable_vertical()) unused_root_delta.set_y(0); } accumulated_root_overscroll_ += unused_root_delta; bool did_scroll_top_controls = initial_top_controls_offset != top_controls_manager_->ControlsTopOffset(); InputHandlerScrollResult scroll_result; scroll_result.did_scroll = did_scroll_content || did_scroll_top_controls; scroll_result.did_overscroll_root = !unused_root_delta.IsZero(); scroll_result.accumulated_root_overscroll = accumulated_root_overscroll_; scroll_result.unused_scroll_delta = unused_root_delta; if (scroll_result.did_scroll) { // Scrolling can change the root scroll offset, so inform the synchronous // input handler. UpdateRootLayerStateForSynchronousInputHandler(); } return scroll_result; } // This implements scrolling by page as described here: // http://msdn.microsoft.com/en-us/library/windows/desktop/ms645601(v=vs.85).aspx#_win32_The_Mouse_Wheel // for events with WHEEL_PAGESCROLL set. bool LayerTreeHostImpl::ScrollVerticallyByPage(const gfx::Point& viewport_point, ScrollDirection direction) { DCHECK(wheel_scrolling_); ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); if (scroll_node) { for (; scroll_tree.parent(scroll_node); scroll_node = scroll_tree.parent(scroll_node)) { // The inner viewport layer represents the viewport. if (!scroll_node->data.scrollable || scroll_node->data.is_outer_viewport_scroll_layer) continue; float height = scroll_tree.scroll_clip_layer_bounds(scroll_node->id).height(); // These magical values match WebKit and are designed to scroll nearly the // entire visible content height but leave a bit of overlap. float page = std::max(height * 0.875f, 1.f); if (direction == SCROLL_BACKWARD) page = -page; gfx::Vector2dF delta = gfx::Vector2dF(0.f, page); gfx::Vector2dF applied_delta = ScrollNodeWithLocalDelta(scroll_node, delta, 1.f, active_tree()); if (!applied_delta.IsZero()) { client_->SetNeedsCommitOnImplThread(); SetNeedsRedraw(); client_->RenewTreePriority(); return true; } scroll_tree.set_currently_scrolling_node(scroll_node->id); } } return false; } void LayerTreeHostImpl::RequestUpdateForSynchronousInputHandler() { UpdateRootLayerStateForSynchronousInputHandler(); } void LayerTreeHostImpl::SetSynchronousInputHandlerRootScrollOffset( const gfx::ScrollOffset& root_offset) { bool changed = active_tree_->DistributeRootScrollOffset(root_offset); if (!changed) return; client_->SetNeedsCommitOnImplThread(); // After applying the synchronous input handler's scroll offset, tell it what // we ended up with. UpdateRootLayerStateForSynchronousInputHandler(); SetFullRootLayerDamage(); SetNeedsRedraw(); } void LayerTreeHostImpl::ClearCurrentlyScrollingLayer() { active_tree_->ClearCurrentlyScrollingLayer(); did_lock_scrolling_layer_ = false; scroll_affects_scroll_handler_ = false; accumulated_root_overscroll_ = gfx::Vector2dF(); } void LayerTreeHostImpl::ScrollEnd(ScrollState* scroll_state) { DCHECK(scroll_state); DCHECK(scroll_state->delta_x() == 0 && scroll_state->delta_y() == 0); DistributeScrollDelta(scroll_state); top_controls_manager_->ScrollEnd(); ClearCurrentlyScrollingLayer(); } InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() { InputHandler::ScrollStatus scroll_status; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollingOnMain; if (!CurrentlyScrollingLayer()) { scroll_status.thread = SCROLL_IGNORED; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNoScrollingLayer; } else { scroll_status.thread = SCROLL_ON_IMPL_THREAD; } return scroll_status; } float LayerTreeHostImpl::DeviceSpaceDistanceToLayer( const gfx::PointF& device_viewport_point, LayerImpl* layer_impl) { if (!layer_impl) return std::numeric_limits<float>::max(); gfx::Rect layer_impl_bounds(layer_impl->bounds()); gfx::RectF device_viewport_layer_impl_bounds = MathUtil::MapClippedRect( layer_impl->ScreenSpaceTransform(), gfx::RectF(layer_impl_bounds)); return device_viewport_layer_impl_bounds.ManhattanDistanceToPoint( device_viewport_point); } void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) { gfx::PointF device_viewport_point = gfx::ScalePoint( gfx::PointF(viewport_point), active_tree_->device_scale_factor()); LayerImpl* layer_impl = active_tree_->FindLayerThatIsHitByPoint(device_viewport_point); HandleMouseOverScrollbar(layer_impl); if (scroll_layer_id_when_mouse_over_scrollbar_ != Layer::INVALID_ID) return; bool scroll_on_main_thread = false; uint32_t main_thread_scrolling_reasons; LayerImpl* scroll_layer_impl = FindScrollLayerForDeviceViewportPoint( device_viewport_point, InputHandler::TOUCHSCREEN, layer_impl, &scroll_on_main_thread, &main_thread_scrolling_reasons); if (scroll_layer_impl == InnerViewportScrollLayer()) scroll_layer_impl = OuterViewportScrollLayer(); if (scroll_on_main_thread || !scroll_layer_impl) return; ScrollbarAnimationController* animation_controller = ScrollbarAnimationControllerForId(scroll_layer_impl->id()); if (!animation_controller) return; float distance_to_scrollbar = std::numeric_limits<float>::max(); for (ScrollbarLayerImplBase* scrollbar : ScrollbarsFor(scroll_layer_impl->id())) distance_to_scrollbar = std::min(distance_to_scrollbar, DeviceSpaceDistanceToLayer(device_viewport_point, scrollbar)); animation_controller->DidMouseMoveNear(distance_to_scrollbar / active_tree_->device_scale_factor()); } void LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl) { int new_id = Layer::INVALID_ID; if (layer_impl && layer_impl->ToScrollbarLayer()) new_id = layer_impl->ToScrollbarLayer()->ScrollLayerId(); if (new_id == scroll_layer_id_when_mouse_over_scrollbar_) return; ScrollbarAnimationController* old_animation_controller = ScrollbarAnimationControllerForId( scroll_layer_id_when_mouse_over_scrollbar_); if (old_animation_controller) old_animation_controller->DidMouseMoveOffScrollbar(); scroll_layer_id_when_mouse_over_scrollbar_ = new_id; ScrollbarAnimationController* new_animation_controller = ScrollbarAnimationControllerForId( scroll_layer_id_when_mouse_over_scrollbar_); if (new_animation_controller) new_animation_controller->DidMouseMoveNear(0); } void LayerTreeHostImpl::PinchGestureBegin() { pinch_gesture_active_ = true; client_->RenewTreePriority(); pinch_gesture_end_should_clear_scrolling_layer_ = !CurrentlyScrollingLayer(); active_tree_->SetCurrentlyScrollingLayer( active_tree_->InnerViewportScrollLayer()); top_controls_manager_->PinchBegin(); } void LayerTreeHostImpl::PinchGestureUpdate(float magnify_delta, const gfx::Point& anchor) { TRACE_EVENT0("cc", "LayerTreeHostImpl::PinchGestureUpdate"); if (!InnerViewportScrollLayer()) return; viewport()->PinchUpdate(magnify_delta, anchor); client_->SetNeedsCommitOnImplThread(); SetNeedsRedraw(); client_->RenewTreePriority(); // Pinching can change the root scroll offset, so inform the synchronous input // handler. UpdateRootLayerStateForSynchronousInputHandler(); } void LayerTreeHostImpl::PinchGestureEnd() { pinch_gesture_active_ = false; if (pinch_gesture_end_should_clear_scrolling_layer_) { pinch_gesture_end_should_clear_scrolling_layer_ = false; ClearCurrentlyScrollingLayer(); } viewport()->PinchEnd(); top_controls_manager_->PinchEnd(); client_->SetNeedsCommitOnImplThread(); // When a pinch ends, we may be displaying content cached at incorrect scales, // so updating draw properties and drawing will ensure we are using the right // scales that we want when we're not inside a pinch. active_tree_->set_needs_update_draw_properties(); SetNeedsRedraw(); } std::unique_ptr<BeginFrameCallbackList> LayerTreeHostImpl::ProcessLayerTreeMutations() { std::unique_ptr<BeginFrameCallbackList> callbacks(new BeginFrameCallbackList); if (mutator_) { const base::Closure& callback = mutator_->TakeMutations(); if (!callback.is_null()) callbacks->push_back(callback); } return callbacks; } static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, LayerImpl* root_layer) { if (!root_layer) return; return root_layer->layer_tree_impl() ->property_trees() ->scroll_tree.CollectScrollDeltas(scroll_info); } std::unique_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() { std::unique_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet()); CollectScrollDeltas(scroll_info.get(), active_tree_->root_layer()); scroll_info->page_scale_delta = active_tree_->page_scale_factor()->PullDeltaForMainThread(); scroll_info->top_controls_delta = active_tree()->top_controls_shown_ratio()->PullDeltaForMainThread(); scroll_info->elastic_overscroll_delta = active_tree_->elastic_overscroll()->PullDeltaForMainThread(); scroll_info->swap_promises.swap(swap_promises_for_main_thread_scroll_update_); return scroll_info; } void LayerTreeHostImpl::SetFullRootLayerDamage() { SetViewportDamage(gfx::Rect(DrawViewportSize())); } void LayerTreeHostImpl::ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta) { DCHECK(InnerViewportScrollLayer()); LayerImpl* scroll_layer = InnerViewportScrollLayer(); gfx::Vector2dF unused_delta = scroll_layer->ScrollBy(scroll_delta); if (!unused_delta.IsZero() && OuterViewportScrollLayer()) OuterViewportScrollLayer()->ScrollBy(unused_delta); } void LayerTreeHostImpl::ScrollViewportBy(gfx::Vector2dF scroll_delta) { DCHECK(InnerViewportScrollLayer()); LayerImpl* scroll_layer = OuterViewportScrollLayer() ? OuterViewportScrollLayer() : InnerViewportScrollLayer(); gfx::Vector2dF unused_delta = scroll_layer->ScrollBy(scroll_delta); if (!unused_delta.IsZero() && (scroll_layer == OuterViewportScrollLayer())) InnerViewportScrollLayer()->ScrollBy(unused_delta); } bool LayerTreeHostImpl::AnimatePageScale(base::TimeTicks monotonic_time) { if (!page_scale_animation_) return false; gfx::ScrollOffset scroll_total = active_tree_->TotalScrollOffset(); if (!page_scale_animation_->IsAnimationStarted()) page_scale_animation_->StartAnimation(monotonic_time); active_tree_->SetPageScaleOnActiveTree( page_scale_animation_->PageScaleFactorAtTime(monotonic_time)); gfx::ScrollOffset next_scroll = gfx::ScrollOffset( page_scale_animation_->ScrollOffsetAtTime(monotonic_time)); ScrollViewportInnerFirst(next_scroll.DeltaFrom(scroll_total)); if (page_scale_animation_->IsAnimationCompleteAtTime(monotonic_time)) { page_scale_animation_ = nullptr; client_->SetNeedsCommitOnImplThread(); client_->RenewTreePriority(); client_->DidCompletePageScaleAnimationOnImplThread(); } else { SetNeedsOneBeginImplFrame(); } return true; } bool LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) { if (!top_controls_manager_->has_animation()) return false; gfx::Vector2dF scroll = top_controls_manager_->Animate(time); if (top_controls_manager_->has_animation()) SetNeedsOneBeginImplFrame(); if (active_tree_->TotalScrollOffset().y() == 0.f) return false; if (scroll.IsZero()) return false; ScrollViewportBy(gfx::ScaleVector2d( scroll, 1.f / active_tree_->current_page_scale_factor())); client_->SetNeedsCommitOnImplThread(); client_->RenewTreePriority(); return true; } bool LayerTreeHostImpl::AnimateScrollbars(base::TimeTicks monotonic_time) { bool animated = false; for (auto& pair : scrollbar_animation_controllers_) animated |= pair.second->Animate(monotonic_time); return animated; } bool LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) { const bool animated = animation_host_->AnimateLayers(monotonic_time); // TODO(crbug.com/551134): Only do this if the animations are on the active // tree, or if they are on the pending tree waiting for some future time to // start. // TODO(crbug.com/551138): We currently have a single signal from the // animation_host, so on the last frame of an animation we will // still request an extra SetNeedsAnimate here. if (animated) SetNeedsOneBeginImplFrame(); // TODO(crbug.com/551138): We could return true only if the animations are on // the active tree. There's no need to cause a draw to take place from // animations starting/ticking on the pending tree. return animated; } void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) { std::unique_ptr<AnimationEvents> events = animation_host_->CreateEvents(); const bool has_active_animations = animation_host_->UpdateAnimationState( start_ready_animations, events.get()); if (!events->events_.empty()) client_->PostAnimationEventsToMainThreadOnImplThread(std::move(events)); if (has_active_animations) SetNeedsOneBeginImplFrame(); } void LayerTreeHostImpl::ActivateAnimations() { const bool activated = animation_host_->ActivateAnimations(); if (activated) { // Activating an animation changes layer draw properties, such as // screen_space_transform_is_animating. So when we see a new animation get // activated, we need to update the draw properties on the active tree. active_tree()->set_needs_update_draw_properties(); // Request another frame to run the next tick of the animation. SetNeedsOneBeginImplFrame(); } } std::string LayerTreeHostImpl::LayerTreeAsJson() const { std::string str; if (active_tree_->root_layer()) { std::unique_ptr<base::Value> json( active_tree_->root_layer()->LayerTreeAsJson()); base::JSONWriter::WriteWithOptions( *json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &str); } return str; } void LayerTreeHostImpl::RegisterScrollbarAnimationController( int scroll_layer_id) { if (settings().scrollbar_animator == LayerTreeSettings::NO_ANIMATOR) return; if (ScrollbarAnimationControllerForId(scroll_layer_id)) return; scrollbar_animation_controllers_[scroll_layer_id] = active_tree_->CreateScrollbarAnimationController(scroll_layer_id); } void LayerTreeHostImpl::UnregisterScrollbarAnimationController( int scroll_layer_id) { scrollbar_animation_controllers_.erase(scroll_layer_id); } ScrollbarAnimationController* LayerTreeHostImpl::ScrollbarAnimationControllerForId( int scroll_layer_id) const { if (InnerViewportScrollLayer() && OuterViewportScrollLayer() && scroll_layer_id == InnerViewportScrollLayer()->id()) scroll_layer_id = OuterViewportScrollLayer()->id(); auto i = scrollbar_animation_controllers_.find(scroll_layer_id); if (i == scrollbar_animation_controllers_.end()) return nullptr; return i->second.get(); } void LayerTreeHostImpl::PostDelayedScrollbarAnimationTask( const base::Closure& task, base::TimeDelta delay) { client_->PostDelayedAnimationTaskOnImplThread(task, delay); } // TODO(danakj): Make this a return value from the Animate() call instead of an // interface on LTHI. (Also, crbug.com/551138.) void LayerTreeHostImpl::SetNeedsAnimateForScrollbarAnimation() { TRACE_EVENT0("cc", "LayerTreeHostImpl::SetNeedsAnimateForScrollbarAnimation"); SetNeedsOneBeginImplFrame(); } // TODO(danakj): Make this a return value from the Animate() call instead of an // interface on LTHI. (Also, crbug.com/551138.) void LayerTreeHostImpl::SetNeedsRedrawForScrollbarAnimation() { SetNeedsRedraw(); } ScrollbarSet LayerTreeHostImpl::ScrollbarsFor(int scroll_layer_id) const { return active_tree_->ScrollbarsFor(scroll_layer_id); } void LayerTreeHostImpl::AddVideoFrameController( VideoFrameController* controller) { bool was_empty = video_frame_controllers_.empty(); video_frame_controllers_.insert(controller); if (current_begin_frame_tracker_.DangerousMethodHasStarted() && !current_begin_frame_tracker_.DangerousMethodHasFinished()) controller->OnBeginFrame(current_begin_frame_tracker_.Current()); if (was_empty) client_->SetVideoNeedsBeginFrames(true); } void LayerTreeHostImpl::RemoveVideoFrameController( VideoFrameController* controller) { video_frame_controllers_.erase(controller); if (video_frame_controllers_.empty()) client_->SetVideoNeedsBeginFrames(false); } void LayerTreeHostImpl::SetTreePriority(TreePriority priority) { if (!tile_manager_) return; if (global_tile_state_.tree_priority == priority) return; global_tile_state_.tree_priority = priority; DidModifyTilePriorities(); } TreePriority LayerTreeHostImpl::GetTreePriority() const { return global_tile_state_.tree_priority; } BeginFrameArgs LayerTreeHostImpl::CurrentBeginFrameArgs() const { // TODO(mithro): Replace call with current_begin_frame_tracker_.Current() // once all calls which happens outside impl frames are fixed. return current_begin_frame_tracker_.DangerousMethodCurrentOrLast(); } base::TimeDelta LayerTreeHostImpl::CurrentBeginFrameInterval() const { return current_begin_frame_tracker_.Interval(); } std::unique_ptr<base::trace_event::ConvertableToTraceFormat> LayerTreeHostImpl::AsValueWithFrame(FrameData* frame) const { std::unique_ptr<base::trace_event::TracedValue> state( new base::trace_event::TracedValue()); AsValueWithFrameInto(frame, state.get()); return std::move(state); } void LayerTreeHostImpl::AsValueWithFrameInto( FrameData* frame, base::trace_event::TracedValue* state) const { if (this->pending_tree_) { state->BeginDictionary("activation_state"); ActivationStateAsValueInto(state); state->EndDictionary(); } MathUtil::AddToTracedValue("device_viewport_size", device_viewport_size_, state); std::vector<PrioritizedTile> prioritized_tiles; active_tree_->GetAllPrioritizedTilesForTracing(&prioritized_tiles); if (pending_tree_) pending_tree_->GetAllPrioritizedTilesForTracing(&prioritized_tiles); state->BeginArray("active_tiles"); for (const auto& prioritized_tile : prioritized_tiles) { state->BeginDictionary(); prioritized_tile.AsValueInto(state); state->EndDictionary(); } state->EndArray(); if (tile_manager_) { state->BeginDictionary("tile_manager_basic_state"); tile_manager_->BasicStateAsValueInto(state); state->EndDictionary(); } state->BeginDictionary("active_tree"); active_tree_->AsValueInto(state); state->EndDictionary(); if (pending_tree_) { state->BeginDictionary("pending_tree"); pending_tree_->AsValueInto(state); state->EndDictionary(); } if (frame) { state->BeginDictionary("frame"); frame->AsValueInto(state); state->EndDictionary(); } } void LayerTreeHostImpl::ActivationStateAsValueInto( base::trace_event::TracedValue* state) const { TracedValue::SetIDRef(this, state, "lthi"); if (tile_manager_) { state->BeginDictionary("tile_manager"); tile_manager_->BasicStateAsValueInto(state); state->EndDictionary(); } } void LayerTreeHostImpl::SetDebugState( const LayerTreeDebugState& new_debug_state) { if (LayerTreeDebugState::Equal(debug_state_, new_debug_state)) return; debug_state_ = new_debug_state; UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); SetFullRootLayerDamage(); } void LayerTreeHostImpl::CreateUIResource(UIResourceId uid, const UIResourceBitmap& bitmap) { DCHECK_GT(uid, 0); // Allow for multiple creation requests with the same UIResourceId. The // previous resource is simply deleted. ResourceId id = ResourceIdForUIResource(uid); if (id) DeleteUIResource(uid); ResourceFormat format = resource_provider_->best_texture_format(); switch (bitmap.GetFormat()) { case UIResourceBitmap::RGBA8: break; case UIResourceBitmap::ALPHA_8: format = ALPHA_8; break; case UIResourceBitmap::ETC1: format = ETC1; break; } id = resource_provider_->CreateResource( bitmap.GetSize(), ResourceProvider::TEXTURE_HINT_IMMUTABLE, format); UIResourceData data; data.resource_id = id; data.size = bitmap.GetSize(); data.opaque = bitmap.GetOpaque(); ui_resource_map_[uid] = data; AutoLockUIResourceBitmap bitmap_lock(bitmap); resource_provider_->CopyToResource(id, bitmap_lock.GetPixels(), bitmap.GetSize()); resource_provider_->GenerateSyncTokenForResource(id); MarkUIResourceNotEvicted(uid); } void LayerTreeHostImpl::DeleteUIResource(UIResourceId uid) { ResourceId id = ResourceIdForUIResource(uid); if (id) { resource_provider_->DeleteResource(id); ui_resource_map_.erase(uid); } MarkUIResourceNotEvicted(uid); } void LayerTreeHostImpl::ClearUIResources() { for (UIResourceMap::const_iterator iter = ui_resource_map_.begin(); iter != ui_resource_map_.end(); ++iter) { evicted_ui_resources_.insert(iter->first); resource_provider_->DeleteResource(iter->second.resource_id); } ui_resource_map_.clear(); } void LayerTreeHostImpl::EvictAllUIResources() { if (ui_resource_map_.empty()) return; ClearUIResources(); client_->SetNeedsCommitOnImplThread(); client_->OnCanDrawStateChanged(CanDraw()); client_->RenewTreePriority(); } ResourceId LayerTreeHostImpl::ResourceIdForUIResource(UIResourceId uid) const { UIResourceMap::const_iterator iter = ui_resource_map_.find(uid); if (iter != ui_resource_map_.end()) return iter->second.resource_id; return 0; } bool LayerTreeHostImpl::IsUIResourceOpaque(UIResourceId uid) const { UIResourceMap::const_iterator iter = ui_resource_map_.find(uid); DCHECK(iter != ui_resource_map_.end()); return iter->second.opaque; } bool LayerTreeHostImpl::EvictedUIResourcesExist() const { return !evicted_ui_resources_.empty(); } void LayerTreeHostImpl::MarkUIResourceNotEvicted(UIResourceId uid) { std::set<UIResourceId>::iterator found_in_evicted = evicted_ui_resources_.find(uid); if (found_in_evicted == evicted_ui_resources_.end()) return; evicted_ui_resources_.erase(found_in_evicted); if (evicted_ui_resources_.empty()) client_->OnCanDrawStateChanged(CanDraw()); } void LayerTreeHostImpl::ScheduleMicroBenchmark( std::unique_ptr<MicroBenchmarkImpl> benchmark) { micro_benchmark_controller_.ScheduleRun(std::move(benchmark)); } void LayerTreeHostImpl::InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) { swap_promise_monitor_.insert(monitor); } void LayerTreeHostImpl::RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) { swap_promise_monitor_.erase(monitor); } void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); for (; it != swap_promise_monitor_.end(); it++) (*it)->OnSetNeedsRedrawOnImpl(); } void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfForwardingToMainThread() { std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); for (; it != swap_promise_monitor_.end(); it++) (*it)->OnForwardScrollUpdateToMainThreadOnImpl(); } void LayerTreeHostImpl::UpdateRootLayerStateForSynchronousInputHandler() { if (!input_handler_client_) return; input_handler_client_->UpdateRootLayerStateForSynchronousInputHandler( active_tree_->TotalScrollOffset(), active_tree_->TotalMaxScrollOffset(), active_tree_->ScrollableSize(), active_tree_->current_page_scale_factor(), active_tree_->min_page_scale_factor(), active_tree_->max_page_scale_factor()); } void LayerTreeHostImpl::ScrollAnimationAbort(LayerImpl* layer_impl) { return animation_host_->ScrollAnimationAbort(false /* needs_completion */); } bool LayerTreeHostImpl::ScrollAnimationUpdateTarget( ScrollNode* scroll_node, const gfx::Vector2dF& scroll_delta) { return animation_host_->ImplOnlyScrollAnimationUpdateTarget( scroll_node->owner_id, scroll_delta, active_tree_->property_trees()->scroll_tree.MaxScrollOffset( scroll_node->id), CurrentBeginFrameArgs().frame_time); } bool LayerTreeHostImpl::IsElementInList(ElementId element_id, ElementListType list_type) const { if (list_type == ElementListType::ACTIVE) { return active_tree() ? active_tree()->LayerById(element_id) != nullptr : false; } else { if (pending_tree() && pending_tree()->LayerById(element_id)) return true; if (recycle_tree() && recycle_tree()->LayerById(element_id)) return true; return false; } } void LayerTreeHostImpl::SetMutatorsNeedCommit() {} void LayerTreeHostImpl::SetMutatorsNeedRebuildPropertyTrees() {} void LayerTreeHostImpl::SetTreeLayerFilterMutated( int layer_id, LayerTreeImpl* tree, const FilterOperations& filters) { if (!tree) return; LayerImpl* layer = tree->LayerById(layer_id); if (layer) layer->OnFilterAnimated(filters); } void LayerTreeHostImpl::SetTreeLayerOpacityMutated(int layer_id, LayerTreeImpl* tree, float opacity) { if (!tree) return; LayerImpl* layer = tree->LayerById(layer_id); if (layer) layer->OnOpacityAnimated(opacity); } void LayerTreeHostImpl::SetTreeLayerTransformMutated( int layer_id, LayerTreeImpl* tree, const gfx::Transform& transform) { if (!tree) return; LayerImpl* layer = tree->LayerById(layer_id); if (layer) layer->OnTransformAnimated(transform); } void LayerTreeHostImpl::SetTreeLayerScrollOffsetMutated( int layer_id, LayerTreeImpl* tree, const gfx::ScrollOffset& scroll_offset) { if (!tree) return; LayerImpl* layer = tree->LayerById(layer_id); if (layer) layer->OnScrollOffsetAnimated(scroll_offset); } bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment( const LayerImpl* layer) const { return animation_host_->AnimationsPreserveAxisAlignment(layer->id()); } void LayerTreeHostImpl::SetElementFilterMutated( ElementId element_id, ElementListType list_type, const FilterOperations& filters) { if (list_type == ElementListType::ACTIVE) { SetTreeLayerFilterMutated(element_id, active_tree(), filters); } else { SetTreeLayerFilterMutated(element_id, pending_tree(), filters); SetTreeLayerFilterMutated(element_id, recycle_tree(), filters); } } void LayerTreeHostImpl::SetElementOpacityMutated(ElementId element_id, ElementListType list_type, float opacity) { if (list_type == ElementListType::ACTIVE) { SetTreeLayerOpacityMutated(element_id, active_tree(), opacity); } else { SetTreeLayerOpacityMutated(element_id, pending_tree(), opacity); SetTreeLayerOpacityMutated(element_id, recycle_tree(), opacity); } } void LayerTreeHostImpl::SetElementTransformMutated( ElementId element_id, ElementListType list_type, const gfx::Transform& transform) { if (list_type == ElementListType::ACTIVE) { SetTreeLayerTransformMutated(element_id, active_tree(), transform); } else { SetTreeLayerTransformMutated(element_id, pending_tree(), transform); SetTreeLayerTransformMutated(element_id, recycle_tree(), transform); } } void LayerTreeHostImpl::SetElementScrollOffsetMutated( ElementId element_id, ElementListType list_type, const gfx::ScrollOffset& scroll_offset) { if (list_type == ElementListType::ACTIVE) { SetTreeLayerScrollOffsetMutated(element_id, active_tree(), scroll_offset); } else { SetTreeLayerScrollOffsetMutated(element_id, pending_tree(), scroll_offset); SetTreeLayerScrollOffsetMutated(element_id, recycle_tree(), scroll_offset); } } void LayerTreeHostImpl::ElementTransformIsAnimatingChanged( ElementId element_id, ElementListType list_type, AnimationChangeType change_type, bool is_animating) { LayerTreeImpl* tree = list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); if (!tree) return; LayerImpl* layer = tree->LayerById(element_id); if (layer) { switch (change_type) { case AnimationChangeType::POTENTIAL: layer->OnTransformIsPotentiallyAnimatingChanged(is_animating); break; case AnimationChangeType::RUNNING: layer->OnTransformIsCurrentlyAnimatingChanged(is_animating); break; case AnimationChangeType::BOTH: layer->OnTransformIsPotentiallyAnimatingChanged(is_animating); layer->OnTransformIsCurrentlyAnimatingChanged(is_animating); break; } } } void LayerTreeHostImpl::ElementOpacityIsAnimatingChanged( ElementId element_id, ElementListType list_type, AnimationChangeType change_type, bool is_animating) { LayerTreeImpl* tree = list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); if (!tree) return; LayerImpl* layer = tree->LayerById(element_id); if (layer) { switch (change_type) { case AnimationChangeType::POTENTIAL: layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating); break; case AnimationChangeType::RUNNING: layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating); break; case AnimationChangeType::BOTH: layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating); layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating); break; } } } void LayerTreeHostImpl::ScrollOffsetAnimationFinished() { // TODO(majidvp): We should pass in the original starting scroll position here ScrollStateData scroll_state_data; ScrollState scroll_state(scroll_state_data); ScrollEnd(&scroll_state); } gfx::ScrollOffset LayerTreeHostImpl::GetScrollOffsetForAnimation( ElementId element_id) const { if (active_tree()) { LayerImpl* layer = active_tree()->LayerById(element_id); if (layer) return layer->ScrollOffsetForAnimation(); } return gfx::ScrollOffset(); } bool LayerTreeHostImpl::SupportsImplScrolling() const { // Supported in threaded mode. return task_runner_provider_->HasImplThread(); } bool LayerTreeHostImpl::CommitToActiveTree() const { // In single threaded mode we skip the pending tree and commit directly to the // active tree. return !task_runner_provider_->HasImplThread(); } bool LayerTreeHostImpl::HasFixedRasterScalePotentialPerformanceRegression() const { return fixed_raster_scale_attempted_scale_change_history_.count() >= kFixedRasterScaleAttemptedScaleChangeThreshold; } void LayerTreeHostImpl::SetFixedRasterScaleAttemptedToChangeScale() { fixed_raster_scale_attempted_scale_change_history_.set(0); } } // namespace cc
37.586464
104
0.737402
maidiHaitai
faaa4656d794e9965baf48a624ba27a09506fb94
214
cpp
C++
n.cpp
Parthiv-657/DSA
0923753218d934b728f6c44da0edb8af836bd1ab
[ "MIT" ]
null
null
null
n.cpp
Parthiv-657/DSA
0923753218d934b728f6c44da0edb8af836bd1ab
[ "MIT" ]
null
null
null
n.cpp
Parthiv-657/DSA
0923753218d934b728f6c44da0edb8af836bd1ab
[ "MIT" ]
null
null
null
#include<iostream> using namespace std; int main() { int n,x=0; cin>>n; while(n!=1) { x++; if(n%2==0) n=n/2; else if(n%2==1) n++; } cout<<x; }
13.375
23
0.373832
Parthiv-657
faac1bc36e9a3a92e9e55802f3905763e7122e82
2,215
cc
C++
Fireworks/Core/src/FWEDProductRepresentationChecker.cc
pasmuss/cmssw
566f40c323beef46134485a45ea53349f59ae534
[ "Apache-2.0" ]
null
null
null
Fireworks/Core/src/FWEDProductRepresentationChecker.cc
pasmuss/cmssw
566f40c323beef46134485a45ea53349f59ae534
[ "Apache-2.0" ]
null
null
null
Fireworks/Core/src/FWEDProductRepresentationChecker.cc
pasmuss/cmssw
566f40c323beef46134485a45ea53349f59ae534
[ "Apache-2.0" ]
null
null
null
// -*- C++ -*- // // Package: Core // Class : FWEDProductRepresentationChecker // // Implementation: // <Notes on implementation> // // Original Author: Chris Jones // Created: Tue Nov 11 15:20:10 EST 2008 // // system include files #include "TClass.h" // user include files #include "Fireworks/Core/interface/FWEDProductRepresentationChecker.h" #include "Fireworks/Core/interface/FWRepresentationInfo.h" // // constants, enums and typedefs // // // static data member definitions // // // constructors and destructor // FWEDProductRepresentationChecker::FWEDProductRepresentationChecker(const std::string& iTypeidName, const std::string& iPurpose, unsigned int iBitPackedViews, bool iRepresentsSubPart, bool iRequiresFF) : FWRepresentationCheckerBase(iPurpose,iBitPackedViews,iRepresentsSubPart, iRequiresFF), m_typeidName(iTypeidName) { } // FWEDProductRepresentationChecker::FWEDProductRepresentationChecker(const FWEDProductRepresentationChecker& rhs) // { // // do actual copying here; // } //FWEDProductRepresentationChecker::~FWEDProductRepresentationChecker() //{ //} // // assignment operators // // const FWEDProductRepresentationChecker& FWEDProductRepresentationChecker::operator=(const FWEDProductRepresentationChecker& rhs) // { // //An exception safe implementation is // FWEDProductRepresentationChecker temp(rhs); // swap(rhs); // // return *this; // } // // member functions // // // const member functions // FWRepresentationInfo FWEDProductRepresentationChecker::infoFor(const std::string& iTypeName) const { TClass* clss = TClass::GetClass(iTypeName.c_str()); if(0==clss || clss->GetTypeInfo()==0) { return FWRepresentationInfo(); } if(clss->GetTypeInfo()->name() == m_typeidName) { return FWRepresentationInfo(purpose(),0,bitPackedViews(), representsSubPart(), requiresFF()); } return FWRepresentationInfo(); } // // static member functions //
26.058824
131
0.642438
pasmuss
faad85a15d16f82edc500e483606cf29f9f8c6e2
10,700
cpp
C++
be/src/exec/vectorized/sorting/merge_cascade.cpp
wangruin/starrocks
6cc50f90794a438333f96424b90fc266103b7c17
[ "Zlib", "PSF-2.0", "BSD-2-Clause", "Apache-2.0", "MIT" ]
null
null
null
be/src/exec/vectorized/sorting/merge_cascade.cpp
wangruin/starrocks
6cc50f90794a438333f96424b90fc266103b7c17
[ "Zlib", "PSF-2.0", "BSD-2-Clause", "Apache-2.0", "MIT" ]
null
null
null
be/src/exec/vectorized/sorting/merge_cascade.cpp
wangruin/starrocks
6cc50f90794a438333f96424b90fc266103b7c17
[ "Zlib", "PSF-2.0", "BSD-2-Clause", "Apache-2.0", "MIT" ]
null
null
null
// This file is licensed under the Elastic License 2.0. Copyright 2021-present, StarRocks Limited. #include "column/chunk.h" #include "column/vectorized_fwd.h" #include "exec/vectorized/sorting/merge.h" #include "exec/vectorized/sorting/sort_helper.h" #include "exec/vectorized/sorting/sorting.h" #include "runtime/chunk_cursor.h" namespace starrocks::vectorized { // Some search algorithms with cursor struct CursorAlgo { static int compare_tail(const SortDescs& desc, const SortedRun& left, const SortedRun& right) { size_t lhs_tail = left.range.second - 1; size_t rhs_tail = right.range.second - 1; return left.compare_row(desc, right, lhs_tail, rhs_tail); } static void trim_permutation(SortedRun left, SortedRun right, Permutation& perm) { size_t start = left.range.first + right.range.first; size_t end = left.range.second + right.range.second; std::copy(perm.begin() + start, perm.begin() + end, perm.begin()); perm.resize(end - start); } // Find upper_bound in left column based on right row static size_t upper_bound(SortDesc desc, const Column& column, std::pair<size_t, size_t> range, const Column& rhs_column, size_t rhs_row) { size_t first = range.first; size_t count = range.second - range.first; while (count > 0) { size_t mid = first + count / 2; int x = column.compare_at(mid, rhs_row, rhs_column, desc.null_first) * desc.sort_order; if (x <= 0) { first = mid + 1; count -= count / 2 + 1; } else { count /= 2; } } return first; } static size_t lower_bound(SortDesc desc, const Column& column, std::pair<size_t, size_t> range, const Column& rhs_column, size_t rhs_row) { size_t first = range.first; size_t count = range.second - range.first; while (count > 0) { size_t mid = first + count / 2; int x = column.compare_at(mid, rhs_row, rhs_column, desc.null_first) * desc.sort_order; if (x < 0) { first = mid + 1; count -= count / 2 + 1; } else { count /= 2; } } return first; } // Cutoff by upper_bound // @return last row index of upper bound static size_t cutoff_run(const SortDescs& sort_descs, SortedRun run, std::pair<SortedRun, size_t> cut) { std::pair<size_t, size_t> search_range = run.range; size_t res = 0; for (int i = 0; i < sort_descs.num_columns(); i++) { auto& lhs_col = *run.get_column(i); auto& rhs_col = *cut.first.get_column(i); SortDesc desc = sort_descs.get_column_desc(i); size_t lower = lower_bound(desc, lhs_col, search_range, rhs_col, cut.second); size_t upper = upper_bound(desc, lhs_col, search_range, rhs_col, cut.second); res = upper; if (upper - lower <= 1) { break; } search_range = {lower, upper}; } return res; } }; MergeTwoCursor::MergeTwoCursor(const SortDescs& sort_desc, std::unique_ptr<SimpleChunkSortCursor>&& left_cursor, std::unique_ptr<SimpleChunkSortCursor>&& right_cursor) : _sort_desc(sort_desc), _left_cursor(std::move(left_cursor)), _right_cursor(std::move(right_cursor)) { _chunk_provider = [&](Chunk** output, bool* eos) -> bool { if (output == nullptr || eos == nullptr) { return is_data_ready(); } auto chunk = next(); *eos = is_eos(); if (!chunk.ok() || !chunk.value()) { return false; } else { *output = chunk.value().release(); return true; } }; } // Consume all inputs and produce output through the callback function Status MergeTwoCursor::consume_all(ChunkConsumer output) { for (auto chunk = next(); chunk.ok() && !is_eos(); chunk = next()) { if (chunk.value()) { output(std::move(chunk.value())); } } return Status::OK(); } // use this as cursor std::unique_ptr<SimpleChunkSortCursor> MergeTwoCursor::as_chunk_cursor() { return std::make_unique<SimpleChunkSortCursor>(as_provider(), _left_cursor->get_sort_exprs()); } bool MergeTwoCursor::is_data_ready() { return _left_cursor->is_data_ready() && _right_cursor->is_data_ready(); } bool MergeTwoCursor::is_eos() { return _left_cursor->is_eos() && _right_cursor->is_eos(); } StatusOr<ChunkUniquePtr> MergeTwoCursor::next() { if (!is_data_ready() || is_eos()) { return ChunkUniquePtr(); } if (!move_cursor()) { return ChunkUniquePtr(); } return merge_sorted_cursor_two_way(); } // 1. Find smaller tail // 2. Cutoff the chunk based on tail // 3. Merge two chunks and output // 4. Move to next StatusOr<ChunkUniquePtr> MergeTwoCursor::merge_sorted_cursor_two_way() { DCHECK(!(_left_run.empty() && _right_run.empty())); const SortDescs& sort_desc = _sort_desc; ChunkUniquePtr result; if (_left_run.empty()) { // TODO: avoid copy result = _right_run.clone_slice(); _right_run.reset(); } else if (_right_run.empty()) { result = _left_run.clone_slice(); _left_run.reset(); } else { int tail_cmp = CursorAlgo::compare_tail(sort_desc, _left_run, _right_run); if (tail_cmp <= 0) { // Cutoff right by left tail size_t right_cut = CursorAlgo::cutoff_run(sort_desc, _right_run, std::make_pair(_left_run, _left_run.num_rows() - 1)); SortedRun right_1(_right_run.chunk, 0, right_cut); SortedRun right_2(_right_run.chunk, right_cut, _right_run.num_rows()); // Merge partial chunk Permutation perm; RETURN_IF_ERROR(merge_sorted_chunks_two_way(sort_desc, _left_run, right_1, &perm)); CursorAlgo::trim_permutation(_left_run, right_1, perm); DCHECK_EQ(_left_run.num_rows() + right_1.num_rows(), perm.size()); ChunkUniquePtr merged = _left_run.chunk->clone_empty(perm.size()); append_by_permutation(merged.get(), {_left_run.chunk, right_1.chunk}, perm); _left_run.reset(); _right_run = right_2; result = std::move(merged); } else { // Cutoff left by right tail size_t left_cut = CursorAlgo::cutoff_run(sort_desc, _left_run, std::make_pair(_right_run, _right_run.num_rows() - 1)); SortedRun left_1(_left_run.chunk, 0, left_cut); SortedRun left_2(_left_run.chunk, left_cut, _left_run.num_rows()); // Merge partial chunk Permutation perm; RETURN_IF_ERROR(merge_sorted_chunks_two_way(sort_desc, _right_run, left_1, &perm)); CursorAlgo::trim_permutation(left_1, _right_run, perm); DCHECK_EQ(_right_run.num_rows() + left_1.num_rows(), perm.size()); std::unique_ptr<Chunk> merged = _left_run.chunk->clone_empty(perm.size()); append_by_permutation(merged.get(), {_right_run.chunk, left_1.chunk}, perm); _left_run = left_2; _right_run.reset(); result = std::move(merged); } #ifndef NDEBUG for (int i = 0; i < result->num_rows(); i++) { fmt::print("merge row: {}\n", result->debug_row(i)); } #endif } return result; } // @return true if data ready, else return false bool MergeTwoCursor::move_cursor() { DCHECK(is_data_ready()); DCHECK(!is_eos()); if (_left_run.empty() && !_left_cursor->is_eos()) { auto chunk = _left_cursor->try_get_next(); if (!chunk.first) { return false; } _left_run = SortedRun(ChunkPtr(chunk.first.release()), chunk.second); } if (_right_run.empty() && !_right_cursor->is_eos()) { auto chunk = _right_cursor->try_get_next(); if (!chunk.first) { return false; } _right_run = SortedRun(ChunkPtr(chunk.first.release()), chunk.second); } return true; } Status MergeCursorsCascade::init(const SortDescs& sort_desc, std::vector<std::unique_ptr<SimpleChunkSortCursor>>&& cursors) { std::vector<std::unique_ptr<SimpleChunkSortCursor>> current_level = std::move(cursors); while (current_level.size() > 1) { std::vector<std::unique_ptr<SimpleChunkSortCursor>> next_level; next_level.reserve(current_level.size() / 2); int level_size = current_level.size() & ~1; for (int i = 0; i < level_size; i += 2) { auto& left = current_level[i]; auto& right = current_level[i + 1]; _mergers.push_back(std::make_unique<MergeTwoCursor>(sort_desc, std::move(left), std::move(right))); next_level.push_back(_mergers.back()->as_chunk_cursor()); } if (current_level.size() % 2 == 1) { next_level.push_back(std::move(current_level.back())); } std::swap(next_level, current_level); } DCHECK_EQ(1, current_level.size()); _root_cursor = std::move(current_level.front()); return Status::OK(); } bool MergeCursorsCascade::is_data_ready() { return _root_cursor->is_data_ready(); } bool MergeCursorsCascade::is_eos() { return _root_cursor->is_eos(); } ChunkUniquePtr MergeCursorsCascade::try_get_next() { return _root_cursor->try_get_next().first; } Status MergeCursorsCascade::consume_all(ChunkConsumer consumer) { while (!is_eos()) { ChunkUniquePtr chunk = try_get_next(); if (!!chunk) { consumer(std::move(chunk)); } } return Status::OK(); } Status merge_sorted_cursor_two_way(const SortDescs& sort_desc, std::unique_ptr<SimpleChunkSortCursor> left_cursor, std::unique_ptr<SimpleChunkSortCursor> right_cursor, ChunkConsumer output) { MergeTwoCursor merger(sort_desc, std::move(left_cursor), std::move(right_cursor)); return merger.consume_all(output); } Status merge_sorted_cursor_cascade(const SortDescs& sort_desc, std::vector<std::unique_ptr<SimpleChunkSortCursor>>&& cursors, ChunkConsumer consumer) { MergeCursorsCascade merger; RETURN_IF_ERROR(merger.init(sort_desc, std::move(cursors))); CHECK(merger.is_data_ready()); merger.consume_all(consumer); return Status::OK(); } } // namespace starrocks::vectorized
37.024221
120
0.612243
wangruin
faae0d850cb9ac1b8589845c8e0891232ed90213
1,240
cpp
C++
MemoryAndPolymorphism/print_memory_layout.cpp
hoelzl/CleanCodeCppCatch
88861faf48967e840b1d66f7faf94c0e9bef26a4
[ "MIT" ]
null
null
null
MemoryAndPolymorphism/print_memory_layout.cpp
hoelzl/CleanCodeCppCatch
88861faf48967e840b1d66f7faf94c0e9bef26a4
[ "MIT" ]
null
null
null
MemoryAndPolymorphism/print_memory_layout.cpp
hoelzl/CleanCodeCppCatch
88861faf48967e840b1d66f7faf94c0e9bef26a4
[ "MIT" ]
null
null
null
#include "print_memory_layout.h" void print_content_addresses(const std::string& name, const std::vector<int>& v) { for (int i = 0; i < v.size(); ++i) { print_address(name + "[" + std::to_string(i) + "]: ", &v[i]); } } void print_memory_layout() { int i { 17 }; int ai[3] = { 1, 2, 3 }; int* pi = new int; *pi = 21; std::vector<int> vi { 1, 2, 3, 4, 5, 6 }; int ii { 0 }; std::vector<int> wi { vi }; print_address("i: ", &i); print_address("ai: ", &ai); print_address("pi: ", &pi); print_address("vi: ", &vi); print_address("wi: ", &wi); print_address("wi: ", &wi); std::cout << std::endl; print_address("*pi: ", pi); std::cout << std::endl; print_content_addresses("vi", vi); std::cout << std::endl; print_content_addresses("wi", wi); std::vector<int> ui { std::move(wi) }; std::cout << std::endl; print_address("wi: ", &wi); print_address("ui: ", &ui); std::cout << std::endl; print_content_addresses("ui", ui); std::cout << std::endl; print_dist(" i to ai: ", &i, &ai); print_dist("ai to pi: ", &ai, &pi); print_dist("pi to vi: ", &pi, &vi); print_dist("vi to ii: ", &vi, &ii); }
24.313725
80
0.523387
hoelzl
faaf48bdc4194661c726bbc8cca5b9922723e16d
2,015
hpp
C++
vad/src/engComp.hpp
forsyde/forsyde-systemc-demonstrators
2af7b5a016b2955553330a901b48ec73354f9ff0
[ "BSD-3-Clause" ]
null
null
null
vad/src/engComp.hpp
forsyde/forsyde-systemc-demonstrators
2af7b5a016b2955553330a901b48ec73354f9ff0
[ "BSD-3-Clause" ]
9
2016-03-08T14:35:52.000Z
2016-03-29T08:50:07.000Z
vad/src/engComp.hpp
forsyde/forsyde-systemc-demonstrators
2af7b5a016b2955553330a901b48ec73354f9ff0
[ "BSD-3-Clause" ]
1
2016-03-20T12:51:40.000Z
2016-03-20T12:51:40.000Z
/********************************************************************** * engComp.hpp * * * * Author: Hosein Attarzadeh (shan2@kth.se) * * adapted from KisTA: https://github.com/nandohca/kista * * * * Purpose: The Energy Computation task * * * * Usage: The VAD example * * * * License: BSD3 * *******************************************************************/ #ifndef ENERGYCOMPUTATION_HPP #define ENERGYCOMPUTATION_HPP #include <forsyde.hpp> #include "includes/vad.h" using namespace ForSyDe; using namespace ForSyDe::SDF; void engComp_func(tokens<token_tuple<pvad_acf0_t,Pfloat>>& out, tokens<rvad_t> inp1, tokens<r_t> inp2, tokens<short> inp3) { // Resize all the vectors to contain 1 element out = init<pvad_acf0_t,Pfloat>(1, {1, 1}); short* in_rvad_buff = &get<0,0>(inp1); short in_rvad_scal = get<0,1>(inp1); short* in_r_h = &get<0>(inp2); short in_scal_acf = get<0>(inp3); Pfloat* val_pvad = &get<0,0,0,0>(out); Pfloat* val_acf0 = &get<0,0,0,1>(out); #pragma ForSyDe begin acfAvg_func energy_computation( in_r_h, // autocorrelation of input signal frame (msb) in_scal_acf, // scaling factor for the autocorrelations in_rvad_buff, // autocorrelated adaptive filter coefficients in_rvad_scal, // scaling factor for rvad[] val_acf0, // signal frame energy (mantissa+exponent) val_pvad // filtered signal energy (mantissa+exponent) ); #pragma ForSyDe end get<0,1,0>(out) = *val_pvad; } #endif
35.982143
72
0.459057
forsyde
fab254641b537bd05e24cd02f58b582c0b0065c8
503
cpp
C++
AIC/AIC'20 - Level 1 Training Contests/Contest #6 (Online)/D.cpp
MaGnsio/CP-Problems
a7f518a20ba470f554b6d54a414b84043bf209c5
[ "Unlicense" ]
3
2020-11-01T06:31:30.000Z
2022-02-21T20:37:51.000Z
AIC/AIC'20 - Level 1 Training Contests/Contest #6 (Online)/D.cpp
MaGnsio/CP-Problems
a7f518a20ba470f554b6d54a414b84043bf209c5
[ "Unlicense" ]
null
null
null
AIC/AIC'20 - Level 1 Training Contests/Contest #6 (Online)/D.cpp
MaGnsio/CP-Problems
a7f518a20ba470f554b6d54a414b84043bf209c5
[ "Unlicense" ]
1
2021-05-05T18:56:31.000Z
2021-05-05T18:56:31.000Z
//https://codeforces.com/group/aDFQm4ed6d/contest/274872/problem/D #include <bits/stdc++.h> using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; ll mod = 1e9 + 7; int main () { ios_base::sync_with_stdio (0); cin.tie (0); cout.tie (0); ll N, p = 0, n = 0; cin >> N; while (N--) { ll x, y; cin >> x >> y; if (x < 0) p++; else n++; } if (p <= 1 || n <= 1) cout << "YES"; else cout << "NO"; }
19.346154
66
0.520875
MaGnsio
fab6aa4024cdbd927b134501a4c15c40d8849426
11,357
cpp
C++
dev/Code/CryEngine/CryCommon/IResourceCompilerHelper.cpp
jeikabu/lumberyard
07228c605ce16cbf5aaa209a94a3cb9d6c1a4115
[ "AML" ]
8
2019-10-07T16:33:47.000Z
2020-12-07T03:59:58.000Z
dev/Code/CryEngine/CryCommon/IResourceCompilerHelper.cpp
jeikabu/lumberyard
07228c605ce16cbf5aaa209a94a3cb9d6c1a4115
[ "AML" ]
null
null
null
dev/Code/CryEngine/CryCommon/IResourceCompilerHelper.cpp
jeikabu/lumberyard
07228c605ce16cbf5aaa209a94a3cb9d6c1a4115
[ "AML" ]
6
2020-06-04T04:21:02.000Z
2021-06-22T17:09:27.000Z
/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #include "IResourceCompilerHelper.h" // DO NOT USE AZSTD. #include <string> // std string used here. #include <memory> // the following block is for _mkdir on windows and mkdir on other platforms. #if defined(_WIN32) # include <direct.h> #else # include <sys/stat.h> # include <sys/types.h> #endif namespace RCPathUtil { const char* GetExt(const char* filepath) { const char* str = filepath; size_t len = strlen(filepath); for (const char* p = str + len - 1; p >= str; --p) { switch (*p) { case ':': case '/': case '\\': // we've reached a path separator - it means there's no extension in this name return ""; case '.': // there's an extension in this file name return p + 1; } } return ""; } const char* GetFile(const char* filepath) { const size_t len = strlen(filepath); for (const char* p = filepath + len - 1; p >= filepath; --p) { switch (*p) { case ':': case '/': case '\\': return p + 1; } } return filepath; } //! Replace extension for given file. std::string RemoveExtension(const char* filepath) { std::string filepathstr = filepath; const char* str = filepathstr.c_str(); for (const char* p = str + filepathstr.length() - 1; p >= str; --p) { switch (*p) { case ':': case '/': case '\\': // we've reached a path separator - it means there's no extension in this name return filepathstr; case '.': // there's an extension in this file name filepathstr = filepathstr.substr(0, p - str); return filepathstr; } } // it seems the file name is a pure name, without path or extension return filepathstr; } std::string ReplaceExtension(const char* filepath, const char* ext) { std::string str = filepath; if (ext != 0) { str = RemoveExtension(str.c_str()); if (ext[0] != 0 && ext[0] != '.') { str += "."; } str += ext; } return str; } std::string GetPath(const char* filepath) { std::string filepathstr = filepath; const char* str = filepathstr.c_str(); for (const char* p = str + filepathstr.length() - 1; p >= str; --p) { switch (*p) { case ':': case '/': case '\\': // we've reached a path separator - it means there's no extension in this name return filepathstr.substr(0, p - str); } } // it seems the file name is a pure name, without path return ""; } ////////////////////////////////////////////////////////////////////////// bool IsRelativePath(const char* p) { if (!p || !p[0]) { return true; } return p[0] != '/' && p[0] != '\\' && !strchr(p, ':'); } } const char* IResourceCompilerHelper::SourceImageFormatExts[NUM_SOURCE_IMAGE_TYPE] = { "tif", "bmp", "gif", "jpg", "jpeg", "jpe", "tga", "png" }; const char* IResourceCompilerHelper::SourceImageFormatExtsWithDot[NUM_SOURCE_IMAGE_TYPE] = { ".tif", ".bmp", ".gif", ".jpg", ".jpeg", ".jpe", ".tga", ".png" }; const char* IResourceCompilerHelper::EngineImageFormatExts[NUM_ENGINE_IMAGE_TYPE] = { "dds" }; const char* IResourceCompilerHelper::EngineImageFormatExtsWithDot[NUM_ENGINE_IMAGE_TYPE] = { ".dds" }; IResourceCompilerHelper::ERcCallResult IResourceCompilerHelper::ConvertResourceCompilerExitCodeToResultCode(int exitCode) { switch (exitCode) { case eRcExitCode_Success: case eRcExitCode_UserFixing: return eRcCallResult_success; case eRcExitCode_Error: return eRcCallResult_error; case eRcExitCode_FatalError: return eRcCallResult_error; case eRcExitCode_Crash: return eRcCallResult_crash; } return eRcCallResult_error; } ////////////////////////////////////////////////////////////////////////// const char* IResourceCompilerHelper::GetCallResultDescription(IResourceCompilerHelper::ERcCallResult result) { switch (result) { case eRcCallResult_success: return "Success."; case eRcCallResult_notFound: return "ResourceCompiler executable was not found."; case eRcCallResult_error: return "ResourceCompiler exited with an error."; case eRcCallResult_crash: return "ResourceCompiler crashed! Please report this. Include source asset and this log in the report."; default: return "Unexpected failure in ResultCompilerHelper."; } } // Arguments: // szFilePath - could be source or destination filename void IResourceCompilerHelper::GetOutputFilename(const char* szFilePath, char* buffer, size_t bufferSizeInBytes) { if (IResourceCompilerHelper::IsSourceImageFormatSupported(szFilePath)) { std::string newString = RCPathUtil::ReplaceExtension(szFilePath, "dds"); strncpy_s(buffer, bufferSizeInBytes, newString.c_str(), bufferSizeInBytes - 1); return; } strncpy_s(buffer, bufferSizeInBytes, szFilePath, bufferSizeInBytes - 1); } IResourceCompilerHelper::ERcCallResult IResourceCompilerHelper::InvokeResourceCompiler(const char* szSrcFilePath, const char* szDstFilePath, const bool bUserDialog) { ERcExitCode eRet = eRcExitCode_Pending; const char* szDstFileName = RCPathUtil::GetFile(szDstFilePath); std::string pathOnly = RCPathUtil::GetPath(szDstFilePath); const int maxStringSize = 512; char szRemoteCmdLine[maxStringSize] = { 0 }; char szFullPathToSourceFile[maxStringSize] = { 0 }; if (RCPathUtil::IsRelativePath(szSrcFilePath)) { strcat_s(szFullPathToSourceFile, maxStringSize, "#ENGINEROOT#"); strcat_s(szFullPathToSourceFile, maxStringSize, "\\"); } strcat_s(szFullPathToSourceFile, maxStringSize, szSrcFilePath); strcat_s(szRemoteCmdLine, maxStringSize, " /targetroot=\""); strcat_s(szRemoteCmdLine, maxStringSize, pathOnly.c_str()); strcat_s(szRemoteCmdLine, maxStringSize, "\""); strcat_s(szRemoteCmdLine, maxStringSize, " /overwritefilename=\""); strcat_s(szRemoteCmdLine, maxStringSize, szDstFileName); strcat_s(szRemoteCmdLine, maxStringSize, "\""); return CallResourceCompiler(szFullPathToSourceFile, szRemoteCmdLine, nullptr, true, IResourceCompilerHelper::eRcExePath_registry, false, !bUserDialog); } unsigned int IResourceCompilerHelper::GetNumSourceImageFormats() { return NUM_SOURCE_IMAGE_TYPE; } const char* IResourceCompilerHelper::GetSourceImageFormat(unsigned int index, bool bWithDot) { if (index >= GetNumSourceImageFormats()) { return nullptr; } if (bWithDot) { return SourceImageFormatExtsWithDot[index]; } else { return SourceImageFormatExts[index]; } } unsigned int IResourceCompilerHelper::GetNumEngineImageFormats() { return NUM_ENGINE_IMAGE_TYPE; } const char* IResourceCompilerHelper::GetEngineImageFormat(unsigned int index, bool bWithDot) { if (index >= GetNumEngineImageFormats()) { return nullptr; } if (bWithDot) { return EngineImageFormatExtsWithDot[index]; } else { return EngineImageFormatExts[index]; } } bool IResourceCompilerHelper::IsSourceImageFormatSupported(const char* szFileNameOrExtension) { if (!szFileNameOrExtension) // if this hits, might want to check the call site { return false; } //check the string length size_t len = strlen(szFileNameOrExtension); if (len < 3)//no point in going on if the smallest valid ext is 3 characters { return false; } //find the ext by starting at the last character and moving backward to first he first '.' const char* szExtension = nullptr; size_t cur = len - 1; while (cur && !szExtension) { if (szFileNameOrExtension[cur] == '.') { szExtension = &szFileNameOrExtension[cur]; } cur--; } if (len - cur < 3)//no point in going on if the smallest valid ext is 3 characters { return false; } //if we didn't find a '.' it could still be valid, they may not have //passed it in. i.e. "dds" instead of ".dds" which is still valid if (!szExtension) { //with no '.' the largest ext is currently 4 characters //no point in going on if it is larger if (len > 4) { return false; } szExtension = szFileNameOrExtension; } //loop over all the valid exts and see if it is one of them for (unsigned int i = 0; i < GetNumSourceImageFormats(); ++i) { if (!_stricmp(szExtension, GetSourceImageFormat(i, szExtension[0] == '.'))) { return true; } } return false; } bool IResourceCompilerHelper::IsGameImageFormatSupported(const char* szFileNameOrExtension) { if (!szFileNameOrExtension) // if this hits, might want to check the call site { return false; } //check the string length size_t len = strlen(szFileNameOrExtension); if (len < 3)//no point in going on if the smallest valid ext is 3 characters { return false; } //find the ext by starting at the last character and moving backward to first he first '.' const char* szExtension = nullptr; size_t cur = len - 1; while (cur && !szExtension) { if (szFileNameOrExtension[cur] == '.') { szExtension = &szFileNameOrExtension[cur]; } cur--; } if (len - cur < 3)//no point in going on if the smallest valid ext is 3 characters { return false; } //if we didn't find a '.' it could still be valid, they may not have //passed it in. i.e. "dds" instead of ".dds" which is still valid if (!szExtension) { //with no '.' the largest ext is currently 4 characters //no point in going on if it is larger if (len > 4) { return false; } szExtension = szFileNameOrExtension; } //loop over all the valid exts and see if it is one of them for (unsigned int i = 0; i < GetNumEngineImageFormats(); ++i) { if (!_stricmp(szExtension, GetEngineImageFormat(i, szExtension[0] == '.'))) { return true; } } return false; }
30.044974
164
0.604561
jeikabu
fab82bd1c7e49cd9c8a2fb05076aaf9b2a7a93fb
566
cpp
C++
Codeforces/69A - Young Physicist.cpp
naimulcsx/online-judge-solutions
0b80f81bcfb05a7cfe7fc925304c70b19eff1d6f
[ "MIT" ]
null
null
null
Codeforces/69A - Young Physicist.cpp
naimulcsx/online-judge-solutions
0b80f81bcfb05a7cfe7fc925304c70b19eff1d6f
[ "MIT" ]
null
null
null
Codeforces/69A - Young Physicist.cpp
naimulcsx/online-judge-solutions
0b80f81bcfb05a7cfe7fc925304c70b19eff1d6f
[ "MIT" ]
null
null
null
#include <iostream> #include <string> #include <vector> using namespace std; int main(void) { int numberOfVectors; cin >> numberOfVectors; int arr[numberOfVectors][3]; for (int i = 0; i < numberOfVectors; i++) cin >> arr[i][0] >> arr[i][1] >> arr[i][2]; int p = 0, q = 0, r = 0; for (int i = 0; i < numberOfVectors; i++) { p += arr[i][0]; q += arr[i][1]; r += arr[i][2]; } if (p == 0 && q == 0 && r == 0) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
19.517241
51
0.462898
naimulcsx
fab89358f86040fb144db934d0e49926f6fdc6b0
1,761
cpp
C++
android-28/android/hardware/usb/UsbRequest.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
12
2020-03-26T02:38:56.000Z
2022-03-14T08:17:26.000Z
android-28/android/hardware/usb/UsbRequest.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
1
2021-01-27T06:07:45.000Z
2021-11-13T19:19:43.000Z
android-30/android/hardware/usb/UsbRequest.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
3
2021-02-02T12:34:55.000Z
2022-03-08T07:45:57.000Z
#include "./UsbDeviceConnection.hpp" #include "./UsbEndpoint.hpp" #include "../../../JObject.hpp" #include "../../../java/nio/ByteBuffer.hpp" #include "./UsbRequest.hpp" namespace android::hardware::usb { // Fields // QJniObject forward UsbRequest::UsbRequest(QJniObject obj) : JObject(obj) {} // Constructors UsbRequest::UsbRequest() : JObject( "android.hardware.usb.UsbRequest", "()V" ) {} // Methods jboolean UsbRequest::cancel() const { return callMethod<jboolean>( "cancel", "()Z" ); } void UsbRequest::close() const { callMethod<void>( "close", "()V" ); } JObject UsbRequest::getClientData() const { return callObjectMethod( "getClientData", "()Ljava/lang/Object;" ); } android::hardware::usb::UsbEndpoint UsbRequest::getEndpoint() const { return callObjectMethod( "getEndpoint", "()Landroid/hardware/usb/UsbEndpoint;" ); } jboolean UsbRequest::initialize(android::hardware::usb::UsbDeviceConnection arg0, android::hardware::usb::UsbEndpoint arg1) const { return callMethod<jboolean>( "initialize", "(Landroid/hardware/usb/UsbDeviceConnection;Landroid/hardware/usb/UsbEndpoint;)Z", arg0.object(), arg1.object() ); } jboolean UsbRequest::queue(java::nio::ByteBuffer arg0) const { return callMethod<jboolean>( "queue", "(Ljava/nio/ByteBuffer;)Z", arg0.object() ); } jboolean UsbRequest::queue(java::nio::ByteBuffer arg0, jint arg1) const { return callMethod<jboolean>( "queue", "(Ljava/nio/ByteBuffer;I)Z", arg0.object(), arg1 ); } void UsbRequest::setClientData(JObject arg0) const { callMethod<void>( "setClientData", "(Ljava/lang/Object;)V", arg0.object<jobject>() ); } } // namespace android::hardware::usb
20.476744
130
0.667802
YJBeetle
fabe170f27fd07fce247851e8f736902c89a8b11
842
hpp
C++
include/svgpp/factory/unitless_angle.hpp
RichardCory/svgpp
801e0142c61c88cf2898da157fb96dc04af1b8b0
[ "BSL-1.0" ]
428
2015-01-05T17:13:54.000Z
2022-03-31T08:25:47.000Z
include/svgpp/factory/unitless_angle.hpp
andrew2015/svgpp
1d2f15ab5e1ae89e74604da08f65723f06c28b3b
[ "BSL-1.0" ]
61
2015-01-08T14:32:27.000Z
2021-12-06T16:55:11.000Z
include/svgpp/factory/unitless_angle.hpp
andrew2015/svgpp
1d2f15ab5e1ae89e74604da08f65723f06c28b3b
[ "BSL-1.0" ]
90
2015-05-19T04:56:46.000Z
2022-03-26T16:42:50.000Z
// Copyright Oleg Maximenko 2014. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://github.com/svgpp/svgpp for library home page. #pragma once #include <svgpp/traits/angle_units.hpp> namespace svgpp { namespace factory { namespace angle { template<class Angle = double, class ReferenceAngleUnits = tag::angle_units::deg> struct unitless { typedef Angle angle_type; template<class Number> static Angle create(Number value, ReferenceAngleUnits) { return static_cast<Angle>(value); } template<class Number, class Units> static Angle create(Number value, Units) { return static_cast<Angle>(value) * traits::angle_conversion_coefficient<Units, ReferenceAngleUnits, Angle>::value(); } }; }}}
25.515152
120
0.74228
RichardCory
fac23cb256e165423d7d4342757c4467f0d43a71
10,693
cpp
C++
practicaIntegradoraPOO/src/main.cpp
JosueCano143/Object-oriented-programming
ab889d4b4eec5db75311d4700d11aacef53d23f9
[ "MIT" ]
1
2020-09-28T05:45:54.000Z
2020-09-28T05:45:54.000Z
practicaIntegradoraPOO/src/main.cpp
JosueCano143/Object-oriented-programming
ab889d4b4eec5db75311d4700d11aacef53d23f9
[ "MIT" ]
null
null
null
practicaIntegradoraPOO/src/main.cpp
JosueCano143/Object-oriented-programming
ab889d4b4eec5db75311d4700d11aacef53d23f9
[ "MIT" ]
null
null
null
// Josue Salvador Cano Martinez | A00829022 // Programación orientada a objetos (c++) // Proyecto integrador: Streaming // 05 Junio 2020 // Incluir librerías #include <iostream> #include <fstream> using namespace std; // Incluir clases #include "Pelicula.h" #include "Episodio.h" #include "Serie.h" #include "Video.h" // Cargar los datos de los archivos .txt void cargaDatosVideo(Video *listaVideos[], int &cantVideos) { // Definir variables int id, duracion, calificacion, numeroEpisodio, numeroTemporada; string nombre, genero, tituloSerie, director; char tipo; // Abrir archivo ifstream archivo; archivo.open("datosVideos.txt"); // Ciclo que itera todos los registros cantVideos = 0; while (archivo >> tipo) { // Determinar si se trata de una película if (tipo == 'p'){ // Obtener datos de la película archivo >> id >> nombre >> genero >> duracion >> calificacion >> director; // Asignar datos de la película listaVideos[cantVideos++] = new Pelicula(id, nombre, genero, duracion, calificacion, director); } else{ // Obtener datos de una serie archivo >> id >> nombre >> genero >> duracion >> calificacion >> director >> tituloSerie >> numeroEpisodio >> numeroTemporada; // Asignar datos de la serie listaVideos[cantVideos++] = new Episodio(id, nombre, genero, duracion, calificacion, director, tituloSerie, numeroEpisodio, numeroTemporada); } } // Cerrar el archivo de lectura archivo.close(); } // Cargar los dtos del fichero de series void cargaDatosSerie(Serie *listaSeries[], int &cantSeries) { // Definir variables string nombre; int id; // Abrir archivo ifstream archivo; archivo.open("datosSeries.txt"); // Iterar todos los registros del fichero cantSeries = 0; while (archivo >> id){ // Obtener el nombre de la serie archivo >> nombre; // Asignar el nombre de la serie listaSeries[cantSeries++] = new Serie(nombre); } // Cerrar el archivo archivo.close(); } // Método que muestra las películas void muestraPeliculas(Video *listaVideos[], int cantVideos){ // Iterar la lista de videos for(int i=0; i<cantVideos; i++){ // Seleccionar los videos que sean películas if(typeid(*listaVideos[i]) == typeid(Pelicula)){ // Imprimir los vídeos (películas) selecionados listaVideos[i]->imprimir(); } } } // Método que muestra videos con cierta calificación void muestraVideosCalificacion(Video *listaVideos[], int cantVideos, int cal){ // Iteración de la lista de videos for(int i=0; i<cantVideos; i++){ // Comparar si la calificación del vídeo coincide con la que ingresa el usuario if(listaVideos[i]->getCalificacion() == cal){ // Imprimir los vídeos listaVideos[i]->imprimir(); } } } // Método que muestra los videos con cierto género void muestraVideosGenero(Video *listaVideos[], int cantVideos, string genero){ int validacion = 0; // Iteración de la lista de videos for(int i=0; i<cantVideos; i++){ // Comparar si el género del vídeo coincide con el ingresado por el usuario if(listaVideos[i]->getGenero() == genero){ // Imprimir el vídeo listaVideos[i]->imprimir(); validacion += 1; } } // Validación el dato ingresado por el usuario if(validacion == 0){ cout <<"Error, el genero no existente o fue escrito incorrectamente"; } } // Método que imprime las series void muestraSeries(Serie *listaSeries[], int cantSeries){ // Iteración de la lista de series for(int i=0; i<cantSeries; i++){ // Impresión del nombre de la serie listaSeries[i]->imprimir(); } } // Método que imprime los episodios de una serie con su respectiva calificación void episodiosDeSerie(Video *listaVideos[], int cantVideos, string serie){ Episodio *misEpisodios; int validacion = 0; // Iteración de la lista de videos for(int i=0; i<cantVideos; i++){ // Determinar si el video se trata de un episodio if(typeid(*listaVideos[i]) == typeid(Episodio)){ // Agregar los episodios misEpisodios = (Episodio *)listaVideos[i]; // Comparar si los títulos son iguales if(misEpisodios->getTituloSerie() == serie) { // Obtner el nombre y la calificación de episodio string name = misEpisodios->getNombre(); int cal = misEpisodios->getCalificacion(); // Imprimir el nombre y la calificación del episodio cout << name <<" "; cout << cal << endl; validacion += 1; } } } // Validar el dato ingresado por el usuario if (validacion == 0){ cout << "El nombre de la serie es incorrecto o no existe"; } } //Método que muestra las películas con cierta calificación void muestraPeliculasCalificacion(Video *listaVideos[], int cantVideos, int cal){ // Iterar la lista de videos for(int i=0; i<cantVideos; i++){ // Determinar si el video es una película y además tiene una calificación igual a la ingresada por el usuario if(typeid(*listaVideos[i]) == typeid(Pelicula) && listaVideos[i]->getCalificacion() == cal){ // Imprimir los videos listaVideos[i]->imprimir(); } } } // Método que permite determinar si el usuario conoce al director de cierto video void evaluaDirector(Video *listaVideos[], int cantVideos, string video, string director){ int validar = 0; // Iteración de la lista de videos for(int i=0; i<cantVideos; i++){ // Comparar si el video tiene el nombre que ingresó el usuario if(listaVideos[i]->getNombre() == video){ validar += 1; // Obtner el nombre del director del video string name = listaVideos[i]->getDirector(); // Comparar si coincide la respuesta del usuario con el dato real if(name == director){ // Mensaje en caso de ser correcto cout << "Correcto, has acertado"; } // Mensaje en caso de ser incorrecto else{ cout << "Incorrecto"; } } } // Validar nombre del video ingresado por el usuario if(validar == 0){ cout << "Error, video escrito incorrectamente o no existente"; } } // Menú de opciones para el usuario int menu() { int iOpcion; // Impresión de las funciones que existen cout << "\n1. Cargar ficheros" << "\n2. Mostrar lista de peliculas" << "\n3. Mostrar lista de series" << "\n4. Mostrar videos en general con cierta calificacion" << "\n5. Mostrar videos en general con cierto genero" << "\n6. Mostrar episodios de una determinada serie con sus calificaciones" << "\n7. Mostrar peliculas con cierta calificacion" << "\n8. Adivina el director del video" << "\n0. Salir" << "\nIngrese su opcion: "; // Tomar la respuesta del usuario cin >> iOpcion; // Retornar respuesta del usuario return iOpcion; } // Main int main() { // Apuntadores Video *listaVideos[50]; int cantVideos; Serie *listaSeries[50]; int cantSeries; // Varianles a manejar en el switch-case int iOpcion; string genero, serie, director, video; int cal, id; // Mandar al menú iOpcion = menu(); // Permitir usar el programa hasta que el usuario ingrse 0 while (iOpcion != 0) { switch (iOpcion) { // Cargar los datos del fichero case 1: cargaDatosVideo(listaVideos, cantVideos); cargaDatosSerie(listaSeries, cantSeries); break; // Mostrar las películas case 2: muestraPeliculas(listaVideos, cantVideos); break; // Mostrar las series case 3: muestraSeries(listaSeries, cantSeries); break; // Mostrar videos con cierta calificación case 4: cout << "Ingrese la calificacion (entero entre 1 y 5): "; cin >> cal; while(cal<0 or cal>5){ cout << "ERROR, dato fuera de parametros" <<endl; cout << "Ingrese la calificacion (entero entre 1 y 5): "; cin >> cal; } muestraVideosCalificacion(listaVideos, cantVideos, cal); break; // Mostrar los videos de cierto género case 5: cout << "Ingrese el genero (sintaxis: Genero | Mi_genero): "; cin >> genero; muestraVideosGenero(listaVideos, cantVideos, genero); break; // Mostrar episodios de una serie con su calificación case 6: cout << "Ingrese la serie (sintaxis: Stranger_things): "; cin >> serie; episodiosDeSerie(listaVideos, cantVideos, serie); break; // Mostrar películas con cierta calificación case 7: cout << "Ingrese la calificacion (entero entre 1 y 5): "; cin >> cal; while(cal<0 or cal>5){ cout << "ERROR, dato fuera de parametros" << endl; cout << "Ingrese la calificacion (entero entre 1 y 5): "; cin >> cal; } muestraPeliculasCalificacion(listaVideos, cantVideos, cal); break; // Adivinar el director del video case 8: cout << "Ingrese el nombre del video:"; cout << "Nota: primera letra de cada palabra con mayuscula, conectores" <<endl; cout << "se escriben con minusculas, palabras separadas por guion bajo: "; cin >> video; cout << "Ingrese solo el primer nombre del director (en minusculas): "; cin >> director; evaluaDirector(listaVideos, cantVideos, video, director); break; // En caso de que el usuario ingrse una opción inválida default: cout << "Opcion Incorrecta\n"; break; } iOpcion = menu(); } return 0; }
35.762542
154
0.576919
JosueCano143
fac3af94081f53f188a7c5fe1612555223b4e867
1,162
hpp
C++
fac/ASTs/Exprs/AstExpr_op1.hpp
fa-org/fa
13bba132b682554beccc25e6d016e04b7b67998f
[ "MIT" ]
20
2021-11-23T23:38:25.000Z
2022-03-13T04:39:24.000Z
fac/ASTs/Exprs/AstExpr_op1.hpp
fa-org/fa
13bba132b682554beccc25e6d016e04b7b67998f
[ "MIT" ]
5
2021-11-24T04:48:59.000Z
2022-01-02T15:27:12.000Z
fac/ASTs/Exprs/AstExpr_op1.hpp
fa-org/fa
13bba132b682554beccc25e6d016e04b7b67998f
[ "MIT" ]
10
2021-11-24T03:36:12.000Z
2022-03-06T19:13:10.000Z
#ifndef __AST_EXPR_OP1_HPP__ #define __AST_EXPR_OP1_HPP__ #include <memory> #include <string> #include "IAstExpr.hpp" struct AstExpr_op1: public IAstExpr { PAstExpr m_base; std::string m_op; bool m_prefix; AstExpr_op1 (antlr4::Token *_token, PAstExpr _base, std::string _op, bool _prefix): IAstExpr (_token), m_base (_base), m_op (_op), m_prefix (_prefix) {} void GetChildTypes (std::function<void (PAstType &)> _cb) override {} void GetChildExprs (std::function<void (PAstExpr &)> _cb) override { _cb (m_base); } void GetChildStmts (std::function<void (PAstStmt &)> _cb) override {} PAstType GuessType () override { throw NOT_IMPLEMENT (); } void ProcessCode (PAstType _type) override { throw NOT_IMPLEMENT (); } std::string GenCppCode (size_t _indent) override { if (m_prefix) { return std::format ("{}{}", m_op, m_base->GenCppCode (_indent)); } else { return std::format ("{}{}", m_base->GenCppCode (_indent), m_op); } } static PAstExpr Make (antlr4::Token *_token, PAstExpr _base, std::string _op, bool _prefix) { return new AstExpr_op1 { _token, _base, _op, _prefix }; } }; #endif //__AST_EXPR_OP1_HPP__
21.924528
94
0.697935
fa-org
fac3c85280d7b96489ad9b14df80c943720f2366
99
cc
C++
tests/data/test-diff-filter/test5-v1.cc
insilications/libabigail-clr
1eb5d367686626660d3cc987b473f296b0a59152
[ "Apache-2.0" ]
3
2021-01-29T20:26:44.000Z
2021-04-28T07:49:48.000Z
tests/data/test-diff-filter/test5-v1.cc
insilications/libabigail-clr
1eb5d367686626660d3cc987b473f296b0a59152
[ "Apache-2.0" ]
2
2021-03-07T19:31:56.000Z
2021-03-07T23:26:13.000Z
tests/data/test-diff-filter/test5-v1.cc
insilications/libabigail-clr
1eb5d367686626660d3cc987b473f296b0a59152
[ "Apache-2.0" ]
1
2021-03-07T19:14:08.000Z
2021-03-07T19:14:08.000Z
class C0 { public: int m0; C0() :m0(0) {} }; typedef C0 c0_type; void foo(c0_type) {}
6.1875
19
0.535354
insilications
fac8f32b6a77baa604f5831f0189ea2db6866ad1
3,363
hpp
C++
include/openpose/gui/wGuiAdam.hpp
purushothamgowthu/openpose
7c21e0b6b184e4dd0b7e119f470089a4149b6e2d
[ "DOC", "MIT-CMU" ]
43
2018-07-07T02:40:22.000Z
2020-12-17T08:18:18.000Z
include/openpose/gui/wGuiAdam.hpp
purushothamgowthu/openpose
7c21e0b6b184e4dd0b7e119f470089a4149b6e2d
[ "DOC", "MIT-CMU" ]
null
null
null
include/openpose/gui/wGuiAdam.hpp
purushothamgowthu/openpose
7c21e0b6b184e4dd0b7e119f470089a4149b6e2d
[ "DOC", "MIT-CMU" ]
26
2017-08-26T04:08:26.000Z
2022-02-08T09:34:05.000Z
#ifdef USE_3D_ADAM_MODEL #ifndef OPENPOSE_GUI_W_GUI_ADAM_HPP #define OPENPOSE_GUI_W_GUI_ADAM_HPP #include <openpose/core/common.hpp> #include <openpose/gui/guiAdam.hpp> #include <openpose/thread/workerConsumer.hpp> namespace op { template<typename TDatums> class WGuiAdam : public WorkerConsumer<TDatums> { public: explicit WGuiAdam(const std::shared_ptr<GuiAdam>& guiAdam); void initializationOnThread(); void workConsumer(const TDatums& tDatums); private: std::shared_ptr<GuiAdam> spGuiAdam; DELETE_COPY(WGuiAdam); }; } // Implementation #include <openpose/utilities/pointerContainer.hpp> namespace op { template<typename TDatums> WGuiAdam<TDatums>::WGuiAdam(const std::shared_ptr<GuiAdam>& guiAdam) : spGuiAdam{guiAdam} { } template<typename TDatums> void WGuiAdam<TDatums>::initializationOnThread() { try { spGuiAdam->initializationOnThread(); } catch (const std::exception& e) { error(e.what(), __LINE__, __FUNCTION__, __FILE__); } } template<typename TDatums> void WGuiAdam<TDatums>::workConsumer(const TDatums& tDatums) { try { // tDatums might be empty but we still wanna update the GUI if (tDatums != nullptr) { // Debugging log dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); // Profiling speed const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__); // Update cvMat & keypoints if (!tDatums->empty()) { // Update cvMat std::vector<cv::Mat> cvOutputDatas; for (auto& tDatum : *tDatums) cvOutputDatas.emplace_back(tDatum.cvOutputData); spGuiAdam->setImage(cvOutputDatas); // Update keypoints const auto& tDatum = (*tDatums)[0]; if (!tDatum.poseKeypoints3D.empty()) spGuiAdam->generateMesh(tDatum.poseKeypoints3D, tDatum.faceKeypoints3D, tDatum.handKeypoints3D, tDatum.adamPose.data(), tDatum.adamTranslation.data(), tDatum.vtVec.data(), tDatum.vtVec.rows(), tDatum.j0Vec.data(), tDatum.j0Vec.rows(), tDatum.adamFaceCoeffsExp.data()); } // Refresh/update GUI spGuiAdam->update(); // Profiling speed if (!tDatums->empty()) { Profiler::timerEnd(profilerKey); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__); } // Debugging log dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); } } catch (const std::exception& e) { this->stop(); error(e.what(), __LINE__, __FUNCTION__, __FILE__); } } COMPILE_TEMPLATE_DATUM(WGuiAdam); } #endif // OPENPOSE_GUI_W_GUI_ADAM_HPP #endif
31.138889
119
0.540886
purushothamgowthu
fad1c8e955b0eec616c67afecf9aa88f1575faaf
5,024
hpp
C++
include/overloaded-fn-ref-abomination.hpp
Quincunx271/MusingsCpp
53991afe3f52c5474cccc48705372203cfefa69a
[ "MIT" ]
null
null
null
include/overloaded-fn-ref-abomination.hpp
Quincunx271/MusingsCpp
53991afe3f52c5474cccc48705372203cfefa69a
[ "MIT" ]
null
null
null
include/overloaded-fn-ref-abomination.hpp
Quincunx271/MusingsCpp
53991afe3f52c5474cccc48705372203cfefa69a
[ "MIT" ]
null
null
null
#include <functional> #include <type_traits> #include <utility> #include <boost/hana.hpp> // Function reference. Similar to what I'd expect `[]someFunction` to do // if the proposal goes through. The intention of this is to lift an // overload set into a lambda. Calling `FREF(std::foo)` acts as if you called // `std::foo` directly #define FREF(...) \ [](auto&&... args) \ noexcept(noexcept( \ __VA_ARGS__(std::forward<decltype(args)>(args)...) \ )) -> decltype( \ __VA_ARGS__(std::forward<decltype(args)>(args)...) \ ) { return \ __VA_ARGS__(std::forward<decltype(args)>(args)...) \ ;} namespace ns { template <typename T> struct is_reference_wrapper : std::false_type {}; template <typename... Ts> struct is_reference_wrapper<std::reference_wrapper<Ts...>> : std::true_type {}; } // Lift member function overload sets into lambdas, with `std::invoke`-like behaviour. The problem // is that we can't use `std::invoke` because our function can't be a function object (overloads). // // Calling syntax: stuff like `MEM_FREF(std::string::size)` is valid because // `myString.std::string::size()` is valid, but it probably doesn't work for data members - // I'm not sure if `myString.my::namespace_::size` would work. // // For templates, it needs the `template` keyword: `MEM_FREF(std::template vector<int>)`. // Better would be `MEM_FREF(size)` for both; it works for any type that has a `.size()` member // or even just `.size` member #define FWD(...) ::std::forward<decltype(__VA_ARGS__)>(__VA_ARGS__) #define CALL_FWD_ARGS (FWD(args)...) #define MEM_FREF_CALL_NORMAL(CALL, ...) \ [](auto&& arg0, auto&&... args) \ noexcept(noexcept(FWD(arg0).__VA_ARGS__ CALL)) \ -> decltype(FWD(arg0).__VA_ARGS__ CALL) \ { \ return FWD(arg0).__VA_ARGS__ CALL; \ } #define MEM_FREF_CALL_REF_WRAP(CALL, ...) \ [](auto&& arg0, auto&&... args) \ noexcept(noexcept(arg0.get().__VA_ARGS__ CALL)) \ -> std::enable_if_t< \ ns::is_reference_wrapper<std::decay_t<decltype(arg0)>>::value, \ decltype(arg0.get().__VA_ARGS__ CALL) \ > \ { \ return arg0.get().__VA_ARGS__ CALL; \ } #define MEM_FREF_CALL_DEREF(CALL, ...) \ [](auto&& arg0, auto&&... args) \ noexcept(noexcept((*FWD(arg0)).__VA_ARGS__ CALL)) \ -> decltype((*FWD(arg0)).__VA_ARGS__ CALL) \ { \ return (*FWD(arg0)).__VA_ARGS__ CALL; \ } #define MEM_FREF(...) \ ::boost::hana::overload_linearly( \ MEM_FREF_CALL_NORMAL(CALL_FWD_ARGS, __VA_ARGS__), \ MEM_FREF_CALL_REF_WRAP(CALL_FWD_ARGS, __VA_ARGS__), \ MEM_FREF_CALL_DEREF(CALL_FWD_ARGS, __VA_ARGS__), \ MEM_FREF_CALL_NORMAL(, __VA_ARGS__), \ MEM_FREF_CALL_DEREF(, __VA_ARGS__) \ ) // #include <algorithm> // #include <string> // #include <initializer_list> // #include <vector> // #include <array> // // int main() { // auto f = MEM_FREF(size); // auto myMin = FREF(std::min); // // std::string test = "Hello, world!\n"; // size() == 14 // std::array<int, 5> foo = {1, 2, 3, 4, 5}; // size() == 5 // return f(test) + f(foo) // 14 + 5 = 19 // + MEM_FREF(std::string::size)(test) // + 14 // + MEM_FREF(std::template array<int, 5>::size)(foo) // + 5 = 38 // + myMin(1, 2) // + 1 // + myMin(std::initializer_list<int>{1, 2}); // + 1 = 40 // }
50.24
98
0.42078
Quincunx271
fad2f63dbe5ad48db907a1fbea67f15365082e58
2,587
cpp
C++
src/baseClasses/vrposrm.cpp
woodbri/vehicle-routing-problems
aae24d92f46a6b1d473ad8f4ec6db9c96742b708
[ "MIT" ]
16
2015-06-26T22:53:20.000Z
2021-03-09T22:54:33.000Z
src/baseClasses/vrposrm.cpp
woodbri/vehicle-routing-problems
aae24d92f46a6b1d473ad8f4ec6db9c96742b708
[ "MIT" ]
21
2015-01-29T14:16:19.000Z
2016-03-27T00:09:50.000Z
src/baseClasses/vrposrm.cpp
woodbri/vehicle-routing-problems
aae24d92f46a6b1d473ad8f4ec6db9c96742b708
[ "MIT" ]
10
2015-07-18T02:48:35.000Z
2019-12-25T11:04:17.000Z
/*VRP********************************************************************* * * vehicle routing problems * A collection of C++ classes for developing VRP solutions * and specific solutions developed using these classes. * * Copyright 2014 Stephen Woodbridge <woodbri@imaptools.com> * Copyright 2014 Vicky Vergara <vicky_vergara@hotmail.com> * * This is free software; you can redistribute and/or modify it under * the terms of the MIT License. Please file LICENSE for details. * ********************************************************************VRP*/ #include <iostream> #include <sstream> #include <string> #include "logger.h" #include "vrposrm.h" bool VrpOSRM::getTravelTime( double &ttime ) const { rapidjson::Document jsondoc; jsondoc.Parse( json.c_str() ); if ( jsondoc.HasParseError() ) { DLOG( INFO ) << "Error: Invalid json document in OSRM response!"; return true; } if ( not jsondoc.HasMember( "route_summary" ) ) { DLOG( INFO ) << "Error: Failed to find 'route_summary' key in json document!"; return true; } if ( not jsondoc["route_summary"].HasMember( "total_time" ) ) { DLOG( INFO ) << "Error: Failed to find 'total_time' key in json document!"; return true; } ttime = jsondoc["route_summary"]["total_time"].GetDouble() / 60.0; return false; } bool VrpOSRM::getStatus( int &status ) const { status = -1; if ( json.size() == 0 ) { DLOG( INFO ) << "Null json document in OSRM response!"; return true; } rapidjson::Document jsondoc; jsondoc.Parse( json.c_str() ); if ( jsondoc.HasParseError() ) { DLOG( INFO ) << "Error: Invalid json document in OSRM response!"; return true; } if ( not jsondoc.HasMember( "status" ) ) { DLOG( INFO ) << "Error: Failed to find 'status' key in json document!"; return true; } status = jsondoc["status"].GetInt(); return false; } bool VrpOSRM::callOSRM( const std::string url ) { std::stringstream result; //DLOG(INFO) << "callOSRM: url: " << url; try { curlpp::Easy request; request.setOpt( new cURLpp::Options::Url( url ) ); request.setOpt( new cURLpp::Options::WriteStream( &result ) ); request.perform(); json = result.str(); } catch ( curlpp::LogicError &e ) { DLOG( WARNING ) << e.what(); return true; } catch ( curlpp::RuntimeError &e ) { DLOG( WARNING ) << e.what(); return true; } return false; }
24.875
86
0.571318
woodbri
fad36d15b11d2511c2204fcc4605acc92a5a6b01
348
cpp
C++
example/example.cpp
ediston/BigNumberCalculator-Cpp
0d66daba5488e271d42cbb089aeec419ae95eba2
[ "Unlicense" ]
null
null
null
example/example.cpp
ediston/BigNumberCalculator-Cpp
0d66daba5488e271d42cbb089aeec419ae95eba2
[ "Unlicense" ]
null
null
null
example/example.cpp
ediston/BigNumberCalculator-Cpp
0d66daba5488e271d42cbb089aeec419ae95eba2
[ "Unlicense" ]
null
null
null
#include "../header/BigNumberCalculator.h" int main() { //Add cout << "Addition: " << add("19", "-22") << endl; //Subtract cout << "Subtract: " << subtract("122", "119") << endl; // Multiply cout << "Multiply: " << multiply("98", "-13") << endl; //103! cout << "Factorial: "<< fact(103) << endl; return 0; }
24.857143
60
0.5
ediston
fad7011382198de1113317d66cfbeaed49c26789
535
hpp
C++
src/bitstream.hpp
mrwonko/physfs-bfs
1eb96bb312247b825ca6ed4629d82d785ca00991
[ "Zlib" ]
2
2019-09-27T06:44:54.000Z
2020-10-23T17:16:01.000Z
src/bitstream.hpp
mrwonko/physfs-bfs
1eb96bb312247b825ca6ed4629d82d785ca00991
[ "Zlib" ]
1
2016-05-26T20:46:47.000Z
2016-05-26T20:46:47.000Z
src/bitstream.hpp
mrwonko/physfs-bfs
1eb96bb312247b825ca6ed4629d82d785ca00991
[ "Zlib" ]
null
null
null
#pragma once #include <vector> class BitStream { public: BitStream( const char * const begin, const char* const end ); ~BitStream() = default; BitStream( const BitStream& rhs ) = default; BitStream& operator=( const BitStream& rhs ) = delete; /** @param out_bit 0 iff next bit is 0 @return if already eof(), thus no reading possible **/ bool read( bool& out_bit ); bool eof() const { return m_iterator == m_end; } private: const char * m_iterator; const char * const m_end; unsigned char m_curBit = 0; };
21.4
63
0.672897
mrwonko
fad7a374495c9e62db142a538efd9ef4cb264647
8,964
hpp
C++
motion/src/objectdetector.hpp
yoosamui/secam
c709b106227e2c57105bc9013b4d622c87f099db
[ "MIT" ]
null
null
null
motion/src/objectdetector.hpp
yoosamui/secam
c709b106227e2c57105bc9013b4d622c87f099db
[ "MIT" ]
1
2022-02-11T11:41:21.000Z
2022-02-11T11:41:21.000Z
motion/src/objectdetector.hpp
yoosamui/secam
c709b106227e2c57105bc9013b4d622c87f099db
[ "MIT" ]
null
null
null
// // https://github.com/doleron/yolov5-opencv-cpp-python // https://github.com/doleron/yolov5-opencv-cpp-python.git // #pragma once #include <opencv2/dnn.hpp> #include <queue> #include "common.h" #include "config.h" #include "constants.h" #include "ofMain.h" #include "ofThread.h" #include "ofxCv.h" #include "ofxOpenCv.h" #include "opencv2/imgcodecs.hpp" #include "videowriter.hpp" using namespace ofxCv; using namespace cv; using namespace std; using namespace dnn; class Objectdetector : public ofThread { const uint16_t QUEUE_MAX_SIZE = 5; const float INPUT_WIDTH = 640.0; const float INPUT_HEIGHT = 640.0; const float SCORE_THRESHOLD = 0.2; const float NMS_THRESHOLD = 0.4; const float CONFIDENCE_THRESHOLD = 0.5; const string m_title = "PERSON_"; struct Detection { int class_id; float confidence; Rect box; }; // clang-format off map<string, Scalar> color_map = { {"person", Scalar(0, 255, 255)}, {"motorbike", Scalar(255, 255, 0)}, {"car", Scalar(0, 255, 0)} }; // clang-format on public: ofEvent<int> on_finish_detections; Objectdetector() { ifstream ifs("data/classes.txt"); string line; while (getline(ifs, line)) { m_classes.push_back(line); } auto result = dnn::readNet("data/yolov5s.onnx"); if (m_is_cuda) { result.setPreferableBackend(dnn::DNN_BACKEND_CUDA); result.setPreferableTarget(dnn::DNN_TARGET_CUDA_FP16); } else { result.setPreferableBackend(dnn::DNN_BACKEND_OPENCV); result.setPreferableTarget(dnn::DNN_TARGET_CPU); } m_net = result; } void add(const Mat &img, const Rect &r) { if (m_frames.size() >= 12 || ++m_frame_number % 3 || img.empty() || m_lock) { return; } common::log("Add probe frame = " + to_string(r.width) + " x " + to_string(r.height)); Mat frame; img.copyTo(frame); common::bgr2rgb(frame); m_frames.push_back(frame); // string filename = m_writer.get_filepath("probe", ".jpg", 1); // imwrite(filename, frame); } void detect() { m_processing = true; if (m_frames.size()) { m_lock = true; common::log("Detected frames count :" + to_string(m_frames.size())); } int i = 0; for (auto &frame : m_frames) { if (m_detected) break; common::log("Add probe to queue :" + to_string(i)); m_queue.push(frame.clone()); frame.release(); i++; } reset(); } void start() { reset(); m_filename = m_writer.get_filepath("PERSON_" + m_config.parameters.camname, ".jpg", 1); } bool detected() { // return m_detected; } private: Videowriter m_writer; Config &m_config = m_config.getInstance(); vector<Mat> m_frames; vector<string> m_classes; int m_frame_number = 1; bool m_is_cuda = false; bool m_processing = false; bool m_lock = false; bool m_detected = false; dnn::Net m_net; Rect m_detection_rect; string m_filename; string m_destination_dir; string m_file; string m_time_zone = m_config.settings.timezone; queue<Mat> m_queue; void reset() { m_frames.clear(); m_lock = false; m_detected = false; } Scalar get_color(const string &name) { if (color_map.count(name) == 0) return Scalar(255, 255, 255); return color_map[name]; } // override void threadedFunction() { vector<Detection> output; int count; while (isThreadRunning()) { count = 0; while (!m_queue.empty() && m_processing) { common::log("Start detection => " + to_string(count)); output.clear(); Mat frame = m_queue.front(); m_detected = detect(frame.clone(), output); m_queue.pop(); count++; if (m_detected) { while (!m_queue.empty()) { m_queue.pop(); } common::log("!!!Person detected!!!"); break; } } if (m_processing) { ofNotifyEvent(on_finish_detections, count, this); m_processing = false; m_lock = false; } ofSleepMillis(10); } } template <typename T> string tostr(const T &t, int precision = 2) { ostringstream ss; ss << fixed << setprecision(precision) << t; return ss.str(); } Mat format_yolov5(const Mat &source) { int col = source.cols; int row = source.rows; int _max = max(col, row); Mat result = Mat::zeros(_max, _max, CV_8UC3); source.copyTo(result(Rect(0, 0, col, row))); return result; } int detect(Mat frame, vector<Detection> &output) { Mat blob; auto input_image = format_yolov5(frame); dnn::blobFromImage(input_image, blob, 1. / 255., cv::Size(INPUT_WIDTH, INPUT_HEIGHT), Scalar(), true, false); m_net.setInput(blob); vector<Mat> outputs; m_net.forward(outputs, m_net.getUnconnectedOutLayersNames()); float x_factor = input_image.cols / INPUT_WIDTH; float y_factor = input_image.rows / INPUT_HEIGHT; float *data = (float *)outputs[0].data; const int rows = 25200; vector<int> class_ids; vector<float> confidences; vector<Rect> boxes; for (int i = 0; i < rows; ++i) { float confidence = data[4]; if (confidence >= CONFIDENCE_THRESHOLD) { float *classes_scores = data + 5; Mat scores(1, m_classes.size(), CV_32FC1, classes_scores); Point class_id; double max_class_score; minMaxLoc(scores, 0, &max_class_score, 0, &class_id); if (max_class_score > SCORE_THRESHOLD) { confidences.push_back(confidence); class_ids.push_back(class_id.x); float x = data[0]; float y = data[1]; float w = data[2]; float h = data[3]; int left = int((x - 0.5 * w) * x_factor); int top = int((y - 0.5 * h) * y_factor); int width = int(w * x_factor); int height = int(h * y_factor); boxes.push_back(Rect(left, top, width, height)); } } data += 85; } vector<int> nms_result; dnn::NMSBoxes(boxes, confidences, SCORE_THRESHOLD, NMS_THRESHOLD, nms_result); for (size_t i = 0; i < nms_result.size(); i++) { int idx = nms_result[i]; Detection result; result.class_id = class_ids[idx]; result.confidence = confidences[idx]; result.box = boxes[idx]; output.push_back(result); } return draw(frame, output) != 0; } bool draw(const Mat &frame, vector<Detection> &output) { int detections = output.size(); if (!detections) return false; Mat input; frame.copyTo(input); bool found = false; for (int c = 0; c < detections; ++c) { auto detection = output[c]; auto box = detection.box; auto classId = detection.class_id; auto color = get_color(m_classes[classId]); if (!found) found = m_classes[classId] == "person"; Rect r = inflate(box, 20, input); rectangle(input, r, color, 2); rectangle(input, Point(r.x - 1, r.y - 20), cv::Point(r.x + r.width, r.y), color, FILLED); float fscale = 0.4; int thickness = 1; string title = m_classes[classId]; putText(input, title, Point(r.x + 2, r.y - 5), cv::FONT_HERSHEY_SIMPLEX, fscale, Scalar(0, 0, 0), thickness, LINE_AA, false); } if (found) imwrite(m_filename, input); return found; } Rect inflate(const Rect &rect, size_t size, const Mat &frame) { Rect r = rect; r.x -= size; if (r.x < 0) r.x = 0; r.y -= size; if (r.y < 0) r.y = 0; r.width += size * 2; if (r.x + r.width > frame.cols) { r.x -= (r.x + r.width) - frame.cols; } r.height += size * 2; if (r.y + r.height > frame.rows) { r.y -= (r.y + r.height) - frame.rows; } return r; } };
25.109244
95
0.522311
yoosamui
fad82ddf69f224ff85fc9c42b44cbda8d8430dcf
322,286
cpp
C++
Temp/il2cppOutput/il2cppOutput/Il2CppCompilerCalculateTypeValues_32Table.cpp
bhuwanY-Hexaware/MapBox_ARKit
64edeb918b61c8d250ac8273253a065181de6c18
[ "Apache-2.0" ]
null
null
null
Temp/il2cppOutput/il2cppOutput/Il2CppCompilerCalculateTypeValues_32Table.cpp
bhuwanY-Hexaware/MapBox_ARKit
64edeb918b61c8d250ac8273253a065181de6c18
[ "Apache-2.0" ]
null
null
null
Temp/il2cppOutput/il2cppOutput/Il2CppCompilerCalculateTypeValues_32Table.cpp
bhuwanY-Hexaware/MapBox_ARKit
64edeb918b61c8d250ac8273253a065181de6c18
[ "Apache-2.0" ]
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.Collections.Generic.Dictionary`2<System.Int32,System.String> struct Dictionary_2_t736164020; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima struct LocalMinima_t86068969; // System.Collections.Generic.List`1<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge>> struct List_1_t343237081; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam struct Scanbeam_t3952834741; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec> struct List_1_t1788952413; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge struct TEdge_t1694054893; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt struct OutPt_t2591102706; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode struct PolyNode_t1300984468; // Mapbox.VectorTile.VectorTileReader struct VectorTileReader_t1753322980; // System.IntPtr[] struct IntPtrU5BU5D_t4013366056; // System.String struct String_t; // System.Collections.IDictionary struct IDictionary_t1363984059; // Mapbox.Examples.ReloadMap struct ReloadMap_t3484436943; // System.Collections.Generic.List`1<Mapbox.Examples.Voxels.VoxelData> struct List_1_t3720956926; // Mapbox.Examples.Voxels.VoxelTile struct VoxelTile_t1944340880; // UnityEngine.Color[] struct ColorU5BU5D_t941916413; // System.Threading.Mutex struct Mutex_t3066672582; // System.Collections.Generic.Dictionary`2<System.String,System.Byte[]> struct Dictionary_2_t3901903956; // System.Func`2<System.UInt32,System.Int32> struct Func_2_t2244831341; // System.Func`3<System.Int32,System.Int32,System.Boolean> struct Func_3_t491204050; // System.Byte[] struct ByteU5BU5D_t4116647657; // System.Collections.Generic.List`1<System.Byte[]> struct List_1_t1293755103; // System.Collections.Generic.List`1<System.Object> struct List_1_t257213610; // System.Collections.Generic.List`1<System.String> struct List_1_t3319525431; // Mapbox.Json.JsonConverter[] struct JsonConverterU5BU5D_t1616679288; // Mapbox.VectorTile.VectorTileFeature struct VectorTileFeature_t4093669591; // System.Func`2<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.LatLng>,System.Collections.Generic.IEnumerable`1<Mapbox.VectorTile.Geometry.LatLng>> struct Func_2_t1001585409; // System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> struct Func_2_t3663939823; // System.Char[] struct CharU5BU5D_t3528271667; // System.Void struct Void_t1185182177; // UnityEngine.GameObject struct GameObject_t1113636619; // System.Collections.Generic.List`1<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint>> struct List_1_t976755323; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint> struct List_1_t3799647877; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/DoublePoint> struct List_1_t3080002113; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode> struct List_1_t2773059210; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima struct Maxima_t4278896992; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode> struct List_1_t556621665; // System.Collections.Generic.IComparer`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode> struct IComparer_1_t338812402; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join> struct List_1_t3821086104; // Mapbox.VectorTile.VectorTileLayer struct VectorTileLayer_t873169949; // System.Collections.Generic.List`1<System.UInt32> struct List_1_t4032136720; // System.Collections.Generic.List`1<System.Int32> struct List_1_t128053199; // UnityEngine.Transform struct Transform_t3600365921; // Mapbox.Unity.Location.ILocationProvider struct ILocationProvider_t2513726273; // UnityEngine.UI.InputField struct InputField_t3762917431; // Mapbox.Geocoding.ReverseGeocodeResource struct ReverseGeocodeResource_t2777886177; // Mapbox.Geocoding.Geocoder struct Geocoder_t3195298050; // Mapbox.Geocoding.ReverseGeocodeResponse struct ReverseGeocodeResponse_t3723437562; // System.EventHandler`1<System.EventArgs> struct EventHandler_1_t1515976428; // UnityEngine.Camera struct Camera_t4157153871; // Mapbox.Unity.Map.AbstractMap struct AbstractMap_t3082917158; // Mapbox.Examples.ForwardGeocodeUserInput struct ForwardGeocodeUserInput_t2575136032; // UnityEngine.UI.Slider struct Slider_t3903728902; // UnityEngine.Coroutine struct Coroutine_t3829159415; // UnityEngine.WaitForSeconds struct WaitForSeconds_t1699091251; // UnityEngine.UI.Text struct Text_t1901882714; // Mapbox.Map.Map`1<Mapbox.Map.VectorTile> struct Map_1_t3054239837; // Mapbox.Examples.ReverseGeocodeUserInput struct ReverseGeocodeUserInput_t2632079094; // UnityEngine.UI.Dropdown struct Dropdown_t2274391225; // UnityEngine.UI.RawImage struct RawImage_t3182918964; // Mapbox.Map.Map`1<Mapbox.Map.RasterTile> struct Map_1_t1665010825; // System.String[] struct StringU5BU5D_t1281789340; // Mapbox.Directions.Directions struct Directions_t1397515081; // Mapbox.Utils.Vector2d[] struct Vector2dU5BU5D_t852968953; // Mapbox.Directions.DirectionResource struct DirectionResource_t3837219169; // UnityEngine.LineRenderer struct LineRenderer_t3154350270; // System.Collections.Generic.List`1<Mapbox.Unity.Location.Location> struct List_1_t3502158253; // Mapbox.MapMatching.MapMatcher struct MapMatcher_t3570695288; // Mapbox.Examples.Voxels.VoxelColorMapper[] struct VoxelColorMapperU5BU5D_t1422690960; // Mapbox.Examples.Voxels.VoxelFetcher struct VoxelFetcher_t3713644963; // Mapbox.Map.Map`1<Mapbox.Map.RawPngRasterTile> struct Map_1_t1070764774; // UnityEngine.Texture2D struct Texture2D_t3840446185; // Mapbox.Platform.IFileSource struct IFileSource_t3859839141; // System.Collections.Generic.List`1<UnityEngine.GameObject> struct List_1_t2585711361; // Mapbox.Unity.MeshGeneration.Factories.FlatSphereTerrainFactory struct FlatSphereTerrainFactory_t1099794750; // UnityEngine.AnimationCurve struct AnimationCurve_t3046754366; // UnityEngine.RectTransform struct RectTransform_t3704657025; // System.Collections.Generic.Dictionary`2<UnityEngine.GameObject,Mapbox.Examples.FeatureSelectionDetector> struct Dictionary_2_t2340548174; // Mapbox.Examples.FeatureUiMarker struct FeatureUiMarker_t3847499068; // Mapbox.Examples.FeatureSelectionDetector struct FeatureSelectionDetector_t508482069; // System.Collections.Generic.Dictionary`2<System.String,System.Object> struct Dictionary_2_t2865362463; // Mapbox.Unity.Map.QuadTreeTileProvider struct QuadTreeTileProvider_t3777865694; // UnityEngine.TextMesh struct TextMesh_t1536577757; // VectorEntity struct VectorEntity_t1410759464; // UnityEngine.Vector3[] struct Vector3U5BU5D_t1718750761; // System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Object>,System.String> struct Func_2_t268983481; // Mapbox.Geocoding.ForwardGeocodeResource struct ForwardGeocodeResource_t367023433; // Mapbox.Geocoding.ForwardGeocodeResponse struct ForwardGeocodeResponse_t2959476828; // System.Action`1<Mapbox.Geocoding.ForwardGeocodeResponse> struct Action_1_t3131944423; // UnityEngine.Material struct Material_t340375123; // System.Collections.Generic.List`1<UnityEngine.Material> struct List_1_t1812449865; // UnityEngine.MeshRenderer struct MeshRenderer_t587009260; #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 COMPRESSION_T3624971113_H #define COMPRESSION_T3624971113_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.Compression struct Compression_t3624971113 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // COMPRESSION_T3624971113_H #ifndef CONSTANTSASDICTIONARY_T107503724_H #define CONSTANTSASDICTIONARY_T107503724_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Contants.ConstantsAsDictionary struct ConstantsAsDictionary_t107503724 : public RuntimeObject { public: public: }; struct ConstantsAsDictionary_t107503724_StaticFields { public: // System.Collections.Generic.Dictionary`2<System.Int32,System.String> Mapbox.VectorTile.Contants.ConstantsAsDictionary::TileType Dictionary_2_t736164020 * ___TileType_0; // System.Collections.Generic.Dictionary`2<System.Int32,System.String> Mapbox.VectorTile.Contants.ConstantsAsDictionary::LayerType Dictionary_2_t736164020 * ___LayerType_1; // System.Collections.Generic.Dictionary`2<System.Int32,System.String> Mapbox.VectorTile.Contants.ConstantsAsDictionary::FeatureType Dictionary_2_t736164020 * ___FeatureType_2; // System.Collections.Generic.Dictionary`2<System.Int32,System.String> Mapbox.VectorTile.Contants.ConstantsAsDictionary::GeomType Dictionary_2_t736164020 * ___GeomType_3; public: inline static int32_t get_offset_of_TileType_0() { return static_cast<int32_t>(offsetof(ConstantsAsDictionary_t107503724_StaticFields, ___TileType_0)); } inline Dictionary_2_t736164020 * get_TileType_0() const { return ___TileType_0; } inline Dictionary_2_t736164020 ** get_address_of_TileType_0() { return &___TileType_0; } inline void set_TileType_0(Dictionary_2_t736164020 * value) { ___TileType_0 = value; Il2CppCodeGenWriteBarrier((&___TileType_0), value); } inline static int32_t get_offset_of_LayerType_1() { return static_cast<int32_t>(offsetof(ConstantsAsDictionary_t107503724_StaticFields, ___LayerType_1)); } inline Dictionary_2_t736164020 * get_LayerType_1() const { return ___LayerType_1; } inline Dictionary_2_t736164020 ** get_address_of_LayerType_1() { return &___LayerType_1; } inline void set_LayerType_1(Dictionary_2_t736164020 * value) { ___LayerType_1 = value; Il2CppCodeGenWriteBarrier((&___LayerType_1), value); } inline static int32_t get_offset_of_FeatureType_2() { return static_cast<int32_t>(offsetof(ConstantsAsDictionary_t107503724_StaticFields, ___FeatureType_2)); } inline Dictionary_2_t736164020 * get_FeatureType_2() const { return ___FeatureType_2; } inline Dictionary_2_t736164020 ** get_address_of_FeatureType_2() { return &___FeatureType_2; } inline void set_FeatureType_2(Dictionary_2_t736164020 * value) { ___FeatureType_2 = value; Il2CppCodeGenWriteBarrier((&___FeatureType_2), value); } inline static int32_t get_offset_of_GeomType_3() { return static_cast<int32_t>(offsetof(ConstantsAsDictionary_t107503724_StaticFields, ___GeomType_3)); } inline Dictionary_2_t736164020 * get_GeomType_3() const { return ___GeomType_3; } inline Dictionary_2_t736164020 ** get_address_of_GeomType_3() { return &___GeomType_3; } inline void set_GeomType_3(Dictionary_2_t736164020 * value) { ___GeomType_3 = value; Il2CppCodeGenWriteBarrier((&___GeomType_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONSTANTSASDICTIONARY_T107503724_H #ifndef UTILGEOM_T2066125609_H #define UTILGEOM_T2066125609_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.UtilGeom struct UtilGeom_t2066125609 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UTILGEOM_T2066125609_H #ifndef DECODEGEOMETRY_T3735437420_H #define DECODEGEOMETRY_T3735437420_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.DecodeGeometry struct DecodeGeometry_t3735437420 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DECODEGEOMETRY_T3735437420_H #ifndef CLIPPERBASE_T2411222589_H #define CLIPPERBASE_T2411222589_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase struct ClipperBase_t2411222589 : public RuntimeObject { public: // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_MinimaList LocalMinima_t86068969 * ___m_MinimaList_6; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_CurrentLM LocalMinima_t86068969 * ___m_CurrentLM_7; // System.Collections.Generic.List`1<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge>> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_edges List_1_t343237081 * ___m_edges_8; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_Scanbeam Scanbeam_t3952834741 * ___m_Scanbeam_9; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_PolyOuts List_1_t1788952413 * ___m_PolyOuts_10; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_ActiveEdges TEdge_t1694054893 * ___m_ActiveEdges_11; // System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_UseFullRange bool ___m_UseFullRange_12; // System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_HasOpenPaths bool ___m_HasOpenPaths_13; // System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::<PreserveCollinear>k__BackingField bool ___U3CPreserveCollinearU3Ek__BackingField_14; public: inline static int32_t get_offset_of_m_MinimaList_6() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_MinimaList_6)); } inline LocalMinima_t86068969 * get_m_MinimaList_6() const { return ___m_MinimaList_6; } inline LocalMinima_t86068969 ** get_address_of_m_MinimaList_6() { return &___m_MinimaList_6; } inline void set_m_MinimaList_6(LocalMinima_t86068969 * value) { ___m_MinimaList_6 = value; Il2CppCodeGenWriteBarrier((&___m_MinimaList_6), value); } inline static int32_t get_offset_of_m_CurrentLM_7() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_CurrentLM_7)); } inline LocalMinima_t86068969 * get_m_CurrentLM_7() const { return ___m_CurrentLM_7; } inline LocalMinima_t86068969 ** get_address_of_m_CurrentLM_7() { return &___m_CurrentLM_7; } inline void set_m_CurrentLM_7(LocalMinima_t86068969 * value) { ___m_CurrentLM_7 = value; Il2CppCodeGenWriteBarrier((&___m_CurrentLM_7), value); } inline static int32_t get_offset_of_m_edges_8() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_edges_8)); } inline List_1_t343237081 * get_m_edges_8() const { return ___m_edges_8; } inline List_1_t343237081 ** get_address_of_m_edges_8() { return &___m_edges_8; } inline void set_m_edges_8(List_1_t343237081 * value) { ___m_edges_8 = value; Il2CppCodeGenWriteBarrier((&___m_edges_8), value); } inline static int32_t get_offset_of_m_Scanbeam_9() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_Scanbeam_9)); } inline Scanbeam_t3952834741 * get_m_Scanbeam_9() const { return ___m_Scanbeam_9; } inline Scanbeam_t3952834741 ** get_address_of_m_Scanbeam_9() { return &___m_Scanbeam_9; } inline void set_m_Scanbeam_9(Scanbeam_t3952834741 * value) { ___m_Scanbeam_9 = value; Il2CppCodeGenWriteBarrier((&___m_Scanbeam_9), value); } inline static int32_t get_offset_of_m_PolyOuts_10() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_PolyOuts_10)); } inline List_1_t1788952413 * get_m_PolyOuts_10() const { return ___m_PolyOuts_10; } inline List_1_t1788952413 ** get_address_of_m_PolyOuts_10() { return &___m_PolyOuts_10; } inline void set_m_PolyOuts_10(List_1_t1788952413 * value) { ___m_PolyOuts_10 = value; Il2CppCodeGenWriteBarrier((&___m_PolyOuts_10), value); } inline static int32_t get_offset_of_m_ActiveEdges_11() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_ActiveEdges_11)); } inline TEdge_t1694054893 * get_m_ActiveEdges_11() const { return ___m_ActiveEdges_11; } inline TEdge_t1694054893 ** get_address_of_m_ActiveEdges_11() { return &___m_ActiveEdges_11; } inline void set_m_ActiveEdges_11(TEdge_t1694054893 * value) { ___m_ActiveEdges_11 = value; Il2CppCodeGenWriteBarrier((&___m_ActiveEdges_11), value); } inline static int32_t get_offset_of_m_UseFullRange_12() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_UseFullRange_12)); } inline bool get_m_UseFullRange_12() const { return ___m_UseFullRange_12; } inline bool* get_address_of_m_UseFullRange_12() { return &___m_UseFullRange_12; } inline void set_m_UseFullRange_12(bool value) { ___m_UseFullRange_12 = value; } inline static int32_t get_offset_of_m_HasOpenPaths_13() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_HasOpenPaths_13)); } inline bool get_m_HasOpenPaths_13() const { return ___m_HasOpenPaths_13; } inline bool* get_address_of_m_HasOpenPaths_13() { return &___m_HasOpenPaths_13; } inline void set_m_HasOpenPaths_13(bool value) { ___m_HasOpenPaths_13 = value; } inline static int32_t get_offset_of_U3CPreserveCollinearU3Ek__BackingField_14() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___U3CPreserveCollinearU3Ek__BackingField_14)); } inline bool get_U3CPreserveCollinearU3Ek__BackingField_14() const { return ___U3CPreserveCollinearU3Ek__BackingField_14; } inline bool* get_address_of_U3CPreserveCollinearU3Ek__BackingField_14() { return &___U3CPreserveCollinearU3Ek__BackingField_14; } inline void set_U3CPreserveCollinearU3Ek__BackingField_14(bool value) { ___U3CPreserveCollinearU3Ek__BackingField_14 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CLIPPERBASE_T2411222589_H #ifndef OUTREC_T316877671_H #define OUTREC_T316877671_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec struct OutRec_t316877671 : public RuntimeObject { public: // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::Idx int32_t ___Idx_0; // System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::IsHole bool ___IsHole_1; // System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::IsOpen bool ___IsOpen_2; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::FirstLeft OutRec_t316877671 * ___FirstLeft_3; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::Pts OutPt_t2591102706 * ___Pts_4; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::BottomPt OutPt_t2591102706 * ___BottomPt_5; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::PolyNode PolyNode_t1300984468 * ___PolyNode_6; public: inline static int32_t get_offset_of_Idx_0() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___Idx_0)); } inline int32_t get_Idx_0() const { return ___Idx_0; } inline int32_t* get_address_of_Idx_0() { return &___Idx_0; } inline void set_Idx_0(int32_t value) { ___Idx_0 = value; } inline static int32_t get_offset_of_IsHole_1() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___IsHole_1)); } inline bool get_IsHole_1() const { return ___IsHole_1; } inline bool* get_address_of_IsHole_1() { return &___IsHole_1; } inline void set_IsHole_1(bool value) { ___IsHole_1 = value; } inline static int32_t get_offset_of_IsOpen_2() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___IsOpen_2)); } inline bool get_IsOpen_2() const { return ___IsOpen_2; } inline bool* get_address_of_IsOpen_2() { return &___IsOpen_2; } inline void set_IsOpen_2(bool value) { ___IsOpen_2 = value; } inline static int32_t get_offset_of_FirstLeft_3() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___FirstLeft_3)); } inline OutRec_t316877671 * get_FirstLeft_3() const { return ___FirstLeft_3; } inline OutRec_t316877671 ** get_address_of_FirstLeft_3() { return &___FirstLeft_3; } inline void set_FirstLeft_3(OutRec_t316877671 * value) { ___FirstLeft_3 = value; Il2CppCodeGenWriteBarrier((&___FirstLeft_3), value); } inline static int32_t get_offset_of_Pts_4() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___Pts_4)); } inline OutPt_t2591102706 * get_Pts_4() const { return ___Pts_4; } inline OutPt_t2591102706 ** get_address_of_Pts_4() { return &___Pts_4; } inline void set_Pts_4(OutPt_t2591102706 * value) { ___Pts_4 = value; Il2CppCodeGenWriteBarrier((&___Pts_4), value); } inline static int32_t get_offset_of_BottomPt_5() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___BottomPt_5)); } inline OutPt_t2591102706 * get_BottomPt_5() const { return ___BottomPt_5; } inline OutPt_t2591102706 ** get_address_of_BottomPt_5() { return &___BottomPt_5; } inline void set_BottomPt_5(OutPt_t2591102706 * value) { ___BottomPt_5 = value; Il2CppCodeGenWriteBarrier((&___BottomPt_5), value); } inline static int32_t get_offset_of_PolyNode_6() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___PolyNode_6)); } inline PolyNode_t1300984468 * get_PolyNode_6() const { return ___PolyNode_6; } inline PolyNode_t1300984468 ** get_address_of_PolyNode_6() { return &___PolyNode_6; } inline void set_PolyNode_6(PolyNode_t1300984468 * value) { ___PolyNode_6 = value; Il2CppCodeGenWriteBarrier((&___PolyNode_6), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // OUTREC_T316877671_H #ifndef MAXIMA_T4278896992_H #define MAXIMA_T4278896992_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima struct Maxima_t4278896992 : public RuntimeObject { public: // System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima::X int64_t ___X_0; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima::Next Maxima_t4278896992 * ___Next_1; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima::Prev Maxima_t4278896992 * ___Prev_2; public: inline static int32_t get_offset_of_X_0() { return static_cast<int32_t>(offsetof(Maxima_t4278896992, ___X_0)); } inline int64_t get_X_0() const { return ___X_0; } inline int64_t* get_address_of_X_0() { return &___X_0; } inline void set_X_0(int64_t value) { ___X_0 = value; } inline static int32_t get_offset_of_Next_1() { return static_cast<int32_t>(offsetof(Maxima_t4278896992, ___Next_1)); } inline Maxima_t4278896992 * get_Next_1() const { return ___Next_1; } inline Maxima_t4278896992 ** get_address_of_Next_1() { return &___Next_1; } inline void set_Next_1(Maxima_t4278896992 * value) { ___Next_1 = value; Il2CppCodeGenWriteBarrier((&___Next_1), value); } inline static int32_t get_offset_of_Prev_2() { return static_cast<int32_t>(offsetof(Maxima_t4278896992, ___Prev_2)); } inline Maxima_t4278896992 * get_Prev_2() const { return ___Prev_2; } inline Maxima_t4278896992 ** get_address_of_Prev_2() { return &___Prev_2; } inline void set_Prev_2(Maxima_t4278896992 * value) { ___Prev_2 = value; Il2CppCodeGenWriteBarrier((&___Prev_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MAXIMA_T4278896992_H #ifndef SCANBEAM_T3952834741_H #define SCANBEAM_T3952834741_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam struct Scanbeam_t3952834741 : public RuntimeObject { public: // System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam::Y int64_t ___Y_0; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam::Next Scanbeam_t3952834741 * ___Next_1; public: inline static int32_t get_offset_of_Y_0() { return static_cast<int32_t>(offsetof(Scanbeam_t3952834741, ___Y_0)); } inline int64_t get_Y_0() const { return ___Y_0; } inline int64_t* get_address_of_Y_0() { return &___Y_0; } inline void set_Y_0(int64_t value) { ___Y_0 = value; } inline static int32_t get_offset_of_Next_1() { return static_cast<int32_t>(offsetof(Scanbeam_t3952834741, ___Next_1)); } inline Scanbeam_t3952834741 * get_Next_1() const { return ___Next_1; } inline Scanbeam_t3952834741 ** get_address_of_Next_1() { return &___Next_1; } inline void set_Next_1(Scanbeam_t3952834741 * value) { ___Next_1 = value; Il2CppCodeGenWriteBarrier((&___Next_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SCANBEAM_T3952834741_H #ifndef LOCALMINIMA_T86068969_H #define LOCALMINIMA_T86068969_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima struct LocalMinima_t86068969 : public RuntimeObject { public: // System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima::Y int64_t ___Y_0; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima::LeftBound TEdge_t1694054893 * ___LeftBound_1; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima::RightBound TEdge_t1694054893 * ___RightBound_2; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima::Next LocalMinima_t86068969 * ___Next_3; public: inline static int32_t get_offset_of_Y_0() { return static_cast<int32_t>(offsetof(LocalMinima_t86068969, ___Y_0)); } inline int64_t get_Y_0() const { return ___Y_0; } inline int64_t* get_address_of_Y_0() { return &___Y_0; } inline void set_Y_0(int64_t value) { ___Y_0 = value; } inline static int32_t get_offset_of_LeftBound_1() { return static_cast<int32_t>(offsetof(LocalMinima_t86068969, ___LeftBound_1)); } inline TEdge_t1694054893 * get_LeftBound_1() const { return ___LeftBound_1; } inline TEdge_t1694054893 ** get_address_of_LeftBound_1() { return &___LeftBound_1; } inline void set_LeftBound_1(TEdge_t1694054893 * value) { ___LeftBound_1 = value; Il2CppCodeGenWriteBarrier((&___LeftBound_1), value); } inline static int32_t get_offset_of_RightBound_2() { return static_cast<int32_t>(offsetof(LocalMinima_t86068969, ___RightBound_2)); } inline TEdge_t1694054893 * get_RightBound_2() const { return ___RightBound_2; } inline TEdge_t1694054893 ** get_address_of_RightBound_2() { return &___RightBound_2; } inline void set_RightBound_2(TEdge_t1694054893 * value) { ___RightBound_2 = value; Il2CppCodeGenWriteBarrier((&___RightBound_2), value); } inline static int32_t get_offset_of_Next_3() { return static_cast<int32_t>(offsetof(LocalMinima_t86068969, ___Next_3)); } inline LocalMinima_t86068969 * get_Next_3() const { return ___Next_3; } inline LocalMinima_t86068969 ** get_address_of_Next_3() { return &___Next_3; } inline void set_Next_3(LocalMinima_t86068969 * value) { ___Next_3 = value; Il2CppCodeGenWriteBarrier((&___Next_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LOCALMINIMA_T86068969_H #ifndef MYINTERSECTNODESORT_T682547759_H #define MYINTERSECTNODESORT_T682547759_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/MyIntersectNodeSort struct MyIntersectNodeSort_t682547759 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MYINTERSECTNODESORT_T682547759_H #ifndef VECTORTILE_T3467883484_H #define VECTORTILE_T3467883484_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.VectorTile struct VectorTile_t3467883484 : public RuntimeObject { public: // Mapbox.VectorTile.VectorTileReader Mapbox.VectorTile.VectorTile::_VTR VectorTileReader_t1753322980 * ____VTR_0; public: inline static int32_t get_offset_of__VTR_0() { return static_cast<int32_t>(offsetof(VectorTile_t3467883484, ____VTR_0)); } inline VectorTileReader_t1753322980 * get__VTR_0() const { return ____VTR_0; } inline VectorTileReader_t1753322980 ** get_address_of__VTR_0() { return &____VTR_0; } inline void set__VTR_0(VectorTileReader_t1753322980 * value) { ____VTR_0 = value; Il2CppCodeGenWriteBarrier((&____VTR_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VECTORTILE_T3467883484_H #ifndef JSONCONVERTER_T472504469_H #define JSONCONVERTER_T472504469_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Json.JsonConverter struct JsonConverter_t472504469 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // JSONCONVERTER_T472504469_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 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 U3CRELOADAFTERDELAYU3EC__ITERATOR0_T22183295_H #define U3CRELOADAFTERDELAYU3EC__ITERATOR0_T22183295_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0 struct U3CReloadAfterDelayU3Ec__Iterator0_t22183295 : public RuntimeObject { public: // System.Int32 Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0::zoom int32_t ___zoom_0; // Mapbox.Examples.ReloadMap Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0::$this ReloadMap_t3484436943 * ___U24this_1; // System.Object Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0::$current RuntimeObject * ___U24current_2; // System.Boolean Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0::$disposing bool ___U24disposing_3; // System.Int32 Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0::$PC int32_t ___U24PC_4; public: inline static int32_t get_offset_of_zoom_0() { return static_cast<int32_t>(offsetof(U3CReloadAfterDelayU3Ec__Iterator0_t22183295, ___zoom_0)); } inline int32_t get_zoom_0() const { return ___zoom_0; } inline int32_t* get_address_of_zoom_0() { return &___zoom_0; } inline void set_zoom_0(int32_t value) { ___zoom_0 = value; } inline static int32_t get_offset_of_U24this_1() { return static_cast<int32_t>(offsetof(U3CReloadAfterDelayU3Ec__Iterator0_t22183295, ___U24this_1)); } inline ReloadMap_t3484436943 * get_U24this_1() const { return ___U24this_1; } inline ReloadMap_t3484436943 ** get_address_of_U24this_1() { return &___U24this_1; } inline void set_U24this_1(ReloadMap_t3484436943 * value) { ___U24this_1 = value; Il2CppCodeGenWriteBarrier((&___U24this_1), value); } inline static int32_t get_offset_of_U24current_2() { return static_cast<int32_t>(offsetof(U3CReloadAfterDelayU3Ec__Iterator0_t22183295, ___U24current_2)); } inline RuntimeObject * get_U24current_2() const { return ___U24current_2; } inline RuntimeObject ** get_address_of_U24current_2() { return &___U24current_2; } inline void set_U24current_2(RuntimeObject * value) { ___U24current_2 = value; Il2CppCodeGenWriteBarrier((&___U24current_2), value); } inline static int32_t get_offset_of_U24disposing_3() { return static_cast<int32_t>(offsetof(U3CReloadAfterDelayU3Ec__Iterator0_t22183295, ___U24disposing_3)); } inline bool get_U24disposing_3() const { return ___U24disposing_3; } inline bool* get_address_of_U24disposing_3() { return &___U24disposing_3; } inline void set_U24disposing_3(bool value) { ___U24disposing_3 = value; } inline static int32_t get_offset_of_U24PC_4() { return static_cast<int32_t>(offsetof(U3CReloadAfterDelayU3Ec__Iterator0_t22183295, ___U24PC_4)); } inline int32_t get_U24PC_4() const { return ___U24PC_4; } inline int32_t* get_address_of_U24PC_4() { return &___U24PC_4; } inline void set_U24PC_4(int32_t value) { ___U24PC_4 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // U3CRELOADAFTERDELAYU3EC__ITERATOR0_T22183295_H #ifndef U3CBUILDROUTINEU3EC__ITERATOR0_T1339467344_H #define U3CBUILDROUTINEU3EC__ITERATOR0_T1339467344_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0 struct U3CBuildRoutineU3Ec__Iterator0_t1339467344 : public RuntimeObject { public: // System.Collections.Generic.List`1<Mapbox.Examples.Voxels.VoxelData> Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::<distanceOrderedVoxels>__0 List_1_t3720956926 * ___U3CdistanceOrderedVoxelsU3E__0_0; // System.Int32 Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::<i>__1 int32_t ___U3CiU3E__1_1; // Mapbox.Examples.Voxels.VoxelTile Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::$this VoxelTile_t1944340880 * ___U24this_2; // System.Object Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::$current RuntimeObject * ___U24current_3; // System.Boolean Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::$disposing bool ___U24disposing_4; // System.Int32 Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::$PC int32_t ___U24PC_5; public: inline static int32_t get_offset_of_U3CdistanceOrderedVoxelsU3E__0_0() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U3CdistanceOrderedVoxelsU3E__0_0)); } inline List_1_t3720956926 * get_U3CdistanceOrderedVoxelsU3E__0_0() const { return ___U3CdistanceOrderedVoxelsU3E__0_0; } inline List_1_t3720956926 ** get_address_of_U3CdistanceOrderedVoxelsU3E__0_0() { return &___U3CdistanceOrderedVoxelsU3E__0_0; } inline void set_U3CdistanceOrderedVoxelsU3E__0_0(List_1_t3720956926 * value) { ___U3CdistanceOrderedVoxelsU3E__0_0 = value; Il2CppCodeGenWriteBarrier((&___U3CdistanceOrderedVoxelsU3E__0_0), value); } inline static int32_t get_offset_of_U3CiU3E__1_1() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U3CiU3E__1_1)); } inline int32_t get_U3CiU3E__1_1() const { return ___U3CiU3E__1_1; } inline int32_t* get_address_of_U3CiU3E__1_1() { return &___U3CiU3E__1_1; } inline void set_U3CiU3E__1_1(int32_t value) { ___U3CiU3E__1_1 = value; } inline static int32_t get_offset_of_U24this_2() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U24this_2)); } inline VoxelTile_t1944340880 * get_U24this_2() const { return ___U24this_2; } inline VoxelTile_t1944340880 ** get_address_of_U24this_2() { return &___U24this_2; } inline void set_U24this_2(VoxelTile_t1944340880 * value) { ___U24this_2 = value; Il2CppCodeGenWriteBarrier((&___U24this_2), value); } inline static int32_t get_offset_of_U24current_3() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U24current_3)); } inline RuntimeObject * get_U24current_3() const { return ___U24current_3; } inline RuntimeObject ** get_address_of_U24current_3() { return &___U24current_3; } inline void set_U24current_3(RuntimeObject * value) { ___U24current_3 = value; Il2CppCodeGenWriteBarrier((&___U24current_3), value); } inline static int32_t get_offset_of_U24disposing_4() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U24disposing_4)); } inline bool get_U24disposing_4() const { return ___U24disposing_4; } inline bool* get_address_of_U24disposing_4() { return &___U24disposing_4; } inline void set_U24disposing_4(bool value) { ___U24disposing_4 = value; } inline static int32_t get_offset_of_U24PC_5() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U24PC_5)); } inline int32_t get_U24PC_5() const { return ___U24PC_5; } inline int32_t* get_address_of_U24PC_5() { return &___U24PC_5; } inline void set_U24PC_5(int32_t value) { ___U24PC_5 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // U3CBUILDROUTINEU3EC__ITERATOR0_T1339467344_H #ifndef THREADDATA_T1095464109_H #define THREADDATA_T1095464109_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Voxels.TextureScale/ThreadData struct ThreadData_t1095464109 : public RuntimeObject { public: // System.Int32 Mapbox.Examples.Voxels.TextureScale/ThreadData::start int32_t ___start_0; // System.Int32 Mapbox.Examples.Voxels.TextureScale/ThreadData::end int32_t ___end_1; public: inline static int32_t get_offset_of_start_0() { return static_cast<int32_t>(offsetof(ThreadData_t1095464109, ___start_0)); } inline int32_t get_start_0() const { return ___start_0; } inline int32_t* get_address_of_start_0() { return &___start_0; } inline void set_start_0(int32_t value) { ___start_0 = value; } inline static int32_t get_offset_of_end_1() { return static_cast<int32_t>(offsetof(ThreadData_t1095464109, ___end_1)); } inline int32_t get_end_1() const { return ___end_1; } inline int32_t* get_address_of_end_1() { return &___end_1; } inline void set_end_1(int32_t value) { ___end_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // THREADDATA_T1095464109_H #ifndef TEXTURESCALE_T57896704_H #define TEXTURESCALE_T57896704_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Voxels.TextureScale struct TextureScale_t57896704 : public RuntimeObject { public: public: }; struct TextureScale_t57896704_StaticFields { public: // UnityEngine.Color[] Mapbox.Examples.Voxels.TextureScale::texColors ColorU5BU5D_t941916413* ___texColors_0; // UnityEngine.Color[] Mapbox.Examples.Voxels.TextureScale::newColors ColorU5BU5D_t941916413* ___newColors_1; // System.Int32 Mapbox.Examples.Voxels.TextureScale::w int32_t ___w_2; // System.Single Mapbox.Examples.Voxels.TextureScale::ratioX float ___ratioX_3; // System.Single Mapbox.Examples.Voxels.TextureScale::ratioY float ___ratioY_4; // System.Int32 Mapbox.Examples.Voxels.TextureScale::w2 int32_t ___w2_5; // System.Int32 Mapbox.Examples.Voxels.TextureScale::finishCount int32_t ___finishCount_6; // System.Threading.Mutex Mapbox.Examples.Voxels.TextureScale::mutex Mutex_t3066672582 * ___mutex_7; public: inline static int32_t get_offset_of_texColors_0() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___texColors_0)); } inline ColorU5BU5D_t941916413* get_texColors_0() const { return ___texColors_0; } inline ColorU5BU5D_t941916413** get_address_of_texColors_0() { return &___texColors_0; } inline void set_texColors_0(ColorU5BU5D_t941916413* value) { ___texColors_0 = value; Il2CppCodeGenWriteBarrier((&___texColors_0), value); } inline static int32_t get_offset_of_newColors_1() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___newColors_1)); } inline ColorU5BU5D_t941916413* get_newColors_1() const { return ___newColors_1; } inline ColorU5BU5D_t941916413** get_address_of_newColors_1() { return &___newColors_1; } inline void set_newColors_1(ColorU5BU5D_t941916413* value) { ___newColors_1 = value; Il2CppCodeGenWriteBarrier((&___newColors_1), value); } inline static int32_t get_offset_of_w_2() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___w_2)); } inline int32_t get_w_2() const { return ___w_2; } inline int32_t* get_address_of_w_2() { return &___w_2; } inline void set_w_2(int32_t value) { ___w_2 = value; } inline static int32_t get_offset_of_ratioX_3() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___ratioX_3)); } inline float get_ratioX_3() const { return ___ratioX_3; } inline float* get_address_of_ratioX_3() { return &___ratioX_3; } inline void set_ratioX_3(float value) { ___ratioX_3 = value; } inline static int32_t get_offset_of_ratioY_4() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___ratioY_4)); } inline float get_ratioY_4() const { return ___ratioY_4; } inline float* get_address_of_ratioY_4() { return &___ratioY_4; } inline void set_ratioY_4(float value) { ___ratioY_4 = value; } inline static int32_t get_offset_of_w2_5() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___w2_5)); } inline int32_t get_w2_5() const { return ___w2_5; } inline int32_t* get_address_of_w2_5() { return &___w2_5; } inline void set_w2_5(int32_t value) { ___w2_5 = value; } inline static int32_t get_offset_of_finishCount_6() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___finishCount_6)); } inline int32_t get_finishCount_6() const { return ___finishCount_6; } inline int32_t* get_address_of_finishCount_6() { return &___finishCount_6; } inline void set_finishCount_6(int32_t value) { ___finishCount_6 = value; } inline static int32_t get_offset_of_mutex_7() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___mutex_7)); } inline Mutex_t3066672582 * get_mutex_7() const { return ___mutex_7; } inline Mutex_t3066672582 ** get_address_of_mutex_7() { return &___mutex_7; } inline void set_mutex_7(Mutex_t3066672582 * value) { ___mutex_7 = value; Il2CppCodeGenWriteBarrier((&___mutex_7), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // TEXTURESCALE_T57896704_H #ifndef VECTORTILEREADER_T1753322980_H #define VECTORTILEREADER_T1753322980_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.VectorTileReader struct VectorTileReader_t1753322980 : public RuntimeObject { public: // System.Collections.Generic.Dictionary`2<System.String,System.Byte[]> Mapbox.VectorTile.VectorTileReader::_Layers Dictionary_2_t3901903956 * ____Layers_0; // System.Boolean Mapbox.VectorTile.VectorTileReader::_Validate bool ____Validate_1; public: inline static int32_t get_offset_of__Layers_0() { return static_cast<int32_t>(offsetof(VectorTileReader_t1753322980, ____Layers_0)); } inline Dictionary_2_t3901903956 * get__Layers_0() const { return ____Layers_0; } inline Dictionary_2_t3901903956 ** get_address_of__Layers_0() { return &____Layers_0; } inline void set__Layers_0(Dictionary_2_t3901903956 * value) { ____Layers_0 = value; Il2CppCodeGenWriteBarrier((&____Layers_0), value); } inline static int32_t get_offset_of__Validate_1() { return static_cast<int32_t>(offsetof(VectorTileReader_t1753322980, ____Validate_1)); } inline bool get__Validate_1() const { return ____Validate_1; } inline bool* get_address_of__Validate_1() { return &____Validate_1; } inline void set__Validate_1(bool value) { ____Validate_1 = value; } }; struct VectorTileReader_t1753322980_StaticFields { public: // System.Func`2<System.UInt32,System.Int32> Mapbox.VectorTile.VectorTileReader::<>f__am$cache0 Func_2_t2244831341 * ___U3CU3Ef__amU24cache0_2; // System.Func`3<System.Int32,System.Int32,System.Boolean> Mapbox.VectorTile.VectorTileReader::<>f__am$cache1 Func_3_t491204050 * ___U3CU3Ef__amU24cache1_3; // System.Func`3<System.Int32,System.Int32,System.Boolean> Mapbox.VectorTile.VectorTileReader::<>f__am$cache2 Func_3_t491204050 * ___U3CU3Ef__amU24cache2_4; public: inline static int32_t get_offset_of_U3CU3Ef__amU24cache0_2() { return static_cast<int32_t>(offsetof(VectorTileReader_t1753322980_StaticFields, ___U3CU3Ef__amU24cache0_2)); } inline Func_2_t2244831341 * get_U3CU3Ef__amU24cache0_2() const { return ___U3CU3Ef__amU24cache0_2; } inline Func_2_t2244831341 ** get_address_of_U3CU3Ef__amU24cache0_2() { return &___U3CU3Ef__amU24cache0_2; } inline void set_U3CU3Ef__amU24cache0_2(Func_2_t2244831341 * value) { ___U3CU3Ef__amU24cache0_2 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache0_2), value); } inline static int32_t get_offset_of_U3CU3Ef__amU24cache1_3() { return static_cast<int32_t>(offsetof(VectorTileReader_t1753322980_StaticFields, ___U3CU3Ef__amU24cache1_3)); } inline Func_3_t491204050 * get_U3CU3Ef__amU24cache1_3() const { return ___U3CU3Ef__amU24cache1_3; } inline Func_3_t491204050 ** get_address_of_U3CU3Ef__amU24cache1_3() { return &___U3CU3Ef__amU24cache1_3; } inline void set_U3CU3Ef__amU24cache1_3(Func_3_t491204050 * value) { ___U3CU3Ef__amU24cache1_3 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache1_3), value); } inline static int32_t get_offset_of_U3CU3Ef__amU24cache2_4() { return static_cast<int32_t>(offsetof(VectorTileReader_t1753322980_StaticFields, ___U3CU3Ef__amU24cache2_4)); } inline Func_3_t491204050 * get_U3CU3Ef__amU24cache2_4() const { return ___U3CU3Ef__amU24cache2_4; } inline Func_3_t491204050 ** get_address_of_U3CU3Ef__amU24cache2_4() { return &___U3CU3Ef__amU24cache2_4; } inline void set_U3CU3Ef__amU24cache2_4(Func_3_t491204050 * value) { ___U3CU3Ef__amU24cache2_4 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache2_4), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VECTORTILEREADER_T1753322980_H #ifndef VECTORTILELAYER_T873169949_H #define VECTORTILELAYER_T873169949_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.VectorTileLayer struct VectorTileLayer_t873169949 : public RuntimeObject { public: // System.Byte[] Mapbox.VectorTile.VectorTileLayer::<Data>k__BackingField ByteU5BU5D_t4116647657* ___U3CDataU3Ek__BackingField_0; // System.String Mapbox.VectorTile.VectorTileLayer::<Name>k__BackingField String_t* ___U3CNameU3Ek__BackingField_1; // System.UInt64 Mapbox.VectorTile.VectorTileLayer::<Version>k__BackingField uint64_t ___U3CVersionU3Ek__BackingField_2; // System.UInt64 Mapbox.VectorTile.VectorTileLayer::<Extent>k__BackingField uint64_t ___U3CExtentU3Ek__BackingField_3; // System.Collections.Generic.List`1<System.Byte[]> Mapbox.VectorTile.VectorTileLayer::<_FeaturesData>k__BackingField List_1_t1293755103 * ___U3C_FeaturesDataU3Ek__BackingField_4; // System.Collections.Generic.List`1<System.Object> Mapbox.VectorTile.VectorTileLayer::<Values>k__BackingField List_1_t257213610 * ___U3CValuesU3Ek__BackingField_5; // System.Collections.Generic.List`1<System.String> Mapbox.VectorTile.VectorTileLayer::<Keys>k__BackingField List_1_t3319525431 * ___U3CKeysU3Ek__BackingField_6; public: inline static int32_t get_offset_of_U3CDataU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CDataU3Ek__BackingField_0)); } inline ByteU5BU5D_t4116647657* get_U3CDataU3Ek__BackingField_0() const { return ___U3CDataU3Ek__BackingField_0; } inline ByteU5BU5D_t4116647657** get_address_of_U3CDataU3Ek__BackingField_0() { return &___U3CDataU3Ek__BackingField_0; } inline void set_U3CDataU3Ek__BackingField_0(ByteU5BU5D_t4116647657* value) { ___U3CDataU3Ek__BackingField_0 = value; Il2CppCodeGenWriteBarrier((&___U3CDataU3Ek__BackingField_0), value); } inline static int32_t get_offset_of_U3CNameU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CNameU3Ek__BackingField_1)); } inline String_t* get_U3CNameU3Ek__BackingField_1() const { return ___U3CNameU3Ek__BackingField_1; } inline String_t** get_address_of_U3CNameU3Ek__BackingField_1() { return &___U3CNameU3Ek__BackingField_1; } inline void set_U3CNameU3Ek__BackingField_1(String_t* value) { ___U3CNameU3Ek__BackingField_1 = value; Il2CppCodeGenWriteBarrier((&___U3CNameU3Ek__BackingField_1), value); } inline static int32_t get_offset_of_U3CVersionU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CVersionU3Ek__BackingField_2)); } inline uint64_t get_U3CVersionU3Ek__BackingField_2() const { return ___U3CVersionU3Ek__BackingField_2; } inline uint64_t* get_address_of_U3CVersionU3Ek__BackingField_2() { return &___U3CVersionU3Ek__BackingField_2; } inline void set_U3CVersionU3Ek__BackingField_2(uint64_t value) { ___U3CVersionU3Ek__BackingField_2 = value; } inline static int32_t get_offset_of_U3CExtentU3Ek__BackingField_3() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CExtentU3Ek__BackingField_3)); } inline uint64_t get_U3CExtentU3Ek__BackingField_3() const { return ___U3CExtentU3Ek__BackingField_3; } inline uint64_t* get_address_of_U3CExtentU3Ek__BackingField_3() { return &___U3CExtentU3Ek__BackingField_3; } inline void set_U3CExtentU3Ek__BackingField_3(uint64_t value) { ___U3CExtentU3Ek__BackingField_3 = value; } inline static int32_t get_offset_of_U3C_FeaturesDataU3Ek__BackingField_4() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3C_FeaturesDataU3Ek__BackingField_4)); } inline List_1_t1293755103 * get_U3C_FeaturesDataU3Ek__BackingField_4() const { return ___U3C_FeaturesDataU3Ek__BackingField_4; } inline List_1_t1293755103 ** get_address_of_U3C_FeaturesDataU3Ek__BackingField_4() { return &___U3C_FeaturesDataU3Ek__BackingField_4; } inline void set_U3C_FeaturesDataU3Ek__BackingField_4(List_1_t1293755103 * value) { ___U3C_FeaturesDataU3Ek__BackingField_4 = value; Il2CppCodeGenWriteBarrier((&___U3C_FeaturesDataU3Ek__BackingField_4), value); } inline static int32_t get_offset_of_U3CValuesU3Ek__BackingField_5() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CValuesU3Ek__BackingField_5)); } inline List_1_t257213610 * get_U3CValuesU3Ek__BackingField_5() const { return ___U3CValuesU3Ek__BackingField_5; } inline List_1_t257213610 ** get_address_of_U3CValuesU3Ek__BackingField_5() { return &___U3CValuesU3Ek__BackingField_5; } inline void set_U3CValuesU3Ek__BackingField_5(List_1_t257213610 * value) { ___U3CValuesU3Ek__BackingField_5 = value; Il2CppCodeGenWriteBarrier((&___U3CValuesU3Ek__BackingField_5), value); } inline static int32_t get_offset_of_U3CKeysU3Ek__BackingField_6() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CKeysU3Ek__BackingField_6)); } inline List_1_t3319525431 * get_U3CKeysU3Ek__BackingField_6() const { return ___U3CKeysU3Ek__BackingField_6; } inline List_1_t3319525431 ** get_address_of_U3CKeysU3Ek__BackingField_6() { return &___U3CKeysU3Ek__BackingField_6; } inline void set_U3CKeysU3Ek__BackingField_6(List_1_t3319525431 * value) { ___U3CKeysU3Ek__BackingField_6 = value; Il2CppCodeGenWriteBarrier((&___U3CKeysU3Ek__BackingField_6), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VECTORTILELAYER_T873169949_H #ifndef JSONCONVERTERS_T1015645604_H #define JSONCONVERTERS_T1015645604_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.JsonConverters.JsonConverters struct JsonConverters_t1015645604 : public RuntimeObject { public: public: }; struct JsonConverters_t1015645604_StaticFields { public: // Mapbox.Json.JsonConverter[] Mapbox.Utils.JsonConverters.JsonConverters::converters JsonConverterU5BU5D_t1616679288* ___converters_0; public: inline static int32_t get_offset_of_converters_0() { return static_cast<int32_t>(offsetof(JsonConverters_t1015645604_StaticFields, ___converters_0)); } inline JsonConverterU5BU5D_t1616679288* get_converters_0() const { return ___converters_0; } inline JsonConverterU5BU5D_t1616679288** get_address_of_converters_0() { return &___converters_0; } inline void set_converters_0(JsonConverterU5BU5D_t1616679288* value) { ___converters_0 = value; Il2CppCodeGenWriteBarrier((&___converters_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // JSONCONVERTERS_T1015645604_H #ifndef VECTORTILEFEATUREEXTENSIONS_T4023769631_H #define VECTORTILEFEATUREEXTENSIONS_T4023769631_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions struct VectorTileFeatureExtensions_t4023769631 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VECTORTILEFEATUREEXTENSIONS_T4023769631_H #ifndef POLYLINEUTILS_T2997409923_H #define POLYLINEUTILS_T2997409923_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.PolylineUtils struct PolylineUtils_t2997409923 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // POLYLINEUTILS_T2997409923_H #ifndef UNIXTIMESTAMPUTILS_T2933311910_H #define UNIXTIMESTAMPUTILS_T2933311910_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.UnixTimestampUtils struct UnixTimestampUtils_t2933311910 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UNIXTIMESTAMPUTILS_T2933311910_H #ifndef INTERNALCLIPPER_T4127247543_H #define INTERNALCLIPPER_T4127247543_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper struct InternalClipper_t4127247543 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INTERNALCLIPPER_T4127247543_H #ifndef U3CGEOMETRYASWGS84U3EC__ANONSTOREY0_T3901700684_H #define U3CGEOMETRYASWGS84U3EC__ANONSTOREY0_T3901700684_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions/<GeometryAsWgs84>c__AnonStorey0 struct U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684 : public RuntimeObject { public: // System.UInt64 Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions/<GeometryAsWgs84>c__AnonStorey0::zoom uint64_t ___zoom_0; // System.UInt64 Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions/<GeometryAsWgs84>c__AnonStorey0::tileColumn uint64_t ___tileColumn_1; // System.UInt64 Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions/<GeometryAsWgs84>c__AnonStorey0::tileRow uint64_t ___tileRow_2; // Mapbox.VectorTile.VectorTileFeature Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions/<GeometryAsWgs84>c__AnonStorey0::feature VectorTileFeature_t4093669591 * ___feature_3; public: inline static int32_t get_offset_of_zoom_0() { return static_cast<int32_t>(offsetof(U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684, ___zoom_0)); } inline uint64_t get_zoom_0() const { return ___zoom_0; } inline uint64_t* get_address_of_zoom_0() { return &___zoom_0; } inline void set_zoom_0(uint64_t value) { ___zoom_0 = value; } inline static int32_t get_offset_of_tileColumn_1() { return static_cast<int32_t>(offsetof(U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684, ___tileColumn_1)); } inline uint64_t get_tileColumn_1() const { return ___tileColumn_1; } inline uint64_t* get_address_of_tileColumn_1() { return &___tileColumn_1; } inline void set_tileColumn_1(uint64_t value) { ___tileColumn_1 = value; } inline static int32_t get_offset_of_tileRow_2() { return static_cast<int32_t>(offsetof(U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684, ___tileRow_2)); } inline uint64_t get_tileRow_2() const { return ___tileRow_2; } inline uint64_t* get_address_of_tileRow_2() { return &___tileRow_2; } inline void set_tileRow_2(uint64_t value) { ___tileRow_2 = value; } inline static int32_t get_offset_of_feature_3() { return static_cast<int32_t>(offsetof(U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684, ___feature_3)); } inline VectorTileFeature_t4093669591 * get_feature_3() const { return ___feature_3; } inline VectorTileFeature_t4093669591 ** get_address_of_feature_3() { return &___feature_3; } inline void set_feature_3(VectorTileFeature_t4093669591 * value) { ___feature_3 = value; Il2CppCodeGenWriteBarrier((&___feature_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // U3CGEOMETRYASWGS84U3EC__ANONSTOREY0_T3901700684_H #ifndef ENUMEXTENSIONS_T2644584491_H #define ENUMEXTENSIONS_T2644584491_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.ExtensionMethods.EnumExtensions struct EnumExtensions_t2644584491 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ENUMEXTENSIONS_T2644584491_H #ifndef VECTORTILEEXTENSIONS_T4243590528_H #define VECTORTILEEXTENSIONS_T4243590528_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions struct VectorTileExtensions_t4243590528 : public RuntimeObject { public: public: }; struct VectorTileExtensions_t4243590528_StaticFields { public: // System.Func`2<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.LatLng>,System.Collections.Generic.IEnumerable`1<Mapbox.VectorTile.Geometry.LatLng>> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache0 Func_2_t1001585409 * ___U3CU3Ef__amU24cache0_0; // System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache1 Func_2_t3663939823 * ___U3CU3Ef__amU24cache1_1; // System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache2 Func_2_t3663939823 * ___U3CU3Ef__amU24cache2_2; // System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache3 Func_2_t3663939823 * ___U3CU3Ef__amU24cache3_3; // System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache4 Func_2_t3663939823 * ___U3CU3Ef__amU24cache4_4; // System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache5 Func_2_t3663939823 * ___U3CU3Ef__amU24cache5_5; public: inline static int32_t get_offset_of_U3CU3Ef__amU24cache0_0() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache0_0)); } inline Func_2_t1001585409 * get_U3CU3Ef__amU24cache0_0() const { return ___U3CU3Ef__amU24cache0_0; } inline Func_2_t1001585409 ** get_address_of_U3CU3Ef__amU24cache0_0() { return &___U3CU3Ef__amU24cache0_0; } inline void set_U3CU3Ef__amU24cache0_0(Func_2_t1001585409 * value) { ___U3CU3Ef__amU24cache0_0 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache0_0), value); } inline static int32_t get_offset_of_U3CU3Ef__amU24cache1_1() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache1_1)); } inline Func_2_t3663939823 * get_U3CU3Ef__amU24cache1_1() const { return ___U3CU3Ef__amU24cache1_1; } inline Func_2_t3663939823 ** get_address_of_U3CU3Ef__amU24cache1_1() { return &___U3CU3Ef__amU24cache1_1; } inline void set_U3CU3Ef__amU24cache1_1(Func_2_t3663939823 * value) { ___U3CU3Ef__amU24cache1_1 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache1_1), value); } inline static int32_t get_offset_of_U3CU3Ef__amU24cache2_2() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache2_2)); } inline Func_2_t3663939823 * get_U3CU3Ef__amU24cache2_2() const { return ___U3CU3Ef__amU24cache2_2; } inline Func_2_t3663939823 ** get_address_of_U3CU3Ef__amU24cache2_2() { return &___U3CU3Ef__amU24cache2_2; } inline void set_U3CU3Ef__amU24cache2_2(Func_2_t3663939823 * value) { ___U3CU3Ef__amU24cache2_2 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache2_2), value); } inline static int32_t get_offset_of_U3CU3Ef__amU24cache3_3() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache3_3)); } inline Func_2_t3663939823 * get_U3CU3Ef__amU24cache3_3() const { return ___U3CU3Ef__amU24cache3_3; } inline Func_2_t3663939823 ** get_address_of_U3CU3Ef__amU24cache3_3() { return &___U3CU3Ef__amU24cache3_3; } inline void set_U3CU3Ef__amU24cache3_3(Func_2_t3663939823 * value) { ___U3CU3Ef__amU24cache3_3 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache3_3), value); } inline static int32_t get_offset_of_U3CU3Ef__amU24cache4_4() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache4_4)); } inline Func_2_t3663939823 * get_U3CU3Ef__amU24cache4_4() const { return ___U3CU3Ef__amU24cache4_4; } inline Func_2_t3663939823 ** get_address_of_U3CU3Ef__amU24cache4_4() { return &___U3CU3Ef__amU24cache4_4; } inline void set_U3CU3Ef__amU24cache4_4(Func_2_t3663939823 * value) { ___U3CU3Ef__amU24cache4_4 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache4_4), value); } inline static int32_t get_offset_of_U3CU3Ef__amU24cache5_5() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache5_5)); } inline Func_2_t3663939823 * get_U3CU3Ef__amU24cache5_5() const { return ___U3CU3Ef__amU24cache5_5; } inline Func_2_t3663939823 ** get_address_of_U3CU3Ef__amU24cache5_5() { return &___U3CU3Ef__amU24cache5_5; } inline void set_U3CU3Ef__amU24cache5_5(Func_2_t3663939823 * value) { ___U3CU3Ef__amU24cache5_5 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache5_5), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VECTORTILEEXTENSIONS_T4243590528_H #ifndef CONSTANTS_T3518929206_H #define CONSTANTS_T3518929206_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.Constants struct Constants_t3518929206 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONSTANTS_T3518929206_H #ifndef CUSTOMCREATIONCONVERTER_1_T1604133405_H #define CUSTOMCREATIONCONVERTER_1_T1604133405_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Json.Converters.CustomCreationConverter`1<System.Collections.Generic.List`1<Mapbox.Utils.Vector2d>> struct CustomCreationConverter_1_t1604133405 : public JsonConverter_t472504469 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CUSTOMCREATIONCONVERTER_1_T1604133405_H #ifndef MATHD_T279629051_H #define MATHD_T279629051_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.Mathd struct Mathd_t279629051 { public: union { struct { }; uint8_t Mathd_t279629051__padding[1]; }; public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MATHD_T279629051_H #ifndef VECTOR2D_T1865246568_H #define VECTOR2D_T1865246568_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.Vector2d struct Vector2d_t1865246568 { public: // System.Double Mapbox.Utils.Vector2d::x double ___x_1; // System.Double Mapbox.Utils.Vector2d::y double ___y_2; public: inline static int32_t get_offset_of_x_1() { return static_cast<int32_t>(offsetof(Vector2d_t1865246568, ___x_1)); } inline double get_x_1() const { return ___x_1; } inline double* get_address_of_x_1() { return &___x_1; } inline void set_x_1(double value) { ___x_1 = value; } inline static int32_t get_offset_of_y_2() { return static_cast<int32_t>(offsetof(Vector2d_t1865246568, ___y_2)); } inline double get_y_2() const { return ___y_2; } inline double* get_address_of_y_2() { return &___y_2; } inline void set_y_2(double value) { ___y_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VECTOR2D_T1865246568_H #ifndef VECTOR3_T3722313464_H #define VECTOR3_T3722313464_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Vector3 struct Vector3_t3722313464 { public: // System.Single UnityEngine.Vector3::x float ___x_1; // System.Single UnityEngine.Vector3::y float ___y_2; // System.Single UnityEngine.Vector3::z float ___z_3; public: inline static int32_t get_offset_of_x_1() { return static_cast<int32_t>(offsetof(Vector3_t3722313464, ___x_1)); } inline float get_x_1() const { return ___x_1; } inline float* get_address_of_x_1() { return &___x_1; } inline void set_x_1(float value) { ___x_1 = value; } inline static int32_t get_offset_of_y_2() { return static_cast<int32_t>(offsetof(Vector3_t3722313464, ___y_2)); } inline float get_y_2() const { return ___y_2; } inline float* get_address_of_y_2() { return &___y_2; } inline void set_y_2(float value) { ___y_2 = value; } inline static int32_t get_offset_of_z_3() { return static_cast<int32_t>(offsetof(Vector3_t3722313464, ___z_3)); } inline float get_z_3() const { return ___z_3; } inline float* get_address_of_z_3() { return &___z_3; } inline void set_z_3(float value) { ___z_3 = value; } }; struct Vector3_t3722313464_StaticFields { public: // UnityEngine.Vector3 UnityEngine.Vector3::zeroVector Vector3_t3722313464 ___zeroVector_4; // UnityEngine.Vector3 UnityEngine.Vector3::oneVector Vector3_t3722313464 ___oneVector_5; // UnityEngine.Vector3 UnityEngine.Vector3::upVector Vector3_t3722313464 ___upVector_6; // UnityEngine.Vector3 UnityEngine.Vector3::downVector Vector3_t3722313464 ___downVector_7; // UnityEngine.Vector3 UnityEngine.Vector3::leftVector Vector3_t3722313464 ___leftVector_8; // UnityEngine.Vector3 UnityEngine.Vector3::rightVector Vector3_t3722313464 ___rightVector_9; // UnityEngine.Vector3 UnityEngine.Vector3::forwardVector Vector3_t3722313464 ___forwardVector_10; // UnityEngine.Vector3 UnityEngine.Vector3::backVector Vector3_t3722313464 ___backVector_11; // UnityEngine.Vector3 UnityEngine.Vector3::positiveInfinityVector Vector3_t3722313464 ___positiveInfinityVector_12; // UnityEngine.Vector3 UnityEngine.Vector3::negativeInfinityVector Vector3_t3722313464 ___negativeInfinityVector_13; public: inline static int32_t get_offset_of_zeroVector_4() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___zeroVector_4)); } inline Vector3_t3722313464 get_zeroVector_4() const { return ___zeroVector_4; } inline Vector3_t3722313464 * get_address_of_zeroVector_4() { return &___zeroVector_4; } inline void set_zeroVector_4(Vector3_t3722313464 value) { ___zeroVector_4 = value; } inline static int32_t get_offset_of_oneVector_5() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___oneVector_5)); } inline Vector3_t3722313464 get_oneVector_5() const { return ___oneVector_5; } inline Vector3_t3722313464 * get_address_of_oneVector_5() { return &___oneVector_5; } inline void set_oneVector_5(Vector3_t3722313464 value) { ___oneVector_5 = value; } inline static int32_t get_offset_of_upVector_6() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___upVector_6)); } inline Vector3_t3722313464 get_upVector_6() const { return ___upVector_6; } inline Vector3_t3722313464 * get_address_of_upVector_6() { return &___upVector_6; } inline void set_upVector_6(Vector3_t3722313464 value) { ___upVector_6 = value; } inline static int32_t get_offset_of_downVector_7() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___downVector_7)); } inline Vector3_t3722313464 get_downVector_7() const { return ___downVector_7; } inline Vector3_t3722313464 * get_address_of_downVector_7() { return &___downVector_7; } inline void set_downVector_7(Vector3_t3722313464 value) { ___downVector_7 = value; } inline static int32_t get_offset_of_leftVector_8() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___leftVector_8)); } inline Vector3_t3722313464 get_leftVector_8() const { return ___leftVector_8; } inline Vector3_t3722313464 * get_address_of_leftVector_8() { return &___leftVector_8; } inline void set_leftVector_8(Vector3_t3722313464 value) { ___leftVector_8 = value; } inline static int32_t get_offset_of_rightVector_9() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___rightVector_9)); } inline Vector3_t3722313464 get_rightVector_9() const { return ___rightVector_9; } inline Vector3_t3722313464 * get_address_of_rightVector_9() { return &___rightVector_9; } inline void set_rightVector_9(Vector3_t3722313464 value) { ___rightVector_9 = value; } inline static int32_t get_offset_of_forwardVector_10() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___forwardVector_10)); } inline Vector3_t3722313464 get_forwardVector_10() const { return ___forwardVector_10; } inline Vector3_t3722313464 * get_address_of_forwardVector_10() { return &___forwardVector_10; } inline void set_forwardVector_10(Vector3_t3722313464 value) { ___forwardVector_10 = value; } inline static int32_t get_offset_of_backVector_11() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___backVector_11)); } inline Vector3_t3722313464 get_backVector_11() const { return ___backVector_11; } inline Vector3_t3722313464 * get_address_of_backVector_11() { return &___backVector_11; } inline void set_backVector_11(Vector3_t3722313464 value) { ___backVector_11 = value; } inline static int32_t get_offset_of_positiveInfinityVector_12() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___positiveInfinityVector_12)); } inline Vector3_t3722313464 get_positiveInfinityVector_12() const { return ___positiveInfinityVector_12; } inline Vector3_t3722313464 * get_address_of_positiveInfinityVector_12() { return &___positiveInfinityVector_12; } inline void set_positiveInfinityVector_12(Vector3_t3722313464 value) { ___positiveInfinityVector_12 = value; } inline static int32_t get_offset_of_negativeInfinityVector_13() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___negativeInfinityVector_13)); } inline Vector3_t3722313464 get_negativeInfinityVector_13() const { return ___negativeInfinityVector_13; } inline Vector3_t3722313464 * get_address_of_negativeInfinityVector_13() { return &___negativeInfinityVector_13; } inline void set_negativeInfinityVector_13(Vector3_t3722313464 value) { ___negativeInfinityVector_13 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VECTOR3_T3722313464_H #ifndef QUATERNION_T2301928331_H #define QUATERNION_T2301928331_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Quaternion struct Quaternion_t2301928331 { public: // System.Single UnityEngine.Quaternion::x float ___x_0; // System.Single UnityEngine.Quaternion::y float ___y_1; // System.Single UnityEngine.Quaternion::z float ___z_2; // System.Single UnityEngine.Quaternion::w float ___w_3; public: inline static int32_t get_offset_of_x_0() { return static_cast<int32_t>(offsetof(Quaternion_t2301928331, ___x_0)); } inline float get_x_0() const { return ___x_0; } inline float* get_address_of_x_0() { return &___x_0; } inline void set_x_0(float value) { ___x_0 = value; } inline static int32_t get_offset_of_y_1() { return static_cast<int32_t>(offsetof(Quaternion_t2301928331, ___y_1)); } inline float get_y_1() const { return ___y_1; } inline float* get_address_of_y_1() { return &___y_1; } inline void set_y_1(float value) { ___y_1 = value; } inline static int32_t get_offset_of_z_2() { return static_cast<int32_t>(offsetof(Quaternion_t2301928331, ___z_2)); } inline float get_z_2() const { return ___z_2; } inline float* get_address_of_z_2() { return &___z_2; } inline void set_z_2(float value) { ___z_2 = value; } inline static int32_t get_offset_of_w_3() { return static_cast<int32_t>(offsetof(Quaternion_t2301928331, ___w_3)); } inline float get_w_3() const { return ___w_3; } inline float* get_address_of_w_3() { return &___w_3; } inline void set_w_3(float value) { ___w_3 = value; } }; struct Quaternion_t2301928331_StaticFields { public: // UnityEngine.Quaternion UnityEngine.Quaternion::identityQuaternion Quaternion_t2301928331 ___identityQuaternion_4; public: inline static int32_t get_offset_of_identityQuaternion_4() { return static_cast<int32_t>(offsetof(Quaternion_t2301928331_StaticFields, ___identityQuaternion_4)); } inline Quaternion_t2301928331 get_identityQuaternion_4() const { return ___identityQuaternion_4; } inline Quaternion_t2301928331 * get_address_of_identityQuaternion_4() { return &___identityQuaternion_4; } inline void set_identityQuaternion_4(Quaternion_t2301928331 value) { ___identityQuaternion_4 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // QUATERNION_T2301928331_H #ifndef LATLNG_T1304626312_H #define LATLNG_T1304626312_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.LatLng struct LatLng_t1304626312 { public: union { struct { // System.Double Mapbox.VectorTile.Geometry.LatLng::<Lat>k__BackingField double ___U3CLatU3Ek__BackingField_0; // System.Double Mapbox.VectorTile.Geometry.LatLng::<Lng>k__BackingField double ___U3CLngU3Ek__BackingField_1; }; uint8_t LatLng_t1304626312__padding[1]; }; public: inline static int32_t get_offset_of_U3CLatU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(LatLng_t1304626312, ___U3CLatU3Ek__BackingField_0)); } inline double get_U3CLatU3Ek__BackingField_0() const { return ___U3CLatU3Ek__BackingField_0; } inline double* get_address_of_U3CLatU3Ek__BackingField_0() { return &___U3CLatU3Ek__BackingField_0; } inline void set_U3CLatU3Ek__BackingField_0(double value) { ___U3CLatU3Ek__BackingField_0 = value; } inline static int32_t get_offset_of_U3CLngU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(LatLng_t1304626312, ___U3CLngU3Ek__BackingField_1)); } inline double get_U3CLngU3Ek__BackingField_1() const { return ___U3CLngU3Ek__BackingField_1; } inline double* get_address_of_U3CLngU3Ek__BackingField_1() { return &___U3CLngU3Ek__BackingField_1; } inline void set_U3CLngU3Ek__BackingField_1(double value) { ___U3CLngU3Ek__BackingField_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LATLNG_T1304626312_H #ifndef COLOR_T2555686324_H #define COLOR_T2555686324_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Color struct Color_t2555686324 { public: // System.Single UnityEngine.Color::r float ___r_0; // System.Single UnityEngine.Color::g float ___g_1; // System.Single UnityEngine.Color::b float ___b_2; // System.Single UnityEngine.Color::a float ___a_3; public: inline static int32_t get_offset_of_r_0() { return static_cast<int32_t>(offsetof(Color_t2555686324, ___r_0)); } inline float get_r_0() const { return ___r_0; } inline float* get_address_of_r_0() { return &___r_0; } inline void set_r_0(float value) { ___r_0 = value; } inline static int32_t get_offset_of_g_1() { return static_cast<int32_t>(offsetof(Color_t2555686324, ___g_1)); } inline float get_g_1() const { return ___g_1; } inline float* get_address_of_g_1() { return &___g_1; } inline void set_g_1(float value) { ___g_1 = value; } inline static int32_t get_offset_of_b_2() { return static_cast<int32_t>(offsetof(Color_t2555686324, ___b_2)); } inline float get_b_2() const { return ___b_2; } inline float* get_address_of_b_2() { return &___b_2; } inline void set_b_2(float value) { ___b_2 = value; } inline static int32_t get_offset_of_a_3() { return static_cast<int32_t>(offsetof(Color_t2555686324, ___a_3)); } inline float get_a_3() const { return ___a_3; } inline float* get_address_of_a_3() { return &___a_3; } inline void set_a_3(float value) { ___a_3 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // COLOR_T2555686324_H #ifndef CUSTOMCREATIONCONVERTER_1_T132058663_H #define CUSTOMCREATIONCONVERTER_1_T132058663_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Json.Converters.CustomCreationConverter`1<Mapbox.Utils.Vector2d> struct CustomCreationConverter_1_t132058663 : public JsonConverter_t472504469 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CUSTOMCREATIONCONVERTER_1_T132058663_H #ifndef CUSTOMCREATIONCONVERTER_1_T241653040_H #define CUSTOMCREATIONCONVERTER_1_T241653040_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Json.Converters.CustomCreationConverter`1<Mapbox.Utils.Vector2dBounds> struct CustomCreationConverter_1_t241653040 : public JsonConverter_t472504469 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CUSTOMCREATIONCONVERTER_1_T241653040_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 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 NULLABLE_1_T4282624060_H #define NULLABLE_1_T4282624060_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Nullable`1<System.UInt32> struct Nullable_1_t4282624060 { public: // T System.Nullable`1::value uint32_t ___value_0; // System.Boolean System.Nullable`1::has_value bool ___has_value_1; public: inline static int32_t get_offset_of_value_0() { return static_cast<int32_t>(offsetof(Nullable_1_t4282624060, ___value_0)); } inline uint32_t get_value_0() const { return ___value_0; } inline uint32_t* get_address_of_value_0() { return &___value_0; } inline void set_value_0(uint32_t value) { ___value_0 = value; } inline static int32_t get_offset_of_has_value_1() { return static_cast<int32_t>(offsetof(Nullable_1_t4282624060, ___has_value_1)); } inline bool get_has_value_1() const { return ___has_value_1; } inline bool* get_address_of_has_value_1() { return &___has_value_1; } inline void set_has_value_1(bool value) { ___has_value_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // NULLABLE_1_T4282624060_H #ifndef NULLABLE_1_T3119828856_H #define NULLABLE_1_T3119828856_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Nullable`1<System.Single> struct Nullable_1_t3119828856 { public: // T System.Nullable`1::value float ___value_0; // System.Boolean System.Nullable`1::has_value bool ___has_value_1; public: inline static int32_t get_offset_of_value_0() { return static_cast<int32_t>(offsetof(Nullable_1_t3119828856, ___value_0)); } inline float get_value_0() const { return ___value_0; } inline float* get_address_of_value_0() { return &___value_0; } inline void set_value_0(float value) { ___value_0 = value; } inline static int32_t get_offset_of_has_value_1() { return static_cast<int32_t>(offsetof(Nullable_1_t3119828856, ___has_value_1)); } inline bool get_has_value_1() const { return ___has_value_1; } inline bool* get_address_of_has_value_1() { return &___has_value_1; } inline void set_has_value_1(bool value) { ___has_value_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // NULLABLE_1_T3119828856_H #ifndef INTPOINT_T2327573135_H #define INTPOINT_T2327573135_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint struct IntPoint_t2327573135 { public: // System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint::X int64_t ___X_0; // System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint::Y int64_t ___Y_1; public: inline static int32_t get_offset_of_X_0() { return static_cast<int32_t>(offsetof(IntPoint_t2327573135, ___X_0)); } inline int64_t get_X_0() const { return ___X_0; } inline int64_t* get_address_of_X_0() { return &___X_0; } inline void set_X_0(int64_t value) { ___X_0 = value; } inline static int32_t get_offset_of_Y_1() { return static_cast<int32_t>(offsetof(IntPoint_t2327573135, ___Y_1)); } inline int64_t get_Y_1() const { return ___Y_1; } inline int64_t* get_address_of_Y_1() { return &___Y_1; } inline void set_Y_1(int64_t value) { ___Y_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INTPOINT_T2327573135_H #ifndef INTRECT_T752847524_H #define INTRECT_T752847524_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntRect struct IntRect_t752847524 { public: // System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntRect::left int64_t ___left_0; // System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntRect::top int64_t ___top_1; // System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntRect::right int64_t ___right_2; // System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntRect::bottom int64_t ___bottom_3; public: inline static int32_t get_offset_of_left_0() { return static_cast<int32_t>(offsetof(IntRect_t752847524, ___left_0)); } inline int64_t get_left_0() const { return ___left_0; } inline int64_t* get_address_of_left_0() { return &___left_0; } inline void set_left_0(int64_t value) { ___left_0 = value; } inline static int32_t get_offset_of_top_1() { return static_cast<int32_t>(offsetof(IntRect_t752847524, ___top_1)); } inline int64_t get_top_1() const { return ___top_1; } inline int64_t* get_address_of_top_1() { return &___top_1; } inline void set_top_1(int64_t value) { ___top_1 = value; } inline static int32_t get_offset_of_right_2() { return static_cast<int32_t>(offsetof(IntRect_t752847524, ___right_2)); } inline int64_t get_right_2() const { return ___right_2; } inline int64_t* get_address_of_right_2() { return &___right_2; } inline void set_right_2(int64_t value) { ___right_2 = value; } inline static int32_t get_offset_of_bottom_3() { return static_cast<int32_t>(offsetof(IntRect_t752847524, ___bottom_3)); } inline int64_t get_bottom_3() const { return ___bottom_3; } inline int64_t* get_address_of_bottom_3() { return &___bottom_3; } inline void set_bottom_3(int64_t value) { ___bottom_3 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INTRECT_T752847524_H #ifndef INT128_T2615162842_H #define INT128_T2615162842_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Int128 struct Int128_t2615162842 { public: // System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Int128::hi int64_t ___hi_0; // System.UInt64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Int128::lo uint64_t ___lo_1; public: inline static int32_t get_offset_of_hi_0() { return static_cast<int32_t>(offsetof(Int128_t2615162842, ___hi_0)); } inline int64_t get_hi_0() const { return ___hi_0; } inline int64_t* get_address_of_hi_0() { return &___hi_0; } inline void set_hi_0(int64_t value) { ___hi_0 = value; } inline static int32_t get_offset_of_lo_1() { return static_cast<int32_t>(offsetof(Int128_t2615162842, ___lo_1)); } inline uint64_t get_lo_1() const { return ___lo_1; } inline uint64_t* get_address_of_lo_1() { return &___lo_1; } inline void set_lo_1(uint64_t value) { ___lo_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INT128_T2615162842_H #ifndef DOUBLEPOINT_T1607927371_H #define DOUBLEPOINT_T1607927371_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/DoublePoint struct DoublePoint_t1607927371 { public: // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/DoublePoint::X double ___X_0; // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/DoublePoint::Y double ___Y_1; public: inline static int32_t get_offset_of_X_0() { return static_cast<int32_t>(offsetof(DoublePoint_t1607927371, ___X_0)); } inline double get_X_0() const { return ___X_0; } inline double* get_address_of_X_0() { return &___X_0; } inline void set_X_0(double value) { ___X_0 = value; } inline static int32_t get_offset_of_Y_1() { return static_cast<int32_t>(offsetof(DoublePoint_t1607927371, ___Y_1)); } inline double get_Y_1() const { return ___Y_1; } inline double* get_address_of_Y_1() { return &___Y_1; } inline void set_Y_1(double value) { ___Y_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DOUBLEPOINT_T1607927371_H #ifndef CLIPPEREXCEPTION_T3118674656_H #define CLIPPEREXCEPTION_T3118674656_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperException struct ClipperException_t3118674656 : public Exception_t { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CLIPPEREXCEPTION_T3118674656_H #ifndef NODETYPE_T363087472_H #define NODETYPE_T363087472_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper/NodeType struct NodeType_t363087472 { public: // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper/NodeType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(NodeType_t363087472, ___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 // NODETYPE_T363087472_H #ifndef INTERSECTNODE_T3379514219_H #define INTERSECTNODE_T3379514219_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode struct IntersectNode_t3379514219 : public RuntimeObject { public: // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode::Edge1 TEdge_t1694054893 * ___Edge1_0; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode::Edge2 TEdge_t1694054893 * ___Edge2_1; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode::Pt IntPoint_t2327573135 ___Pt_2; public: inline static int32_t get_offset_of_Edge1_0() { return static_cast<int32_t>(offsetof(IntersectNode_t3379514219, ___Edge1_0)); } inline TEdge_t1694054893 * get_Edge1_0() const { return ___Edge1_0; } inline TEdge_t1694054893 ** get_address_of_Edge1_0() { return &___Edge1_0; } inline void set_Edge1_0(TEdge_t1694054893 * value) { ___Edge1_0 = value; Il2CppCodeGenWriteBarrier((&___Edge1_0), value); } inline static int32_t get_offset_of_Edge2_1() { return static_cast<int32_t>(offsetof(IntersectNode_t3379514219, ___Edge2_1)); } inline TEdge_t1694054893 * get_Edge2_1() const { return ___Edge2_1; } inline TEdge_t1694054893 ** get_address_of_Edge2_1() { return &___Edge2_1; } inline void set_Edge2_1(TEdge_t1694054893 * value) { ___Edge2_1 = value; Il2CppCodeGenWriteBarrier((&___Edge2_1), value); } inline static int32_t get_offset_of_Pt_2() { return static_cast<int32_t>(offsetof(IntersectNode_t3379514219, ___Pt_2)); } inline IntPoint_t2327573135 get_Pt_2() const { return ___Pt_2; } inline IntPoint_t2327573135 * get_address_of_Pt_2() { return &___Pt_2; } inline void set_Pt_2(IntPoint_t2327573135 value) { ___Pt_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INTERSECTNODE_T3379514219_H #ifndef BBOXTOVECTOR2DBOUNDSCONVERTER_T1118841236_H #define BBOXTOVECTOR2DBOUNDSCONVERTER_T1118841236_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.JsonConverters.BboxToVector2dBoundsConverter struct BboxToVector2dBoundsConverter_t1118841236 : public CustomCreationConverter_1_t241653040 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // BBOXTOVECTOR2DBOUNDSCONVERTER_T1118841236_H #ifndef POLYLINETOVECTOR2DLISTCONVERTER_T1416161534_H #define POLYLINETOVECTOR2DLISTCONVERTER_T1416161534_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.JsonConverters.PolylineToVector2dListConverter struct PolylineToVector2dListConverter_t1416161534 : public CustomCreationConverter_1_t1604133405 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // POLYLINETOVECTOR2DLISTCONVERTER_T1416161534_H #ifndef GEOMTYPE_T3056663235_H #define GEOMTYPE_T3056663235_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.GeomType struct GeomType_t3056663235 { public: // System.Int32 Mapbox.VectorTile.Geometry.GeomType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(GeomType_t3056663235, ___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 // GEOMTYPE_T3056663235_H #ifndef VOXELCOLORMAPPER_T2180346717_H #define VOXELCOLORMAPPER_T2180346717_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Voxels.VoxelColorMapper struct VoxelColorMapper_t2180346717 : public RuntimeObject { public: // UnityEngine.Color Mapbox.Examples.Voxels.VoxelColorMapper::Color Color_t2555686324 ___Color_0; // UnityEngine.GameObject Mapbox.Examples.Voxels.VoxelColorMapper::Voxel GameObject_t1113636619 * ___Voxel_1; public: inline static int32_t get_offset_of_Color_0() { return static_cast<int32_t>(offsetof(VoxelColorMapper_t2180346717, ___Color_0)); } inline Color_t2555686324 get_Color_0() const { return ___Color_0; } inline Color_t2555686324 * get_address_of_Color_0() { return &___Color_0; } inline void set_Color_0(Color_t2555686324 value) { ___Color_0 = value; } inline static int32_t get_offset_of_Voxel_1() { return static_cast<int32_t>(offsetof(VoxelColorMapper_t2180346717, ___Voxel_1)); } inline GameObject_t1113636619 * get_Voxel_1() const { return ___Voxel_1; } inline GameObject_t1113636619 ** get_address_of_Voxel_1() { return &___Voxel_1; } inline void set_Voxel_1(GameObject_t1113636619 * value) { ___Voxel_1 = value; Il2CppCodeGenWriteBarrier((&___Voxel_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VOXELCOLORMAPPER_T2180346717_H #ifndef VOXELDATA_T2248882184_H #define VOXELDATA_T2248882184_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Voxels.VoxelData struct VoxelData_t2248882184 : public RuntimeObject { public: // UnityEngine.Vector3 Mapbox.Examples.Voxels.VoxelData::Position Vector3_t3722313464 ___Position_0; // UnityEngine.GameObject Mapbox.Examples.Voxels.VoxelData::Prefab GameObject_t1113636619 * ___Prefab_1; public: inline static int32_t get_offset_of_Position_0() { return static_cast<int32_t>(offsetof(VoxelData_t2248882184, ___Position_0)); } inline Vector3_t3722313464 get_Position_0() const { return ___Position_0; } inline Vector3_t3722313464 * get_address_of_Position_0() { return &___Position_0; } inline void set_Position_0(Vector3_t3722313464 value) { ___Position_0 = value; } inline static int32_t get_offset_of_Prefab_1() { return static_cast<int32_t>(offsetof(VoxelData_t2248882184, ___Prefab_1)); } inline GameObject_t1113636619 * get_Prefab_1() const { return ___Prefab_1; } inline GameObject_t1113636619 ** get_address_of_Prefab_1() { return &___Prefab_1; } inline void set_Prefab_1(GameObject_t1113636619 * value) { ___Prefab_1 = value; Il2CppCodeGenWriteBarrier((&___Prefab_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VOXELDATA_T2248882184_H #ifndef CLIPTYPE_T1616702040_H #define CLIPTYPE_T1616702040_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipType struct ClipType_t1616702040 { public: // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(ClipType_t1616702040, ___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 // CLIPTYPE_T1616702040_H #ifndef EDGESIDE_T2739901735_H #define EDGESIDE_T2739901735_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EdgeSide struct EdgeSide_t2739901735 { public: // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EdgeSide::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(EdgeSide_t2739901735, ___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 // EDGESIDE_T2739901735_H #ifndef VECTOR2DBOUNDS_T1974840945_H #define VECTOR2DBOUNDS_T1974840945_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.Vector2dBounds struct Vector2dBounds_t1974840945 { public: // Mapbox.Utils.Vector2d Mapbox.Utils.Vector2dBounds::SouthWest Vector2d_t1865246568 ___SouthWest_0; // Mapbox.Utils.Vector2d Mapbox.Utils.Vector2dBounds::NorthEast Vector2d_t1865246568 ___NorthEast_1; public: inline static int32_t get_offset_of_SouthWest_0() { return static_cast<int32_t>(offsetof(Vector2dBounds_t1974840945, ___SouthWest_0)); } inline Vector2d_t1865246568 get_SouthWest_0() const { return ___SouthWest_0; } inline Vector2d_t1865246568 * get_address_of_SouthWest_0() { return &___SouthWest_0; } inline void set_SouthWest_0(Vector2d_t1865246568 value) { ___SouthWest_0 = value; } inline static int32_t get_offset_of_NorthEast_1() { return static_cast<int32_t>(offsetof(Vector2dBounds_t1974840945, ___NorthEast_1)); } inline Vector2d_t1865246568 get_NorthEast_1() const { return ___NorthEast_1; } inline Vector2d_t1865246568 * get_address_of_NorthEast_1() { return &___NorthEast_1; } inline void set_NorthEast_1(Vector2d_t1865246568 value) { ___NorthEast_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VECTOR2DBOUNDS_T1974840945_H #ifndef ENDTYPE_T3515135373_H #define ENDTYPE_T3515135373_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EndType struct EndType_t3515135373 { public: // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EndType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(EndType_t3515135373, ___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 // ENDTYPE_T3515135373_H #ifndef JOINTYPE_T3449044149_H #define JOINTYPE_T3449044149_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/JoinType struct JoinType_t3449044149 { public: // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/JoinType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(JoinType_t3449044149, ___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 // JOINTYPE_T3449044149_H #ifndef PROFILE_T1584301659_H #define PROFILE_T1584301659_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.MapMatching.Profile struct Profile_t1584301659 { public: // System.Int32 Mapbox.MapMatching.Profile::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(Profile_t1584301659, ___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 // PROFILE_T1584301659_H #ifndef POLYFILLTYPE_T2091732334_H #define POLYFILLTYPE_T2091732334_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyFillType struct PolyFillType_t2091732334 { public: // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyFillType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(PolyFillType_t2091732334, ___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 // POLYFILLTYPE_T2091732334_H #ifndef POLYTYPE_T1741373358_H #define POLYTYPE_T1741373358_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyType struct PolyType_t1741373358 { public: // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(PolyType_t1741373358, ___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 // POLYTYPE_T1741373358_H #ifndef LONLATTOVECTOR2DCONVERTER_T2933574141_H #define LONLATTOVECTOR2DCONVERTER_T2933574141_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.JsonConverters.LonLatToVector2dConverter struct LonLatToVector2dConverter_t2933574141 : public CustomCreationConverter_1_t132058663 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LONLATTOVECTOR2DCONVERTER_T2933574141_H #ifndef JOIN_T2349011362_H #define JOIN_T2349011362_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join struct Join_t2349011362 : public RuntimeObject { public: // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join::OutPt1 OutPt_t2591102706 * ___OutPt1_0; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join::OutPt2 OutPt_t2591102706 * ___OutPt2_1; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join::OffPt IntPoint_t2327573135 ___OffPt_2; public: inline static int32_t get_offset_of_OutPt1_0() { return static_cast<int32_t>(offsetof(Join_t2349011362, ___OutPt1_0)); } inline OutPt_t2591102706 * get_OutPt1_0() const { return ___OutPt1_0; } inline OutPt_t2591102706 ** get_address_of_OutPt1_0() { return &___OutPt1_0; } inline void set_OutPt1_0(OutPt_t2591102706 * value) { ___OutPt1_0 = value; Il2CppCodeGenWriteBarrier((&___OutPt1_0), value); } inline static int32_t get_offset_of_OutPt2_1() { return static_cast<int32_t>(offsetof(Join_t2349011362, ___OutPt2_1)); } inline OutPt_t2591102706 * get_OutPt2_1() const { return ___OutPt2_1; } inline OutPt_t2591102706 ** get_address_of_OutPt2_1() { return &___OutPt2_1; } inline void set_OutPt2_1(OutPt_t2591102706 * value) { ___OutPt2_1 = value; Il2CppCodeGenWriteBarrier((&___OutPt2_1), value); } inline static int32_t get_offset_of_OffPt_2() { return static_cast<int32_t>(offsetof(Join_t2349011362, ___OffPt_2)); } inline IntPoint_t2327573135 get_OffPt_2() const { return ___OffPt_2; } inline IntPoint_t2327573135 * get_address_of_OffPt_2() { return &___OffPt_2; } inline void set_OffPt_2(IntPoint_t2327573135 value) { ___OffPt_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // JOIN_T2349011362_H #ifndef VALUETYPE_T2776630785_H #define VALUETYPE_T2776630785_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Contants.ValueType struct ValueType_t2776630785 { public: // System.Int32 Mapbox.VectorTile.Contants.ValueType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(ValueType_t2776630785, ___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 // VALUETYPE_T2776630785_H #ifndef FEATURETYPE_T2360609914_H #define FEATURETYPE_T2360609914_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Contants.FeatureType struct FeatureType_t2360609914 { public: // System.Int32 Mapbox.VectorTile.Contants.FeatureType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(FeatureType_t2360609914, ___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 // FEATURETYPE_T2360609914_H #ifndef LAYERTYPE_T1746409905_H #define LAYERTYPE_T1746409905_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Contants.LayerType struct LayerType_t1746409905 { public: // System.Int32 Mapbox.VectorTile.Contants.LayerType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(LayerType_t1746409905, ___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 // LAYERTYPE_T1746409905_H #ifndef TILETYPE_T3106966029_H #define TILETYPE_T3106966029_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Contants.TileType struct TileType_t3106966029 { public: // System.Int32 Mapbox.VectorTile.Contants.TileType::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(TileType_t3106966029, ___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 // TILETYPE_T3106966029_H #ifndef COMMANDS_T1803779524_H #define COMMANDS_T1803779524_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Contants.Commands struct Commands_t1803779524 { public: // System.Int32 Mapbox.VectorTile.Contants.Commands::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(Commands_t1803779524, ___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 // COMMANDS_T1803779524_H #ifndef WIRETYPES_T1504741901_H #define WIRETYPES_T1504741901_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Contants.WireTypes struct WireTypes_t1504741901 { public: // System.Int32 Mapbox.VectorTile.Contants.WireTypes::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(WireTypes_t1504741901, ___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 // WIRETYPES_T1504741901_H #ifndef OUTPT_T2591102706_H #define OUTPT_T2591102706_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt struct OutPt_t2591102706 : public RuntimeObject { public: // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt::Idx int32_t ___Idx_0; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt::Pt IntPoint_t2327573135 ___Pt_1; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt::Next OutPt_t2591102706 * ___Next_2; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt::Prev OutPt_t2591102706 * ___Prev_3; public: inline static int32_t get_offset_of_Idx_0() { return static_cast<int32_t>(offsetof(OutPt_t2591102706, ___Idx_0)); } inline int32_t get_Idx_0() const { return ___Idx_0; } inline int32_t* get_address_of_Idx_0() { return &___Idx_0; } inline void set_Idx_0(int32_t value) { ___Idx_0 = value; } inline static int32_t get_offset_of_Pt_1() { return static_cast<int32_t>(offsetof(OutPt_t2591102706, ___Pt_1)); } inline IntPoint_t2327573135 get_Pt_1() const { return ___Pt_1; } inline IntPoint_t2327573135 * get_address_of_Pt_1() { return &___Pt_1; } inline void set_Pt_1(IntPoint_t2327573135 value) { ___Pt_1 = value; } inline static int32_t get_offset_of_Next_2() { return static_cast<int32_t>(offsetof(OutPt_t2591102706, ___Next_2)); } inline OutPt_t2591102706 * get_Next_2() const { return ___Next_2; } inline OutPt_t2591102706 ** get_address_of_Next_2() { return &___Next_2; } inline void set_Next_2(OutPt_t2591102706 * value) { ___Next_2 = value; Il2CppCodeGenWriteBarrier((&___Next_2), value); } inline static int32_t get_offset_of_Prev_3() { return static_cast<int32_t>(offsetof(OutPt_t2591102706, ___Prev_3)); } inline OutPt_t2591102706 * get_Prev_3() const { return ___Prev_3; } inline OutPt_t2591102706 ** get_address_of_Prev_3() { return &___Prev_3; } inline void set_Prev_3(OutPt_t2591102706 * value) { ___Prev_3 = value; Il2CppCodeGenWriteBarrier((&___Prev_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // OUTPT_T2591102706_H #ifndef CLIPPEROFFSET_T3668738110_H #define CLIPPEROFFSET_T3668738110_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset struct ClipperOffset_t3668738110 : public RuntimeObject { public: // System.Collections.Generic.List`1<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint>> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_destPolys List_1_t976755323 * ___m_destPolys_0; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_srcPoly List_1_t3799647877 * ___m_srcPoly_1; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_destPoly List_1_t3799647877 * ___m_destPoly_2; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/DoublePoint> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_normals List_1_t3080002113 * ___m_normals_3; // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_delta double ___m_delta_4; // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_sinA double ___m_sinA_5; // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_sin double ___m_sin_6; // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_cos double ___m_cos_7; // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_miterLim double ___m_miterLim_8; // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_StepsPerRad double ___m_StepsPerRad_9; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_lowest IntPoint_t2327573135 ___m_lowest_10; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_polyNodes PolyNode_t1300984468 * ___m_polyNodes_11; // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::<ArcTolerance>k__BackingField double ___U3CArcToleranceU3Ek__BackingField_12; // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::<MiterLimit>k__BackingField double ___U3CMiterLimitU3Ek__BackingField_13; public: inline static int32_t get_offset_of_m_destPolys_0() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_destPolys_0)); } inline List_1_t976755323 * get_m_destPolys_0() const { return ___m_destPolys_0; } inline List_1_t976755323 ** get_address_of_m_destPolys_0() { return &___m_destPolys_0; } inline void set_m_destPolys_0(List_1_t976755323 * value) { ___m_destPolys_0 = value; Il2CppCodeGenWriteBarrier((&___m_destPolys_0), value); } inline static int32_t get_offset_of_m_srcPoly_1() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_srcPoly_1)); } inline List_1_t3799647877 * get_m_srcPoly_1() const { return ___m_srcPoly_1; } inline List_1_t3799647877 ** get_address_of_m_srcPoly_1() { return &___m_srcPoly_1; } inline void set_m_srcPoly_1(List_1_t3799647877 * value) { ___m_srcPoly_1 = value; Il2CppCodeGenWriteBarrier((&___m_srcPoly_1), value); } inline static int32_t get_offset_of_m_destPoly_2() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_destPoly_2)); } inline List_1_t3799647877 * get_m_destPoly_2() const { return ___m_destPoly_2; } inline List_1_t3799647877 ** get_address_of_m_destPoly_2() { return &___m_destPoly_2; } inline void set_m_destPoly_2(List_1_t3799647877 * value) { ___m_destPoly_2 = value; Il2CppCodeGenWriteBarrier((&___m_destPoly_2), value); } inline static int32_t get_offset_of_m_normals_3() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_normals_3)); } inline List_1_t3080002113 * get_m_normals_3() const { return ___m_normals_3; } inline List_1_t3080002113 ** get_address_of_m_normals_3() { return &___m_normals_3; } inline void set_m_normals_3(List_1_t3080002113 * value) { ___m_normals_3 = value; Il2CppCodeGenWriteBarrier((&___m_normals_3), value); } inline static int32_t get_offset_of_m_delta_4() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_delta_4)); } inline double get_m_delta_4() const { return ___m_delta_4; } inline double* get_address_of_m_delta_4() { return &___m_delta_4; } inline void set_m_delta_4(double value) { ___m_delta_4 = value; } inline static int32_t get_offset_of_m_sinA_5() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_sinA_5)); } inline double get_m_sinA_5() const { return ___m_sinA_5; } inline double* get_address_of_m_sinA_5() { return &___m_sinA_5; } inline void set_m_sinA_5(double value) { ___m_sinA_5 = value; } inline static int32_t get_offset_of_m_sin_6() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_sin_6)); } inline double get_m_sin_6() const { return ___m_sin_6; } inline double* get_address_of_m_sin_6() { return &___m_sin_6; } inline void set_m_sin_6(double value) { ___m_sin_6 = value; } inline static int32_t get_offset_of_m_cos_7() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_cos_7)); } inline double get_m_cos_7() const { return ___m_cos_7; } inline double* get_address_of_m_cos_7() { return &___m_cos_7; } inline void set_m_cos_7(double value) { ___m_cos_7 = value; } inline static int32_t get_offset_of_m_miterLim_8() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_miterLim_8)); } inline double get_m_miterLim_8() const { return ___m_miterLim_8; } inline double* get_address_of_m_miterLim_8() { return &___m_miterLim_8; } inline void set_m_miterLim_8(double value) { ___m_miterLim_8 = value; } inline static int32_t get_offset_of_m_StepsPerRad_9() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_StepsPerRad_9)); } inline double get_m_StepsPerRad_9() const { return ___m_StepsPerRad_9; } inline double* get_address_of_m_StepsPerRad_9() { return &___m_StepsPerRad_9; } inline void set_m_StepsPerRad_9(double value) { ___m_StepsPerRad_9 = value; } inline static int32_t get_offset_of_m_lowest_10() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_lowest_10)); } inline IntPoint_t2327573135 get_m_lowest_10() const { return ___m_lowest_10; } inline IntPoint_t2327573135 * get_address_of_m_lowest_10() { return &___m_lowest_10; } inline void set_m_lowest_10(IntPoint_t2327573135 value) { ___m_lowest_10 = value; } inline static int32_t get_offset_of_m_polyNodes_11() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_polyNodes_11)); } inline PolyNode_t1300984468 * get_m_polyNodes_11() const { return ___m_polyNodes_11; } inline PolyNode_t1300984468 ** get_address_of_m_polyNodes_11() { return &___m_polyNodes_11; } inline void set_m_polyNodes_11(PolyNode_t1300984468 * value) { ___m_polyNodes_11 = value; Il2CppCodeGenWriteBarrier((&___m_polyNodes_11), value); } inline static int32_t get_offset_of_U3CArcToleranceU3Ek__BackingField_12() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___U3CArcToleranceU3Ek__BackingField_12)); } inline double get_U3CArcToleranceU3Ek__BackingField_12() const { return ___U3CArcToleranceU3Ek__BackingField_12; } inline double* get_address_of_U3CArcToleranceU3Ek__BackingField_12() { return &___U3CArcToleranceU3Ek__BackingField_12; } inline void set_U3CArcToleranceU3Ek__BackingField_12(double value) { ___U3CArcToleranceU3Ek__BackingField_12 = value; } inline static int32_t get_offset_of_U3CMiterLimitU3Ek__BackingField_13() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___U3CMiterLimitU3Ek__BackingField_13)); } inline double get_U3CMiterLimitU3Ek__BackingField_13() const { return ___U3CMiterLimitU3Ek__BackingField_13; } inline double* get_address_of_U3CMiterLimitU3Ek__BackingField_13() { return &___U3CMiterLimitU3Ek__BackingField_13; } inline void set_U3CMiterLimitU3Ek__BackingField_13(double value) { ___U3CMiterLimitU3Ek__BackingField_13 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CLIPPEROFFSET_T3668738110_H #ifndef OBJECT_T631007953_H #define OBJECT_T631007953_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Object struct Object_t631007953 : public RuntimeObject { public: // System.IntPtr UnityEngine.Object::m_CachedPtr intptr_t ___m_CachedPtr_0; public: inline static int32_t get_offset_of_m_CachedPtr_0() { return static_cast<int32_t>(offsetof(Object_t631007953, ___m_CachedPtr_0)); } inline intptr_t get_m_CachedPtr_0() const { return ___m_CachedPtr_0; } inline intptr_t* get_address_of_m_CachedPtr_0() { return &___m_CachedPtr_0; } inline void set_m_CachedPtr_0(intptr_t value) { ___m_CachedPtr_0 = value; } }; struct Object_t631007953_StaticFields { public: // System.Int32 UnityEngine.Object::OffsetOfInstanceIDInCPlusPlusObject int32_t ___OffsetOfInstanceIDInCPlusPlusObject_1; public: inline static int32_t get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return static_cast<int32_t>(offsetof(Object_t631007953_StaticFields, ___OffsetOfInstanceIDInCPlusPlusObject_1)); } inline int32_t get_OffsetOfInstanceIDInCPlusPlusObject_1() const { return ___OffsetOfInstanceIDInCPlusPlusObject_1; } inline int32_t* get_address_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return &___OffsetOfInstanceIDInCPlusPlusObject_1; } inline void set_OffsetOfInstanceIDInCPlusPlusObject_1(int32_t value) { ___OffsetOfInstanceIDInCPlusPlusObject_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of UnityEngine.Object struct Object_t631007953_marshaled_pinvoke { intptr_t ___m_CachedPtr_0; }; // Native definition for COM marshalling of UnityEngine.Object struct Object_t631007953_marshaled_com { intptr_t ___m_CachedPtr_0; }; #endif // OBJECT_T631007953_H #ifndef DIRECTION_T4237952965_H #define DIRECTION_T4237952965_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Direction struct Direction_t4237952965 { public: // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Direction::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(Direction_t4237952965, ___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 // DIRECTION_T4237952965_H #ifndef RECTD_T151583371_H #define RECTD_T151583371_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Utils.RectD struct RectD_t151583371 { public: union { struct { // Mapbox.Utils.Vector2d Mapbox.Utils.RectD::<Min>k__BackingField Vector2d_t1865246568 ___U3CMinU3Ek__BackingField_0; // Mapbox.Utils.Vector2d Mapbox.Utils.RectD::<Max>k__BackingField Vector2d_t1865246568 ___U3CMaxU3Ek__BackingField_1; // Mapbox.Utils.Vector2d Mapbox.Utils.RectD::<Size>k__BackingField Vector2d_t1865246568 ___U3CSizeU3Ek__BackingField_2; // Mapbox.Utils.Vector2d Mapbox.Utils.RectD::<Center>k__BackingField Vector2d_t1865246568 ___U3CCenterU3Ek__BackingField_3; }; uint8_t RectD_t151583371__padding[1]; }; public: inline static int32_t get_offset_of_U3CMinU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(RectD_t151583371, ___U3CMinU3Ek__BackingField_0)); } inline Vector2d_t1865246568 get_U3CMinU3Ek__BackingField_0() const { return ___U3CMinU3Ek__BackingField_0; } inline Vector2d_t1865246568 * get_address_of_U3CMinU3Ek__BackingField_0() { return &___U3CMinU3Ek__BackingField_0; } inline void set_U3CMinU3Ek__BackingField_0(Vector2d_t1865246568 value) { ___U3CMinU3Ek__BackingField_0 = value; } inline static int32_t get_offset_of_U3CMaxU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(RectD_t151583371, ___U3CMaxU3Ek__BackingField_1)); } inline Vector2d_t1865246568 get_U3CMaxU3Ek__BackingField_1() const { return ___U3CMaxU3Ek__BackingField_1; } inline Vector2d_t1865246568 * get_address_of_U3CMaxU3Ek__BackingField_1() { return &___U3CMaxU3Ek__BackingField_1; } inline void set_U3CMaxU3Ek__BackingField_1(Vector2d_t1865246568 value) { ___U3CMaxU3Ek__BackingField_1 = value; } inline static int32_t get_offset_of_U3CSizeU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(RectD_t151583371, ___U3CSizeU3Ek__BackingField_2)); } inline Vector2d_t1865246568 get_U3CSizeU3Ek__BackingField_2() const { return ___U3CSizeU3Ek__BackingField_2; } inline Vector2d_t1865246568 * get_address_of_U3CSizeU3Ek__BackingField_2() { return &___U3CSizeU3Ek__BackingField_2; } inline void set_U3CSizeU3Ek__BackingField_2(Vector2d_t1865246568 value) { ___U3CSizeU3Ek__BackingField_2 = value; } inline static int32_t get_offset_of_U3CCenterU3Ek__BackingField_3() { return static_cast<int32_t>(offsetof(RectD_t151583371, ___U3CCenterU3Ek__BackingField_3)); } inline Vector2d_t1865246568 get_U3CCenterU3Ek__BackingField_3() const { return ___U3CCenterU3Ek__BackingField_3; } inline Vector2d_t1865246568 * get_address_of_U3CCenterU3Ek__BackingField_3() { return &___U3CCenterU3Ek__BackingField_3; } inline void set_U3CCenterU3Ek__BackingField_3(Vector2d_t1865246568 value) { ___U3CCenterU3Ek__BackingField_3 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RECTD_T151583371_H #ifndef POLYNODE_T1300984468_H #define POLYNODE_T1300984468_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode struct PolyNode_t1300984468 : public RuntimeObject { public: // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_Parent PolyNode_t1300984468 * ___m_Parent_0; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_polygon List_1_t3799647877 * ___m_polygon_1; // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_Index int32_t ___m_Index_2; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/JoinType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_jointype int32_t ___m_jointype_3; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EndType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_endtype int32_t ___m_endtype_4; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_Childs List_1_t2773059210 * ___m_Childs_5; // System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::<IsOpen>k__BackingField bool ___U3CIsOpenU3Ek__BackingField_6; public: inline static int32_t get_offset_of_m_Parent_0() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_Parent_0)); } inline PolyNode_t1300984468 * get_m_Parent_0() const { return ___m_Parent_0; } inline PolyNode_t1300984468 ** get_address_of_m_Parent_0() { return &___m_Parent_0; } inline void set_m_Parent_0(PolyNode_t1300984468 * value) { ___m_Parent_0 = value; Il2CppCodeGenWriteBarrier((&___m_Parent_0), value); } inline static int32_t get_offset_of_m_polygon_1() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_polygon_1)); } inline List_1_t3799647877 * get_m_polygon_1() const { return ___m_polygon_1; } inline List_1_t3799647877 ** get_address_of_m_polygon_1() { return &___m_polygon_1; } inline void set_m_polygon_1(List_1_t3799647877 * value) { ___m_polygon_1 = value; Il2CppCodeGenWriteBarrier((&___m_polygon_1), value); } inline static int32_t get_offset_of_m_Index_2() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_Index_2)); } inline int32_t get_m_Index_2() const { return ___m_Index_2; } inline int32_t* get_address_of_m_Index_2() { return &___m_Index_2; } inline void set_m_Index_2(int32_t value) { ___m_Index_2 = value; } inline static int32_t get_offset_of_m_jointype_3() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_jointype_3)); } inline int32_t get_m_jointype_3() const { return ___m_jointype_3; } inline int32_t* get_address_of_m_jointype_3() { return &___m_jointype_3; } inline void set_m_jointype_3(int32_t value) { ___m_jointype_3 = value; } inline static int32_t get_offset_of_m_endtype_4() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_endtype_4)); } inline int32_t get_m_endtype_4() const { return ___m_endtype_4; } inline int32_t* get_address_of_m_endtype_4() { return &___m_endtype_4; } inline void set_m_endtype_4(int32_t value) { ___m_endtype_4 = value; } inline static int32_t get_offset_of_m_Childs_5() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_Childs_5)); } inline List_1_t2773059210 * get_m_Childs_5() const { return ___m_Childs_5; } inline List_1_t2773059210 ** get_address_of_m_Childs_5() { return &___m_Childs_5; } inline void set_m_Childs_5(List_1_t2773059210 * value) { ___m_Childs_5 = value; Il2CppCodeGenWriteBarrier((&___m_Childs_5), value); } inline static int32_t get_offset_of_U3CIsOpenU3Ek__BackingField_6() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___U3CIsOpenU3Ek__BackingField_6)); } inline bool get_U3CIsOpenU3Ek__BackingField_6() const { return ___U3CIsOpenU3Ek__BackingField_6; } inline bool* get_address_of_U3CIsOpenU3Ek__BackingField_6() { return &___U3CIsOpenU3Ek__BackingField_6; } inline void set_U3CIsOpenU3Ek__BackingField_6(bool value) { ___U3CIsOpenU3Ek__BackingField_6 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // POLYNODE_T1300984468_H #ifndef COMPONENT_T1923634451_H #define COMPONENT_T1923634451_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Component struct Component_t1923634451 : public Object_t631007953 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // COMPONENT_T1923634451_H #ifndef SCRIPTABLEOBJECT_T2528358522_H #define SCRIPTABLEOBJECT_T2528358522_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.ScriptableObject struct ScriptableObject_t2528358522 : public Object_t631007953 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of UnityEngine.ScriptableObject struct ScriptableObject_t2528358522_marshaled_pinvoke : public Object_t631007953_marshaled_pinvoke { }; // Native definition for COM marshalling of UnityEngine.ScriptableObject struct ScriptableObject_t2528358522_marshaled_com : public Object_t631007953_marshaled_com { }; #endif // SCRIPTABLEOBJECT_T2528358522_H #ifndef PBFREADER_T1662343237_H #define PBFREADER_T1662343237_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.PbfReader struct PbfReader_t1662343237 : public RuntimeObject { public: // System.Int32 Mapbox.VectorTile.PbfReader::<Tag>k__BackingField int32_t ___U3CTagU3Ek__BackingField_0; // System.UInt64 Mapbox.VectorTile.PbfReader::<Value>k__BackingField uint64_t ___U3CValueU3Ek__BackingField_1; // Mapbox.VectorTile.Contants.WireTypes Mapbox.VectorTile.PbfReader::<WireType>k__BackingField int32_t ___U3CWireTypeU3Ek__BackingField_2; // System.Byte[] Mapbox.VectorTile.PbfReader::_buffer ByteU5BU5D_t4116647657* ____buffer_3; // System.UInt64 Mapbox.VectorTile.PbfReader::_length uint64_t ____length_4; // System.UInt64 Mapbox.VectorTile.PbfReader::_pos uint64_t ____pos_5; public: inline static int32_t get_offset_of_U3CTagU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ___U3CTagU3Ek__BackingField_0)); } inline int32_t get_U3CTagU3Ek__BackingField_0() const { return ___U3CTagU3Ek__BackingField_0; } inline int32_t* get_address_of_U3CTagU3Ek__BackingField_0() { return &___U3CTagU3Ek__BackingField_0; } inline void set_U3CTagU3Ek__BackingField_0(int32_t value) { ___U3CTagU3Ek__BackingField_0 = value; } inline static int32_t get_offset_of_U3CValueU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ___U3CValueU3Ek__BackingField_1)); } inline uint64_t get_U3CValueU3Ek__BackingField_1() const { return ___U3CValueU3Ek__BackingField_1; } inline uint64_t* get_address_of_U3CValueU3Ek__BackingField_1() { return &___U3CValueU3Ek__BackingField_1; } inline void set_U3CValueU3Ek__BackingField_1(uint64_t value) { ___U3CValueU3Ek__BackingField_1 = value; } inline static int32_t get_offset_of_U3CWireTypeU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ___U3CWireTypeU3Ek__BackingField_2)); } inline int32_t get_U3CWireTypeU3Ek__BackingField_2() const { return ___U3CWireTypeU3Ek__BackingField_2; } inline int32_t* get_address_of_U3CWireTypeU3Ek__BackingField_2() { return &___U3CWireTypeU3Ek__BackingField_2; } inline void set_U3CWireTypeU3Ek__BackingField_2(int32_t value) { ___U3CWireTypeU3Ek__BackingField_2 = value; } inline static int32_t get_offset_of__buffer_3() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ____buffer_3)); } inline ByteU5BU5D_t4116647657* get__buffer_3() const { return ____buffer_3; } inline ByteU5BU5D_t4116647657** get_address_of__buffer_3() { return &____buffer_3; } inline void set__buffer_3(ByteU5BU5D_t4116647657* value) { ____buffer_3 = value; Il2CppCodeGenWriteBarrier((&____buffer_3), value); } inline static int32_t get_offset_of__length_4() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ____length_4)); } inline uint64_t get__length_4() const { return ____length_4; } inline uint64_t* get_address_of__length_4() { return &____length_4; } inline void set__length_4(uint64_t value) { ____length_4 = value; } inline static int32_t get_offset_of__pos_5() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ____pos_5)); } inline uint64_t get__pos_5() const { return ____pos_5; } inline uint64_t* get_address_of__pos_5() { return &____pos_5; } inline void set__pos_5(uint64_t value) { ____pos_5 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // PBFREADER_T1662343237_H #ifndef TEDGE_T1694054893_H #define TEDGE_T1694054893_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge struct TEdge_t1694054893 : public RuntimeObject { public: // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Bot IntPoint_t2327573135 ___Bot_0; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Curr IntPoint_t2327573135 ___Curr_1; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Top IntPoint_t2327573135 ___Top_2; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Delta IntPoint_t2327573135 ___Delta_3; // System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Dx double ___Dx_4; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::PolyTyp int32_t ___PolyTyp_5; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EdgeSide Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Side int32_t ___Side_6; // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::WindDelta int32_t ___WindDelta_7; // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::WindCnt int32_t ___WindCnt_8; // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::WindCnt2 int32_t ___WindCnt2_9; // System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::OutIdx int32_t ___OutIdx_10; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Next TEdge_t1694054893 * ___Next_11; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Prev TEdge_t1694054893 * ___Prev_12; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::NextInLML TEdge_t1694054893 * ___NextInLML_13; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::NextInAEL TEdge_t1694054893 * ___NextInAEL_14; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::PrevInAEL TEdge_t1694054893 * ___PrevInAEL_15; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::NextInSEL TEdge_t1694054893 * ___NextInSEL_16; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::PrevInSEL TEdge_t1694054893 * ___PrevInSEL_17; public: inline static int32_t get_offset_of_Bot_0() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Bot_0)); } inline IntPoint_t2327573135 get_Bot_0() const { return ___Bot_0; } inline IntPoint_t2327573135 * get_address_of_Bot_0() { return &___Bot_0; } inline void set_Bot_0(IntPoint_t2327573135 value) { ___Bot_0 = value; } inline static int32_t get_offset_of_Curr_1() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Curr_1)); } inline IntPoint_t2327573135 get_Curr_1() const { return ___Curr_1; } inline IntPoint_t2327573135 * get_address_of_Curr_1() { return &___Curr_1; } inline void set_Curr_1(IntPoint_t2327573135 value) { ___Curr_1 = value; } inline static int32_t get_offset_of_Top_2() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Top_2)); } inline IntPoint_t2327573135 get_Top_2() const { return ___Top_2; } inline IntPoint_t2327573135 * get_address_of_Top_2() { return &___Top_2; } inline void set_Top_2(IntPoint_t2327573135 value) { ___Top_2 = value; } inline static int32_t get_offset_of_Delta_3() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Delta_3)); } inline IntPoint_t2327573135 get_Delta_3() const { return ___Delta_3; } inline IntPoint_t2327573135 * get_address_of_Delta_3() { return &___Delta_3; } inline void set_Delta_3(IntPoint_t2327573135 value) { ___Delta_3 = value; } inline static int32_t get_offset_of_Dx_4() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Dx_4)); } inline double get_Dx_4() const { return ___Dx_4; } inline double* get_address_of_Dx_4() { return &___Dx_4; } inline void set_Dx_4(double value) { ___Dx_4 = value; } inline static int32_t get_offset_of_PolyTyp_5() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___PolyTyp_5)); } inline int32_t get_PolyTyp_5() const { return ___PolyTyp_5; } inline int32_t* get_address_of_PolyTyp_5() { return &___PolyTyp_5; } inline void set_PolyTyp_5(int32_t value) { ___PolyTyp_5 = value; } inline static int32_t get_offset_of_Side_6() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Side_6)); } inline int32_t get_Side_6() const { return ___Side_6; } inline int32_t* get_address_of_Side_6() { return &___Side_6; } inline void set_Side_6(int32_t value) { ___Side_6 = value; } inline static int32_t get_offset_of_WindDelta_7() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___WindDelta_7)); } inline int32_t get_WindDelta_7() const { return ___WindDelta_7; } inline int32_t* get_address_of_WindDelta_7() { return &___WindDelta_7; } inline void set_WindDelta_7(int32_t value) { ___WindDelta_7 = value; } inline static int32_t get_offset_of_WindCnt_8() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___WindCnt_8)); } inline int32_t get_WindCnt_8() const { return ___WindCnt_8; } inline int32_t* get_address_of_WindCnt_8() { return &___WindCnt_8; } inline void set_WindCnt_8(int32_t value) { ___WindCnt_8 = value; } inline static int32_t get_offset_of_WindCnt2_9() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___WindCnt2_9)); } inline int32_t get_WindCnt2_9() const { return ___WindCnt2_9; } inline int32_t* get_address_of_WindCnt2_9() { return &___WindCnt2_9; } inline void set_WindCnt2_9(int32_t value) { ___WindCnt2_9 = value; } inline static int32_t get_offset_of_OutIdx_10() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___OutIdx_10)); } inline int32_t get_OutIdx_10() const { return ___OutIdx_10; } inline int32_t* get_address_of_OutIdx_10() { return &___OutIdx_10; } inline void set_OutIdx_10(int32_t value) { ___OutIdx_10 = value; } inline static int32_t get_offset_of_Next_11() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Next_11)); } inline TEdge_t1694054893 * get_Next_11() const { return ___Next_11; } inline TEdge_t1694054893 ** get_address_of_Next_11() { return &___Next_11; } inline void set_Next_11(TEdge_t1694054893 * value) { ___Next_11 = value; Il2CppCodeGenWriteBarrier((&___Next_11), value); } inline static int32_t get_offset_of_Prev_12() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Prev_12)); } inline TEdge_t1694054893 * get_Prev_12() const { return ___Prev_12; } inline TEdge_t1694054893 ** get_address_of_Prev_12() { return &___Prev_12; } inline void set_Prev_12(TEdge_t1694054893 * value) { ___Prev_12 = value; Il2CppCodeGenWriteBarrier((&___Prev_12), value); } inline static int32_t get_offset_of_NextInLML_13() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___NextInLML_13)); } inline TEdge_t1694054893 * get_NextInLML_13() const { return ___NextInLML_13; } inline TEdge_t1694054893 ** get_address_of_NextInLML_13() { return &___NextInLML_13; } inline void set_NextInLML_13(TEdge_t1694054893 * value) { ___NextInLML_13 = value; Il2CppCodeGenWriteBarrier((&___NextInLML_13), value); } inline static int32_t get_offset_of_NextInAEL_14() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___NextInAEL_14)); } inline TEdge_t1694054893 * get_NextInAEL_14() const { return ___NextInAEL_14; } inline TEdge_t1694054893 ** get_address_of_NextInAEL_14() { return &___NextInAEL_14; } inline void set_NextInAEL_14(TEdge_t1694054893 * value) { ___NextInAEL_14 = value; Il2CppCodeGenWriteBarrier((&___NextInAEL_14), value); } inline static int32_t get_offset_of_PrevInAEL_15() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___PrevInAEL_15)); } inline TEdge_t1694054893 * get_PrevInAEL_15() const { return ___PrevInAEL_15; } inline TEdge_t1694054893 ** get_address_of_PrevInAEL_15() { return &___PrevInAEL_15; } inline void set_PrevInAEL_15(TEdge_t1694054893 * value) { ___PrevInAEL_15 = value; Il2CppCodeGenWriteBarrier((&___PrevInAEL_15), value); } inline static int32_t get_offset_of_NextInSEL_16() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___NextInSEL_16)); } inline TEdge_t1694054893 * get_NextInSEL_16() const { return ___NextInSEL_16; } inline TEdge_t1694054893 ** get_address_of_NextInSEL_16() { return &___NextInSEL_16; } inline void set_NextInSEL_16(TEdge_t1694054893 * value) { ___NextInSEL_16 = value; Il2CppCodeGenWriteBarrier((&___NextInSEL_16), value); } inline static int32_t get_offset_of_PrevInSEL_17() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___PrevInSEL_17)); } inline TEdge_t1694054893 * get_PrevInSEL_17() const { return ___PrevInSEL_17; } inline TEdge_t1694054893 ** get_address_of_PrevInSEL_17() { return &___PrevInSEL_17; } inline void set_PrevInSEL_17(TEdge_t1694054893 * value) { ___PrevInSEL_17 = value; Il2CppCodeGenWriteBarrier((&___PrevInSEL_17), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // TEDGE_T1694054893_H #ifndef CLIPPER_T4158555122_H #define CLIPPER_T4158555122_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper struct Clipper_t4158555122 : public ClipperBase_t2411222589 { public: // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_ClipType int32_t ___m_ClipType_18; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_Maxima Maxima_t4278896992 * ___m_Maxima_19; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_SortedEdges TEdge_t1694054893 * ___m_SortedEdges_20; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_IntersectList List_1_t556621665 * ___m_IntersectList_21; // System.Collections.Generic.IComparer`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_IntersectNodeComparer RuntimeObject* ___m_IntersectNodeComparer_22; // System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_ExecuteLocked bool ___m_ExecuteLocked_23; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyFillType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_ClipFillType int32_t ___m_ClipFillType_24; // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyFillType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_SubjFillType int32_t ___m_SubjFillType_25; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_Joins List_1_t3821086104 * ___m_Joins_26; // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_GhostJoins List_1_t3821086104 * ___m_GhostJoins_27; // System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_UsingPolyTree bool ___m_UsingPolyTree_28; // System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::<ReverseSolution>k__BackingField bool ___U3CReverseSolutionU3Ek__BackingField_29; // System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::<StrictlySimple>k__BackingField bool ___U3CStrictlySimpleU3Ek__BackingField_30; public: inline static int32_t get_offset_of_m_ClipType_18() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_ClipType_18)); } inline int32_t get_m_ClipType_18() const { return ___m_ClipType_18; } inline int32_t* get_address_of_m_ClipType_18() { return &___m_ClipType_18; } inline void set_m_ClipType_18(int32_t value) { ___m_ClipType_18 = value; } inline static int32_t get_offset_of_m_Maxima_19() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_Maxima_19)); } inline Maxima_t4278896992 * get_m_Maxima_19() const { return ___m_Maxima_19; } inline Maxima_t4278896992 ** get_address_of_m_Maxima_19() { return &___m_Maxima_19; } inline void set_m_Maxima_19(Maxima_t4278896992 * value) { ___m_Maxima_19 = value; Il2CppCodeGenWriteBarrier((&___m_Maxima_19), value); } inline static int32_t get_offset_of_m_SortedEdges_20() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_SortedEdges_20)); } inline TEdge_t1694054893 * get_m_SortedEdges_20() const { return ___m_SortedEdges_20; } inline TEdge_t1694054893 ** get_address_of_m_SortedEdges_20() { return &___m_SortedEdges_20; } inline void set_m_SortedEdges_20(TEdge_t1694054893 * value) { ___m_SortedEdges_20 = value; Il2CppCodeGenWriteBarrier((&___m_SortedEdges_20), value); } inline static int32_t get_offset_of_m_IntersectList_21() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_IntersectList_21)); } inline List_1_t556621665 * get_m_IntersectList_21() const { return ___m_IntersectList_21; } inline List_1_t556621665 ** get_address_of_m_IntersectList_21() { return &___m_IntersectList_21; } inline void set_m_IntersectList_21(List_1_t556621665 * value) { ___m_IntersectList_21 = value; Il2CppCodeGenWriteBarrier((&___m_IntersectList_21), value); } inline static int32_t get_offset_of_m_IntersectNodeComparer_22() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_IntersectNodeComparer_22)); } inline RuntimeObject* get_m_IntersectNodeComparer_22() const { return ___m_IntersectNodeComparer_22; } inline RuntimeObject** get_address_of_m_IntersectNodeComparer_22() { return &___m_IntersectNodeComparer_22; } inline void set_m_IntersectNodeComparer_22(RuntimeObject* value) { ___m_IntersectNodeComparer_22 = value; Il2CppCodeGenWriteBarrier((&___m_IntersectNodeComparer_22), value); } inline static int32_t get_offset_of_m_ExecuteLocked_23() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_ExecuteLocked_23)); } inline bool get_m_ExecuteLocked_23() const { return ___m_ExecuteLocked_23; } inline bool* get_address_of_m_ExecuteLocked_23() { return &___m_ExecuteLocked_23; } inline void set_m_ExecuteLocked_23(bool value) { ___m_ExecuteLocked_23 = value; } inline static int32_t get_offset_of_m_ClipFillType_24() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_ClipFillType_24)); } inline int32_t get_m_ClipFillType_24() const { return ___m_ClipFillType_24; } inline int32_t* get_address_of_m_ClipFillType_24() { return &___m_ClipFillType_24; } inline void set_m_ClipFillType_24(int32_t value) { ___m_ClipFillType_24 = value; } inline static int32_t get_offset_of_m_SubjFillType_25() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_SubjFillType_25)); } inline int32_t get_m_SubjFillType_25() const { return ___m_SubjFillType_25; } inline int32_t* get_address_of_m_SubjFillType_25() { return &___m_SubjFillType_25; } inline void set_m_SubjFillType_25(int32_t value) { ___m_SubjFillType_25 = value; } inline static int32_t get_offset_of_m_Joins_26() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_Joins_26)); } inline List_1_t3821086104 * get_m_Joins_26() const { return ___m_Joins_26; } inline List_1_t3821086104 ** get_address_of_m_Joins_26() { return &___m_Joins_26; } inline void set_m_Joins_26(List_1_t3821086104 * value) { ___m_Joins_26 = value; Il2CppCodeGenWriteBarrier((&___m_Joins_26), value); } inline static int32_t get_offset_of_m_GhostJoins_27() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_GhostJoins_27)); } inline List_1_t3821086104 * get_m_GhostJoins_27() const { return ___m_GhostJoins_27; } inline List_1_t3821086104 ** get_address_of_m_GhostJoins_27() { return &___m_GhostJoins_27; } inline void set_m_GhostJoins_27(List_1_t3821086104 * value) { ___m_GhostJoins_27 = value; Il2CppCodeGenWriteBarrier((&___m_GhostJoins_27), value); } inline static int32_t get_offset_of_m_UsingPolyTree_28() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_UsingPolyTree_28)); } inline bool get_m_UsingPolyTree_28() const { return ___m_UsingPolyTree_28; } inline bool* get_address_of_m_UsingPolyTree_28() { return &___m_UsingPolyTree_28; } inline void set_m_UsingPolyTree_28(bool value) { ___m_UsingPolyTree_28 = value; } inline static int32_t get_offset_of_U3CReverseSolutionU3Ek__BackingField_29() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___U3CReverseSolutionU3Ek__BackingField_29)); } inline bool get_U3CReverseSolutionU3Ek__BackingField_29() const { return ___U3CReverseSolutionU3Ek__BackingField_29; } inline bool* get_address_of_U3CReverseSolutionU3Ek__BackingField_29() { return &___U3CReverseSolutionU3Ek__BackingField_29; } inline void set_U3CReverseSolutionU3Ek__BackingField_29(bool value) { ___U3CReverseSolutionU3Ek__BackingField_29 = value; } inline static int32_t get_offset_of_U3CStrictlySimpleU3Ek__BackingField_30() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___U3CStrictlySimpleU3Ek__BackingField_30)); } inline bool get_U3CStrictlySimpleU3Ek__BackingField_30() const { return ___U3CStrictlySimpleU3Ek__BackingField_30; } inline bool* get_address_of_U3CStrictlySimpleU3Ek__BackingField_30() { return &___U3CStrictlySimpleU3Ek__BackingField_30; } inline void set_U3CStrictlySimpleU3Ek__BackingField_30(bool value) { ___U3CStrictlySimpleU3Ek__BackingField_30 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CLIPPER_T4158555122_H #ifndef VECTORTILEFEATURE_T4093669591_H #define VECTORTILEFEATURE_T4093669591_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.VectorTileFeature struct VectorTileFeature_t4093669591 : public RuntimeObject { public: // Mapbox.VectorTile.VectorTileLayer Mapbox.VectorTile.VectorTileFeature::_layer VectorTileLayer_t873169949 * ____layer_0; // System.Object Mapbox.VectorTile.VectorTileFeature::_cachedGeometry RuntimeObject * ____cachedGeometry_1; // System.Nullable`1<System.UInt32> Mapbox.VectorTile.VectorTileFeature::_clipBuffer Nullable_1_t4282624060 ____clipBuffer_2; // System.Nullable`1<System.Single> Mapbox.VectorTile.VectorTileFeature::_scale Nullable_1_t3119828856 ____scale_3; // System.Nullable`1<System.Single> Mapbox.VectorTile.VectorTileFeature::_previousScale Nullable_1_t3119828856 ____previousScale_4; // System.UInt64 Mapbox.VectorTile.VectorTileFeature::<Id>k__BackingField uint64_t ___U3CIdU3Ek__BackingField_5; // Mapbox.VectorTile.Geometry.GeomType Mapbox.VectorTile.VectorTileFeature::<GeometryType>k__BackingField int32_t ___U3CGeometryTypeU3Ek__BackingField_6; // System.Collections.Generic.List`1<System.UInt32> Mapbox.VectorTile.VectorTileFeature::<GeometryCommands>k__BackingField List_1_t4032136720 * ___U3CGeometryCommandsU3Ek__BackingField_7; // System.Collections.Generic.List`1<System.Int32> Mapbox.VectorTile.VectorTileFeature::<Tags>k__BackingField List_1_t128053199 * ___U3CTagsU3Ek__BackingField_8; public: inline static int32_t get_offset_of__layer_0() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ____layer_0)); } inline VectorTileLayer_t873169949 * get__layer_0() const { return ____layer_0; } inline VectorTileLayer_t873169949 ** get_address_of__layer_0() { return &____layer_0; } inline void set__layer_0(VectorTileLayer_t873169949 * value) { ____layer_0 = value; Il2CppCodeGenWriteBarrier((&____layer_0), value); } inline static int32_t get_offset_of__cachedGeometry_1() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ____cachedGeometry_1)); } inline RuntimeObject * get__cachedGeometry_1() const { return ____cachedGeometry_1; } inline RuntimeObject ** get_address_of__cachedGeometry_1() { return &____cachedGeometry_1; } inline void set__cachedGeometry_1(RuntimeObject * value) { ____cachedGeometry_1 = value; Il2CppCodeGenWriteBarrier((&____cachedGeometry_1), value); } inline static int32_t get_offset_of__clipBuffer_2() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ____clipBuffer_2)); } inline Nullable_1_t4282624060 get__clipBuffer_2() const { return ____clipBuffer_2; } inline Nullable_1_t4282624060 * get_address_of__clipBuffer_2() { return &____clipBuffer_2; } inline void set__clipBuffer_2(Nullable_1_t4282624060 value) { ____clipBuffer_2 = value; } inline static int32_t get_offset_of__scale_3() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ____scale_3)); } inline Nullable_1_t3119828856 get__scale_3() const { return ____scale_3; } inline Nullable_1_t3119828856 * get_address_of__scale_3() { return &____scale_3; } inline void set__scale_3(Nullable_1_t3119828856 value) { ____scale_3 = value; } inline static int32_t get_offset_of__previousScale_4() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ____previousScale_4)); } inline Nullable_1_t3119828856 get__previousScale_4() const { return ____previousScale_4; } inline Nullable_1_t3119828856 * get_address_of__previousScale_4() { return &____previousScale_4; } inline void set__previousScale_4(Nullable_1_t3119828856 value) { ____previousScale_4 = value; } inline static int32_t get_offset_of_U3CIdU3Ek__BackingField_5() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ___U3CIdU3Ek__BackingField_5)); } inline uint64_t get_U3CIdU3Ek__BackingField_5() const { return ___U3CIdU3Ek__BackingField_5; } inline uint64_t* get_address_of_U3CIdU3Ek__BackingField_5() { return &___U3CIdU3Ek__BackingField_5; } inline void set_U3CIdU3Ek__BackingField_5(uint64_t value) { ___U3CIdU3Ek__BackingField_5 = value; } inline static int32_t get_offset_of_U3CGeometryTypeU3Ek__BackingField_6() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ___U3CGeometryTypeU3Ek__BackingField_6)); } inline int32_t get_U3CGeometryTypeU3Ek__BackingField_6() const { return ___U3CGeometryTypeU3Ek__BackingField_6; } inline int32_t* get_address_of_U3CGeometryTypeU3Ek__BackingField_6() { return &___U3CGeometryTypeU3Ek__BackingField_6; } inline void set_U3CGeometryTypeU3Ek__BackingField_6(int32_t value) { ___U3CGeometryTypeU3Ek__BackingField_6 = value; } inline static int32_t get_offset_of_U3CGeometryCommandsU3Ek__BackingField_7() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ___U3CGeometryCommandsU3Ek__BackingField_7)); } inline List_1_t4032136720 * get_U3CGeometryCommandsU3Ek__BackingField_7() const { return ___U3CGeometryCommandsU3Ek__BackingField_7; } inline List_1_t4032136720 ** get_address_of_U3CGeometryCommandsU3Ek__BackingField_7() { return &___U3CGeometryCommandsU3Ek__BackingField_7; } inline void set_U3CGeometryCommandsU3Ek__BackingField_7(List_1_t4032136720 * value) { ___U3CGeometryCommandsU3Ek__BackingField_7 = value; Il2CppCodeGenWriteBarrier((&___U3CGeometryCommandsU3Ek__BackingField_7), value); } inline static int32_t get_offset_of_U3CTagsU3Ek__BackingField_8() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ___U3CTagsU3Ek__BackingField_8)); } inline List_1_t128053199 * get_U3CTagsU3Ek__BackingField_8() const { return ___U3CTagsU3Ek__BackingField_8; } inline List_1_t128053199 ** get_address_of_U3CTagsU3Ek__BackingField_8() { return &___U3CTagsU3Ek__BackingField_8; } inline void set_U3CTagsU3Ek__BackingField_8(List_1_t128053199 * value) { ___U3CTagsU3Ek__BackingField_8 = value; Il2CppCodeGenWriteBarrier((&___U3CTagsU3Ek__BackingField_8), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VECTORTILEFEATURE_T4093669591_H #ifndef POLYTREE_T3708317675_H #define POLYTREE_T3708317675_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyTree struct PolyTree_t3708317675 : public PolyNode_t1300984468 { public: // System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyTree::m_AllPolys List_1_t2773059210 * ___m_AllPolys_7; public: inline static int32_t get_offset_of_m_AllPolys_7() { return static_cast<int32_t>(offsetof(PolyTree_t3708317675, ___m_AllPolys_7)); } inline List_1_t2773059210 * get_m_AllPolys_7() const { return ___m_AllPolys_7; } inline List_1_t2773059210 ** get_address_of_m_AllPolys_7() { return &___m_AllPolys_7; } inline void set_m_AllPolys_7(List_1_t2773059210 * value) { ___m_AllPolys_7 = value; Il2CppCodeGenWriteBarrier((&___m_AllPolys_7), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // POLYTREE_T3708317675_H #ifndef MODIFIERBASE_T1320963181_H #define MODIFIERBASE_T1320963181_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Unity.MeshGeneration.Modifiers.ModifierBase struct ModifierBase_t1320963181 : public ScriptableObject_t2528358522 { public: // System.Boolean Mapbox.Unity.MeshGeneration.Modifiers.ModifierBase::Active bool ___Active_2; public: inline static int32_t get_offset_of_Active_2() { return static_cast<int32_t>(offsetof(ModifierBase_t1320963181, ___Active_2)); } inline bool get_Active_2() const { return ___Active_2; } inline bool* get_address_of_Active_2() { return &___Active_2; } inline void set_Active_2(bool value) { ___Active_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MODIFIERBASE_T1320963181_H #ifndef BEHAVIOUR_T1437897464_H #define BEHAVIOUR_T1437897464_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Behaviour struct Behaviour_t1437897464 : public Component_t1923634451 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // BEHAVIOUR_T1437897464_H #ifndef GAMEOBJECTMODIFIER_T609190006_H #define GAMEOBJECTMODIFIER_T609190006_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Unity.MeshGeneration.Modifiers.GameObjectModifier struct GameObjectModifier_t609190006 : public ModifierBase_t1320963181 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // GAMEOBJECTMODIFIER_T609190006_H #ifndef MONOBEHAVIOUR_T3962482529_H #define MONOBEHAVIOUR_T3962482529_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.MonoBehaviour struct MonoBehaviour_t3962482529 : public Behaviour_t1437897464 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MONOBEHAVIOUR_T3962482529_H #ifndef ABSTRACTALIGNMENTSTRATEGY_T2689440908_H #define ABSTRACTALIGNMENTSTRATEGY_T2689440908_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Unity.Ar.AbstractAlignmentStrategy struct AbstractAlignmentStrategy_t2689440908 : public MonoBehaviour_t3962482529 { public: // UnityEngine.Transform Mapbox.Unity.Ar.AbstractAlignmentStrategy::_transform Transform_t3600365921 * ____transform_2; public: inline static int32_t get_offset_of__transform_2() { return static_cast<int32_t>(offsetof(AbstractAlignmentStrategy_t2689440908, ____transform_2)); } inline Transform_t3600365921 * get__transform_2() const { return ____transform_2; } inline Transform_t3600365921 ** get_address_of__transform_2() { return &____transform_2; } inline void set__transform_2(Transform_t3600365921 * value) { ____transform_2 = value; Il2CppCodeGenWriteBarrier((&____transform_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ABSTRACTALIGNMENTSTRATEGY_T2689440908_H #ifndef ROTATEWITHLOCATIONPROVIDER_T2777253481_H #define ROTATEWITHLOCATIONPROVIDER_T2777253481_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.RotateWithLocationProvider struct RotateWithLocationProvider_t2777253481 : public MonoBehaviour_t3962482529 { public: // System.Single Mapbox.Examples.RotateWithLocationProvider::_rotationFollowFactor float ____rotationFollowFactor_2; // System.Boolean Mapbox.Examples.RotateWithLocationProvider::_rotateZ bool ____rotateZ_3; // System.Boolean Mapbox.Examples.RotateWithLocationProvider::_useTransformLocationProvider bool ____useTransformLocationProvider_4; // UnityEngine.Quaternion Mapbox.Examples.RotateWithLocationProvider::_targetRotation Quaternion_t2301928331 ____targetRotation_5; // Mapbox.Unity.Location.ILocationProvider Mapbox.Examples.RotateWithLocationProvider::_locationProvider RuntimeObject* ____locationProvider_6; // UnityEngine.Vector3 Mapbox.Examples.RotateWithLocationProvider::_targetPosition Vector3_t3722313464 ____targetPosition_7; public: inline static int32_t get_offset_of__rotationFollowFactor_2() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____rotationFollowFactor_2)); } inline float get__rotationFollowFactor_2() const { return ____rotationFollowFactor_2; } inline float* get_address_of__rotationFollowFactor_2() { return &____rotationFollowFactor_2; } inline void set__rotationFollowFactor_2(float value) { ____rotationFollowFactor_2 = value; } inline static int32_t get_offset_of__rotateZ_3() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____rotateZ_3)); } inline bool get__rotateZ_3() const { return ____rotateZ_3; } inline bool* get_address_of__rotateZ_3() { return &____rotateZ_3; } inline void set__rotateZ_3(bool value) { ____rotateZ_3 = value; } inline static int32_t get_offset_of__useTransformLocationProvider_4() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____useTransformLocationProvider_4)); } inline bool get__useTransformLocationProvider_4() const { return ____useTransformLocationProvider_4; } inline bool* get_address_of__useTransformLocationProvider_4() { return &____useTransformLocationProvider_4; } inline void set__useTransformLocationProvider_4(bool value) { ____useTransformLocationProvider_4 = value; } inline static int32_t get_offset_of__targetRotation_5() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____targetRotation_5)); } inline Quaternion_t2301928331 get__targetRotation_5() const { return ____targetRotation_5; } inline Quaternion_t2301928331 * get_address_of__targetRotation_5() { return &____targetRotation_5; } inline void set__targetRotation_5(Quaternion_t2301928331 value) { ____targetRotation_5 = value; } inline static int32_t get_offset_of__locationProvider_6() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____locationProvider_6)); } inline RuntimeObject* get__locationProvider_6() const { return ____locationProvider_6; } inline RuntimeObject** get_address_of__locationProvider_6() { return &____locationProvider_6; } inline void set__locationProvider_6(RuntimeObject* value) { ____locationProvider_6 = value; Il2CppCodeGenWriteBarrier((&____locationProvider_6), value); } inline static int32_t get_offset_of__targetPosition_7() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____targetPosition_7)); } inline Vector3_t3722313464 get__targetPosition_7() const { return ____targetPosition_7; } inline Vector3_t3722313464 * get_address_of__targetPosition_7() { return &____targetPosition_7; } inline void set__targetPosition_7(Vector3_t3722313464 value) { ____targetPosition_7 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ROTATEWITHLOCATIONPROVIDER_T2777253481_H #ifndef REVERSEGEOCODEUSERINPUT_T2632079094_H #define REVERSEGEOCODEUSERINPUT_T2632079094_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.ReverseGeocodeUserInput struct ReverseGeocodeUserInput_t2632079094 : public MonoBehaviour_t3962482529 { public: // UnityEngine.UI.InputField Mapbox.Examples.ReverseGeocodeUserInput::_inputField InputField_t3762917431 * ____inputField_2; // Mapbox.Geocoding.ReverseGeocodeResource Mapbox.Examples.ReverseGeocodeUserInput::_resource ReverseGeocodeResource_t2777886177 * ____resource_3; // Mapbox.Geocoding.Geocoder Mapbox.Examples.ReverseGeocodeUserInput::_geocoder Geocoder_t3195298050 * ____geocoder_4; // Mapbox.Utils.Vector2d Mapbox.Examples.ReverseGeocodeUserInput::_coordinate Vector2d_t1865246568 ____coordinate_5; // System.Boolean Mapbox.Examples.ReverseGeocodeUserInput::_hasResponse bool ____hasResponse_6; // Mapbox.Geocoding.ReverseGeocodeResponse Mapbox.Examples.ReverseGeocodeUserInput::<Response>k__BackingField ReverseGeocodeResponse_t3723437562 * ___U3CResponseU3Ek__BackingField_7; // System.EventHandler`1<System.EventArgs> Mapbox.Examples.ReverseGeocodeUserInput::OnGeocoderResponse EventHandler_1_t1515976428 * ___OnGeocoderResponse_8; public: inline static int32_t get_offset_of__inputField_2() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ____inputField_2)); } inline InputField_t3762917431 * get__inputField_2() const { return ____inputField_2; } inline InputField_t3762917431 ** get_address_of__inputField_2() { return &____inputField_2; } inline void set__inputField_2(InputField_t3762917431 * value) { ____inputField_2 = value; Il2CppCodeGenWriteBarrier((&____inputField_2), value); } inline static int32_t get_offset_of__resource_3() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ____resource_3)); } inline ReverseGeocodeResource_t2777886177 * get__resource_3() const { return ____resource_3; } inline ReverseGeocodeResource_t2777886177 ** get_address_of__resource_3() { return &____resource_3; } inline void set__resource_3(ReverseGeocodeResource_t2777886177 * value) { ____resource_3 = value; Il2CppCodeGenWriteBarrier((&____resource_3), value); } inline static int32_t get_offset_of__geocoder_4() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ____geocoder_4)); } inline Geocoder_t3195298050 * get__geocoder_4() const { return ____geocoder_4; } inline Geocoder_t3195298050 ** get_address_of__geocoder_4() { return &____geocoder_4; } inline void set__geocoder_4(Geocoder_t3195298050 * value) { ____geocoder_4 = value; Il2CppCodeGenWriteBarrier((&____geocoder_4), value); } inline static int32_t get_offset_of__coordinate_5() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ____coordinate_5)); } inline Vector2d_t1865246568 get__coordinate_5() const { return ____coordinate_5; } inline Vector2d_t1865246568 * get_address_of__coordinate_5() { return &____coordinate_5; } inline void set__coordinate_5(Vector2d_t1865246568 value) { ____coordinate_5 = value; } inline static int32_t get_offset_of__hasResponse_6() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ____hasResponse_6)); } inline bool get__hasResponse_6() const { return ____hasResponse_6; } inline bool* get_address_of__hasResponse_6() { return &____hasResponse_6; } inline void set__hasResponse_6(bool value) { ____hasResponse_6 = value; } inline static int32_t get_offset_of_U3CResponseU3Ek__BackingField_7() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ___U3CResponseU3Ek__BackingField_7)); } inline ReverseGeocodeResponse_t3723437562 * get_U3CResponseU3Ek__BackingField_7() const { return ___U3CResponseU3Ek__BackingField_7; } inline ReverseGeocodeResponse_t3723437562 ** get_address_of_U3CResponseU3Ek__BackingField_7() { return &___U3CResponseU3Ek__BackingField_7; } inline void set_U3CResponseU3Ek__BackingField_7(ReverseGeocodeResponse_t3723437562 * value) { ___U3CResponseU3Ek__BackingField_7 = value; Il2CppCodeGenWriteBarrier((&___U3CResponseU3Ek__BackingField_7), value); } inline static int32_t get_offset_of_OnGeocoderResponse_8() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ___OnGeocoderResponse_8)); } inline EventHandler_1_t1515976428 * get_OnGeocoderResponse_8() const { return ___OnGeocoderResponse_8; } inline EventHandler_1_t1515976428 ** get_address_of_OnGeocoderResponse_8() { return &___OnGeocoderResponse_8; } inline void set_OnGeocoderResponse_8(EventHandler_1_t1515976428 * value) { ___OnGeocoderResponse_8 = value; Il2CppCodeGenWriteBarrier((&___OnGeocoderResponse_8), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // REVERSEGEOCODEUSERINPUT_T2632079094_H #ifndef RELOADMAP_T3484436943_H #define RELOADMAP_T3484436943_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.ReloadMap struct ReloadMap_t3484436943 : public MonoBehaviour_t3962482529 { public: // UnityEngine.Camera Mapbox.Examples.ReloadMap::_camera Camera_t4157153871 * ____camera_2; // UnityEngine.Vector3 Mapbox.Examples.ReloadMap::_cameraStartPos Vector3_t3722313464 ____cameraStartPos_3; // Mapbox.Unity.Map.AbstractMap Mapbox.Examples.ReloadMap::_map AbstractMap_t3082917158 * ____map_4; // Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.ReloadMap::_forwardGeocoder ForwardGeocodeUserInput_t2575136032 * ____forwardGeocoder_5; // UnityEngine.UI.Slider Mapbox.Examples.ReloadMap::_zoomSlider Slider_t3903728902 * ____zoomSlider_6; // UnityEngine.Coroutine Mapbox.Examples.ReloadMap::_reloadRoutine Coroutine_t3829159415 * ____reloadRoutine_7; // UnityEngine.WaitForSeconds Mapbox.Examples.ReloadMap::_wait WaitForSeconds_t1699091251 * ____wait_8; public: inline static int32_t get_offset_of__camera_2() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____camera_2)); } inline Camera_t4157153871 * get__camera_2() const { return ____camera_2; } inline Camera_t4157153871 ** get_address_of__camera_2() { return &____camera_2; } inline void set__camera_2(Camera_t4157153871 * value) { ____camera_2 = value; Il2CppCodeGenWriteBarrier((&____camera_2), value); } inline static int32_t get_offset_of__cameraStartPos_3() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____cameraStartPos_3)); } inline Vector3_t3722313464 get__cameraStartPos_3() const { return ____cameraStartPos_3; } inline Vector3_t3722313464 * get_address_of__cameraStartPos_3() { return &____cameraStartPos_3; } inline void set__cameraStartPos_3(Vector3_t3722313464 value) { ____cameraStartPos_3 = value; } inline static int32_t get_offset_of__map_4() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____map_4)); } inline AbstractMap_t3082917158 * get__map_4() const { return ____map_4; } inline AbstractMap_t3082917158 ** get_address_of__map_4() { return &____map_4; } inline void set__map_4(AbstractMap_t3082917158 * value) { ____map_4 = value; Il2CppCodeGenWriteBarrier((&____map_4), value); } inline static int32_t get_offset_of__forwardGeocoder_5() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____forwardGeocoder_5)); } inline ForwardGeocodeUserInput_t2575136032 * get__forwardGeocoder_5() const { return ____forwardGeocoder_5; } inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__forwardGeocoder_5() { return &____forwardGeocoder_5; } inline void set__forwardGeocoder_5(ForwardGeocodeUserInput_t2575136032 * value) { ____forwardGeocoder_5 = value; Il2CppCodeGenWriteBarrier((&____forwardGeocoder_5), value); } inline static int32_t get_offset_of__zoomSlider_6() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____zoomSlider_6)); } inline Slider_t3903728902 * get__zoomSlider_6() const { return ____zoomSlider_6; } inline Slider_t3903728902 ** get_address_of__zoomSlider_6() { return &____zoomSlider_6; } inline void set__zoomSlider_6(Slider_t3903728902 * value) { ____zoomSlider_6 = value; Il2CppCodeGenWriteBarrier((&____zoomSlider_6), value); } inline static int32_t get_offset_of__reloadRoutine_7() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____reloadRoutine_7)); } inline Coroutine_t3829159415 * get__reloadRoutine_7() const { return ____reloadRoutine_7; } inline Coroutine_t3829159415 ** get_address_of__reloadRoutine_7() { return &____reloadRoutine_7; } inline void set__reloadRoutine_7(Coroutine_t3829159415 * value) { ____reloadRoutine_7 = value; Il2CppCodeGenWriteBarrier((&____reloadRoutine_7), value); } inline static int32_t get_offset_of__wait_8() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____wait_8)); } inline WaitForSeconds_t1699091251 * get__wait_8() const { return ____wait_8; } inline WaitForSeconds_t1699091251 ** get_address_of__wait_8() { return &____wait_8; } inline void set__wait_8(WaitForSeconds_t1699091251 * value) { ____wait_8 = value; Il2CppCodeGenWriteBarrier((&____wait_8), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RELOADMAP_T3484436943_H #ifndef CAMERABILLBOARD_T2325764960_H #define CAMERABILLBOARD_T2325764960_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.CameraBillboard struct CameraBillboard_t2325764960 : public MonoBehaviour_t3962482529 { public: // UnityEngine.Camera Mapbox.Examples.CameraBillboard::_camera Camera_t4157153871 * ____camera_2; public: inline static int32_t get_offset_of__camera_2() { return static_cast<int32_t>(offsetof(CameraBillboard_t2325764960, ____camera_2)); } inline Camera_t4157153871 * get__camera_2() const { return ____camera_2; } inline Camera_t4157153871 ** get_address_of__camera_2() { return &____camera_2; } inline void set__camera_2(Camera_t4157153871 * value) { ____camera_2 = value; Il2CppCodeGenWriteBarrier((&____camera_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CAMERABILLBOARD_T2325764960_H #ifndef VECTORTILEEXAMPLE_T4002429299_H #define VECTORTILEEXAMPLE_T4002429299_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Playground.VectorTileExample struct VectorTileExample_t4002429299 : public MonoBehaviour_t3962482529 { public: // Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Playground.VectorTileExample::_searchLocation ForwardGeocodeUserInput_t2575136032 * ____searchLocation_2; // UnityEngine.UI.Text Mapbox.Examples.Playground.VectorTileExample::_resultsText Text_t1901882714 * ____resultsText_3; // Mapbox.Map.Map`1<Mapbox.Map.VectorTile> Mapbox.Examples.Playground.VectorTileExample::_map Map_1_t3054239837 * ____map_4; public: inline static int32_t get_offset_of__searchLocation_2() { return static_cast<int32_t>(offsetof(VectorTileExample_t4002429299, ____searchLocation_2)); } inline ForwardGeocodeUserInput_t2575136032 * get__searchLocation_2() const { return ____searchLocation_2; } inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__searchLocation_2() { return &____searchLocation_2; } inline void set__searchLocation_2(ForwardGeocodeUserInput_t2575136032 * value) { ____searchLocation_2 = value; Il2CppCodeGenWriteBarrier((&____searchLocation_2), value); } inline static int32_t get_offset_of__resultsText_3() { return static_cast<int32_t>(offsetof(VectorTileExample_t4002429299, ____resultsText_3)); } inline Text_t1901882714 * get__resultsText_3() const { return ____resultsText_3; } inline Text_t1901882714 ** get_address_of__resultsText_3() { return &____resultsText_3; } inline void set__resultsText_3(Text_t1901882714 * value) { ____resultsText_3 = value; Il2CppCodeGenWriteBarrier((&____resultsText_3), value); } inline static int32_t get_offset_of__map_4() { return static_cast<int32_t>(offsetof(VectorTileExample_t4002429299, ____map_4)); } inline Map_1_t3054239837 * get__map_4() const { return ____map_4; } inline Map_1_t3054239837 ** get_address_of__map_4() { return &____map_4; } inline void set__map_4(Map_1_t3054239837 * value) { ____map_4 = value; Il2CppCodeGenWriteBarrier((&____map_4), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VECTORTILEEXAMPLE_T4002429299_H #ifndef REVERSEGEOCODEREXAMPLE_T1816435679_H #define REVERSEGEOCODEREXAMPLE_T1816435679_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Playground.ReverseGeocoderExample struct ReverseGeocoderExample_t1816435679 : public MonoBehaviour_t3962482529 { public: // Mapbox.Examples.ReverseGeocodeUserInput Mapbox.Examples.Playground.ReverseGeocoderExample::_searchLocation ReverseGeocodeUserInput_t2632079094 * ____searchLocation_2; // UnityEngine.UI.Text Mapbox.Examples.Playground.ReverseGeocoderExample::_resultsText Text_t1901882714 * ____resultsText_3; public: inline static int32_t get_offset_of__searchLocation_2() { return static_cast<int32_t>(offsetof(ReverseGeocoderExample_t1816435679, ____searchLocation_2)); } inline ReverseGeocodeUserInput_t2632079094 * get__searchLocation_2() const { return ____searchLocation_2; } inline ReverseGeocodeUserInput_t2632079094 ** get_address_of__searchLocation_2() { return &____searchLocation_2; } inline void set__searchLocation_2(ReverseGeocodeUserInput_t2632079094 * value) { ____searchLocation_2 = value; Il2CppCodeGenWriteBarrier((&____searchLocation_2), value); } inline static int32_t get_offset_of__resultsText_3() { return static_cast<int32_t>(offsetof(ReverseGeocoderExample_t1816435679, ____resultsText_3)); } inline Text_t1901882714 * get__resultsText_3() const { return ____resultsText_3; } inline Text_t1901882714 ** get_address_of__resultsText_3() { return &____resultsText_3; } inline void set__resultsText_3(Text_t1901882714 * value) { ____resultsText_3 = value; Il2CppCodeGenWriteBarrier((&____resultsText_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // REVERSEGEOCODEREXAMPLE_T1816435679_H #ifndef RASTERTILEEXAMPLE_T3949613556_H #define RASTERTILEEXAMPLE_T3949613556_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Playground.RasterTileExample struct RasterTileExample_t3949613556 : public MonoBehaviour_t3962482529 { public: // Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Playground.RasterTileExample::_searchLocation ForwardGeocodeUserInput_t2575136032 * ____searchLocation_2; // UnityEngine.UI.Slider Mapbox.Examples.Playground.RasterTileExample::_zoomSlider Slider_t3903728902 * ____zoomSlider_3; // UnityEngine.UI.Dropdown Mapbox.Examples.Playground.RasterTileExample::_stylesDropdown Dropdown_t2274391225 * ____stylesDropdown_4; // UnityEngine.UI.RawImage Mapbox.Examples.Playground.RasterTileExample::_imageContainer RawImage_t3182918964 * ____imageContainer_5; // Mapbox.Map.Map`1<Mapbox.Map.RasterTile> Mapbox.Examples.Playground.RasterTileExample::_map Map_1_t1665010825 * ____map_6; // System.String Mapbox.Examples.Playground.RasterTileExample::_latLon String_t* ____latLon_7; // System.String[] Mapbox.Examples.Playground.RasterTileExample::_mapboxStyles StringU5BU5D_t1281789340* ____mapboxStyles_8; // Mapbox.Utils.Vector2d Mapbox.Examples.Playground.RasterTileExample::_startLoc Vector2d_t1865246568 ____startLoc_9; // System.Int32 Mapbox.Examples.Playground.RasterTileExample::_mapstyle int32_t ____mapstyle_10; public: inline static int32_t get_offset_of__searchLocation_2() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____searchLocation_2)); } inline ForwardGeocodeUserInput_t2575136032 * get__searchLocation_2() const { return ____searchLocation_2; } inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__searchLocation_2() { return &____searchLocation_2; } inline void set__searchLocation_2(ForwardGeocodeUserInput_t2575136032 * value) { ____searchLocation_2 = value; Il2CppCodeGenWriteBarrier((&____searchLocation_2), value); } inline static int32_t get_offset_of__zoomSlider_3() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____zoomSlider_3)); } inline Slider_t3903728902 * get__zoomSlider_3() const { return ____zoomSlider_3; } inline Slider_t3903728902 ** get_address_of__zoomSlider_3() { return &____zoomSlider_3; } inline void set__zoomSlider_3(Slider_t3903728902 * value) { ____zoomSlider_3 = value; Il2CppCodeGenWriteBarrier((&____zoomSlider_3), value); } inline static int32_t get_offset_of__stylesDropdown_4() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____stylesDropdown_4)); } inline Dropdown_t2274391225 * get__stylesDropdown_4() const { return ____stylesDropdown_4; } inline Dropdown_t2274391225 ** get_address_of__stylesDropdown_4() { return &____stylesDropdown_4; } inline void set__stylesDropdown_4(Dropdown_t2274391225 * value) { ____stylesDropdown_4 = value; Il2CppCodeGenWriteBarrier((&____stylesDropdown_4), value); } inline static int32_t get_offset_of__imageContainer_5() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____imageContainer_5)); } inline RawImage_t3182918964 * get__imageContainer_5() const { return ____imageContainer_5; } inline RawImage_t3182918964 ** get_address_of__imageContainer_5() { return &____imageContainer_5; } inline void set__imageContainer_5(RawImage_t3182918964 * value) { ____imageContainer_5 = value; Il2CppCodeGenWriteBarrier((&____imageContainer_5), value); } inline static int32_t get_offset_of__map_6() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____map_6)); } inline Map_1_t1665010825 * get__map_6() const { return ____map_6; } inline Map_1_t1665010825 ** get_address_of__map_6() { return &____map_6; } inline void set__map_6(Map_1_t1665010825 * value) { ____map_6 = value; Il2CppCodeGenWriteBarrier((&____map_6), value); } inline static int32_t get_offset_of__latLon_7() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____latLon_7)); } inline String_t* get__latLon_7() const { return ____latLon_7; } inline String_t** get_address_of__latLon_7() { return &____latLon_7; } inline void set__latLon_7(String_t* value) { ____latLon_7 = value; Il2CppCodeGenWriteBarrier((&____latLon_7), value); } inline static int32_t get_offset_of__mapboxStyles_8() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____mapboxStyles_8)); } inline StringU5BU5D_t1281789340* get__mapboxStyles_8() const { return ____mapboxStyles_8; } inline StringU5BU5D_t1281789340** get_address_of__mapboxStyles_8() { return &____mapboxStyles_8; } inline void set__mapboxStyles_8(StringU5BU5D_t1281789340* value) { ____mapboxStyles_8 = value; Il2CppCodeGenWriteBarrier((&____mapboxStyles_8), value); } inline static int32_t get_offset_of__startLoc_9() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____startLoc_9)); } inline Vector2d_t1865246568 get__startLoc_9() const { return ____startLoc_9; } inline Vector2d_t1865246568 * get_address_of__startLoc_9() { return &____startLoc_9; } inline void set__startLoc_9(Vector2d_t1865246568 value) { ____startLoc_9 = value; } inline static int32_t get_offset_of__mapstyle_10() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____mapstyle_10)); } inline int32_t get__mapstyle_10() const { return ____mapstyle_10; } inline int32_t* get_address_of__mapstyle_10() { return &____mapstyle_10; } inline void set__mapstyle_10(int32_t value) { ____mapstyle_10 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RASTERTILEEXAMPLE_T3949613556_H #ifndef FORWARDGEOCODEREXAMPLE_T595455162_H #define FORWARDGEOCODEREXAMPLE_T595455162_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Playground.ForwardGeocoderExample struct ForwardGeocoderExample_t595455162 : public MonoBehaviour_t3962482529 { public: // Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Playground.ForwardGeocoderExample::_searchLocation ForwardGeocodeUserInput_t2575136032 * ____searchLocation_2; // UnityEngine.UI.Text Mapbox.Examples.Playground.ForwardGeocoderExample::_resultsText Text_t1901882714 * ____resultsText_3; public: inline static int32_t get_offset_of__searchLocation_2() { return static_cast<int32_t>(offsetof(ForwardGeocoderExample_t595455162, ____searchLocation_2)); } inline ForwardGeocodeUserInput_t2575136032 * get__searchLocation_2() const { return ____searchLocation_2; } inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__searchLocation_2() { return &____searchLocation_2; } inline void set__searchLocation_2(ForwardGeocodeUserInput_t2575136032 * value) { ____searchLocation_2 = value; Il2CppCodeGenWriteBarrier((&____searchLocation_2), value); } inline static int32_t get_offset_of__resultsText_3() { return static_cast<int32_t>(offsetof(ForwardGeocoderExample_t595455162, ____resultsText_3)); } inline Text_t1901882714 * get__resultsText_3() const { return ____resultsText_3; } inline Text_t1901882714 ** get_address_of__resultsText_3() { return &____resultsText_3; } inline void set__resultsText_3(Text_t1901882714 * value) { ____resultsText_3 = value; Il2CppCodeGenWriteBarrier((&____resultsText_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // FORWARDGEOCODEREXAMPLE_T595455162_H #ifndef DIRECTIONSEXAMPLE_T2773998098_H #define DIRECTIONSEXAMPLE_T2773998098_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Playground.DirectionsExample struct DirectionsExample_t2773998098 : public MonoBehaviour_t3962482529 { public: // UnityEngine.UI.Text Mapbox.Examples.Playground.DirectionsExample::_resultsText Text_t1901882714 * ____resultsText_2; // Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Playground.DirectionsExample::_startLocationGeocoder ForwardGeocodeUserInput_t2575136032 * ____startLocationGeocoder_3; // Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Playground.DirectionsExample::_endLocationGeocoder ForwardGeocodeUserInput_t2575136032 * ____endLocationGeocoder_4; // Mapbox.Directions.Directions Mapbox.Examples.Playground.DirectionsExample::_directions Directions_t1397515081 * ____directions_5; // Mapbox.Utils.Vector2d[] Mapbox.Examples.Playground.DirectionsExample::_coordinates Vector2dU5BU5D_t852968953* ____coordinates_6; // Mapbox.Directions.DirectionResource Mapbox.Examples.Playground.DirectionsExample::_directionResource DirectionResource_t3837219169 * ____directionResource_7; public: inline static int32_t get_offset_of__resultsText_2() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____resultsText_2)); } inline Text_t1901882714 * get__resultsText_2() const { return ____resultsText_2; } inline Text_t1901882714 ** get_address_of__resultsText_2() { return &____resultsText_2; } inline void set__resultsText_2(Text_t1901882714 * value) { ____resultsText_2 = value; Il2CppCodeGenWriteBarrier((&____resultsText_2), value); } inline static int32_t get_offset_of__startLocationGeocoder_3() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____startLocationGeocoder_3)); } inline ForwardGeocodeUserInput_t2575136032 * get__startLocationGeocoder_3() const { return ____startLocationGeocoder_3; } inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__startLocationGeocoder_3() { return &____startLocationGeocoder_3; } inline void set__startLocationGeocoder_3(ForwardGeocodeUserInput_t2575136032 * value) { ____startLocationGeocoder_3 = value; Il2CppCodeGenWriteBarrier((&____startLocationGeocoder_3), value); } inline static int32_t get_offset_of__endLocationGeocoder_4() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____endLocationGeocoder_4)); } inline ForwardGeocodeUserInput_t2575136032 * get__endLocationGeocoder_4() const { return ____endLocationGeocoder_4; } inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__endLocationGeocoder_4() { return &____endLocationGeocoder_4; } inline void set__endLocationGeocoder_4(ForwardGeocodeUserInput_t2575136032 * value) { ____endLocationGeocoder_4 = value; Il2CppCodeGenWriteBarrier((&____endLocationGeocoder_4), value); } inline static int32_t get_offset_of__directions_5() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____directions_5)); } inline Directions_t1397515081 * get__directions_5() const { return ____directions_5; } inline Directions_t1397515081 ** get_address_of__directions_5() { return &____directions_5; } inline void set__directions_5(Directions_t1397515081 * value) { ____directions_5 = value; Il2CppCodeGenWriteBarrier((&____directions_5), value); } inline static int32_t get_offset_of__coordinates_6() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____coordinates_6)); } inline Vector2dU5BU5D_t852968953* get__coordinates_6() const { return ____coordinates_6; } inline Vector2dU5BU5D_t852968953** get_address_of__coordinates_6() { return &____coordinates_6; } inline void set__coordinates_6(Vector2dU5BU5D_t852968953* value) { ____coordinates_6 = value; Il2CppCodeGenWriteBarrier((&____coordinates_6), value); } inline static int32_t get_offset_of__directionResource_7() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____directionResource_7)); } inline DirectionResource_t3837219169 * get__directionResource_7() const { return ____directionResource_7; } inline DirectionResource_t3837219169 ** get_address_of__directionResource_7() { return &____directionResource_7; } inline void set__directionResource_7(DirectionResource_t3837219169 * value) { ____directionResource_7 = value; Il2CppCodeGenWriteBarrier((&____directionResource_7), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DIRECTIONSEXAMPLE_T2773998098_H #ifndef MAPMATCHINGEXAMPLE_T325328315_H #define MAPMATCHINGEXAMPLE_T325328315_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.MapMatchingExample struct MapMatchingExample_t325328315 : public MonoBehaviour_t3962482529 { public: // Mapbox.Unity.Map.AbstractMap Mapbox.Examples.MapMatchingExample::_map AbstractMap_t3082917158 * ____map_2; // UnityEngine.LineRenderer Mapbox.Examples.MapMatchingExample::_originalRoute LineRenderer_t3154350270 * ____originalRoute_3; // UnityEngine.LineRenderer Mapbox.Examples.MapMatchingExample::_mapMatchRoute LineRenderer_t3154350270 * ____mapMatchRoute_4; // System.Boolean Mapbox.Examples.MapMatchingExample::_useTransformLocationProvider bool ____useTransformLocationProvider_5; // Mapbox.MapMatching.Profile Mapbox.Examples.MapMatchingExample::_profile int32_t ____profile_6; // System.Single Mapbox.Examples.MapMatchingExample::_lineHeight float ____lineHeight_7; // System.Collections.Generic.List`1<Mapbox.Unity.Location.Location> Mapbox.Examples.MapMatchingExample::_locations List_1_t3502158253 * ____locations_8; // Mapbox.MapMatching.MapMatcher Mapbox.Examples.MapMatchingExample::_mapMatcher MapMatcher_t3570695288 * ____mapMatcher_9; // Mapbox.Unity.Location.ILocationProvider Mapbox.Examples.MapMatchingExample::_locationProvider RuntimeObject* ____locationProvider_10; public: inline static int32_t get_offset_of__map_2() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____map_2)); } inline AbstractMap_t3082917158 * get__map_2() const { return ____map_2; } inline AbstractMap_t3082917158 ** get_address_of__map_2() { return &____map_2; } inline void set__map_2(AbstractMap_t3082917158 * value) { ____map_2 = value; Il2CppCodeGenWriteBarrier((&____map_2), value); } inline static int32_t get_offset_of__originalRoute_3() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____originalRoute_3)); } inline LineRenderer_t3154350270 * get__originalRoute_3() const { return ____originalRoute_3; } inline LineRenderer_t3154350270 ** get_address_of__originalRoute_3() { return &____originalRoute_3; } inline void set__originalRoute_3(LineRenderer_t3154350270 * value) { ____originalRoute_3 = value; Il2CppCodeGenWriteBarrier((&____originalRoute_3), value); } inline static int32_t get_offset_of__mapMatchRoute_4() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____mapMatchRoute_4)); } inline LineRenderer_t3154350270 * get__mapMatchRoute_4() const { return ____mapMatchRoute_4; } inline LineRenderer_t3154350270 ** get_address_of__mapMatchRoute_4() { return &____mapMatchRoute_4; } inline void set__mapMatchRoute_4(LineRenderer_t3154350270 * value) { ____mapMatchRoute_4 = value; Il2CppCodeGenWriteBarrier((&____mapMatchRoute_4), value); } inline static int32_t get_offset_of__useTransformLocationProvider_5() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____useTransformLocationProvider_5)); } inline bool get__useTransformLocationProvider_5() const { return ____useTransformLocationProvider_5; } inline bool* get_address_of__useTransformLocationProvider_5() { return &____useTransformLocationProvider_5; } inline void set__useTransformLocationProvider_5(bool value) { ____useTransformLocationProvider_5 = value; } inline static int32_t get_offset_of__profile_6() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____profile_6)); } inline int32_t get__profile_6() const { return ____profile_6; } inline int32_t* get_address_of__profile_6() { return &____profile_6; } inline void set__profile_6(int32_t value) { ____profile_6 = value; } inline static int32_t get_offset_of__lineHeight_7() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____lineHeight_7)); } inline float get__lineHeight_7() const { return ____lineHeight_7; } inline float* get_address_of__lineHeight_7() { return &____lineHeight_7; } inline void set__lineHeight_7(float value) { ____lineHeight_7 = value; } inline static int32_t get_offset_of__locations_8() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____locations_8)); } inline List_1_t3502158253 * get__locations_8() const { return ____locations_8; } inline List_1_t3502158253 ** get_address_of__locations_8() { return &____locations_8; } inline void set__locations_8(List_1_t3502158253 * value) { ____locations_8 = value; Il2CppCodeGenWriteBarrier((&____locations_8), value); } inline static int32_t get_offset_of__mapMatcher_9() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____mapMatcher_9)); } inline MapMatcher_t3570695288 * get__mapMatcher_9() const { return ____mapMatcher_9; } inline MapMatcher_t3570695288 ** get_address_of__mapMatcher_9() { return &____mapMatcher_9; } inline void set__mapMatcher_9(MapMatcher_t3570695288 * value) { ____mapMatcher_9 = value; Il2CppCodeGenWriteBarrier((&____mapMatcher_9), value); } inline static int32_t get_offset_of__locationProvider_10() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____locationProvider_10)); } inline RuntimeObject* get__locationProvider_10() const { return ____locationProvider_10; } inline RuntimeObject** get_address_of__locationProvider_10() { return &____locationProvider_10; } inline void set__locationProvider_10(RuntimeObject* value) { ____locationProvider_10 = value; Il2CppCodeGenWriteBarrier((&____locationProvider_10), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MAPMATCHINGEXAMPLE_T325328315_H #ifndef PLOTROUTE_T1165660348_H #define PLOTROUTE_T1165660348_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.PlotRoute struct PlotRoute_t1165660348 : public MonoBehaviour_t3962482529 { public: // UnityEngine.Transform Mapbox.Examples.PlotRoute::_target Transform_t3600365921 * ____target_2; // UnityEngine.Color Mapbox.Examples.PlotRoute::_color Color_t2555686324 ____color_3; // System.Single Mapbox.Examples.PlotRoute::_height float ____height_4; // System.Single Mapbox.Examples.PlotRoute::_lineWidth float ____lineWidth_5; // System.Single Mapbox.Examples.PlotRoute::_updateInterval float ____updateInterval_6; // System.Single Mapbox.Examples.PlotRoute::_minDistance float ____minDistance_7; // UnityEngine.LineRenderer Mapbox.Examples.PlotRoute::_lineRenderer LineRenderer_t3154350270 * ____lineRenderer_8; // System.Single Mapbox.Examples.PlotRoute::_elapsedTime float ____elapsedTime_9; // System.Int32 Mapbox.Examples.PlotRoute::_currentIndex int32_t ____currentIndex_10; // System.Single Mapbox.Examples.PlotRoute::_sqDistance float ____sqDistance_11; // UnityEngine.Vector3 Mapbox.Examples.PlotRoute::_lastPosition Vector3_t3722313464 ____lastPosition_12; // System.Boolean Mapbox.Examples.PlotRoute::_isStable bool ____isStable_13; public: inline static int32_t get_offset_of__target_2() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____target_2)); } inline Transform_t3600365921 * get__target_2() const { return ____target_2; } inline Transform_t3600365921 ** get_address_of__target_2() { return &____target_2; } inline void set__target_2(Transform_t3600365921 * value) { ____target_2 = value; Il2CppCodeGenWriteBarrier((&____target_2), value); } inline static int32_t get_offset_of__color_3() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____color_3)); } inline Color_t2555686324 get__color_3() const { return ____color_3; } inline Color_t2555686324 * get_address_of__color_3() { return &____color_3; } inline void set__color_3(Color_t2555686324 value) { ____color_3 = value; } inline static int32_t get_offset_of__height_4() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____height_4)); } inline float get__height_4() const { return ____height_4; } inline float* get_address_of__height_4() { return &____height_4; } inline void set__height_4(float value) { ____height_4 = value; } inline static int32_t get_offset_of__lineWidth_5() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____lineWidth_5)); } inline float get__lineWidth_5() const { return ____lineWidth_5; } inline float* get_address_of__lineWidth_5() { return &____lineWidth_5; } inline void set__lineWidth_5(float value) { ____lineWidth_5 = value; } inline static int32_t get_offset_of__updateInterval_6() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____updateInterval_6)); } inline float get__updateInterval_6() const { return ____updateInterval_6; } inline float* get_address_of__updateInterval_6() { return &____updateInterval_6; } inline void set__updateInterval_6(float value) { ____updateInterval_6 = value; } inline static int32_t get_offset_of__minDistance_7() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____minDistance_7)); } inline float get__minDistance_7() const { return ____minDistance_7; } inline float* get_address_of__minDistance_7() { return &____minDistance_7; } inline void set__minDistance_7(float value) { ____minDistance_7 = value; } inline static int32_t get_offset_of__lineRenderer_8() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____lineRenderer_8)); } inline LineRenderer_t3154350270 * get__lineRenderer_8() const { return ____lineRenderer_8; } inline LineRenderer_t3154350270 ** get_address_of__lineRenderer_8() { return &____lineRenderer_8; } inline void set__lineRenderer_8(LineRenderer_t3154350270 * value) { ____lineRenderer_8 = value; Il2CppCodeGenWriteBarrier((&____lineRenderer_8), value); } inline static int32_t get_offset_of__elapsedTime_9() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____elapsedTime_9)); } inline float get__elapsedTime_9() const { return ____elapsedTime_9; } inline float* get_address_of__elapsedTime_9() { return &____elapsedTime_9; } inline void set__elapsedTime_9(float value) { ____elapsedTime_9 = value; } inline static int32_t get_offset_of__currentIndex_10() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____currentIndex_10)); } inline int32_t get__currentIndex_10() const { return ____currentIndex_10; } inline int32_t* get_address_of__currentIndex_10() { return &____currentIndex_10; } inline void set__currentIndex_10(int32_t value) { ____currentIndex_10 = value; } inline static int32_t get_offset_of__sqDistance_11() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____sqDistance_11)); } inline float get__sqDistance_11() const { return ____sqDistance_11; } inline float* get_address_of__sqDistance_11() { return &____sqDistance_11; } inline void set__sqDistance_11(float value) { ____sqDistance_11 = value; } inline static int32_t get_offset_of__lastPosition_12() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____lastPosition_12)); } inline Vector3_t3722313464 get__lastPosition_12() const { return ____lastPosition_12; } inline Vector3_t3722313464 * get_address_of__lastPosition_12() { return &____lastPosition_12; } inline void set__lastPosition_12(Vector3_t3722313464 value) { ____lastPosition_12 = value; } inline static int32_t get_offset_of__isStable_13() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____isStable_13)); } inline bool get__isStable_13() const { return ____isStable_13; } inline bool* get_address_of__isStable_13() { return &____isStable_13; } inline void set__isStable_13(bool value) { ____isStable_13 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // PLOTROUTE_T1165660348_H #ifndef VOXELFETCHER_T3713644963_H #define VOXELFETCHER_T3713644963_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Voxels.VoxelFetcher struct VoxelFetcher_t3713644963 : public MonoBehaviour_t3962482529 { public: // Mapbox.Examples.Voxels.VoxelColorMapper[] Mapbox.Examples.Voxels.VoxelFetcher::_voxels VoxelColorMapperU5BU5D_t1422690960* ____voxels_2; public: inline static int32_t get_offset_of__voxels_2() { return static_cast<int32_t>(offsetof(VoxelFetcher_t3713644963, ____voxels_2)); } inline VoxelColorMapperU5BU5D_t1422690960* get__voxels_2() const { return ____voxels_2; } inline VoxelColorMapperU5BU5D_t1422690960** get_address_of__voxels_2() { return &____voxels_2; } inline void set__voxels_2(VoxelColorMapperU5BU5D_t1422690960* value) { ____voxels_2 = value; Il2CppCodeGenWriteBarrier((&____voxels_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VOXELFETCHER_T3713644963_H #ifndef VOXELTILE_T1944340880_H #define VOXELTILE_T1944340880_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Voxels.VoxelTile struct VoxelTile_t1944340880 : public MonoBehaviour_t3962482529 { public: // Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Voxels.VoxelTile::_geocodeInput ForwardGeocodeUserInput_t2575136032 * ____geocodeInput_2; // System.Int32 Mapbox.Examples.Voxels.VoxelTile::_zoom int32_t ____zoom_3; // System.Single Mapbox.Examples.Voxels.VoxelTile::_elevationMultiplier float ____elevationMultiplier_4; // System.Int32 Mapbox.Examples.Voxels.VoxelTile::_voxelDepthPadding int32_t ____voxelDepthPadding_5; // System.Int32 Mapbox.Examples.Voxels.VoxelTile::_tileWidthInVoxels int32_t ____tileWidthInVoxels_6; // Mapbox.Examples.Voxels.VoxelFetcher Mapbox.Examples.Voxels.VoxelTile::_voxelFetcher VoxelFetcher_t3713644963 * ____voxelFetcher_7; // UnityEngine.GameObject Mapbox.Examples.Voxels.VoxelTile::_camera GameObject_t1113636619 * ____camera_8; // System.Int32 Mapbox.Examples.Voxels.VoxelTile::_voxelBatchCount int32_t ____voxelBatchCount_9; // System.String Mapbox.Examples.Voxels.VoxelTile::_styleUrl String_t* ____styleUrl_10; // Mapbox.Map.Map`1<Mapbox.Map.RasterTile> Mapbox.Examples.Voxels.VoxelTile::_raster Map_1_t1665010825 * ____raster_11; // Mapbox.Map.Map`1<Mapbox.Map.RawPngRasterTile> Mapbox.Examples.Voxels.VoxelTile::_elevation Map_1_t1070764774 * ____elevation_12; // UnityEngine.Texture2D Mapbox.Examples.Voxels.VoxelTile::_rasterTexture Texture2D_t3840446185 * ____rasterTexture_13; // UnityEngine.Texture2D Mapbox.Examples.Voxels.VoxelTile::_elevationTexture Texture2D_t3840446185 * ____elevationTexture_14; // Mapbox.Platform.IFileSource Mapbox.Examples.Voxels.VoxelTile::_fileSource RuntimeObject* ____fileSource_15; // System.Collections.Generic.List`1<Mapbox.Examples.Voxels.VoxelData> Mapbox.Examples.Voxels.VoxelTile::_voxels List_1_t3720956926 * ____voxels_16; // System.Collections.Generic.List`1<UnityEngine.GameObject> Mapbox.Examples.Voxels.VoxelTile::_instantiatedVoxels List_1_t2585711361 * ____instantiatedVoxels_17; // System.Single Mapbox.Examples.Voxels.VoxelTile::_tileScale float ____tileScale_18; public: inline static int32_t get_offset_of__geocodeInput_2() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____geocodeInput_2)); } inline ForwardGeocodeUserInput_t2575136032 * get__geocodeInput_2() const { return ____geocodeInput_2; } inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__geocodeInput_2() { return &____geocodeInput_2; } inline void set__geocodeInput_2(ForwardGeocodeUserInput_t2575136032 * value) { ____geocodeInput_2 = value; Il2CppCodeGenWriteBarrier((&____geocodeInput_2), value); } inline static int32_t get_offset_of__zoom_3() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____zoom_3)); } inline int32_t get__zoom_3() const { return ____zoom_3; } inline int32_t* get_address_of__zoom_3() { return &____zoom_3; } inline void set__zoom_3(int32_t value) { ____zoom_3 = value; } inline static int32_t get_offset_of__elevationMultiplier_4() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____elevationMultiplier_4)); } inline float get__elevationMultiplier_4() const { return ____elevationMultiplier_4; } inline float* get_address_of__elevationMultiplier_4() { return &____elevationMultiplier_4; } inline void set__elevationMultiplier_4(float value) { ____elevationMultiplier_4 = value; } inline static int32_t get_offset_of__voxelDepthPadding_5() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____voxelDepthPadding_5)); } inline int32_t get__voxelDepthPadding_5() const { return ____voxelDepthPadding_5; } inline int32_t* get_address_of__voxelDepthPadding_5() { return &____voxelDepthPadding_5; } inline void set__voxelDepthPadding_5(int32_t value) { ____voxelDepthPadding_5 = value; } inline static int32_t get_offset_of__tileWidthInVoxels_6() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____tileWidthInVoxels_6)); } inline int32_t get__tileWidthInVoxels_6() const { return ____tileWidthInVoxels_6; } inline int32_t* get_address_of__tileWidthInVoxels_6() { return &____tileWidthInVoxels_6; } inline void set__tileWidthInVoxels_6(int32_t value) { ____tileWidthInVoxels_6 = value; } inline static int32_t get_offset_of__voxelFetcher_7() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____voxelFetcher_7)); } inline VoxelFetcher_t3713644963 * get__voxelFetcher_7() const { return ____voxelFetcher_7; } inline VoxelFetcher_t3713644963 ** get_address_of__voxelFetcher_7() { return &____voxelFetcher_7; } inline void set__voxelFetcher_7(VoxelFetcher_t3713644963 * value) { ____voxelFetcher_7 = value; Il2CppCodeGenWriteBarrier((&____voxelFetcher_7), value); } inline static int32_t get_offset_of__camera_8() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____camera_8)); } inline GameObject_t1113636619 * get__camera_8() const { return ____camera_8; } inline GameObject_t1113636619 ** get_address_of__camera_8() { return &____camera_8; } inline void set__camera_8(GameObject_t1113636619 * value) { ____camera_8 = value; Il2CppCodeGenWriteBarrier((&____camera_8), value); } inline static int32_t get_offset_of__voxelBatchCount_9() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____voxelBatchCount_9)); } inline int32_t get__voxelBatchCount_9() const { return ____voxelBatchCount_9; } inline int32_t* get_address_of__voxelBatchCount_9() { return &____voxelBatchCount_9; } inline void set__voxelBatchCount_9(int32_t value) { ____voxelBatchCount_9 = value; } inline static int32_t get_offset_of__styleUrl_10() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____styleUrl_10)); } inline String_t* get__styleUrl_10() const { return ____styleUrl_10; } inline String_t** get_address_of__styleUrl_10() { return &____styleUrl_10; } inline void set__styleUrl_10(String_t* value) { ____styleUrl_10 = value; Il2CppCodeGenWriteBarrier((&____styleUrl_10), value); } inline static int32_t get_offset_of__raster_11() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____raster_11)); } inline Map_1_t1665010825 * get__raster_11() const { return ____raster_11; } inline Map_1_t1665010825 ** get_address_of__raster_11() { return &____raster_11; } inline void set__raster_11(Map_1_t1665010825 * value) { ____raster_11 = value; Il2CppCodeGenWriteBarrier((&____raster_11), value); } inline static int32_t get_offset_of__elevation_12() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____elevation_12)); } inline Map_1_t1070764774 * get__elevation_12() const { return ____elevation_12; } inline Map_1_t1070764774 ** get_address_of__elevation_12() { return &____elevation_12; } inline void set__elevation_12(Map_1_t1070764774 * value) { ____elevation_12 = value; Il2CppCodeGenWriteBarrier((&____elevation_12), value); } inline static int32_t get_offset_of__rasterTexture_13() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____rasterTexture_13)); } inline Texture2D_t3840446185 * get__rasterTexture_13() const { return ____rasterTexture_13; } inline Texture2D_t3840446185 ** get_address_of__rasterTexture_13() { return &____rasterTexture_13; } inline void set__rasterTexture_13(Texture2D_t3840446185 * value) { ____rasterTexture_13 = value; Il2CppCodeGenWriteBarrier((&____rasterTexture_13), value); } inline static int32_t get_offset_of__elevationTexture_14() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____elevationTexture_14)); } inline Texture2D_t3840446185 * get__elevationTexture_14() const { return ____elevationTexture_14; } inline Texture2D_t3840446185 ** get_address_of__elevationTexture_14() { return &____elevationTexture_14; } inline void set__elevationTexture_14(Texture2D_t3840446185 * value) { ____elevationTexture_14 = value; Il2CppCodeGenWriteBarrier((&____elevationTexture_14), value); } inline static int32_t get_offset_of__fileSource_15() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____fileSource_15)); } inline RuntimeObject* get__fileSource_15() const { return ____fileSource_15; } inline RuntimeObject** get_address_of__fileSource_15() { return &____fileSource_15; } inline void set__fileSource_15(RuntimeObject* value) { ____fileSource_15 = value; Il2CppCodeGenWriteBarrier((&____fileSource_15), value); } inline static int32_t get_offset_of__voxels_16() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____voxels_16)); } inline List_1_t3720956926 * get__voxels_16() const { return ____voxels_16; } inline List_1_t3720956926 ** get_address_of__voxels_16() { return &____voxels_16; } inline void set__voxels_16(List_1_t3720956926 * value) { ____voxels_16 = value; Il2CppCodeGenWriteBarrier((&____voxels_16), value); } inline static int32_t get_offset_of__instantiatedVoxels_17() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____instantiatedVoxels_17)); } inline List_1_t2585711361 * get__instantiatedVoxels_17() const { return ____instantiatedVoxels_17; } inline List_1_t2585711361 ** get_address_of__instantiatedVoxels_17() { return &____instantiatedVoxels_17; } inline void set__instantiatedVoxels_17(List_1_t2585711361 * value) { ____instantiatedVoxels_17 = value; Il2CppCodeGenWriteBarrier((&____instantiatedVoxels_17), value); } inline static int32_t get_offset_of__tileScale_18() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____tileScale_18)); } inline float get__tileScale_18() const { return ____tileScale_18; } inline float* get_address_of__tileScale_18() { return &____tileScale_18; } inline void set__tileScale_18(float value) { ____tileScale_18 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VOXELTILE_T1944340880_H #ifndef DRAGROTATE_T2912444650_H #define DRAGROTATE_T2912444650_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.Scripts.Utilities.DragRotate struct DragRotate_t2912444650 : public MonoBehaviour_t3962482529 { public: // UnityEngine.Transform Mapbox.Examples.Scripts.Utilities.DragRotate::_objectToRotate Transform_t3600365921 * ____objectToRotate_2; // System.Single Mapbox.Examples.Scripts.Utilities.DragRotate::_multiplier float ____multiplier_3; // UnityEngine.Vector3 Mapbox.Examples.Scripts.Utilities.DragRotate::_startTouchPosition Vector3_t3722313464 ____startTouchPosition_4; public: inline static int32_t get_offset_of__objectToRotate_2() { return static_cast<int32_t>(offsetof(DragRotate_t2912444650, ____objectToRotate_2)); } inline Transform_t3600365921 * get__objectToRotate_2() const { return ____objectToRotate_2; } inline Transform_t3600365921 ** get_address_of__objectToRotate_2() { return &____objectToRotate_2; } inline void set__objectToRotate_2(Transform_t3600365921 * value) { ____objectToRotate_2 = value; Il2CppCodeGenWriteBarrier((&____objectToRotate_2), value); } inline static int32_t get_offset_of__multiplier_3() { return static_cast<int32_t>(offsetof(DragRotate_t2912444650, ____multiplier_3)); } inline float get__multiplier_3() const { return ____multiplier_3; } inline float* get_address_of__multiplier_3() { return &____multiplier_3; } inline void set__multiplier_3(float value) { ____multiplier_3 = value; } inline static int32_t get_offset_of__startTouchPosition_4() { return static_cast<int32_t>(offsetof(DragRotate_t2912444650, ____startTouchPosition_4)); } inline Vector3_t3722313464 get__startTouchPosition_4() const { return ____startTouchPosition_4; } inline Vector3_t3722313464 * get_address_of__startTouchPosition_4() { return &____startTouchPosition_4; } inline void set__startTouchPosition_4(Vector3_t3722313464 value) { ____startTouchPosition_4 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DRAGROTATE_T2912444650_H #ifndef SPAWNONGLOBEEXAMPLE_T1835218885_H #define SPAWNONGLOBEEXAMPLE_T1835218885_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.SpawnOnGlobeExample struct SpawnOnGlobeExample_t1835218885 : public MonoBehaviour_t3962482529 { public: // Mapbox.Unity.MeshGeneration.Factories.FlatSphereTerrainFactory Mapbox.Examples.SpawnOnGlobeExample::_globeFactory FlatSphereTerrainFactory_t1099794750 * ____globeFactory_2; // System.String[] Mapbox.Examples.SpawnOnGlobeExample::_locations StringU5BU5D_t1281789340* ____locations_3; // System.Single Mapbox.Examples.SpawnOnGlobeExample::_spawnScale float ____spawnScale_4; // UnityEngine.GameObject Mapbox.Examples.SpawnOnGlobeExample::_markerPrefab GameObject_t1113636619 * ____markerPrefab_5; public: inline static int32_t get_offset_of__globeFactory_2() { return static_cast<int32_t>(offsetof(SpawnOnGlobeExample_t1835218885, ____globeFactory_2)); } inline FlatSphereTerrainFactory_t1099794750 * get__globeFactory_2() const { return ____globeFactory_2; } inline FlatSphereTerrainFactory_t1099794750 ** get_address_of__globeFactory_2() { return &____globeFactory_2; } inline void set__globeFactory_2(FlatSphereTerrainFactory_t1099794750 * value) { ____globeFactory_2 = value; Il2CppCodeGenWriteBarrier((&____globeFactory_2), value); } inline static int32_t get_offset_of__locations_3() { return static_cast<int32_t>(offsetof(SpawnOnGlobeExample_t1835218885, ____locations_3)); } inline StringU5BU5D_t1281789340* get__locations_3() const { return ____locations_3; } inline StringU5BU5D_t1281789340** get_address_of__locations_3() { return &____locations_3; } inline void set__locations_3(StringU5BU5D_t1281789340* value) { ____locations_3 = value; Il2CppCodeGenWriteBarrier((&____locations_3), value); } inline static int32_t get_offset_of__spawnScale_4() { return static_cast<int32_t>(offsetof(SpawnOnGlobeExample_t1835218885, ____spawnScale_4)); } inline float get__spawnScale_4() const { return ____spawnScale_4; } inline float* get_address_of__spawnScale_4() { return &____spawnScale_4; } inline void set__spawnScale_4(float value) { ____spawnScale_4 = value; } inline static int32_t get_offset_of__markerPrefab_5() { return static_cast<int32_t>(offsetof(SpawnOnGlobeExample_t1835218885, ____markerPrefab_5)); } inline GameObject_t1113636619 * get__markerPrefab_5() const { return ____markerPrefab_5; } inline GameObject_t1113636619 ** get_address_of__markerPrefab_5() { return &____markerPrefab_5; } inline void set__markerPrefab_5(GameObject_t1113636619 * value) { ____markerPrefab_5 = value; Il2CppCodeGenWriteBarrier((&____markerPrefab_5), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SPAWNONGLOBEEXAMPLE_T1835218885_H #ifndef CAMERAMOVEMENT_T3562026478_H #define CAMERAMOVEMENT_T3562026478_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.CameraMovement struct CameraMovement_t3562026478 : public MonoBehaviour_t3962482529 { public: // System.Single Mapbox.Examples.CameraMovement::_panSpeed float ____panSpeed_2; // System.Single Mapbox.Examples.CameraMovement::_zoomSpeed float ____zoomSpeed_3; // UnityEngine.Camera Mapbox.Examples.CameraMovement::_referenceCamera Camera_t4157153871 * ____referenceCamera_4; // UnityEngine.Quaternion Mapbox.Examples.CameraMovement::_originalRotation Quaternion_t2301928331 ____originalRotation_5; // UnityEngine.Vector3 Mapbox.Examples.CameraMovement::_origin Vector3_t3722313464 ____origin_6; // UnityEngine.Vector3 Mapbox.Examples.CameraMovement::_delta Vector3_t3722313464 ____delta_7; // System.Boolean Mapbox.Examples.CameraMovement::_shouldDrag bool ____shouldDrag_8; public: inline static int32_t get_offset_of__panSpeed_2() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____panSpeed_2)); } inline float get__panSpeed_2() const { return ____panSpeed_2; } inline float* get_address_of__panSpeed_2() { return &____panSpeed_2; } inline void set__panSpeed_2(float value) { ____panSpeed_2 = value; } inline static int32_t get_offset_of__zoomSpeed_3() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____zoomSpeed_3)); } inline float get__zoomSpeed_3() const { return ____zoomSpeed_3; } inline float* get_address_of__zoomSpeed_3() { return &____zoomSpeed_3; } inline void set__zoomSpeed_3(float value) { ____zoomSpeed_3 = value; } inline static int32_t get_offset_of__referenceCamera_4() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____referenceCamera_4)); } inline Camera_t4157153871 * get__referenceCamera_4() const { return ____referenceCamera_4; } inline Camera_t4157153871 ** get_address_of__referenceCamera_4() { return &____referenceCamera_4; } inline void set__referenceCamera_4(Camera_t4157153871 * value) { ____referenceCamera_4 = value; Il2CppCodeGenWriteBarrier((&____referenceCamera_4), value); } inline static int32_t get_offset_of__originalRotation_5() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____originalRotation_5)); } inline Quaternion_t2301928331 get__originalRotation_5() const { return ____originalRotation_5; } inline Quaternion_t2301928331 * get_address_of__originalRotation_5() { return &____originalRotation_5; } inline void set__originalRotation_5(Quaternion_t2301928331 value) { ____originalRotation_5 = value; } inline static int32_t get_offset_of__origin_6() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____origin_6)); } inline Vector3_t3722313464 get__origin_6() const { return ____origin_6; } inline Vector3_t3722313464 * get_address_of__origin_6() { return &____origin_6; } inline void set__origin_6(Vector3_t3722313464 value) { ____origin_6 = value; } inline static int32_t get_offset_of__delta_7() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____delta_7)); } inline Vector3_t3722313464 get__delta_7() const { return ____delta_7; } inline Vector3_t3722313464 * get_address_of__delta_7() { return &____delta_7; } inline void set__delta_7(Vector3_t3722313464 value) { ____delta_7 = value; } inline static int32_t get_offset_of__shouldDrag_8() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____shouldDrag_8)); } inline bool get__shouldDrag_8() const { return ____shouldDrag_8; } inline bool* get_address_of__shouldDrag_8() { return &____shouldDrag_8; } inline void set__shouldDrag_8(bool value) { ____shouldDrag_8 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CAMERAMOVEMENT_T3562026478_H #ifndef LOADINGPANELCONTROLLER_T2494933297_H #define LOADINGPANELCONTROLLER_T2494933297_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.LoadingPanelController struct LoadingPanelController_t2494933297 : public MonoBehaviour_t3962482529 { public: // UnityEngine.GameObject Mapbox.Examples.LoadingPanelController::_content GameObject_t1113636619 * ____content_2; // UnityEngine.UI.Text Mapbox.Examples.LoadingPanelController::_text Text_t1901882714 * ____text_3; // UnityEngine.AnimationCurve Mapbox.Examples.LoadingPanelController::_curve AnimationCurve_t3046754366 * ____curve_4; public: inline static int32_t get_offset_of__content_2() { return static_cast<int32_t>(offsetof(LoadingPanelController_t2494933297, ____content_2)); } inline GameObject_t1113636619 * get__content_2() const { return ____content_2; } inline GameObject_t1113636619 ** get_address_of__content_2() { return &____content_2; } inline void set__content_2(GameObject_t1113636619 * value) { ____content_2 = value; Il2CppCodeGenWriteBarrier((&____content_2), value); } inline static int32_t get_offset_of__text_3() { return static_cast<int32_t>(offsetof(LoadingPanelController_t2494933297, ____text_3)); } inline Text_t1901882714 * get__text_3() const { return ____text_3; } inline Text_t1901882714 ** get_address_of__text_3() { return &____text_3; } inline void set__text_3(Text_t1901882714 * value) { ____text_3 = value; Il2CppCodeGenWriteBarrier((&____text_3), value); } inline static int32_t get_offset_of__curve_4() { return static_cast<int32_t>(offsetof(LoadingPanelController_t2494933297, ____curve_4)); } inline AnimationCurve_t3046754366 * get__curve_4() const { return ____curve_4; } inline AnimationCurve_t3046754366 ** get_address_of__curve_4() { return &____curve_4; } inline void set__curve_4(AnimationCurve_t3046754366 * value) { ____curve_4 = value; Il2CppCodeGenWriteBarrier((&____curve_4), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LOADINGPANELCONTROLLER_T2494933297_H #ifndef MAKIHELPER_T3260814930_H #define MAKIHELPER_T3260814930_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.MakiHelper struct MakiHelper_t3260814930 : public MonoBehaviour_t3962482529 { public: // UnityEngine.GameObject Mapbox.Examples.MakiHelper::_uiObject GameObject_t1113636619 * ____uiObject_4; public: inline static int32_t get_offset_of__uiObject_4() { return static_cast<int32_t>(offsetof(MakiHelper_t3260814930, ____uiObject_4)); } inline GameObject_t1113636619 * get__uiObject_4() const { return ____uiObject_4; } inline GameObject_t1113636619 ** get_address_of__uiObject_4() { return &____uiObject_4; } inline void set__uiObject_4(GameObject_t1113636619 * value) { ____uiObject_4 = value; Il2CppCodeGenWriteBarrier((&____uiObject_4), value); } }; struct MakiHelper_t3260814930_StaticFields { public: // UnityEngine.RectTransform Mapbox.Examples.MakiHelper::Parent RectTransform_t3704657025 * ___Parent_2; // UnityEngine.GameObject Mapbox.Examples.MakiHelper::UiPrefab GameObject_t1113636619 * ___UiPrefab_3; public: inline static int32_t get_offset_of_Parent_2() { return static_cast<int32_t>(offsetof(MakiHelper_t3260814930_StaticFields, ___Parent_2)); } inline RectTransform_t3704657025 * get_Parent_2() const { return ___Parent_2; } inline RectTransform_t3704657025 ** get_address_of_Parent_2() { return &___Parent_2; } inline void set_Parent_2(RectTransform_t3704657025 * value) { ___Parent_2 = value; Il2CppCodeGenWriteBarrier((&___Parent_2), value); } inline static int32_t get_offset_of_UiPrefab_3() { return static_cast<int32_t>(offsetof(MakiHelper_t3260814930_StaticFields, ___UiPrefab_3)); } inline GameObject_t1113636619 * get_UiPrefab_3() const { return ___UiPrefab_3; } inline GameObject_t1113636619 ** get_address_of_UiPrefab_3() { return &___UiPrefab_3; } inline void set_UiPrefab_3(GameObject_t1113636619 * value) { ___UiPrefab_3 = value; Il2CppCodeGenWriteBarrier((&___UiPrefab_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MAKIHELPER_T3260814930_H #ifndef OBJECTINSPECTORMODIFIER_T3950592485_H #define OBJECTINSPECTORMODIFIER_T3950592485_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.ObjectInspectorModifier struct ObjectInspectorModifier_t3950592485 : public GameObjectModifier_t609190006 { public: // System.Collections.Generic.Dictionary`2<UnityEngine.GameObject,Mapbox.Examples.FeatureSelectionDetector> Mapbox.Examples.ObjectInspectorModifier::_detectors Dictionary_2_t2340548174 * ____detectors_3; // Mapbox.Examples.FeatureUiMarker Mapbox.Examples.ObjectInspectorModifier::_marker FeatureUiMarker_t3847499068 * ____marker_4; // Mapbox.Examples.FeatureSelectionDetector Mapbox.Examples.ObjectInspectorModifier::_tempDetector FeatureSelectionDetector_t508482069 * ____tempDetector_5; public: inline static int32_t get_offset_of__detectors_3() { return static_cast<int32_t>(offsetof(ObjectInspectorModifier_t3950592485, ____detectors_3)); } inline Dictionary_2_t2340548174 * get__detectors_3() const { return ____detectors_3; } inline Dictionary_2_t2340548174 ** get_address_of__detectors_3() { return &____detectors_3; } inline void set__detectors_3(Dictionary_2_t2340548174 * value) { ____detectors_3 = value; Il2CppCodeGenWriteBarrier((&____detectors_3), value); } inline static int32_t get_offset_of__marker_4() { return static_cast<int32_t>(offsetof(ObjectInspectorModifier_t3950592485, ____marker_4)); } inline FeatureUiMarker_t3847499068 * get__marker_4() const { return ____marker_4; } inline FeatureUiMarker_t3847499068 ** get_address_of__marker_4() { return &____marker_4; } inline void set__marker_4(FeatureUiMarker_t3847499068 * value) { ____marker_4 = value; Il2CppCodeGenWriteBarrier((&____marker_4), value); } inline static int32_t get_offset_of__tempDetector_5() { return static_cast<int32_t>(offsetof(ObjectInspectorModifier_t3950592485, ____tempDetector_5)); } inline FeatureSelectionDetector_t508482069 * get__tempDetector_5() const { return ____tempDetector_5; } inline FeatureSelectionDetector_t508482069 ** get_address_of__tempDetector_5() { return &____tempDetector_5; } inline void set__tempDetector_5(FeatureSelectionDetector_t508482069 * value) { ____tempDetector_5 = value; Il2CppCodeGenWriteBarrier((&____tempDetector_5), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // OBJECTINSPECTORMODIFIER_T3950592485_H #ifndef POIMARKERHELPER_T575496201_H #define POIMARKERHELPER_T575496201_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.PoiMarkerHelper struct PoiMarkerHelper_t575496201 : public MonoBehaviour_t3962482529 { public: // System.Collections.Generic.Dictionary`2<System.String,System.Object> Mapbox.Examples.PoiMarkerHelper::_props Dictionary_2_t2865362463 * ____props_2; public: inline static int32_t get_offset_of__props_2() { return static_cast<int32_t>(offsetof(PoiMarkerHelper_t575496201, ____props_2)); } inline Dictionary_2_t2865362463 * get__props_2() const { return ____props_2; } inline Dictionary_2_t2865362463 ** get_address_of__props_2() { return &____props_2; } inline void set__props_2(Dictionary_2_t2865362463 * value) { ____props_2 = value; Il2CppCodeGenWriteBarrier((&____props_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // POIMARKERHELPER_T575496201_H #ifndef POSITIONWITHLOCATIONPROVIDER_T2078499108_H #define POSITIONWITHLOCATIONPROVIDER_T2078499108_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.PositionWithLocationProvider struct PositionWithLocationProvider_t2078499108 : public MonoBehaviour_t3962482529 { public: // Mapbox.Unity.Map.AbstractMap Mapbox.Examples.PositionWithLocationProvider::_map AbstractMap_t3082917158 * ____map_2; // System.Single Mapbox.Examples.PositionWithLocationProvider::_positionFollowFactor float ____positionFollowFactor_3; // System.Boolean Mapbox.Examples.PositionWithLocationProvider::_useTransformLocationProvider bool ____useTransformLocationProvider_4; // System.Boolean Mapbox.Examples.PositionWithLocationProvider::_isInitialized bool ____isInitialized_5; // Mapbox.Unity.Location.ILocationProvider Mapbox.Examples.PositionWithLocationProvider::_locationProvider RuntimeObject* ____locationProvider_6; // UnityEngine.Vector3 Mapbox.Examples.PositionWithLocationProvider::_targetPosition Vector3_t3722313464 ____targetPosition_7; public: inline static int32_t get_offset_of__map_2() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____map_2)); } inline AbstractMap_t3082917158 * get__map_2() const { return ____map_2; } inline AbstractMap_t3082917158 ** get_address_of__map_2() { return &____map_2; } inline void set__map_2(AbstractMap_t3082917158 * value) { ____map_2 = value; Il2CppCodeGenWriteBarrier((&____map_2), value); } inline static int32_t get_offset_of__positionFollowFactor_3() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____positionFollowFactor_3)); } inline float get__positionFollowFactor_3() const { return ____positionFollowFactor_3; } inline float* get_address_of__positionFollowFactor_3() { return &____positionFollowFactor_3; } inline void set__positionFollowFactor_3(float value) { ____positionFollowFactor_3 = value; } inline static int32_t get_offset_of__useTransformLocationProvider_4() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____useTransformLocationProvider_4)); } inline bool get__useTransformLocationProvider_4() const { return ____useTransformLocationProvider_4; } inline bool* get_address_of__useTransformLocationProvider_4() { return &____useTransformLocationProvider_4; } inline void set__useTransformLocationProvider_4(bool value) { ____useTransformLocationProvider_4 = value; } inline static int32_t get_offset_of__isInitialized_5() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____isInitialized_5)); } inline bool get__isInitialized_5() const { return ____isInitialized_5; } inline bool* get_address_of__isInitialized_5() { return &____isInitialized_5; } inline void set__isInitialized_5(bool value) { ____isInitialized_5 = value; } inline static int32_t get_offset_of__locationProvider_6() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____locationProvider_6)); } inline RuntimeObject* get__locationProvider_6() const { return ____locationProvider_6; } inline RuntimeObject** get_address_of__locationProvider_6() { return &____locationProvider_6; } inline void set__locationProvider_6(RuntimeObject* value) { ____locationProvider_6 = value; Il2CppCodeGenWriteBarrier((&____locationProvider_6), value); } inline static int32_t get_offset_of__targetPosition_7() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____targetPosition_7)); } inline Vector3_t3722313464 get__targetPosition_7() const { return ____targetPosition_7; } inline Vector3_t3722313464 * get_address_of__targetPosition_7() { return &____targetPosition_7; } inline void set__targetPosition_7(Vector3_t3722313464 value) { ____targetPosition_7 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // POSITIONWITHLOCATIONPROVIDER_T2078499108_H #ifndef QUADTREECAMERAMOVEMENT_T4261193325_H #define QUADTREECAMERAMOVEMENT_T4261193325_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.QuadTreeCameraMovement struct QuadTreeCameraMovement_t4261193325 : public MonoBehaviour_t3962482529 { public: // System.Single Mapbox.Examples.QuadTreeCameraMovement::_panSpeed float ____panSpeed_2; // System.Single Mapbox.Examples.QuadTreeCameraMovement::_zoomSpeed float ____zoomSpeed_3; // UnityEngine.Camera Mapbox.Examples.QuadTreeCameraMovement::_referenceCamera Camera_t4157153871 * ____referenceCamera_4; // Mapbox.Unity.Map.QuadTreeTileProvider Mapbox.Examples.QuadTreeCameraMovement::_quadTreeTileProvider QuadTreeTileProvider_t3777865694 * ____quadTreeTileProvider_5; // Mapbox.Unity.Map.AbstractMap Mapbox.Examples.QuadTreeCameraMovement::_dynamicZoomMap AbstractMap_t3082917158 * ____dynamicZoomMap_6; // System.Boolean Mapbox.Examples.QuadTreeCameraMovement::_useDegreeMethod bool ____useDegreeMethod_7; // UnityEngine.Vector3 Mapbox.Examples.QuadTreeCameraMovement::_origin Vector3_t3722313464 ____origin_8; // UnityEngine.Vector3 Mapbox.Examples.QuadTreeCameraMovement::_mousePosition Vector3_t3722313464 ____mousePosition_9; // UnityEngine.Vector3 Mapbox.Examples.QuadTreeCameraMovement::_mousePositionPrevious Vector3_t3722313464 ____mousePositionPrevious_10; // System.Boolean Mapbox.Examples.QuadTreeCameraMovement::_shouldDrag bool ____shouldDrag_11; public: inline static int32_t get_offset_of__panSpeed_2() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____panSpeed_2)); } inline float get__panSpeed_2() const { return ____panSpeed_2; } inline float* get_address_of__panSpeed_2() { return &____panSpeed_2; } inline void set__panSpeed_2(float value) { ____panSpeed_2 = value; } inline static int32_t get_offset_of__zoomSpeed_3() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____zoomSpeed_3)); } inline float get__zoomSpeed_3() const { return ____zoomSpeed_3; } inline float* get_address_of__zoomSpeed_3() { return &____zoomSpeed_3; } inline void set__zoomSpeed_3(float value) { ____zoomSpeed_3 = value; } inline static int32_t get_offset_of__referenceCamera_4() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____referenceCamera_4)); } inline Camera_t4157153871 * get__referenceCamera_4() const { return ____referenceCamera_4; } inline Camera_t4157153871 ** get_address_of__referenceCamera_4() { return &____referenceCamera_4; } inline void set__referenceCamera_4(Camera_t4157153871 * value) { ____referenceCamera_4 = value; Il2CppCodeGenWriteBarrier((&____referenceCamera_4), value); } inline static int32_t get_offset_of__quadTreeTileProvider_5() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____quadTreeTileProvider_5)); } inline QuadTreeTileProvider_t3777865694 * get__quadTreeTileProvider_5() const { return ____quadTreeTileProvider_5; } inline QuadTreeTileProvider_t3777865694 ** get_address_of__quadTreeTileProvider_5() { return &____quadTreeTileProvider_5; } inline void set__quadTreeTileProvider_5(QuadTreeTileProvider_t3777865694 * value) { ____quadTreeTileProvider_5 = value; Il2CppCodeGenWriteBarrier((&____quadTreeTileProvider_5), value); } inline static int32_t get_offset_of__dynamicZoomMap_6() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____dynamicZoomMap_6)); } inline AbstractMap_t3082917158 * get__dynamicZoomMap_6() const { return ____dynamicZoomMap_6; } inline AbstractMap_t3082917158 ** get_address_of__dynamicZoomMap_6() { return &____dynamicZoomMap_6; } inline void set__dynamicZoomMap_6(AbstractMap_t3082917158 * value) { ____dynamicZoomMap_6 = value; Il2CppCodeGenWriteBarrier((&____dynamicZoomMap_6), value); } inline static int32_t get_offset_of__useDegreeMethod_7() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____useDegreeMethod_7)); } inline bool get__useDegreeMethod_7() const { return ____useDegreeMethod_7; } inline bool* get_address_of__useDegreeMethod_7() { return &____useDegreeMethod_7; } inline void set__useDegreeMethod_7(bool value) { ____useDegreeMethod_7 = value; } inline static int32_t get_offset_of__origin_8() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____origin_8)); } inline Vector3_t3722313464 get__origin_8() const { return ____origin_8; } inline Vector3_t3722313464 * get_address_of__origin_8() { return &____origin_8; } inline void set__origin_8(Vector3_t3722313464 value) { ____origin_8 = value; } inline static int32_t get_offset_of__mousePosition_9() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____mousePosition_9)); } inline Vector3_t3722313464 get__mousePosition_9() const { return ____mousePosition_9; } inline Vector3_t3722313464 * get_address_of__mousePosition_9() { return &____mousePosition_9; } inline void set__mousePosition_9(Vector3_t3722313464 value) { ____mousePosition_9 = value; } inline static int32_t get_offset_of__mousePositionPrevious_10() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____mousePositionPrevious_10)); } inline Vector3_t3722313464 get__mousePositionPrevious_10() const { return ____mousePositionPrevious_10; } inline Vector3_t3722313464 * get_address_of__mousePositionPrevious_10() { return &____mousePositionPrevious_10; } inline void set__mousePositionPrevious_10(Vector3_t3722313464 value) { ____mousePositionPrevious_10 = value; } inline static int32_t get_offset_of__shouldDrag_11() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____shouldDrag_11)); } inline bool get__shouldDrag_11() const { return ____shouldDrag_11; } inline bool* get_address_of__shouldDrag_11() { return &____shouldDrag_11; } inline void set__shouldDrag_11(bool value) { ____shouldDrag_11 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // QUADTREECAMERAMOVEMENT_T4261193325_H #ifndef LABELTEXTSETTER_T2340976267_H #define LABELTEXTSETTER_T2340976267_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.LabelTextSetter struct LabelTextSetter_t2340976267 : public MonoBehaviour_t3962482529 { public: // UnityEngine.TextMesh Mapbox.Examples.LabelTextSetter::_textMesh TextMesh_t1536577757 * ____textMesh_2; public: inline static int32_t get_offset_of__textMesh_2() { return static_cast<int32_t>(offsetof(LabelTextSetter_t2340976267, ____textMesh_2)); } inline TextMesh_t1536577757 * get__textMesh_2() const { return ____textMesh_2; } inline TextMesh_t1536577757 ** get_address_of__textMesh_2() { return &____textMesh_2; } inline void set__textMesh_2(TextMesh_t1536577757 * value) { ____textMesh_2 = value; Il2CppCodeGenWriteBarrier((&____textMesh_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LABELTEXTSETTER_T2340976267_H #ifndef CHANGESHADOWDISTANCE_T4294610605_H #define CHANGESHADOWDISTANCE_T4294610605_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.ChangeShadowDistance struct ChangeShadowDistance_t4294610605 : public MonoBehaviour_t3962482529 { public: // System.Int32 Mapbox.Examples.ChangeShadowDistance::ShadowDistance int32_t ___ShadowDistance_2; public: inline static int32_t get_offset_of_ShadowDistance_2() { return static_cast<int32_t>(offsetof(ChangeShadowDistance_t4294610605, ___ShadowDistance_2)); } inline int32_t get_ShadowDistance_2() const { return ___ShadowDistance_2; } inline int32_t* get_address_of_ShadowDistance_2() { return &___ShadowDistance_2; } inline void set_ShadowDistance_2(int32_t value) { ___ShadowDistance_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CHANGESHADOWDISTANCE_T4294610605_H #ifndef FEATURESELECTIONDETECTOR_T508482069_H #define FEATURESELECTIONDETECTOR_T508482069_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.FeatureSelectionDetector struct FeatureSelectionDetector_t508482069 : public MonoBehaviour_t3962482529 { public: // Mapbox.Examples.FeatureUiMarker Mapbox.Examples.FeatureSelectionDetector::_marker FeatureUiMarker_t3847499068 * ____marker_2; // VectorEntity Mapbox.Examples.FeatureSelectionDetector::_feature VectorEntity_t1410759464 * ____feature_3; public: inline static int32_t get_offset_of__marker_2() { return static_cast<int32_t>(offsetof(FeatureSelectionDetector_t508482069, ____marker_2)); } inline FeatureUiMarker_t3847499068 * get__marker_2() const { return ____marker_2; } inline FeatureUiMarker_t3847499068 ** get_address_of__marker_2() { return &____marker_2; } inline void set__marker_2(FeatureUiMarker_t3847499068 * value) { ____marker_2 = value; Il2CppCodeGenWriteBarrier((&____marker_2), value); } inline static int32_t get_offset_of__feature_3() { return static_cast<int32_t>(offsetof(FeatureSelectionDetector_t508482069, ____feature_3)); } inline VectorEntity_t1410759464 * get__feature_3() const { return ____feature_3; } inline VectorEntity_t1410759464 ** get_address_of__feature_3() { return &____feature_3; } inline void set__feature_3(VectorEntity_t1410759464 * value) { ____feature_3 = value; Il2CppCodeGenWriteBarrier((&____feature_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // FEATURESELECTIONDETECTOR_T508482069_H #ifndef FEATUREUIMARKER_T3847499068_H #define FEATUREUIMARKER_T3847499068_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.FeatureUiMarker struct FeatureUiMarker_t3847499068 : public MonoBehaviour_t3962482529 { public: // UnityEngine.Transform Mapbox.Examples.FeatureUiMarker::_wrapperMarker Transform_t3600365921 * ____wrapperMarker_2; // UnityEngine.Transform Mapbox.Examples.FeatureUiMarker::_infoPanel Transform_t3600365921 * ____infoPanel_3; // UnityEngine.UI.Text Mapbox.Examples.FeatureUiMarker::_info Text_t1901882714 * ____info_4; // UnityEngine.Vector3[] Mapbox.Examples.FeatureUiMarker::_targetVerts Vector3U5BU5D_t1718750761* ____targetVerts_5; // VectorEntity Mapbox.Examples.FeatureUiMarker::_selectedFeature VectorEntity_t1410759464 * ____selectedFeature_6; public: inline static int32_t get_offset_of__wrapperMarker_2() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068, ____wrapperMarker_2)); } inline Transform_t3600365921 * get__wrapperMarker_2() const { return ____wrapperMarker_2; } inline Transform_t3600365921 ** get_address_of__wrapperMarker_2() { return &____wrapperMarker_2; } inline void set__wrapperMarker_2(Transform_t3600365921 * value) { ____wrapperMarker_2 = value; Il2CppCodeGenWriteBarrier((&____wrapperMarker_2), value); } inline static int32_t get_offset_of__infoPanel_3() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068, ____infoPanel_3)); } inline Transform_t3600365921 * get__infoPanel_3() const { return ____infoPanel_3; } inline Transform_t3600365921 ** get_address_of__infoPanel_3() { return &____infoPanel_3; } inline void set__infoPanel_3(Transform_t3600365921 * value) { ____infoPanel_3 = value; Il2CppCodeGenWriteBarrier((&____infoPanel_3), value); } inline static int32_t get_offset_of__info_4() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068, ____info_4)); } inline Text_t1901882714 * get__info_4() const { return ____info_4; } inline Text_t1901882714 ** get_address_of__info_4() { return &____info_4; } inline void set__info_4(Text_t1901882714 * value) { ____info_4 = value; Il2CppCodeGenWriteBarrier((&____info_4), value); } inline static int32_t get_offset_of__targetVerts_5() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068, ____targetVerts_5)); } inline Vector3U5BU5D_t1718750761* get__targetVerts_5() const { return ____targetVerts_5; } inline Vector3U5BU5D_t1718750761** get_address_of__targetVerts_5() { return &____targetVerts_5; } inline void set__targetVerts_5(Vector3U5BU5D_t1718750761* value) { ____targetVerts_5 = value; Il2CppCodeGenWriteBarrier((&____targetVerts_5), value); } inline static int32_t get_offset_of__selectedFeature_6() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068, ____selectedFeature_6)); } inline VectorEntity_t1410759464 * get__selectedFeature_6() const { return ____selectedFeature_6; } inline VectorEntity_t1410759464 ** get_address_of__selectedFeature_6() { return &____selectedFeature_6; } inline void set__selectedFeature_6(VectorEntity_t1410759464 * value) { ____selectedFeature_6 = value; Il2CppCodeGenWriteBarrier((&____selectedFeature_6), value); } }; struct FeatureUiMarker_t3847499068_StaticFields { public: // System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Object>,System.String> Mapbox.Examples.FeatureUiMarker::<>f__am$cache0 Func_2_t268983481 * ___U3CU3Ef__amU24cache0_7; public: inline static int32_t get_offset_of_U3CU3Ef__amU24cache0_7() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068_StaticFields, ___U3CU3Ef__amU24cache0_7)); } inline Func_2_t268983481 * get_U3CU3Ef__amU24cache0_7() const { return ___U3CU3Ef__amU24cache0_7; } inline Func_2_t268983481 ** get_address_of_U3CU3Ef__amU24cache0_7() { return &___U3CU3Ef__amU24cache0_7; } inline void set_U3CU3Ef__amU24cache0_7(Func_2_t268983481 * value) { ___U3CU3Ef__amU24cache0_7 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache0_7), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // FEATUREUIMARKER_T3847499068_H #ifndef FORWARDGEOCODEUSERINPUT_T2575136032_H #define FORWARDGEOCODEUSERINPUT_T2575136032_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.ForwardGeocodeUserInput struct ForwardGeocodeUserInput_t2575136032 : public MonoBehaviour_t3962482529 { public: // UnityEngine.UI.InputField Mapbox.Examples.ForwardGeocodeUserInput::_inputField InputField_t3762917431 * ____inputField_2; // Mapbox.Geocoding.ForwardGeocodeResource Mapbox.Examples.ForwardGeocodeUserInput::_resource ForwardGeocodeResource_t367023433 * ____resource_3; // Mapbox.Utils.Vector2d Mapbox.Examples.ForwardGeocodeUserInput::_coordinate Vector2d_t1865246568 ____coordinate_4; // System.Boolean Mapbox.Examples.ForwardGeocodeUserInput::_hasResponse bool ____hasResponse_5; // Mapbox.Geocoding.ForwardGeocodeResponse Mapbox.Examples.ForwardGeocodeUserInput::<Response>k__BackingField ForwardGeocodeResponse_t2959476828 * ___U3CResponseU3Ek__BackingField_6; // System.Action`1<Mapbox.Geocoding.ForwardGeocodeResponse> Mapbox.Examples.ForwardGeocodeUserInput::OnGeocoderResponse Action_1_t3131944423 * ___OnGeocoderResponse_7; public: inline static int32_t get_offset_of__inputField_2() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ____inputField_2)); } inline InputField_t3762917431 * get__inputField_2() const { return ____inputField_2; } inline InputField_t3762917431 ** get_address_of__inputField_2() { return &____inputField_2; } inline void set__inputField_2(InputField_t3762917431 * value) { ____inputField_2 = value; Il2CppCodeGenWriteBarrier((&____inputField_2), value); } inline static int32_t get_offset_of__resource_3() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ____resource_3)); } inline ForwardGeocodeResource_t367023433 * get__resource_3() const { return ____resource_3; } inline ForwardGeocodeResource_t367023433 ** get_address_of__resource_3() { return &____resource_3; } inline void set__resource_3(ForwardGeocodeResource_t367023433 * value) { ____resource_3 = value; Il2CppCodeGenWriteBarrier((&____resource_3), value); } inline static int32_t get_offset_of__coordinate_4() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ____coordinate_4)); } inline Vector2d_t1865246568 get__coordinate_4() const { return ____coordinate_4; } inline Vector2d_t1865246568 * get_address_of__coordinate_4() { return &____coordinate_4; } inline void set__coordinate_4(Vector2d_t1865246568 value) { ____coordinate_4 = value; } inline static int32_t get_offset_of__hasResponse_5() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ____hasResponse_5)); } inline bool get__hasResponse_5() const { return ____hasResponse_5; } inline bool* get_address_of__hasResponse_5() { return &____hasResponse_5; } inline void set__hasResponse_5(bool value) { ____hasResponse_5 = value; } inline static int32_t get_offset_of_U3CResponseU3Ek__BackingField_6() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ___U3CResponseU3Ek__BackingField_6)); } inline ForwardGeocodeResponse_t2959476828 * get_U3CResponseU3Ek__BackingField_6() const { return ___U3CResponseU3Ek__BackingField_6; } inline ForwardGeocodeResponse_t2959476828 ** get_address_of_U3CResponseU3Ek__BackingField_6() { return &___U3CResponseU3Ek__BackingField_6; } inline void set_U3CResponseU3Ek__BackingField_6(ForwardGeocodeResponse_t2959476828 * value) { ___U3CResponseU3Ek__BackingField_6 = value; Il2CppCodeGenWriteBarrier((&___U3CResponseU3Ek__BackingField_6), value); } inline static int32_t get_offset_of_OnGeocoderResponse_7() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ___OnGeocoderResponse_7)); } inline Action_1_t3131944423 * get_OnGeocoderResponse_7() const { return ___OnGeocoderResponse_7; } inline Action_1_t3131944423 ** get_address_of_OnGeocoderResponse_7() { return &___OnGeocoderResponse_7; } inline void set_OnGeocoderResponse_7(Action_1_t3131944423 * value) { ___OnGeocoderResponse_7 = value; Il2CppCodeGenWriteBarrier((&___OnGeocoderResponse_7), value); } }; struct ForwardGeocodeUserInput_t2575136032_StaticFields { public: // System.Action`1<Mapbox.Geocoding.ForwardGeocodeResponse> Mapbox.Examples.ForwardGeocodeUserInput::<>f__am$cache0 Action_1_t3131944423 * ___U3CU3Ef__amU24cache0_8; public: inline static int32_t get_offset_of_U3CU3Ef__amU24cache0_8() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032_StaticFields, ___U3CU3Ef__amU24cache0_8)); } inline Action_1_t3131944423 * get_U3CU3Ef__amU24cache0_8() const { return ___U3CU3Ef__amU24cache0_8; } inline Action_1_t3131944423 ** get_address_of_U3CU3Ef__amU24cache0_8() { return &___U3CU3Ef__amU24cache0_8; } inline void set_U3CU3Ef__amU24cache0_8(Action_1_t3131944423 * value) { ___U3CU3Ef__amU24cache0_8 = value; Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache0_8), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // FORWARDGEOCODEUSERINPUT_T2575136032_H #ifndef HIGHLIGHTFEATURE_T1851209614_H #define HIGHLIGHTFEATURE_T1851209614_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.HighlightFeature struct HighlightFeature_t1851209614 : public MonoBehaviour_t3962482529 { public: // System.Collections.Generic.List`1<UnityEngine.Material> Mapbox.Examples.HighlightFeature::_materials List_1_t1812449865 * ____materials_3; // UnityEngine.MeshRenderer Mapbox.Examples.HighlightFeature::_meshRenderer MeshRenderer_t587009260 * ____meshRenderer_4; public: inline static int32_t get_offset_of__materials_3() { return static_cast<int32_t>(offsetof(HighlightFeature_t1851209614, ____materials_3)); } inline List_1_t1812449865 * get__materials_3() const { return ____materials_3; } inline List_1_t1812449865 ** get_address_of__materials_3() { return &____materials_3; } inline void set__materials_3(List_1_t1812449865 * value) { ____materials_3 = value; Il2CppCodeGenWriteBarrier((&____materials_3), value); } inline static int32_t get_offset_of__meshRenderer_4() { return static_cast<int32_t>(offsetof(HighlightFeature_t1851209614, ____meshRenderer_4)); } inline MeshRenderer_t587009260 * get__meshRenderer_4() const { return ____meshRenderer_4; } inline MeshRenderer_t587009260 ** get_address_of__meshRenderer_4() { return &____meshRenderer_4; } inline void set__meshRenderer_4(MeshRenderer_t587009260 * value) { ____meshRenderer_4 = value; Il2CppCodeGenWriteBarrier((&____meshRenderer_4), value); } }; struct HighlightFeature_t1851209614_StaticFields { public: // UnityEngine.Material Mapbox.Examples.HighlightFeature::_highlightMaterial Material_t340375123 * ____highlightMaterial_2; public: inline static int32_t get_offset_of__highlightMaterial_2() { return static_cast<int32_t>(offsetof(HighlightFeature_t1851209614_StaticFields, ____highlightMaterial_2)); } inline Material_t340375123 * get__highlightMaterial_2() const { return ____highlightMaterial_2; } inline Material_t340375123 ** get_address_of__highlightMaterial_2() { return &____highlightMaterial_2; } inline void set__highlightMaterial_2(Material_t340375123 * value) { ____highlightMaterial_2 = value; Il2CppCodeGenWriteBarrier((&____highlightMaterial_2), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // HIGHLIGHTFEATURE_T1851209614_H #ifndef IMMEDIATEPOSITIONWITHLOCATIONPROVIDER_T789589409_H #define IMMEDIATEPOSITIONWITHLOCATIONPROVIDER_T789589409_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.ImmediatePositionWithLocationProvider struct ImmediatePositionWithLocationProvider_t789589409 : public MonoBehaviour_t3962482529 { public: // Mapbox.Unity.Map.AbstractMap Mapbox.Examples.ImmediatePositionWithLocationProvider::_map AbstractMap_t3082917158 * ____map_2; // System.Boolean Mapbox.Examples.ImmediatePositionWithLocationProvider::_isInitialized bool ____isInitialized_3; // Mapbox.Unity.Location.ILocationProvider Mapbox.Examples.ImmediatePositionWithLocationProvider::_locationProvider RuntimeObject* ____locationProvider_4; // UnityEngine.Vector3 Mapbox.Examples.ImmediatePositionWithLocationProvider::_targetPosition Vector3_t3722313464 ____targetPosition_5; public: inline static int32_t get_offset_of__map_2() { return static_cast<int32_t>(offsetof(ImmediatePositionWithLocationProvider_t789589409, ____map_2)); } inline AbstractMap_t3082917158 * get__map_2() const { return ____map_2; } inline AbstractMap_t3082917158 ** get_address_of__map_2() { return &____map_2; } inline void set__map_2(AbstractMap_t3082917158 * value) { ____map_2 = value; Il2CppCodeGenWriteBarrier((&____map_2), value); } inline static int32_t get_offset_of__isInitialized_3() { return static_cast<int32_t>(offsetof(ImmediatePositionWithLocationProvider_t789589409, ____isInitialized_3)); } inline bool get__isInitialized_3() const { return ____isInitialized_3; } inline bool* get_address_of__isInitialized_3() { return &____isInitialized_3; } inline void set__isInitialized_3(bool value) { ____isInitialized_3 = value; } inline static int32_t get_offset_of__locationProvider_4() { return static_cast<int32_t>(offsetof(ImmediatePositionWithLocationProvider_t789589409, ____locationProvider_4)); } inline RuntimeObject* get__locationProvider_4() const { return ____locationProvider_4; } inline RuntimeObject** get_address_of__locationProvider_4() { return &____locationProvider_4; } inline void set__locationProvider_4(RuntimeObject* value) { ____locationProvider_4 = value; Il2CppCodeGenWriteBarrier((&____locationProvider_4), value); } inline static int32_t get_offset_of__targetPosition_5() { return static_cast<int32_t>(offsetof(ImmediatePositionWithLocationProvider_t789589409, ____targetPosition_5)); } inline Vector3_t3722313464 get__targetPosition_5() const { return ____targetPosition_5; } inline Vector3_t3722313464 * get_address_of__targetPosition_5() { return &____targetPosition_5; } inline void set__targetPosition_5(Vector3_t3722313464 value) { ____targetPosition_5 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // IMMEDIATEPOSITIONWITHLOCATIONPROVIDER_T789589409_H #ifndef SPAWNONMAP_T234351174_H #define SPAWNONMAP_T234351174_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mapbox.Examples.SpawnOnMap struct SpawnOnMap_t234351174 : public MonoBehaviour_t3962482529 { public: // Mapbox.Unity.Map.AbstractMap Mapbox.Examples.SpawnOnMap::_map AbstractMap_t3082917158 * ____map_2; // System.String[] Mapbox.Examples.SpawnOnMap::_locationStrings StringU5BU5D_t1281789340* ____locationStrings_3; // Mapbox.Utils.Vector2d[] Mapbox.Examples.SpawnOnMap::_locations Vector2dU5BU5D_t852968953* ____locations_4; // System.Single Mapbox.Examples.SpawnOnMap::_spawnScale float ____spawnScale_5; // UnityEngine.GameObject Mapbox.Examples.SpawnOnMap::_markerPrefab GameObject_t1113636619 * ____markerPrefab_6; // System.Collections.Generic.List`1<UnityEngine.GameObject> Mapbox.Examples.SpawnOnMap::_spawnedObjects List_1_t2585711361 * ____spawnedObjects_7; public: inline static int32_t get_offset_of__map_2() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____map_2)); } inline AbstractMap_t3082917158 * get__map_2() const { return ____map_2; } inline AbstractMap_t3082917158 ** get_address_of__map_2() { return &____map_2; } inline void set__map_2(AbstractMap_t3082917158 * value) { ____map_2 = value; Il2CppCodeGenWriteBarrier((&____map_2), value); } inline static int32_t get_offset_of__locationStrings_3() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____locationStrings_3)); } inline StringU5BU5D_t1281789340* get__locationStrings_3() const { return ____locationStrings_3; } inline StringU5BU5D_t1281789340** get_address_of__locationStrings_3() { return &____locationStrings_3; } inline void set__locationStrings_3(StringU5BU5D_t1281789340* value) { ____locationStrings_3 = value; Il2CppCodeGenWriteBarrier((&____locationStrings_3), value); } inline static int32_t get_offset_of__locations_4() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____locations_4)); } inline Vector2dU5BU5D_t852968953* get__locations_4() const { return ____locations_4; } inline Vector2dU5BU5D_t852968953** get_address_of__locations_4() { return &____locations_4; } inline void set__locations_4(Vector2dU5BU5D_t852968953* value) { ____locations_4 = value; Il2CppCodeGenWriteBarrier((&____locations_4), value); } inline static int32_t get_offset_of__spawnScale_5() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____spawnScale_5)); } inline float get__spawnScale_5() const { return ____spawnScale_5; } inline float* get_address_of__spawnScale_5() { return &____spawnScale_5; } inline void set__spawnScale_5(float value) { ____spawnScale_5 = value; } inline static int32_t get_offset_of__markerPrefab_6() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____markerPrefab_6)); } inline GameObject_t1113636619 * get__markerPrefab_6() const { return ____markerPrefab_6; } inline GameObject_t1113636619 ** get_address_of__markerPrefab_6() { return &____markerPrefab_6; } inline void set__markerPrefab_6(GameObject_t1113636619 * value) { ____markerPrefab_6 = value; Il2CppCodeGenWriteBarrier((&____markerPrefab_6), value); } inline static int32_t get_offset_of__spawnedObjects_7() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____spawnedObjects_7)); } inline List_1_t2585711361 * get__spawnedObjects_7() const { return ____spawnedObjects_7; } inline List_1_t2585711361 ** get_address_of__spawnedObjects_7() { return &____spawnedObjects_7; } inline void set__spawnedObjects_7(List_1_t2585711361 * value) { ____spawnedObjects_7 = value; Il2CppCodeGenWriteBarrier((&____spawnedObjects_7), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SPAWNONMAP_T234351174_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3200 = { sizeof (Compression_t3624971113), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3201 = { sizeof (Constants_t3518929206), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3201[6] = { 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3202 = { sizeof (Vector2dBounds_t1974840945)+ sizeof (RuntimeObject), sizeof(Vector2dBounds_t1974840945 ), 0, 0 }; extern const int32_t g_FieldOffsetTable3202[2] = { Vector2dBounds_t1974840945::get_offset_of_SouthWest_0() + static_cast<int32_t>(sizeof(RuntimeObject)), Vector2dBounds_t1974840945::get_offset_of_NorthEast_1() + static_cast<int32_t>(sizeof(RuntimeObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3203 = { 0, 0, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3204 = { 0, 0, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3205 = { sizeof (BboxToVector2dBoundsConverter_t1118841236), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3206 = { sizeof (JsonConverters_t1015645604), -1, sizeof(JsonConverters_t1015645604_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable3206[1] = { JsonConverters_t1015645604_StaticFields::get_offset_of_converters_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3207 = { sizeof (LonLatToVector2dConverter_t2933574141), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3208 = { sizeof (PolylineToVector2dListConverter_t1416161534), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3209 = { sizeof (PolylineUtils_t2997409923), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3210 = { sizeof (UnixTimestampUtils_t2933311910), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3211 = { sizeof (Mathd_t279629051)+ sizeof (RuntimeObject), sizeof(Mathd_t279629051 ), 0, 0 }; extern const int32_t g_FieldOffsetTable3211[6] = { 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3212 = { sizeof (RectD_t151583371)+ sizeof (RuntimeObject), sizeof(RectD_t151583371 ), 0, 0 }; extern const int32_t g_FieldOffsetTable3212[4] = { RectD_t151583371::get_offset_of_U3CMinU3Ek__BackingField_0() + static_cast<int32_t>(sizeof(RuntimeObject)), RectD_t151583371::get_offset_of_U3CMaxU3Ek__BackingField_1() + static_cast<int32_t>(sizeof(RuntimeObject)), RectD_t151583371::get_offset_of_U3CSizeU3Ek__BackingField_2() + static_cast<int32_t>(sizeof(RuntimeObject)), RectD_t151583371::get_offset_of_U3CCenterU3Ek__BackingField_3() + static_cast<int32_t>(sizeof(RuntimeObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3213 = { sizeof (Vector2d_t1865246568)+ sizeof (RuntimeObject), sizeof(Vector2d_t1865246568 ), 0, 0 }; extern const int32_t g_FieldOffsetTable3213[3] = { 0, Vector2d_t1865246568::get_offset_of_x_1() + static_cast<int32_t>(sizeof(RuntimeObject)), Vector2d_t1865246568::get_offset_of_y_2() + static_cast<int32_t>(sizeof(RuntimeObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3214 = { sizeof (EnumExtensions_t2644584491), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3215 = { sizeof (VectorTileExtensions_t4243590528), -1, sizeof(VectorTileExtensions_t4243590528_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable3215[6] = { VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache0_0(), VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache1_1(), VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache2_2(), VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache3_3(), VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache4_4(), VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache5_5(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3216 = { sizeof (VectorTileFeatureExtensions_t4023769631), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3217 = { sizeof (U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3217[4] = { U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684::get_offset_of_zoom_0(), U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684::get_offset_of_tileColumn_1(), U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684::get_offset_of_tileRow_2(), U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684::get_offset_of_feature_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3218 = { sizeof (InternalClipper_t4127247543), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3219 = { sizeof (DoublePoint_t1607927371)+ sizeof (RuntimeObject), sizeof(DoublePoint_t1607927371 ), 0, 0 }; extern const int32_t g_FieldOffsetTable3219[2] = { DoublePoint_t1607927371::get_offset_of_X_0() + static_cast<int32_t>(sizeof(RuntimeObject)), DoublePoint_t1607927371::get_offset_of_Y_1() + static_cast<int32_t>(sizeof(RuntimeObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3220 = { sizeof (PolyTree_t3708317675), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3220[1] = { PolyTree_t3708317675::get_offset_of_m_AllPolys_7(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3221 = { sizeof (PolyNode_t1300984468), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3221[7] = { PolyNode_t1300984468::get_offset_of_m_Parent_0(), PolyNode_t1300984468::get_offset_of_m_polygon_1(), PolyNode_t1300984468::get_offset_of_m_Index_2(), PolyNode_t1300984468::get_offset_of_m_jointype_3(), PolyNode_t1300984468::get_offset_of_m_endtype_4(), PolyNode_t1300984468::get_offset_of_m_Childs_5(), PolyNode_t1300984468::get_offset_of_U3CIsOpenU3Ek__BackingField_6(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3222 = { sizeof (Int128_t2615162842)+ sizeof (RuntimeObject), sizeof(Int128_t2615162842 ), 0, 0 }; extern const int32_t g_FieldOffsetTable3222[2] = { Int128_t2615162842::get_offset_of_hi_0() + static_cast<int32_t>(sizeof(RuntimeObject)), Int128_t2615162842::get_offset_of_lo_1() + static_cast<int32_t>(sizeof(RuntimeObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3223 = { sizeof (IntPoint_t2327573135)+ sizeof (RuntimeObject), sizeof(IntPoint_t2327573135 ), 0, 0 }; extern const int32_t g_FieldOffsetTable3223[2] = { IntPoint_t2327573135::get_offset_of_X_0() + static_cast<int32_t>(sizeof(RuntimeObject)), IntPoint_t2327573135::get_offset_of_Y_1() + static_cast<int32_t>(sizeof(RuntimeObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3224 = { sizeof (IntRect_t752847524)+ sizeof (RuntimeObject), sizeof(IntRect_t752847524 ), 0, 0 }; extern const int32_t g_FieldOffsetTable3224[4] = { IntRect_t752847524::get_offset_of_left_0() + static_cast<int32_t>(sizeof(RuntimeObject)), IntRect_t752847524::get_offset_of_top_1() + static_cast<int32_t>(sizeof(RuntimeObject)), IntRect_t752847524::get_offset_of_right_2() + static_cast<int32_t>(sizeof(RuntimeObject)), IntRect_t752847524::get_offset_of_bottom_3() + static_cast<int32_t>(sizeof(RuntimeObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3225 = { sizeof (ClipType_t1616702040)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3225[5] = { ClipType_t1616702040::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3226 = { sizeof (PolyType_t1741373358)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3226[3] = { PolyType_t1741373358::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3227 = { sizeof (PolyFillType_t2091732334)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3227[5] = { PolyFillType_t2091732334::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3228 = { sizeof (JoinType_t3449044149)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3228[4] = { JoinType_t3449044149::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3229 = { sizeof (EndType_t3515135373)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3229[6] = { EndType_t3515135373::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3230 = { sizeof (EdgeSide_t2739901735)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3230[3] = { EdgeSide_t2739901735::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3231 = { sizeof (Direction_t4237952965)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3231[3] = { Direction_t4237952965::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3232 = { sizeof (TEdge_t1694054893), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3232[18] = { TEdge_t1694054893::get_offset_of_Bot_0(), TEdge_t1694054893::get_offset_of_Curr_1(), TEdge_t1694054893::get_offset_of_Top_2(), TEdge_t1694054893::get_offset_of_Delta_3(), TEdge_t1694054893::get_offset_of_Dx_4(), TEdge_t1694054893::get_offset_of_PolyTyp_5(), TEdge_t1694054893::get_offset_of_Side_6(), TEdge_t1694054893::get_offset_of_WindDelta_7(), TEdge_t1694054893::get_offset_of_WindCnt_8(), TEdge_t1694054893::get_offset_of_WindCnt2_9(), TEdge_t1694054893::get_offset_of_OutIdx_10(), TEdge_t1694054893::get_offset_of_Next_11(), TEdge_t1694054893::get_offset_of_Prev_12(), TEdge_t1694054893::get_offset_of_NextInLML_13(), TEdge_t1694054893::get_offset_of_NextInAEL_14(), TEdge_t1694054893::get_offset_of_PrevInAEL_15(), TEdge_t1694054893::get_offset_of_NextInSEL_16(), TEdge_t1694054893::get_offset_of_PrevInSEL_17(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3233 = { sizeof (IntersectNode_t3379514219), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3233[3] = { IntersectNode_t3379514219::get_offset_of_Edge1_0(), IntersectNode_t3379514219::get_offset_of_Edge2_1(), IntersectNode_t3379514219::get_offset_of_Pt_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3234 = { sizeof (MyIntersectNodeSort_t682547759), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3235 = { sizeof (LocalMinima_t86068969), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3235[4] = { LocalMinima_t86068969::get_offset_of_Y_0(), LocalMinima_t86068969::get_offset_of_LeftBound_1(), LocalMinima_t86068969::get_offset_of_RightBound_2(), LocalMinima_t86068969::get_offset_of_Next_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3236 = { sizeof (Scanbeam_t3952834741), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3236[2] = { Scanbeam_t3952834741::get_offset_of_Y_0(), Scanbeam_t3952834741::get_offset_of_Next_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3237 = { sizeof (Maxima_t4278896992), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3237[3] = { Maxima_t4278896992::get_offset_of_X_0(), Maxima_t4278896992::get_offset_of_Next_1(), Maxima_t4278896992::get_offset_of_Prev_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3238 = { sizeof (OutRec_t316877671), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3238[7] = { OutRec_t316877671::get_offset_of_Idx_0(), OutRec_t316877671::get_offset_of_IsHole_1(), OutRec_t316877671::get_offset_of_IsOpen_2(), OutRec_t316877671::get_offset_of_FirstLeft_3(), OutRec_t316877671::get_offset_of_Pts_4(), OutRec_t316877671::get_offset_of_BottomPt_5(), OutRec_t316877671::get_offset_of_PolyNode_6(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3239 = { sizeof (OutPt_t2591102706), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3239[4] = { OutPt_t2591102706::get_offset_of_Idx_0(), OutPt_t2591102706::get_offset_of_Pt_1(), OutPt_t2591102706::get_offset_of_Next_2(), OutPt_t2591102706::get_offset_of_Prev_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3240 = { sizeof (Join_t2349011362), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3240[3] = { Join_t2349011362::get_offset_of_OutPt1_0(), Join_t2349011362::get_offset_of_OutPt2_1(), Join_t2349011362::get_offset_of_OffPt_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3241 = { sizeof (ClipperBase_t2411222589), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3241[15] = { 0, 0, 0, 0, 0, 0, ClipperBase_t2411222589::get_offset_of_m_MinimaList_6(), ClipperBase_t2411222589::get_offset_of_m_CurrentLM_7(), ClipperBase_t2411222589::get_offset_of_m_edges_8(), ClipperBase_t2411222589::get_offset_of_m_Scanbeam_9(), ClipperBase_t2411222589::get_offset_of_m_PolyOuts_10(), ClipperBase_t2411222589::get_offset_of_m_ActiveEdges_11(), ClipperBase_t2411222589::get_offset_of_m_UseFullRange_12(), ClipperBase_t2411222589::get_offset_of_m_HasOpenPaths_13(), ClipperBase_t2411222589::get_offset_of_U3CPreserveCollinearU3Ek__BackingField_14(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3242 = { sizeof (Clipper_t4158555122), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3242[16] = { 0, 0, 0, Clipper_t4158555122::get_offset_of_m_ClipType_18(), Clipper_t4158555122::get_offset_of_m_Maxima_19(), Clipper_t4158555122::get_offset_of_m_SortedEdges_20(), Clipper_t4158555122::get_offset_of_m_IntersectList_21(), Clipper_t4158555122::get_offset_of_m_IntersectNodeComparer_22(), Clipper_t4158555122::get_offset_of_m_ExecuteLocked_23(), Clipper_t4158555122::get_offset_of_m_ClipFillType_24(), Clipper_t4158555122::get_offset_of_m_SubjFillType_25(), Clipper_t4158555122::get_offset_of_m_Joins_26(), Clipper_t4158555122::get_offset_of_m_GhostJoins_27(), Clipper_t4158555122::get_offset_of_m_UsingPolyTree_28(), Clipper_t4158555122::get_offset_of_U3CReverseSolutionU3Ek__BackingField_29(), Clipper_t4158555122::get_offset_of_U3CStrictlySimpleU3Ek__BackingField_30(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3243 = { sizeof (NodeType_t363087472)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3243[4] = { NodeType_t363087472::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3244 = { sizeof (ClipperOffset_t3668738110), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3244[16] = { ClipperOffset_t3668738110::get_offset_of_m_destPolys_0(), ClipperOffset_t3668738110::get_offset_of_m_srcPoly_1(), ClipperOffset_t3668738110::get_offset_of_m_destPoly_2(), ClipperOffset_t3668738110::get_offset_of_m_normals_3(), ClipperOffset_t3668738110::get_offset_of_m_delta_4(), ClipperOffset_t3668738110::get_offset_of_m_sinA_5(), ClipperOffset_t3668738110::get_offset_of_m_sin_6(), ClipperOffset_t3668738110::get_offset_of_m_cos_7(), ClipperOffset_t3668738110::get_offset_of_m_miterLim_8(), ClipperOffset_t3668738110::get_offset_of_m_StepsPerRad_9(), ClipperOffset_t3668738110::get_offset_of_m_lowest_10(), ClipperOffset_t3668738110::get_offset_of_m_polyNodes_11(), ClipperOffset_t3668738110::get_offset_of_U3CArcToleranceU3Ek__BackingField_12(), ClipperOffset_t3668738110::get_offset_of_U3CMiterLimitU3Ek__BackingField_13(), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3245 = { sizeof (ClipperException_t3118674656), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3246 = { sizeof (DecodeGeometry_t3735437420), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3247 = { sizeof (GeomType_t3056663235)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3247[5] = { GeomType_t3056663235::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3248 = { sizeof (LatLng_t1304626312)+ sizeof (RuntimeObject), sizeof(LatLng_t1304626312 ), 0, 0 }; extern const int32_t g_FieldOffsetTable3248[2] = { LatLng_t1304626312::get_offset_of_U3CLatU3Ek__BackingField_0() + static_cast<int32_t>(sizeof(RuntimeObject)), LatLng_t1304626312::get_offset_of_U3CLngU3Ek__BackingField_1() + static_cast<int32_t>(sizeof(RuntimeObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3249 = { 0, 0, 0, 0 }; extern const int32_t g_FieldOffsetTable3249[2] = { 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3250 = { sizeof (UtilGeom_t2066125609), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3251 = { sizeof (WireTypes_t1504741901)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3251[6] = { WireTypes_t1504741901::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3252 = { sizeof (Commands_t1803779524)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3252[4] = { Commands_t1803779524::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3253 = { sizeof (TileType_t3106966029)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3253[2] = { TileType_t3106966029::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3254 = { sizeof (LayerType_t1746409905)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3254[7] = { LayerType_t1746409905::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3255 = { sizeof (FeatureType_t2360609914)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3255[6] = { FeatureType_t2360609914::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3256 = { sizeof (ValueType_t2776630785)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable3256[8] = { ValueType_t2776630785::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)), 0, 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3257 = { sizeof (ConstantsAsDictionary_t107503724), -1, sizeof(ConstantsAsDictionary_t107503724_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable3257[4] = { ConstantsAsDictionary_t107503724_StaticFields::get_offset_of_TileType_0(), ConstantsAsDictionary_t107503724_StaticFields::get_offset_of_LayerType_1(), ConstantsAsDictionary_t107503724_StaticFields::get_offset_of_FeatureType_2(), ConstantsAsDictionary_t107503724_StaticFields::get_offset_of_GeomType_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3258 = { sizeof (PbfReader_t1662343237), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3258[6] = { PbfReader_t1662343237::get_offset_of_U3CTagU3Ek__BackingField_0(), PbfReader_t1662343237::get_offset_of_U3CValueU3Ek__BackingField_1(), PbfReader_t1662343237::get_offset_of_U3CWireTypeU3Ek__BackingField_2(), PbfReader_t1662343237::get_offset_of__buffer_3(), PbfReader_t1662343237::get_offset_of__length_4(), PbfReader_t1662343237::get_offset_of__pos_5(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3259 = { sizeof (VectorTile_t3467883484), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3259[1] = { VectorTile_t3467883484::get_offset_of__VTR_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3260 = { sizeof (VectorTileFeature_t4093669591), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3260[9] = { VectorTileFeature_t4093669591::get_offset_of__layer_0(), VectorTileFeature_t4093669591::get_offset_of__cachedGeometry_1(), VectorTileFeature_t4093669591::get_offset_of__clipBuffer_2(), VectorTileFeature_t4093669591::get_offset_of__scale_3(), VectorTileFeature_t4093669591::get_offset_of__previousScale_4(), VectorTileFeature_t4093669591::get_offset_of_U3CIdU3Ek__BackingField_5(), VectorTileFeature_t4093669591::get_offset_of_U3CGeometryTypeU3Ek__BackingField_6(), VectorTileFeature_t4093669591::get_offset_of_U3CGeometryCommandsU3Ek__BackingField_7(), VectorTileFeature_t4093669591::get_offset_of_U3CTagsU3Ek__BackingField_8(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3261 = { sizeof (VectorTileLayer_t873169949), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3261[7] = { VectorTileLayer_t873169949::get_offset_of_U3CDataU3Ek__BackingField_0(), VectorTileLayer_t873169949::get_offset_of_U3CNameU3Ek__BackingField_1(), VectorTileLayer_t873169949::get_offset_of_U3CVersionU3Ek__BackingField_2(), VectorTileLayer_t873169949::get_offset_of_U3CExtentU3Ek__BackingField_3(), VectorTileLayer_t873169949::get_offset_of_U3C_FeaturesDataU3Ek__BackingField_4(), VectorTileLayer_t873169949::get_offset_of_U3CValuesU3Ek__BackingField_5(), VectorTileLayer_t873169949::get_offset_of_U3CKeysU3Ek__BackingField_6(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3262 = { sizeof (VectorTileReader_t1753322980), -1, sizeof(VectorTileReader_t1753322980_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable3262[5] = { VectorTileReader_t1753322980::get_offset_of__Layers_0(), VectorTileReader_t1753322980::get_offset_of__Validate_1(), VectorTileReader_t1753322980_StaticFields::get_offset_of_U3CU3Ef__amU24cache0_2(), VectorTileReader_t1753322980_StaticFields::get_offset_of_U3CU3Ef__amU24cache1_3(), VectorTileReader_t1753322980_StaticFields::get_offset_of_U3CU3Ef__amU24cache2_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3263 = { sizeof (MapMatchingExample_t325328315), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3263[9] = { MapMatchingExample_t325328315::get_offset_of__map_2(), MapMatchingExample_t325328315::get_offset_of__originalRoute_3(), MapMatchingExample_t325328315::get_offset_of__mapMatchRoute_4(), MapMatchingExample_t325328315::get_offset_of__useTransformLocationProvider_5(), MapMatchingExample_t325328315::get_offset_of__profile_6(), MapMatchingExample_t325328315::get_offset_of__lineHeight_7(), MapMatchingExample_t325328315::get_offset_of__locations_8(), MapMatchingExample_t325328315::get_offset_of__mapMatcher_9(), MapMatchingExample_t325328315::get_offset_of__locationProvider_10(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3264 = { sizeof (PlotRoute_t1165660348), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3264[12] = { PlotRoute_t1165660348::get_offset_of__target_2(), PlotRoute_t1165660348::get_offset_of__color_3(), PlotRoute_t1165660348::get_offset_of__height_4(), PlotRoute_t1165660348::get_offset_of__lineWidth_5(), PlotRoute_t1165660348::get_offset_of__updateInterval_6(), PlotRoute_t1165660348::get_offset_of__minDistance_7(), PlotRoute_t1165660348::get_offset_of__lineRenderer_8(), PlotRoute_t1165660348::get_offset_of__elapsedTime_9(), PlotRoute_t1165660348::get_offset_of__currentIndex_10(), PlotRoute_t1165660348::get_offset_of__sqDistance_11(), PlotRoute_t1165660348::get_offset_of__lastPosition_12(), PlotRoute_t1165660348::get_offset_of__isStable_13(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3265 = { sizeof (TextureScale_t57896704), -1, sizeof(TextureScale_t57896704_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable3265[8] = { TextureScale_t57896704_StaticFields::get_offset_of_texColors_0(), TextureScale_t57896704_StaticFields::get_offset_of_newColors_1(), TextureScale_t57896704_StaticFields::get_offset_of_w_2(), TextureScale_t57896704_StaticFields::get_offset_of_ratioX_3(), TextureScale_t57896704_StaticFields::get_offset_of_ratioY_4(), TextureScale_t57896704_StaticFields::get_offset_of_w2_5(), TextureScale_t57896704_StaticFields::get_offset_of_finishCount_6(), TextureScale_t57896704_StaticFields::get_offset_of_mutex_7(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3266 = { sizeof (ThreadData_t1095464109), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3266[2] = { ThreadData_t1095464109::get_offset_of_start_0(), ThreadData_t1095464109::get_offset_of_end_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3267 = { sizeof (VoxelData_t2248882184), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3267[2] = { VoxelData_t2248882184::get_offset_of_Position_0(), VoxelData_t2248882184::get_offset_of_Prefab_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3268 = { sizeof (VoxelFetcher_t3713644963), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3268[1] = { VoxelFetcher_t3713644963::get_offset_of__voxels_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3269 = { sizeof (VoxelColorMapper_t2180346717), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3269[2] = { VoxelColorMapper_t2180346717::get_offset_of_Color_0(), VoxelColorMapper_t2180346717::get_offset_of_Voxel_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3270 = { sizeof (VoxelTile_t1944340880), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3270[17] = { VoxelTile_t1944340880::get_offset_of__geocodeInput_2(), VoxelTile_t1944340880::get_offset_of__zoom_3(), VoxelTile_t1944340880::get_offset_of__elevationMultiplier_4(), VoxelTile_t1944340880::get_offset_of__voxelDepthPadding_5(), VoxelTile_t1944340880::get_offset_of__tileWidthInVoxels_6(), VoxelTile_t1944340880::get_offset_of__voxelFetcher_7(), VoxelTile_t1944340880::get_offset_of__camera_8(), VoxelTile_t1944340880::get_offset_of__voxelBatchCount_9(), VoxelTile_t1944340880::get_offset_of__styleUrl_10(), VoxelTile_t1944340880::get_offset_of__raster_11(), VoxelTile_t1944340880::get_offset_of__elevation_12(), VoxelTile_t1944340880::get_offset_of__rasterTexture_13(), VoxelTile_t1944340880::get_offset_of__elevationTexture_14(), VoxelTile_t1944340880::get_offset_of__fileSource_15(), VoxelTile_t1944340880::get_offset_of__voxels_16(), VoxelTile_t1944340880::get_offset_of__instantiatedVoxels_17(), VoxelTile_t1944340880::get_offset_of__tileScale_18(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3271 = { sizeof (U3CBuildRoutineU3Ec__Iterator0_t1339467344), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3271[6] = { U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U3CdistanceOrderedVoxelsU3E__0_0(), U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U3CiU3E__1_1(), U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U24this_2(), U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U24current_3(), U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U24disposing_4(), U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U24PC_5(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3272 = { sizeof (SpawnOnMap_t234351174), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3272[6] = { SpawnOnMap_t234351174::get_offset_of__map_2(), SpawnOnMap_t234351174::get_offset_of__locationStrings_3(), SpawnOnMap_t234351174::get_offset_of__locations_4(), SpawnOnMap_t234351174::get_offset_of__spawnScale_5(), SpawnOnMap_t234351174::get_offset_of__markerPrefab_6(), SpawnOnMap_t234351174::get_offset_of__spawnedObjects_7(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3273 = { sizeof (DragRotate_t2912444650), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3273[3] = { DragRotate_t2912444650::get_offset_of__objectToRotate_2(), DragRotate_t2912444650::get_offset_of__multiplier_3(), DragRotate_t2912444650::get_offset_of__startTouchPosition_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3274 = { sizeof (SpawnOnGlobeExample_t1835218885), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3274[4] = { SpawnOnGlobeExample_t1835218885::get_offset_of__globeFactory_2(), SpawnOnGlobeExample_t1835218885::get_offset_of__locations_3(), SpawnOnGlobeExample_t1835218885::get_offset_of__spawnScale_4(), SpawnOnGlobeExample_t1835218885::get_offset_of__markerPrefab_5(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3275 = { sizeof (DirectionsExample_t2773998098), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3275[6] = { DirectionsExample_t2773998098::get_offset_of__resultsText_2(), DirectionsExample_t2773998098::get_offset_of__startLocationGeocoder_3(), DirectionsExample_t2773998098::get_offset_of__endLocationGeocoder_4(), DirectionsExample_t2773998098::get_offset_of__directions_5(), DirectionsExample_t2773998098::get_offset_of__coordinates_6(), DirectionsExample_t2773998098::get_offset_of__directionResource_7(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3276 = { sizeof (ForwardGeocoderExample_t595455162), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3276[2] = { ForwardGeocoderExample_t595455162::get_offset_of__searchLocation_2(), ForwardGeocoderExample_t595455162::get_offset_of__resultsText_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3277 = { sizeof (RasterTileExample_t3949613556), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3277[9] = { RasterTileExample_t3949613556::get_offset_of__searchLocation_2(), RasterTileExample_t3949613556::get_offset_of__zoomSlider_3(), RasterTileExample_t3949613556::get_offset_of__stylesDropdown_4(), RasterTileExample_t3949613556::get_offset_of__imageContainer_5(), RasterTileExample_t3949613556::get_offset_of__map_6(), RasterTileExample_t3949613556::get_offset_of__latLon_7(), RasterTileExample_t3949613556::get_offset_of__mapboxStyles_8(), RasterTileExample_t3949613556::get_offset_of__startLoc_9(), RasterTileExample_t3949613556::get_offset_of__mapstyle_10(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3278 = { sizeof (ReverseGeocoderExample_t1816435679), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3278[2] = { ReverseGeocoderExample_t1816435679::get_offset_of__searchLocation_2(), ReverseGeocoderExample_t1816435679::get_offset_of__resultsText_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3279 = { sizeof (VectorTileExample_t4002429299), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3279[3] = { VectorTileExample_t4002429299::get_offset_of__searchLocation_2(), VectorTileExample_t4002429299::get_offset_of__resultsText_3(), VectorTileExample_t4002429299::get_offset_of__map_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3280 = { sizeof (CameraBillboard_t2325764960), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3280[1] = { CameraBillboard_t2325764960::get_offset_of__camera_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3281 = { sizeof (CameraMovement_t3562026478), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3281[7] = { CameraMovement_t3562026478::get_offset_of__panSpeed_2(), CameraMovement_t3562026478::get_offset_of__zoomSpeed_3(), CameraMovement_t3562026478::get_offset_of__referenceCamera_4(), CameraMovement_t3562026478::get_offset_of__originalRotation_5(), CameraMovement_t3562026478::get_offset_of__origin_6(), CameraMovement_t3562026478::get_offset_of__delta_7(), CameraMovement_t3562026478::get_offset_of__shouldDrag_8(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3282 = { sizeof (ChangeShadowDistance_t4294610605), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3282[1] = { ChangeShadowDistance_t4294610605::get_offset_of_ShadowDistance_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3283 = { sizeof (FeatureSelectionDetector_t508482069), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3283[2] = { FeatureSelectionDetector_t508482069::get_offset_of__marker_2(), FeatureSelectionDetector_t508482069::get_offset_of__feature_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3284 = { sizeof (FeatureUiMarker_t3847499068), -1, sizeof(FeatureUiMarker_t3847499068_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable3284[6] = { FeatureUiMarker_t3847499068::get_offset_of__wrapperMarker_2(), FeatureUiMarker_t3847499068::get_offset_of__infoPanel_3(), FeatureUiMarker_t3847499068::get_offset_of__info_4(), FeatureUiMarker_t3847499068::get_offset_of__targetVerts_5(), FeatureUiMarker_t3847499068::get_offset_of__selectedFeature_6(), FeatureUiMarker_t3847499068_StaticFields::get_offset_of_U3CU3Ef__amU24cache0_7(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3285 = { sizeof (ForwardGeocodeUserInput_t2575136032), -1, sizeof(ForwardGeocodeUserInput_t2575136032_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable3285[7] = { ForwardGeocodeUserInput_t2575136032::get_offset_of__inputField_2(), ForwardGeocodeUserInput_t2575136032::get_offset_of__resource_3(), ForwardGeocodeUserInput_t2575136032::get_offset_of__coordinate_4(), ForwardGeocodeUserInput_t2575136032::get_offset_of__hasResponse_5(), ForwardGeocodeUserInput_t2575136032::get_offset_of_U3CResponseU3Ek__BackingField_6(), ForwardGeocodeUserInput_t2575136032::get_offset_of_OnGeocoderResponse_7(), ForwardGeocodeUserInput_t2575136032_StaticFields::get_offset_of_U3CU3Ef__amU24cache0_8(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3286 = { sizeof (HighlightFeature_t1851209614), -1, sizeof(HighlightFeature_t1851209614_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable3286[3] = { HighlightFeature_t1851209614_StaticFields::get_offset_of__highlightMaterial_2(), HighlightFeature_t1851209614::get_offset_of__materials_3(), HighlightFeature_t1851209614::get_offset_of__meshRenderer_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3287 = { sizeof (ImmediatePositionWithLocationProvider_t789589409), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3287[4] = { ImmediatePositionWithLocationProvider_t789589409::get_offset_of__map_2(), ImmediatePositionWithLocationProvider_t789589409::get_offset_of__isInitialized_3(), ImmediatePositionWithLocationProvider_t789589409::get_offset_of__locationProvider_4(), ImmediatePositionWithLocationProvider_t789589409::get_offset_of__targetPosition_5(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3288 = { sizeof (LabelTextSetter_t2340976267), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3288[1] = { LabelTextSetter_t2340976267::get_offset_of__textMesh_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3289 = { sizeof (LoadingPanelController_t2494933297), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3289[3] = { LoadingPanelController_t2494933297::get_offset_of__content_2(), LoadingPanelController_t2494933297::get_offset_of__text_3(), LoadingPanelController_t2494933297::get_offset_of__curve_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3290 = { sizeof (MakiHelper_t3260814930), -1, sizeof(MakiHelper_t3260814930_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable3290[3] = { MakiHelper_t3260814930_StaticFields::get_offset_of_Parent_2(), MakiHelper_t3260814930_StaticFields::get_offset_of_UiPrefab_3(), MakiHelper_t3260814930::get_offset_of__uiObject_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3291 = { sizeof (ObjectInspectorModifier_t3950592485), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3291[3] = { ObjectInspectorModifier_t3950592485::get_offset_of__detectors_3(), ObjectInspectorModifier_t3950592485::get_offset_of__marker_4(), ObjectInspectorModifier_t3950592485::get_offset_of__tempDetector_5(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3292 = { sizeof (PoiMarkerHelper_t575496201), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3292[1] = { PoiMarkerHelper_t575496201::get_offset_of__props_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3293 = { sizeof (PositionWithLocationProvider_t2078499108), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3293[6] = { PositionWithLocationProvider_t2078499108::get_offset_of__map_2(), PositionWithLocationProvider_t2078499108::get_offset_of__positionFollowFactor_3(), PositionWithLocationProvider_t2078499108::get_offset_of__useTransformLocationProvider_4(), PositionWithLocationProvider_t2078499108::get_offset_of__isInitialized_5(), PositionWithLocationProvider_t2078499108::get_offset_of__locationProvider_6(), PositionWithLocationProvider_t2078499108::get_offset_of__targetPosition_7(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3294 = { sizeof (QuadTreeCameraMovement_t4261193325), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3294[10] = { QuadTreeCameraMovement_t4261193325::get_offset_of__panSpeed_2(), QuadTreeCameraMovement_t4261193325::get_offset_of__zoomSpeed_3(), QuadTreeCameraMovement_t4261193325::get_offset_of__referenceCamera_4(), QuadTreeCameraMovement_t4261193325::get_offset_of__quadTreeTileProvider_5(), QuadTreeCameraMovement_t4261193325::get_offset_of__dynamicZoomMap_6(), QuadTreeCameraMovement_t4261193325::get_offset_of__useDegreeMethod_7(), QuadTreeCameraMovement_t4261193325::get_offset_of__origin_8(), QuadTreeCameraMovement_t4261193325::get_offset_of__mousePosition_9(), QuadTreeCameraMovement_t4261193325::get_offset_of__mousePositionPrevious_10(), QuadTreeCameraMovement_t4261193325::get_offset_of__shouldDrag_11(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3295 = { sizeof (ReloadMap_t3484436943), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3295[7] = { ReloadMap_t3484436943::get_offset_of__camera_2(), ReloadMap_t3484436943::get_offset_of__cameraStartPos_3(), ReloadMap_t3484436943::get_offset_of__map_4(), ReloadMap_t3484436943::get_offset_of__forwardGeocoder_5(), ReloadMap_t3484436943::get_offset_of__zoomSlider_6(), ReloadMap_t3484436943::get_offset_of__reloadRoutine_7(), ReloadMap_t3484436943::get_offset_of__wait_8(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3296 = { sizeof (U3CReloadAfterDelayU3Ec__Iterator0_t22183295), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3296[5] = { U3CReloadAfterDelayU3Ec__Iterator0_t22183295::get_offset_of_zoom_0(), U3CReloadAfterDelayU3Ec__Iterator0_t22183295::get_offset_of_U24this_1(), U3CReloadAfterDelayU3Ec__Iterator0_t22183295::get_offset_of_U24current_2(), U3CReloadAfterDelayU3Ec__Iterator0_t22183295::get_offset_of_U24disposing_3(), U3CReloadAfterDelayU3Ec__Iterator0_t22183295::get_offset_of_U24PC_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3297 = { sizeof (ReverseGeocodeUserInput_t2632079094), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3297[7] = { ReverseGeocodeUserInput_t2632079094::get_offset_of__inputField_2(), ReverseGeocodeUserInput_t2632079094::get_offset_of__resource_3(), ReverseGeocodeUserInput_t2632079094::get_offset_of__geocoder_4(), ReverseGeocodeUserInput_t2632079094::get_offset_of__coordinate_5(), ReverseGeocodeUserInput_t2632079094::get_offset_of__hasResponse_6(), ReverseGeocodeUserInput_t2632079094::get_offset_of_U3CResponseU3Ek__BackingField_7(), ReverseGeocodeUserInput_t2632079094::get_offset_of_OnGeocoderResponse_8(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3298 = { sizeof (RotateWithLocationProvider_t2777253481), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3298[6] = { RotateWithLocationProvider_t2777253481::get_offset_of__rotationFollowFactor_2(), RotateWithLocationProvider_t2777253481::get_offset_of__rotateZ_3(), RotateWithLocationProvider_t2777253481::get_offset_of__useTransformLocationProvider_4(), RotateWithLocationProvider_t2777253481::get_offset_of__targetRotation_5(), RotateWithLocationProvider_t2777253481::get_offset_of__locationProvider_6(), RotateWithLocationProvider_t2777253481::get_offset_of__targetPosition_7(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3299 = { sizeof (AbstractAlignmentStrategy_t2689440908), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable3299[1] = { AbstractAlignmentStrategy_t2689440908::get_offset_of__transform_2(), }; #ifdef __clang__ #pragma clang diagnostic pop #endif
42.982929
235
0.826043
bhuwanY-Hexaware
fad872c5b1f9c8a7ae1b0d394071b467f7adc244
1,757
cpp
C++
src/view/view2d/polylinepathitem.cpp
panzergame/dxfplotter
95393027903c8e907c1d1ef7b4982d1aadc968c8
[ "MIT" ]
19
2020-04-08T16:38:27.000Z
2022-03-30T19:53:18.000Z
src/view/view2d/polylinepathitem.cpp
panzergame/dxfplotter
95393027903c8e907c1d1ef7b4982d1aadc968c8
[ "MIT" ]
3
2020-10-27T05:50:37.000Z
2022-03-19T17:22:04.000Z
src/view/view2d/polylinepathitem.cpp
panzergame/dxfplotter
95393027903c8e907c1d1ef7b4982d1aadc968c8
[ "MIT" ]
6
2020-06-15T13:00:58.000Z
2022-02-09T13:18:04.000Z
#include <polylinepathitem.h> #include <bulgepainter.h> #include <QPainter> namespace View::View2d { QPainterPath PolylinePathItem::paintPath() const { const Geometry::Polyline &polyline = m_path.basePolyline(); QPainterPath painter(polyline.start().toPointF()); BulgePainter functor(painter); polyline.forEachBulge(functor); return painter; } QPainterPath PolylinePathItem::shapePath() const { QPainterPathStroker stroker; stroker.setWidth(0.05f); // TODO const or config stroker.setCapStyle(Qt::RoundCap); stroker.setJoinStyle(Qt::RoundJoin); return stroker.createStroke(m_paintPath); } void PolylinePathItem::updateOffsetedPath() { Model::OffsettedPath *offsettedPath = m_path.offsettedPath(); if (offsettedPath) { m_offsettedPath = std::make_unique<OffsettedPolylinePathItem>(*offsettedPath); // Link our offsetted path item for drawing m_offsettedPath->setParentItem(this); // TODO use QGraphicsItemGroup } else { m_offsettedPath.reset(); } } void PolylinePathItem::setSelected(bool selected) { BasicPathItem::setSelected(selected); if (m_offsettedPath) { m_offsettedPath->setSelected(selected); } } PolylinePathItem::PolylinePathItem(Model::Path &path) :BasicPathItem(path), m_paintPath(paintPath()), m_shapePath(shapePath()) { updateOffsetedPath(); connect(&path, &Model::Path::offsettedPathChanged, this, &PolylinePathItem::updateOffsetedPath); } void PolylinePathItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { BasicPathItem::paint(painter, option, widget); painter->drawPath(m_paintPath); } QPainterPath PolylinePathItem::shape() const { return m_shapePath; } QRectF PolylinePathItem::boundingRect() const { return m_shapePath.boundingRect(); } }
21.691358
104
0.770632
panzergame
fadb248fa46042378820936417a450d458cfa0d3
2,858
cpp
C++
yotta_modules/core-util/source/sbrk.cpp
lbk003/mbed-cortexm
a4fcb5de906a49a7fa737d6a89fcf5590aa68d31
[ "Apache-2.0" ]
null
null
null
yotta_modules/core-util/source/sbrk.cpp
lbk003/mbed-cortexm
a4fcb5de906a49a7fa737d6a89fcf5590aa68d31
[ "Apache-2.0" ]
null
null
null
yotta_modules/core-util/source/sbrk.cpp
lbk003/mbed-cortexm
a4fcb5de906a49a7fa737d6a89fcf5590aa68d31
[ "Apache-2.0" ]
null
null
null
/* mbed Microcontroller Library * Copyright (c) 2006-2013 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "core-util/atomic_ops.h" #include "core-util/sbrk.h" void * volatile mbed_krbs_ptr = MBED_KRBS_START; void * volatile mbed_sbrk_ptr = MBED_SBRK_START; volatile ptrdiff_t mbed_sbrk_diff = MBED_HEAP_SIZE; void * mbed_sbrk(ptrdiff_t size) { if (size == 0) { return (void *) mbed_sbrk_ptr; } ptrdiff_t size_internal = size; // Minimum increment only applies to positive sbrks if (size_internal > 0) { if ((uintptr_t)size_internal < SBRK_INC_MIN) { size_internal = SBRK_INC_MIN; } size_internal = ( size_internal + SBRK_ALIGN - 1) & ~(SBRK_ALIGN - 1); } /* Decrement mbed_sbrk_diff by the size being allocated. */ ptrdiff_t ptr_diff = mbed_sbrk_diff; while (1) { if (size_internal > ptr_diff) { return (void *) -1; } if (mbed::util::atomic_cas((uint32_t *)&mbed_sbrk_diff, (uint32_t *)&ptr_diff, (uint32_t)(ptr_diff - size_internal))) { break; } } uintptr_t new_sbrk_ptr = mbed::util::atomic_incr((uint32_t *)&mbed_sbrk_ptr, (uint32_t)size_internal); return (void *)(new_sbrk_ptr - size_internal); } void * mbed_krbs(const ptrdiff_t size) { return mbed_krbs_ex(size, NULL); } void * mbed_krbs_ex(const ptrdiff_t size, ptrdiff_t *actual) { if (size == 0) { return (void *) mbed_krbs_ptr; } // krbs does not support deallocation. if (size < 0) { return (void *) -1; } uintptr_t size_internal = (uintptr_t)size; // Guarantee minimum allocation size if (size_internal < KRBS_INC_MIN) { size_internal = KRBS_INC_MIN; } size_internal = (size_internal + KRBS_ALIGN - 1) & ~(KRBS_ALIGN - 1); /* Decrement mbed_sbrk_diff by the size being allocated. */ ptrdiff_t ptr_diff = mbed_sbrk_diff; while (1) { if ((size_internal > (uintptr_t)ptr_diff) && (actual == NULL)) { return (void *) -1; } if (mbed::util::atomic_cas((uint32_t *)&mbed_sbrk_diff, (uint32_t *)&ptr_diff, (uint32_t)(ptr_diff - size_internal))) { break; } } return (void *)mbed::util::atomic_decr((uint32_t *)&mbed_krbs_ptr, (uint32_t)size_internal); }
32.11236
127
0.652204
lbk003
fadb55b9cc81be894247c5eaaae33c2792389608
460
cpp
C++
720. Longest Word in Dictionary.cpp
rajeev-ranjan-au6/Leetcode_Cpp
f64cd98ab96ec110f1c21393f418acf7d88473e8
[ "MIT" ]
3
2020-12-30T00:29:59.000Z
2021-01-24T22:43:04.000Z
720. Longest Word in Dictionary.cpp
rajeevranjancom/Leetcode_Cpp
f64cd98ab96ec110f1c21393f418acf7d88473e8
[ "MIT" ]
null
null
null
720. Longest Word in Dictionary.cpp
rajeevranjancom/Leetcode_Cpp
f64cd98ab96ec110f1c21393f418acf7d88473e8
[ "MIT" ]
null
null
null
class Solution { public: string longestWord(vector<string>& words) { string res = ""; unordered_map<int, unordered_set<string>>m; for(auto s: words) m[s.size()].insert(s); for(auto s: words){ int i = 1; while(i < s.size() && m[i].count(s.substr(0, i))) i++; if(i == s.size() && s.size() >= res.size()) res = s.size() > res.size() ? s : min(s, res); } return res; } };
30.666667
102
0.482609
rajeev-ranjan-au6
fadb985dbc23fb7e6b54f8c12c427d8f939f8ee2
561
hpp
C++
src/standard/bits/DD_IsEnum.hpp
iDingDong/libDDCPP-old
841260fecc84330ff3bfffba7263f5318f0b4655
[ "BSD-3-Clause" ]
1
2018-06-01T03:29:34.000Z
2018-06-01T03:29:34.000Z
src/standard/bits/DD_IsEnum.hpp
iDingDong/libDDCPP-old
841260fecc84330ff3bfffba7263f5318f0b4655
[ "BSD-3-Clause" ]
null
null
null
src/standard/bits/DD_IsEnum.hpp
iDingDong/libDDCPP-old
841260fecc84330ff3bfffba7263f5318f0b4655
[ "BSD-3-Clause" ]
null
null
null
// DDCPP/standard/bits/DD_IsEnum.hpp #ifndef DD_IS_ENUM_HPP_INCLUDED_ # define DD_IS_ENUM_HPP_INCLUDED_ 1 # if __cplusplus < 201103L # error ISO/IEC 14882:2011 or a later version support is required for'DD::IsEnum'. # endif # include <type_traits> # include "DD_And.hpp" DD_DETAIL_BEGIN_ template <typename... ObjectsT_> struct IsEnum : AndType<IsEnum<ObjectsT_>...> { }; template <typename ObjectT_> struct IsEnum<ObjectT_> : StdBoolConstant<std::is_enum<ObjectT_>> { }; DD_DETAIL_END_ DD_BEGIN_ using detail_::IsEnum; DD_END_ #endif
12.195652
83
0.743316
iDingDong
fadfcaec11730498729318661eb1452370c87d69
1,140
cpp
C++
examples/syntax/fp-values-in-string-assembly.using-specific-headers.cpp
alf-p-steinbach/cppx-core-language
930351fe0df65e231e8e91998f1c94d345938107
[ "MIT" ]
3
2020-05-24T16:29:42.000Z
2021-09-10T13:33:15.000Z
examples/syntax/fp-values-in-string-assembly.using-specific-headers.cpp
alf-p-steinbach/cppx-core-language
930351fe0df65e231e8e91998f1c94d345938107
[ "MIT" ]
null
null
null
examples/syntax/fp-values-in-string-assembly.using-specific-headers.cpp
alf-p-steinbach/cppx-core-language
930351fe0df65e231e8e91998f1c94d345938107
[ "MIT" ]
null
null
null
#include <cppx-core-language/calc/floating-point-operations.hpp> // cppx::intpow #include <cppx-core-language/calc/named-numbers.hpp> // cppx::m::pi #include <cppx-core-language/calc/number-type-properties.hpp> // cppx::n_digits_ #include <cppx-core-language/syntax/types.hpp> // cppx::Sequence #include <cppx-core-language/syntax/string-expressions.hpp> // cppx::syntax::* #include <c/stdio.hpp> #include <string> $use_std( string ); void say( const string& s ) { printf( "%s\n", s.c_str() ); } auto main() -> int { $use_cppx( intpow, m::pi, n_digits_, spaces, Sequence ); using namespace cppx::syntax; // "<<", spaces const int max_decimals = n_digits_<double> - 1; say( "Pi is roughly "s << pi << ", or thereabouts." ); say( "More precisely it's "s << fp::fix( pi, max_decimals ) << ", and so on." ); say( "" ); for( const int n: Sequence( 0, max_decimals ) ) { const double c = intpow( 10, n ); const int n_spaces = 30 - n + (n == 0); say( ""s << fp::fix( pi, n ) << spaces( n_spaces ) << fp::sci( c*pi ) ); } }
38
86
0.581579
alf-p-steinbach
fae164a1977e871c3a0651c73abedf09fde1bacd
1,094
cpp
C++
elenasrc2/ide/historylist.cpp
drkameleon/elena-lang
8585e93a3bc0b19f8d60029ffbe01311d0b711a3
[ "MIT" ]
193
2015-07-03T22:23:27.000Z
2022-03-15T18:56:02.000Z
elenasrc2/ide/historylist.cpp
drkameleon/elena-lang
8585e93a3bc0b19f8d60029ffbe01311d0b711a3
[ "MIT" ]
531
2015-05-07T09:39:42.000Z
2021-09-27T07:51:38.000Z
elenasrc2/ide/historylist.cpp
drkameleon/elena-lang
8585e93a3bc0b19f8d60029ffbe01311d0b711a3
[ "MIT" ]
31
2015-09-30T13:07:36.000Z
2021-10-15T13:08:04.000Z
//--------------------------------------------------------------------------- // E L E N A P r o j e c t: ELENA IDE // MenuHistoryList class implementation // (C)2005-2018, by Alexei Rakov //--------------------------------------------------------------------------- #include "historylist.h" #include "elena.h" using namespace _GUI_; using namespace _ELENA_; RecentList :: RecentList(int maxCount, int menuBaseId) : MenuHistoryList(maxCount, menuBaseId, true) { } void RecentList :: load(XmlConfigFile& file, const char* section) { _ConfigFile::Nodes nodes; file.select(section, nodes); for (auto it = nodes.start(); !it.Eof(); it++) { _list.add(text_str(TextString((*it).Content())).clone()); } } void RecentList :: save(XmlConfigFile& file, const char* section) { //file.clear(section); for(List<text_c*>::Iterator it = _list.start() ; !it.Eof() ; it++) { IdentifierString value(*it); // config.setSetting(section, it.key(), value); file.appendSetting(section, value.c_str()); } }
28.789474
77
0.535649
drkameleon